// File: /workspace/github_c_makefile_star2_O3/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
movl $0x0, 0xf266d(%rip)     # 0x1163f8
movl 0x1b527(%rip), %ebx     # 0x3f2b8
movl $0xfffe795f, %r14d      # imm = 0xFFFE795F
leal (%rbx,%r14), %eax
cmpl %r14d, %eax
jbe 0x23fcd
decl %ebx
movl %ebx, 0x1b50c(%rip)     # 0x3f2b8
leaq 0x2480d(%rip), %r15     # 0x485c0
movq (%r15,%rbx,8), %rdi
callq 0x24ac1
movl %ebx, %edi
callq 0x24b6d
movl 0x1b4ef(%rip), %eax     # 0x3f2b8
leal (%rax,%r14), %ecx
cmpl %r14d, %ecx
jbe 0x23fcd
decl %eax
movl %eax, 0x1b4da(%rip)     # 0x3f2b8
movq (%r15,%rax,8), %rbx
cmpb $0x1, 0x10(%rbx)
leaq 0x8(%rbx), %rax
leaq 0x21c0f(%rip), %rcx     # 0x45a00
cmovneq %rcx, %rax
movq (%rax), %rdx
movb 0x10(%rdx), %sil
cmpb $0x1, %sil
jne 0x23e4c
movq (%rdx), %rax
cvttsd2si (%rax), %r14d
movq 0x8(%rdx), %rdi
cmpb $0x1, 0x10(%rdi)
leaq 0x21be7(%rip), %rcx     # 0x45a00
movq %rcx, %rax
cmoveq %rdi, %rax
movq (%rax), %rax
cvttsd2si (%rax), %eax
jne 0x23e99
movq 0x8(%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
jne 0x23eae
cmpb $0x1, %sil
jne 0x23e7c
movq 0x8(%rdx), %rsi
cmpb $0x1, 0x10(%rsi)
jne 0x23ea6
addq $0x8, %rdx
movq %rdx, %rcx
jmp 0x23e90
movq 0x21bad(%rip), %rax     # 0x45a00
cvttsd2si (%rax), %r14d
cmpb $0x1, 0x10(%rax)
jne 0x23eab
movq (%rax), %rax
cvttsd2si (%rax), %eax
movq 0x21b94(%rip), %rdx     # 0x45a00
cmpb $0x1, 0x10(%rdx)
jne 0x23eae
movq 0x8(%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x23eae
leaq 0x21b7d(%rip), %rcx     # 0x45a00
movq 0x21b76(%rip), %rdx     # 0x45a00
cmpb $0x1, 0x10(%rdx)
jne 0x23ea6
movq (%rcx), %rcx
addq $0x8, %rcx
jmp 0x23ea6
movq 0x21b60(%rip), %rdx     # 0x45a00
cmpb $0x1, 0x10(%rdx)
jne 0x23eae
movq (%rcx), %rcx
jmp 0x23eae
movl %r14d, %eax
movq (%rcx), %rcx
cvttsd2si (%rcx), %ecx
addl %r14d, %eax
movl %eax, 0xf253e(%rip)     # 0x1163fc
movl %ecx, 0xf253c(%rip)     # 0x116400
imull %ecx, %eax
shll $0x2, %eax
movslq %eax, %r15
imulq $0x10624dd3, %r15, %rax # imm = 0x10624DD3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x26, %rax
addl %ecx, %eax
imull $0x3e8, %eax, %r12d     # imm = 0x3E8
addl $0x3e8, %r12d           # imm = 0x3E8
movq 0xf2512(%rip), %rdi     # 0x116408
cmpl 0xf2507(%rip), %r12d    # 0x116404
jle 0x23f22
testq %rdi, %rdi
je 0x23f09
callq 0x7040
movl %r12d, %edi
callq 0x7853
movq %rax, %rdi
movq %rax, 0xf24ed(%rip)     # 0x116408
movl %r12d, 0xf24e2(%rip)    # 0x116404
xorl %r12d, %r12d
xorl %esi, %esi
movq %r15, %rdx
callq 0x7130
decl %r14d
xorl %edi, %edi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x23ff7
movl $0x0, 0xf28af(%rip)     # 0x1167f8
leaq 0xaf9b(%rip), %rdi      # 0x2eeeb
callq 0x16573
cmpl $0x0, 0xf24a0(%rip)     # 0x1163fc
jle 0x23fa5
movl 0xf249c(%rip), %eax     # 0x116400
testl %eax, %eax
jle 0x23f8f
xorl %ebx, %ebx
movq 0xf2497(%rip), %rcx     # 0x116408
imull %r12d, %eax
cltq
addq %rbx, %rax
movl (%rcx,%rax,4), %edi
callq 0x24930
movl 0xf2478(%rip), %eax     # 0x116400
incq %rbx
cmpl %eax, %ebx
jl 0x23f6a
movl $0xa, %edi
callq 0x24930
incl %r12d
cmpl 0xf2459(%rip), %r12d    # 0x1163fc
jl 0x23f5e
movl $0xa, %edi
callq 0x24930
movq 0xf2412(%rip), %rdi     # 0x1163c8
movq 0x14013(%rip), %rax     # 0x37fd0
movq (%rax), %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7120
leaq 0xaf6d(%rip), %rdi      # 0x2ef41
callq 0x780b