// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: wrap_bad_args
static opt_t wrap_bad_args(s7_scheme *sc, s7_pointer func, s7_pointer expr, int32_t n_args, int32_t hop)
                {
                    set_opt3_arglen(expr, small_int(n_args));
                    if (is_c_function(func))
                    {
                        set_safe_optimize_op(expr, hop + ((is_safe_procedure(func)) ?
                                    ((n_args == 1) ? OP_SAFE_C_A : OP_SAFE_C_AA) :
                                    ((n_args == 1) ? OP_C_A : OP_C_AA)));
                        set_c_function(expr, func);
                        return(OPT_T);
                    }
                    if ((is_closure(func)) &&
                            (!arglist_has_rest(sc, closure_args(func))))
                    {
                        s7_pointer body;
                        bool one_form, safe_case;

                        body = closure_body(func);
                        one_form = is_null(cdr(body));
                        safe_case = is_safe_closure(func);
                        set_unsafely_optimized(expr);
                        set_opt1_lambda(expr, func);

                        if (one_form)
                            set_optimize_op(expr, hop + ((safe_case) ?
                                        ((n_args == 1) ? OP_SAFE_CLOSURE_A_P : OP_SAFE_CLOSURE_AA_P) :
                                        ((n_args == 1) ? OP_CLOSURE_A_P : OP_CLOSURE_AA_P)));
                        else
                            set_optimize_op(expr, hop + ((safe_case) ?
                                        ((n_args == 1) ? OP_SAFE_CLOSURE_A : OP_SAFE_CLOSURE_AA) :
                                        ((n_args == 1) ? OP_CLOSURE_A : OP_CLOSURE_AA)));
                        return(OPT_F);
                    }
                    if ((is_closure_star(func)) &&
                            (lambda_has_simple_defaults(closure_body(func))) &&
                            (closure_star_arity_to_int(sc, func) >= n_args) &&
                            (!arglist_has_rest(sc, closure_args(func))))
                    {
                        set_unsafely_optimized(expr);
                        if (n_args == 1)
                            set_optimize_op(expr, ((is_safe_closure(func)) ? OP_SAFE_CLOSURE_STAR_A : OP_CLOSURE_STAR_A));
                        else
                        {
                            if (closure_star_arity_to_int(sc, func) == 2)
                                set_optimize_op(expr, ((is_safe_closure(func)) ? OP_SAFE_CLOSURE_STAR_AA : OP_CLOSURE_STAR_FX));
                            else set_optimize_op(expr, ((is_safe_closure(func)) ? OP_SAFE_CLOSURE_STAR_FX : OP_CLOSURE_STAR_FX));
                        }
                        set_opt1_lambda(expr, func);
                    }
                    return(OPT_F);
                }

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movl %ecx, 0x34(%rsp)
movl %r8d, 0x30(%rsp)
movslq 0x34(%rsp), %rcx
leaq 0x963a8(%rip), %rax     # 0x216480
movq (%rax,%rcx,8), %rcx
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x28(%rax)
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rcx
andq $-0x40001, %rcx         # imm = 0xFFFBFFFF
movq %rcx, (%rax)
movq 0x40(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x30, %eax
jl 0x1801c8
jmp 0x180112
movq 0x38(%rsp), %rax
movzwl (%rax), %ecx
orl $0x800, %ecx            # imm = 0x800
movw %cx, (%rax)
movl 0x30(%rsp), %eax
movl %eax, 0x20(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rax
andq $0x200000, %rax         # imm = 0x200000
cmpq $0x0, %rax
je 0x180159
movl 0x34(%rsp), %edx
movl $0x6e, %eax
movl $0x6c, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, 0x1c(%rsp)
jmp 0x180171
movl 0x34(%rsp), %edx
movl $0x14e, %eax            # imm = 0x14E
movl $0x148, %ecx            # imm = 0x148
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, 0x1c(%rsp)
movl 0x20(%rsp), %eax
movl 0x1c(%rsp), %ecx
addl %ecx, %eax
movw %ax, %cx
movq 0x38(%rsp), %rax
movw %cx, 0x4(%rax)
jmp 0x180189
movq 0x40(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x38(%rsp), %rax
movzwl 0x6(%rax), %ecx
orl $0x4, %ecx
movw %cx, 0x6(%rax)
jmp 0x1801bb
movl $0x1, 0x54(%rsp)
jmp 0x18045d
movq 0x40(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x28, %eax
jne 0x180329
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x15d270
testb $0x1, %al
jne 0x180329
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x48(%rsp), %rcx
cmpq 0x110(%rcx), %rax
sete %al
andb $0x1, %al
movb %al, 0x27(%rsp)
movq 0x40(%rsp), %rax
movzwl (%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x26(%rsp)
movq 0x38(%rsp), %rax
movq (%rax), %rcx
orq $0x800000, %rcx         # imm = 0x800000
orq $0x800, %rcx            # imm = 0x800
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x18(%rax)
testb $0x1, 0x27(%rsp)
je 0x1802c5
movl 0x30(%rsp), %eax
movl %eax, 0x18(%rsp)
testb $0x1, 0x26(%rsp)
je 0x180295
movl 0x34(%rsp), %edx
movl $0x104, %eax            # imm = 0x104
movl $0xca, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, 0x14(%rsp)
jmp 0x1802ad
movl 0x34(%rsp), %edx
movl $0x100, %eax            # imm = 0x100
movl $0xc6, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, 0x14(%rsp)
movl 0x18(%rsp), %eax
movl 0x14(%rsp), %ecx
addl %ecx, %eax
movw %ax, %cx
movq 0x38(%rsp), %rax
movw %cx, 0x4(%rax)
jmp 0x18031c
movl 0x30(%rsp), %eax
movl %eax, 0x10(%rsp)
testb $0x1, 0x26(%rsp)
je 0x1802ee
movl 0x34(%rsp), %edx
movl $0x102, %eax            # imm = 0x102
movl $0xc8, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, 0xc(%rsp)
jmp 0x180306
movl 0x34(%rsp), %edx
movl $0xfe, %eax
movl $0xc4, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, 0xc(%rsp)
movl 0x10(%rsp), %eax
movl 0xc(%rsp), %ecx
addl %ecx, %eax
movw %ax, %cx
movq 0x38(%rsp), %rax
movw %cx, 0x4(%rax)
movl $0x0, 0x54(%rsp)
jmp 0x18045d
movq 0x40(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x29, %eax
jne 0x180455
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
andq $0x400, %rax            # imm = 0x400
cmpq $0x0, %rax
je 0x180455
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x15d230
cmpl 0x34(%rsp), %eax
jl 0x180455
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x15d270
testb $0x1, %al
jne 0x180455
movq 0x38(%rsp), %rax
movq (%rax), %rcx
orq $0x800000, %rcx         # imm = 0x800000
orq $0x800, %rcx            # imm = 0x800
movq 0x38(%rsp), %rax
movq %rcx, (%rax)
cmpl $0x1, 0x34(%rsp)
jne 0x1803db
movq 0x40(%rsp), %rax
movzwl (%rax), %edx
andl $0x1000, %edx           # imm = 0x1000
movl $0x118, %eax            # imm = 0x118
movl $0x11c, %ecx            # imm = 0x11C
cmpl $0x0, %edx
cmovnel %ecx, %eax
movw %ax, %cx
movq 0x38(%rsp), %rax
movw %cx, 0x4(%rax)
jmp 0x180447
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x15d230
cmpl $0x2, %eax
jne 0x18041b
movq 0x40(%rsp), %rax
movzwl (%rax), %edx
andl $0x1000, %edx           # imm = 0x1000
movl $0x11a, %eax            # imm = 0x11A
movl $0x11e, %ecx            # imm = 0x11E
cmpl $0x0, %edx
cmovnel %ecx, %eax
movw %ax, %cx
movq 0x38(%rsp), %rax
movw %cx, 0x4(%rax)
jmp 0x180445
movq 0x40(%rsp), %rax
movzwl (%rax), %edx
andl $0x1000, %edx           # imm = 0x1000
movl $0x11a, %eax            # imm = 0x11A
movl $0x120, %ecx            # imm = 0x120
cmpl $0x0, %edx
cmovnel %ecx, %eax
movw %ax, %cx
movq 0x38(%rsp), %rax
movw %cx, 0x4(%rax)
jmp 0x180447
movq 0x40(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)