// File: /workspace/github_c_makefile_star2_O3/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 $0x48, %rsp
cmpb $0x1, 0x10(%rdx)
leaq 0x8(%rdx), %rax
leaq 0x1e831(%rip), %r9      # 0x45a00
cmovneq %r9, %rdx
movq (%rdx), %rcx
cvttsd2si (%rcx), %ecx
movl %ecx, -0x34(%rbp)
cmovneq %r9, %rax
movq (%rax), %rax
leaq 0x8(%rax), %rcx
cmpb $0x1, 0x10(%rax)
cmovneq %r9, %rax
cmovneq %r9, %rcx
movq (%rcx), %rdx
cmpb $0x1, 0x10(%rdx)
movq %rsi, -0x30(%rbp)
movq %r9, %rcx
cmoveq %rdx, %rcx
movq %rdx, -0x50(%rbp)
leaq 0x8(%rdx), %rsi
movq %r9, %rdx
movq %rsi, -0x48(%rbp)
cmoveq %rsi, %rdx
movq %rdi, -0x70(%rbp)
movq (%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x27235
movq (%rdx), %r10
movq 0x8(%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
je 0x27245
jmp 0x27248
movq 0x1e7c4(%rip), %rdx     # 0x45a00
cmpb $0x1, 0x10(%rdx)
movq %rdx, %r10
jne 0x27248
movq %rdx, %r9
cmpl $0x0, -0x34(%rbp)
jle 0x27549
movq (%rax), %rax
cvttsd2si (%rax), %ebx
movq (%rcx), %r12
xorl %r11d, %r11d
leaq 0x1e79a(%rip), %r8      # 0x45a00
movl %ebx, -0x38(%rbp)
movb 0x10(%r10), %cl
cmpb $0x1, %cl
movq %r8, %rdx
cmoveq %r10, %rdx
movq (%r9), %r9
movb 0x10(%r9), %al
cmpb $0x1, %al
movq %r8, %rsi
cmoveq %r9, %rsi
movq -0x50(%rbp), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r8, %rdi
cmoveq -0x48(%rbp), %rdi
movq (%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
jne 0x272b1
movq 0x8(%rdi), %r8
cmpb $0x1, 0x10(%r8)
jne 0x272d7
movq 0x8(%r8), %r8
jmp 0x272de
movq 0x1e748(%rip), %rdi     # 0x45a00
cmpb $0x1, 0x10(%rdi)
movq %r8, %r13
jne 0x2730a
movq 0x8(%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
movq %r8, %r13
jne 0x2730a
movq 0x1e72b(%rip), %rdi     # 0x45a00
jmp 0x272f3
movq 0x1e722(%rip), %r8      # 0x45a00
cmpb $0x1, 0x10(%r8)
leaq 0x1e716(%rip), %r8      # 0x45a00
movq %r8, %r13
jne 0x2730a
movq 0x8(%rdi), %rdi
cmpb $0x1, 0x10(%rdi)
jne 0x27300
addq $0x8, %rdi
movq %rdi, %r8
movq (%r8), %r13
leaq 0x1e6f6(%rip), %r8      # 0x45a00
movq (%rdx), %rdx
cvttsd2si (%rdx), %edx
movq -0x30(%rbp), %rdi
addl %edx, %edi
movq %rdi, -0x30(%rbp)
movq (%rsi), %rdx
cvttsd2si (%rdx), %edx
testl %ebx, %ebx
jle 0x27518
movq %rdx, -0x58(%rbp)
movl %r11d, -0x3c(%rbp)
movq %r10, -0x60(%rbp)
movq %r9, -0x68(%rbp)
xorl %r15d, %r15d
movq (%r13), %r13
cmpb $0x1, 0x10(%r13)
movq %r8, %rax
cmoveq %r13, %rax
movq (%rax), %rax
cvttsd2si (%rax), %r14d
cmpb $0x1, 0x10(%r12)
movq %r8, %rax
cmoveq %r12, %rax
movq (%rax), %rdx
movb 0x10(%rdx), %al
cmpb $0x1, %al
jne 0x27385
movq 0x8(%rdx), %rcx
cmpb $0x1, 0x10(%rcx)
jne 0x273b9
movq 0x8(%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
movq %r8, %rcx
je 0x273c6
jmp 0x273e1
movq 0x1e674(%rip), %rsi     # 0x45a00
cmpb $0x1, 0x10(%rsi)
movq %r8, %rcx
jne 0x2749e
movq 0x8(%rsi), %rcx
cmpb $0x1, 0x10(%rcx)
movq 0x1e658(%rip), %rcx     # 0x45a00
movb 0x10(%rcx), %sil
jne 0x273f7
movq %r8, %rdi
cmpb $0x1, %sil
je 0x273d3
jmp 0x273da
movq 0x1e640(%rip), %rcx     # 0x45a00
cmpb $0x1, 0x10(%rcx)
jne 0x27427
movq 0x8(%rdx), %rcx
cmpb $0x1, 0x10(%rcx)
movq %r8, %rdi
jne 0x273da
addq $0x8, %rcx
movq %rcx, %rdi
movq (%rdi), %rcx
addq $0x8, %rcx
movq (%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
movq %r8, %rcx
jne 0x2749e
cmpb $0x1, %al
jne 0x27404
jmp 0x27437
movq %r8, %rcx
cmpb $0x1, %sil
jne 0x2749e
movq 0x1e5f5(%rip), %rax     # 0x45a00
cmpb $0x1, 0x10(%rax)
movq %r8, %rcx
jne 0x2749b
movq 0x8(%rax), %rax
cmpb $0x1, 0x10(%rax)
movq %r8, %rcx
je 0x2747a
jmp 0x2749b
movq 0x1e5d2(%rip), %rcx     # 0x45a00
cmpb $0x1, 0x10(%rcx)
movq %r8, %rcx
jne 0x2749e
movq 0x8(%rdx), %rcx
cmpb $0x1, 0x10(%rcx)
jne 0x27465
movq 0x8(%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
movq %r8, %rcx
jne 0x2749b
cmpb $0x1, %al
jne 0x2747a
movq 0x8(%rdx), %rax
cmpb $0x1, 0x10(%rax)
movq %r8, %rax
jne 0x27494
leaq 0x8(%rdx), %rcx
jmp 0x2748d
movq 0x1e594(%rip), %rax     # 0x45a00
cmpb $0x1, 0x10(%rax)
movq %r8, %rax
movq %r8, %rcx
je 0x27494
jmp 0x2749b
movq 0x1e57f(%rip), %rax     # 0x45a00
cmpb $0x1, 0x10(%rax)
movq %r8, %rcx
movq %r8, %rax
jne 0x27494
movq (%rcx), %rax
addq $0x8, %rax
movq (%rax), %rcx
addq $0x8, %rcx
movq (%rcx), %rcx
movq (%rcx), %rax
cvttsd2si (%rax), %eax
movq -0x70(%rbp), %rcx
addl %r15d, %ecx
movl %r14d, %esi
subl %eax, %esi
movl %esi, %edi
shrl $0x1f, %edi
addl %esi, %edi
sarl %edi
addl %ecx, %edi
movq -0x30(%rbp), %rsi
callq 0x23ff7
leaq 0x1e534(%rip), %r8      # 0x45a00
leaq 0x8(%r12), %rax
cmpb $0x1, 0x10(%r12)
cmovneq %r8, %rax
movq (%rax), %r12
cmpb $0x1, 0x10(%r13)
je 0x274ea
movq %r8, %r13
jmp 0x274ee
addq $0x8, %r13
addl %r14d, %r15d
addl $0x3, %r15d
decl %ebx
jne 0x2733d
movq -0x60(%rbp), %r10
movb 0x10(%r10), %cl
movq -0x68(%rbp), %r9
movb 0x10(%r9), %al
movl -0x38(%rbp), %ebx
movl -0x3c(%rbp), %r11d
movq -0x58(%rbp), %rdx
addq $0x8, %r10
cmpb $0x1, %cl
cmovneq %r8, %r10
movq -0x30(%rbp), %rcx
addl %edx, %ecx
incl %ecx
movq %rcx, -0x30(%rbp)
movq (%r10), %r10
addq $0x8, %r9
cmpb $0x1, %al
cmovneq %r8, %r9
incl %r11d
cmpl -0x34(%rbp), %r11d
jne 0x27269
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq