// File: /workspace/github_c_makefile_star2_O3/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 0x6600f(%rip), %rcx     # 0x146950
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 0xe09aa
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 0xe0ac6
movq %rdi, %r12
xorl %ebp, %ebp
cmpl $0x29, %eax
je 0xe0a2f
cmpl $0x28, %eax
jne 0xe0ac6
movq 0x8(%r14), %rax
cmpb $0x1, (%rax)
jne 0xe09e1
movq 0x1890(%r12), %rcx
cmpq %rcx, 0x8(%rax)
je 0xe0ac6
movq 0x10(%rax), %rax
cmpb $0x1, (%rax)
je 0xe09ce
cmpq 0x110(%r12), %rax
jne 0xe0ac6
movq 0x10(%r14), %rcx
movq 0x10(%rcx), %rdx
movzwl (%r14), %ecx
orq $0x800800, (%rbx)       # imm = 0x800800
movq %r14, 0x18(%rbx)
cmpq %rax, %rdx
je 0xe0a9a
cmpl $0x1, %r15d
movl $0xc8, %eax
movl $0x102, %edx            # imm = 0x102
cmovel %eax, %edx
movl $0xc4, %eax
movl $0xfe, %esi
jmp 0xe0ab5
movq 0x10(%r14), %rax
testb $0x4, 0x1(%rax)
je 0xe0ac6
movq 0x8(%r14), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x9a1d8
cmpl %r15d, 0x28(%r14)
jl 0xe0ac6
movq 0x8(%r14), %rax
cmpb $0x1, (%rax)
jne 0xe0a72
movq 0x1890(%r12), %rcx
cmpq %rcx, 0x8(%rax)
je 0xe0ac6
movq 0x10(%rax), %rax
cmpb $0x1, (%rax)
je 0xe0a63
cmpq 0x110(%r12), %rax
jne 0xe0ac6
orq $0x800800, (%rbx)       # imm = 0x800800
cmpl $0x1, %r15d
jne 0xe0ad1
movzwl (%r14), %eax
shrl $0xa, %eax
andl $0x4, %eax
orl $0x118, %eax            # imm = 0x118
jmp 0xe0af6
cmpl $0x1, %r15d
movl $0xca, %eax
movl $0x104, %edx            # imm = 0x104
cmovel %eax, %edx
movl $0xc6, %eax
movl $0x100, %esi            # imm = 0x100
cmovel %eax, %esi
btl $0xc, %ecx
cmovbl %edx, %esi
addl %r8d, %esi
movw %si, 0x4(%rbx)
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r14), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x9a1d8
cmpl $0x2, 0x28(%r14)
movzwl (%r14), %eax
jne 0xe0afc
shrl $0xa, %eax
andl $0x4, %eax
orl $0x11a, %eax            # imm = 0x11A
movw %ax, 0x4(%rbx)
jmp 0xe0b11
btl $0xc, %eax
movl $0x11a, %eax            # imm = 0x11A
movl $0x120, %ecx            # imm = 0x120
cmovael %eax, %ecx
movw %cx, 0x4(%rbx)
movq %r14, 0x18(%rbx)
jmp 0xe0ac6