LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: handler_dac
static void handler_dac(deark *c, lctx *d,
	const struct marker_info *mi, i64 pos1, i64 data_size)
{
	i64 ntables;
	i64 i;
	u8 b;
	u8 cs;
	u8 table_class;
	u8 table_id;

	ntables = data_size/2;
	for(i=0; i<ntables; i++) {
		b = de_getbyte(pos1+i*2);
		table_class = b>>4;
		table_id = b&0x0f;
		de_dbg(c, "table: %s%u", table_class==0?"DC":"AC",
			(unsigned int)table_id);
		cs = de_getbyte(pos1+i*2+1);
		de_dbg_indent(c, 1);
		de_dbg(c, "conditioning value: %d", (int)cs);
		de_dbg_indent(c, -1);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0xbd65a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rax
shlq %rax
addq %rax, %rsi
callq 0x165060
movb %al, -0x39(%rbp)
movzbl -0x39(%rbp), %eax
sarl $0x4, %eax
movb %al, -0x3b(%rbp)
movzbl -0x39(%rbp), %eax
andl $0xf, %eax
movb %al, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x3b(%rbp), %ecx
leaq 0xf8fc5(%rip), %rdx     # 0x1b659a
leaq 0xe9a53(%rip), %rax     # 0x1a702f
cmpl $0x0, %ecx
cmoveq %rax, %rdx
movzbl -0x3c(%rbp), %ecx
leaq 0xf912d(%rip), %rsi     # 0x1b671b
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rax
shlq %rax
addq %rax, %rsi
addq $0x1, %rsi
callq 0x165060
movb %al, -0x3a(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movzbl -0x3a(%rbp), %edx
leaq 0xf90f3(%rip), %rsi     # 0x1b6727
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xbd586
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
addq -0x28(%rbp), %rcx
cmpq %rcx, %rax
jl 0xbd8aa
jmp 0xbd9ac
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x165060
movb %al, -0x31(%rbp)
movzbl -0x31(%rbp), %eax
sarl $0x4, %eax
movb %al, -0x32(%rbp)
movzbl -0x31(%rbp), %eax
andl $0xf, %eax
movb %al, -0x33(%rbp)
movzbl -0x32(%rbp), %eax
cmpl $0x0, %eax
jne 0xbd8f0
leaq 0xe2340(%rip), %rax     # 0x19fc22
movq %rax, -0x48(%rbp)
movq $0x40, -0x40(%rbp)
jmp 0xbd923
movzbl -0x32(%rbp), %eax
cmpl $0x1, %eax
jne 0xbd90e
leaq 0xfd8ad(%rip), %rax     # 0x1bb1ad
movq %rax, -0x48(%rbp)
movq $0x80, -0x40(%rbp)
jmp 0xbd921
leaq 0xfa318(%rip), %rax     # 0x1b7c2d
movq %rax, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
jmp 0xbd923
movq -0x8(%rbp), %rdi
movzbl -0x33(%rbp), %edx
movq -0x30(%rbp), %rax
movl %eax, %ecx
leaq 0xf8ea7(%rip), %rsi     # 0x1b67df
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movzbl -0x32(%rbp), %edx
movq -0x48(%rbp), %rcx
leaq 0xf8e91(%rip), %rsi     # 0x1b67f1
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
addq $0x1, %rdx
movzbl -0x32(%rbp), %ecx
callq 0xbdd10
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
cmpq $0x0, -0x40(%rbp)
jne 0xbd997
jmp 0xbd9ac
movq -0x40(%rbp), %rax
addq $0x1, %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xbd894
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: handler_dri
static void handler_dri(deark *c, lctx *d,
	const struct marker_info *mi, i64 pos, i64 data_size)
{
	i64 ri;
	if(data_size!=2) return;
	ri = de_getu16be(pos);
	de_dbg(c, "restart interval: %d", (int)ri);
	if(ri!=0) d->has_restart_markers = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
cmpq $0x2, -0x28(%rbp)
je 0xbd9e5
jmp 0xbda21
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x1651d0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0xf8e06(%rip), %rsi     # 0x1b6811
movb $0x0, %al
callq 0x15b0d0
cmpq $0x0, -0x30(%rbp)
je 0xbda21
movq -0x10(%rbp), %rax
movb $0x1, 0x1b(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: handler_jpg8
static void handler_jpg8(deark *c, lctx *d,
	const struct marker_info *mi, i64 seg_data_pos, i64 seg_data_size)
{
	u8 id;
	const char *name = "?";

	if(seg_data_size<1) return;
	id = de_getbyte(seg_data_pos);
	if(id==0x0d) {
		d->has_revcolorxform = 1;
		name="inverse color transform specification";
	}
	de_dbg(c, "id: 0x%02x (%s)", (unsigned int)id, name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
leaq 0xfa1da(%rip), %rax     # 0x1b7c2d
movq %rax, -0x38(%rbp)
cmpq $0x1, -0x28(%rbp)
jge 0xbda60
jmp 0xbdaaa
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165060
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
cmpl $0xd, %eax
jne 0xbda90
movq -0x10(%rbp), %rax
movb $0x1, 0x1f(%rax)
leaq 0xf8d9a(%rip), %rax     # 0x1b6826
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x29(%rbp), %edx
movq -0x38(%rbp), %rcx
leaq 0xf8da9(%rip), %rsi     # 0x1b684c
movb $0x0, %al
callq 0x15b0d0
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: dump_htable_summary
static void dump_htable_summary(deark *c, lctx *d, const u8 *codecounts)
{
	i64 k;
	de_ucstring *s = NULL;

	if(c->debug_level<2) return;

	s = ucstring_create(c);
	for(k=0; k<16; k++) {
		ucstring_printf(s, DE_ENCODING_LATIN1, " %3u",
			(unsigned int)codecounts[k]);
		if(k%8==7) { // end of a debug line
			de_dbg(c, "number of codes of len[%d-%2d]:%s",
				(int)(k-7+1), (int)(k+1),
				ucstring_getpsz(s));
			ucstring_empty(s);
		}
	}
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jge 0xbdb2a
jmp 0xbdbec
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x10, -0x20(%rbp)
jge 0xbdbe3
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
movl $0x5, %esi
leaq 0xf8b8e(%rip), %rdx     # 0x1b66f4
movb $0x0, %al
callq 0x171660
movq -0x20(%rbp), %rax
movl $0x8, %ecx
cqto
idivq %rcx
cmpq $0x7, %rdx
jne 0xbdbd0
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
subq $0x7, %rax
addq $0x1, %rax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x172500
movq -0x38(%rbp), %rdi
movl -0x30(%rbp), %edx
movl -0x2c(%rbp), %ecx
movq %rax, %r8
leaq 0xf8b39(%rip), %rsi     # 0x1b66f9
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rdi
callq 0x171210
jmp 0xbdbd2
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xbdb3f
movq -0x28(%rbp), %rdi
callq 0x171750
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: dump_htable_details
static void dump_htable_details(deark *c, lctx *d, i64 pos1, const u8 *codecounts,
	i64 num_huff_codes)
{
	struct fmtutil_huffman_decoder *ht = NULL;
	UI symlen;
	i64 pos = pos1;

	// TODO: Is there any case (e.g. lossless) where >162 codes are allowed?
	if(c->debug_level>=3 && (num_huff_codes>=1 && num_huff_codes<=162)) {
		;
	}
	else {
		return;
	}

	ht = fmtutil_huffman_create_decoder(c, 0, 0);

	// Note: Per the JPEG spec, "the all-1-bits code word of any length is
	// reserved as a prefix for longer code words". So we should not expect to
	// see such a code in the derived codebook.

	for(symlen=1; symlen<=16; symlen++) {
		UI num_syms_of_this_length;
		UI k;

		num_syms_of_this_length = (UI)codecounts[symlen-1];
		for(k=0; k<num_syms_of_this_length; k++) {
			u8 sym;

			sym = de_getbyte_p(&pos);
			fmtutil_huffman_record_a_code_length(c, ht->builder, (fmtutil_huffman_valtype)sym, symlen);
		}
	}

	// We do this only for the side effect of the debug messages.
	(void)fmtutil_huffman_make_canonical_code(c, ht->bk, ht->builder, 0, NULL);

	fmtutil_huffman_destroy_decoder(c, ht);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x3, (%rax)
jl 0xbdc48
cmpq $0x1, -0x28(%rbp)
jl 0xbdc48
cmpq $0xa2, -0x28(%rbp)
jg 0xbdc48
jmp 0xbdc4d
jmp 0xbdd01
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x188560
movq %rax, -0x30(%rbp)
movl $0x1, -0x34(%rbp)
cmpl $0x10, -0x34(%rbp)
ja 0xbdcd4
movq -0x20(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x44(%rbp), %eax
jae 0xbdcc7
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165170
movb %al, -0x49(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rsi
movzbl -0x49(%rbp), %edx
movl -0x34(%rbp), %ecx
callq 0x187f20
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xbdc88
jmp 0xbdcc9
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xbdc68
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdx
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r8d
callq 0x188020
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x1886d0
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: do_jfxx_segment
static void do_jfxx_segment(deark *c, lctx *d,
	i64 pos, i64 data_size)
{
	u8 t;

	d->has_jfxx_seg = 1;
	de_dbg(c, "JFXX segment at %d datasize=%d", (int)pos, (int)data_size);
	if(data_size<1) return;

	t = de_getbyte(pos);
	de_dbg(c, "thumbnail type: 0x%02x", (unsigned int)t);

	if(t==0x10) { // thumbnail coded using JPEG
		// TODO: JPEG-formatted thumbnails are forbidden from containing JFIF segments.
		// They essentially inherit them from their parent.
		// So, maybe, when we extract a thumbnail, we should insert an artificial JFIF
		// segment into it. We currently don't do that.
		// (However, this is not at all important.)
		dbuf_create_file_from_slice(c->infile, pos+1, data_size-1, "jfxxthumb.jpg", NULL, DE_CREATEFLAG_IS_AUX);
	}
	else if(t==0x11 || t==0x13) {
		i64 tn_w, tn_h;

		if(data_size<3) return;
		tn_w = (i64)de_getbyte(pos+1);
		tn_h = (i64)de_getbyte(pos+2);
		de_dbg(c, "JFXX thumbnail dimensions: %d"DE_CHAR_TIMES"%d", (int)tn_w, (int)tn_h);
		extract_unc_jfif_thumbnail(c, d, pos+3, data_size-3, tn_w, tn_h,
			(t==0x11)?1:0, "jfxxthumb");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movb $0x1, 0x4(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
leaq 0xf7eea(%rip), %rsi     # 0x1b6b41
movb $0x0, %al
callq 0x15b0d0
cmpq $0x1, -0x20(%rbp)
jge 0xbec6a
jmp 0xbed95
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165060
movb %al, -0x21(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x21(%rbp), %edx
leaq 0xf7ed3(%rip), %rsi     # 0x1b6b60
movb $0x0, %al
callq 0x15b0d0
movzbl -0x21(%rbp), %eax
cmpl $0x10, %eax
jne 0xbecd1
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
movq -0x20(%rbp), %rdx
subq $0x1, %rdx
leaq 0xf7ebb(%rip), %rcx     # 0x1b6b77
xorl %eax, %eax
movl %eax, %r8d
movl $0x1, %r9d
callq 0x166be0
jmp 0xbed95
movzbl -0x21(%rbp), %eax
cmpl $0x11, %eax
je 0xbece7
movzbl -0x21(%rbp), %eax
cmpl $0x13, %eax
jne 0xbed93
cmpq $0x3, -0x20(%rbp)
jge 0xbecf3
jmp 0xbed95
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
callq 0x165060
movzbl %al, %eax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x2, %rsi
callq 0x165060
movzbl %al, %eax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
movq -0x38(%rbp), %rax
movl %eax, %ecx
leaq 0xf7e43(%rip), %rsi     # 0x1b6b85
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x3, %rdx
movq -0x20(%rbp), %rcx
subq $0x3, %rcx
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
movzbl -0x21(%rbp), %r11d
xorl %r10d, %r10d
movl $0x1, %eax
cmpl $0x11, %r11d
cmovel %eax, %r10d
leaq 0xf7e22(%rip), %rax     # 0x1b6ba7
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xc0460
jmp 0xbed95
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: do_adobeapp14_segment
static void do_adobeapp14_segment(deark *c, lctx *d,
	i64 pos, i64 data_size)
{
	const char *tname;

	if(data_size<7) return;
	d->has_adobeapp14 = 1;
	d->color_transform = de_getbyte(pos+6);
	if(d->color_transform==0) tname="RGB or CMYK";
	else if(d->color_transform==1) tname="YCbCr";
	else if(d->color_transform==2) tname="YCCK";
	else tname="unknown";
	de_dbg(c, "color transform: %d (%s)", (int)d->color_transform, tname);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x7, -0x20(%rbp)
jge 0xbedc4
jmp 0xbee65
movq -0x10(%rbp), %rax
movb $0x1, 0x1d(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x6, %rsi
callq 0x165060
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x1e(%rax)
movq -0x10(%rbp), %rax
movzbl 0x1e(%rax), %eax
cmpl $0x0, %eax
jne 0xbee04
leaq 0xf7db3(%rip), %rax     # 0x1b6bb1
movq %rax, -0x28(%rbp)
jmp 0xbee47
movq -0x10(%rbp), %rax
movzbl 0x1e(%rax), %eax
cmpl $0x1, %eax
jne 0xbee1e
leaq 0xf7da5(%rip), %rax     # 0x1b6bbd
movq %rax, -0x28(%rbp)
jmp 0xbee45
movq -0x10(%rbp), %rax
movzbl 0x1e(%rax), %eax
cmpl $0x2, %eax
jne 0xbee38
leaq 0xf7d91(%rip), %rax     # 0x1b6bc3
movq %rax, -0x28(%rbp)
jmp 0xbee43
leaq 0xdf71d(%rip), %rax     # 0x19e55c
movq %rax, -0x28(%rbp)
jmp 0xbee45
jmp 0xbee47
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x1e(%rax), %edx
movq -0x28(%rbp), %rcx
leaq 0xf7d6a(%rip), %rsi     # 0x1b6bc8
movb $0x0, %al
callq 0x15b0d0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: do_exif_segment
static void do_exif_segment(deark *c, lctx *d,
	i64 pos, i64 data_size)
{
	u32 exifflags = 0;
	u32 exiforientation = 0;
	u32 exifversion = 0;

	if(data_size<8) return;
	// Note that Exif has an additional padding byte after the APP ID NUL terminator.
	de_dbg(c, "Exif data at %d, size=%d", (int)pos, (int)data_size);
	d->has_exif_seg = 1;
	if(!d->has_jfif_seg) {
		d->exif_before_jfif = 1;
	}
	de_dbg_indent(c, 1);
	fmtutil_handle_exif2(c, pos, data_size,
		&exifflags, &exiforientation, &exifversion);
	if(exifflags&0x08)
		d->has_exif_gps = 1;
	if(exifflags&0x10)
		d->exif_cosited = 1;
	if(exifflags&0x20)
		d->exif_orientation = exiforientation;
	if(exifflags&0x40)
		d->exif_version_as_uint32 = exifversion;
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
cmpq $0x8, -0x20(%rbp)
jge 0xbeea9
jmp 0xbef6a
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
leaq 0xf7d21(%rip), %rsi     # 0x1b6be1
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movb $0x1, 0x5(%rax)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x2(%rax)
jne 0xbeee1
movq -0x10(%rbp), %rax
movb $0x1, 0xa(%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x24(%rbp), %rcx
leaq -0x28(%rbp), %r8
leaq -0x2c(%rbp), %r9
callq 0x173570
movl -0x24(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xbef1f
movq -0x10(%rbp), %rax
movb $0x1, 0x6(%rax)
movl -0x24(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xbef32
movq -0x10(%rbp), %rax
movb $0x1, 0x20(%rax)
movl -0x24(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0xbef47
movl -0x28(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x3c(%rax)
movl -0x24(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xbef5c
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: do_meta_segment
static void do_meta_segment(deark *c, lctx *d, i64 pos1, i64 len)
{
	if(len<1) return;

	de_dbg(c, "\"Meta\" data at %d, size=%d", (int)(pos1+1), (int)(len-1));
	de_dbg_indent(c, 1);
	// TODO: The 3rd param below should probably represent some sort of TIFF
	// tag "namespace".
	de_run_module_by_id_on_slice2(c, "tiff", NULL, c->infile, pos1+1, len-1);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x1, -0x20(%rbp)
jge 0xbef91
jmp 0xbefff
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
addq $0x1, %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
subq $0x1, %rax
movl %eax, %ecx
leaq 0xf7c4a(%rip), %rsi     # 0x1b6bfa
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %r8
addq $0x1, %r8
movq -0x20(%rbp), %r9
subq $0x1, %r9
leaq 0x116f58(%rip), %rsi    # 0x1d5f40
xorl %eax, %eax
movl %eax, %edx
callq 0x15cab0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: do_icc_profile_segment
static void do_icc_profile_segment(deark *c, lctx *d, i64 pos, i64 data_size)
{
	u8 b1, b2;

	if(data_size<2) return; // bogus data
	b1 = de_getbyte(pos);
	b2 = de_getbyte(pos+1);
	de_dbg(c, "icc profile segment at %d datasize=%d part %d of %d", (int)pos, (int)(data_size-2), b1, b2);

	if(!d->iccprofile_file) {
		d->has_iccprofile = 1;
		d->iccprofile_file = dbuf_create_output_file(c, "icc", NULL, DE_CREATEFLAG_IS_AUX);
	}
	dbuf_copy(c->infile, pos+2, data_size-2, d->iccprofile_file);

	if(b1==b2) {
		// If this is the final piece of the ICC profile, close the file.
		// That way, if for some reason there's another profile in the file, we'll put
		// it in a separate file.
		dbuf_close(d->iccprofile_file);
		d->iccprofile_file = NULL;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x2, -0x20(%rbp)
jge 0xbf034
jmp 0xbf10d
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165060
movb %al, -0x21(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
callq 0x165060
movb %al, -0x22(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
subq $0x2, %rax
movl %eax, %ecx
movzbl -0x21(%rbp), %r8d
movzbl -0x22(%rbp), %r9d
leaq 0xf7b90(%rip), %rsi     # 0x1b6c15
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
jne 0xbf0c3
movq -0x10(%rbp), %rax
movb $0x1, 0xf(%rax)
movq -0x8(%rbp), %rdi
leaq 0xe293b(%rip), %rsi     # 0x1a19e5
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x166c60
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x2, %rsi
movq -0x20(%rbp), %rdx
subq $0x2, %rdx
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rcx
callq 0x166070
movzbl -0x21(%rbp), %eax
movzbl -0x22(%rbp), %ecx
cmpl %ecx, %eax
jne 0xbf10d
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x1676a0
movq -0x10(%rbp), %rax
movq $0x0, 0x48(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: do_photoshop_segment
static void do_photoshop_segment(deark *c, lctx *d,
	i64 pos, i64 data_size)
{
	struct de_module_out_params oparams;

	de_zeromem(&oparams, sizeof(struct de_module_out_params));
	// TODO: Can Photoshop resources span multiple JPEG segments? I have
	// a file in which that seems to be the case.
	de_dbg(c, "photoshop data at %d, size=%d", (int)pos, (int)data_size);
	d->has_psd = 1;
	de_dbg_indent(c, 1);
	fmtutil_handle_photoshop_rsrc2(c, c->infile, pos, data_size, 0x0, &oparams);
	if(oparams.flags&0x02)
		d->has_iptc = 1;
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x19140
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
leaq 0xf7798(%rip), %rsi     # 0x1b6df7
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movb $0x1, 0xb(%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
xorl %r8d, %r8d
leaq -0x50(%rbp), %r9
callq 0x173a30
movl -0x50(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xbf6af
movq -0x10(%rbp), %rax
movb $0x1, 0xc(%rax)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: do_ducky_segment
static void do_ducky_segment(deark *c, lctx *d, i64 pos1, i64 len)
{
	i64 pos = pos1;
	u32 blktype;
	i64 blklen;
	i64 n;

	while(1) {
		blktype = (u32)de_getu16be_p(&pos);
		if(blktype==0) break;
		if(pos+2 > pos1+len) break;
		blklen = de_getu16be_p(&pos);
		if(pos+blklen > pos1+len) break;
		switch(blktype) {
		case 1:
			if(blklen==4) {
				n = de_getu32be(pos);
				de_dbg(c, "quality: %d", (int)n);
			}
			break;
		case 2:
			do_ducky_stringblock(c, d, pos, blklen, "comment");
			break;
		case 3:
			do_ducky_stringblock(c, d, pos, blklen, "copyright");
			break;
		}
		pos += blklen;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165210
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0xbf70f
jmp 0xbf7fa
movq -0x28(%rbp), %rax
addq $0x2, %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jle 0xbf729
jmp 0xbf7fa
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165210
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
addq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jle 0xbf758
jmp 0xbf7fa
movl -0x2c(%rbp), %eax
movl %eax, -0x44(%rbp)
subl $0x1, %eax
je 0xbf779
jmp 0xbf765
movl -0x44(%rbp), %eax
subl $0x2, %eax
je 0xbf7af
jmp 0xbf76f
movl -0x44(%rbp), %eax
subl $0x3, %eax
je 0xbf7cd
jmp 0xbf7e9
cmpq $0x4, -0x38(%rbp)
jne 0xbf7ad
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x165470
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
leaq 0xf766f(%rip), %rsi     # 0x1b6e15
movb $0x0, %al
callq 0x15b0d0
jmp 0xbf7e9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq 0x110b7f(%rip), %r8     # 0x1d0345
callq 0xc0be0
jmp 0xbf7e9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq 0xdefcb(%rip), %r8      # 0x19e7af
callq 0xc0be0
movq -0x38(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0xbf6f0
addq $0x50, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: do_jpeghdr_segment
static void do_jpeghdr_segment(deark *c, lctx *d, i64 pos1,
	i64 data_size1, int is_ext)
{
	int ret;
	i64 pos = 0;
	i64 data_size;

	// Payload should begin after the first NUL byte. Search for it.
	ret = dbuf_search_byte(c->infile, 0x00, pos1, data_size1, &pos);
	if(!ret) {
		de_warn(c, "Bad or unsupported JPEG-HDR data");
		return;
	}
	pos++;
	data_size = pos1+data_size1 - pos;

	if(is_ext) {
		de_dbg(c, "JPEG-HDR residual image continuation, pos=%d size=%d",
			(int)pos, (int)data_size);
	}
	else {
		de_dbg(c, "JPEG-HDR residual image start, pos=%d size=%d",
			(int)pos, (int)data_size);

		// Close any previous file
		if(d->hdr_residual_file) {
			dbuf_close(d->hdr_residual_file);
			d->hdr_residual_file = NULL;
		}

		// Make sure it looks like an embedded JPEG file
		if(dbuf_memcmp(c->infile, pos, "\xff\xd8", 2)) {
			de_warn(c, "Bad or unsupported JPEG-HDR format");
			return;
		}

		d->hdr_residual_file = dbuf_create_output_file(c, "residual.jpg", NULL, DE_CREATEFLAG_IS_AUX);
	}

	if(!d->hdr_residual_file) return;
	dbuf_copy(c->infile, pos, data_size, d->hdr_residual_file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
xorl %esi, %esi
leaq -0x30(%rbp), %r8
callq 0x1667a0
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0xbfb8f
movq -0x8(%rbp), %rdi
leaq 0xf73d2(%rip), %rsi     # 0x1b6f55
movb $0x0, %al
callq 0x15bc10
jmp 0xbfc9a
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
subq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0xbfbd4
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
movq -0x38(%rbp), %rax
movl %eax, %ecx
leaq 0xf73ae(%rip), %rsi     # 0x1b6f76
movb $0x0, %al
callq 0x15b0d0
jmp 0xbfc70
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
movq -0x38(%rbp), %rax
movl %eax, %ecx
leaq 0xf73c0(%rip), %rsi     # 0x1b6fab
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0xbfc16
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x1676a0
movq -0x10(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
leaq 0xf73b0(%rip), %rdx     # 0x1b6fd9
movl $0x2, %ecx
callq 0x166ab0
cmpl $0x0, %eax
je 0xbfc4c
movq -0x8(%rbp), %rdi
leaq 0xf7399(%rip), %rsi     # 0x1b6fdc
movb $0x0, %al
callq 0x15bc10
jmp 0xbfc9a
movq -0x8(%rbp), %rdi
leaq 0xf73a8(%rip), %rsi     # 0x1b6fff
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x166c60
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0xbfc7d
jmp 0xbfc9a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rcx
callq 0x166070
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: do_mpf_segment
static void do_mpf_segment(deark *c, lctx *d,
	i64 pos, i64 data_size)
{
	de_module_params *mparams = NULL;

	d->has_mpf_seg = 1;
	de_dbg(c, "MPF data at %d, size=%d", (int)pos, (int)data_size);
	de_dbg_indent(c, 1);

	mparams = de_malloc(c, sizeof(de_module_params));

	mparams->in_params.codes = "M";
	mparams->in_params.flags |= 0x01;
	mparams->in_params.offset_in_parent = pos;
	mparams->in_params.parent_dbuf = c->infile;

	de_run_module_by_id_on_slice(c, "tiff", mparams, c->infile, pos, data_size);

	if(mparams->out_params.flags & 0x80) {
		if(mparams->out_params.uint3 > 1) {
			// We want to set the is_mpo flag if there is an MPEntry tag which
			// says there is more than one non-thumbnail image.
			// This is so we can declare the format to be "JPEG/MPO".
			d->is_mpo = 1;
		}
	}

	de_free(c, mparams);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movb $0x1, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
leaq 0xf71c9(%rip), %rsi     # 0x1b7058
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movl $0x70, %esi
callq 0x15b780
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
leaq 0xec4b7(%rip), %rcx     # 0x1ac378
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %r8
movq -0x20(%rbp), %r9
leaq 0x116034(%rip), %rsi    # 0x1d5f40
callq 0x15c9f0
movq -0x28(%rbp), %rax
movl 0x40(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0xbff36
movq -0x28(%rbp), %rax
cmpl $0x1, 0x4c(%rax)
jbe 0xbff34
movq -0x10(%rbp), %rax
movb $0x1, 0x19(%rax)
jmp 0xbff36
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x15b820
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: decode_app_id
static void decode_app_id(struct app_id_decode_struct *ad)
{
	i64 k;

	if(ad->nraw_bytes<2) return;
	if(ad->raw_bytes[0]<32 || ad->raw_bytes[0]>126) return;

	// Might have an app id.
	for(k=0; k<ad->nraw_bytes; k++) {
		if(ad->raw_bytes[k]==0) {
			ad->has_app_id = 1;
			ad->app_id_orig_strlen = k;
			break;
		}
	}

	if(ad->has_app_id) {
		// We'll assume this is an app id
		de_strlcpy(ad->app_id_orig, (const char*)ad->raw_bytes, sizeof(ad->app_id_orig));
		normalize_app_id(ad->app_id_orig, ad->app_id_normalized, sizeof(ad->app_id_normalized));
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x2, 0x50(%rax)
jge 0xc02bc
jmp 0xc036f
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x20, %eax
jl 0xc02d4
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x7e, %eax
jle 0xc02d9
jmp 0xc036f
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jge 0xc032f
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xc031f
movq -0x8(%rbp), %rax
movl $0x1, 0x100(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xf8(%rax)
jmp 0xc032f
jmp 0xc0321
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xc02e1
movq -0x8(%rbp), %rax
cmpl $0x0, 0x100(%rax)
je 0xc036f
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
movq -0x8(%rbp), %rsi
movl $0x50, %edx
callq 0x15aa30
movq -0x8(%rbp), %rdi
addq $0x58, %rdi
movq -0x8(%rbp), %rsi
addq $0xa8, %rsi
movl $0x50, %edx
callq 0xc0380
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: normalize_app_id
static void normalize_app_id(const char *app_id_orig, char *app_id_normalized,
	size_t app_id_normalized_len)
{
	i64 id_strlen;
	i64 i;

	de_strlcpy(app_id_normalized, app_id_orig, app_id_normalized_len);
	id_strlen = (i64)de_strlen(app_id_normalized);

	// Strip trailing spaces.
	while(id_strlen>0 && app_id_normalized[id_strlen-1]==' ') {
		app_id_normalized[id_strlen-1] = '\0';
		id_strlen--;
	}

	for(i=0; i<id_strlen; i++) {
		if(app_id_normalized[i]>='a' && app_id_normalized[i]<='z') {
			app_id_normalized[i] -= 32;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x15aa30
movq -0x10(%rbp), %rdi
callq 0x190e0
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x20(%rbp)
movb %al, -0x29(%rbp)
jle 0xc03d7
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
sete %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0xc03e0
jmp 0xc03fe
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xc03b2
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0xc0454
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x61, %eax
jl 0xc0444
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x7a, %eax
jg 0xc0444
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %edx
subl $0x20, %edx
movb %dl, (%rax,%rcx)
jmp 0xc0446
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xc0406
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: extract_unc_jfif_thumbnail
static void extract_unc_jfif_thumbnail(deark *c, lctx *d,
	i64 pos1, i64 len, i64 w, i64 h, int has_pal,
	const char *token)
{
	i64 i, j;
	i64 pos = pos1;
	de_bitmap *img = NULL;
	u32 clr;
	i64 rowspan;

	img = de_bitmap_create(c, w, h, 3);

	if(has_pal) {
		u32 pal[256];
		de_read_palette_rgb(c->infile, pos, 256, 3, pal, 256, 0);
		pos += 768;
		de_convert_image_paletted(c->infile, pos, 8, w, pal, img, 0);
	}
	else {
		rowspan = 3*w;
		for(j=0; j<h; j++) {
			for(i=0; i<w; i++) {
				clr = dbuf_getRGB(c->infile, pos + j*rowspan + i*3, 0);
				de_bitmap_setpixel_rgb(img, i, j, clr);
			}
		}
	}

	de_bitmap_write_to_file(img, token, DE_CREATEFLAG_IS_AUX);

	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x470, %rsp            # imm = 0x470
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl $0x3, %ecx
callq 0x16b750
movq %rax, -0x50(%rbp)
cmpl $0x0, 0x10(%rbp)
je 0xc052a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x48(%rbp), %rsi
leaq -0x460(%rbp), %r8
movl $0x100, %r9d            # imm = 0x100
movl $0x3, %ecx
xorl %eax, %eax
movq %r9, %rdx
movl $0x0, (%rsp)
callq 0x16c0c0
movq -0x48(%rbp), %rax
addq $0x300, %rax            # imm = 0x300
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x28(%rbp), %rcx
leaq -0x460(%rbp), %r8
movq -0x50(%rbp), %r9
movl $0x8, %edx
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x16c520
jmp 0xc05b5
imulq $0x3, -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0xc05b3
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0xc05a3
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rax
imulq -0x60(%rbp), %rax
addq %rax, %rsi
imulq $0x3, -0x38(%rbp), %rax
addq %rax, %rsi
xorl %edx, %edx
callq 0x165ff0
movl %eax, -0x54(%rbp)
movq -0x50(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x54(%rbp), %ecx
callq 0x16b310
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xc054d
jmp 0xc05a5
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xc053b
jmp 0xc05b5
movq -0x50(%rbp), %rdi
movq 0x18(%rbp), %rsi
movl $0x1, %edx
callq 0x16afd0
movq -0x50(%rbp), %rdi
callq 0x16af60
addq $0x470, %rsp            # imm = 0x470
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: destroy_fpxr_data
static void destroy_fpxr_data(deark *c, lctx *d)
{
	size_t k;
	if(!d->fpxr_data) return;

	for(k=0; k<d->fpxr_data->num_entities; k++) {
		if(d->fpxr_data->entities[k].name_srd) {
			de_destroy_stringreaderdata(c, d->fpxr_data->entities[k].name_srd);
			d->fpxr_data->entities[k].name_srd = NULL;
		}

		dbuf_close(d->fpxr_data->entities[k].stream);
		d->fpxr_data->entities[k].stream = NULL;
	}

	de_free(c, d->fpxr_data->entities);
	de_free(c, d->fpxr_data);
	d->fpxr_data = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xa8(%rax)
jne 0xc0603
jmp 0xc070f
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0xa8(%rcx), %rcx
cmpq (%rcx), %rax
jae 0xc06d4
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x18(%rbp), %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0xc0684
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x18(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
callq 0x166830
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x18(%rbp), %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x18(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
callq 0x1676a0
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x18(%rbp), %rcx
addq %rcx, %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xc060b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x15b820
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rsi
callq 0x15b820
movq -0x10(%rbp), %rax
movq $0x0, 0xa8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: append_fpxr_stream_data
static void append_fpxr_stream_data(deark *c, lctx *d, size_t stream_idx,
	i64 pos, i64 len)
{
	struct fpxr_entity_struct *fe = NULL;

	if(!d->fpxr_data) return;
	if(stream_idx > d->fpxr_data->num_entities) return;
	fe = &d->fpxr_data->entities[stream_idx];
	if(fe->done_flag) return;

	// TODO: More validation could be done here.
	// We're just assuming the FPXR chunks are correctly formed, and in the
	// right order.
	// Note that the chunk size (len) is a calculated value, and is constrained
	// to the size of a JPEG segment (64KB). So it should be okay to trust it.

	// If we haven't done it yet, create a membuf for this stream.
	if(!fe->stream) {
		fe->stream = dbuf_create_membuf(c, len, 0);
	}

	// Save the stream data to the membuf.
	// We make a copy of the stream, because it could be split up into chunks,
	// *and* we might want to parse it.
	dbuf_copy(c->infile, pos, len, fe->stream);

	if(fe->stream->len >= fe->stream_size) {
		finalize_fpxr_stream(c, d, fe);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xa8(%rax)
jne 0xc0757
jmp 0xc0800
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0xa8(%rcx), %rcx
cmpq (%rcx), %rax
jbe 0xc0770
jmp 0xc0800
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0xc0797
jmp 0xc0800
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0xc07bc
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0x168020
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rcx
callq 0x166070
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jl 0xc0800
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0xc0810
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: ucstring_contains_char
static int ucstring_contains_char(de_ucstring *s, i32 ch)
{
	i64 k;

	if(!s) return 0;
	for(k=0; k<s->len; k++) {
		if(s->str[k]==ch) return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xc0b0b
movl $0x0, -0x4(%rbp)
jmp 0xc0b55
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0xc0b4e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x14(%rbp), %eax
jne 0xc0b3e
movl $0x1, -0x4(%rbp)
jmp 0xc0b55
jmp 0xc0b40
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xc0b13
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: do_fpxr_olepropset_stream
static void do_fpxr_olepropset_stream(deark *c, lctx *d, struct fpxr_entity_struct *fe)
{
	de_dbg(c, "decoding Flashpix stream %d (OLE property set)", (int)fe->index);
	de_dbg_indent(c, 1);
	de_run_module_by_id_on_slice(c, "olepropset", NULL, fe->stream, 0, fe->stream->len);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %edx
leaq 0xf6240(%rip), %rsi     # 0x1b6dc8
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %r9
leaq 0xe5009(%rip), %rsi     # 0x1a5bc5
xorl %eax, %eax
movl %eax, %r8d
movq %r8, %rdx
callq 0x15c9f0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: do_ducky_stringblock
static void do_ducky_stringblock(deark *c, lctx *d,
	i64 pos1, i64 len, const char *name)
{
	i64 pos = pos1;
	i64 nchars;
	de_ucstring *s = NULL;

	if(len<4) goto done;
	nchars = de_getu32be_p(&pos);
	if(nchars*2 > len-4) goto done;

	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, pos, nchars*2, DE_DBG_MAX_STRLEN, s,
		0, DE_ENCODING_UTF16BE);
	de_dbg(c, "%s: \"%s\"", name, ucstring_getpsz(s));
done:
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
cmpq $0x4, -0x20(%rbp)
jge 0xc0c18
jmp 0xc0cad
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1654b0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
shlq %rax
movq -0x20(%rbp), %rcx
subq $0x4, %rcx
cmpq %rcx, %rax
jle 0xc0c43
jmp 0xc0cad
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
shlq %rdx
movq -0x40(%rbp), %r8
movl $0x1f4, %ecx            # imm = 0x1F4
xorl %r9d, %r9d
movl $0x4, (%rsp)
callq 0x166a40
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x172500
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq %rax, %rcx
leaq 0xf6f60(%rip), %rsi     # 0x1b7c06
movb $0x0, %al
callq 0x15b0d0
movq -0x40(%rbp), %rdi
callq 0x171750
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: finalize_all_fpxr_streams
static void finalize_all_fpxr_streams(deark *c, lctx *d)
{
	size_t k;

	if(!d->fpxr_data) return;

	for(k=0; k<d->fpxr_data->num_entities; k++) {
		struct fpxr_entity_struct *fe = &d->fpxr_data->entities[k];
		if(fe->stream) {
			finalize_fpxr_stream(c, d, fe);
		}
	}
	destroy_fpxr_data(c, d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0xa8(%rax)
jne 0xc0ce0
jmp 0xc0d50
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0xa8(%rcx), %rcx
cmpq (%rcx), %rax
jae 0xc0d43
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xc0d33
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xc0810
jmp 0xc0d35
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xc0ce8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xc05e0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/jpeg.c
// Function: declare_jpeg_fmt
static void declare_jpeg_fmt(deark *c, lctx *d, u8 seg_type)
{
	const char *name = "JPEG (other)";

	// The declared format is only an executive summary of the kind of JPEG.
	// It does not come close to covering all possible combinations of attributes.
	// (The "summary:" line goes a bit further.)
	if(d->is_jpegls) { name = "JPEG-LS"; }
	else if(d->is_mpo) { name = "JPEG/MPO"; }
	else if(d->is_jps) { name = "JPEG/JPS"; }
	else if(d->is_jps) { name = "JPEG XT"; }
	else if(d->is_jpeghdr) { name = "JPEG-HDR"; }
	else if(d->is_lossless) { name = "JPEG/lossless"; }
	else if(d->has_jfif_seg && d->has_exif_seg) { name = "JPEG/JFIF+Exif"; }
	else if(d->has_jfif_seg) { name = "JPEG/JFIF"; }
	else if(d->has_exif_seg) { name = "JPEG/Exif"; }
	de_declare_fmt(c, name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
leaq 0xf6492(%rip), %rax     # 0x1b720e
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0xc0d99
leaq 0xf6434(%rip), %rax     # 0x1b71c4
movq %rax, -0x20(%rbp)
jmp 0xc0e78
movq -0x10(%rbp), %rax
cmpb $0x0, 0x19(%rax)
je 0xc0db3
leaq 0xf6471(%rip), %rax     # 0x1b721b
movq %rax, -0x20(%rbp)
jmp 0xc0e76
movq -0x10(%rbp), %rax
cmpb $0x0, 0x1a(%rax)
je 0xc0dcd
leaq 0xf6460(%rip), %rax     # 0x1b7224
movq %rax, -0x20(%rbp)
jmp 0xc0e74
movq -0x10(%rbp), %rax
cmpb $0x0, 0x1a(%rax)
je 0xc0de7
leaq 0xf644f(%rip), %rax     # 0x1b722d
movq %rax, -0x20(%rbp)
jmp 0xc0e72
movq -0x10(%rbp), %rax
cmpb $0x0, 0x17(%rax)
je 0xc0dfe
leaq 0xf643d(%rip), %rax     # 0x1b7235
movq %rax, -0x20(%rbp)
jmp 0xc0e70
movq -0x10(%rbp), %rax
cmpb $0x0, 0x14(%rax)
je 0xc0e15
leaq 0xf642f(%rip), %rax     # 0x1b723e
movq %rax, -0x20(%rbp)
jmp 0xc0e6e
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %eax
cmpl $0x0, %eax
je 0xc0e3c
movq -0x10(%rbp), %rax
movzbl 0x5(%rax), %eax
cmpl $0x0, %eax
je 0xc0e3c
leaq 0xf6416(%rip), %rax     # 0x1b724c
movq %rax, -0x20(%rbp)
jmp 0xc0e6c
movq -0x10(%rbp), %rax
cmpb $0x0, 0x2(%rax)
je 0xc0e53
leaq 0xf640e(%rip), %rax     # 0x1b725b
movq %rax, -0x20(%rbp)
jmp 0xc0e6a
movq -0x10(%rbp), %rax
cmpb $0x0, 0x5(%rax)
je 0xc0e68
leaq 0xf6401(%rip), %rax     # 0x1b7265
movq %rax, -0x20(%rbp)
jmp 0xc0e6a
jmp 0xc0e6c
jmp 0xc0e6e
jmp 0xc0e70
jmp 0xc0e72
jmp 0xc0e74
jmp 0xc0e76
jmp 0xc0e78
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x15e380
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)