// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
movq %r8, 0x70(%rsp)
movq 0x78(%rsp), %rdi
callq 0xa430
addq $0x8, %rax
movq %rax, 0x40(%rsp)
movq 0x90(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xaa80
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
movq 0x78(%rsp), %rdx
leaq 0x1b86d9(%rip), %rsi    # 0x1f249a
leaq 0x1ba725(%rip), %rcx    # 0x1f44ed
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x10540
movq 0x90(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x2b910
movq %rax, 0x60(%rsp)
movq 0x90(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x9cb0
movq %rax, 0x30(%rsp)
movq 0x90(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xb230
movq 0x60(%rsp), %rdi
callq 0x3a070
movq %rax, 0x38(%rsp)
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x38(%rsp), %r8
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
xorl %r9d, %r9d
movq %rax, (%rsp)
callq 0x39300
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
movabsq $0x400000000000002f, %rcx # imm = 0x400000000000002F
movq %rcx, (%rax)
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq $0x0, 0x60(%rax)
movq 0x38(%rsp), %rdi
shlq $0x3, %rdi
callq 0x9480
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rcx
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x58(%rax)
movq 0x38(%rsp), %rdi
shlq $0x3, %rdi
callq 0x9480
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rcx
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x50(%rax)
movq 0x68(%rsp), %rax
movq (%rax), %rcx
orq $0x40000, %rcx          # imm = 0x40000
movq %rcx, (%rax)
movq 0x60(%rsp), %rax
movq %rax, 0x58(%rsp)
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x38(%rsp), %rax
jge 0x3a042
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x39fdf
movq 0x90(%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x3a0c0
movq %rax, %rdx
movq 0x28(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdx
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x90(%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
callq 0xbbd0
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0x39fbd
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movzbl (%rax), %eax
cmpl $0xa, %eax
jne 0x39fdd
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movzwl 0x6(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x39fdd
movq 0x68(%rsp), %rax
movq (%rax), %rcx
andq $-0x40001, %rcx         # imm = 0xFFFBFFFF
movq %rcx, (%rax)
leaq 0x11a(%rip), %rax       # 0x3a0f0
movq %rax, 0x1dc43b(%rip)    # 0x216418
jmp 0x3a01f
movq 0x90(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x3a0c0
movq %rax, %rdx
movq 0x28(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x90(%rsp), %rax
movq 0x120(%rax), %rdx
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x3a021
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x39eea
movq 0x90(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x9f60
movq 0x68(%rsp), %rax
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)