// File: /workspace/github_c_makefile_star2_O3/georgeweigt[P]eigenmath/eigenmath.c
// Function: infixform_factor
void
infixform_factor(struct atom *p)
{
	if (isrational(p)) {
		infixform_rational(p);
		return;
	}

	if (isdouble(p)) {
		infixform_double(p);
		return;
	}

	if (issymbol(p)) {
		if (p == symbol(EXP1))
			outbuf_puts("exp(1)");
		else
			outbuf_puts(printname(p));
		return;
	}

	if (isstr(p)) {
		outbuf_puts(p->u.str);
		return;
	}

	if (istensor(p)) {
		infixform_tensor(p);
		return;
	}

	if (car(p) == symbol(ADD) || car(p) == symbol(MULTIPLY)) {
		infixform_subexpr(p);
		return;
	}

	if (car(p) == symbol(POWER)) {
		infixform_power(p);
		return;
	}

	if (car(p) == symbol(FACTORIAL)) {
		infixform_factorial(p);
		return;
	}

	if (car(p) == symbol(INDEX)) {
		infixform_index(p);
		return;
	}

	// use d if for derivative if d not defined

	if (car(p) == symbol(DERIVATIVE) && get_usrfunc(symbol(D_LOWER)) == symbol(NIL)) {
		outbuf_puts("d");
		infixform_arglist(p);
		return;
	}

	if (car(p) == symbol(SETQ)) {
		infixform_expr(cadr(p));
		outbuf_puts(" = ");
		infixform_expr(caddr(p));
		return;
	}

	if (car(p) == symbol(TESTEQ)) {
		infixform_expr(cadr(p));
		outbuf_puts(" == ");
		infixform_expr(caddr(p));
		return;
	}

	if (car(p) == symbol(TESTGE)) {
		infixform_expr(cadr(p));
		outbuf_puts(" >= ");
		infixform_expr(caddr(p));
		return;
	}

	if (car(p) == symbol(TESTGT)) {
		infixform_expr(cadr(p));
		outbuf_puts(" > ");
		infixform_expr(caddr(p));
		return;
	}

	if (car(p) == symbol(TESTLE)) {
		infixform_expr(cadr(p));
		outbuf_puts(" <= ");
		infixform_expr(caddr(p));
		return;
	}

	if (car(p) == symbol(TESTLT)) {
		infixform_expr(cadr(p));
		outbuf_puts(" < ");
		infixform_expr(caddr(p));
		return;
	}

	// other function

	if (iscons(p)) {
		infixform_base(car(p));
		infixform_arglist(p);
		return;
	}

	outbuf_puts(" ? ");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzbl 0x10(%rdi), %eax
leal -0x1(%rax), %ecx
cmpl $0x6, %ecx
ja 0x16868
leaq 0x137f1(%rip), %rdx     # 0x2a038
movslq (%rdx,%rcx,4), %rsi
addq %rdx, %rsi
movq %rbx, %rcx
jmpq *%rsi
cmpq %rbx, 0x31a6e(%rip)     # 0x482c8
je 0x169b1
movq (%rbx), %rdi
jmp 0x169b8
leaq 0x2f191(%rip), %rcx     # 0x45a00
movq (%rcx), %rcx
cmpq 0x31a27(%rip), %rcx     # 0x482a0
je 0x1695a
cmpb $0x1, %al
leaq 0x2f178(%rip), %r14     # 0x45a00
movq %r14, %rcx
cmoveq %rbx, %rcx
movq (%rcx), %rcx
cmpq 0x31a0f(%rip), %rcx     # 0x482a8
je 0x1695a
cmpq 0x31a0a(%rip), %rcx     # 0x482b0
je 0x169c7
cmpq 0x2d84d(%rip), %rcx     # 0x44100
je 0x169d9
cmpq 0x319f8(%rip), %rcx     # 0x482b8
je 0x169eb
cmpq 0x2d213(%rip), %rcx     # 0x43ae0
jne 0x168eb
movq 0x2d1f2(%rip), %rdi     # 0x43ac8
callq 0x1732b
cmpq 0x2f11e(%rip), %rax     # 0x45a00
je 0x16a63
movb 0x10(%rbx), %al
cmpb $0x1, %al
movq %r14, %rcx
cmoveq %rbx, %rcx
movq (%rcx), %rcx
cmpq 0x319c2(%rip), %rcx     # 0x482c0
je 0x169fd
cmpq 0x303e5(%rip), %rcx     # 0x46cf0
je 0x16a30
cmpq 0x303e0(%rip), %rcx     # 0x46cf8
je 0x16a81
cmpq 0x303db(%rip), %rcx     # 0x46d00
je 0x16ab4
cmpq 0x303d6(%rip), %rcx     # 0x46d08
je 0x16ae4
cmpq 0x303d1(%rip), %rcx     # 0x46d10
je 0x16b14
cmpb $0x1, %al
jne 0x16b79
movq (%rbx), %rdi
callq 0x16de4
jmp 0x16a6f
leaq 0x13a61(%rip), %rdi     # 0x2a3c2
callq 0x16573
movq %rbx, %rdi
callq 0x1642d
leaq 0x16ac5(%rip), %rdi     # 0x2d43a
jmp 0x169b8
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x16f44
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x17679
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x16ef3
leaq 0x139e1(%rip), %rdi     # 0x2a399
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x16573
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x17008
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x17224
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1725b
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2eff6(%rip), %r14     # 0x45a00
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x1642d
leaq 0x13975(%rip), %rdi     # 0x2a3a0
jmp 0x16b3b
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2efc3(%rip), %r14     # 0x45a00
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x1642d
leaq 0x13946(%rip), %rdi     # 0x2a3a4
jmp 0x16b3b
leaq 0x17fd1(%rip), %rdi     # 0x2ea3b
callq 0x16573
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1735c
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2ef72(%rip), %r14     # 0x45a00
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x1642d
leaq 0x138fa(%rip), %rdi     # 0x2a3a9
jmp 0x16b3b
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2ef3f(%rip), %r14     # 0x45a00
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x1642d
leaq 0x138cc(%rip), %rdi     # 0x2a3ae
jmp 0x16b3b
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2ef0f(%rip), %r14     # 0x45a00
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x1642d
leaq 0x138a0(%rip), %rdi     # 0x2a3b2
jmp 0x16b3b
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x1642d
leaq 0x1387c(%rip), %rdi     # 0x2a3b7
callq 0x16573
cmpb $0x1, 0x10(%rbx)
cmovneq %r14, %r15
movq (%r15), %rax
cmpb $0x1, 0x10(%rax)
jne 0x16b57
movq 0x8(%rax), %rax
jmp 0x16b5e
movq 0x2eea2(%rip), %rax     # 0x45a00
cmpb $0x1, 0x10(%rax)
jne 0x16b67
movq %rax, %r14
movq (%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1642d
leaq 0x1383b(%rip), %rdi     # 0x2a3bb
jmp 0x169b8