// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rsi), %r14
cmpb $0xa, (%r14)
jne 0x8554b
movq %rbx, %rdi
movq %r14, %rsi
callq 0xaa24
movq %rax, %r14
cmpq 0x128(%rbx), %rax
je 0x856e3
movb (%r14), %al
cmpb $0x30, %al
setb %cl
cmpb $0x2e, %al
setne %al
testb %al, %cl
jne 0x85568
movq 0x110(%rbx), %r15
jmp 0x85746
movb $0x1, %bpl
testb $0x40, 0x3(%r14)
je 0x855fe
cmpb $0x1, 0x24c(%rbx)
jne 0x855fe
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9a55
movq 0x1408(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x99ef
cmpq 0x128(%rbx), %rax
je 0x855fe
movq %rax, %r15
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r12
cmpq 0x98(%rbx), %rax
ja 0x855c7
movq %rbx, %rdi
callq 0xb389
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
callq 0xbd41
movq %rax, %r15
xorl %ebp, %ebp
jmp 0x855fe
testb %bpl, %bpl
je 0x85746
movzbl (%r14), %eax
leaq 0xc92fe(%rip), %rcx     # 0x14e910
cmpb $0x1, (%rax,%rcx)
jne 0x85758
movq 0x10(%r14), %r12
movl (%r12), %eax
btl $0xc, %eax
jae 0x85634
andl $0xefff, %eax           # imm = 0xEFFF
movw %ax, (%r12)
movb (%r14), %al
addb $-0x29, %al
movl $0x1798, %ecx           # imm = 0x1798
cmpb $0x4, %al
ja 0x85650
movzbl %al, %eax
leaq 0x8d73c(%rip), %rcx     # 0x112d88
movq (%rcx,%rax,8), %rcx
movq (%rbx,%rcx), %r13
movq 0x8(%r14), %r14
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r15
cmpq 0x98(%rbx), %rax
ja 0x85677
movq %rbx, %rdi
callq 0xb389
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 %r15, 0x10(%rax)
movq 0x90(%rbx), %rdx
leaq -0x8(%rdx), %rsi
movq %rsi, 0x90(%rbx)
movq -0x8(%rdx), %r15
movq %rcx, (%r15)
movq %r13, 0x8(%r15)
movq %rax, 0x10(%r15)
movq 0x110(%rbx), %rax
cmpq %r15, %rax
je 0x857d5
movq %r15, %rdx
movq %rdx, %rcx
movq 0x10(%rdx), %rdx
cmpq %rax, %rdx
jne 0x856d1
movq %r12, 0x10(%rcx)
jmp 0x85746
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 0x9f685(%rip), %rcx     # 0x124d93
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 0x3b366
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcebd1(%rip), %rcx     # 0x154330
cmpb $0x0, (%rax,%rcx)
jne 0x8555c
cmpl $0x14, %eax
jne 0x85779
testb $0x20, 0x2(%r14)
jne 0x8555c
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 0x9f609(%rip), %rax     # 0x124db9
movq %rax, 0x10(%r8)
movq $0x16, 0x8(%r8)
movq %rbx, %rdi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xfac8
movq %r12, %r15
jmp 0x85746