// File: /workspace/github_c_makefile_star2_O3/georgeweigt[P]eigenmath/eigenmath.c
// Function: power_natural_number
void
power_natural_number(struct atom *EXPO)
{
	double x, y;

	// exp(x + i y) = exp(x) (cos(y) + i sin(y))

	if (isdoublez(EXPO)) {
		if (car(EXPO) == symbol(ADD)) {
			x = cadr(EXPO)->u.d;
			y = cadaddr(EXPO)->u.d;
		} else {
			x = 0.0;
			y = cadr(EXPO)->u.d;
		}
		push_double(exp(x));
		push_double(y);
		cosfunc();
		push(imaginaryunit);
		push_double(y);
		sinfunc();
		multiply();
		add();
		multiply();
		return;
	}

	// e^log(expr) = expr

	if (car(EXPO) == symbol(LOG)) {
		push(cadr(EXPO));
		return;
	}

	if (isdenormalpolar(EXPO)) {
		normalize_polar(EXPO);
		return;
	}

	push_symbol(POWER);
	push_symbol(EXP1);
	push(EXPO);
	list(3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0xca1c
movb 0x10(%rbx), %dl
cmpb $0x1, %dl
leaq 0x29536(%rip), %rcx     # 0x45a00
movq %rcx, %rsi
cmoveq %rbx, %rsi
movq (%rsi), %rsi
testl %eax, %eax
je 0x1c502
addq $0x8, %rbx
cmpb $0x1, %dl
cmovneq %rcx, %rbx
movq (%rbx), %rax
movb 0x10(%rax), %dl
cmpq 0x2bdb0(%rip), %rsi     # 0x482a0
je 0x1c529
cmpb $0x1, %dl
cmoveq %rax, %rcx
pxor %xmm0, %xmm0
jmp 0x1c64c
cmpq 0x28ec7(%rip), %rsi     # 0x453d0
je 0x1c579
movq %rbx, %rdi
callq 0x1d1fe
testl %eax, %eax
je 0x1c5d7
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0x1d288
cmpb $0x1, %dl
jne 0x1c5a4
movq (%rax), %rsi
movq 0x8(%rax), %rax
movb 0x10(%rax), %dl
cmpb $0x1, %dl
leaq 0x294be(%rip), %rcx     # 0x45a00
movq %rcx, %rdi
cmoveq %rax, %rdi
movq (%rsi), %xmm0
movq (%rdi), %rsi
cmpb $0x1, 0x10(%rsi)
jne 0x1c607
cmpb $0x1, %dl
jne 0x1c61e
movq (%rax), %rdx
movq 0x8(%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
je 0x1c619
jmp 0x1c64c
addq $0x8, %rbx
cmpb $0x1, %dl
leaq 0x29479(%rip), %rax     # 0x45a00
cmovneq %rax, %rbx
movq (%rbx), %rcx
cmpb $0x1, 0x10(%rcx)
cmoveq %rcx, %rax
movq (%rax), %rdi
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0x8ba5
movq 0x29455(%rip), %rax     # 0x45a00
movq (%rax), %xmm0
cmpb $0x1, 0x10(%rax)
jne 0x1c64c
movq %xmm0, %rax
cmpb $0x1, 0x10(%rax)
jne 0x1c642
movq 0x8(%rax), %rcx
cmpb $0x1, 0x10(%rcx)
je 0x1c63c
leaq 0x2942b(%rip), %rcx     # 0x45a00
jmp 0x1c64c
movq 0x2bcd2(%rip), %rdi     # 0x482b0
callq 0x8ba5
movq 0x2bcde(%rip), %rdi     # 0x482c8
callq 0x8ba5
movq %rbx, %rdi
callq 0x8ba5
movl $0x3, %edi
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0x8b7d
movq 0x293f2(%rip), %rsi     # 0x45a00
cmpb $0x1, 0x10(%rsi)
jne 0x1c64c
cmpb $0x1, %dl
jne 0x1c62f
movq (%rax), %rax
jmp 0x1c636
movq 0x293db(%rip), %rax     # 0x45a00
movq 0x8(%rax), %rax
cmpb $0x1, 0x10(%rax)
jne 0x1c64c
movq 0x293ca(%rip), %rax     # 0x45a00
cmpb $0x1, 0x10(%rax)
jne 0x1c642
addq $0x8, %rax
jmp 0x1c649
leaq 0x293b7(%rip), %rax     # 0x45a00
movq (%rax), %rcx
movq (%rcx), %rax
movsd (%rax), %xmm1
movsd %xmm1, -0x10(%rbp)
callq 0x7370
movq %xmm0, -0x18(%rbp)
callq 0x74dc
movb $0x5, %bl
movb %bl, 0x10(%rax)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %rax, %rdi
callq 0x8ba5
callq 0x74dc
movb %bl, 0x10(%rax)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %rax, %rdi
callq 0x8ba5
callq 0x10115
movq 0xef43e(%rip), %rdi     # 0x10bae0
callq 0x8ba5
callq 0x74dc
movb %bl, 0x10(%rax)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %rax, %rdi
callq 0x8ba5
callq 0x10ab4
movl $0x2, %edi
callq 0xacef
movl $0x2, %edi
callq 0xadb3
movl $0x2, %edi
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0xacef