// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_cos
static s7_pointer g_cos(s7_scheme *sc, s7_pointer args)
    {
#define H_cos "(cos z) returns cos(z)"
#define Q_cos sc->pl_nn

        s7_pointer x;
        x = car(args);
        switch (type(x))
        {
            case T_REAL:
                return(make_real(sc, cos(real(x))));

            case T_INTEGER:
                if (integer(x) == 0) return(small_int(1));                     /* (cos 0) -> 1 */
                return(make_real(sc, cos((s7_double)integer(x))));

            case T_RATIO:
                return(make_real(sc, cos((s7_double)(fraction(x)))));

            case T_COMPLEX:
#if HAVE_COMPLEX_NUMBERS
                return(s7_from_c_complex(sc, ccos(as_c_complex(x))));
#else
                return(out_of_range(sc, sc->cos_symbol, small_int(1), x, no_complex_numbers_string));
#endif

            default:
                return(method_or_bust_with_type_one_arg(sc, x, sc->cos_symbol, args, a_number_string));
        }
    }

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xa8(%rsp)
movq %rsi, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rax
movzbl (%rax), %eax
addl $-0xb, %eax
movl %eax, %ecx
movq %rcx, 0x10(%rsp)
subl $0x3, %eax
ja 0x73dae
movq 0x10(%rsp), %rax
leaq 0x16af3b(%rip), %rcx    # 0x1dea10
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x98(%rsp), %rax
movsd 0x8(%rax), %xmm0
callq 0x92f0
movsd %xmm0, 0x88(%rsp)
movq 0xa8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x73b26
movq 0xa8(%rsp), %rdi
callq 0xc670
movq 0xa8(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq $0xd, (%rax)
movsd 0x88(%rsp), %xmm0
movq 0x90(%rsp), %rax
movsd %xmm0, 0x8(%rax)
movq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0xb0(%rsp)
jmp 0x73de9
movq 0x98(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x73bbc
movq 0x1a28d9(%rip), %rax    # 0x216488
movq %rax, 0xb0(%rsp)
jmp 0x73de9
movq 0x98(%rsp), %rax
cvtsi2sdq 0x8(%rax), %xmm0
callq 0x92f0
movsd %xmm0, 0x70(%rsp)
movq 0xa8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x73c02
movq 0xa8(%rsp), %rdi
callq 0xc670
movq 0xa8(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq $0xd, (%rax)
movsd 0x70(%rsp), %xmm0
movq 0x78(%rsp), %rax
movsd %xmm0, 0x8(%rax)
movq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0xb0(%rsp)
jmp 0x73de9
movq 0x98(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rax
movq %rcx, 0x28(%rsp)
fildll 0x28(%rsp)
movq %rax, 0x20(%rsp)
fildll 0x20(%rsp)
fdivrp %st, %st(1)
fstpl 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x92f0
movsd %xmm0, 0x58(%rsp)
movq 0xa8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x73cc6
movq 0xa8(%rsp), %rdi
callq 0xc670
movq 0xa8(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq $0xd, (%rax)
movsd 0x58(%rsp), %xmm0
movq 0x60(%rsp), %rax
movsd %xmm0, 0x8(%rax)
movq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0xb0(%rsp)
jmp 0x73de9
movq 0xa8(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x98(%rsp), %rax
movsd 0x8(%rax), %xmm1
movq 0x98(%rsp), %rax
movsd 0x10(%rax), %xmm0
xorps %xmm3, %xmm3
movaps %xmm0, %xmm2
mulsd %xmm3, %xmm2
movsd 0x16dc0b(%rip), %xmm3   # 0x1e1968
mulsd %xmm3, %xmm0
addsd %xmm2, %xmm1
movsd %xmm1, 0x40(%rsp)
movsd %xmm0, 0x48(%rsp)
movsd 0x40(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
callq 0x9580
movq 0x8(%rsp), %rdi
movsd %xmm0, 0x30(%rsp)
movsd %xmm1, 0x38(%rsp)
movsd 0x30(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
callq 0x1bb560
movq %rax, 0xb0(%rsp)
jmp 0x73de9
movq 0xa8(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0xa8(%rsp), %rax
movq 0xe28(%rax), %rdx
movq 0xa0(%rsp), %rcx
movq 0x1b1114(%rip), %r8     # 0x224ef0
callq 0x1ba7e0
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
addq $0xb8, %rsp
retq
nopl (%rax)