// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: make_function
static s7_pointer make_function(s7_scheme *sc, const char *name, s7_function f, s7_int req, s7_int opt, bool rst, const char *doc, s7_pointer x, c_proc_t *ptr)
                {
                    uint32_t ftype = T_C_FUNCTION;
                    if (req == 0)
                    {
                        if (rst)
                            ftype = T_C_ANY_ARGS_FUNCTION;
                        else
                        {
                            if (opt != 0)
                                ftype = T_C_OPT_ARGS_FUNCTION;
                        }
                    }
                    else
                    {
                        if (rst)
                            ftype = T_C_RST_ARGS_FUNCTION;
                    }

                    set_type(x, ftype);

                    c_function_data(x) = ptr;
                    c_function_call(x) = f;               /* f is T_App but needs cast */
                    c_function_set_base(x, x);
                    c_function_set_setter(x, sc->F);
                    c_function_name(x) = name;            /* (procedure-name proc) => (format #f "~A" proc) */
                    c_function_name_length(x) = safe_strlen(name);
                    if (doc)
                        c_function_documentation(x) = make_permanent_c_string(sc, doc);
                    else c_function_documentation(x) = NULL;
                    c_function_signature(x) = sc->F;

                    c_function_required_args(x) = req;
                    c_function_optional_args(x) = opt;    /* T_C_FUNCTION_STAR type may be set later, so T_Fst not usable here */
                    if (rst)
                        c_function_all_args(x) = MAX_ARITY;
                    else c_function_all_args(x) = req + opt;

                    c_function_class(x) = ++sc->f_class;
                    c_function_chooser(x) = fallback_chooser;
                    c_function_opt_data(x) = NULL;
                    c_function_marker(x) = NULL;
                    c_function_symbol(x) = NULL;

                    return(x);
                }

// Assembly:
subq $0x38, %rsp
movb %r9b, %al
movq 0x50(%rsp), %r9
movq 0x48(%rsp), %r9
movq 0x40(%rsp), %r9
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %r8, 0x10(%rsp)
andb $0x1, %al
movb %al, 0xf(%rsp)
movl $0x30, 0x8(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x3948a
testb $0x1, 0xf(%rsp)
je 0x39476
movl $0x31, 0x8(%rsp)
jmp 0x39488
cmpq $0x0, 0x10(%rsp)
je 0x39486
movl $0x32, 0x8(%rsp)
jmp 0x39488
jmp 0x3949b
testb $0x1, 0xf(%rsp)
je 0x39499
movl $0x33, 0x8(%rsp)
jmp 0x3949b
movl 0x8(%rsp), %eax
movl %eax, %ecx
movq 0x48(%rsp), %rax
movq %rcx, (%rax)
movq 0x50(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x20(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x48(%rsp), %rcx
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x28(%rax)
movq 0x30(%rsp), %rax
movq 0x120(%rax), %rcx
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x30(%rax)
movq 0x28(%rsp), %rcx
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rdi
callq 0xa430
movl %eax, %ecx
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movl %ecx, 0x8(%rax)
cmpq $0x0, 0x40(%rsp)
je 0x39542
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xd9700
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x10(%rax)
jmp 0x39553
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq $0x0, 0x10(%rax)
movq 0x30(%rsp), %rax
movq 0x120(%rax), %rcx
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x38(%rax)
movq 0x18(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x10(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x20(%rax)
testb $0x1, 0xf(%rsp)
je 0x3959e
movq 0x48(%rsp), %rax
movq $0x20000000, 0x28(%rax) # imm = 0x20000000
jmp 0x395b1
movq 0x18(%rsp), %rcx
addq 0x10(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x30(%rsp), %rax
movl 0x224(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x224(%rax)
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movl %ecx, 0xc(%rax)
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
leaq 0xa018f(%rip), %rcx     # 0xd9770
movq %rcx, 0x48(%rax)
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq $0x0, 0x20(%rax)
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq $0x0, 0x60(%rax)
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq $0x0, 0x58(%rax)
movq 0x48(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)