    /**
     * {{ ep_method }}.
     * Invokes C FFI: {{ ffi_prefix }}_{{ service_snake }}_ep_{{ ep_method_snake }}
     */
    public {{ return_type }} {{ ep_method }}({{ params_signature }}) {
        try {
            MemorySegment epAddr = LOOKUP.find("{{ ffi_prefix }}_{{ service_snake }}_ep_{{ ep_method_snake }}")
                .or(() -> LOOKUP.find("_{{ ffi_prefix }}_{{ service_snake }}_ep_{{ ep_method_snake }}"))
                .orElseThrow();
            FunctionDescriptor epDesc = FunctionDescriptor.of(
{{ return_layout }}                ValueLayout.ADDRESS       // owner: *mut opaque
{% for layout in descriptor_layouts %}
                , {{ layout.0 }}    // {{ layout.1 }} param
{% endfor %}            );
            MethodHandle epHandle = LINKER.downcallHandle(epAddr, epDesc);
            {% if return_type == "void" %}epHandle.invoke(ownerHandle{% else %}return (long) epHandle.invoke(ownerHandle{% endif %}
{% for arg in invoke_args %}
                , {{ arg }}
{% endfor %}            );

        } catch (Throwable e) {
            throw new RuntimeException("Failed to invoke entrypoint", e);
        }
    }
