// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
movl %ecx, %r15d
movq %rdx, %rbx
movl %ecx, %eax
leaq 0x65709(%rip), %rcx     # 0x14e950
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 0xe92b0
orb $0x8, 0x1(%rbx)
xorl %eax, %eax
cmpl $0x1, %r15d
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 %r8d, %eax
movw %ax, 0x4(%rbx)
movq %r14, 0x18(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x20(%rbx)
orb $0x4, 0x6(%rbx)
movl $0x1, %ebp
jmp 0xe942b
movq %rdi, %r12
xorl %ebp, %ebp
cmpl $0x29, %eax
je 0xe92fa
cmpl $0x28, %eax
jne 0xe942b
movq 0x8(%r14), %rcx
cmpb $0x1, (%rcx)
jne 0xe92e3
movq 0x1890(%r12), %rdx
cmpq %rdx, 0x8(%rcx)
je 0xe92f1
movq 0x10(%rcx), %rcx
cmpb $0x1, (%rcx)
je 0xe92d4
cmpq 0x110(%r12), %rcx
je 0xe9378
cmpl $0x29, %eax
jne 0xe942b
movq 0x10(%r14), %rax
testb $0x4, 0x1(%rax)
je 0xe942b
movq 0x8(%r14), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0xa0ae3
cmpl %r15d, 0x28(%r14)
jl 0xe942b
movq 0x8(%r14), %rax
cmpb $0x1, (%rax)
jne 0xe9345
movq 0x1890(%r12), %rcx
cmpq %rcx, 0x8(%rax)
je 0xe942b
movq 0x10(%rax), %rax
cmpb $0x1, (%rax)
je 0xe9332
cmpq 0x110(%r12), %rax
jne 0xe942b
orq $0x800800, (%rbx)       # imm = 0x800800
cmpl $0x1, %r15d
jne 0xe93e7
movzwl (%r14), %eax
shrl $0xa, %eax
andl $0x4, %eax
orl $0x118, %eax            # imm = 0x118
jmp 0xe940c
movq 0x10(%r14), %rax
movq 0x10(%rax), %rcx
movq 0x110(%r12), %rdx
movzwl (%r14), %eax
orq $0x800800, (%rbx)       # imm = 0x800800
movq %r14, 0x18(%rbx)
cmpq %rdx, %rcx
je 0xe93b9
cmpl $0x1, %r15d
movl $0xc8, %ecx
movl $0x102, %edx            # imm = 0x102
cmovel %ecx, %edx
movl $0xc4, %ecx
movl $0xfe, %esi
jmp 0xe93d4
cmpl $0x1, %r15d
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 %r8d, %esi
movw %si, 0x4(%rbx)
jmp 0xe942b
movq 0x8(%r14), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0xa0ae3
cmpl $0x2, 0x28(%r14)
movzwl (%r14), %eax
jne 0xe9412
shrl $0xa, %eax
andl $0x4, %eax
orl $0x11a, %eax            # imm = 0x11A
movw %ax, 0x4(%rbx)
jmp 0xe9427
btl $0xc, %eax
movl $0x11a, %eax            # imm = 0x11A
movl $0x120, %ecx            # imm = 0x120
cmovael %eax, %ecx
movw %cx, 0x4(%rbx)
movq %r14, 0x18(%rbx)
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq