// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: fmt
void
fmt(void)
{
	int c, d, h, i, j, m, n, w;
	struct atom *p1;

	fmt_level = 0;

	p1 = pop();

	fmt_list(p1);

	p1 = pop();

	h = HEIGHT(p1);
	d = DEPTH(p1);
	w = WIDTH(p1);

	fmt_nrow = h + d;
	fmt_ncol = w;

	n = fmt_nrow * fmt_ncol * sizeof (uint32_t); // number of bytes

	m = 1000 * (n / 1000 + 1); // round up

	if (m > fmt_buf_len) {
		if (fmt_buf)
			free(fmt_buf);
		fmt_buf = alloc_mem(m);
		fmt_buf_len = m;
	}

	memset(fmt_buf, 0, n);

	fmt_draw(0, h - 1, p1);

	outbuf_init();

	for (i = 0; i < fmt_nrow; i++) {
		for (j = 0; j < fmt_ncol; j++) {
			c = fmt_buf[i * fmt_ncol + j];
			fmt_putw(c);
		}
		fmt_putw('\n');
	}

	fmt_putw('\n'); // blank line after result

	printbuf(outbuf, BLACK);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
andl $0x0, 0xf1a7a(%rip)     # 0x10f3e8
callq 0x868d
movq %rax, %rdi
callq 0x1db30
callq 0x868d
movq %rax, %rbx
cmpb $0x1, 0x10(%rax)
leaq 0x8(%rax), %rcx
leaq 0x2105e(%rip), %rax     # 0x3e9f0
cmovneq %rax, %rcx
movq (%rcx), %rcx
movb 0x10(%rcx), %dl
cmpb $0x1, %dl
jne 0x1d9eb
movq (%rcx), %rax
cvttsd2si (%rax), %r14d
movq 0x8(%rcx), %rsi
cmpb $0x1, 0x10(%rsi)
leaq 0x21038(%rip), %rax     # 0x3e9f0
movq %rax, %rdi
cmoveq %rsi, %rdi
movq (%rdi), %rdi
cvttsd2si (%rdi), %r15d
jne 0x1da39
movq 0x8(%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
jne 0x1da4e
cmpb $0x1, %dl
jne 0x1da1c
movq 0x8(%rcx), %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x1da46
addq $0x8, %rcx
movq %rcx, %rax
jmp 0x1da30
movq 0x20ffe(%rip), %rcx     # 0x3e9f0
cvttsd2si (%rcx), %r14d
cmpb $0x1, 0x10(%rcx)
jne 0x1da4b
movq (%rcx), %rcx
cvttsd2si (%rcx), %r15d
movq 0x20fe4(%rip), %rcx     # 0x3e9f0
cmpb $0x1, 0x10(%rcx)
jne 0x1da4e
movq 0x8(%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
jne 0x1da4e
leaq 0x20fcd(%rip), %rax     # 0x3e9f0
movq 0x20fc6(%rip), %rcx     # 0x3e9f0
cmpb $0x1, 0x10(%rcx)
jne 0x1da46
movq (%rax), %rax
addq $0x8, %rax
jmp 0x1da46
movq 0x20fb0(%rip), %rcx     # 0x3e9f0
cmpb $0x1, 0x10(%rcx)
jne 0x1da4e
movq (%rax), %rax
jmp 0x1da4e
movl %r14d, %r15d
movq (%rax), %rax
cvttsd2si (%rax), %eax
addl %r14d, %r15d
movl %r15d, 0xf198d(%rip)    # 0x10f3ec
movl %eax, 0xf198b(%rip)     # 0x10f3f0
imull %eax, %r15d
shll $0x2, %r15d
movl $0x3e8, %ecx            # imm = 0x3E8
movl %r15d, %eax
cltd
idivl %ecx
movl %r15d, %r12d
subl %edx, %r12d
addl %ecx, %r12d
movq 0xf1970(%rip), %rdi     # 0x10f3f8
cmpl 0xf1965(%rip), %r12d    # 0x10f3f4
jle 0x1daaf
callq 0x7040
movl %r12d, %edi
callq 0x779c
movq %rax, %rdi
movq %rax, 0xf1950(%rip)     # 0x10f3f8
movl %r12d, 0xf1945(%rip)    # 0x10f3f4
movslq %r15d, %rdx
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x7130
decl %r14d
xorl %edi, %edi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x1db4e
callq 0x12e54
pushq $0xa
popq %rbx
cmpl 0xf1911(%rip), %r15d    # 0x10f3ec
jge 0x1db14
xorl %r14d, %r14d
movl 0xf190a(%rip), %eax     # 0x10f3f0
cmpl %eax, %r14d
jge 0x1db08
movq 0xf1906(%rip), %rcx     # 0x10f3f8
imull %r15d, %eax
addl %r14d, %eax
cltq
movl (%rcx,%rax,4), %edi
callq 0x1e36c
incl %r14d
jmp 0x1dae0
movl %ebx, %edi
callq 0x1e36c
incl %r15d
jmp 0x1dad4
pushq $0xa
popq %rdi
callq 0x1e36c
movq 0xf1895(%rip), %rdi     # 0x10f3b8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x13012