// File: /workspace/github_c_makefile_star2_O1/georgeweigt[P]eigenmath/eigenmath.c
// Function: fmt_table
void
fmt_table(int x, int y, struct atom *p)
{
	int cx, dx, i, j, m, n;
	int column_width, elem_width, row_depth, row_height;
	struct atom *d, *h, *w, *table;

	n = VAL1(p);
	m = VAL2(p);

	p = cddr(p);

	table = car(p);
	h = cadr(p);
	d = caddr(p);

	for (i = 0; i < n; i++) { // for each row

		row_height = VAL1(h);
		row_depth = VAL1(d);

		y += row_height;

		dx = 0;

		w = cadddr(p);

		for (j = 0; j < m; j++) { // for each column
			column_width = VAL1(w);
			elem_width = WIDTH(car(table));
			cx = x + dx + (column_width - elem_width) / 2; // center horizontal
			fmt_draw(cx, y, car(table));
			dx += column_width + TABLE_HSPACE;
			table = cdr(table);
			w = cdr(w);
		}

		y += row_depth + TABLE_VSPACE;

		h = cdr(h);
		d = cdr(d);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
cmpb $0x1, 0x10(%rdx)
leaq 0x8(%rdx), %rcx
leaq 0x1cce2(%rip), %rax     # 0x40a00
cmovneq %rax, %rdx
movq (%rdx), %rdx
cvttsd2si (%rdx), %edx
movl %edx, -0x34(%rbp)
cmovneq %rax, %rcx
movq (%rcx), %rcx
leaq 0x8(%rcx), %rdx
cmpb $0x1, 0x10(%rcx)
cmovneq %rax, %rcx
cmovneq %rax, %rdx
movq (%rdx), %r8
leaq 0x8(%r8), %r9
cmpb $0x1, 0x10(%r8)
movq %rax, %rdx
movq %r8, -0x50(%rbp)
cmoveq %r8, %rdx
movq %rax, %r8
movq %r9, -0x48(%rbp)
cmoveq %r9, %r8
movq (%r8), %r8
movb 0x10(%r8), %r10b
leaq 0x8(%r8), %r9
cmpb $0x1, %r10b
cmovneq %rax, %r8
movq %rsi, -0x30(%rbp)
movq %rax, %rsi
cmoveq %r9, %rsi
movq %rdi, -0x70(%rbp)
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
jne 0x23da2
cmpb $0x1, %r10b
leaq 0x1cc65(%rip), %rax     # 0x40a00
cmoveq %r9, %rax
movq (%rax), %rax
cmpl $0x0, -0x34(%rbp)
jle 0x24037
movq (%rcx), %rcx
cvttsd2si (%rcx), %ebx
movq (%rdx), %r11
movq (%r8), %r10
xorl %r8d, %r8d
leaq 0x1cc3d(%rip), %r13     # 0x40a00
movl %ebx, -0x38(%rbp)
cmpb $0x1, 0x10(%r10)
movq %r13, %rcx
cmoveq %r10, %rcx
movq (%rax), %rdx
cmpb $0x1, 0x10(%rdx)
movq %r13, %rax
movq %rdx, -0x60(%rbp)
cmoveq %rdx, %rax
movq -0x50(%rbp), %rdx
cmpb $0x1, 0x10(%rdx)
movq %r13, %rdx
cmoveq -0x48(%rbp), %rdx
movq (%rdx), %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 0x23e28
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rdx, %rdi
movq (%rdi), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %r12
jne 0x23e5d
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rdx, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x23e5a
cmpb $0x1, %sil
cmovneq %r13, %rdx
movq (%rdx), %rdi
addq $0x8, %rdi
movq (%rdi), %r12
movq %r10, -0x68(%rbp)
movl %r8d, -0x3c(%rbp)
movq (%rcx), %rcx
cvttsd2si (%rcx), %ecx
movq -0x30(%rbp), %rdx
addl %ecx, %edx
movq %rdx, -0x30(%rbp)
movq (%rax), %rax
cvttsd2si (%rax), %eax
movq %rax, -0x58(%rbp)
testl %ebx, %ebx
jle 0x23ff0
xorl %r14d, %r14d
movq (%r12), %r12
cmpb $0x1, 0x10(%r12)
movq %r13, %rax
cmoveq %r12, %rax
cmpb $0x1, 0x10(%r11)
movq %r13, %rcx
cmoveq %r11, %rcx
movq (%rcx), %rdx
movb 0x10(%rdx), %sil
leaq 0x8(%rdx), %rcx
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rcx, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x23edd
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rcx, %rdi
movq (%rdi), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x23f19
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rcx, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x23f12
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rcx, %rdi
movq (%rdi), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
addq $0x8, %rdi
movq %r11, -0x78(%rbp)
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x23f8e
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rcx, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x23f52
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rcx, %rdi
movq (%rdi), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x23f8b
cmpb $0x1, %sil
movq %r13, %rdi
cmoveq %rcx, %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r13, %rdi
jne 0x23f84
cmpb $0x1, %sil
cmovneq %r13, %rcx
movq (%rcx), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
movq (%rax), %rax
cvttsd2si (%rax), %r15d
movq (%rdi), %rax
cvttsd2si (%rax), %eax
movq -0x70(%rbp), %rcx
addl %r14d, %ecx
movl %r15d, %esi
subl %eax, %esi
movl %esi, %edi
shrl $0x1f, %edi
addl %esi, %edi
sarl %edi
addl %ecx, %edi
movq -0x30(%rbp), %rsi
callq 0x20ff2
movq -0x78(%rbp), %rcx
leaq 0x8(%rcx), %rax
cmpb $0x1, 0x10(%rcx)
cmovneq %r13, %rax
cmpb $0x1, 0x10(%r12)
je 0x23fda
movq %r13, %r12
jmp 0x23fde
addq $0x8, %r12
addl %r15d, %r14d
addl $0x3, %r14d
movq (%rax), %r11
decl %ebx
jne 0x23e8c
movq -0x30(%rbp), %rax
movq -0x58(%rbp), %rcx
addl %ecx, %eax
incl %eax
movq %rax, -0x30(%rbp)
movq -0x68(%rbp), %rcx
leaq 0x8(%rcx), %rax
cmpb $0x1, 0x10(%rcx)
cmovneq %r13, %rax
movq (%rax), %r10
movq -0x60(%rbp), %rcx
leaq 0x8(%rcx), %rax
cmpb $0x1, 0x10(%rcx)
cmovneq %r13, %rax
movl -0x3c(%rbp), %r8d
incl %r8d
cmpl -0x34(%rbp), %r8d
movl -0x38(%rbp), %ebx
jne 0x23dc6
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq