// File: /workspace/github_c_makefile_star2_O0/georgeweigt[P]eigenmath/eigenmath.c
// Function: arcsin
void
arcsin(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]);
			arcsin();
			p1->u.tensor->elem[i] = pop();
		}
		push(p1);
		return;
	}

	if (isdouble(p1)) {
		push(p1);
		d = pop_double();
		if (-1.0 <= d && d <= 1.0) {
			d = asin(d);
			push_double(d);
			return;
		}
	}

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

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

	// arcsin(-x) = -arcsin(x)

	if (isnegativeterm(p1)) {
		push(p1);
		negate();
		arcsin();
		negate();
		return;
	}

	// arcsin(1 / sqrt(2)) = 1/4 pi

	if (isoneoversqrttwo(p1)) {
		push_rational(1, 4);
		push_symbol(PI);
		multiply();
		return;
	}

	// arcsin(0) = 0

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

	// arcsin(1/2) = 1/6 pi

	if (isequalq(p1, 1, 2)) {
		push_rational(1, 6);
		push_symbol(PI);
		multiply();
		return;
	}

	// arcsin(1) = 1/2 pi

	if (isplusone(p1)) {
		push_rational(1, 2);
		push_symbol(PI);
		multiply();
		return;
	}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x91d0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x7, %eax
jne 0x10ba2
movq -0x18(%rbp), %rdi
callq 0xa550
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl 0x64(%rax), %eax
movl %eax, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x10b94
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0x4(%rbp), %rcx
movq 0x68(%rax,%rcx,8), %rdi
callq 0x9110
callq 0x10b10
callq 0x91d0
movq %rax, %rdx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0x4(%rbp), %rcx
movq %rdx, 0x68(%rax,%rcx,8)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x10b4f
movq -0x18(%rbp), %rdi
callq 0x9110
jmp 0x10d8d
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x5, %eax
jne 0x10c04
movq -0x18(%rbp), %rdi
callq 0x9110
callq 0x9af0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0x344d9(%rip), %xmm1    # 0x450a8
ucomisd %xmm1, %xmm0
jb 0x10c02
movsd 0x344d3(%rip), %xmm0    # 0x450b0
ucomisd -0x10(%rbp), %xmm0
jb 0x10c02
movsd -0x10(%rbp), %xmm0
callq 0x7310
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0xe5e0
jmp 0x10d8d
jmp 0x10c04
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x5, %eax
je 0x10c1f
movq -0x18(%rbp), %rdi
callq 0xf370
cmpl $0x0, %eax
je 0x10c8c
movq 0x113eba(%rip), %rdi    # 0x124ae0
callq 0x9110
callq 0xb4b0
movq 0x113ea9(%rip), %rdi    # 0x124ae0
callq 0x9110
movq -0x18(%rbp), %rdi
callq 0x9110
callq 0xc280
movsd 0x3445e(%rip), %xmm0    # 0x450b0
callq 0xe5e0
movq -0x18(%rbp), %rdi
callq 0x9110
movq -0x18(%rbp), %rdi
callq 0x9110
callq 0xc280
callq 0xe7e0
callq 0xfa20
callq 0xc660
callq 0xfa40
callq 0xc280
jmp 0x10d8d
movq -0x18(%rbp), %rdi
callq 0xc2b0
cmpl $0x0, %eax
je 0x10cb7
movq -0x18(%rbp), %rdi
callq 0x9110
callq 0xb4b0
callq 0x10b10
callq 0xb4b0
jmp 0x10d8d
movq -0x18(%rbp), %rdi
callq 0x10240
cmpl $0x0, %eax
je 0x10cea
movl $0x1, %edi
movl $0x4, %esi
callq 0xb840
movq 0x4e375(%rip), %rdi     # 0x5f050
callq 0x9110
callq 0xc280
jmp 0x10d8d
movq -0x18(%rbp), %rdi
callq 0xcdc0
cmpl $0x0, %eax
je 0x10d04
xorl %edi, %edi
callq 0xca50
jmp 0x10d8d
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0x10670
cmpl $0x0, %eax
je 0x10d3e
movl $0x1, %edi
movl $0x6, %esi
callq 0xb840
movq 0x4e31e(%rip), %rdi     # 0x5f050
callq 0x9110
callq 0xc280
jmp 0x10d8d
movq -0x18(%rbp), %rdi
callq 0xd4c0
cmpl $0x0, %eax
je 0x10d6e
movl $0x1, %edi
movl $0x2, %esi
callq 0xb840
movq 0x4e2ee(%rip), %rdi     # 0x5f050
callq 0x9110
callq 0xc280
jmp 0x10d8d
movq 0x4b413(%rip), %rdi     # 0x5c188
callq 0x9110
movq -0x18(%rbp), %rdi
callq 0x9110
movl $0x2, %edi
callq 0x90d0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)