// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: g_procedure_source
static s7_pointer g_procedure_source(s7_scheme *sc, s7_pointer args)
                {
                    /* make it look like a scheme-level lambda */
                    s7_pointer p;
#define H_procedure_source "(procedure-source func) tries to return the definition of func"
#define Q_procedure_source s7_make_signature(sc, 2, sc->is_list_symbol, s7_make_signature(sc, 2, sc->is_procedure_symbol, sc->is_macro_symbol))

                    p = car(args);
                    if (is_symbol(p))
                    {
                        p = s7_symbol_value(sc, p);
                        if (p == sc->undefined)
                            return(s7_error(sc, sc->wrong_type_arg_symbol,
                                        set_elist_2(sc, wrap_string(sc, "procedure-source arg, '~S, is unbound", 37), p)));
                    }

                    if ((is_c_function(p)) || (is_c_macro(p)))
                        return(sc->nil);

                    check_method_uncopied(sc, p, sc->procedure_source_symbol, list_1(sc, p));
                    if (has_closure_let(p))
                    {
                        s7_pointer body;
                        body = closure_body(p);
                        /* perhaps if this function has been removed from the heap, it would be better to use copy_body (as in s7_copy)? */
                        if (is_safe_closure_body(body))
                            clear_safe_closure_body(body);
                        return(append_in_place(sc,
                                    list_2(sc, ((is_closure_star(p)) || (is_macro_star(p)) || (is_bacro_star(p))) ? sc->lambda_star_symbol : sc->lambda_symbol, closure_args(p)),
                                    body));
                    }

                    if (!is_procedure(p))
                        return(simple_wrong_type_argument_with_type(sc, sc->procedure_source_symbol, p,
                                    wrap_string(sc, "a procedure or a macro", 22)));
                    return(sc->nil);
                }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rsi), %r14
movb (%r14), %al
cmpb $0xa, %al
jne 0x66265
movq %rbx, %rdi
movq %r14, %rsi
callq 0x94b4
movq %rax, %r14
cmpq 0x128(%rbx), %rax
je 0x663e9
movb (%r14), %al
cmpb $0x30, %al
setb %cl
cmpb $0x2e, %al
setne %al
testb %al, %cl
jne 0x6627f
movq 0x110(%rbx), %r15
jmp 0x6644c
movq (%r14), %r12
btl $0x1e, %r12d
jae 0x6631b
cmpb $0x1, 0x24c(%rbx)
jne 0x6631b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x88f3
movq 0x1408(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x888f
cmpq 0x128(%rbx), %rax
je 0x6631b
movq %rax, %r15
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r12
cmpq 0x98(%rbx), %rax
ja 0x662e9
movq %rbx, %rdi
callq 0x9c27
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rdx
movq $0x200001, (%rdx)       # imm = 0x200001
movq %r14, 0x8(%rdx)
movq %r12, 0x10(%rdx)
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xa34c
movzbl %r12b, %eax
leaq 0xaf5ea(%rip), %rcx     # 0x115910
cmpb $0x1, (%rax,%rcx)
jne 0x66459
movq 0x10(%r14), %r15
movl (%r15), %eax
btl $0xc, %eax
jae 0x66349
andl $0xefff, %eax           # imm = 0xEFFF
movw %ax, (%r15)
movb (%r14), %r12b
addb $-0x29, %r12b
movl $0x1798, %eax           # imm = 0x1798
cmpb $0x4, %r12b
ja 0x66367
movzbl %r12b, %eax
leaq 0x6fb15(%rip), %rcx     # 0xd5e78
movq (%rcx,%rax,8), %rax
movq (%rbx,%rax), %r12
movq 0x8(%r14), %r14
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r13
cmpq 0x98(%rbx), %rax
ja 0x66395
movq %rbx, %rdi
callq 0x9c27
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movl $0x200001, %ecx         # imm = 0x200001
movq %rcx, (%rax)
movq %r14, 0x8(%rax)
movq %r13, 0x10(%rax)
movq 0x90(%rbx), %rdx
leaq -0x8(%rdx), %rsi
movq %rsi, 0x90(%rbx)
movq -0x8(%rdx), %rsi
movq %rcx, (%rsi)
movq %r12, 0x8(%rsi)
movq %rax, 0x10(%rsi)
movq %rbx, %rdi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xa9c37
movq 0x1940(%rbx), %r15
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rcx
movq (%rax,%rcx,8), %rax
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x7dc(%rbx)
leaq 0x81a2f(%rip), %rcx     # 0xe7e43
movq %rcx, 0x10(%rax)
movq $0x25, 0x8(%rax)
movq 0x6e0(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x6e0(%rbx), %rax
movq 0x10(%rax), %rax
movq %r14, 0x8(%rax)
movq 0x6e0(%rbx), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2cdc0
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0xb4ed0(%rip), %rcx     # 0x11b330
cmpb $0x0, (%rax,%rcx)
jne 0x66273
cmpb $0x14, %r12b
sete %al
shrl $0x15, %r12d
andl $0x1, %r12d
testb %r12b, %al
jne 0x66273
movq 0x1408(%rbx), %rax
movq 0x8(%rax), %rsi
movq 0x140(%rbx), %rcx
movq 0x820(%rbx), %rax
movslq 0x7dc(%rbx), %rdx
movq (%rax,%rdx,8), %r8
leal 0x1(%rdx), %eax
andl $0x7, %eax
movl %eax, 0x7dc(%rbx)
leaq 0x819b0(%rip), %rax     # 0xe7e69
movq %rax, 0x10(%r8)
movq $0x16, 0x8(%r8)
movq %rbx, %rdi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xd456