// File: /workspace/github_c_makefile_star2_O1/georgeweigt[P]eigenmath/eigenmath.c
// Function: infixform_power
void
infixform_power(struct atom *p)
{
	if (cadr(p) == symbol(EXP1)) {
		outbuf_puts("exp(");
		infixform_expr(caddr(p));
		outbuf_puts(")");
		return;
	}

	if (isimaginaryunit(p)) {
		if (isimaginaryunit(get_binding(symbol(J_LOWER)))) {
			outbuf_puts("j");
			return;
		}
		if (isimaginaryunit(get_binding(symbol(I_LOWER)))) {
			outbuf_puts("i");
			return;
		}
	}

	if (isnegativenumber(caddr(p))) {
		infixform_reciprocal(p);
		return;
	}

	infixform_base(cadr(p));

	outbuf_puts("^");

	p = caddr(p); // p now points to exponent

	if (isnum(p))
		infixform_numeric_exponent(p);
	else if (car(p) == symbol(ADD) || car(p) == symbol(MULTIPLY) || car(p) == symbol(POWER) || car(p) == symbol(FACTORIAL))
		infixform_subexpr(p);
	else
		infixform_expr(p);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
cmpb $0x1, 0x10(%rdi)
leaq 0x2b293(%rip), %r15     # 0x40a00
movq %r15, %rax
cmoveq %r14, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r15, %rax
movq (%rax), %rax
cmpq 0x2db3f(%rip), %rax     # 0x432c8
je 0x157bc
movq %rbx, %rdi
callq 0x15b7a
testl %eax, %eax
je 0x15844
movq 0x2a5e6(%rip), %rdi     # 0x3fd88
callq 0xe468
movq %rax, %rdi
callq 0x15b7a
testl %eax, %eax
je 0x15823
leaq 0x157d3(%rip), %rdi     # 0x2af8d
jmp 0x15814
leaq 0x10bdc(%rip), %rdi     # 0x2639f
callq 0x14c8d
cmpb $0x1, 0x10(%rbx)
leaq 0x2b22d(%rip), %rax     # 0x40a00
cmovneq %rax, %r14
movq (%r14), %rcx
movb 0x10(%rcx), %dl
addq $0x8, %rcx
cmpb $0x1, %dl
movq %rax, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
jne 0x15805
cmpb $0x1, %dl
leaq 0x2b202(%rip), %rax     # 0x40a00
cmoveq %rcx, %rax
movq (%rax), %rax
movq (%rax), %rdi
callq 0x14b66
leaq 0x13c06(%rip), %rdi     # 0x2941a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x14c8d
movq 0x2a23e(%rip), %rdi     # 0x3fa68
callq 0xe468
movq %rax, %rdi
callq 0x15b7a
testl %eax, %eax
je 0x15844
leaq 0x153d0(%rip), %rdi     # 0x2ac12
jmp 0x15814
cmpb $0x1, 0x10(%rbx)
movq %r15, %rax
cmoveq %r14, %rax
movq (%rax), %rax
movb 0x10(%rax), %cl
leaq 0x8(%rax), %rdx
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rdx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
jne 0x1587d
cmpb $0x1, %cl
leaq 0x2b18a(%rip), %rsi     # 0x40a00
cmoveq %rdx, %rsi
movq (%rsi), %r15
movq (%r15), %rdx
movzbl 0x10(%rdx), %esi
cmpl $0x5, %esi
je 0x15897
cmpl $0x4, %esi
jne 0x158b8
cmpb $0x1, 0x12(%rdx)
sete %dl
jmp 0x158a2
xorpd %xmm0, %xmm0
ucomisd (%rdx), %xmm0
seta %dl
testb %dl, %dl
je 0x158b8
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x15c28
cmpb $0x1, %cl
leaq 0x2b13e(%rip), %r15     # 0x40a00
cmovneq %r15, %rax
movq (%rax), %rdi
callq 0x15525
leaq 0x10ae4(%rip), %rdi     # 0x263b9
callq 0x14c8d
cmpb $0x1, 0x10(%rbx)
cmovneq %r15, %r14
movq (%r14), %rax
movb 0x10(%rax), %cl
addq $0x8, %rax
cmpb $0x1, %cl
movq %r15, %rdx
cmoveq %rax, %rdx
movq (%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x15910
cmpb $0x1, %cl
leaq 0x2b0f7(%rip), %rcx     # 0x40a00
cmoveq %rax, %rcx
movq (%rcx), %r15
movq (%r15), %rbx
movb 0x10(%rbx), %al
movzbl %al, %ecx
leal -0x4(%rcx), %edx
cmpl $0x2, %edx
jae 0x15933
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x155c4
movq %rbx, %rdx
cmpl $0x1, %ecx
je 0x15942
leaq 0x2b0be(%rip), %rdx     # 0x40a00
movq (%rdx), %rcx
cmpq 0x2d954(%rip), %rcx     # 0x432a0
je 0x1598b
cmpb $0x1, %al
leaq 0x2b0a9(%rip), %rax     # 0x40a00
cmoveq %rbx, %rax
movq (%rax), %rax
cmpq 0x2d943(%rip), %rax     # 0x432a8
je 0x1598b
cmpq 0x2d942(%rip), %rax     # 0x432b0
je 0x1598b
cmpq 0x29789(%rip), %rax     # 0x3f100
je 0x1598b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x14b66
leaq 0x10a10(%rip), %rdi     # 0x263a2
callq 0x14c8d
movq %rbx, %rdi
jmp 0x15808