// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: s7_arity
s7_pointer s7_arity(s7_scheme *sc, s7_pointer x)
                {
                    switch (type(x))
                    {
                        case T_C_OPT_ARGS_FUNCTION:
                        case T_C_RST_ARGS_FUNCTION:
                        case T_C_FUNCTION:
                            return(s7_cons(sc, s7_make_integer(sc, c_function_required_args(x)), s7_make_integer(sc, c_function_all_args(x))));

                        case T_C_ANY_ARGS_FUNCTION:
                        case T_C_FUNCTION_STAR:
                            return(s7_cons(sc, small_int(0), s7_make_integer(sc, c_function_all_args(x)))); /* should this be *2? */

                        case T_MACRO:
                        case T_BACRO:
                        case T_CLOSURE:
                            return(closure_arity_to_cons(sc, x, closure_args(x)));

                        case T_MACRO_STAR:
                        case T_BACRO_STAR:
                        case T_CLOSURE_STAR:
                            return(closure_star_arity_to_cons(sc, x, closure_args(x)));

                        case T_C_MACRO:
                            return(s7_cons(sc, s7_make_integer(sc, c_macro_required_args(x)), s7_make_integer(sc, c_macro_all_args(x))));

                        case T_GOTO:
                        case T_CONTINUATION:
                            return(s7_cons(sc, small_int(0), max_arity));

                        case T_STRING:
                            if (string_length(x) == 0) return(sc->F);
                            return(s7_cons(sc, small_int(1), small_int(1)));

                        case T_LET:
                            return(s7_cons(sc, small_int(1), small_int(1)));

                        case T_C_OBJECT:
                            check_method_uncopied(sc, x, sc->arity_symbol, list_1(sc, x));
                            if (is_safe_procedure(x))
                                return(s7_cons(sc, small_int(0), max_arity));
                            return(sc->F);

                        case T_VECTOR:
                            if (vector_length(x) == 0) return(sc->F);
                            if (has_simple_elements(x)) return(s7_cons(sc, small_int(1), make_integer(sc, vector_rank(x))));
                            return(s7_cons(sc, small_int(1), max_arity));

                        case T_INT_VECTOR:
                        case T_FLOAT_VECTOR:
                        case T_BYTE_VECTOR:
                            if (vector_length(x) == 0) return(sc->F);
                            return(s7_cons(sc, small_int(1), make_integer(sc, vector_rank(x))));

                        case T_PAIR:
                        case T_HASH_TABLE:
                            return(s7_cons(sc, small_int(1), max_arity));

                        case T_ITERATOR:
                            return(s7_cons(sc, small_int(0), small_int(0)));

                        case T_SYNTAX:
                            return(s7_cons(sc, small_int(syntax_min_args(x)), (syntax_max_args(x) == -1) ? max_arity : small_int(syntax_max_args(x))));
                    }
                    return(sc->F);
                }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzbl (%rsi), %eax
decl %eax
cmpl $0x32, %eax
ja 0x322e7
movq %rsi, %r14
leaq 0xa1340(%rip), %rcx     # 0xd33f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xc049
movq %rax, %r15
jmp 0x32194
movq 0x8(%r14), %rsi
cmpb $0xa, (%rsi)
je 0x322fa
movl 0x28(%r14), %eax
cmpl $0x40000000, %eax       # imm = 0x40000000
jne 0x320f1
movq %rbx, %rdi
callq 0x2dada
movl %eax, 0x28(%r14)
testl %eax, %eax
js 0x3235c
movl %eax, %r14d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc049
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x3219b
movq 0x8(%r14), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7b672
movslq 0x28(%r14), %rsi
movq 0xe3821(%rip), %r14     # 0x115950
cmpq $-0x1, %rsi
je 0x321ba
movq %rbx, %rdi
callq 0xc049
movq %rax, %rdx
jmp 0x321c1
cmpq $0x0, 0x8(%r14)
je 0x322e7
movq 0xe3800(%rip), %r15     # 0x115958
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
movq %r15, %rdx
testq %rax, %rax
je 0x32346
movq 0x10(%rax), %r14
cmpq $0x7ff, %r14            # imm = 0x7FF
ja 0x3230d
leaq 0xe37cc(%rip), %rax     # 0x115950
movq (%rax,%r14,8), %rdx
jmp 0x32346
movq 0xe37bc(%rip), %r15     # 0x115950
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0xc049
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
jmp 0x3234c
movq 0xe37a3(%rip), %rsi     # 0x115958
jmp 0x32301
movq 0xe91e7(%rip), %rdx     # 0x11b3a8
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x3234c
movq 0xe377d(%rip), %rdx     # 0x115950
jmp 0x32215
movslq 0x18(%r14), %rax
leaq 0xe3770(%rip), %rcx     # 0x115950
movq (%rcx,%rax,8), %rsi
movslq 0x1c(%r14), %rax
cmpq $-0x1, %rax
leaq (%rcx,%rax,8), %rax
leaq 0xe91b1(%rip), %rcx     # 0x11b3a8
cmovneq %rax, %rcx
movq (%rcx), %rdx
jmp 0x32308
cmpq $0x0, 0x8(%r14)
je 0x322e7
movq 0xe3743(%rip), %rdx     # 0x115958
movq %rbx, %rdi
movq %rdx, %rsi
jmp 0x3234c
movq (%r14), %r12
btl $0x1e, %r12d
jae 0x322e0
cmpb $0x1, 0x24c(%rbx)
jne 0x322e0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x88f3
movq 0xbd0(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x888f
cmpq 0x128(%rbx), %rax
je 0x322e0
movq %rax, %r15
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r12
cmpq 0x98(%rbx), %rax
ja 0x3228a
movq %rbx, %rdi
callq 0x9c27
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rdx
movq $0x200001, (%rdx)       # imm = 0x200001
movq %r14, 0x8(%rdx)
movq %r12, 0x10(%rdx)
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xa34c
cmpq $0x0, 0x8(%r14)
je 0x322e7
testb $0x1, 0x7(%r14)
movq 0xe3687(%rip), %r15     # 0x115958
jne 0x32158
movq 0xe90ca(%rip), %rdx     # 0x11b3a8
jmp 0x32346
btl $0x15, %r12d
jb 0x322fa
movq 0x120(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0xe364f(%rip), %rsi     # 0x115950
movq 0xe90a0(%rip), %rdx     # 0x11b3a8
movq %rbx, %rdi
jmp 0x3234c
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x3232c
movq %rbx, %rdi
callq 0x9c27
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rdx
movq $0xb, (%rdx)
movq %r14, 0x8(%rdx)
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2c1a0
negl %eax
movq %rbx, %rdi
movq %rax, %rsi
callq 0xc049
movq 0xe9038(%rip), %rdx     # 0x11b3a8
movq %rbx, %rdi
movq %rax, %rsi
jmp 0x3234c