// File: /workspace/github_c_makefile_star2_O2/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), %rax
leaq 0x1e83f(%rip), %r14     # 0x3e9f0
cmovneq %r14, %rdx
movq (%rdx), %rcx
cvttsd2si (%rcx), %r9d
cmovneq %r14, %rax
movq (%rax), %rax
leaq 0x8(%rax), %rcx
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
cmovneq %r14, %rcx
movq (%rax), %rax
cvttsd2si (%rax), %r10d
movq (%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
movq %rsi, -0x30(%rbp)
movq %r14, %rax
cmoveq %rcx, %rax
movq %rcx, -0x50(%rbp)
leaq 0x8(%rcx), %rdx
movq %r14, %rcx
movq %rdx, -0x48(%rbp)
cmoveq %rdx, %rcx
movq %rdi, -0x70(%rbp)
movq (%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
jne 0x2021b
movq (%rcx), %rdi
movq 0x8(%rcx), %rdx
cmpb $0x1, 0x10(%rdx)
jmp 0x20229
movq 0x1e7ce(%rip), %rdx     # 0x3e9f0
cmpb $0x1, 0x10(%rdx)
movq %rdx, %rdi
movq %r14, %rcx
jne 0x20231
movq %rdx, %rcx
movq (%rax), %r12
xorl %eax, %eax
testl %r10d, %r10d
cmovlel %eax, %r10d
movl %r10d, -0x34(%rbp)
testl %r9d, %r9d
cmovlel %eax, %r9d
movl %r9d, -0x38(%rbp)
cmpl -0x38(%rbp), %eax
je 0x2051a
movl %eax, -0x3c(%rbp)
cmpb $0x1, 0x10(%rdi)
movq %r14, %rax
cmoveq %rdi, %rax
movq (%rcx), %rdx
cmpb $0x1, 0x10(%rdx)
movq %r14, %rcx
movq %rdx, -0x60(%rbp)
cmoveq %rdx, %rcx
movq -0x50(%rbp), %rdx
cmpb $0x1, 0x10(%rdx)
movq %r14, %rdx
cmoveq -0x48(%rbp), %rdx
movq (%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x2029e
movq 0x8(%rdx), %rsi
cmpb $0x1, 0x10(%rsi)
jne 0x202c4
movq 0x8(%rsi), %rsi
jmp 0x202cb
movq 0x1e74b(%rip), %rdx     # 0x3e9f0
cmpb $0x1, 0x10(%rdx)
movq %r14, %rsi
jne 0x202eb
movq 0x8(%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
movq %r14, %rsi
jne 0x202eb
movq 0x1e72e(%rip), %rdx     # 0x3e9f0
jmp 0x202d8
movq 0x1e725(%rip), %rsi     # 0x3e9f0
cmpb $0x1, 0x10(%rsi)
movq %r14, %rsi
jne 0x202eb
movq 0x8(%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
movq %r14, %rsi
jne 0x202e8
addq $0x8, %rdx
movq %rdx, %rsi
movq (%rsi), %rsi
movq %rdi, -0x68(%rbp)
movq (%rax), %rax
cvttsd2si (%rax), %eax
movq (%rcx), %rcx
cvttsd2si (%rcx), %ecx
movq %rcx, -0x58(%rbp)
movq -0x30(%rbp), %rcx
addl %eax, %ecx
movq %rcx, -0x30(%rbp)
xorl %r9d, %r9d
movl -0x34(%rbp), %ebx
subl $0x1, %ebx
jb 0x204dd
movq (%rsi), %rsi
cmpb $0x1, 0x10(%rsi)
movq %r14, %rax
movq %rsi, -0x78(%rbp)
cmoveq %rsi, %rax
movq (%rax), %rax
cvttsd2si (%rax), %r10d
cmpb $0x1, 0x10(%r12)
movq %r14, %rax
cmoveq %r12, %rax
movq (%rax), %rcx
movb 0x10(%rcx), %al
cmpb $0x1, %al
jne 0x20364
movq 0x8(%rcx), %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x20398
movq 0x8(%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
movq %r14, %rdx
je 0x203a5
jmp 0x203c0
movq 0x1e685(%rip), %rsi     # 0x3e9f0
cmpb $0x1, 0x10(%rsi)
movq %r14, %rdx
jne 0x2047d
movq 0x8(%rsi), %rdx
cmpb $0x1, 0x10(%rdx)
movq 0x1e669(%rip), %rdx     # 0x3e9f0
movb 0x10(%rdx), %sil
jne 0x203d6
movq %r14, %rdi
cmpb $0x1, %sil
je 0x203b2
jmp 0x203b9
movq 0x1e651(%rip), %rdx     # 0x3e9f0
cmpb $0x1, 0x10(%rdx)
jne 0x20406
movq 0x8(%rcx), %rdx
cmpb $0x1, 0x10(%rdx)
movq %r14, %rdi
jne 0x203b9
addq $0x8, %rdx
movq %rdx, %rdi
movq (%rdi), %rdx
addq $0x8, %rdx
movq (%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
movq %r14, %rdx
jne 0x2047d
cmpb $0x1, %al
jne 0x203e3
jmp 0x20416
movq %r14, %rdx
cmpb $0x1, %sil
jne 0x2047d
movq 0x1e606(%rip), %rax     # 0x3e9f0
cmpb $0x1, 0x10(%rax)
movq %r14, %rdx
jne 0x2047a
movq 0x8(%rax), %rax
cmpb $0x1, 0x10(%rax)
movq %r14, %rdx
je 0x20459
jmp 0x2047a
movq 0x1e5e3(%rip), %rdx     # 0x3e9f0
cmpb $0x1, 0x10(%rdx)
movq %r14, %rdx
jne 0x2047d
movq 0x8(%rcx), %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x20444
movq 0x8(%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
movq %r14, %rdx
jne 0x2047a
cmpb $0x1, %al
jne 0x20459
movq 0x8(%rcx), %rax
cmpb $0x1, 0x10(%rax)
movq %r14, %rax
jne 0x20473
leaq 0x8(%rcx), %rdx
jmp 0x2046c
movq 0x1e5a5(%rip), %rax     # 0x3e9f0
cmpb $0x1, 0x10(%rax)
movq %r14, %rax
movq %r14, %rdx
je 0x20473
jmp 0x2047a
movq 0x1e590(%rip), %rax     # 0x3e9f0
cmpb $0x1, 0x10(%rax)
movq %r14, %rdx
movq %r14, %rax
jne 0x20473
movq (%rdx), %rax
addq $0x8, %rax
movq (%rax), %rdx
addq $0x8, %rdx
movq (%rdx), %rdx
movq (%rdx), %rax
cvttsd2si (%rax), %edx
movq -0x70(%rbp), %rax
movq %r9, %r13
leal (%r9,%rax), %edi
movq %r10, %r15
movl %r10d, %eax
subl %edx, %eax
cltd
pushq $0x2
popq %rsi
idivl %esi
addl %eax, %edi
movq -0x30(%rbp), %rsi
movq %rcx, %rdx
callq 0x1db4e
leaq 0x8(%r12), %rax
cmpb $0x1, 0x10(%r12)
cmovneq %r14, %rax
movq (%rax), %r12
movq -0x78(%rbp), %rsi
cmpb $0x1, 0x10(%rsi)
je 0x204cc
movq %r14, %rsi
jmp 0x204d0
addq $0x8, %rsi
leal (%r15,%r13), %r9d
addl $0x3, %r9d
jmp 0x20311
movq -0x68(%rbp), %rax
cmpb $0x1, 0x10(%rax)
leaq 0x8(%rax), %rax
cmovneq %r14, %rax
movq -0x30(%rbp), %rcx
movq -0x58(%rbp), %rdx
leal 0x1(%rcx,%rdx), %ecx
movq %rcx, -0x30(%rbp)
movq (%rax), %rdi
movq -0x60(%rbp), %rax
cmpb $0x1, 0x10(%rax)
leaq 0x8(%rax), %rcx
cmovneq %r14, %rcx
movl -0x3c(%rbp), %eax
incl %eax
jmp 0x2024c
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq