// File: /workspace/github_c_makefile_star2_O3/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 0x6ca68
movq 0x10(%r14), %rbp
leaq 0x9b27f(%rip), %rdx     # 0x107b04
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
movq %rdi, 0x8(%rsp)
jmpq *%rcx
movq 0x8(%rax), %r13
cvtsi2sd %r13, %xmm0
leaq 0x9b291(%rip), %rax     # 0x107b34
movq 0x8(%rbp), %r15
movq 0x10(%rbp), %rbp
movzbl (%r15), %ecx
addl $-0xb, %ecx
cmpl $0x3, %ecx
ja 0x6cc23
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpq 0x8(%r15), %r13
je 0x6c8e5
jmp 0x6ca93
movsd 0x8(%r15), %xmm1
ucomisd %xmm0, %xmm1
jne 0x6ca93
jp 0x6ca93
cmpq 0x110(%rdi), %rbp
jne 0x6c8a3
jmp 0x6ca5c
movsd 0x8(%rax), %xmm1
leaq 0x9b215(%rip), %rax     # 0x107b14
movq 0x8(%rbp), %r15
movq 0x10(%rbp), %rbp
movzbl (%r15), %ecx
addl $-0xb, %ecx
cmpl $0x3, %ecx
ja 0x6cce0
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%r15), %xmm0
ucomisd %xmm0, %xmm1
jmp 0x6c95d
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 0x6c95d
ucomisd 0x8(%r15), %xmm1
jne 0x6ca93
jp 0x6ca93
cmpq 0x110(%rdi), %rbp
jne 0x6c8ff
jmp 0x6ca5c
movsd 0x8(%rax), %xmm0
movsd 0x10(%rax), %xmm1
movq 0x8(%rbp), %r15
movq 0x10(%rbp), %rbp
movzbl (%r15), %eax
cmpl $0xe, %eax
jne 0x6ca87
ucomisd 0x8(%r15), %xmm0
jne 0x6ca93
jp 0x6ca93
ucomisd 0x10(%r15), %xmm1
jne 0x6ca93
jp 0x6ca93
cmpq 0x110(%rdi), %rbp
jne 0x6c981
jmp 0x6ca5c
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 0x9b12b(%rip), %rax     # 0x107b24
xorpd %xmm2, %xmm2
movq 0x8(%rbp), %r15
movq 0x10(%rbp), %rbp
movzbl (%r15), %ecx
addl $-0xb, %ecx
cmpl $0x3, %ecx
ja 0x6cdb6
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpq 0x8(%r15), %rsi
jne 0x6ca93
cmpq 0x10(%r15), %rdx
je 0x6ca53
jmp 0x6ca93
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 0x6ca93
jp 0x6ca93
cmpq 0x110(%rdi), %rbp
jne 0x6c9fd
movq 0x118(%rdi), %rax
jmp 0x6cb75
movq 0xea0(%rdi), %rdx
movq 0xe892a(%rip), %r8      # 0x1553a0
movq %rax, %rsi
movq %r14, %rcx
movl $0x1, %r9d
jmp 0x6cf1a
addl $-0xb, %eax
cmpl $0x3, %eax
jae 0x6cc47
cmpb $0x1, (%rbp)
jne 0x6cb6e
leaq 0xddecc(%rip), %rbx     # 0x14a970
movq 0x8(%rbp), %r15
movzbl (%r15), %eax
cmpb $0x0, (%rax,%rbx)
jne 0x6cb60
testb $0x40, 0x3(%r15)
je 0x6cb84
cmpb $0x1, 0x24c(%rdi)
jne 0x6cb84
movq %r15, %rsi
callq 0x8a63
movq 0x8(%rsp), %rcx
movq 0x1120(%rcx), %rdx
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x89ff
movq 0x8(%rsp), %rdi
cmpq 0x128(%rdi), %rax
je 0x6cb84
movq %rax, %r12
movq 0x90(%rdi), %rax
movq 0x110(%rdi), %r13
cmpq 0x98(%rdi), %rax
ja 0x6cb2c
callq 0xa550
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 0xaee6
movq 0x8(%rsp), %rdi
cmpq 0x120(%rdi), %rax
je 0x6cb84
movq 0x10(%rbp), %rbp
cmpb $0x1, (%rbp)
je 0x6caa4
movq 0x120(%rdi), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xea0(%rdi), %rax
movq 0x8(%rax), %r15
cmpq %r14, %rbp
je 0x6cbea
xorl %eax, %eax
movq 0x10(%r14), %r14
incq %rax
cmpq %rbp, %r14
jne 0x6cb96
leaq 0x1(%rax), %r14
cmpl $0x7fe, %eax            # imm = 0x7FE
jbe 0x6cbf0
movq 0x90(%rdi), %rax
cmpq 0x98(%rdi), %rax
ja 0x6cbce
callq 0xa550
movq 0x8(%rsp), %rdi
movq 0x90(%rdi), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rdi)
movq -0x8(%rax), %rdx
movq $0xb, (%rdx)
movq %r14, 0x8(%rdx)
jmp 0x6cbfb
movl $0x1, %r14d
leaq 0xd9d59(%rip), %rax     # 0x146950
movq (%rax,%r14,8), %rdx
movq 0x8(%rbp), %rcx
movq 0x140(%rdi), %r8
movq 0xe8793(%rip), %r9      # 0x1553a0
movq %r15, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa4e4
movq 0xea0(%rdi), %rdx
cmpq $0x7ff, %r13            # imm = 0x7FF
ja 0x6ce51
leaq 0xd9d12(%rip), %rax     # 0x146950
movq (%rax,%r13,8), %r12
jmp 0x6ce94
movq 0xea0(%rdi), %r12
callq 0xd387
movq 0x8(%rsp), %rdi
movq %rax, %r13
movq 0x90(%rdi), %rax
cmpq 0x98(%rdi), %rax
ja 0x6cc7c
callq 0xa550
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 0xe86dd(%rip), %r8      # 0x1553a0
xorl %r9d, %r9d
cmpq %r14, %rbp
je 0x6ce46
movq 0x10(%r14), %r14
incl %r9d
cmpq %rbp, %r14
jne 0x6cccf
jmp 0x6ce46
movq 0xea0(%rdi), %r12
movq 0x90(%rdi), %rax
cmpq 0x98(%rdi), %rax
ja 0x6cd14
movsd %xmm1, 0x10(%rsp)
callq 0xa550
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 0x6cd52
callq 0xa550
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 0xe8607(%rip), %r8      # 0x1553a0
xorl %r9d, %r9d
cmpq %r14, %rbp
je 0x6ce46
movq 0x10(%r14), %r14
incl %r9d
cmpq %rbp, %r14
jne 0x6cda5
jmp 0x6ce46
movq 0xea0(%rdi), %r12
callq 0xcfa8
movq 0x8(%rsp), %rdi
movq %rax, %r13
movq 0x90(%rdi), %rax
cmpq 0x98(%rdi), %rax
ja 0x6cdeb
callq 0xa550
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 0xe856e(%rip), %r8      # 0x1553a0
xorl %r9d, %r9d
cmpq %r14, %rbp
je 0x6ce46
movq 0x10(%r14), %r14
incl %r9d
cmpq %rbp, %r14
jne 0x6ce3a
movq %r15, %rsi
movq %r12, %rdx
jmp 0x6cf1a
movq 0x90(%rdi), %rax
cmpq 0x98(%rdi), %rax
ja 0x6ce78
movq %rdx, %r12
callq 0xa550
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 0x6cebb
movq %rdx, %r13
callq 0xa550
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 0xe849d(%rip), %r8      # 0x1553a0
xorl %r9d, %r9d
cmpq %r14, %rbp
je 0x6cf17
movq 0x10(%r14), %r14
incl %r9d
cmpq %rbp, %r14
jne 0x6cf0b
movq %r15, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe659