// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
movl %esi, %ebx
movl 0x18792(%rip), %ecx     # 0x382a8
movl %esi, %eax
imull %edi, %eax
movl %eax, -0x5c(%rbp)
subl %eax, %ecx
xorl %esi, %esi
testl %ebx, %ebx
movl $0x0, %r12d
cmovgl %ebx, %r12d
movslq %ebx, %rdx
movl %ecx, -0x34(%rbp)
movslq %ecx, %rcx
testl %edi, %edi
movl $0x0, %eax
movq %rdi, -0x58(%rbp)
cmovgl %edi, %eax
movq %rax, -0x48(%rbp)
leaq 0x21a60(%rip), %rax     # 0x415b0
movq %rcx, -0x40(%rbp)
leaq (%rax,%rcx,8), %r13
shlq $0x3, %rdx
movq %rdx, -0x50(%rbp)
leaq 0x1ee89(%rip), %r15     # 0x3e9f0
movq $0x0, -0x30(%rbp)
movq %rbx, -0x70(%rbp)
cmpq -0x48(%rbp), %rsi
je 0x1fbda
xorl %eax, %eax
xorl %r14d, %r14d
cmpq %rax, %r12
je 0x1fbb2
movq (%r13,%rax,8), %rcx
cmpb $0x1, 0x10(%rcx)
leaq 0x8(%rcx), %rcx
cmovneq %r15, %rcx
movq (%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
cmovneq %r15, %rcx
movq (%rcx), %rcx
cvttsd2si (%rcx), %ecx
cmpl %ecx, %r14d
cmovlel %ecx, %r14d
incq %rax
jmp 0x1fb7e
cvtsi2sd %r14d, %xmm0
movq %rsi, %rbx
callq 0xaf59
movq %rbx, %rsi
movq -0x70(%rbp), %rbx
movq -0x30(%rbp), %rax
addl %r14d, %eax
movq %rax, -0x30(%rbp)
incq %rsi
addq -0x50(%rbp), %r13
jmp 0x1fb73
movq -0x58(%rbp), %rdi
callq 0x85eb
callq 0x868d
movq %rax, -0x68(%rbp)
leaq 0x219bd(%rip), %rax     # 0x415b0
movq -0x40(%rbp), %rcx
leaq (%rax,%rcx,8), %r13
xorl %eax, %eax
cmpq -0x48(%rbp), %rax
je 0x1fcaf
movq %rax, -0x40(%rbp)
xorl %eax, %eax
movq 0x1eddc(%rip), %rcx     # 0x3e9f0
xorl %r14d, %r14d
cmpq %rax, %r12
je 0x1fc8a
movq (%r13,%rax,8), %rdx
leaq 0x8(%rdx), %rsi
cmpb $0x1, 0x10(%rdx)
cmovneq %r15, %rsi
movq (%rsi), %rdx
movb 0x10(%rdx), %sil
cmpb $0x1, %sil
jne 0x1fc4d
movq 0x8(%rdx), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r15, %r8
jne 0x1fc5c
leaq 0x8(%rdx), %rdi
jmp 0x1fc59
cmpb $0x1, 0x10(%rcx)
movq %r15, %rdi
movq %r15, %r8
jne 0x1fc5c
movq (%rdi), %r8
movq (%r8), %rdi
cvttsd2si (%rdi), %edi
cmpl %edi, %r14d
jg 0x1fc85
movq %rcx, %rdi
cmpb $0x1, %sil
jne 0x1fc75
movq 0x8(%rdx), %rdi
cmpb $0x1, 0x10(%rdi)
cmovneq %r15, %rdi
movq (%rdi), %rdx
cvttsd2si (%rdx), %r14d
incq %rax
jmp 0x1fc17
cvtsi2sd %r14d, %xmm0
callq 0xaf59
movq -0x30(%rbp), %rax
addl %r14d, %eax
movq %rax, -0x30(%rbp)
movq -0x40(%rbp), %rax
incq %rax
addq -0x50(%rbp), %r13
jmp 0x1fbfd
movq -0x58(%rbp), %rdi
callq 0x85eb
xorl %r14d, %r14d
callq 0x868d
movq %rax, -0x40(%rbp)
leaq 0x1ed25(%rip), %r13     # 0x3e9f0
xorl %eax, %eax
movl -0x34(%rbp), %edx
cmpl %r12d, %eax
je 0x1fe1f
movl %eax, -0x50(%rbp)
xorl %r15d, %r15d
movq 0x1ed0a(%rip), %rax     # 0x3e9f0
movq -0x48(%rbp), %rcx
movl %edx, -0x34(%rbp)
leaq 0x218bc(%rip), %r10     # 0x415b0
subq $0x1, %rcx
jb 0x1fe03
movslq %edx, %rsi
movq (%r10,%rsi,8), %rsi
leaq 0x8(%rsi), %rdi
cmpb $0x1, 0x10(%rsi)
cmovneq %r13, %rdi
movq (%rdi), %rsi
movb 0x10(%rsi), %dil
cmpb $0x1, %dil
jne 0x1fd2f
movq 0x8(%rsi), %r8
cmpb $0x1, 0x10(%r8)
jne 0x1fd60
leaq 0x8(%rsi), %r9
jmp 0x1fd3b
cmpb $0x1, 0x10(%rax)
movq %r13, %r9
movq %r13, %r8
jne 0x1fd85
movq (%r9), %r8
movq 0x8(%r8), %r8
cmpb $0x1, 0x10(%r8)
movq %r13, %r8
jne 0x1fd85
cmpb $0x1, %dil
je 0x1fd69
cmpb $0x1, 0x10(%rax)
movq %r13, %r9
movq %r13, %r8
je 0x1fd7b
jmp 0x1fd82
cmpb $0x1, 0x10(%rax)
movq %r13, %r8
jne 0x1fd85
movq 0x8(%rsi), %r8
cmpb $0x1, 0x10(%r8)
movq %r13, %r8
jne 0x1fd82
leaq 0x8(%rsi), %r9
movq (%r9), %r8
addq $0x8, %r8
movq (%r8), %r8
movq (%r8), %r8
cvttsd2si (%r8), %r8d
cmpl %r8d, %r15d
jg 0x1fdfc
cmpb $0x1, %dil
jne 0x1fdac
movq 0x8(%rsi), %rdi
cmpb $0x1, 0x10(%rdi)
jne 0x1fdd0
movq 0x8(%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
jmp 0x1fdd4
cmpb $0x1, 0x10(%rax)
movq %r13, %rdi
jne 0x1fdf4
movq 0x8(%rax), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r13, %rdi
jne 0x1fdf4
cmpb $0x1, 0x10(%rax)
movq %r13, %rsi
movq %r13, %rdi
je 0x1fdea
jmp 0x1fdf1
cmpb $0x1, 0x10(%rax)
movq %r13, %rdi
jne 0x1fdf4
movq 0x8(%rsi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x1fdf1
addq $0x8, %rsi
movq (%rsi), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
movq (%rdi), %rsi
cvttsd2si (%rsi), %r15d
addl %ebx, %edx
jmp 0x1fcf4
cvtsi2sd %r15d, %xmm0
callq 0xaf59
addl %r15d, %r14d
movl -0x50(%rbp), %eax
incl %eax
movl -0x34(%rbp), %edx
incl %edx
jmp 0x1fcd0
movl %ebx, %edi
callq 0x85eb
callq 0x868d
movq %rax, -0x48(%rbp)
movq -0x58(%rbp), %r13
movq -0x30(%rbp), %rax
leal (%rax,%r13), %r12d
incl %r12d
leal (%rbx,%rbx,2), %eax
leal 0x1(%r14,%rax), %eax
movl %eax, -0x30(%rbp)
pushq $0x2
popq %rcx
movl %r12d, %eax
cltd
idivl %ecx
movl %eax, %r14d
incl %r14d
subl %r14d, %r12d
movl -0x5c(%rbp), %edi
callq 0x85eb
callq 0x868d
movq %rax, %r15
movsd 0x3355(%rip), %xmm0     # 0x231c8
callq 0xaf59
cvtsi2sd %r14d, %xmm0
callq 0xaf59
cvtsi2sd %r12d, %xmm0
callq 0xaf59
cvtsi2sdl -0x30(%rbp), %xmm0
callq 0xaf59
cvtsi2sd %r13d, %xmm0
callq 0xaf59
cvtsi2sd %ebx, %xmm0
callq 0xaf59
movq %r15, %rdi
callq 0x861b
movq -0x68(%rbp), %rdi
callq 0x861b
movq -0x40(%rbp), %rdi
callq 0x861b
movq -0x48(%rbp), %rdi
callq 0x861b
pushq $0xa
popq %rdi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x85eb