// File: /workspace/github_c_makefile_star2_O1/BernardTatin[P]s7sh/s7.c
// Function: s7_is_aritable
bool s7_is_aritable(s7_scheme *sc, s7_pointer x, s7_int args)
                {
                    switch (type(x))
                    {
                        case T_C_RST_ARGS_FUNCTION:
                        case T_C_FUNCTION:
                            return((c_function_required_args(x) <= args) &&
                                    (c_function_all_args(x) >= args));

                        case T_C_OPT_ARGS_FUNCTION: /* any/opt req args == 0 */
                        case T_C_ANY_ARGS_FUNCTION:
                        case T_C_FUNCTION_STAR:
                            return(c_function_all_args(x) >= args);

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

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

                        case T_C_MACRO:
                            return((c_macro_required_args(x) <= args) &&
                                    (c_macro_all_args(x) >= args));

                        case T_GOTO:
                        case T_CONTINUATION:
                            return(true);

                        case T_STRING:
                            return((args == 1) && (string_length(x) > 0)); /* ("" 0) -> error */

                        case T_C_OBJECT:
                            {
                                s7_pointer func;
                                if ((has_active_methods(sc, x)) &&
                                        ((func = find_method(sc, find_let(sc, x), sc->is_aritable_symbol)) != sc->undefined))
                                    return(s7_apply_function(sc, func, list_2(sc, x, s7_make_integer(sc, args))) != sc->F);
                                return(is_safe_procedure(x));
                            }

                        case T_VECTOR: case T_INT_VECTOR: case T_FLOAT_VECTOR: case T_BYTE_VECTOR:
                            return((args > 0) &&
                                    (vector_length(x) > 0) &&   /* (#() 0) -> error */
                                    (args <= vector_rank(x)));

                        case T_LET:
                        case T_HASH_TABLE:
                        case T_PAIR:
                            return(args == 1);

                        case T_ITERATOR:
                            return(args == 0);

                        case T_SYNTAX:
                            return((args >= syntax_min_args(x)) && ((args <= syntax_max_args(x)) || (syntax_max_args(x) == -1)));
                    }
                    return(false);
                }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movzbl (%rsi), %eax
decl %eax
cmpl $0x32, %eax
ja 0x420d1
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movb $0x1, %r15b
leaq 0xce516(%rip), %rcx     # 0x1104ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
testq %rbx, %rbx
jle 0x420d1
cmpq $0x0, 0x8(%r14)
jle 0x420d1
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x421c2
movq 0x10(%rax), %rax
jmp 0x421c7
movq 0x8(%r14), %rsi
movb (%rsi), %al
testl %ebx, %ebx
je 0x42083
cmpb $0xa, %al
je 0x421ce
movslq 0x28(%r14), %rax
cmpq $0x40000000, %rax       # imm = 0x40000000
jne 0x42037
movq %r12, %rdi
callq 0x3c299
movl %eax, 0x28(%r14)
testq %rax, %rax
js 0x421db
movslq %ebx, %rcx
cmpq %rcx, %rax
jmp 0x42091
movq 0x8(%r14), %rdx
cmpb $0xa, (%rdx)
je 0x421ce
movq %r12, %rdi
movq %r14, %rsi
callq 0xa0ae3
movl 0x28(%r14), %eax
cmpl $-0x1, %eax
sete %cl
cmpl %ebx, %eax
jmp 0x420b1
cmpq %rbx, 0x18(%r14)
jg 0x420d1
cmpq %rbx, 0x28(%r14)
jmp 0x421ca
cmpq $0x1, %rbx
jmp 0x42091
cmpb $0x1, %al
setne %r15b
jmp 0x421ce
testq %rbx, %rbx
sete %r15b
jmp 0x421ce
movslq 0x18(%r14), %rax
cmpq %rbx, %rax
jg 0x420d1
movslq 0x1c(%r14), %rax
cmpq $-0x1, %rax
sete %cl
cmpq %rbx, %rax
setge %r15b
orb %cl, %r15b
jmp 0x421ce
cmpq $0x1, %rbx
jne 0x420d1
cmpq $0x0, 0x8(%r14)
setg %r15b
jmp 0x421ce
xorl %r15d, %r15d
jmp 0x421ce
movq (%r14), %r15
btl $0x1e, %r15d
jae 0x421b8
cmpb $0x1, 0x24c(%r12)
jne 0x421b8
movq %r12, %rdi
movq %r14, %rsi
callq 0x9a55
movq 0xfd0(%r12), %rdx
movq %r12, %rdi
movq %rax, %rsi
callq 0x99ef
cmpq 0x128(%r12), %rax
je 0x421b8
movq %rax, %r13
movq %r12, %rdi
movq %rbx, %rsi
callq 0xdff8
movq %rax, %rbx
movq 0x90(%r12), %rax
movq 0x110(%r12), %r15
cmpq 0x98(%r12), %rax
ja 0x42155
movq %r12, %rdi
callq 0xb389
movq 0x90(%r12), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%r12)
movq -0x8(%rax), %rax
movl $0x200001, %ecx         # imm = 0x200001
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
movq %r15, 0x10(%rax)
movq 0x90(%r12), %rdx
leaq -0x8(%rdx), %rsi
movq %rsi, 0x90(%r12)
movq -0x8(%rdx), %rdx
movq %rcx, (%rdx)
movq %r14, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movq %r12, %rdi
movq %r13, %rsi
callq 0xbd41
cmpq 0x120(%r12), %rax
jmp 0x42085
shrl $0x15, %r15d
andl $0x1, %r15d
jmp 0x421ce
movl $0x1, %eax
cmpq %rbx, %rax
setge %r15b
movl %r15d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
negq %rax
movslq %ebx, %rcx
cmpq %rax, %rcx
jmp 0x421ca