// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: op_macroexpand
static goto_t op_macroexpand(s7_scheme *sc)
                {
                    set_current_code(sc, sc->code);
                    sc->code = cdr(sc->code);
                    /* mimic APPLY, but don't push OP_EVAL_MACRO or OP_EXPANSION
                     *   (define-macro (mac a) `(+ ,a 1)) (macroexpand (mac 3)), sc->code: ((mac 3))
                     */
                    if ((!is_pair(sc->code)) ||
                            (!is_pair(car(sc->code))))
                        eval_error_no_return(sc, sc->syntax_error_symbol, "macroexpand argument is not a macro call: ~A", 44, sc->code);
                    if (!is_null(cdr(sc->code)))
                        eval_error_no_return(sc, sc->syntax_error_symbol, "macroexpand: too many arguments: ~A", 35, sc->code);

                    if (is_pair(caar(sc->code)))                            /* (macroexpand ((symbol->value 'mac) (+ 1 2))) */
                    {
                        push_stack_no_args(sc, OP_MACROEXPAND_1, sc->code);
                        sc->code = caar(sc->code);
                        return(goto_eval);
                    }

                    sc->args = copy_list(sc, cdar(sc->code));               /* apply_lambda reuses args as slots, and these have not been copied yet */
                    if (!is_symbol(caar(sc->code)))
                        eval_error_no_return(sc, sc->syntax_error_symbol, "macroexpand argument is not a macro call: ~A", 44, sc->code);
                    sc->code = lookup_checked(sc, caar(sc->code));
                    return(macroexpand(sc));
                }

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
movq 0x68(%rsp), %rax
movq (%rax), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x133a12
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0x133a74
movq 0x68(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x68(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x68(%rsp), %rdi
leaq 0xbc1de(%rip), %rsi     # 0x1efc21
movl $0x2c, %edx
callq 0xb880
movq 0x40(%rsp), %rdi
movq %rax, %rsi
movq 0x68(%rsp), %rax
movq (%rax), %rdx
callq 0xb830
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x68(%rsp), %rcx
cmpq 0x110(%rcx), %rax
je 0x133af0
movq 0x68(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x68(%rsp), %rdi
leaq 0xbc18f(%rip), %rsi     # 0x1efc4e
movl $0x23, %edx
callq 0xb880
movq 0x28(%rsp), %rdi
movq %rax, %rsi
movq 0x68(%rsp), %rax
movq (%rax), %rdx
callq 0xb830
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x133b7c
jmp 0x133b0a
movq 0x68(%rsp), %rax
movq (%rax), %rcx
movq 0x68(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, (%rax)
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x68(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x68(%rsp), %rax
movq 0x50(%rax), %rax
movl $0x310, %ecx            # imm = 0x310
movq %rcx, 0x18(%rax)
movq 0x68(%rsp), %rax
movq 0x50(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x50(%rax)
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
movl $0x5, 0x74(%rsp)
jmp 0x133c93
movq 0x68(%rsp), %rdi
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x44270
movq %rax, %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
cmpl $0xa, %eax
je 0x133c1c
movq 0x68(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x68(%rsp), %rax
movq 0x1918(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rdi
leaq 0xbc036(%rip), %rsi     # 0x1efc21
movl $0x2c, %edx
callq 0xb880
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq 0x68(%rsp), %rax
movq (%rax), %rdx
callq 0xb830
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq 0x68(%rsp), %rdi
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0xde990
movq %rax, 0x60(%rsp)
cmpq $0x0, 0x60(%rsp)
je 0x133c4f
movq 0x60(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x133c6e
movq 0x68(%rsp), %rdi
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0xdead0
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
movq 0x68(%rsp), %rdi
callq 0x16ea70
movl %eax, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopl (%rax)