// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: g_atanh
static s7_pointer g_atanh(s7_scheme *sc, s7_pointer args)
    {
#define H_atanh "(atanh z) returns atanh(z)"
#define Q_atanh sc->pl_nn
        s7_pointer x;
        x = car(args);
        switch (type(x))
        {
            case T_INTEGER:
                if (integer(x) == 0) return(small_int(0));                    /* (atanh 0) -> 0 */

            case T_REAL:
            case T_RATIO:
                {
                    double x1;
                    x1 = s7_real(x);
                    if (fabs(x1) < 1.0)
                        return(make_real(sc, atanh(x1)));
                }

                /* if we can't distinguish x from 1.0 even with long doubles, we'll get inf.0:
                 *    (atanh 9223372036854775/9223372036854776) -> 18.714973875119
                 *    (atanh 92233720368547758/92233720368547757) -> inf.0
                 */
            case T_COMPLEX:
#if HAVE_COMPLEX_NUMBERS
#if (defined(__OpenBSD__)) || (defined(__NetBSD__))
                return(s7_from_c_complex(sc, catanh_1(s7_to_c_complex(x))));
#else
                return(s7_from_c_complex(sc, catanh(s7_to_c_complex(x))));
#endif
#else
                return(out_of_range(sc, sc->atanh_symbol, small_int(1), x, no_complex_numbers_string));
#endif

            default:
                return(method_or_bust_with_type_one_arg(sc, x, sc->atanh_symbol, list_1(sc, x), a_number_string));
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x8(%rsi), %r14
movzbl (%r14), %eax
addl $-0xb, %eax
cmpl $0x3, %eax
ja 0x67e6f
leaq 0x9fcaf(%rip), %rcx     # 0x107a34
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x0, 0x8(%r14)
je 0x67edb
movq 0xe2c90(%rip), %rdi     # 0x14aa30
leaq 0xa22d1(%rip), %rdx     # 0x10a078
movq %r14, %rsi
callq 0xd498
jmp 0x67db7
movsd 0x8(%r14), %xmm0
movapd 0xa2101(%rip), %xmm1    # 0x109ec0
andpd %xmm0, %xmm1
movsd 0x9e265(%rip), %xmm2    # 0x106030
ucomisd %xmm1, %xmm2
ja 0x67de8
movb (%r14), %bpl
movq %r14, %rdi
callq 0xe238
xorpd %xmm1, %xmm1
cmpb $0xe, %bpl
je 0x67e40
jmp 0x67e46
callq 0x8080
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x67e18
movq %rbx, %rdi
movsd %xmm0, 0x8(%rsp)
callq 0xa550
movsd 0x8(%rsp), %xmm0
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0xd, (%rax)
movsd %xmm0, 0x8(%rax)
jmp 0x67ee2
movq %r14, %rdi
callq 0xe238
movsd 0x10(%r14), %xmm1
xorpd %xmm2, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
movapd %xmm2, %xmm0
callq 0x84d0
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xd387
movq 0xc10(%rbx), %r15
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r12
cmpq 0x98(%rbx), %rax
ja 0x67e9c
movq %rbx, %rdi
callq 0xa550
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rcx
movq $0x200001, (%rcx)       # imm = 0x200001
movq %r14, 0x8(%rcx)
movq %r12, 0x10(%rcx)
movq 0xed4df(%rip), %r8      # 0x1553a0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xfa261
movq 0xdea6e(%rip), %rax     # 0x146950
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq