// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/jpeg.c
// Function: handler_dqt
static void handler_dqt(deark *c, lctx *d,
	const struct marker_info *mi, i64 pos1, i64 data_size)
{
	i64 pos = pos1;
	u8 b;
	u8 precision_code;
	u8 table_id;
	i64 qsize;
	const char *s;

	while(1) {
		if(pos >= pos1+data_size) goto done;

		b = de_getbyte(pos);
		precision_code = b>>4;
		table_id = b&0x0f;
		if(precision_code==0) {
			s="8-bit";
			qsize = 64;
		}
		else if(precision_code==1) {
			s="16-bit";
			qsize = 128;
		}
		else {
			s="?";
			qsize = 0;
		}
		de_dbg(c, "table: Q%d, at %d", table_id, (int)pos);

		de_dbg_indent(c, 1);
		de_dbg(c, "precision: %d (%s)", (int)precision_code, s);
		dump_qtable_data(c, d, pos+1, precision_code);
		de_dbg_indent(c, -1);

		if(qsize==0) goto done;

		pos += 1 + qsize;
	}

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rcx, %rbp
movq %rdi, %r15
addq %rcx, %r8
movq %r8, 0x8(%rsp)
cmpq 0x8(%rsp), %rbp
jge 0x7ed89
movq 0x18(%r15), %rdi
movq %rbp, %rsi
callq 0xe3eb4
movl %eax, %ebx
movl %eax, %r14d
shrb $0x4, %r14b
andb $0xf, %al
movzbl %r14b, %ecx
movl %ecx, 0x4(%rsp)
xorl %r13d, %r13d
cmpb $0x1, %cl
setne 0x3(%rsp)
sete %r13b
movq %rbp, %r12
leaq 0xa3810(%rip), %rbp     # 0x122429
leaq 0xa02c1(%rip), %rcx     # 0x11eee1
cmovneq %rcx, %rbp
shll $0x7, %r13d
incq %r13
cmpb $0x10, %bl
pushq $0x41
popq %rcx
cmovbq %rcx, %r13
setae 0x2(%rsp)
leaq 0x8804c(%rip), %rcx     # 0x106c8d
cmovbq %rcx, %rbp
movzbl %al, %edx
movq %r15, %rdi
leaq 0x9ef0d(%rip), %rsi     # 0x11db5f
movl %r12d, %ecx
xorl %eax, %eax
callq 0xde896
movq %r15, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %r15, %rdi
leaq 0x9ef00(%rip), %rsi     # 0x11db71
movl 0x4(%rsp), %edx
movq %rbp, %rcx
movq %r12, %rbp
xorl %eax, %eax
callq 0xde896
cmpb $0x1f, %bl
ja 0x7ed6b
cmpl $0x2, (%r15)
jl 0x7ed6b
leaq 0x1(%rbp), %rdx
cmpb $0x1, %r14b
jne 0x7ecc6
movq %rdx, 0x10(%rsp)
xorl %ebx, %ebx
leaq 0x10(%rsp), %r14
cmpq $0x40, %rbx
je 0x7eced
movq 0x18(%r15), %rdi
movq %r14, %rsi
callq 0xe3f6e
movl %eax, 0x50(%rsp,%rbx,4)
incq %rbx
jmp 0x7ecab
movq 0x18(%r15), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x40
popq %rcx
callq 0xe3cb7
xorl %eax, %eax
cmpq $0x40, %rax
je 0x7ecf6
movzbl 0x10(%rsp,%rax), %ecx
movl %ecx, 0x50(%rsp,%rax,4)
incq %rax
jmp 0x7ecd9
leaq 0x9ee90(%rip), %rbx     # 0x11db84
jmp 0x7ecfd
leaq 0x9ed77(%rip), %rbx     # 0x11da74
movq %r15, %rdi
callq 0xeac74
movq %rax, %r12
xorl %r14d, %r14d
cmpq $0x40, %r14
je 0x7ed63
leaq 0x9ea28(%rip), %rax     # 0x11d740
movzbl (%r14,%rax), %eax
movl 0x50(%rsp,%rax,4), %ecx
movq %r12, %rdi
pushq $0x5
popq %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xeae8b
movl %r14d, %eax
notl %eax
testb $0x7, %al
jne 0x7ed5e
movq %r12, %rdi
callq 0xeb7e4
movq %r15, %rdi
leaq 0x9ee3d(%rip), %rsi     # 0x11db89
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq %r12, %rdi
callq 0xeac85
incq %r14
jmp 0x7ed0b
movq %r12, %rdi
callq 0xeaf3c
movb 0x2(%rsp), %bl
andb 0x3(%rsp), %bl
movq %r15, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
addq %r13, %rbp
testb %bl, %bl
je 0x7ebd6
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq