// File: /workspace/github_c_makefile_star2_O1/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 %rdi, %rbx
movq 0x8(%rsi), %r14
movzbl (%r14), %eax
cmpl $0xa, %eax
je 0xaf470
cmpl $0x1, %eax
jne 0xaf48b
movq 0x8(%r14), %rax
cmpb $0xa, (%rax)
jne 0xaf559
movq %rsi, %r12
testb $0x1, 0x2(%rax)
jne 0xaf388
movq 0x10(%rax), %rcx
cmpb $0x20, (%rcx)
jne 0xaf4a7
movq 0x8(%rbx), %rdx
movq 0x18(%rdx), %rdi
movq 0x20(%rax), %rsi
cmpq %rsi, %rdi
je 0xaf37b
jle 0xaf372
movq 0x10(%rdx), %rdx
movq 0x18(%rdx), %rdi
cmpq %rdi, %rsi
jl 0xaf365
cmpq %rsi, %rdi
jne 0xaf575
movq 0x18(%rax), %rsi
cmpq %rcx, %rsi
jne 0xaf4a7
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
cmpb $0x30, (%rax)
jb 0xaf49b
movq 0x8(%rax), %rax
movq 0x38(%rax), %r13
cmpb $0x1, (%r13)
setne %bpl
jne 0xaf49e
movq 0x8(%r13), %rax
movq 0x10d0(%rbx), %r15
cmpq %r15, %rax
je 0xaf49e
movb (%rax), %cl
cmpb $0x1, %cl
jne 0xaf3f5
cmpq %r15, 0x8(%rax)
je 0xaf49e
movq %rax, %rdx
movq 0x10(%rdx), %rdx
movb (%rdx), %sil
cmpb $0x1, %sil
jne 0xaf3f5
cmpq %r15, 0x8(%rdx)
jne 0xaf3d8
cmpb $0x1, %sil
je 0xaf49e
movq 0x11e0(%rbx), %r15
cmpq %r15, %rax
je 0xaf49e
cmpb $0x1, %cl
jne 0xaf42d
cmpq %r15, 0x8(%rax)
je 0xaf49e
movq %rax, %rcx
movq 0x10(%rcx), %rcx
movb (%rcx), %dl
cmpb $0x1, %dl
jne 0xaf42d
cmpq %r15, 0x8(%rcx)
jne 0xaf417
cmpb $0x1, %dl
je 0xaf49e
cmpq 0x1180(%rbx), %rax
je 0xaf443
cmpq 0x1120(%rbx), %rax
jne 0xaf5e8
movl 0x2258(%rbx), %r15d
movq %rbx, %rdi
movq %r12, %rsi
callq 0xa66f0
testb %al, %al
je 0xaf5ba
leaq 0x10d0(%rbx), %rax
movl %r15d, 0x2258(%rbx)
jmp 0xaf5d7
movq %rbx, %rdi
movq %r14, %rsi
callq 0xac2d6
testq %rax, %rax
je 0xaf559
movq 0x10(%rax), %rax
movzbl (%rax), %eax
leaq (%rbx,%rax,8), %rbx
addq $0x8e8, %rbx            # imm = 0x8E8
jmp 0xaf560
movb $0x1, %bpl
testb %bpl, %bpl
je 0xaf563
movq 0x8(%r14), %rax
movq 0x8(%rbx), %rdx
movq 0x18(%rdx), %rdi
movq 0x20(%rax), %rsi
movl $0x18, %ecx
cmpq %rsi, %rdi
je 0xaf50c
jle 0xaf4d0
movq 0x10(%rdx), %rdx
movq 0x18(%rdx), %rdi
cmpq %rdi, %rsi
jl 0xaf4c3
cmpq %rsi, %rdi
je 0xaf50c
movl $0x10, %ecx
cmpb $0x1c, (%rdx)
jne 0xaf50c
movq 0x8(%rdx), %rsi
testq %rsi, %rsi
sete %r8b
je 0xaf4f8
cmpq %rax, 0x8(%rsi)
je 0xaf4fb
movq 0x18(%rsi), %rsi
jmp 0xaf4e3
movq %rdi, %rsi
testb %r8b, %r8b
je 0xaf510
movq 0x10(%rdx), %rdx
cmpb $0x1c, (%rdx)
movq %rsi, %rdi
je 0xaf4df
movq (%rax,%rcx), %rsi
cmpb $0x20, (%rsi)
jne 0xaf559
movq 0x10(%rsi), %rax
movzbl (%rax), %ecx
leaq 0xab65d(%rip), %rdx     # 0x15ab80
cmpb $0x0, (%rcx,%rdx)
jne 0xaf52f
testb $0x40, 0x3(%rax)
je 0xaf559
movq 0x700(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x700(%rbx), %rsi
movq %rbx, %rdi
callq 0x40fe8
movb (%rax), %cl
cmpb $0x1, %cl
jne 0xaf554
movq 0x8(%rax), %r15
cmpb $0x1, %cl
je 0xaf563
addq $0x118, %rbx            # imm = 0x118
movq (%rbx), %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x1c, (%rdx)
movq %rcx, %rsi
jne 0xaf37f
movq 0x8(%rdx), %rsi
testq %rsi, %rsi
sete %r8b
je 0xaf59a
cmpq %rax, 0x8(%rsi)
je 0xaf59d
movq 0x18(%rsi), %rsi
jmp 0xaf585
movq %rdi, %rsi
testb %r8b, %r8b
je 0xaf37f
movq 0x10(%rdx), %rdx
cmpb $0x1c, (%rdx)
movq %rsi, %rdi
je 0xaf581
movq %rcx, %rsi
jmp 0xaf37f
movq %rbx, %rdi
movq %r12, %rsi
callq 0x47b96
movl %r15d, 0x2258(%rbx)
testb %al, %al
je 0xaf5de
leaq 0x11e0(%rbx), %rax
movq (%rax), %r15
xorl %eax, %eax
jmp 0xaf5e0
movb $0x1, %al
testb %al, %al
je 0xaf49e
movq 0x8(%r13), %r15
jmp 0xaf49e