// File: /workspace/github_c_makefile_star2_O1/georgeweigt[P]eigenmath/eigenmath.c
// Function: fmt_update_table
void
fmt_update_table(int n, int m)
{
	int i, j, t;
	int d, h, w;
	int total_height, total_width;
	struct atom *p1, *p2, *p3, *p4;

	total_height = 0;
	total_width = 0;

	t = tos - n * m;

	// height of each row

	for (i = 0; i < n; i++) { // for each row
		h = 0;
		for (j = 0; j < m; j++) { // for each column
			p1 = stack[t + i * m + j];
			h = MAX(h, HEIGHT(p1));
		}
		push_double(h);
		total_height += h;
	}

	list(n);
	p2 = pop();

	// depth of each row

	for (i = 0; i < n; i++) { // for each row
		d = 0;
		for (j = 0; j < m; j++) { // for each column
			p1 = stack[t + i * m + j];
			d = MAX(d, DEPTH(p1));
		}
		push_double(d);
		total_height += d;
	}

	list(n);
	p3 = pop();

	// width of each column

	for (j = 0; j < m; j++) { // for each column
		w = 0;
		for (i = 0; i < n; i++) { // for each row
			p1 = stack[t + i * m + j];
			w = MAX(w, WIDTH(p1));
		}
		push_double(w);
		total_width += w;
	}

	list(m);
	p4 = pop();

	// h, d, w for entire table centered vertical

	total_height += (n - 1) * TABLE_VSPACE + 2; // +2 for delimiters
	total_width += (m - 1) * TABLE_HSPACE + 4; // +4 for delimiters

	h = total_height / 2 + 1;
	d = total_height - h;
	w = total_width;

	list(n * m);
	p1 = pop();

	push_double(EMIT_TABLE);
	push_double(h);
	push_double(d);
	push_double(w);
	push_double(n);
	push_double(m);
	push(p1);
	push(p2);
	push(p3);
	push(p4);

	list(10);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl 0x16e34(%rip), %ecx     # 0x3a2b8
movl %esi, %eax
imull %edi, %eax
movl %eax, -0x70(%rbp)
subl %eax, %ecx
movslq %esi, %rdx
movl %ecx, -0x6c(%rbp)
movslq %ecx, %rcx
movl %edi, %eax
movq %rax, -0x50(%rbp)
movq %rsi, -0x48(%rbp)
movl %esi, %r14d
movq %rdi, -0x58(%rbp)
testl %edi, %edi
movq %rdx, -0x38(%rbp)
movq %rcx, -0x60(%rbp)
jle 0x23574
leaq 0x20101(%rip), %rax     # 0x435c0
leaq (%rax,%rcx,8), %r12
leaq (,%rdx,8), %rax
movq %rax, -0x68(%rbp)
xorl %r15d, %r15d
leaq 0x1d527(%rip), %r13     # 0x40a00
movq $0x0, -0x40(%rbp)
movl $0x0, %ebx
cmpl $0x0, -0x48(%rbp)
jle 0x23531
xorl %eax, %eax
xorl %ebx, %ebx
movq (%r12,%rax,8), %rcx
leaq 0x8(%rcx), %rdx
cmpb $0x1, 0x10(%rcx)
cmovneq %r13, %rdx
movq (%rdx), %rcx
movb 0x10(%rcx), %dl
cmpb $0x1, %dl
movq %r13, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cvttsd2si (%rsi), %esi
cmpl %esi, %ebx
jg 0x23529
cmpb $0x1, %dl
cmovneq %r13, %rcx
movq (%rcx), %rcx
cvttsd2si (%rcx), %ebx
incq %rax
cmpq %rax, %r14
jne 0x234f0
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x74ec
movb $0x5, 0x10(%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %rax, %rdi
callq 0x8b01
movq -0x40(%rbp), %rax
addl %ebx, %eax
movq %rax, -0x40(%rbp)
incq %r15
addq -0x68(%rbp), %r12
cmpq -0x50(%rbp), %r15
jne 0x234e1
jmp 0x2357c
movq $0x0, -0x40(%rbp)
movq -0x58(%rbp), %rbx
movl %ebx, %edi
callq 0x8ad9
callq 0x8b78
movq %rax, -0x78(%rbp)
testl %ebx, %ebx
jle 0x23687
leaq 0x20021(%rip), %rax     # 0x435c0
movq -0x60(%rbp), %rcx
leaq (%rax,%rcx,8), %r15
movq -0x38(%rbp), %rax
shlq $0x3, %rax
xorl %r12d, %r12d
leaq 0x1d447(%rip), %r13     # 0x40a00
movq %rax, -0x38(%rbp)
movl $0x0, %ebx
cmpl $0x0, -0x48(%rbp)
jle 0x23643
xorl %eax, %eax
xorl %ebx, %ebx
movq (%r15,%rax,8), %rcx
leaq 0x8(%rcx), %rdx
cmpb $0x1, 0x10(%rcx)
cmovneq %r13, %rdx
movq (%rdx), %rcx
movb 0x10(%rcx), %dl
addq $0x8, %rcx
cmpb $0x1, %dl
movq %r13, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r13, %rsi
jne 0x23609
cmpb $0x1, %dl
movq %r13, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
movq (%rsi), %rsi
cvttsd2si (%rsi), %esi
cmpl %esi, %ebx
jg 0x2363b
cmpb $0x1, %dl
movq %r13, %rsi
cmoveq %rcx, %rsi
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r13, %rsi
jne 0x23634
cmpb $0x1, %dl
cmovneq %r13, %rcx
movq (%rcx), %rsi
movq (%rsi), %rcx
cvttsd2si (%rcx), %ebx
incq %rax
cmpq %rax, %r14
jne 0x235cc
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x74ec
movb $0x5, 0x10(%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %rax, %rdi
callq 0x8b01
movq -0x40(%rbp), %rax
addl %ebx, %eax
movq %rax, -0x40(%rbp)
incq %r12
movq -0x38(%rbp), %rax
addq %rax, %r15
cmpq -0x50(%rbp), %r12
jne 0x235bd
movq -0x58(%rbp), %rdi
callq 0x8ad9
callq 0x8b78
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rbx
testl %ebx, %ebx
jle 0x2381f
xorl %eax, %eax
leaq 0x1ff12(%rip), %r12     # 0x435c0
leaq 0x1d34b(%rip), %r13     # 0x40a00
xorl %r15d, %r15d
movl -0x6c(%rbp), %r8d
movl %eax, -0x38(%rbp)
movq %r15, -0x30(%rbp)
movl $0x0, %r14d
cmpl $0x0, -0x58(%rbp)
jle 0x237d9
xorl %r14d, %r14d
movq -0x50(%rbp), %rax
movl %r8d, %ecx
movslq %ecx, %rdx
movq (%r12,%rdx,8), %rdx
leaq 0x8(%rdx), %rsi
cmpb $0x1, 0x10(%rdx)
cmovneq %r13, %rsi
movq (%rsi), %rdx
movb 0x10(%rdx), %sil
addq $0x8, %rdx
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rdx, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x23724
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rdx, %rdi
movq (%rdi), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x2375c
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rdx, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x23759
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rdx, %rdi
movq (%rdi), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
movq (%rdi), %rdi
cvttsd2si (%rdi), %edi
cmpl %edi, %r14d
jg 0x237ce
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rdx, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x23791
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rdx, %rdi
movq (%rdi), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x237c6
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rdx, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x237c3
cmpb $0x1, %sil
cmovneq %r13, %rdx
movq (%rdx), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
movq (%rdi), %rdx
cvttsd2si (%rdx), %r14d
addl %ebx, %ecx
decq %rax
jne 0x236dd
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd %xmm0, -0x68(%rbp)
movl %r8d, %r15d
callq 0x74ec
movb $0x5, 0x10(%rax)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %rax, %rdi
callq 0x8b01
movl %r15d, %r8d
movq -0x30(%rbp), %r15
addl %r14d, %r15d
movl -0x38(%rbp), %eax
incl %eax
incl %r8d
cmpl %ebx, %eax
jne 0x236bc
jmp 0x23822
xorl %r15d, %r15d
movl %ebx, %edi
callq 0x8ad9
callq 0x8b78
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %r14
movq -0x40(%rbp), %rcx
leal (%r14,%rcx), %eax
leal 0x1(%r14,%rcx), %r13d
leal (%rbx,%rbx,2), %ecx
addl %r15d, %ecx
incl %ecx
movl %ecx, -0x30(%rbp)
movl %r13d, %ecx
shrl $0x1f, %ecx
leal (%rcx,%rax), %r12d
incl %r12d
sarl %r12d
incl %r12d
subl %r12d, %r13d
movl -0x70(%rbp), %edi
callq 0x8ad9
callq 0x8b78
movq %rax, -0x40(%rbp)
callq 0x74ec
movq %rbx, %r15
movb $0x5, %bl
movb %bl, 0x10(%rax)
movabsq $0x4020000000000000, %rcx # imm = 0x4020000000000000
movq %rcx, (%rax)
movq %rax, %rdi
callq 0x8b01
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x74ec
movb %bl, 0x10(%rax)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %rax, %rdi
callq 0x8b01
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x74ec
movb %bl, 0x10(%rax)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %rax, %rdi
callq 0x8b01
xorps %xmm0, %xmm0
cvtsi2sdl -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x74ec
movb %bl, 0x10(%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %rax, %rdi
callq 0x8b01
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x74ec
movb %bl, 0x10(%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %rax, %rdi
callq 0x8b01
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x74ec
movb %bl, 0x10(%rax)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %rax, %rdi
callq 0x8b01
movq -0x40(%rbp), %rdi
callq 0x8b01
movq -0x78(%rbp), %rdi
callq 0x8b01
movq -0x60(%rbp), %rdi
callq 0x8b01
movq -0x50(%rbp), %rdi
callq 0x8b01
movl $0xa, %edi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8ad9