// File: /workspace/github_c_makefile_star2_O1/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
movl %eax, %ecx
decl %ecx
cmpl $0x6, %ecx
ja 0x14f86
leaq 0x110c1(%rip), %rdx     # 0x2601c
movslq (%rdx,%rcx,4), %rsi
addq %rdx, %rsi
movq %rbx, %rcx
jmpq *%rsi
cmpq %rbx, 0x2e35a(%rip)     # 0x432c8
je 0x150cf
andb $-0x2, %al
cmpb $0x2, %al
jne 0x150d8
movq (%rbx), %rdi
jmp 0x150df
leaq 0x2ba73(%rip), %rcx     # 0x40a00
movq (%rcx), %rcx
cmpq 0x2e309(%rip), %rcx     # 0x432a0
je 0x15078
cmpb $0x1, %al
leaq 0x2ba5a(%rip), %r14     # 0x40a00
movq %r14, %rax
cmoveq %rbx, %rax
movq (%rax), %rax
cmpq 0x2e2f1(%rip), %rax     # 0x432a8
je 0x15078
cmpq 0x2e2ec(%rip), %rax     # 0x432b0
je 0x150ee
cmpq 0x2a12f(%rip), %rax     # 0x3f100
je 0x15100
cmpq 0x2e2da(%rip), %rax     # 0x432b8
je 0x15112
cmpq 0x29af5(%rip), %rax     # 0x3eae0
jne 0x15006
movq 0x29ad4(%rip), %rdi     # 0x3eac8
callq 0x15aa6
cmpq 0x2ba00(%rip), %rax     # 0x40a00
je 0x1518a
movb 0x10(%rbx), %al
cmpb $0x1, %al
movq %r14, %rcx
cmoveq %rbx, %rcx
movq (%rcx), %rcx
cmpq 0x2e2a4(%rip), %rcx     # 0x432c0
je 0x15124
cmpq 0x2ccc7(%rip), %rcx     # 0x41cf0
je 0x15157
cmpq 0x2ccc2(%rip), %rcx     # 0x41cf8
je 0x151a8
cmpq 0x2ccbd(%rip), %rcx     # 0x41d00
je 0x151db
cmpq 0x2ccb8(%rip), %rcx     # 0x41d08
je 0x1520b
cmpq 0x2ccb3(%rip), %rcx     # 0x41d10
je 0x1523b
cmpb $0x1, %al
jne 0x152af
movq (%rbx), %rdi
callq 0x15525
jmp 0x15196
leaq 0x11323(%rip), %rdi     # 0x263a2
callq 0x14c8d
movq %rbx, %rdi
callq 0x14b66
leaq 0x14387(%rip), %rdi     # 0x2941a
jmp 0x150df
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1568d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x15e0a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x15634
leaq 0x112a3(%rip), %rdi     # 0x26379
jmp 0x150df
leaq 0x15e99(%rip), %rdi     # 0x2af78
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x14c8d
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x15751
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1599f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x159d6
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2b8cf(%rip), %r14     # 0x40a00
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x14b66
leaq 0x1122e(%rip), %rdi     # 0x26380
jmp 0x15262
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2b89c(%rip), %r14     # 0x40a00
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x14b66
leaq 0x111ff(%rip), %rdi     # 0x26384
jmp 0x15262
leaq 0x1588a(%rip), %rdi     # 0x2aa1b
callq 0x14c8d
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x15ad7
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2b84b(%rip), %r14     # 0x40a00
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x14b66
leaq 0x111b3(%rip), %rdi     # 0x26389
jmp 0x15262
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2b818(%rip), %r14     # 0x40a00
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x14b66
leaq 0x11185(%rip), %rdi     # 0x2638e
jmp 0x15262
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2b7e8(%rip), %r14     # 0x40a00
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x14b66
leaq 0x11159(%rip), %rdi     # 0x26392
jmp 0x15262
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 0x14b66
leaq 0x11135(%rip), %rdi     # 0x26397
callq 0x14c8d
cmpb $0x1, 0x10(%rbx)
cmovneq %r14, %r15
movq (%r15), %rax
movb 0x10(%rax), %cl
addq $0x8, %rax
cmpb $0x1, %cl
movq %r14, %rdx
cmoveq %rax, %rdx
movq (%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x1529d
cmpb $0x1, %cl
leaq 0x2b76a(%rip), %rcx     # 0x40a00
cmoveq %rax, %rcx
movq (%rcx), %r14
movq (%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x14b66
leaq 0x110e5(%rip), %rdi     # 0x2639b
jmp 0x150df