// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_asin
static s7_pointer g_asin(s7_scheme *sc, s7_pointer args)
    {
#define H_asin "(asin z) returns asin(z); (sin (asin x)) = x"
#define Q_asin sc->pl_nn
        s7_pointer n;

        n = car(args);
        switch (type(n))
        {
            case T_INTEGER:
                if (integer(n) == 0) return(small_int(0));                    /* (asin 0) -> 0 */
                /* in netBSD, (asin 2) returns 0.25383842987008+0.25383842987008i according to Peter Bex */
                return(c_asin(sc, (s7_double)integer(n)));

            case T_RATIO:
                return(c_asin(sc, (s7_double)numerator(n) / (s7_double)denominator(n)));

            case T_REAL:
                return(c_asin(sc, real(n)));

            case T_COMPLEX:
#if HAVE_COMPLEX_NUMBERS
                /* if either real or imag part is very large, use explicit formula, not casin */
                /*   this code taken from sbcl's src/code/irrat.lisp; break is around x+70000000i */
                if ((fabs(real_part(n)) > 1.0e7) ||
                        (fabs(imag_part(n)) > 1.0e7))
                {
                    s7_complex sq1mz, sq1pz, z;
                    z = as_c_complex(n);
                    sq1mz = csqrt(1.0 - z);
                    sq1pz = csqrt(1.0 + z);
                    return(s7_make_complex(sc, atan(real_part(n) / creal(sq1mz * sq1pz)), asinh(cimag(sq1pz * conj(sq1mz)))));
                }
                return(s7_from_c_complex(sc, casin(as_c_complex(n))));
#else
                return(out_of_range(sc, sc->asin_symbol, small_int(1), n, no_complex_numbers_string));
#endif

            default:
                return(method_or_bust_with_type_one_arg(sc, n, sc->asin_symbol, list_1(sc, n), a_number_string));
        }
    }

// Assembly:
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x148(%rsp)
movq %rsi, 0x140(%rsp)
movq 0x140(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x138(%rsp)
movq 0x138(%rsp), %rax
movzbl (%rax), %eax
addl $-0xb, %eax
movl %eax, %ecx
movq %rcx, 0xa0(%rsp)
subl $0x3, %eax
ja 0x746fd
movq 0xa0(%rsp), %rax
leaq 0x16a7d5(%rip), %rcx    # 0x1dea30
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x138(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x74287
movq 0x1a2206(%rip), %rax    # 0x216480
movq %rax, 0x150(%rsp)
jmp 0x74818
movq 0x148(%rsp), %rdi
movq 0x138(%rsp), %rax
cvtsi2sdq 0x8(%rax), %xmm0
callq 0x1bb6d0
movq %rax, 0x150(%rsp)
jmp 0x74818
movq 0x148(%rsp), %rdi
movq 0x138(%rsp), %rax
cvtsi2sdq 0x8(%rax), %xmm0
movq 0x138(%rsp), %rax
cvtsi2sdq 0x10(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x1bb6d0
movq %rax, 0x150(%rsp)
jmp 0x74818
movq 0x148(%rsp), %rdi
movq 0x138(%rsp), %rax
movsd 0x8(%rax), %xmm0
callq 0x1bb6d0
movq %rax, 0x150(%rsp)
jmp 0x74818
movq 0x138(%rsp), %rax
movsd 0x8(%rax), %xmm0
movaps 0x16d77c(%rip), %xmm1   # 0x1e1aa0
pand %xmm1, %xmm0
movsd 0x16d6d8(%rip), %xmm1   # 0x1e1a08
ucomisd %xmm1, %xmm0
ja 0x74360
movq 0x138(%rsp), %rax
movsd 0x10(%rax), %xmm0
movaps 0x16d756(%rip), %xmm1   # 0x1e1aa0
pand %xmm1, %xmm0
movsd 0x16d6b2(%rip), %xmm1   # 0x1e1a08
ucomisd %xmm1, %xmm0
jbe 0x74658
movq 0x138(%rsp), %rax
movsd 0x8(%rax), %xmm1
movq 0x138(%rsp), %rax
movsd 0x10(%rax), %xmm0
xorps %xmm3, %xmm3
movaps %xmm0, %xmm2
mulsd %xmm3, %xmm2
movsd 0x16d5dc(%rip), %xmm3   # 0x1e1968
mulsd %xmm3, %xmm0
addsd %xmm2, %xmm1
movsd %xmm1, 0x108(%rsp)
movsd %xmm0, 0x110(%rsp)
movsd 0x108(%rsp), %xmm2
movsd 0x110(%rsp), %xmm0
movsd 0x16d5a8(%rip), %xmm1   # 0x1e1968
subsd %xmm2, %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm1, 0xf8(%rsp)
movsd %xmm0, 0x100(%rsp)
movsd 0xf8(%rsp), %xmm0
movsd 0x100(%rsp), %xmm1
callq 0x9560
movsd %xmm0, 0x128(%rsp)
movsd %xmm1, 0x130(%rsp)
movsd 0x108(%rsp), %xmm2
movsd 0x110(%rsp), %xmm0
movsd 0x16d538(%rip), %xmm1   # 0x1e1968
addsd %xmm2, %xmm1
movsd %xmm1, 0xe8(%rsp)
movsd %xmm0, 0xf0(%rsp)
movsd 0xe8(%rsp), %xmm0
movsd 0xf0(%rsp), %xmm1
callq 0x9560
movsd %xmm0, 0x118(%rsp)
movsd %xmm1, 0x120(%rsp)
movq 0x148(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x138(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x128(%rsp), %xmm1
movsd %xmm1, 0x68(%rsp)
movsd 0x130(%rsp), %xmm2
movsd %xmm2, 0x70(%rsp)
movsd 0x118(%rsp), %xmm4
movsd %xmm4, 0x78(%rsp)
movsd 0x120(%rsp), %xmm5
movsd %xmm5, 0x80(%rsp)
movaps %xmm1, %xmm0
mulsd %xmm4, %xmm0
movaps %xmm2, %xmm3
mulsd %xmm5, %xmm3
mulsd %xmm5, %xmm1
mulsd %xmm4, %xmm2
subsd %xmm3, %xmm0
movsd %xmm0, 0x88(%rsp)
addsd %xmm2, %xmm1
movsd %xmm1, 0x90(%rsp)
ucomisd %xmm0, %xmm0
movsd %xmm0, 0x98(%rsp)
jnp 0x74557
movsd 0x88(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
ucomisd %xmm1, %xmm1
movsd %xmm0, 0x98(%rsp)
jnp 0x74557
movsd 0x80(%rsp), %xmm3
movsd 0x78(%rsp), %xmm2
movsd 0x70(%rsp), %xmm1
movsd 0x68(%rsp), %xmm0
callq 0x1dc190
movsd %xmm0, 0x98(%rsp)
movsd 0x60(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x9150
movsd %xmm0, 0x20(%rsp)
movsd 0x118(%rsp), %xmm1
movsd %xmm1, 0x28(%rsp)
movsd 0x120(%rsp), %xmm2
movsd %xmm2, 0x30(%rsp)
movsd 0x128(%rsp), %xmm4
movsd %xmm4, 0x38(%rsp)
movsd 0x130(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm5
movsd %xmm5, 0x40(%rsp)
movaps %xmm1, %xmm0
mulsd %xmm4, %xmm0
movaps %xmm2, %xmm3
mulsd %xmm5, %xmm3
mulsd %xmm5, %xmm1
mulsd %xmm4, %xmm2
subsd %xmm3, %xmm0
addsd %xmm2, %xmm1
movsd %xmm1, 0x48(%rsp)
ucomisd %xmm0, %xmm0
movsd %xmm1, 0x50(%rsp)
jnp 0x7462d
movsd 0x48(%rsp), %xmm1
ucomisd %xmm1, %xmm1
movsd %xmm1, 0x50(%rsp)
jnp 0x7462d
movsd 0x40(%rsp), %xmm3
movsd 0x38(%rsp), %xmm2
movsd 0x30(%rsp), %xmm1
movsd 0x28(%rsp), %xmm0
callq 0x1dc190
movsd %xmm1, 0x50(%rsp)
movsd 0x50(%rsp), %xmm0
callq 0x9740
movq 0x58(%rsp), %rdi
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
callq 0x122a0
movq %rax, 0x150(%rsp)
jmp 0x74818
movq 0x148(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x138(%rsp), %rax
movsd 0x8(%rax), %xmm1
movq 0x138(%rsp), %rax
movsd 0x10(%rax), %xmm0
xorps %xmm3, %xmm3
movaps %xmm0, %xmm2
mulsd %xmm3, %xmm2
movsd 0x16d2d7(%rip), %xmm3   # 0x1e1968
mulsd %xmm3, %xmm0
addsd %xmm2, %xmm1
movsd %xmm1, 0xd8(%rsp)
movsd %xmm0, 0xe0(%rsp)
movsd 0xd8(%rsp), %xmm0
movsd 0xe0(%rsp), %xmm1
callq 0x93c0
movq 0x18(%rsp), %rdi
movsd %xmm0, 0xc8(%rsp)
movsd %xmm1, 0xd0(%rsp)
movsd 0xc8(%rsp), %xmm0
movsd 0xd0(%rsp), %xmm1
callq 0x1bb560
movq %rax, 0x150(%rsp)
jmp 0x74818
movq 0x148(%rsp), %rax
movq %rax, (%rsp)
movq 0x138(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x148(%rsp), %rax
movq 0xbe0(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x138(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x148(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0xb0(%rsp)
movq 0x148(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x148(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x7477e
movq 0x148(%rsp), %rdi
callq 0xc670
movq 0x148(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rsi
movq (%rsp), %rdi
movq 0xb8(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0xb0(%rsp), %rcx
movq 0xc0(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0xc0(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rcx
movq 0x1b06e5(%rip), %r8     # 0x224ef0
callq 0x1ba7e0
movq %rax, 0x150(%rsp)
movq 0x150(%rsp), %rax
addq $0x158, %rsp            # imm = 0x158
retq
nopl (%rax,%rax)