// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: g_signature
static s7_pointer g_signature(s7_scheme *sc, s7_pointer args)
                {
                    s7_pointer p;
#define H_signature "(signature obj) returns obj's signature"
#define Q_signature s7_make_signature(sc, 2, s7_make_signature(sc, 2, sc->is_pair_symbol, sc->is_boolean_symbol), sc->T)

                    p = car(args);
                    switch (type(p))
                    {
                        case T_C_FUNCTION:
                        case T_C_FUNCTION_STAR:
                        case T_C_ANY_ARGS_FUNCTION:
                        case T_C_OPT_ARGS_FUNCTION:
                        case T_C_RST_ARGS_FUNCTION:
                        case T_C_MACRO:
                            return((s7_pointer)c_function_signature(p));

                        case T_MACRO:   case T_MACRO_STAR:
                        case T_BACRO:   case T_BACRO_STAR:
                        case T_CLOSURE: case T_CLOSURE_STAR:
                            {
                                s7_pointer func;
                                func = funclet_entry(sc, p, sc->local_signature_symbol);
                                if (func) return(func);
                                func = funclet_entry(sc, p, sc->signature_symbol);
                                if (func) return(s7_apply_function(sc, func, args));
                                return(sc->F);
                            }

                        case T_VECTOR:
                            if (vector_length(p) == 0) return(sc->F); /* sig () is #f so sig #() should be #f */
                            if (!is_typed_vector(p))
                                return(sc->vector_signature);
                            {
                                s7_pointer lst;
                                lst = list_3(sc, typed_vector_typer_symbol(sc, p), sc->is_vector_symbol, sc->is_integer_symbol);
                                cdddr(lst) = cddr(lst);
                                return(lst);
                            }

                        case T_FLOAT_VECTOR: return((vector_length(p) == 0) ? sc->F : sc->float_vector_signature);
                        case T_INT_VECTOR:   return((vector_length(p) == 0) ? sc->F : sc->int_vector_signature);
                        case T_BYTE_VECTOR:  return((vector_length(p) == 0) ? sc->F : sc->byte_vector_signature);
                        case T_PAIR:         return(sc->pair_signature);
                        case T_STRING:       return(sc->string_signature);

                        case T_HASH_TABLE:
                                             if (is_typed_hash_table(p))
                                                 return(list_3(sc,
                                                             hash_table_typer_symbol(sc, hash_table_value_typer(p)),
                                                             sc->is_hash_table_symbol,
                                                             hash_table_typer_symbol(sc, hash_table_key_typer(p))));
                                             return(sc->hash_table_signature);

                        case T_ITERATOR:
                                             p = iterator_sequence(p);
                                             if ((is_hash_table(p)) || (is_let(p)))   /* cons returned -- would be nice to include the car/cdr types if known */
                                                 return(list_1(sc, sc->is_pair_symbol));
                                             p = g_signature(sc, set_plist_1(sc, p));
                                             if (is_pair(p))
                                                 return(list_1(sc, car(p)));
                                             return(list_1(sc, sc->T));

                        case T_C_OBJECT:
                                             check_method(sc, p, sc->signature_symbol, args);
                                             return(sc->c_object_signature);

                        case T_LET:
                                             check_method(sc, p, sc->signature_symbol, args);
                                             return(sc->let_signature);

                        case T_SYMBOL:
                                             /* this used to get the symbol's value and call g_signature on that */
                                             {
                                                 s7_pointer slot;
                                                 slot = symbol_to_slot(sc, p);
                                                 if ((is_slot(slot)) && (slot_has_setter(slot)))
                                                 {
                                                     s7_pointer setter;
                                                     setter = slot_setter(slot);
                                                     p = g_signature(sc, set_plist_1(sc, setter));
                                                     if (is_pair(p))
                                                         return(list_1(sc, car(p)));
                                                 }
                                             }
                                             break;

                        default:
                                             break;
                    }
                    return(sc->F);
                }

// 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
decl %eax
cmpl $0x32, %eax
ja 0x4122e
movq %rsi, %r15
leaq 0xcf341(%rip), %rcx     # 0x110354
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x16c8(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40e7b
testq %rax, %rax
jne 0x4125a
movq 0x14d0(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40e7b
testq %rax, %rax
je 0x4122e
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbd41
movq 0x8(%r14), %rax
movq 0x38(%rax), %rax
jmp 0x4125a
movq 0x8(%r14), %rax
movb (%rax), %cl
addb $-0x1b, %cl
cmpb $0x1, %cl
ja 0x412f8
movq 0x1140(%rbx), %r14
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r15
cmpq 0x98(%rbx), %rax
ja 0x410b3
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %r14, 0x8(%rax)
movq %r15, 0x10(%rax)
jmp 0x4125a
movq 0x1970(%rbx), %rax
jmp 0x4125a
cmpq $0x0, 0x8(%r14)
je 0x4122e
testb $0x2, 0x6(%r14)
jne 0x413f2
movq 0x1978(%rbx), %rax
jmp 0x4125a
leaq 0x1988(%rbx), %rax
jmp 0x41247
movq 0x19b0(%rbx), %rax
jmp 0x4125a
movb $0x1, %bpl
testb $0x40, 0x3(%r14)
je 0x412d2
cmpb $0x1, 0x24c(%rbx)
jne 0x412d2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9a55
movq 0x14d0(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x99ef
cmpq 0x128(%rbx), %rax
je 0x412d2
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x45a8d
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xbd41
xorl %ebp, %ebp
jmp 0x412d2
movq 0x8(%rbx), %rcx
movq 0x18(%rcx), %rsi
movq 0x20(%r14), %rdx
movl $0x18, %eax
cmpq %rdx, %rsi
je 0x411ec
jle 0x411b0
movq 0x10(%rcx), %rcx
movq 0x18(%rcx), %rsi
cmpq %rsi, %rdx
jl 0x411a3
cmpq %rdx, %rsi
je 0x411ec
movl $0x10, %eax
cmpb $0x1c, (%rcx)
jne 0x411ec
movq 0x8(%rcx), %rdx
testq %rdx, %rdx
sete %dil
je 0x411d8
cmpq %r14, 0x8(%rdx)
je 0x411db
movq 0x18(%rdx), %rdx
jmp 0x411c3
movq %rsi, %rdx
testb %dil, %dil
je 0x411f0
movq 0x10(%rcx), %rcx
cmpb $0x1c, (%rcx)
movq %rdx, %rsi
je 0x411bf
movq (%r14,%rax), %rdx
movb $0x1, %bpl
cmpb $0x20, (%rdx)
jne 0x41229
testb $0x4, 0x2(%rdx)
je 0x41229
movq 0x28(%rdx), %rax
movq 0x700(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x700(%rbx), %rsi
movq %rbx, %rdi
callq 0x40fe8
cmpb $0x1, (%rax)
setne %bpl
je 0x414f4
testb %bpl, %bpl
je 0x4125a
movq 0x120(%rbx), %rax
jmp 0x4125a
leaq 0x1980(%rbx), %rax
jmp 0x41247
leaq 0x1990(%rbx), %rax
addq $0x120, %rbx            # imm = 0x120
cmpq $0x0, 0x8(%r14)
cmovneq %rax, %rbx
movq (%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %bpl
testb $0x40, 0x3(%r14)
je 0x412e3
cmpb $0x1, 0x24c(%rbx)
jne 0x412e3
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9a55
movq 0x14d0(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x99ef
cmpq 0x128(%rbx), %rax
je 0x412e3
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x45a8d
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xbd41
xorl %ebp, %ebp
jmp 0x412e3
testb $0x2, 0x6(%r14)
jne 0x41339
movq 0x19a8(%rbx), %rax
jmp 0x4125a
testb %bpl, %bpl
je 0x4125a
movq 0x1998(%rbx), %rax
jmp 0x4125a
testb %bpl, %bpl
je 0x4125a
movq 0x19a0(%rbx), %rax
jmp 0x4125a
movq 0x700(%rbx), %rcx
movq %rax, 0x8(%rcx)
movq 0x700(%rbx), %rsi
movq %rbx, %rdi
callq 0x40fe8
cmpb $0x1, (%rax)
movq 0x110(%rbx), %r14
movq 0x90(%rbx), %rcx
movq 0x98(%rbx), %rdx
jne 0x41405
movq 0x8(%rax), %r15
jmp 0x4140c
movq 0x28(%r14), %rax
movq 0x20(%rax), %r15
movq 0x20(%r15), %rsi
movq %rbx, %rdi
callq 0xa09ef
movq %rax, %r14
movq 0x10a0(%rbx), %r12
movq 0x18(%r15), %rsi
movq %rbx, %rdi
callq 0xa09ef
movq %rax, %r15
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r13
cmpq 0x98(%rbx), %rax
ja 0x41385
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movl $0x200001, %ecx         # imm = 0x200001
movq %rcx, (%rax)
movq %r15, 0x8(%rax)
movq %r13, 0x10(%rax)
movq 0x90(%rbx), %rdx
leaq -0x8(%rdx), %rsi
movq %rsi, 0x90(%rbx)
movq -0x8(%rdx), %rdx
movq %rcx, (%rdx)
movq %r12, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rsi
movq %rsi, 0x90(%rbx)
movq -0x8(%rax), %rax
movq %rcx, (%rax)
movq %r14, 0x8(%rax)
movq %rdx, 0x10(%rax)
jmp 0x4125a
movq 0x28(%r14), %rsi
cmpb $0x30, (%rsi)
jb 0x41443
movq 0x8(%rsi), %rax
movq 0x58(%rax), %r14
jmp 0x41452
movq 0x118(%rbx), %r15
cmpq %rdx, %rcx
ja 0x41419
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %r15, 0x8(%rax)
movq %r14, 0x10(%rax)
jmp 0x4125a
movq 0x18(%rsi), %rdx
movq %rbx, %rdi
callq 0xa05a7
movq %rax, %r14
movq 0x11b0(%rbx), %r15
movq 0x10d0(%rbx), %r12
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r13
cmpq 0x98(%rbx), %rax
ja 0x4147f
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movl $0x200001, %ecx         # imm = 0x200001
movq %rcx, (%rax)
movq %r12, 0x8(%rax)
movq %r13, 0x10(%rax)
movq 0x90(%rbx), %rdx
leaq -0x8(%rdx), %rsi
movq %rsi, 0x90(%rbx)
movq -0x8(%rdx), %rdx
movq %rcx, (%rdx)
movq %r15, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rsi
movq %rsi, 0x90(%rbx)
movq -0x8(%rax), %rax
movq %rcx, (%rax)
movq %r14, 0x8(%rax)
movq %rdx, 0x10(%rax)
movq 0x10(%rdx), %rcx
movq %rcx, 0x10(%rcx)
jmp 0x4125a
movq 0x8(%rax), %r14
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r15
cmpq 0x98(%rbx), %rax
ja 0x41517
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %r14, 0x8(%rax)
movq %r15, 0x10(%rax)
jmp 0x41229