// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
movzbl (%rsi), %eax
cmpl $0xa, %eax
je 0xa8550
cmpl $0x1, %eax
jne 0xa8569
movq 0x8(%rsi), %rax
cmpb $0xa, (%rax)
jne 0xa85eb
movq 0x10(%rax), %rcx
testb $0x1, 0x2(%rax)
jne 0xa84cc
cmpb $0x20, (%rcx)
jne 0xa8576
movq 0x8(%rbx), %rsi
movq 0x18(%rsi), %r8
movq 0x20(%rax), %rdi
movl $0x18, %edx
cmpq %rdi, %r8
je 0xa84bf
jle 0xa84b6
movq 0x10(%rsi), %rsi
movq 0x18(%rsi), %r8
cmpq %r8, %rdi
jl 0xa84a9
cmpq %rdi, %r8
jne 0xa8623
movq (%rax,%rdx), %rdi
cmpq %rcx, %rdi
jne 0xa8576
movq 0x10(%rcx), %rcx
cmpb $0x30, (%rcx)
jb 0xa8576
movq 0x8(%rcx), %rcx
movq 0x38(%rcx), %r15
cmpb $0x1, (%r15)
jne 0xa8576
movq 0x8(%r15), %rcx
movq 0x10d0(%rbx), %rax
cmpq %rax, %rcx
je 0xa85f5
cmpb $0x1, (%rcx)
jne 0xa8650
movq %rcx, %rdx
cmpq %rax, 0x8(%rdx)
je 0xa85f5
movq 0x10(%rdx), %rdx
cmpb $0x1, (%rdx)
je 0xa850b
movq 0x11e0(%rbx), %rax
cmpq %rax, %rcx
je 0xa85f5
leaq 0x11e0(%rbx), %r12
movq %rcx, %rdx
cmpq %rax, 0x8(%rdx)
je 0xa85f5
movq 0x10(%rdx), %rdx
cmpb $0x1, (%rdx)
je 0xa8538
jmp 0xa8663
movq 0x8(%rbx), %rdi
callq 0xa56a4
testq %rax, %rax
je 0xa85eb
movq 0x10(%rax), %rax
movzbl (%rax), %eax
leaq (%rbx,%rax,8), %rbx
addq $0x8e8, %rbx            # imm = 0x8E8
jmp 0xa85f2
movq 0x8(%rbx), %rdx
movq 0x18(%rdx), %rdi
movq 0x20(%rax), %rsi
movl $0x18, %ecx
cmpq %rsi, %rdi
je 0xa85a0
jle 0xa859b
movq 0x10(%rdx), %rdx
movq 0x18(%rdx), %rdi
cmpq %rdi, %rsi
jl 0xa858e
cmpq %rsi, %rdi
jne 0xa85fe
movq (%rax,%rcx), %rsi
cmpb $0x20, (%rsi)
jne 0xa85eb
movq 0x10(%rsi), %rax
movzbl (%rax), %ecx
leaq 0xaa5c9(%rip), %rdx     # 0x152b80
cmpb $0x0, (%rcx,%rdx)
jne 0xa85c3
testb $0x40, 0x3(%rax)
je 0xa85eb
movq 0x700(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x700(%rbx), %rsi
movq %rbx, %rdi
callq 0x3e9c6
cmpb $0x1, (%rax)
jne 0xa85eb
addq $0x8, %rax
movq %rax, %rbx
jmp 0xa85f2
addq $0x118, %rbx            # imm = 0x118
movq (%rbx), %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %ecx
cmpb $0x1c, (%rdx)
jne 0xa85a0
movq 0x8(%rdx), %rsi
testq %rsi, %rsi
je 0xa861d
cmpq %rax, 0x8(%rsi)
je 0xa85a4
movq 0x18(%rsi), %rsi
jmp 0xa860c
movq 0x10(%rdx), %rdx
jmp 0xa8603
movl $0x10, %edx
cmpb $0x1c, (%rsi)
jne 0xa84bf
movq 0x8(%rsi), %rdi
testq %rdi, %rdi
je 0xa864a
cmpq %rax, 0x8(%rdi)
je 0xa84c3
movq 0x18(%rdi), %rdi
jmp 0xa8635
movq 0x10(%rsi), %rsi
jmp 0xa8628
movq 0x11e0(%rbx), %rax
cmpq %rax, %rcx
je 0xa85f5
leaq 0x11e0(%rbx), %r12
cmpq 0x1180(%rbx), %rcx
je 0xa867c
movq %rcx, %rax
cmpq 0x1120(%rbx), %rcx
jne 0xa85f5
movl 0x2258(%rbx), %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9fbc8
testb %al, %al
je 0xa86a3
movl %ebp, 0x2258(%rbx)
addq $0x10d0, %rbx           # imm = 0x10D0
jmp 0xa85f2
addq $0x8, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x44f61
movl %ebp, 0x2258(%rbx)
testb %al, %al
cmovneq %r12, %r15
movq %r15, %rbx
jmp 0xa85f2