// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: add_chooser
static s7_pointer add_chooser(s7_scheme *sc, s7_pointer f, int32_t args, s7_pointer expr, bool ops)
                {
                    /* (+ s f) (+ (* s s) s) (+ s s) (+ s (* s s)) */
#if (!WITH_GMP)
                    if (args == 2)
                    {
                        if (ops)
                        {
                            s7_pointer arg1, arg2;
                            arg1 = cadr(expr);
                            arg2 = caddr(expr);
                            if (arg2 == small_int(1))                          /* (+ ... 1) */
                                return(sc->add_x1);
                            if ((is_t_integer(arg1)) && ((is_pair(arg2)) && (is_optimized(arg2)) && (is_h_safe_c_d(arg2)) && (c_callee(arg2) == g_random_i)))
                            {
                                set_opt3_any(cdr(expr), cadr(arg2));
                                set_safe_optimize_op(expr, HOP_SAFE_C_D); /* op if r op? */
                                return(sc->add_i_random);
                            }
                            if (arg1 == small_int(1))
                                return(sc->add_1x);
                            return(chooser_check_arg_types(sc, arg1, arg2, sc->add_2,
                                        sc->add_2_ff, sc->add_2_ii, sc->add_2_if, sc->add_2_fi,
                                        sc->add_2_xi, sc->add_2_ix, sc->add_2_fx, sc->add_2_xf));
                        }
                        return(sc->add_2);
                    }
                    if (args == 3)
                        return(sc->add_3);
#endif
                    return(f);
                }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movb %r8b, %al
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movl %edx, 0x54(%rsp)
movq %rcx, 0x48(%rsp)
andb $0x1, %al
movb %al, 0x47(%rsp)
cmpl $0x2, 0x54(%rsp)
jne 0x1d056d
testb $0x1, 0x47(%rsp)
je 0x1d055a
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x460c9(%rip), %rax     # 0x216488
jne 0x1d03d7
movq 0x60(%rsp), %rax
movq 0x1a60(%rax), %rax
movq %rax, 0x68(%rsp)
jmp 0x1d0591
movq 0x38(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xb, %eax
jne 0x1d0492
movq 0x30(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x1d0492
movq 0x30(%rsp), %rax
movzwl (%rax), %eax
cmpl $0x801, %eax            # imm = 0x801
jne 0x1d0492
movq 0x30(%rsp), %rax
movzwl 0x4(%rax), %eax
cmpl $0x3, %eax
jne 0x1d0492
movq 0x30(%rsp), %rax
leaq -0xca656(%rip), %rcx    # 0x105dd0
cmpq %rcx, 0x20(%rax)
jne 0x1d0492
jmp 0x1d042e
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rcx
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x28(%rax)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rcx
andq $-0x40001, %rcx         # imm = 0xFFFBFFFF
movq %rcx, (%rax)
jmp 0x1d0460
movq 0x48(%rsp), %rax
movzwl (%rax), %ecx
orl $0x800, %ecx            # imm = 0x800
movw %cx, (%rax)
movq 0x48(%rsp), %rax
movw $0x3, 0x4(%rax)
movq 0x60(%rsp), %rax
movq 0x1c20(%rax), %rax
movq %rax, 0x68(%rsp)
jmp 0x1d0591
movq 0x38(%rsp), %rax
cmpq 0x45fea(%rip), %rax     # 0x216488
jne 0x1d04b6
movq 0x60(%rsp), %rax
movq 0x1a58(%rax), %rax
movq %rax, 0x68(%rsp)
jmp 0x1d0591
movq 0x60(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x60(%rsp), %rax
movq 0x1a48(%rax), %rcx
movq 0x60(%rsp), %rax
movq 0x1d20(%rax), %r8
movq 0x60(%rsp), %rax
movq 0x1d28(%rax), %r9
movq 0x60(%rsp), %rax
movq 0x1d30(%rax), %r15
movq 0x60(%rsp), %rax
movq 0x1d38(%rax), %r14
movq 0x60(%rsp), %rax
movq 0x1d40(%rax), %rbx
movq 0x60(%rsp), %rax
movq 0x1d48(%rax), %r11
movq 0x60(%rsp), %rax
movq 0x1d50(%rax), %r10
movq 0x60(%rsp), %rax
movq 0x1d58(%rax), %rax
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x1d8d60
movq %rax, 0x68(%rsp)
jmp 0x1d0591
movq 0x60(%rsp), %rax
movq 0x1a48(%rax), %rax
movq %rax, 0x68(%rsp)
jmp 0x1d0591
cmpl $0x3, 0x54(%rsp)
jne 0x1d0587
movq 0x60(%rsp), %rax
movq 0x1a50(%rax), %rax
movq %rax, 0x68(%rsp)
jmp 0x1d0591
movq 0x58(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq