// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movzbl (%rsi), %eax
decl %eax
cmpl $0x32, %eax
ja 0x41dfd
movq %rsi, %r14
leaq 0xce89f(%rip), %rcx     # 0x110420
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xdff8
movq %rax, %r15
jmp 0x41c05
movq 0x8(%r14), %rsi
cmpb $0xa, (%rsi)
jne 0x41c5e
movq 0x10cda1(%rip), %r14    # 0x14e950
jmp 0x41eb7
movq 0x8(%r14), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa0ae3
movslq 0x28(%r14), %rsi
movq 0x10cd82(%rip), %r15    # 0x14e950
cmpq $-0x1, %rsi
jne 0x41c09
jmp 0x41ddd
cmpq $0x0, 0x8(%r14)
je 0x41dfd
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x41e09
movq 0x10(%rax), %r15
jmp 0x41e0f
movq 0x10cd4b(%rip), %r15    # 0x14e950
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0xdff8
movq %rax, %r14
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x41c2c
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)
jmp 0x41d24
movq 0x10ccff(%rip), %r14    # 0x14e958
jmp 0x41eb7
cmpl $0x40000000, 0x28(%r14) # imm = 0x40000000
jne 0x41c74
movq %rbx, %rdi
callq 0x3c299
movl %eax, 0x28(%r14)
movslq 0x28(%r14), %r15
testq %r15, %r15
js 0x41ea6
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdff8
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdff8
movq %rax, %r15
jmp 0x41ebe
movq 0x10cca7(%rip), %r14    # 0x14e950
jmp 0x41ceb
movslq 0x18(%r14), %rax
leaq 0x10cc9a(%rip), %rcx    # 0x14e950
movq (%rcx,%rax,8), %r15
movslq 0x1c(%r14), %rax
cmpq $-0x1, %rax
leaq (%rcx,%rax,8), %rax
leaq 0x1126db(%rip), %rcx    # 0x1543a8
cmovneq %rax, %rcx
movq (%rcx), %r14
jmp 0x41c14
cmpq $0x0, 0x8(%r14)
je 0x41dfd
movq 0x10cc6d(%rip), %r14    # 0x14e958
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x41d03
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 %r14, 0x10(%rax)
jmp 0x41efb
movb $0x1, %bpl
testb $0x40, 0x3(%r14)
je 0x41de9
cmpb $0x1, 0x24c(%rbx)
jne 0x41de9
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9a55
movq 0xbd0(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x99ef
cmpq 0x128(%rbx), %rax
je 0x41de9
movq %rax, %r15
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r12
cmpq 0x98(%rbx), %rax
ja 0x41d90
movq %rbx, %rdi
callq 0xb389
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
callq 0xbd41
xorl %ebp, %ebp
jmp 0x41de9
cmpq $0x0, 0x8(%r14)
je 0x41dfd
testb $0x1, 0x7(%r14)
movq 0x10cb81(%rip), %r15    # 0x14e958
jne 0x41f04
movq 0x1125c4(%rip), %r14    # 0x1543a8
jmp 0x41c14
testb %bpl, %bpl
je 0x41efb
testb $0x20, 0x2(%r14)
jne 0x41ba8
movq 0x120(%rbx), %rax
jmp 0x41efb
movl $0x1, %r15d
movq 0x10cb42(%rip), %r14    # 0x14e958
cmpq $0x7ff, %r15            # imm = 0x7FF
ja 0x41e2c
leaq 0x10cb2a(%rip), %rax    # 0x14e950
movq (%rax,%r15,8), %r12
jmp 0x41e67
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x41e44
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r12
movq $0xb, (%r12)
movq %r15, 0x8(%r12)
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x41e7f
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 %r12, 0x10(%rax)
jmp 0x41efb
negl %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdff8
movq %rax, %r14
movq 0x1124ea(%rip), %r15    # 0x1543a8
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x41ed6
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)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x41f17
movq 0x10(%rax), %r14
jmp 0x41f1d
movl $0x1, %r14d
cmpq $0x7ff, %r14            # imm = 0x7FF
ja 0x41f33
leaq 0x10ca23(%rip), %rax    # 0x14e950
movq (%rax,%r14,8), %r12
jmp 0x41f6e
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x41f4b
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r12
movq $0xb, (%r12)
movq %r14, 0x8(%r12)
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x41f86
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)
jmp 0x41ea0