// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: dump_qtable_data
static void dump_qtable_data(deark *c, lctx *d, i64 pos1, u8 precision_code)
{
	UI qbuf[64];
	i64 k;
	de_ucstring *s = NULL;
	const char *cfmt;
	static const u8 zigzag[64] = {
		 0, 1, 5, 6,14,15,27,28,
		 2, 4, 7,13,16,26,29,42,
		 3, 8,12,17,25,30,41,43,
		 9,11,18,24,31,40,44,53,
		10,19,23,32,39,45,52,54,
		20,22,33,38,46,51,55,60,
		21,34,37,47,50,56,59,61,
		35,36,48,49,57,58,62,63
	};

	if(c->debug_level<2) return;
	if(precision_code>1) return;

	if(precision_code==1) {
		i64 pos = pos1;

		cfmt = " %5u";
		for(k=0; k<64; k++) {
			qbuf[k] = (UI)de_getu16be_p(&pos);
		}
	}
	else {
		u8 qbuf8[64];

		cfmt = " %3u";
		de_read(qbuf8, pos1, 64);
		for(k=0; k<64; k++) {
			qbuf[k] = (UI)qbuf8[k];
		}
	}

	s = ucstring_create(c);
	for(k=0; k<64; k++) {
		ucstring_printf(s, DE_ENCODING_LATIN1, cfmt, qbuf[(UI)zigzag[k]]);
		if(k%8==7) { // end of a debug line
			de_dbg(c, "data:%s", ucstring_getpsz(s));
			ucstring_empty(s);
		}
	}
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq $0x0, -0x130(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jge 0xbdd45
jmp 0xbdf0c
movzbl -0x19(%rbp), %eax
cmpl $0x1, %eax
jle 0xbdd53
jmp 0xbdf0c
movzbl -0x19(%rbp), %eax
cmpl $0x1, %eax
jne 0xbddc4
movq -0x18(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq 0xf8a96(%rip), %rax     # 0x1b6804
movq %rax, -0x138(%rbp)
movq $0x0, -0x128(%rbp)
cmpq $0x40, -0x128(%rbp)
jge 0xbddc2
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x140(%rbp), %rsi
callq 0x165210
movl %eax, %ecx
movq -0x128(%rbp), %rax
movl %ecx, -0x120(%rbp,%rax,4)
movq -0x128(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x128(%rbp)
jmp 0xbdd80
jmp 0xbde37
leaq 0xf8929(%rip), %rax     # 0x1b66f4
movq %rax, -0x138(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x180(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x40, %ecx
callq 0x164d10
movq $0x0, -0x128(%rbp)
cmpq $0x40, -0x128(%rbp)
jge 0xbde35
movq -0x128(%rbp), %rax
movzbl -0x180(%rbp,%rax), %ecx
movq -0x128(%rbp), %rax
movl %ecx, -0x120(%rbp,%rax,4)
movq -0x128(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x128(%rbp)
jmp 0xbddfa
jmp 0xbde37
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x130(%rbp)
movq $0x0, -0x128(%rbp)
cmpq $0x40, -0x128(%rbp)
jge 0xbdf00
movq -0x130(%rbp), %rdi
movq -0x138(%rbp), %rdx
movq -0x128(%rbp), %rcx
leaq 0xf8534(%rip), %rax     # 0x1b63b0
movzbl (%rax,%rcx), %eax
movl %eax, %eax
movl -0x120(%rbp,%rax,4), %ecx
movl $0x5, %esi
movb $0x0, %al
callq 0x171660
movq -0x128(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
cmpq $0x7, %rdx
jne 0xbdee7
movq -0x8(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x130(%rbp), %rdi
callq 0x172500
movq -0x188(%rbp), %rdi
movq %rax, %rdx
leaq 0xf8935(%rip), %rsi     # 0x1b6809
movb $0x0, %al
callq 0x15b0d0
movq -0x130(%rbp), %rdi
callq 0x171210
jmp 0xbdee9
movq -0x128(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x128(%rbp)
jmp 0xbde52
movq -0x130(%rbp), %rdi
callq 0x171750
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nopw %cs:(%rax,%rax)