// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r15d
movl %ecx, %r12d
movq %rdx, %rbx
movl %ecx, %eax
leaq 0x639c3(%rip), %rcx     # 0x115950
movq (%rcx,%rax,8), %rax
movq 0x10(%rdx), %rcx
movq %rax, 0x28(%rcx)
movq 0x10(%rdx), %rax
andq $-0x40001, (%rax)       # imm = 0xFFFBFFFF
movq %rsi, %r14
movzbl (%rsi), %eax
cmpl $0x30, %eax
jb 0xb1ff4
orb $0x8, 0x1(%rbx)
xorl %eax, %eax
cmpl $0x1, %r12d
setne %al
movl $0x148, %ecx            # imm = 0x148
movl $0x14e, %edx            # imm = 0x14E
cmovel %ecx, %edx
btl $0x15, (%r14)
leal 0x6c(%rax,%rax), %eax
cmovael %edx, %eax
addl %r15d, %eax
movw %ax, 0x4(%rbx)
movq %r14, 0x18(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x20(%rbx)
orb $0x4, 0x6(%rbx)
pushq $0x1
popq %rbp
jmp 0xb20d3
movq %rdi, %r13
xorl %ebp, %ebp
cmpl $0x29, %eax
je 0xb205b
cmpl $0x28, %eax
jne 0xb20d3
movq 0x8(%r14), %rsi
movq %r13, %rdi
callq 0xa275d
testb %al, %al
jne 0xb20d3
movq 0x10(%r14), %rax
movq 0x10(%rax), %rcx
movq 0x110(%r13), %rdx
movzwl (%r14), %eax
orq $0x800800, (%rbx)       # imm = 0x800800
movq %r14, 0x18(%rbx)
cmpq %rdx, %rcx
je 0xb20a7
cmpl $0x1, %r12d
movl $0xc8, %ecx
movl $0x102, %edx            # imm = 0x102
cmovel %ecx, %edx
movl $0xc4, %ecx
movl $0xfe, %esi
jmp 0xb20c2
movq 0x10(%r14), %rax
testb $0x4, 0x1(%rax)
je 0xb20d3
movq %r13, %rdi
movq %r14, %rsi
callq 0xa274b
cmpl %r12d, %eax
jl 0xb20d3
movq 0x8(%r14), %rsi
movq %r13, %rdi
callq 0xa275d
testb %al, %al
jne 0xb20d3
orq $0x800800, (%rbx)       # imm = 0x800800
cmpl $0x1, %r12d
jne 0xb20e4
movzwl (%r14), %eax
shrl $0xa, %eax
andl $0x4, %eax
orl $0x118, %eax            # imm = 0x118
movw %ax, 0x4(%rbx)
jmp 0xb211b
cmpl $0x1, %r12d
movl $0xca, %ecx
movl $0x104, %edx            # imm = 0x104
cmovel %ecx, %edx
movl $0xc6, %ecx
movl $0x100, %esi            # imm = 0x100
cmovel %ecx, %esi
btl $0xc, %eax
cmovbl %edx, %esi
addl %r15d, %esi
movw %si, 0x4(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
movq %r14, %rsi
callq 0xa274b
movzwl (%r14), %ecx
cmpl $0x2, %eax
jne 0xb2106
shrl $0xa, %ecx
andl $0x4, %ecx
orl $0x11a, %ecx            # imm = 0x11A
jmp 0xb2117
btl $0xc, %ecx
movl $0x11a, %eax            # imm = 0x11A
movl $0x120, %ecx            # imm = 0x120
cmovael %eax, %ecx
movw %cx, 0x4(%rbx)
movq %r14, 0x18(%rbx)
jmp 0xb20d3