// File: /workspace/github_c_makefile_star2_O0/georgeweigt[P]eigenmath/eigenmath.c
// Function: sinfunc
void
sinfunc(void)
{
	int i, n;
	double d;
	struct atom *p1, *p2, *X, *Y;

	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]);
			sinfunc();
			p1->u.tensor->elem[i] = pop();
		}
		push(p1);
		return;
	}

	if (isdouble(p1)) {
		push(p1);
		d = pop_double();
		d = sin(d);
		push_double(d);
		return;
	}

	// sin(z) = -i/2 exp(i z) + i/2 exp(-i z)

	if (isdoublez(p1)) {
		push_double(-0.5);
		push(imaginaryunit);
		multiply();
		push(imaginaryunit);
		push(p1);
		multiply();
		expfunc();
		push(imaginaryunit);
		negate();
		push(p1);
		multiply();
		expfunc();
		subtract();
		multiply();
		return;
	}

	// sin(-x) = -sin(x)

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

	if (car(p1) == symbol(ADD)) {
		sinfunc_sum(p1);
		return;
	}

	// sin(arctan(y,x)) = y (x^2 + y^2)^(-1/2)

	if (car(p1) == symbol(ARCTAN)) {
		X = caddr(p1);
		Y = cadr(p1);
		push(Y);
		push(X);
		push(X);
		multiply();
		push(Y);
		push(Y);
		multiply();
		add();
		push_rational(-1, 2);
		power();
		multiply();
		return;
	}

	// sin(arccos(x)) = sqrt(1 - x^2)

	if (car(p1) == symbol(ARCCOS)) {
		push_integer(1);
		push(cadr(p1));
		push_integer(2);
		power();
		subtract();
		push_rational(1, 2);
		power();
		return;
	}

	// n pi ?

	push(p1);
	push_symbol(PI);
	divide();
	p2 = pop();

	if (!isnum(p2)) {
		push_symbol(SIN);
		push(p1);
		list(2);
		return;
	}

	if (isdouble(p2)) {
		push(p2);
		d = pop_double();
		d = sin(d * M_PI);
		push_double(d);
		return;
	}

	push(p2); // nonnegative by sin(-x) = -sin(x) above
	push_integer(180);
	multiply();
	p2 = pop();

	if (!isinteger(p2)) {
		push_symbol(SIN);
		push(p1);
		list(2);
		return;
	}

	push(p2);
	push_integer(360);
	modfunc();
	n = pop_integer();

	switch (n) {
	case 0:
	case 180:
		push_integer(0);
		break;
	case 30:
	case 150:
		push_rational(1, 2);
		break;
	case 210:
	case 330:
		push_rational(-1, 2);
		break;
	case 45:
	case 135:
		push_rational(1, 2);
		push_integer(2);
		push_rational(1, 2);
		power();
		multiply();
		break;
	case 225:
	case 315:
		push_rational(-1, 2);
		push_integer(2);
		push_rational(1, 2);
		power();
		multiply();
		break;
	case 60:
	case 120:
		push_rational(1, 2);
		push_integer(3);
		push_rational(1, 2);
		power();
		multiply();
		break;
	case 240:
	case 300:
		push_rational(-1, 2);
		push_integer(3);
		push_rational(1, 2);
		power();
		multiply();
		break;
	case 90:
		push_integer(1);
		break;
	case 270:
		push_integer(-1);
		break;
	default:
		push_symbol(SIN);
		push(p1);
		list(2);
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
callq 0x91d0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x7, %eax
jne 0x14e75
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 0x14e67
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0x4(%rbp), %rcx
movq 0x68(%rax,%rcx,8), %rdi
callq 0x9110
callq 0x14de0
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 0x14e22
movq -0x18(%rbp), %rdi
callq 0x9110
jmp 0x1564f
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x5, %eax
jne 0x14eb3
movq -0x18(%rbp), %rdi
callq 0x9110
callq 0x9af0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x72e0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0xe5e0
jmp 0x1564f
movq -0x18(%rbp), %rdi
callq 0xf370
cmpl $0x0, %eax
je 0x14f31
movsd 0x301ef(%rip), %xmm0    # 0x450b8
callq 0xe5e0
movq 0x10fc0b(%rip), %rdi    # 0x124ae0
callq 0x9110
callq 0xc280
movq 0x10fbfa(%rip), %rdi    # 0x124ae0
callq 0x9110
movq -0x18(%rbp), %rdi
callq 0x9110
callq 0xc280
callq 0x14a50
movq 0x10fbdb(%rip), %rdi    # 0x124ae0
callq 0x9110
callq 0xb4b0
movq -0x18(%rbp), %rdi
callq 0x9110
callq 0xc280
callq 0x14a50
callq 0xe7e0
callq 0xc280
jmp 0x1564f
movq -0x18(%rbp), %rdi
callq 0xc2b0
cmpl $0x0, %eax
je 0x14f5c
movq -0x18(%rbp), %rdi
callq 0x9110
callq 0xb4b0
callq 0x14de0
callq 0xb4b0
jmp 0x1564f
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x14f76
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x14f81
movq 0x49a83(%rip), %rax     # 0x5ea00
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq 0x4c314(%rip), %rax     # 0x612a0
jne 0x14f9c
movq -0x18(%rbp), %rdi
callq 0x32b80
jmp 0x1564f
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x14fb6
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x14fc1
movq 0x49a43(%rip), %rax     # 0x5ea00
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq 0x471cc(%rip), %rax     # 0x5c198
jne 0x151c8
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x14fed
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x14ff8
movq 0x49a0c(%rip), %rax     # 0x5ea00
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x15039
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x15020
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x1502b
movq 0x499d9(%rip), %rax     # 0x5ea00
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x15044
movq 0x499c0(%rip), %rax     # 0x5ea00
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x150d0
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x1506c
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x15077
movq 0x4998d(%rip), %rax     # 0x5ea00
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x150b8
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x1509f
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x150aa
movq 0x4995a(%rip), %rax     # 0x5ea00
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x70(%rbp)
jmp 0x150c3
movq 0x49941(%rip), %rax     # 0x5ea00
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0x150db
movq 0x49929(%rip), %rax     # 0x5ea00
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x150fe
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x80(%rbp)
jmp 0x15109
movq 0x498fb(%rip), %rax     # 0x5ea00
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x15155
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x15134
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
jmp 0x15142
movq 0x498c5(%rip), %rax     # 0x5ea00
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x90(%rbp)
jmp 0x15163
movq 0x498a4(%rip), %rax     # 0x5ea00
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x9110
movq -0x28(%rbp), %rdi
callq 0x9110
movq -0x28(%rbp), %rdi
callq 0x9110
callq 0xc280
movq -0x30(%rbp), %rdi
callq 0x9110
movq -0x30(%rbp), %rdi
callq 0x9110
callq 0xc280
callq 0xc660
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x2, %esi
callq 0xb840
callq 0xb8b0
callq 0xc280
jmp 0x1564f
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x151e5
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
jmp 0x151f3
movq 0x49814(%rip), %rax     # 0x5ea00
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
cmpq 0x46f77(%rip), %rax     # 0x5c178
jne 0x152d3
movl $0x1, %edi
callq 0xca50
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x1522f
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0x1523d
movq 0x497ca(%rip), %rax     # 0x5ea00
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x1528c
movq -0x18(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x1526b
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa8(%rbp)
jmp 0x15279
movq 0x4978e(%rip), %rax     # 0x5ea00
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
jmp 0x1529a
movq 0x4976d(%rip), %rax     # 0x5ea00
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x9110
movl $0x2, %edi
callq 0xca50
callq 0xb8b0
callq 0xe7e0
movl $0x1, %edi
movl $0x2, %esi
callq 0xb840
callq 0xb8b0
jmp 0x1564f
movq -0x18(%rbp), %rdi
callq 0x9110
movq 0x49d6d(%rip), %rdi     # 0x5f050
callq 0x9110
callq 0x117a0
callq 0x91d0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x4, %eax
je 0x15334
movq -0x20(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x5, %eax
je 0x15334
movq 0x4a6a9(%rip), %rdi     # 0x5f9c0
callq 0x9110
movq -0x18(%rbp), %rdi
callq 0x9110
movl $0x2, %edi
callq 0x90d0
jmp 0x1564f
movq -0x20(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x5, %eax
jne 0x1537a
movq -0x20(%rbp), %rdi
callq 0x9110
callq 0x9af0
movsd %xmm0, -0x10(%rbp)
movsd 0x2fd44(%rip), %xmm0    # 0x450a0
mulsd -0x10(%rbp), %xmm0
callq 0x72e0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0xe5e0
jmp 0x1564f
movq -0x20(%rbp), %rdi
callq 0x9110
movl $0xb4, %edi
callq 0xca50
callq 0xc280
callq 0x91d0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x9bc0
cmpl $0x0, %eax
jne 0x153cd
movq 0x4a610(%rip), %rdi     # 0x5f9c0
callq 0x9110
movq -0x18(%rbp), %rdi
callq 0x9110
movl $0x2, %edi
callq 0x90d0
jmp 0x1564f
movq -0x20(%rbp), %rdi
callq 0x9110
movl $0x168, %edi            # imm = 0x168
callq 0xca50
callq 0x14c60
callq 0x13520
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0xb4(%rbp)
testl %eax, %eax
je 0x1550e
jmp 0x15400
movl -0xb4(%rbp), %eax
subl $0x1e, %eax
je 0x1551a
jmp 0x15411
movl -0xb4(%rbp), %eax
subl $0x2d, %eax
je 0x15542
jmp 0x15422
movl -0xb4(%rbp), %eax
subl $0x3c, %eax
je 0x155b0
jmp 0x15433
movl -0xb4(%rbp), %eax
subl $0x5a, %eax
je 0x15618
jmp 0x15444
movl -0xb4(%rbp), %eax
subl $0x78, %eax
je 0x155b0
jmp 0x15455
movl -0xb4(%rbp), %eax
subl $0x87, %eax
je 0x15542
jmp 0x15468
movl -0xb4(%rbp), %eax
subl $0x96, %eax
je 0x1551a
jmp 0x1547b
movl -0xb4(%rbp), %eax
subl $0xb4, %eax
je 0x1550e
jmp 0x1548e
movl -0xb4(%rbp), %eax
subl $0xd2, %eax
je 0x1552e
jmp 0x154a1
movl -0xb4(%rbp), %eax
subl $0xe1, %eax
je 0x15579
jmp 0x154b4
movl -0xb4(%rbp), %eax
subl $0xf0, %eax
je 0x155e4
jmp 0x154c7
movl -0xb4(%rbp), %eax
subl $0x10e, %eax            # imm = 0x10E
je 0x15624
jmp 0x154da
movl -0xb4(%rbp), %eax
subl $0x12c, %eax            # imm = 0x12C
je 0x155e4
jmp 0x154ed
movl -0xb4(%rbp), %eax
subl $0x13b, %eax            # imm = 0x13B
je 0x15579
jmp 0x154fc
movl -0xb4(%rbp), %eax
subl $0x14a, %eax            # imm = 0x14A
je 0x1552e
jmp 0x15630
xorl %edi, %edi
callq 0xca50
jmp 0x1564f
movl $0x1, %edi
movl $0x2, %esi
callq 0xb840
jmp 0x1564f
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x2, %esi
callq 0xb840
jmp 0x1564f
movl $0x1, %edi
movl $0x2, %esi
callq 0xb840
movl $0x2, %edi
callq 0xca50
movl $0x1, %edi
movl $0x2, %esi
callq 0xb840
callq 0xb8b0
callq 0xc280
jmp 0x1564f
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x2, %esi
callq 0xb840
movl $0x2, %edi
callq 0xca50
movl $0x1, %edi
movl $0x2, %esi
callq 0xb840
callq 0xb8b0
callq 0xc280
jmp 0x1564f
movl $0x1, %edi
movl $0x2, %esi
callq 0xb840
movl $0x3, %edi
callq 0xca50
movl $0x1, %edi
movl $0x2, %esi
callq 0xb840
callq 0xb8b0
callq 0xc280
jmp 0x1564f
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x2, %esi
callq 0xb840
movl $0x3, %edi
callq 0xca50
movl $0x1, %edi
movl $0x2, %esi
callq 0xb840
callq 0xb8b0
callq 0xc280
jmp 0x1564f
movl $0x1, %edi
callq 0xca50
jmp 0x1564f
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xca50
jmp 0x1564f
movq 0x4a389(%rip), %rdi     # 0x5f9c0
callq 0x9110
movq -0x18(%rbp), %rdi
callq 0x9110
movl $0x2, %edi
callq 0x90d0
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax,%rax)