LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: valdec_newsubfiletype
static int valdec_newsubfiletype(deark *c, const struct valdec_params *vp, struct valdec_result *vr)
{
	i64 n = vp->n;

	if(n<1) return 0;

	if(n&0x1) {
		ucstring_append_flags_item(vr->s, "reduced-res");
		n -= 0x1;
	}
	if(n&0x2) {
		ucstring_append_flags_item(vr->s, "one-page-of-many");
		n -= 0x2;
	}
	if(n&0x4) {
		ucstring_append_flags_item(vr->s, "mask");
		n -= 0x4;
	}
	if(n&0x10) {
		ucstring_append_flags_item(vr->s, "MRC-related");
		n -= 0x10;
	}
	if(n!=0) {
		ucstring_append_flags_itemf(vr->s, "0x%x", (unsigned int)n);
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x1, -0x28(%rbp)
jge 0x130b33
movl $0x0, -0x4(%rbp)
jmp 0x130c10
movq -0x28(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x130b60
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq 0x99f7b(%rip), %rsi     # 0x1caaca
callq 0x172680
movq -0x28(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
andq $0x2, %rax
cmpq $0x0, %rax
je 0x130b8d
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq 0x99f5a(%rip), %rsi     # 0x1caad6
callq 0x172680
movq -0x28(%rbp), %rax
subq $0x2, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
andq $0x4, %rax
cmpq $0x0, %rax
je 0x130bba
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq 0xa0f9a(%rip), %rsi     # 0x1d1b43
callq 0x172680
movq -0x28(%rbp), %rax
subq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
andq $0x10, %rax
cmpq $0x0, %rax
je 0x130be7
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq 0x99f11(%rip), %rsi     # 0x1caae7
callq 0x172680
movq -0x28(%rbp), %rax
subq $0x10, %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x130c09
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x83b42(%rip), %rsi     # 0x1b4744
movb $0x0, %al
callq 0x1726d0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_bitspersample
static void handler_bitspersample(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	i64 val;

	tg->pg->valcount_bitspersample = (u8)tg->valcount;
	if(tg->valcount<1) return;

	// FIXME: This is a multi-valued field.
	read_tag_value_as_int64(c, d, tg, 0, &val);
	tg->pg->bits_per_sample = (u32)val;
}

// 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 -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movb %al, %cl
movq -0x18(%rbp), %rax
movq (%rax), %rax
movb %cl, 0x9b(%rax)
movq -0x18(%rbp), %rax
cmpq $0x1, 0x18(%rax)
jge 0x130c9c
jmp 0x130cc5
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
leaq -0x28(%rbp), %r8
callq 0x132fa0
movq -0x28(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %ecx, 0x28(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: valdec_compression
static int valdec_compression(deark *c, const struct valdec_params *vp, struct valdec_result *vr)
{
	const struct cmpr_meth_info *cmi;

	cmi = find_cmpr_meth_info((u32)vp->n);

	if(cmi && cmi->name) {
		ucstring_append_sz(vr->s, cmi->name, DE_ENCODING_UTF8);
	}
	else {
		ucstring_append_sz(vr->s, "?", DE_ENCODING_LATIN1);
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %edi
callq 0x133560
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x130d24
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x130d24
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0x2, %edx
callq 0x1715e0
jmp 0x130d3c
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x86efb(%rip), %rsi     # 0x1b7c2d
movl $0x5, %edx
callq 0x1715e0
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_strileoffsets
static void handler_strileoffsets(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	struct page_ctx *pg = tg->pg;
	i64 i;

	if(tni->tagnum==TAG_TILEOFFSETS) {
		pg->have_tile_tags = 1;
	}
	else {
		pg->have_strip_tags = 1;
	}
	if(!alloc_striledata(c, pg, tg->valcount)) return;

	for(i=0; i<tg->valcount; i++) {
		read_tag_value_as_int64(c, d, tg, i, &pg->strile_data[i].pos);
	}
}

// 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 -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x144, (%rax)          # imm = 0x144
jne 0x130e49
movq -0x28(%rbp), %rax
movb $0x1, 0x16(%rax)
jmp 0x130e51
movq -0x28(%rbp), %rax
movb $0x1, 0x15(%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
callq 0x133a00
cmpl $0x0, %eax
jne 0x130e6d
jmp 0x130ebc
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jge 0x130ebc
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0xb8(%rax), %r8
movq -0x30(%rbp), %rax
shlq $0x4, %rax
addq %rax, %r8
callq 0x132fa0
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x130e75
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_strilebytecounts
static void handler_strilebytecounts(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	struct page_ctx *pg = tg->pg;
	i64 i;

	pg->have_strilebytecounts = 1;
	if(tni->tagnum==TAG_TILEBYTECOUNTS) {
		pg->have_tile_tags = 1;
	}
	else {
		pg->have_strip_tags = 1;
	}
	if(!alloc_striledata(c, pg, tg->valcount)) return;

	for(i=0; i<tg->valcount; i++) {
		read_tag_value_as_int64(c, d, tg, i, &pg->strile_data[i].len);
	}
}

// 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 -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movb $0x1, 0x17(%rax)
movq -0x20(%rbp), %rax
cmpl $0x145, (%rax)          # imm = 0x145
jne 0x130f61
movq -0x28(%rbp), %rax
movb $0x1, 0x16(%rax)
jmp 0x130f69
movq -0x28(%rbp), %rax
movb $0x1, 0x15(%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
callq 0x133a00
cmpl $0x0, %eax
jne 0x130f85
jmp 0x130fd8
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jge 0x130fd8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq 0xb8(%rax), %r8
movq -0x30(%rbp), %rax
shlq $0x4, %rax
addq %rax, %r8
addq $0x8, %r8
callq 0x132fa0
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x130f8d
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_resolution
static void handler_resolution(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	struct numeric_value nv;

	if(tg->valcount<1) return;
	read_numeric_value(c, d, tg, 0, &nv, NULL);
	if(!nv.isvalid) return;
	tg->pg->have_density = 1;
	if(tg->tagnum==TAG_XRESOLUTION) {
		tg->pg->density_ImageWidth = nv.val_double;
	}
	else if(tg->tagnum==TAG_YRESOLUTION) {
		tg->pg->density_ImageLength = nv.val_double;
	}
}

// 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 -0x18(%rbp), %rax
cmpq $0x1, 0x18(%rax)
jge 0x131005
jmp 0x131075
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %r9d
leaq -0x38(%rbp), %r8
movq %r9, %rcx
callq 0x133ab0
cmpl $0x0, -0x38(%rbp)
jne 0x13102a
jmp 0x131075
movq -0x18(%rbp), %rax
movq (%rax), %rax
movb $0x1, 0x14(%rax)
movq -0x18(%rbp), %rax
cmpl $0x11a, 0x8(%rax)       # imm = 0x11A
jne 0x131055
movsd -0x28(%rbp), %xmm0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movsd %xmm0, 0x50(%rax)
jmp 0x131075
movq -0x18(%rbp), %rax
cmpl $0x11b, 0x8(%rax)       # imm = 0x11B
jne 0x131073
movsd -0x28(%rbp), %xmm0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movsd %xmm0, 0x58(%rax)
jmp 0x131075
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: valdec_t4options
static int valdec_t4options(deark *c, const struct valdec_params *vp, struct valdec_result *vr)
{
	if(vp->n<1) return 0;

	if(vp->n&0x1) {
		ucstring_append_flags_item(vr->s, "2-d encoding");
	}
	if(vp->n&0x2) {
		ucstring_append_flags_item(vr->s, "uncompressed mode allowed");
	}
	if(vp->n&0x4) {
		ucstring_append_flags_item(vr->s, "has fill bits");
	}
	if((vp->n & ~0x7)!=0) {
		ucstring_append_flags_item(vr->s, "?");
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x1, 0x18(%rax)
jge 0x1310eb
movl $0x0, -0x4(%rbp)
jmp 0x131186
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x131110
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq 0x99b8e(%rip), %rsi     # 0x1cac99
callq 0x172680
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
andq $0x2, %rax
cmpq $0x0, %rax
je 0x131135
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq 0x99b76(%rip), %rsi     # 0x1caca6
callq 0x172680
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
je 0x13115a
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq 0x99b6b(%rip), %rsi     # 0x1cacc0
callq 0x172680
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
andq $-0x8, %rax
cmpq $0x0, %rax
je 0x13117f
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq 0x86ab3(%rip), %rsi     # 0x1b7c2d
callq 0x172680
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: valdec_t6options
static int valdec_t6options(deark *c, const struct valdec_params *vp, struct valdec_result *vr)
{
	if(vp->n<1) return 0;

	if(vp->n&0x2) {
		ucstring_append_flags_item(vr->s, "uncompressed mode allowed");
	}
	if((vp->n & ~0x2)!=0) {
		ucstring_append_flags_item(vr->s, "?");
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x1, 0x18(%rax)
jge 0x1311b8
movl $0x0, -0x4(%rbp)
jmp 0x131209
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
andq $0x2, %rax
cmpq $0x0, %rax
je 0x1311dd
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq 0x99ace(%rip), %rsi     # 0x1caca6
callq 0x172680
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
andq $-0x3, %rax
cmpq $0x0, %rax
je 0x131202
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq 0x86a30(%rip), %rsi     # 0x1b7c2d
callq 0x172680
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: valdec_pagenumber
static int valdec_pagenumber(deark *c, const struct valdec_params *vp, struct valdec_result *vr)
{
	if(vp->idx==0) {
		ucstring_printf(vr->s, DE_ENCODING_LATIN1, "page %d", (int)(vp->n+1));
		return 1;
	}
	if(vp->idx==1) {
		if(vp->n==0) {
			ucstring_append_sz(vr->s, "of an unknown number", DE_ENCODING_LATIN1);
		}
		else {
			ucstring_printf(vr->s, DE_ENCODING_LATIN1, "of %d", (int)vp->n);
		}
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x1312b0
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
addq $0x1, %rax
movl %eax, %ecx
movl $0x5, %esi
leaq 0x9bfea(%rip), %rdx     # 0x1cd28a
movb $0x0, %al
callq 0x171660
movl $0x1, -0x4(%rbp)
jmp 0x131314
movq -0x18(%rbp), %rax
cmpq $0x1, 0x10(%rax)
jne 0x13130d
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x1312e0
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq 0x999fa(%rip), %rsi     # 0x1cacce
movl $0x5, %edx
callq 0x1715e0
jmp 0x131304
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %ecx
movl $0x5, %esi
leaq 0x6fa39(%rip), %rdx     # 0x1a0d36
movb $0x0, %al
callq 0x171660
movl $0x1, -0x4(%rbp)
jmp 0x131314
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_subifd
static void handler_subifd(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	i64 j;
	i64 tmpoffset;
	u8 ifdtype = IFDTYPE_NORMAL;

	if(d->fmt==DE_TIFFFMT_NIKONMN && tg->tagnum==0x11) ifdtype = IFDTYPE_NIKONPREVIEW;
	else if(tg->tagnum==330) ifdtype = IFDTYPE_SUBIFD;
	else if(tg->tagnum==400) ifdtype = IFDTYPE_GLOBALPARAMS;
	else if(tg->tagnum==34665) ifdtype = IFDTYPE_EXIF;
	else if(tg->tagnum==34731) ifdtype = IFDTYPE_MASKSUBIFD;
	else if(tg->tagnum==34853) ifdtype = IFDTYPE_GPS;
	else if(tg->tagnum==40965) ifdtype = IFDTYPE_EXIFINTEROP;

	for(j=0; j<tg->valcount;j++) {
		read_tag_value_as_int64(c, d, tg, j, &tmpoffset);
		de_dbg(c, "offset of %s: %d", tni->tagname, (int)tmpoffset);
		push_ifd(c, d, tmpoffset, ifdtype, 0);
	}
}

// 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)
movb $0x0, -0x31(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x9, 0x4(%rax)
jne 0x1315f6
movq -0x18(%rbp), %rax
cmpl $0x11, 0x8(%rax)
jne 0x1315f6
movb $0x7, -0x31(%rbp)
jmp 0x131672
movq -0x18(%rbp), %rax
cmpl $0x14a, 0x8(%rax)       # imm = 0x14A
jne 0x131609
movb $0x1, -0x31(%rbp)
jmp 0x131670
movq -0x18(%rbp), %rax
cmpl $0x190, 0x8(%rax)       # imm = 0x190
jne 0x13161c
movb $0x5, -0x31(%rbp)
jmp 0x13166e
movq -0x18(%rbp), %rax
cmpl $0x8769, 0x8(%rax)      # imm = 0x8769
jne 0x13162f
movb $0x2, -0x31(%rbp)
jmp 0x13166c
movq -0x18(%rbp), %rax
cmpl $0x87ab, 0x8(%rax)      # imm = 0x87AB
jne 0x131642
movb $0x9, -0x31(%rbp)
jmp 0x13166a
movq -0x18(%rbp), %rax
cmpl $0x8825, 0x8(%rax)      # imm = 0x8825
jne 0x131655
movb $0x4, -0x31(%rbp)
jmp 0x131668
movq -0x18(%rbp), %rax
cmpl $0xa005, 0x8(%rax)      # imm = 0xA005
jne 0x131666
movb $0x3, -0x31(%rbp)
jmp 0x131668
jmp 0x13166a
jmp 0x13166c
jmp 0x13166e
jmp 0x131670
jmp 0x131672
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jge 0x1316e7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq -0x30(%rbp), %r8
callq 0x132fa0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x30(%rbp), %rax
movl %eax, %ecx
leaq 0x9968b(%rip), %rsi     # 0x1cad45
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
xorl %r8d, %r8d
movzbl -0x31(%rbp), %ecx
callq 0x12e3a0
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x13167a
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_extrasamples
static void handler_extrasamples(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	struct page_ctx *pg = tg->pg;
	u8 i;

	pg->extrasamples_count = (u8)tg->valcount;
	if(pg->extrasamples_count>DE_TIFF_MAX_SAMPLES) {
		pg->extrasamples_count = DE_TIFF_MAX_SAMPLES;
	}

	for(i=0; i<pg->extrasamples_count; i++) {
		i64 val;

		read_tag_value_as_int64(c, d, tg, 0, &val);
		pg->extrasample_type[(size_t)i] = (u8)val;
	}
}

// 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 -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, 0x9c(%rax)
movq -0x28(%rbp), %rax
movzbl 0x9c(%rax), %eax
cmpl $0xa, %eax
jle 0x131782
movq -0x28(%rbp), %rax
movb $0xa, 0x9c(%rax)
movb $0x0, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
movq -0x28(%rbp), %rcx
movzbl 0x9c(%rcx), %ecx
cmpl %ecx, %eax
jge 0x1317d1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
leaq -0x38(%rbp), %r8
callq 0x132fa0
movq -0x38(%rbp), %rax
movb %al, %dl
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movb %dl, 0x9d(%rax,%rcx)
movb -0x29(%rbp), %al
addb $0x1, %al
movb %al, -0x29(%rbp)
jmp 0x131786
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_matteing
static void handler_matteing(deark *c, lctx *d, const struct taginfo *tg,
	const struct tagnuminfo *tni)
{
	i64 val;

	if(tg->valcount<1) return;
	read_tag_value_as_int64(c, d, tg, 0, &val);
	if(val==1) {
		tg->pg->extrasamples_count = 1;
		tg->pg->extrasample_type[0] = 1; // = Assoc. alpha
	}
}

// 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 -0x18(%rbp), %rax
cmpq $0x1, 0x18(%rax)
jge 0x1319b5
jmp 0x1319f1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
leaq -0x28(%rbp), %r8
callq 0x132fa0
cmpq $0x1, -0x28(%rbp)
jne 0x1319f1
movq -0x18(%rbp), %rax
movq (%rax), %rax
movb $0x1, 0x9c(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movb $0x1, 0x9d(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_photoshoprsrc
static void handler_photoshoprsrc(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	de_dbg(c, "Photoshop resources at %d, len=%d",
		(int)tg->val_offset, (int)tg->total_size);
	de_dbg_indent(c, 1);
	fmtutil_handle_photoshop_rsrc(c, c->infile, tg->val_offset, tg->total_size,
		d->is_deark_8bim?0x2:0x0);
	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)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movl %eax, %ecx
leaq 0x99308(%rip), %rsi     # 0x1caddf
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), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x10(%rbp), %rax
movzbl 0x18(%rax), %r9d
xorl %r8d, %r8d
movl $0x2, %eax
cmpl $0x0, %r9d
cmovnel %eax, %r8d
callq 0x173bd0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: valdec_flash
static int valdec_flash(deark *c, const struct valdec_params *vp, struct valdec_result *vr)
{
	i64 v;

	ucstring_append_flags_item(vr->s, (vp->n&0x01)?"flash fired":"flash did not fire");

	v = (vp->n&0x06)>>1;
	if(v==0) ucstring_append_flags_item(vr->s, "no strobe return detection function");
	else if(v==2) ucstring_append_flags_item(vr->s, "strobe return light not detected");
	else if(v==3) ucstring_append_flags_item(vr->s, "strobe return light detected");

	v = (vp->n&0x18)>>3;
	if(v==1) ucstring_append_flags_item(vr->s, "compulsory flash firing");
	else if(v==2) ucstring_append_flags_item(vr->s, "compulsory flash suppression");
	else if(v==3) ucstring_append_flags_item(vr->s, "auto mode");

	ucstring_append_flags_item(vr->s, (vp->n&0x20)?"no flash function":"flash function present");

	if(vp->n&0x40) ucstring_append_flags_item(vr->s, "red eye reduction supported");

	if((vp->n & ~0x7f)!=0) {
		ucstring_append_flags_item(vr->s, "?");
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
andq $0x1, %rcx
leaq 0x9922b(%rip), %rsi     # 0x1cafa9
leaq 0x99218(%rip), %rax     # 0x1caf9d
cmpq $0x0, %rcx
cmovneq %rax, %rsi
callq 0x172680
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
andq $0x6, %rax
sarq %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x131dc1
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x99202(%rip), %rsi     # 0x1cafbc
callq 0x172680
jmp 0x131dfb
cmpq $0x2, -0x20(%rbp)
jne 0x131ddd
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x9920a(%rip), %rsi     # 0x1cafe0
callq 0x172680
jmp 0x131df9
cmpq $0x3, -0x20(%rbp)
jne 0x131df7
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x9920f(%rip), %rsi     # 0x1cb001
callq 0x172680
jmp 0x131df9
jmp 0x131dfb
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
andq $0x18, %rax
sarq $0x3, %rax
movq %rax, -0x20(%rbp)
cmpq $0x1, -0x20(%rbp)
jne 0x131e2b
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x991fa(%rip), %rsi     # 0x1cb01e
callq 0x172680
jmp 0x131e65
cmpq $0x2, -0x20(%rbp)
jne 0x131e47
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x991f6(%rip), %rsi     # 0x1cb036
callq 0x172680
jmp 0x131e63
cmpq $0x3, -0x20(%rbp)
jne 0x131e61
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x991f7(%rip), %rsi     # 0x1cb053
callq 0x172680
jmp 0x131e63
jmp 0x131e65
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
andq $0x20, %rcx
leaq 0x991f0(%rip), %rsi     # 0x1cb06f
leaq 0x991d7(%rip), %rax     # 0x1cb05d
cmpq $0x0, %rcx
cmovneq %rax, %rsi
callq 0x172680
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x131eb8
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x991d3(%rip), %rsi     # 0x1cb086
callq 0x172680
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
andq $-0x80, %rax
cmpq $0x0, %rax
je 0x131edd
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x85d55(%rip), %rsi     # 0x1b7c2d
callq 0x172680
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_makernote
static void handler_makernote(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	struct makernote_id_info *mni = NULL;

	mni = de_malloc(c, sizeof(struct makernote_id_info));
	identify_makernote(c, d, tg, mni);

	if(mni->mntype != 0) {
		de_dbg(c, "MakerNote identified as: %s", mni->name);
	}

	if(mni->mntype==MAKERNOTE_NIKON) {
		do_makernote_nikon(c, d, tg->val_offset, tg->total_size);
	}
	else if(mni->mntype==MAKERNOTE_APPLE_IOS) {
		do_makernote_apple_ios(c, d, tg->val_offset, tg->total_size);
	}
	else if(mni->mntype==MAKERNOTE_FUJIFILM) {
		do_makernote_fujifilm(c, d, tg->val_offset, tg->total_size);
	}
	else {
		handler_hexdump(c, d, tg, tni);
	}

	de_free(c, mni);
}

// 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 -0x8(%rbp), %rdi
movl $0x24, %esi
callq 0x15b780
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x134210
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x131f5a
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
addq $0x4, %rdx
leaq 0x9914f(%rip), %rsi     # 0x1cb0a2
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x131f82
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
callq 0x134380
jmp 0x131feb
movq -0x28(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x131faa
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
callq 0x134460
jmp 0x131fe9
movq -0x28(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x131fd2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
callq 0x134530
jmp 0x131fe7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x131bd0
jmp 0x131fe9
jmp 0x131feb
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x15b820
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_olepropset
static void handler_olepropset(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	de_dbg(c, "OLE property set storage dump at %"I64_FMT", len=%"I64_FMT,
		tg->val_offset, tg->total_size);
	de_dbg_indent(c, 1);
	de_run_module_by_id_on_slice2(c, "cfb", "T", c->infile, tg->val_offset, tg->total_size);
	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)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
leaq 0x98fa0(%rip), %rsi     # 0x1cb163
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), %rax
movq 0x20(%rax), %r8
movq -0x18(%rbp), %rax
movq 0x30(%rax), %r9
leaq 0x732b9(%rip), %rsi     # 0x1a54b4
leaq 0x823e1(%rip), %rdx     # 0x1b45e3
callq 0x15cab0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_37724
static void handler_37724(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	const char *codes;
	static const i64 siglen = 36;
	i64 dpos, dlen;
	int psdver = 0;

	if(tg->total_size<siglen) {
		;
	}
	else if(!dbuf_memcmp(c->infile, tg->val_offset, "Adobe Photoshop Document Data Block\0", (size_t)siglen)) {
		psdver = 1;
	}
	else if(!dbuf_memcmp(c->infile, tg->val_offset, "Adobe Photoshop Document Data V0002\0", (size_t)siglen)) {
		psdver = 2;
	}

	if(psdver==0) {
		detiff_warn(c, d, tg->pg, "Bad or unsupported ImageSourceData tag at %d", (int)tg->val_offset);
		goto done;
	}

	de_dbg(c, "ImageSourceData signature at %d, PSD version=%d", (int)tg->val_offset, psdver);

	dpos = tg->val_offset + siglen;
	dlen = tg->total_size - siglen;
	de_dbg(c, "ImageSourceData blocks at %d, len=%d", (int)dpos, (int)dlen);

	codes = (psdver==2)? "B" : "T";
	de_dbg_indent(c, 1);
	de_run_module_by_id_on_slice2(c, "psd", codes, c->infile, dpos, dlen);
	de_dbg_indent(c, -1);
done:
	;
}

// 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 $0x0, -0x3c(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x24, 0x30(%rax)
jge 0x13224c
jmp 0x1322ac
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
leaq 0x96345(%rip), %rdx     # 0x1c85a8
movl $0x24, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x13227b
movl $0x1, -0x3c(%rbp)
jmp 0x1322aa
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
leaq 0x9633b(%rip), %rdx     # 0x1c85cd
movl $0x24, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x1322a8
movl $0x2, -0x3c(%rbp)
jmp 0x1322aa
jmp 0x1322ac
cmpl $0x0, -0x3c(%rbp)
jne 0x1322df
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %r8d
leaq 0x98ebe(%rip), %rcx     # 0x1cb191
movb $0x0, %al
callq 0x12dfd0
jmp 0x132398
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, %edx
movl -0x3c(%rbp), %ecx
leaq 0x98ec7(%rip), %rsi     # 0x1cb1be
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
addq $0x24, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
subq $0x24, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
movq -0x38(%rbp), %rax
movl %eax, %ecx
leaq 0x98eb9(%rip), %rsi     # 0x1cb1ee
movb $0x0, %al
callq 0x15b0d0
movl -0x3c(%rbp), %edx
leaq 0x8229d(%rip), %rax     # 0x1b45e3
leaq 0x98c19(%rip), %rcx     # 0x1caf66
cmpl $0x2, %edx
cmoveq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
leaq 0x8c4da(%rip), %rsi     # 0x1be85f
callq 0x15cab0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_utf16
static void handler_utf16(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	de_ucstring *s = NULL;

	if(tg->datatype!=DATATYPE_BYTE && tg->datatype!=DATATYPE_UNDEF) goto done;
	if(tg->total_size % 2) goto done; // Something's wrong if the byte count is odd.

	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, tg->val_offset, tg->total_size,
		DE_TIFF_MAX_CHARS_TO_PRINT*2, s, 0, DE_ENCODING_UTF16LE);
	ucstring_truncate_at_NUL(s);
	de_dbg(c, "UTF-16 string: \"%s\"", ucstring_getpsz(s));

done:
	ucstring_destroy(s);
	return;
}

// 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 $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, 0xc(%rax)
je 0x1323d9
movq -0x18(%rbp), %rax
cmpl $0x7, 0xc(%rax)
je 0x1323d9
jmp 0x13245f
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movl $0x2, %ecx
cqto
idivq %rcx
cmpq $0x0, %rdx
je 0x1323f3
jmp 0x13245f
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x28(%rbp), %r8
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %r9d, %r9d
movl $0x3, (%rsp)
callq 0x166a40
movq -0x28(%rbp), %rdi
callq 0x1712b0
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x172500
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0x98dbb(%rip), %rsi     # 0x1cb213
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rdi
callq 0x171750
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_jxr_pixelformat
static void handler_jxr_pixelformat(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	u64 n1, n2;

	if(tg->total_size != 16) return;
	n1 = dbuf_getu64be(c->infile, tg->val_offset);
	n2 = dbuf_getu64be(c->infile, tg->val_offset+8);
	de_dbg(c, "id: 0x%016"U64_FMTx"%016"U64_FMTx, n1, n2);
}

// 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 -0x18(%rbp), %rax
cmpq $0x10, 0x30(%rax)
je 0x132c35
jmp 0x132c85
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x1659b0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
addq $0x8, %rsi
callq 0x1659b0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq 0x98937(%rip), %rsi     # 0x1cb5b5
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/tiff.c
// Function: handler_dngprivatedata
static void handler_dngprivatedata(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	struct de_stringreaderdata *srd;
	i64 nbytes_to_scan;

	nbytes_to_scan = tg->total_size;
	if(nbytes_to_scan>128) nbytes_to_scan=128;

	srd = dbuf_read_string(c->infile, tg->val_offset, nbytes_to_scan, nbytes_to_scan,
		DE_CONVFLAG_STOP_AT_NUL, DE_ENCODING_ASCII);
	if(srd->found_nul) {
		de_dbg(c, "identifier: \"%s\"", ucstring_getpsz(srd->str));
	}
	de_destroy_stringreaderdata(c, srd);
}

// 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 -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x80, -0x30(%rbp)
jle 0x132cf6
movq $0x80, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x30(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl $0x1, %r9d
movl %r9d, %r8d
callq 0x1664c0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, 0x34(%rax)
je 0x132d54
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x172500
movq -0x38(%rbp), %rdi
movq %rax, %rdx
leaq 0x8d399(%rip), %rsi     # 0x1c00e6
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x166830
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: handler_bplist
static void handler_bplist(deark *c, lctx *d, const struct taginfo *tg, const struct tagnuminfo *tni)
{
	if(tg->total_size>=40 &&
		!dbuf_memcmp(c->infile, tg->val_offset, "bplist", 6))
	{
		de_dbg(c, "binary .plist at %"I64_FMT", len=%"I64_FMT, tg->val_offset, tg->total_size);
		de_dbg_indent(c, 1);
		fmtutil_handle_plist(c, c->infile, tg->val_offset, tg->total_size, NULL, 0x0);
		de_dbg_indent(c, -1);
	}
	else {
		handler_hexdump(c, d, tg, tni);
	}
}

// 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)
movq -0x18(%rbp), %rax
cmpq $0x28, 0x30(%rax)
jl 0x132f26
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
leaq 0x92a14(%rip), %rdx     # 0x1c58c2
movl $0x6, %ecx
callq 0x166ab0
cmpl $0x0, %eax
jne 0x132f26
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
leaq 0x9874e(%rip), %rsi     # 0x1cb626
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), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
xorl %eax, %eax
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x173c10
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
jmp 0x132f3b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x131bd0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: read_tag_value_as_double
static int read_tag_value_as_double(deark *c, lctx *d, const struct taginfo *tg,
	i64 value_index, double *n)
{
	i64 offs;

	*n = 0.0;
	if(value_index<0 || value_index>=tg->valcount) return 0;
	offs = tg->val_offset + value_index*tg->unit_size;

	switch(tg->datatype) {
	case DATATYPE_RATIONAL:
		return read_rational_as_double(c, d, offs, n);
	case DATATYPE_SRATIONAL:
		return read_srational_as_double(c, d, offs, n);
	case DATATYPE_FLOAT32:
		if(!d->can_decode_fltpt) return 0;
		*n = dbuf_getfloat32x(c->infile, offs, d->is_le);
		return 1;
	case DATATYPE_FLOAT64:
		if(!d->can_decode_fltpt) return 0;
		*n = dbuf_getfloat64x(c->infile, offs, d->is_le);
		return 1;

		// There should be no need to support other data types (like UINT32).
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x30(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
cmpq $0x0, -0x28(%rbp)
jl 0x13322c
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jl 0x133238
movl $0x0, -0x4(%rbp)
jmp 0x133334
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq 0x20(%rdx), %rax
movq 0x28(%rdx), %rdx
imulq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
addl $-0x5, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x7, %eax
ja 0x13332d
movq -0x40(%rbp), %rax
leaq 0x95081(%rip), %rcx     # 0x1c82f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x133340
movl %eax, -0x4(%rbp)
jmp 0x133334
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x1333e0
movl %eax, -0x4(%rbp)
jmp 0x133334
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x1332ca
movl $0x0, -0x4(%rbp)
jmp 0x133334
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rax
movl (%rax), %edx
callq 0x165e00
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x133334
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x133305
movl $0x0, -0x4(%rbp)
jmp 0x133334
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rax
movl (%rax), %edx
callq 0x165f20
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x133334
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: read_rational_as_double
static int read_rational_as_double(deark *c, lctx *d, i64 pos, double *n)
{
	i64 num, den;

	*n = 0.0;
	num = dbuf_getu32x(c->infile, pos, d->is_le);
	den = dbuf_getu32x(c->infile, pos+4, d->is_le);
	if(den==0) return 0;
	*n = (double)num/(double)den;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movl (%rax), %edx
callq 0x1658c0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
movq -0x18(%rbp), %rax
movl (%rax), %edx
callq 0x1658c0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1333ad
movl $0x0, -0x4(%rbp)
jmp 0x1333cc
cvtsi2sdq -0x30(%rbp), %xmm0
cvtsi2sdq -0x38(%rbp), %xmm1
divsd %xmm1, %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: read_srational_as_double
static int read_srational_as_double(deark *c, lctx *d, i64 pos, double *n)
{
	i64 num, den;

	*n = 0.0;
	num = dbuf_geti32x(c->infile, pos, d->is_le);
	den = dbuf_geti32x(c->infile, pos+4, d->is_le);
	if(den==0) return 0;
	*n = (double)num/(double)den;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movl (%rax), %edx
callq 0x165910
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
movq -0x18(%rbp), %rax
movl (%rax), %edx
callq 0x165910
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x13344d
movl $0x0, -0x4(%rbp)
jmp 0x13346c
cvtsi2sdq -0x30(%rbp), %xmm0
cvtsi2sdq -0x38(%rbp), %xmm1
divsd %xmm1, %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: lookup_str
static const char *lookup_str(const struct int_and_str *items, size_t num_items, i64 n)
{
	i64 i;

	for(i=0; i<(i64)num_items; i++) {
		if(items[i].n==n && items[i].s!=NULL) {
			return items[i].s;
		}
	}
	return "?";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x133549
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
cmpq -0x20(%rbp), %rax
jne 0x133539
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0x133539
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x133554
jmp 0x13353b
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1334e8
leaq 0x846dd(%rip), %rax     # 0x1b7c2d
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: find_cmpr_meth_info
static const struct cmpr_meth_info *find_cmpr_meth_info(u32 id)
{
	size_t k;

	for(k=0; k<DE_ARRAYCOUNT(cmpr_meth_info_arr); k++) {
		if(id == cmpr_meth_info_arr[k].id)
			return &cmpr_meth_info_arr[k];
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x21, -0x18(%rbp)
jae 0x1335b1
movl -0xc(%rbp), %eax
leaq 0xeee30(%rip), %rcx     # 0x2223b0
imulq $0x18, -0x18(%rbp), %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x1335a1
leaq 0xeee1d(%rip), %rax     # 0x2223b0
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x1335b9
jmp 0x1335a3
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x13356f
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: decompress_strile_fax34
static void decompress_strile_fax34(deark *c, lctx *d, struct page_ctx *pg,
	struct decode_page_ctx *dctx)
{
	struct de_fax34_params fax34params;

	de_zeromem(&fax34params, sizeof(struct de_fax34_params));
	fax34params.image_width = dctx->strileset_width;
	fax34params.image_height = dctx->strileset_height;
	fax34params.tiff_cmpr_meth = (UI)pg->compression;
	fax34params.t4options = pg->t4options;
	fax34params.t6options = pg->t6options;
	fax34params.is_lsb = (pg->fill_order==2)?1:0;

	fmtutil_fax34_codectype1(c, &dctx->dcmpri, &dctx->dcmpro, &dctx->dres,
		 (void*)&fax34params);
}

// 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 -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x19140
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl 0x48(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl 0x4c(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movl 0x34(%rax), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x2, %edx
cmovel %ecx, %eax
movb %al, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0xe8, %rsi
movq -0x20(%rbp), %rdx
addq $0x108, %rdx            # imm = 0x108
movq -0x20(%rbp), %rcx
addq $0x120, %rcx            # imm = 0x120
leaq -0x48(%rbp), %r8
callq 0x17d920
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: decompress_strile_lzw
static void decompress_strile_lzw(deark *c, lctx *d, struct page_ctx *pg,
	struct decode_page_ctx *dctx)
{
	struct de_lzw_params delzwp;

	if(dctx->dfctx) {
		de_dfilter_destroy(dctx->dfctx);
		dctx->dfctx = NULL;
		// TODO: Make the LZW decoder support DE_DFILTER_COMMAND_REINITIALIZE
	}

	de_zeromem(&delzwp, sizeof(struct de_lzw_params));
	delzwp.fmt =  (pg->is_old_lzw)?DE_LZWFMT_TIFFOLD:DE_LZWFMT_TIFFNEW;
	delzwp.max_code_size = 12;

	dctx->dfctx = de_dfilter_create(c, dfilter_lzw_codec, (void*)&delzwp, &dctx->dcmpro, &dctx->dres);

	de_dfilter_addslice(dctx->dfctx, dctx->dcmpri.f, dctx->dcmpri.pos, dctx->dcmpri.len);
	de_dfilter_finish(dctx->dfctx);
}

// 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 -0x20(%rbp), %rax
cmpq $0x0, 0xe0(%rax)
je 0x133725
movq -0x20(%rbp), %rax
movq 0xe0(%rax), %rdi
callq 0x177720
movq -0x20(%rbp), %rax
movq $0x0, 0xe0(%rax)
leaq -0x34(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x19140
movq -0x18(%rbp), %rax
movzbl 0x98(%rax), %edx
movl $0x6, %eax
movl $0x5, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x34(%rbp)
movl $0xc, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rcx
addq $0x108, %rcx            # imm = 0x108
movq -0x20(%rbp), %r8
addq $0x120, %r8             # imm = 0x120
leaq 0x50c85(%rip), %rsi     # 0x184400
leaq -0x34(%rbp), %rdx
callq 0x1775a0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0xe0(%rax)
movq -0x20(%rbp), %rax
movq 0xe0(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0xe8(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0xf0(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0xf8(%rax), %rcx
callq 0x177770
movq -0x20(%rbp), %rax
movq 0xe0(%rax), %rdi
callq 0x1776f0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: decompress_strile_packbits
static void decompress_strile_packbits(deark *c, lctx *d, struct page_ctx *pg,
	struct decode_page_ctx *dctx)
{
	if(dctx->dfctx) {
		de_dfilter_command(dctx->dfctx, DE_DFILTER_COMMAND_REINITIALIZE, 0);
	}
	else {
		dctx->dfctx = de_dfilter_create(c, dfilter_packbits_codec, NULL,
			&dctx->dcmpro, &dctx->dres);
	}

	de_dfilter_addslice(dctx->dfctx, dctx->dcmpri.f, dctx->dcmpri.pos, dctx->dcmpri.len);
	de_dfilter_finish(dctx->dfctx);
}

// 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)
movq -0x20(%rbp), %rax
cmpq $0x0, 0xe0(%rax)
je 0x13388f
movq -0x20(%rbp), %rax
movq 0xe0(%rax), %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x177690
jmp 0x1338c7
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rcx
addq $0x108, %rcx            # imm = 0x108
movq -0x20(%rbp), %r8
addq $0x120, %r8             # imm = 0x120
leaq 0x440c0(%rip), %rsi     # 0x177970
xorl %eax, %eax
movl %eax, %edx
callq 0x1775a0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0xe0(%rax)
movq -0x20(%rbp), %rax
movq 0xe0(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0xe8(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0xf0(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0xf8(%rax), %rcx
callq 0x177770
movq -0x20(%rbp), %rax
movq 0xe0(%rax), %rdi
callq 0x1776f0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: reverse_bits_in_membuf
static void reverse_bits_in_membuf(dbuf *f)
{
	i64 len = f->len;
	i64 i;

	dbuf_flush(f);
	len = f->len;

	for(i=0; i<len; i++) {
		u8 b, b2;
		size_t k;

		b = dbuf_getbyte(f, i);
		if(b==0x00 || b==0xff) continue;
		b2 = 0;
		for(k=0; k<8; k++) {
			if(b & (1U<<k)) {
				b2 |= (1U<<(7-k));
			}
		}
		dbuf_writebyte_at(f, i, b2);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x167c30
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jge 0x1339f3
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x165060
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x0, %eax
je 0x133977
movzbl -0x19(%rbp), %eax
cmpl $0xff, %eax
jne 0x133979
jmp 0x1339e2
movb $0x0, -0x1a(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x8, -0x28(%rbp)
jae 0x1339d1
movzbl -0x19(%rbp), %eax
movq -0x28(%rbp), %rcx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x1339c1
movl $0x7, %eax
subq -0x28(%rbp), %rax
movl %eax, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
movzbl -0x1a(%rbp), %eax
orl %ecx, %eax
movb %al, -0x1a(%rbp)
jmp 0x1339c3
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x133985
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movzbl -0x1a(%rbp), %edx
callq 0x168790
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x133945
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)