// File: /workspace/github_c_makefile_star2_O2/BernardTatin[P]s7sh/s7.c
// Function: g_num_eq
static s7_pointer g_num_eq(s7_scheme *sc, s7_pointer args)
    {
#define H_num_eq "(= z1 ...) returns #t if all its arguments are equal"
#define Q_num_eq s7_make_circular_signature(sc, 1, 2, sc->is_boolean_symbol, sc->is_number_symbol)
        s7_pointer x, p;
        s7_int num_a, den_a;
        s7_double rl_a, im_a;

        x = car(args);
        p = cdr(args);

        switch (type(x))
        {
            case T_INTEGER:
                num_a = integer(x);
                while (true)
                {
                    x = car(p);
                    p = cdr(p);
                    switch (type(x))
                    {
                        case T_INTEGER:
                            if (num_a != integer(x)) goto NOT_EQUAL;
                            break;

                        case T_RATIO:
                        case T_COMPLEX:
                            goto NOT_EQUAL;

                        case T_REAL:
                            if (num_a != real(x)) goto NOT_EQUAL;
                            break;

                        default:
                            return(method_or_bust_with_type(sc, x, sc->num_eq_symbol, cons_unchecked(sc, make_integer(sc, num_a), cons(sc, x, p)), a_number_string, position_of(p, args) - 1));
                    }
                    if (is_null(p))
                        return(sc->T);
                }

            case T_RATIO:
                num_a = numerator(x);
                den_a = denominator(x);
                rl_a = 0.0;
                while (true)
                {
                    x = car(p);
                    p = cdr(p);
                    switch (type(x))
                    {
                        case T_INTEGER:
                        case T_COMPLEX:
                            goto NOT_EQUAL;

                        case T_RATIO:
                            if ((num_a != numerator(x)) || (den_a != denominator(x)))	goto NOT_EQUAL; /* hidden cast here */
                            break;

                        case T_REAL:
                            if (rl_a == 0.0)
                                rl_a = ((long_double)num_a) / ((long_double)den_a);
                            if (rl_a != real(x)) goto NOT_EQUAL;
                            break;

                        default:
                            return(method_or_bust_with_type(sc, x, sc->num_eq_symbol, cons_unchecked(sc, s7_make_ratio(sc, num_a, den_a), cons(sc, x, p)), a_number_string, position_of(p, args) - 1));
                    }
                    if (is_null(p))
                        return(sc->T);
                }

            case T_REAL:
                rl_a = real(x);
                while (true)
                {
                    x = car(p);
                    p = cdr(p);
                    switch (type(x))
                    {
                        case T_INTEGER:
                            if (rl_a != integer(x)) goto NOT_EQUAL;
                            break;

                        case T_RATIO:
                            if (rl_a != (double)fraction(x)) goto NOT_EQUAL;
                            /* the cast to double is needed because rl_a is s7_double and we want (= ratio real) to be the same as (= real ratio):
                             *   (= 1.0 9223372036854775807/9223372036854775806)
                             *   (= 9223372036854775807/9223372036854775806 1.0)
                             */
                            break;

                        case T_REAL:
                            if (rl_a != real(x)) goto NOT_EQUAL;
                            break;

                        case T_COMPLEX:
                            goto NOT_EQUAL;

                        default:
                            return(method_or_bust_with_type(sc, x, sc->num_eq_symbol, cons_unchecked(sc, make_real(sc, rl_a), cons(sc, x, p)), a_number_string, position_of(p, args) - 1));
                    }
                    if (is_null(p))
                        return(sc->T);
                }

            case T_COMPLEX:
                rl_a = real_part(x);
                im_a = imag_part(x);
                while (true)
                {
                    x = car(p);
                    p = cdr(p);
                    switch (type(x))
                    {
                        case T_INTEGER:
                        case T_RATIO:
                        case T_REAL:
                            goto NOT_EQUAL;

                        case T_COMPLEX:
                            if ((rl_a != real_part(x)) || (im_a != imag_part(x)))
                                goto NOT_EQUAL;
                            break;

                        default:
                            return(method_or_bust_with_type(sc, x, sc->num_eq_symbol, cons_unchecked(sc, s7_make_complex(sc, rl_a, im_a), cons(sc, x, p)), a_number_string, position_of(p, args) - 1));
                    }
                    if (is_null(p))
                        return(sc->T);
                }

            default:
                return(method_or_bust_with_type(sc, x, sc->num_eq_symbol, args, a_number_string, 1));
        }

NOT_EQUAL:
        for (; is_pair(p); p = cdr(p))
            if (!is_number_via_method(sc, car(p)))
                return(wrong_type_argument_with_type(sc, sc->num_eq_symbol, position_of(p, args), car(p), a_number_string));

        return(sc->F);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rsi), %rax
movzbl (%rax), %ecx
addl $-0xb, %ecx
cmpl $0x3, %ecx
ja 0x579ad
movq 0x10(%r15), %r14
leaq 0x7c321(%rip), %rdx     # 0xd3ae4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x8(%rax), %r13
cvtsi2sd %r13, %xmm0
leaq 0x7c338(%rip), %rax     # 0xd3b14
movq 0x8(%r14), %r12
movq 0x10(%r14), %r14
movzbl (%r12), %ecx
addl $-0xb, %ecx
cmpl $0x3, %ecx
ja 0x57b50
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpq 0x8(%r12), %r13
je 0x57821
jmp 0x579d9
movsd 0x8(%r12), %xmm1
ucomisd %xmm0, %xmm1
jne 0x579d9
jp 0x579d9
cmpq 0x110(%rbx), %r14
jne 0x577dc
jmp 0x579a1
movsd 0x8(%rax), %xmm1
leaq 0x7c2b9(%rip), %rax     # 0xd3af4
movq 0x8(%r14), %r12
movq 0x10(%r14), %r14
movzbl (%r12), %ecx
addl $-0xb, %ecx
cmpl $0x3, %ecx
ja 0x57b8f
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cvtsi2sdq 0x8(%r12), %xmm0
ucomisd %xmm0, %xmm1
jmp 0x5789b
movq 0x8(%r12), %rcx
movq 0x10(%r12), %rdx
movq %rcx, 0x40(%rsp)
fildll 0x40(%rsp)
movq %rdx, 0x38(%rsp)
fildll 0x38(%rsp)
fdivrp %st, %st(1)
fstpl 0x30(%rsp)
ucomisd 0x30(%rsp), %xmm1
jmp 0x5789b
ucomisd 0x8(%r12), %xmm1
jne 0x579d9
jp 0x579d9
cmpq 0x110(%rbx), %r14
jne 0x5783b
jmp 0x579a1
movsd 0x8(%rax), %xmm0
movsd 0x10(%rax), %xmm1
movq 0x8(%r14), %r12
movq 0x10(%r14), %r14
movzbl (%r12), %eax
cmpl $0xe, %eax
jne 0x579cd
ucomisd 0x8(%r12), %xmm0
jne 0x579d9
jp 0x579d9
ucomisd 0x10(%r12), %xmm1
jne 0x579d9
jp 0x579d9
cmpq 0x110(%rbx), %r14
jne 0x578bf
jmp 0x579a1
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %rsi, 0x28(%rsp)
fildll 0x28(%rsp)
movq %rdx, 0x20(%rsp)
fildll 0x20(%rsp)
fdivrp %st, %st(1)
fstpl 0x18(%rsp)
xorpd %xmm0, %xmm0
movsd 0x18(%rsp), %xmm1
leaq 0x7c1ca(%rip), %rax     # 0xd3b04
xorpd %xmm2, %xmm2
movq 0x8(%r14), %r12
movq 0x10(%r14), %r14
movzbl (%r12), %ecx
addl $-0xb, %ecx
cmpl $0x3, %ecx
ja 0x57be8
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpq 0x8(%r12), %rsi
jne 0x579d9
cmpq 0x10(%r12), %rdx
je 0x57998
jmp 0x579d9
movapd %xmm2, %xmm3
cmpeqsd %xmm0, %xmm3
movapd %xmm3, %xmm4
andpd %xmm1, %xmm4
andnpd %xmm2, %xmm3
orpd %xmm4, %xmm3
ucomisd 0x8(%r12), %xmm3
movapd %xmm3, %xmm2
jne 0x579d9
jp 0x579d9
cmpq 0x110(%rbx), %r14
jne 0x5793e
movq 0x118(%rbx), %rax
jmp 0x57add
movq 0xea0(%rbx), %rdx
movq 0xcc9e5(%rip), %r8      # 0x1243a0
pushq $0x1
popq %r9
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rcx
jmp 0x57d4e
addl $-0xb, %eax
cmpl $0x3, %eax
jae 0x57b79
movq %r15, 0x8(%rsp)
leaq 0xc1f8b(%rip), %rbp     # 0x119970
cmpb $0x1, (%r14)
jne 0x57ad6
movq 0x8(%r14), %r12
movzbl (%r12), %eax
cmpb $0x0, (%rax,%rbp)
jne 0x57a9c
testb $0x40, 0x3(%r12)
je 0x57aa5
cmpb $0x1, 0x24c(%rbx)
jne 0x57aa5
movq %rbx, %rdi
movq %r12, %rsi
callq 0x88f3
movq 0x1120(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x888f
cmpq 0x128(%rbx), %rax
je 0x57aa5
movq %rax, %r13
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r15
cmpq 0x98(%rbx), %rax
ja 0x57a6a
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 %r12, 0x8(%rdx)
movq %r15, 0x10(%rdx)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa34c
cmpq 0x120(%rbx), %rax
je 0x57aa5
movq 0x10(%r14), %r14
jmp 0x579e5
movq 0xea0(%rbx), %rax
movq 0x8(%rax), %r12
movq %r14, %rdi
movq 0x8(%rsp), %rsi
callq 0x72a82
movslq %eax, %r15
cmpl $0x7ff, %r15d           # imm = 0x7FF
ja 0x57aec
leaq 0xbde80(%rip), %rax     # 0x115950
movq (%rax,%r15,8), %rdx
jmp 0x57b25
movq 0x120(%rbx), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x57b0b
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 %r15, 0x8(%rdx)
movq 0x8(%r14), %rcx
movq 0x140(%rbx), %r8
movq 0xcc869(%rip), %r9      # 0x1243a0
movq %rbx, %rdi
movq %r12, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9bbb
movq 0xea0(%rbx), %rax
movq %rax, 0x8(%rsp)
cmpq $0x7ff, %r13            # imm = 0x7FF
ja 0x57c8b
leaq 0xbdde0(%rip), %rax     # 0x115950
movq (%rax,%r13,8), %r13
jmp 0x57cc7
movq 0xea0(%rbx), %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
callq 0xc152
jmp 0x57bfc
movq 0xea0(%rbx), %rax
movq %rax, 0x8(%rsp)
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x57bc6
movq %rbx, %rdi
movsd %xmm1, 0x10(%rsp)
callq 0x9c27
movsd 0x10(%rsp), %xmm1
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r13
movq $0xd, (%r13)
movsd %xmm1, 0x8(%r13)
jmp 0x57cc7
movq 0xea0(%rbx), %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
callq 0xbd87
movq %rax, %rbp
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x57c1e
movq %rbx, %rdi
callq 0x9c27
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 %r14, 0x10(%rax)
movq 0x90(%rbx), %rdx
leaq -0x8(%rdx), %rsi
movq %rsi, 0x90(%rbx)
movq -0x8(%rdx), %r13
movq %rcx, (%r13)
movq %rbp, 0x8(%r13)
movq %rax, 0x10(%r13)
movq 0xcc73a(%rip), %rbp     # 0x1243a0
movq %r14, %rdi
movq %r15, %rsi
callq 0x72a82
leal -0x1(%rax), %r9d
movq %rbx, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
movq %r13, %rcx
movq %rbp, %r8
jmp 0x57d4e
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x57caa
movq %rbx, %rdi
callq 0x9c27
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0xb, (%rax)
movq %r13, 0x8(%rax)
movq %rax, %r13
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x57ce6
movq %rbx, %rdi
callq 0x9c27
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 %r14, 0x10(%rax)
movq 0x90(%rbx), %rdx
leaq -0x8(%rdx), %rsi
movq %rsi, 0x90(%rbx)
movq -0x8(%rdx), %rbp
movq %rcx, (%rbp)
movq %r13, 0x8(%rbp)
movq %rax, 0x10(%rbp)
movq 0xcc672(%rip), %r13     # 0x1243a0
movq %r14, %rdi
movq %r15, %rsi
callq 0x72a82
leal -0x1(%rax), %r9d
movq %rbx, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
movq %rbp, %rcx
movq %r13, %r8
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xcf9a