// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: opt_arg_type
static s7_pointer opt_arg_type(s7_scheme *sc, s7_pointer argp)
                {
                    s7_pointer arg, slot;
                    arg = car(argp);
                    if (is_pair(arg))
                    {
                        if (is_symbol(car(arg)))
                        {
                            if ((is_global(car(arg))) ||
                                    ((is_slot(global_slot(car(arg)))) &&
                                     (symbol_to_slot(sc, car(arg)) == global_slot(car(arg)))))
                            {
                                s7_pointer a_func;
                                a_func = slot_value(global_slot(car(arg)));
                                if (is_c_function(a_func))
                                {
                                    s7_pointer sig;
                                    sig = c_function_signature(a_func);
                                    if (is_pair(sig))
                                    {
                                        if ((car(sig) == sc->is_integer_symbol) ||
                                                ((is_pair(car(sig))) && (direct_memq(sc->is_integer_symbol, car(sig)))))
                                            return(sc->is_integer_symbol);
                                        if ((car(sig) == sc->is_float_symbol) ||
                                                ((is_pair(car(sig))) && (direct_memq(sc->is_float_symbol, car(sig)))))
                                            return(sc->is_float_symbol);
                                        if ((car(sig) == sc->is_real_symbol) ||
                                                (car(sig) == sc->is_number_symbol))
                                        {
                                            int32_t start;
                                            start = sc->pc;
                                            if (int_optimize(sc, argp))
                                            {
                                                pc_fallback(sc, start);
                                                return(sc->is_integer_symbol);
                                            }
                                            if (float_optimize(sc, argp))
                                            {
                                                pc_fallback(sc, start);
                                                return(sc->is_float_symbol);
                                            }
                                            pc_fallback(sc, start);
                                        }
                                        return(car(sig)); /* we want the function's return type in this context */
                                    }
                                }
                            }
                            slot = symbol_to_slot(sc, car(arg));
                            if ((is_slot(slot)) &&
                                    (is_sequence(slot_value(slot))))
                            {
                                s7_pointer sig;
                                sig = s7_signature(sc, slot_value(slot));
                                if (is_pair(sig))
                                    return(car(sig));
                            }
                        }
                        return(sc->T);
                    }
                    if (is_symbol(arg))
                    {
                        slot = opt_simple_symbol(sc, arg);
                        if (!slot) return(sc->T);
                        return(s7_type_of(sc, slot_value(slot)));
                    }
                    return(s7_type_of(sc, arg));
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
movzbl (%rsi), %eax
cmpl $0xa, %eax
je 0x85f17
cmpl $0x1, %eax
jne 0x85f2b
movq 0x8(%rsi), %r15
cmpb $0xa, (%r15)
jne 0x85f78
movq 0x10(%r15), %r12
testb $0x1, 0x2(%r15)
jne 0x85ea9
cmpb $0x20, (%r12)
jne 0x85f38
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb00b
cmpq %r12, %rax
jne 0x85f38
movq 0x10(%r12), %rax
cmpb $0x30, (%rax)
jb 0x85f38
movq 0x8(%rax), %rax
movq 0x38(%rax), %r13
cmpb $0x1, (%r13)
jne 0x85f38
movq 0x8(%r13), %r15
movq 0x10d0(%rbx), %r12
cmpq %r12, %r15
je 0x85f82
cmpb $0x1, (%r15)
jne 0x85f94
movq %r12, %rdi
movq %r15, %rsi
callq 0x7cf28
testb %al, %al
jne 0x85f82
movq 0x11e0(%rbx), %r12
cmpq %r12, %r15
je 0x85f82
movq %r12, %rdi
movq %r15, %rsi
callq 0x7cf28
testb %al, %al
jne 0x85f82
jmp 0x85fa0
movq %rbx, %rdi
callq 0x85aab
testq %rax, %rax
je 0x85f78
movq 0x10(%rax), %rax
movzbl (%rax), %eax
leaq (%rbx,%rax,8), %rbx
addq $0x8e8, %rbx            # imm = 0x8E8
jmp 0x85f7f
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb00b
cmpb $0x20, (%rax)
jne 0x85f78
movq 0x10(%rax), %rsi
movzbl (%rsi), %eax
leaq 0x9bc2a(%rip), %rcx     # 0x121b80
cmpb $0x0, (%rax,%rcx)
jne 0x85f62
testb $0x40, 0x3(%rsi)
je 0x85f78
movq %rbx, %rdi
callq 0x3166b
cmpb $0x1, (%rax)
jne 0x85f78
addq $0x8, %rax
movq %rax, %rbx
jmp 0x85f7f
addq $0x118, %rbx            # imm = 0x118
movq (%rbx), %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x11e0(%rbx), %r12
cmpq %r12, %r15
je 0x85f82
leaq 0x11e0(%rbx), %rbp
cmpq 0x1180(%rbx), %r15
je 0x85fbc
movq %r15, %r12
cmpq 0x1120(%rbx), %r15
jne 0x85f82
movl 0x2258(%rbx), %r15d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7e94f
testb %al, %al
je 0x85fe2
movl %r15d, 0x2258(%rbx)
addq $0x10d0, %rbx           # imm = 0x10D0
jmp 0x85f7f
addq $0x8, %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0x36881
movl %r15d, 0x2258(%rbx)
testb %al, %al
cmovneq %rbp, %r13
movq %r13, %rbx
jmp 0x85f7f