// File: /workspace/github_c_makefile_star2_O2/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 0x3249d
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movb $0x1, %r15b
leaq 0xa111a(%rip), %rcx     # 0xd34bc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
testq %rbx, %rbx
jle 0x3249d
cmpq $0x0, 0x8(%r14)
jle 0x3249d
movq 0x18(%r14), %rax
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x3258e
movq 0x10(%rax), %rax
jmp 0x32591
movq 0x8(%r14), %rsi
movb (%rsi), %al
testl %ebx, %ebx
je 0x3244f
cmpb $0xa, %al
je 0x32598
movslq 0x28(%r14), %rax
cmpq $0x40000000, %rax       # imm = 0x40000000
jne 0x32403
movq %r12, %rdi
callq 0x2dada
movl %eax, 0x28(%r14)
testq %rax, %rax
js 0x325a5
movslq %ebx, %rcx
cmpq %rcx, %rax
jmp 0x3245d
movq 0x8(%r14), %rdx
cmpb $0xa, (%rdx)
je 0x32598
movq %r12, %rdi
movq %r14, %rsi
callq 0x7b672
movl 0x28(%r14), %eax
cmpl $-0x1, %eax
sete %cl
cmpl %ebx, %eax
jmp 0x3247d
cmpq %rbx, 0x18(%r14)
jg 0x3249d
cmpq %rbx, 0x28(%r14)
jmp 0x32594
cmpq $0x1, %rbx
jmp 0x3245d
cmpb $0x1, %al
setne %r15b
jmp 0x32598
testq %rbx, %rbx
sete %r15b
jmp 0x32598
movslq 0x18(%r14), %rax
cmpq %rbx, %rax
jg 0x3249d
movslq 0x1c(%r14), %rax
cmpq $-0x1, %rax
sete %cl
cmpq %rbx, %rax
setge %r15b
orb %cl, %r15b
jmp 0x32598
cmpq $0x1, %rbx
jne 0x3249d
cmpq $0x0, 0x8(%r14)
setg %r15b
jmp 0x32598
xorl %r15d, %r15d
jmp 0x32598
movq (%r14), %r15
btl $0x1e, %r15d
jae 0x32584
cmpb $0x1, 0x24c(%r12)
jne 0x32584
movq %r12, %rdi
movq %r14, %rsi
callq 0x88f3
movq 0xfd0(%r12), %rdx
movq %r12, %rdi
movq %rax, %rsi
callq 0x888f
cmpq 0x128(%r12), %rax
je 0x32584
movq %rax, %r13
movq %r12, %rdi
movq %rbx, %rsi
callq 0xc049
movq %rax, %rbx
movq 0x90(%r12), %rax
movq 0x110(%r12), %r15
cmpq 0x98(%r12), %rax
ja 0x32529
movq %r12, %rdi
callq 0x9c27
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 0xa34c
cmpq 0x120(%r12), %rax
jmp 0x32451
shrl $0x15, %r15d
andl $0x1, %r15d
jmp 0x32598
pushq $0x1
popq %rax
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 0x32594