// File: /workspace/github_c_makefile_star2_O1/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, %r14
movq 0x8(%rsi), %rax
movzbl (%rax), %ecx
addl $-0xb, %ecx
cmpl $0x3, %ecx
ja 0x721a7
movq 0x10(%r14), %rbp
leaq 0x9eac0(%rip), %rdx     # 0x110a84
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
movq %rdi, 0x8(%rsp)
jmpq *%rcx
movq 0x8(%rax), %r13
cvtsi2sd %r13, %xmm0
leaq 0x9ead2(%rip), %rax     # 0x110ab4
movq 0x8(%rbp), %r15
movq 0x10(%rbp), %rbp
movzbl (%r15), %ecx
addl $-0xb, %ecx
cmpl $0x3, %ecx
ja 0x7235f
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpq 0x8(%r15), %r13
je 0x72024
jmp 0x721d2
movsd 0x8(%r15), %xmm1
ucomisd %xmm0, %xmm1
jne 0x721d2
jp 0x721d2
cmpq 0x110(%rdi), %rbp
jne 0x71fe2
jmp 0x7219b
movsd 0x8(%rax), %xmm1
leaq 0x9ea56(%rip), %rax     # 0x110a94
movq 0x8(%rbp), %r15
movq 0x10(%rbp), %rbp
movzbl (%r15), %ecx
addl $-0xb, %ecx
cmpl $0x3, %ecx
ja 0x7241c
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%r15), %xmm0
ucomisd %xmm0, %xmm1
jmp 0x7209c
movq 0x8(%r15), %rcx
movq 0x10(%r15), %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 0x7209c
ucomisd 0x8(%r15), %xmm1
jne 0x721d2
jp 0x721d2
cmpq 0x110(%rdi), %rbp
jne 0x7203e
jmp 0x7219b
movsd 0x8(%rax), %xmm0
movsd 0x10(%rax), %xmm1
movq 0x8(%rbp), %r15
movq 0x10(%rbp), %rbp
movzbl (%r15), %eax
cmpl $0xe, %eax
jne 0x721c6
ucomisd 0x8(%r15), %xmm0
jne 0x721d2
jp 0x721d2
ucomisd 0x10(%r15), %xmm1
jne 0x721d2
jp 0x721d2
cmpq 0x110(%rdi), %rbp
jne 0x720c0
jmp 0x7219b
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 0x9e96c(%rip), %rax     # 0x110aa4
xorpd %xmm2, %xmm2
movq 0x8(%rbp), %r15
movq 0x10(%rbp), %rbp
movzbl (%r15), %ecx
addl $-0xb, %ecx
cmpl $0x3, %ecx
ja 0x724f2
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpq 0x8(%r15), %rsi
jne 0x721d2
cmpq 0x10(%r15), %rdx
je 0x72192
jmp 0x721d2
movapd %xmm2, %xmm3
cmpeqsd %xmm0, %xmm3
movapd %xmm3, %xmm4
andpd %xmm1, %xmm4
andnpd %xmm2, %xmm3
orpd %xmm4, %xmm3
ucomisd 0x8(%r15), %xmm3
movapd %xmm3, %xmm2
jne 0x721d2
jp 0x721d2
cmpq 0x110(%rdi), %rbp
jne 0x7213c
movq 0x118(%rdi), %rax
jmp 0x722b4
movq 0xea0(%rdi), %rdx
movq 0xeb1eb(%rip), %r8      # 0x15d3a0
movq %rax, %rsi
movq %r14, %rcx
movl $0x1, %r9d
jmp 0x72656
addl $-0xb, %eax
cmpl $0x3, %eax
jae 0x72383
cmpb $0x1, (%rbp)
jne 0x722ad
leaq 0xe078d(%rip), %rbx     # 0x152970
movq 0x8(%rbp), %r15
movzbl (%r15), %eax
cmpb $0x0, (%rax,%rbx)
jne 0x7229f
testb $0x40, 0x3(%r15)
je 0x722c3
cmpb $0x1, 0x24c(%rdi)
jne 0x722c3
movq %r15, %rsi
callq 0x9a55
movq 0x8(%rsp), %rcx
movq 0x1120(%rcx), %rdx
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x99ef
movq 0x8(%rsp), %rdi
cmpq 0x128(%rdi), %rax
je 0x722c3
movq %rax, %r12
movq 0x90(%rdi), %rax
movq 0x110(%rdi), %r13
cmpq 0x98(%rdi), %rax
ja 0x72264
callq 0xb389
movq 0x8(%rsp), %rdi
movq 0x90(%rdi), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rdi)
movq -0x8(%rax), %rdx
movq $0x200001, (%rdx)       # imm = 0x200001
movq %r15, 0x8(%rdx)
movq %r13, 0x10(%rdx)
movq %r12, %rsi
callq 0xbd41
movq 0x8(%rsp), %rdi
cmpq 0x120(%rdi), %rax
je 0x722c3
movq 0x10(%rbp), %rbp
cmpb $0x1, (%rbp)
je 0x721e3
movq 0x120(%rdi), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xea0(%rdi), %rax
movl $0x1, %ecx
cmpq %r14, %rbp
je 0x722df
incl %ecx
movq 0x10(%r14), %r14
cmpq %rbp, %r14
jne 0x722d4
movq 0x8(%rax), %r14
movslq %ecx, %r15
cmpl $0x7ff, %r15d           # imm = 0x7FF
ja 0x722fc
leaq 0xdc65a(%rip), %rax     # 0x14e950
movq (%rax,%r15,8), %rdx
jmp 0x72337
movq 0x90(%rdi), %rax
cmpq 0x98(%rdi), %rax
ja 0x72316
callq 0xb389
movq 0x8(%rsp), %rdi
movq 0x90(%rdi), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rdi)
movq -0x8(%rax), %rdx
movq $0xb, (%rdx)
movq %r15, 0x8(%rdx)
movq 0x8(%rbp), %rcx
movq 0x140(%rdi), %r8
movq 0xeb057(%rip), %r9      # 0x15d3a0
movq %r14, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb31d
movq 0xea0(%rdi), %rdx
cmpq $0x7ff, %r13            # imm = 0x7FF
ja 0x7258d
leaq 0xdc5d6(%rip), %rax     # 0x14e950
movq (%rax,%r13,8), %r12
jmp 0x725d0
movq 0xea0(%rdi), %r12
callq 0xe101
movq 0x8(%rsp), %rdi
movq %rax, %r13
movq 0x90(%rdi), %rax
cmpq 0x98(%rdi), %rax
ja 0x723b1
callq 0xb389
movq 0x8(%rsp), %rdi
movq 0x90(%rdi), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rdi)
movq -0x8(%rax), %rax
movl $0x200001, %edx         # imm = 0x200001
movq %rdx, (%rax)
movq %r15, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq 0x90(%rdi), %rcx
leaq -0x8(%rcx), %rsi
movq %rsi, 0x90(%rdi)
movq -0x8(%rcx), %rcx
movq %rdx, (%rcx)
movq %r13, 0x8(%rcx)
movq %rax, 0x10(%rcx)
movq 0xeafa1(%rip), %r8      # 0x15d3a0
xorl %r9d, %r9d
cmpq %r14, %rbp
je 0x72582
movq 0x10(%r14), %r14
incl %r9d
cmpq %rbp, %r14
jne 0x7240b
jmp 0x72582
movq 0xea0(%rdi), %r12
movq 0x90(%rdi), %rax
cmpq 0x98(%rdi), %rax
ja 0x72449
movsd %xmm1, 0x10(%rsp)
callq 0xb389
movsd 0x10(%rsp), %xmm1
movq 0x8(%rsp), %rdi
movq 0x90(%rdi), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rdi)
movq -0x8(%rax), %r13
movq $0xd, (%r13)
movsd %xmm1, 0x8(%r13)
movq 0x90(%rdi), %rax
cmpq 0x98(%rdi), %rax
ja 0x72487
callq 0xb389
movq 0x8(%rsp), %rdi
movq 0x90(%rdi), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rdi)
movq -0x8(%rax), %rax
movl $0x200001, %edx         # imm = 0x200001
movq %rdx, (%rax)
movq %r15, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq 0x90(%rdi), %rcx
leaq -0x8(%rcx), %rsi
movq %rsi, 0x90(%rdi)
movq -0x8(%rcx), %rcx
movq %rdx, (%rcx)
movq %r13, 0x8(%rcx)
movq %rax, 0x10(%rcx)
movq 0xeaecb(%rip), %r8      # 0x15d3a0
xorl %r9d, %r9d
cmpq %r14, %rbp
je 0x72582
movq 0x10(%r14), %r14
incl %r9d
cmpq %rbp, %r14
jne 0x724e1
jmp 0x72582
movq 0xea0(%rdi), %r12
callq 0xdd7f
movq 0x8(%rsp), %rdi
movq %rax, %r13
movq 0x90(%rdi), %rax
cmpq 0x98(%rdi), %rax
ja 0x72520
callq 0xb389
movq 0x8(%rsp), %rdi
movq 0x90(%rdi), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rdi)
movq -0x8(%rax), %rax
movl $0x200001, %edx         # imm = 0x200001
movq %rdx, (%rax)
movq %r15, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq 0x90(%rdi), %rcx
leaq -0x8(%rcx), %rsi
movq %rsi, 0x90(%rdi)
movq -0x8(%rcx), %rcx
movq %rdx, (%rcx)
movq %r13, 0x8(%rcx)
movq %rax, 0x10(%rcx)
movq 0xeae32(%rip), %r8      # 0x15d3a0
xorl %r9d, %r9d
cmpq %r14, %rbp
je 0x72582
movq 0x10(%r14), %r14
incl %r9d
cmpq %rbp, %r14
jne 0x72576
movq %r15, %rsi
movq %r12, %rdx
jmp 0x72656
movq 0x90(%rdi), %rax
cmpq 0x98(%rdi), %rax
ja 0x725ad
movq %rdx, %r12
callq 0xb389
movq 0x8(%rsp), %rdi
movq %r12, %rdx
movq 0x90(%rdi), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rdi)
movq -0x8(%rax), %r12
movq $0xb, (%r12)
movq %r13, 0x8(%r12)
movq 0x90(%rdi), %rax
cmpq 0x98(%rdi), %rax
ja 0x725f0
movq %rdx, %r13
callq 0xb389
movq 0x8(%rsp), %rdi
movq %r13, %rdx
movq 0x90(%rdi), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rdi)
movq -0x8(%rax), %rax
movl $0x200001, %r8d         # imm = 0x200001
movq %r8, (%rax)
movq %r15, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq 0x90(%rdi), %rcx
leaq -0x8(%rcx), %rsi
movq %rsi, 0x90(%rdi)
movq -0x8(%rcx), %rcx
movq %r8, (%rcx)
movq %r12, 0x8(%rcx)
movq %rax, 0x10(%rcx)
movq 0xead61(%rip), %r8      # 0x15d3a0
xorl %r9d, %r9d
cmpq %r14, %rbp
je 0x72653
movq 0x10(%r14), %r14
incl %r9d
cmpq %rbp, %r14
jne 0x72647
movq %r15, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf3da