// File: /workspace/github_c_makefile_star2_O2/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 0x1322a
leaq 0xfe2f(%rip), %rdx      # 0x23038
movslq (%rdx,%rcx,4), %rsi
addq %rdx, %rsi
movq %rbx, %rcx
jmpq *%rsi
cmpq %rbx, 0x2e09c(%rip)     # 0x412b8
je 0x13364
movq (%rbx), %rdi
jmp 0x1336b
leaq 0x2b7bf(%rip), %rcx     # 0x3e9f0
movq (%rcx), %rcx
cmpq 0x2e055(%rip), %rcx     # 0x41290
je 0x1331c
leaq 0x2b7a8(%rip), %r14     # 0x3e9f0
cmpb $0x1, %al
movq %r14, %rcx
cmoveq %rbx, %rcx
movq (%rcx), %rcx
cmpq 0x2e03d(%rip), %rcx     # 0x41298
je 0x1331c
cmpq 0x2e038(%rip), %rcx     # 0x412a0
je 0x1337a
cmpq 0x29e7b(%rip), %rcx     # 0x3d0f0
je 0x1338c
cmpq 0x2e026(%rip), %rcx     # 0x412a8
je 0x1339e
cmpq 0x29841(%rip), %rcx     # 0x3cad0
jne 0x132ad
movq 0x29820(%rip), %rdi     # 0x3cab8
callq 0x13c81
cmpq 0x2b74c(%rip), %rax     # 0x3e9f0
je 0x13416
movb 0x10(%rbx), %al
cmpb $0x1, %al
movq %r14, %rcx
cmoveq %rbx, %rcx
movq (%rcx), %rcx
cmpq 0x2dff0(%rip), %rcx     # 0x412b0
je 0x133b0
cmpq 0x2ca13(%rip), %rcx     # 0x3fce0
je 0x133e3
cmpq 0x2ca0e(%rip), %rcx     # 0x3fce8
je 0x13434
cmpq 0x2ca09(%rip), %rcx     # 0x3fcf0
je 0x13467
cmpq 0x2ca04(%rip), %rcx     # 0x3fcf8
je 0x13497
cmpq 0x2c9ff(%rip), %rcx     # 0x3fd00
je 0x134c7
cmpb $0x1, %al
jne 0x1352c
movq (%rbx), %rdi
callq 0x1378d
jmp 0x13422
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x13026
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x138ad
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x13963
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1385c
leaq 0x10066(%rip), %rdi     # 0x233d1
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x12f84
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x13971
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x13b92
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x13bc9
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2b633(%rip), %r14     # 0x3e9f0
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x12e6c
leaq 0xfffa(%rip), %rdi      # 0x233d8
jmp 0x134ee
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2b600(%rip), %r14     # 0x3e9f0
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x12e6c
leaq 0xffcb(%rip), %rdi      # 0x233dc
jmp 0x134ee
leaq 0x14656(%rip), %rdi     # 0x27a73
callq 0x12f84
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x13cb2
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2b5af(%rip), %r14     # 0x3e9f0
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x12e6c
leaq 0xff7f(%rip), %rdi      # 0x233e1
jmp 0x134ee
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2b57c(%rip), %r14     # 0x3e9f0
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x12e6c
leaq 0xff51(%rip), %rdi      # 0x233e6
jmp 0x134ee
leaq 0x8(%rbx), %r15
cmpb $0x1, %al
leaq 0x2b54c(%rip), %r14     # 0x3e9f0
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x12e6c
leaq 0xff25(%rip), %rdi      # 0x233ea
jmp 0x134ee
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 0x12e6c
leaq 0xff01(%rip), %rdi      # 0x233ef
callq 0x12f84
cmpb $0x1, 0x10(%rbx)
cmovneq %r14, %r15
movq (%r15), %rax
cmpb $0x1, 0x10(%rax)
jne 0x1350a
movq 0x8(%rax), %rax
jmp 0x13511
movq 0x2b4df(%rip), %rax     # 0x3e9f0
cmpb $0x1, 0x10(%rax)
jne 0x1351a
movq %rax, %r14
movq (%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x12e6c
leaq 0xfec0(%rip), %rdi      # 0x233f3
jmp 0x1336b