// File: /workspace/github_c_makefile_star2_O3/georgeweigt[P]eigenmath/eigenmath.c
// Function: arccosh
void
arccosh(void)
{
	int i, n;
	double d;
	struct atom *p1;

	p1 = pop();

	if (istensor(p1)) {
		p1 = copy_tensor(p1);
		n = p1->u.tensor->nelem;
		for (i = 0; i < n; i++) {
			push(p1->u.tensor->elem[i]);
			arccosh();
			p1->u.tensor->elem[i] = pop();
		}
		push(p1);
		return;
	}

	if (isdouble(p1)) {
		push(p1);
		d = pop_double();
		if (d >= 1.0) {
			d = acosh(d);
			push_double(d);
			return;
		}
	}

	// arccosh(z) = log(sqrt(z^2 - 1) + z)

	if (isdouble(p1) || isdoublez(p1)) {
		push(p1);
		push(p1);
		multiply();
		push_double(-1.0);
		add();
		sqrtfunc();
		push(p1);
		add();
		logfunc();
		return;
	}

	if (isplusone(p1)) {
		push_integer(0);
		return;
	}

	if (car(p1) == symbol(COSH)) {
		push(cadr(p1));
		return;
	}

	push_symbol(ARCCOSH);
	push(p1);
	list(2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x3202f(%rip), %eax     # 0x3f2b8
movl $0xfffe795f, %ecx       # imm = 0xFFFE795F
leal (%rax,%rcx), %edx
cmpl %ecx, %edx
jbe 0xd491
decl %eax
movl %eax, 0x32017(%rip)     # 0x3f2b8
leaq 0x3b318(%rip), %r14     # 0x485c0
movq (%r14,%rax,8), %rbx
movzbl 0x10(%rbx), %r15d
cmpl $0x5, %r15d
je 0xd32a
cmpl $0x7, %r15d
jne 0xd34f
movq %rbx, %rdi
callq 0x9638
movq %rax, %rbx
movq (%rax), %rax
movslq 0x64(%rax), %r15
testq %r15, %r15
jle 0xd322
xorl %r12d, %r12d
movl $0xfffe795f, %r13d      # imm = 0xFFFE795F
movq (%rbx), %rax
movq 0x68(%rax,%r12,8), %rdi
callq 0x8ba5
callq 0xd275
movl 0x31fbf(%rip), %eax     # 0x3f2b8
leal (%rax,%r13), %ecx
cmpl %r13d, %ecx
jbe 0xd491
decl %eax
movl %eax, 0x31faa(%rip)     # 0x3f2b8
movq (%r14,%rax,8), %rax
movq (%rbx), %rcx
movq %rax, 0x68(%rcx,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0xd2e1
movq %rbx, %rdi
jmp 0xd418
movq %rbx, %rdi
callq 0x8ba5
callq 0x9128
ucomisd 0x1cdf1(%rip), %xmm0    # 0x2a130
jae 0xd3da
movb 0x10(%rbx), %r15b
cmpb $0x5, %r15b
je 0xd35f
movq %rbx, %rdi
callq 0xca1c
testl %eax, %eax
je 0xd3fb
movq %rbx, %rdi
callq 0x8ba5
movq %rbx, %rdi
callq 0x8ba5
movl $0x2, %edi
callq 0xacef
callq 0x74dc
movb $0x5, 0x10(%rax)
movabsq $-0x4010000000000000, %rcx # imm = 0xBFF0000000000000
movq %rcx, (%rax)
movq %rax, %rdi
callq 0x8ba5
movl $0x2, %edi
callq 0xadb3
movl $0x1, %edi
movl $0x2, %esi
callq 0xa533
callq 0xa573
movq %rbx, %rdi
callq 0x8ba5
movl $0x2, %edi
callq 0xadb3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xcbe3
callq 0x7340
movsd %xmm0, -0x30(%rbp)
callq 0x74dc
movb $0x5, 0x10(%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %rax, %rdi
jmp 0xd418
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0xd1c4
testl %eax, %eax
je 0xd42b
movq 0x35d28(%rip), %rdi     # 0x43140
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8ba5
cmpb $0x1, %r15b
leaq 0x385ca(%rip), %rax     # 0x45a00
movq %rax, %rcx
cmoveq %rbx, %rcx
movq (%rcx), %rcx
cmpq 0x363b1(%rip), %rcx     # 0x437f8
je 0xd475
movq 0x35d30(%rip), %rdi     # 0x43180
callq 0x8ba5
movq %rbx, %rdi
callq 0x8ba5
movl $0x2, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8b7d
addq $0x8, %rbx
cmpb $0x1, %r15b
cmovneq %rax, %rbx
movq (%rbx), %rcx
cmpb $0x1, 0x10(%rcx)
cmoveq %rcx, %rax
movq (%rax), %rdi
jmp 0xd418
leaq 0x21aa9(%rip), %rdi     # 0x2ef41
callq 0x780b