// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: g_complex
static s7_pointer g_complex(s7_scheme *sc, s7_pointer args)
    {
        s7_pointer x, y;
#define H_complex "(complex x1 x2) returns a complex number with real-part x1 and imaginary-part x2"
#define Q_complex s7_make_signature(sc, 3, sc->is_number_symbol, sc->is_real_symbol, sc->is_real_symbol)

        x = car(args);
        y = cadr(args);

        switch (type(y))
        {
            case T_INTEGER:
                switch (type(x))
                {
                    case T_INTEGER:
                        if (integer(y) == 0) return(x);
                        return(c_complex(sc, (s7_double)integer(x), (s7_double)integer(y)));

                    case T_RATIO:
                        if (integer(y) == 0) return(x);
                        return(c_complex(sc, (s7_double)fraction(x), (s7_double)integer(y)));

                    case T_REAL:
                        if (integer(y) == 0) return(x);
                        return(c_complex(sc, real(x), (s7_double)integer(y)));

                    default:
                        return(method_or_bust(sc, x, sc->complex_symbol, args, T_REAL, 1));
                }

            case T_RATIO:
                switch (type(x))
                {
                    case T_INTEGER: return(c_complex(sc, (s7_double)integer(x), (s7_double)fraction(y)));
                    case T_RATIO:   return(c_complex(sc, (s7_double)fraction(x), (s7_double)fraction(y)));
                    case T_REAL:    return(c_complex(sc, real(x), (s7_double)fraction(y)));
                    default:
                                    return(method_or_bust(sc, x, sc->complex_symbol, args, T_REAL, 1));
                }

            case T_REAL:
                switch (type(x))
                {
                    case T_INTEGER:
                        if (real(y) == 0.0) return(x);
                        return(c_complex(sc, (s7_double)integer(x), real(y)));

                    case T_RATIO:
                        if (real(y) == 0.0) return(x);
                        return(c_complex(sc, (s7_double)fraction(x), real(y)));

                    case T_REAL:
                        if (real(y) == 0.0) return(x);
                        return(c_complex(sc, real(x), real(y)));

                    default:
                        return(method_or_bust(sc, x, sc->complex_symbol, args, T_REAL, 1));
                }

            default:
                return(method_or_bust(sc, (is_let(x)) ? x : y, sc->complex_symbol, args, T_REAL, 2));
        }
    }

// Assembly:
pushq %rbx
subq $0xa0, %rsp
movq %rsi, %rcx
movq %rdi, %rbx
movq 0x8(%rsi), %rax
movq 0x10(%rsi), %rdx
movq 0x8(%rdx), %rsi
movzbl (%rsi), %edi
movzbl (%rax), %edx
cmpl $0xd, %edi
je 0x65826
cmpl $0xc, %edi
je 0x657da
cmpl $0xb, %edi
jne 0x65860
cmpl $0xd, %edx
je 0x65a58
cmpl $0xc, %edx
je 0x659aa
cmpl $0xb, %edx
jne 0x6587f
movq 0x8(%rsi), %rcx
testq %rcx, %rcx
je 0x65ac0
cvtsi2sdq 0x8(%rax), %xmm0
cvtsi2sd %rcx, %xmm1
jmp 0x65924
cmpl $0xd, %edx
je 0x658f3
cmpl $0xc, %edx
je 0x658a5
cmpl $0xb, %edx
jne 0x6587f
cvtsi2sdq 0x8(%rax), %xmm0
movq 0x8(%rsi), %rax
movq 0x10(%rsi), %rcx
movq %rax, 0x38(%rsp)
fildll 0x38(%rsp)
movq %rcx, 0x30(%rsp)
fildll 0x30(%rsp)
fdivrp %st, %st(1)
fstpl 0x28(%rsp)
movsd 0x28(%rsp), %xmm1
jmp 0x65924
cmpl $0xd, %edx
je 0x659e7
cmpl $0xc, %edx
je 0x6595b
cmpl $0xb, %edx
jne 0x6587f
movsd 0x8(%rsi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x65852
jnp 0x65ac0
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rax), %xmm0
jmp 0x65a01
cmpl $0x1c, %edx
cmoveq %rax, %rsi
movq 0xe10(%rbx), %rdx
movq %rbx, %rdi
movl $0xd, %r8d
movl $0x2, %r9d
jmp 0x65898
movq 0xe10(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
movl $0xd, %r8d
movl $0x1, %r9d
addq $0xa0, %rsp
popq %rbx
jmp 0xe42d
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rax
movq %rcx, 0x58(%rsp)
fildll 0x58(%rsp)
movq %rax, 0x50(%rsp)
fildll 0x50(%rsp)
fdivrp %st, %st(1)
fstpl 0x48(%rsp)
movsd 0x48(%rsp), %xmm0
movq 0x8(%rsi), %rax
movq 0x10(%rsi), %rcx
movq %rax, 0x68(%rsp)
fildll 0x68(%rsp)
movq %rcx, 0x60(%rsp)
fildll 0x60(%rsp)
fdivrp %st, %st(1)
fstpl 0x40(%rsp)
movsd 0x40(%rsp), %xmm1
jmp 0x65924
movsd 0x8(%rax), %xmm0
movq 0x8(%rsi), %rax
movq 0x10(%rsi), %rcx
movq %rax, 0x80(%rsp)
fildll 0x80(%rsp)
movq %rcx, 0x78(%rsp)
fildll 0x78(%rsp)
fdivrp %st, %st(1)
fstpl 0x70(%rsp)
movsd 0x70(%rsp), %xmm1
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x65a36
movq %rbx, %rdi
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, (%rsp)
callq 0xa550
movsd (%rsp), %xmm1
movsd 0x8(%rsp), %xmm0
jmp 0x65a2f
movsd 0x8(%rsi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x65970
jnp 0x65ac0
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rax
movq %rcx, 0x98(%rsp)
fildll 0x98(%rsp)
movq %rax, 0x90(%rsp)
fildll 0x90(%rsp)
fdivrp %st, %st(1)
fstpl 0x88(%rsp)
movsd 0x88(%rsp), %xmm0
jmp 0x65a01
movq 0x8(%rsi), %rcx
testq %rcx, %rcx
je 0x65ac0
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rax
movq %rdx, 0x20(%rsp)
fildll 0x20(%rsp)
movq %rax, 0x18(%rsp)
fildll 0x18(%rsp)
fdivrp %st, %st(1)
fstpl 0x10(%rsp)
cvtsi2sd %rcx, %xmm0
movsd 0x10(%rsp), %xmm1
jmp 0x65a6b
movsd 0x8(%rsi), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x659fc
jnp 0x65ac0
movsd 0x8(%rax), %xmm0
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x65a36
movq %rbx, %rdi
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, (%rsp)
callq 0xa550
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0xe, (%rax)
movsd %xmm0, 0x8(%rax)
movsd %xmm1, 0x10(%rax)
jmp 0x65ac0
movq 0x8(%rsi), %rcx
testq %rcx, %rcx
je 0x65ac0
cvtsi2sd %rcx, %xmm0
movsd 0x8(%rax), %xmm1
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x65aa0
movq %rbx, %rdi
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, (%rsp)
callq 0xa550
movsd (%rsp), %xmm1
movsd 0x8(%rsp), %xmm0
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0xe, (%rax)
movsd %xmm1, 0x8(%rax)
movsd %xmm0, 0x10(%rax)
addq $0xa0, %rsp
popq %rbx
retq