// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: s7_make_function_star
s7_pointer s7_make_function_star(s7_scheme *sc, const char *name, s7_function fnc, const char *arglist, const char *doc)
                {
                    s7_pointer func, local_args, p;
                    char *internal_arglist;
                    s7_int i, len, n_args;
                    s7_int gc_loc;
                    s7_pointer *names, *defaults;
                    block_t *b;

                    len = safe_strlen(arglist) + 8;
                    b = mallocate(sc, len);
                    internal_arglist = (char *)block_data(b);
                    catstrs_direct(internal_arglist, "'(", arglist, ")", NULL);
                    local_args = s7_eval_c_string(sc, internal_arglist);
                    gc_loc = s7_gc_protect_1(sc, local_args);
                    liberate(sc, b);
                    n_args = safe_list_length(local_args);  /* currently rest arg not supported, and we don't notice :allow-other-keys etc */

                    func = s7_make_function(sc, name, fnc, 0, n_args, false, doc);
                    set_type(func, T_C_FUNCTION_STAR | T_UNHEAP); /* unheap from s7_make_function */
                    c_function_call_args(func) = NULL;

                    names = (s7_pointer *)malloc(n_args * sizeof(s7_pointer));
                    c_function_arg_names(func) = names;
                    defaults = (s7_pointer *)malloc(n_args * sizeof(s7_pointer));
                    c_function_arg_defaults(func) = defaults;
                    c_func_set_simple_defaults(func);

                    for (p = local_args, i = 0; i < n_args; p = cdr(p), i++)
                    {
                        s7_pointer arg;
                        arg = car(p);
                        if (is_pair(arg)) /* there is a default */
                        {
                            names[i] = symbol_to_keyword(sc, car(arg));
                            defaults[i] = cadr(arg);
                            s7_remove_from_heap(sc, cadr(arg));
                            if ((is_pair(defaults[i])) ||
                                    (is_normal_symbol(defaults[i])))
                            {
                                c_func_clear_simple_defaults(func);
                                mark_function[T_C_FUNCTION_STAR] = mark_c_proc_star;
                            }
                        }
                        else
                        {
                            names[i] = symbol_to_keyword(sc, arg);
                            defaults[i] = sc->F;
                        }
                    }
                    s7_gc_unprotect_at(sc, gc_loc);
                    return(func);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x10(%rsp)
movq %rcx, %r14
movq %rdx, 0x18(%rsp)
movq %rsi, %rbp
movq %rdi, %rbx
movq %rcx, %rdi
callq 0x8d06
leaq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x9037
movq %rax, %r13
movq (%rax), %r15
leaq 0xb52e3(%rip), %rsi     # 0xe6514
leaq 0xb726a(%rip), %rcx     # 0xe84a2
xorl %r12d, %r12d
movq %r15, %rdi
movq %r14, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xb3a5
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2af27
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x89a9
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x9439
movq %r14, %rdi
callq 0x313be
movq %rax, %r13
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
movq 0x18(%rsp), %rdx
xorl %ecx, %ecx
movq %r13, %r8
xorl %r9d, %r9d
callq 0x30d36
movq %rax, %rbp
movabsq $0x400000000000002f, %rax # imm = 0x400000000000002F
movq %rax, (%rbp)
movq 0x8(%rbp), %rax
andq $0x0, 0x60(%rax)
leaq (,%r13,8), %r15
movq %r15, %rdi
callq 0x8480
movq 0x8(%rbp), %rcx
movq %rax, 0x18(%rsp)
movq %rax, 0x58(%rcx)
movq %r15, %rdi
callq 0x8480
movq %rax, %r15
movq 0x8(%rbp), %rax
movq %r15, 0x50(%rax)
movq %rbp, 0x10(%rsp)
orb $0x4, 0x2(%rbp)
testq %r13, %r13
cmovleq %r12, %r13
movq %r13, %rbp
cmpq %r12, %rbp
je 0x3139d
movq 0x8(%r14), %r13
cmpb $0x1, (%r13)
jne 0x31372
movq 0x8(%r13), %rsi
movq %rbx, %rdi
callq 0x313cf
movq 0x18(%rsp), %rcx
movq %rax, (%rcx,%r12,8)
movq 0x10(%r13), %rax
movq 0x8(%rax), %rax
movq %rax, (%r15,%r12,8)
movq 0x10(%r13), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x9897
movq (%r15,%r12,8), %rax
movzbl (%rax), %ecx
cmpl $0x1, %ecx
je 0x31359
cmpl $0xa, %ecx
jne 0x31391
testb $-0x80, 0x6(%rax)
jne 0x31391
movq 0x10(%rsp), %rax
andb $-0x5, 0x2(%rax)
leaq 0x73(%rip), %rax        # 0x313dc
movq %rax, 0xe4578(%rip)     # 0x1158e8
jmp 0x31391
movq %rbx, %rdi
movq %r13, %rsi
callq 0x313cf
movq 0x18(%rsp), %rcx
movq %rax, (%rcx,%r12,8)
movq 0x120(%rbx), %rax
movq %rax, (%r15,%r12,8)
movq 0x10(%r14), %r14
incq %r12
jmp 0x312fd
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0x8b00
movq 0x10(%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq