// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_exp
static s7_pointer g_exp(s7_scheme *sc, s7_pointer args)
    {
#define H_exp "(exp z) returns e^z, (exp 1) is 2.718281828459"
#define Q_exp sc->pl_nn

        s7_pointer x;

        x = car(args);
        switch (type(x))
        {
            case T_INTEGER:
                if (integer(x) == 0) return(small_int(1));                       /* (exp 0) -> 1 */
                return(make_real(sc, exp((s7_double)(integer(x)))));

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

            case T_REAL:
                return(make_real(sc, exp(real(x))));

            case T_COMPLEX:
#if HAVE_COMPLEX_NUMBERS
                return(s7_from_c_complex(sc, cexp(as_c_complex(x))));
                /* this is inaccurate for large arguments:
                 *   (exp 0+1e20i) -> -0.66491178990701-0.74692189125949i, not 7.639704044417283004001468027378811228331E-1-6.45251285265780844205811711312523007406E-1i
                 */
#else
                return(out_of_range(sc, sc->exp_symbol, small_int(1), x, no_complex_numbers_string));
#endif

            default:
                return(method_or_bust_with_type_one_arg(sc, x, sc->exp_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 0x729ee
movq 0x10(%rsp), %rax
leaq 0x16c2db(%rip), %rcx    # 0x1de9f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x98(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x72741
movq 0x1a3d54(%rip), %rax    # 0x216488
movq %rax, 0xb0(%rsp)
jmp 0x72a29
movq 0x98(%rsp), %rax
cvtsi2sdq 0x8(%rax), %xmm0
callq 0x9720
movsd %xmm0, 0x88(%rsp)
movq 0xa8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x7278a
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 0x72a29
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 0x9720
movsd %xmm0, 0x70(%rsp)
movq 0xa8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x72863
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 0x72a29
movq 0x98(%rsp), %rax
movsd 0x8(%rax), %xmm0
callq 0x9720
movsd %xmm0, 0x58(%rsp)
movq 0xa8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x72906
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 0x72a29
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 0x16efcb(%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 0x90e0
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 0x72a29
movq 0xa8(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0xa8(%rsp), %rax
movq 0xed0(%rax), %rdx
movq 0xa0(%rsp), %rcx
movq 0x1b24d4(%rip), %r8     # 0x224ef0
callq 0x1ba7e0
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
addq $0xb8, %rsp
retq
nopl (%rax)