// File: /workspace/github_c_makefile_star2_O1/georgeweigt[P]eigenmath/eigenmath.c
// Function: fmt_draw
void
fmt_draw(int x, int y, struct atom *p)
{
	int d, dx, dy, h, i, k, w;

	k = OPCODE(p);
	h = HEIGHT(p);
	d = DEPTH(p);
	w = WIDTH(p);

	p = cddddr(p);

	switch (k) {

	case EMIT_SPACE:
		break;

	case EMIT_CHAR:
		fmt_draw_char(x, y, VAL1(p));
		break;

	case EMIT_LIST:
		p = car(p);
		while (iscons(p)) {
			fmt_draw(x, y, car(p));
			x += WIDTH(car(p));
			p = cdr(p);
		}
		break;

	case EMIT_SUPERSCRIPT:
	case EMIT_SUBSCRIPT:
		dx = VAL1(p);
		dy = VAL2(p);
		p = caddr(p);
		fmt_draw(x + dx, y + dy, p);
		break;

	case EMIT_SUBEXPR:
		fmt_draw_delims(x, y, h, d, w);
		fmt_draw(x + 1, y, car(p));
		break;

	case EMIT_FRACTION:

		// horizontal line

		fmt_draw_char(x, y, BDLR);

		for (i = 1; i < w - 1; i++)
			fmt_draw_char(x + i, y, BDLH);

		fmt_draw_char(x + w - 1, y, BDLL);

		// numerator

		dx = (w - WIDTH(car(p))) / 2;
		dy = -h + HEIGHT(car(p));
		fmt_draw(x + dx, y + dy, car(p));

		// denominator

		p = cdr(p);
		dx = (w - WIDTH(car(p))) / 2;
		dy = d - DEPTH(car(p));
		fmt_draw(x + dx, y + dy, car(p));

		break;

	case EMIT_TABLE:
		fmt_draw_delims(x, y, h, d, w);
		fmt_draw_table(x + 2, y - h + 1, p);
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, -0x2c(%rbp)
movl %edi, %r14d
leaq 0x1f9f3(%rip), %r15     # 0x40a00
leal 0x1(%r14), %r12d
leaq 0x8(%rdx), %rcx
cmpb $0x1, 0x10(%rdx)
cmovneq %r15, %rdx
movq (%rdx), %rax
cvttsd2si (%rax), %eax
cmovneq %r15, %rcx
movq (%rcx), %rsi
movb 0x10(%rsi), %dl
leaq 0x8(%rsi), %rcx
cmpb $0x1, %dl
cmovneq %r15, %rsi
movq (%rsi), %rsi
cvttsd2si (%rsi), %r13d
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x21061
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
movq (%rsi), %rsi
cvttsd2si (%rsi), %r9d
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x21090
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x210c6
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x210c3
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
movq (%rsi), %rsi
cvttsd2si (%rsi), %r8d
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x210f5
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x2112c
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x21125
cmpb $0x1, %dl
cmovneq %r15, %rcx
movq (%rcx), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rbx
cmpl $0x6, %eax
jne 0x2115b
movl %r14d, %edi
movl -0x2c(%rbp), %esi
movl %r13d, %edx
movl %r9d, %ecx
callq 0x241a9
incl %r14d
cmpb $0x1, 0x10(%rbx)
cmovneq %r15, %rbx
movq (%rbx), %rdx
incl %r12d
jmp 0x21011
addl $-0x2, %eax
cmpl $0x6, %eax
ja 0x216ef
leaq 0x4f26(%rip), %rcx      # 0x26094
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rbx)
cmovneq %r15, %rbx
cmovneq %r15, %rax
movq (%rax), %rax
movb 0x10(%rax), %dl
leaq 0x8(%rax), %rcx
cmpb $0x1, %dl
cmovneq %r15, %rax
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x211b5
cmpb $0x1, %dl
cmovneq %r15, %rcx
movq (%rcx), %rsi
movq (%rbx), %rcx
cvttsd2si (%rcx), %ecx
movq (%rax), %rax
cvttsd2si (%rax), %eax
movq (%rsi), %rdx
addl %r14d, %ecx
addl %eax, -0x2c(%rbp)
movl %ecx, %r14d
jmp 0x2100d
testl %r14d, %r14d
js 0x2120a
cmpl $0x0, -0x2c(%rbp)
js 0x2120a
movl 0xf021b(%rip), %eax     # 0x111400
cmpl %r14d, %eax
jle 0x2120a
movl -0x2c(%rbp), %ecx
cmpl %ecx, 0xf0209(%rip)     # 0x1113fc
jle 0x2120a
movq 0xf020c(%rip), %rcx     # 0x111408
imull -0x2c(%rbp), %eax
addl %r14d, %eax
movl $0xe295b6, (%rcx,%rax,4) # imm = 0xE295B6
cmpl $0x3, %r8d
jl 0x21251
movq 0xf01f1(%rip), %rax     # 0x111408
leal -0x2(%r8), %ecx
testl %r12d, %r12d
js 0x2124a
cmpl $0x0, -0x2c(%rbp)
js 0x2124a
movl 0xf01d4(%rip), %edx     # 0x111400
cmpl %r12d, %edx
jle 0x2124a
movl -0x2c(%rbp), %esi
cmpl %esi, 0xf01c2(%rip)     # 0x1113fc
jle 0x2124a
imull -0x2c(%rbp), %edx
addl %r12d, %edx
movl $0xe29480, (%rax,%rdx,4) # imm = 0xE29480
incl %r12d
decl %ecx
jne 0x2121b
leal (%r8,%r14), %ecx
testl %ecx, %ecx
jle 0x2128e
cmpl $0x0, -0x2c(%rbp)
js 0x2128e
movl 0xf019b(%rip), %eax     # 0x111400
cmpl %ecx, %eax
jl 0x2128e
movl -0x2c(%rbp), %ecx
cmpl %ecx, 0xf018a(%rip)     # 0x1113fc
jle 0x2128e
leal (%r8,%r14), %ecx
decl %ecx
movq 0xf0187(%rip), %rdx     # 0x111408
imull -0x2c(%rbp), %eax
addl %ecx, %eax
movl $0xe295b4, (%rdx,%rax,4) # imm = 0xE295B4
cmpb $0x1, 0x10(%rbx)
movq %r15, %rax
cmoveq %rbx, %rax
movq (%rax), %rdx
movb 0x10(%rdx), %cl
leaq 0x8(%rdx), %rax
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x212ca
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x21304
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x212fd
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x21374
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x21337
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x21371
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x2136a
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
movl %r9d, -0x30(%rbp)
movq (%rsi), %rsi
cvttsd2si (%rsi), %esi
cmpb $0x1, %cl
movq %r15, %rdi
cmoveq %rax, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r15, %r9
jne 0x2139f
cmpb $0x1, %cl
cmovneq %r15, %rax
movq (%rax), %r9
movq %r8, %r12
movl %r8d, %eax
subl %esi, %eax
movl %eax, %edi
shrl $0x1f, %edi
addl %eax, %edi
sarl %edi
movq (%r9), %rax
cvttsd2si (%rax), %eax
addl %r14d, %edi
movl -0x2c(%rbp), %esi
subl %r13d, %esi
addl %eax, %esi
callq 0x20ff2
cmpb $0x1, 0x10(%rbx)
leaq 0x8(%rbx), %rax
cmovneq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r15, %rax
movq (%rax), %rdx
movb 0x10(%rdx), %cl
leaq 0x8(%rdx), %rax
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x2140f
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
movl -0x30(%rbp), %r8d
jne 0x2144d
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x21446
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x214bd
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x21480
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x214ba
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x214b3
cmpb $0x1, %cl
movq %r15, %rsi
cmoveq %rax, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
movq (%rsi), %rsi
cvttsd2si (%rsi), %esi
cmpb $0x1, %cl
movq %r15, %rdi
cmoveq %rax, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r15, %rdi
jne 0x214eb
cmpb $0x1, %cl
movq %r15, %rdi
cmoveq %rax, %rdi
movq (%rdi), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r15, %rdi
jne 0x2151e
cmpb $0x1, %cl
movq %r15, %rdi
cmoveq %rax, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r15, %rdi
jne 0x2151b
cmpb $0x1, %cl
cmovneq %r15, %rax
movq (%rax), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
subl %esi, %r12d
movl %r12d, %eax
shrl $0x1f, %eax
addl %r12d, %eax
sarl %eax
movq (%rdi), %rcx
cvttsd2si (%rcx), %ecx
addl %r14d, %eax
addl -0x2c(%rbp), %r8d
subl %ecx, %r8d
movl %eax, %r14d
movl %r8d, -0x2c(%rbp)
jmp 0x2100d
cmpb $0x1, 0x10(%rbx)
leaq 0x1f4ac(%rip), %r15     # 0x40a00
cmovneq %r15, %rbx
movq (%rbx), %rbx
cmpb $0x1, 0x10(%rbx)
jne 0x216ef
movq (%rbx), %rdx
movl %r14d, %edi
movl -0x2c(%rbp), %esi
callq 0x20ff2
movb 0x10(%rbx), %al
cmpb $0x1, %al
movq %r15, %rcx
cmoveq %rbx, %rcx
movq (%rcx), %rcx
movb 0x10(%rcx), %dl
addq $0x8, %rcx
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x215b0
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x215ea
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x215e3
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x21657
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x2161d
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x21654
cmpb $0x1, %dl
movq %r15, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r15, %rsi
jne 0x2164d
cmpb $0x1, %dl
cmovneq %r15, %rcx
movq (%rcx), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
addq $0x8, %rsi
movq (%rsi), %rsi
movq (%rsi), %rcx
cvttsd2si (%rcx), %ecx
addl %ecx, %r14d
addq $0x8, %rbx
cmpb $0x1, %al
jmp 0x21554
movl %r14d, %edi
movl -0x2c(%rbp), %r15d
movl %r15d, %esi
movl %r13d, %edx
movl %r9d, %ecx
callq 0x241a9
addl $0x2, %r14d
subl %r13d, %r15d
incl %r15d
movl %r14d, %edi
movl %r15d, %esi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x24278
cmpb $0x1, 0x10(%rbx)
leaq 0x1f34e(%rip), %rax     # 0x40a00
cmoveq %rbx, %rax
testl %r14d, %r14d
js 0x216ef
cmpl $0x0, -0x2c(%rbp)
js 0x216ef
movl 0xefd39(%rip), %ecx     # 0x111400
cmpl %r14d, %ecx
jle 0x216ef
movl -0x2c(%rbp), %edx
cmpl %edx, 0xefd27(%rip)     # 0x1113fc
jle 0x216ef
movq (%rax), %rax
cvttsd2si (%rax), %eax
movq 0xefd23(%rip), %rdx     # 0x111408
imull -0x2c(%rbp), %ecx
addl %r14d, %ecx
movl %eax, (%rdx,%rcx,4)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq