// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_make_polar
static s7_pointer g_make_polar(s7_scheme *sc, s7_pointer args)
    {
        s7_pointer x, y;
        s7_double ang, mag;
#define H_make_polar "(make-polar mag ang) returns a complex number with magnitude mag and angle ang"
#define Q_make_polar 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(x))
        {
            case T_INTEGER:
                switch (type(y))
                {
                    case T_INTEGER:
                        if (integer(x) == 0) return(x);            /* (make-polar 0 1) -> 0 */
                        if (integer(y) == 0) return(x);            /* (make-polar 1 0) -> 1 */
                        mag = (s7_double)integer(x);
                        ang = (s7_double)integer(y);
                        break;

                    case T_RATIO:
                        if (integer(x) == 0) return(x);
                        mag = (s7_double)integer(x);
                        ang = (s7_double)fraction(y);
                        break;

                    case T_REAL:
                        ang = real(y);
                        if (ang == 0.0) return(x);
                        if (is_NaN(ang)) return(y);
                        if (is_inf(ang)) return(real_NaN);
                        if ((ang == M_PI) || (ang == -M_PI)) return(make_integer(sc, -integer(x)));
                        mag = (s7_double)integer(x);
                        break;

                    default:
                        return(method_or_bust(sc, y, sc->make_polar_symbol, args, T_REAL, 2));
                }
                break;

            case T_RATIO:
                switch (type(y))
                {
                    case T_INTEGER:
                        if (integer(y) == 0) return(x);
                        mag = (s7_double)fraction(x);
                        ang = (s7_double)integer(y);
                        break;

                    case T_RATIO:
                        mag = (s7_double)fraction(x);
                        ang = (s7_double)fraction(y);
                        break;

                    case T_REAL:
                        ang = real(y);
                        if (ang == 0.0) return(x);
                        if (is_NaN(ang)) return(y);
                        if (is_inf(ang)) return(real_NaN);
                        if ((ang == M_PI) || (ang == -M_PI)) return(make_simple_ratio(sc, -numerator(x), denominator(x)));
                        mag = (s7_double)fraction(x);
                        break;

                    default:
                        return(method_or_bust(sc, y, sc->make_polar_symbol, args, T_REAL, 2));
                }
                break;

            case T_REAL:
                mag = real(x);
                switch (type(y))
                {
                    case T_INTEGER:
                        if (is_NaN(mag)) return(x);
                        if (integer(y) == 0) return(x);
                        ang = (s7_double)integer(y);
                        break;

                    case T_RATIO:
                        if (is_NaN(mag)) return(x);
                        ang = (s7_double)fraction(y);
                        break;

                    case T_REAL:
                        if (is_NaN(mag)) return(x);
                        ang = real(y);
                        if (ang == 0.0) return(x);
                        if (is_NaN(ang)) return(y);
                        if (is_inf(ang)) return(real_NaN);
                        break;

                    default:
                        return(method_or_bust(sc, y, sc->make_polar_symbol, args, T_REAL, 2));
                }
                break;

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

        return(s7_make_complex(sc, mag * cos(ang), mag * sin(ang)));

        /* since sin is inaccurate for large arguments, so is make-polar:
         *    (make-polar 1.0 1e40) -> -0.76267273202438+0.64678458842683i, not 8.218988919070239214448025364432557517335E-1-5.696334009536363273080341815735687231337E-1i
         */
    }

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x108(%rsp)
movq %rsi, 0x100(%rsp)
movq 0x100(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0xf8(%rsp)
movq 0x100(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0xf0(%rsp)
movq 0xf8(%rsp), %rax
movzbl (%rax), %eax
movl %eax, 0x34(%rsp)
subl $0xb, %eax
je 0x88c0a
jmp 0x88be9
movl 0x34(%rsp), %eax
subl $0xc, %eax
je 0x88f9c
jmp 0x88bf8
movl 0x34(%rsp), %eax
subl $0xd, %eax
je 0x89285
jmp 0x894e9
movq 0xf0(%rsp), %rax
movzbl (%rax), %eax
movl %eax, 0x30(%rsp)
subl $0xb, %eax
je 0x88c41
jmp 0x88c20
movl 0x30(%rsp), %eax
subl $0xc, %eax
je 0x88cbc
jmp 0x88c2f
movl 0x30(%rsp), %eax
subl $0xd, %eax
je 0x88d33
jmp 0x88f52
movq 0xf8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x88c65
movq 0xf8(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movq 0xf0(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x88c89
movq 0xf8(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movq 0xf8(%rsp), %rax
cvtsi2sdq 0x8(%rax), %xmm0
movsd %xmm0, 0xe0(%rsp)
movq 0xf0(%rsp), %rax
cvtsi2sdq 0x8(%rax), %xmm0
movsd %xmm0, 0xe8(%rsp)
jmp 0x88f97
movq 0xf8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x88ce0
movq 0xf8(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movq 0xf8(%rsp), %rax
cvtsi2sdq 0x8(%rax), %xmm0
movsd %xmm0, 0xe0(%rsp)
movq 0xf0(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rax
movq %rcx, 0x48(%rsp)
fildll 0x48(%rsp)
movq %rax, 0x40(%rsp)
fildll 0x40(%rsp)
fdivrp %st, %st(1)
fstpl 0x38(%rsp)
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0xe8(%rsp)
jmp 0x88f97
movq 0xf0(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0xe8(%rsp)
movsd 0xe8(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x88d72
jp 0x88d72
movq 0xf8(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movsd 0xe8(%rsp), %xmm0
callq 0x13860
testb $0x1, %al
jne 0x88d86
jmp 0x88d9b
movq 0xf0(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movsd 0xe8(%rsp), %xmm1
movaps %xmm1, %xmm0
movaps 0x158cf2(%rip), %xmm2   # 0x1e1aa0
pand %xmm2, %xmm0
movq %xmm1, %rdx
movl $0x1, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x0, %rdx
cmovll %eax, %ecx
movsd 0x158ba0(%rip), %xmm1   # 0x1e1970
xorl %eax, %eax
ucomisd %xmm1, %xmm0
setnp %sil
sete %dl
testb %sil, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
je 0x88dfc
movq 0x194be1(%rip), %rax    # 0x21d9d0
movq %rax, 0x110(%rsp)
jmp 0x895a8
movsd 0xe8(%rsp), %xmm0
movsd 0x158bcb(%rip), %xmm1   # 0x1e19d8
ucomisd %xmm1, %xmm0
jne 0x88e17
jp 0x88e17
jmp 0x88e38
movsd 0xe8(%rsp), %xmm0
movsd 0x158c30(%rip), %xmm1   # 0x1e1a58
ucomisd %xmm1, %xmm0
jne 0x88f39
jp 0x88f39
movq 0xf8(%rsp), %rcx
xorl %eax, %eax
subq 0x8(%rcx), %rax
movq %rax, 0xd8(%rsp)
movq 0xd8(%rsp), %rax
andq $-0x800, %rax           # imm = 0xF800
cmpq $0x0, %rax
jne 0x88e7f
movq 0xd8(%rsp), %rcx
leaq 0x18d60f(%rip), %rax    # 0x216480
movq (%rax,%rcx,8), %rax
movq %rax, 0x28(%rsp)
jmp 0x88f17
jmp 0x88e81
movq 0x108(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x108(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x88eae
movq 0x108(%rsp), %rdi
callq 0xc670
movq 0x108(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rax
movq $0xb, (%rax)
movq 0xd8(%rsp), %rcx
movq 0xc8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0xc8(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movq 0xf8(%rsp), %rax
cvtsi2sdq 0x8(%rax), %xmm0
movsd %xmm0, 0xe0(%rsp)
jmp 0x88f97
movq 0x108(%rsp), %rdi
movq 0xf0(%rsp), %rsi
movq 0x108(%rsp), %rax
movq 0x1780(%rax), %rdx
movq 0x100(%rsp), %rcx
movl $0xd, %r8d
movl $0x2, %r9d
callq 0x13c50
movq %rax, 0x110(%rsp)
jmp 0x895a8
jmp 0x8952b
movq 0xf0(%rsp), %rax
movzbl (%rax), %eax
movl %eax, 0x24(%rsp)
subl $0xb, %eax
je 0x88fd3
jmp 0x88fb2
movl 0x24(%rsp), %eax
subl $0xc, %eax
je 0x8904a
jmp 0x88fc1
movl 0x24(%rsp), %eax
subl $0xd, %eax
je 0x890bd
jmp 0x8923b
movq 0xf0(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x88ff7
movq 0xf8(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movq 0xf8(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rax
movq %rcx, 0x60(%rsp)
fildll 0x60(%rsp)
movq %rax, 0x58(%rsp)
fildll 0x58(%rsp)
fdivrp %st, %st(1)
fstpl 0x50(%rsp)
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0xe0(%rsp)
movq 0xf0(%rsp), %rax
cvtsi2sdq 0x8(%rax), %xmm0
movsd %xmm0, 0xe8(%rsp)
jmp 0x89280
movq 0xf8(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rax
movq %rcx, 0x78(%rsp)
fildll 0x78(%rsp)
movq %rax, 0x70(%rsp)
fildll 0x70(%rsp)
fdivrp %st, %st(1)
fstpl 0xe0(%rsp)
movq 0xf0(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rax
movq %rcx, 0x88(%rsp)
fildll 0x88(%rsp)
movq %rax, 0x80(%rsp)
fildll 0x80(%rsp)
fdivrp %st, %st(1)
fstpl 0x68(%rsp)
movsd 0x68(%rsp), %xmm0
movsd %xmm0, 0xe8(%rsp)
jmp 0x89280
movq 0xf0(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0xe8(%rsp)
movsd 0xe8(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x890fc
jp 0x890fc
movq 0xf8(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movsd 0xe8(%rsp), %xmm0
callq 0x13860
testb $0x1, %al
jne 0x89110
jmp 0x89125
movq 0xf0(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movsd 0xe8(%rsp), %xmm1
movaps %xmm1, %xmm0
movaps 0x158968(%rip), %xmm2   # 0x1e1aa0
pand %xmm2, %xmm0
movq %xmm1, %rdx
movl $0x1, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x0, %rdx
cmovll %eax, %ecx
movsd 0x158816(%rip), %xmm1   # 0x1e1970
xorl %eax, %eax
ucomisd %xmm1, %xmm0
setnp %sil
sete %dl
testb %sil, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
je 0x89186
movq 0x194857(%rip), %rax    # 0x21d9d0
movq %rax, 0x110(%rsp)
jmp 0x895a8
movsd 0xe8(%rsp), %xmm0
movsd 0x158841(%rip), %xmm1   # 0x1e19d8
ucomisd %xmm1, %xmm0
jne 0x891a1
jp 0x891a1
jmp 0x891ba
movsd 0xe8(%rsp), %xmm0
movsd 0x1588a6(%rip), %xmm1   # 0x1e1a58
ucomisd %xmm1, %xmm0
jne 0x891f0
jp 0x891f0
movq 0x108(%rsp), %rdi
movq 0xf8(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %esi
subq 0x8(%rax), %rsi
movq 0xf8(%rsp), %rax
movq 0x10(%rax), %rdx
callq 0x1bb0a0
movq %rax, 0x110(%rsp)
jmp 0x895a8
movq 0xf8(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rax
movq %rcx, 0xa0(%rsp)
fildll 0xa0(%rsp)
movq %rax, 0x98(%rsp)
fildll 0x98(%rsp)
fdivrp %st, %st(1)
fstpl 0x90(%rsp)
movsd 0x90(%rsp), %xmm0
movsd %xmm0, 0xe0(%rsp)
jmp 0x89280
movq 0x108(%rsp), %rdi
movq 0xf0(%rsp), %rsi
movq 0x108(%rsp), %rax
movq 0x1780(%rax), %rdx
movq 0x100(%rsp), %rcx
movl $0xd, %r8d
movl $0x2, %r9d
callq 0x13c50
movq %rax, 0x110(%rsp)
jmp 0x895a8
jmp 0x8952b
movq 0xf8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0xe0(%rsp)
movq 0xf0(%rsp), %rax
movzbl (%rax), %eax
movl %eax, 0x20(%rsp)
subl $0xb, %eax
je 0x892ce
jmp 0x892b1
movl 0x20(%rsp), %eax
subl $0xc, %eax
je 0x89337
jmp 0x892bc
movl 0x20(%rsp), %eax
subl $0xd, %eax
je 0x893ae
jmp 0x894a2
movsd 0xe0(%rsp), %xmm0
callq 0x13860
testb $0x1, %al
jne 0x892e2
jmp 0x892f7
movq 0xf8(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movq 0xf0(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x8931b
movq 0xf8(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movq 0xf0(%rsp), %rax
cvtsi2sdq 0x8(%rax), %xmm0
movsd %xmm0, 0xe8(%rsp)
jmp 0x894e7
movsd 0xe0(%rsp), %xmm0
callq 0x13860
testb $0x1, %al
jne 0x8934b
jmp 0x89360
movq 0xf8(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movq 0xf0(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rax
movq %rcx, 0xb8(%rsp)
fildll 0xb8(%rsp)
movq %rax, 0xb0(%rsp)
fildll 0xb0(%rsp)
fdivrp %st, %st(1)
fstpl 0xa8(%rsp)
movsd 0xa8(%rsp), %xmm0
movsd %xmm0, 0xe8(%rsp)
jmp 0x894e7
movsd 0xe0(%rsp), %xmm0
callq 0x13860
testb $0x1, %al
jne 0x893c2
jmp 0x893d7
movq 0xf8(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movq 0xf0(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0xe8(%rsp)
movsd 0xe8(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x89416
jp 0x89416
movq 0xf8(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movsd 0xe8(%rsp), %xmm0
callq 0x13860
testb $0x1, %al
jne 0x8942a
jmp 0x8943f
movq 0xf0(%rsp), %rax
movq %rax, 0x110(%rsp)
jmp 0x895a8
movsd 0xe8(%rsp), %xmm1
movaps %xmm1, %xmm0
movaps 0x15864e(%rip), %xmm2   # 0x1e1aa0
pand %xmm2, %xmm0
movq %xmm1, %rdx
movl $0x1, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x0, %rdx
cmovll %eax, %ecx
movsd 0x1584fc(%rip), %xmm1   # 0x1e1970
xorl %eax, %eax
ucomisd %xmm1, %xmm0
setnp %sil
sete %dl
testb %sil, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
je 0x894a0
movq 0x19453d(%rip), %rax    # 0x21d9d0
movq %rax, 0x110(%rsp)
jmp 0x895a8
jmp 0x894e7
movq 0x108(%rsp), %rdi
movq 0xf0(%rsp), %rsi
movq 0x108(%rsp), %rax
movq 0x1780(%rax), %rdx
movq 0x100(%rsp), %rcx
movl $0xd, %r8d
movl $0x2, %r9d
callq 0x13c50
movq %rax, 0x110(%rsp)
jmp 0x895a8
jmp 0x8952b
movq 0x108(%rsp), %rdi
movq 0xf8(%rsp), %rsi
movq 0x108(%rsp), %rax
movq 0x1780(%rax), %rdx
movq 0x100(%rsp), %rcx
movl $0xd, %r8d
movl $0x1, %r9d
callq 0x13c50
movq %rax, 0x110(%rsp)
jmp 0x895a8
movq 0x108(%rsp), %rax
movq %rax, 0x10(%rsp)
movsd 0xe0(%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0xe8(%rsp), %xmm0
callq 0x92f0
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0xe0(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xe8(%rsp), %xmm0
callq 0x95e0
movsd 0x8(%rsp), %xmm1
movq 0x10(%rsp), %rdi
movaps %xmm0, %xmm2
movsd 0x18(%rsp), %xmm0
mulsd %xmm2, %xmm1
callq 0x122a0
movq %rax, 0x110(%rsp)
movq 0x110(%rsp), %rax
addq $0x118, %rsp            # imm = 0x118
retq
nopl (%rax,%rax)