// File: /workspace/github_c_makefile_star2_O1/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, 0xf0627(%rip)     # 0x1113f8
callq 0x8b78
movl 0x194dc(%rip), %ebx     # 0x3a2b8
movq %rax, %rdi
callq 0x2188f
movl %ebx, %edi
callq 0x2191c
callq 0x8b78
movq %rax, %rbx
addq $0x8, %rax
cmpb $0x1, 0x10(%rbx)
leaq 0x1fbfe(%rip), %rdx     # 0x40a00
cmovneq %rdx, %rax
movq (%rax), %rsi
movb 0x10(%rsi), %cl
leaq 0x8(%rsi), %rax
cmpb $0x1, %cl
cmovneq %rdx, %rsi
movq %rdx, %rdi
cmoveq %rax, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %rdx, %rdi
jne 0x20e3b
cmpb $0x1, %cl
leaq 0x1fbcc(%rip), %rdi     # 0x40a00
cmoveq %rax, %rdi
movq (%rdi), %rdi
movq (%rsi), %rsi
cmpb $0x1, %cl
movq (%rdi), %rdi
movq %rdx, %r8
cmoveq %rax, %r8
movq (%r8), %r8
cmpb $0x1, 0x10(%r8)
movq %rdx, %r8
jne 0x20e6d
cmpb $0x1, %cl
leaq 0x1fb9e(%rip), %r8      # 0x40a00
cmoveq %rax, %r8
movq (%r8), %r8
addq $0x8, %r8
cvttsd2si (%rsi), %r14d
cvttsd2si (%rdi), %esi
movq (%r8), %rdi
cmpb $0x1, 0x10(%rdi)
jne 0x20eb1
cmpb $0x1, %cl
leaq 0x1fb77(%rip), %rdx     # 0x40a00
movq %rdx, %rdi
cmoveq %rax, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
jne 0x20eae
cmpb $0x1, %cl
leaq 0x1fb5d(%rip), %rcx     # 0x40a00
cmoveq %rax, %rcx
movq (%rcx), %rdx
addq $0x8, %rdx
movq (%rdx), %rdx
movq (%rdx), %rax
cvttsd2si (%rax), %eax
addl %r14d, %esi
movl %esi, 0xf053b(%rip)     # 0x1113fc
movl %eax, 0xf0539(%rip)     # 0x111400
imull %eax, %esi
shll $0x2, %esi
movslq %esi, %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
cmpl 0xf050b(%rip), %r12d    # 0x111404
jle 0x20f22
movq 0xf0506(%rip), %rdi     # 0x111408
testq %rdi, %rdi
je 0x20f0c
callq 0x7040
movl %r12d, %edi
callq 0x7810
movq %rax, 0xf04ed(%rip)     # 0x111408
movl %r12d, 0xf04e2(%rip)    # 0x111404
movq 0xf04df(%rip), %rdi     # 0x111408
xorl %r12d, %r12d
xorl %esi, %esi
movq %r15, %rdx
callq 0x7130
decl %r14d
xorl %edi, %edi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x20ff2
movl $0x0, 0xf08a8(%rip)     # 0x1117f8
leaq 0x9f74(%rip), %rdi      # 0x2aecb
callq 0x14c8d
cmpl $0x0, 0xf0499(%rip)     # 0x1113fc
jle 0x20fac
movl 0xf0495(%rip), %eax     # 0x111400
testl %eax, %eax
jle 0x20f96
xorl %ebx, %ebx
movq 0xf0490(%rip), %rcx     # 0x111408
imull %r12d, %eax
cltq
addq %rbx, %rax
movl (%rcx,%rax,4), %edi
callq 0x216fe
movl 0xf0471(%rip), %eax     # 0x111400
incq %rbx
cmpl %eax, %ebx
jl 0x20f71
movl $0xa, %edi
callq 0x216fe
incl %r12d
cmpl 0xf0452(%rip), %r12d    # 0x1113fc
jl 0x20f65
movl $0xa, %edi
callq 0x216fe
movq 0xf040b(%rip), %rdi     # 0x1113c8
movq 0x1200c(%rip), %rax     # 0x32fd0
movq (%rax), %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7120