LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: alloc_striledata
static int alloc_striledata(deark *c, struct page_ctx *pg, i64 nstriles)
{
	if(nstriles<1) nstriles = 1;
	if(pg->strile_count >= nstriles) return 1;
	if(nstriles>DE_TIFF_MAX_STRILES) return 0;
	pg->strile_data = de_reallocarray(c, pg->strile_data, pg->strile_count, sizeof(struct strile_data_struct), nstriles);
	pg->strile_count = nstriles;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x1, -0x20(%rbp)
jge 0x133a23
movq $0x1, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0xb0(%rax), %rax
cmpq -0x20(%rbp), %rax
jl 0x133a3d
movl $0x1, -0x4(%rbp)
jmp 0x133a9c
cmpq $0x10000, -0x20(%rbp)   # imm = 0x10000
jle 0x133a50
movl $0x0, -0x4(%rbp)
jmp 0x133a9c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0xb8(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0xb0(%rax), %rdx
movq -0x20(%rbp), %r8
movl $0x10, %ecx
callq 0x15c4d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0xb8(%rax)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0xb0(%rax)
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: parse_tiff_datetime
static void parse_tiff_datetime(deark *c, lctx *d, const struct taginfo *tg, struct de_timestamp *ts)
{
	i64 yr, mo, da;
	i64 hr, mi, se;

	if(tg->unit_size!=1) return;
	if(tg->valcount<19) return;
	// Format: "YYYY:MM:DD HH:MM:SS"
	yr = read_fixed_decimal(c->infile, tg->val_offset, 4);
	mo = read_fixed_decimal(c->infile, tg->val_offset+5, 2);
	da = read_fixed_decimal(c->infile, tg->val_offset+8, 2);
	hr = read_fixed_decimal(c->infile, tg->val_offset+11, 2);
	mi = read_fixed_decimal(c->infile, tg->val_offset+14, 2);
	se = read_fixed_decimal(c->infile, tg->val_offset+17, 2);
	de_make_timestamp(ts, yr, mo, da, hr, mi, se);
	if(ts->is_valid) {
		ts->tzcode = DE_TZCODE_UNKNOWN;
		ts->precision = DE_TSPREC_1SEC;
	}
}

// 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 -0x18(%rbp), %rax
cmpq $0x1, 0x28(%rax)
je 0x133e08
jmp 0x133f1e
movq -0x18(%rbp), %rax
cmpq $0x13, 0x18(%rax)
jge 0x133e18
jmp 0x133f1e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
movl $0x4, %edx
callq 0x133f30
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
addq $0x5, %rsi
movl $0x2, %edx
callq 0x133f30
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
addq $0x8, %rsi
movl $0x2, %edx
callq 0x133f30
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
addq $0xb, %rsi
movl $0x2, %edx
callq 0x133f30
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
addq $0xe, %rsi
movl $0x2, %edx
callq 0x133f30
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
addq $0x11, %rsi
movl $0x2, %edx
callq 0x133f30
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %r9
movq -0x50(%rbp), %rax
movq %rax, (%rsp)
callq 0x15d830
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x133f1e
movq -0x20(%rbp), %rax
movb $0x0, 0x1(%rax)
movq -0x20(%rbp), %rax
movb $0x1e, 0x2(%rax)
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: read_fixed_decimal
static i64 read_fixed_decimal(dbuf *f, i64 pos, size_t ndigits)
{
	i64 n;
	char buf[16];

	if(ndigits >= sizeof(buf)) return 0;
	dbuf_read(f, (u8*)buf, pos, ndigits);
	buf[ndigits] = '\0';
	n = de_atoi64(buf);
	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x10, -0x20(%rbp)
jb 0x133f55
movq $0x0, -0x8(%rbp)
jmp 0x133f88
movq -0x10(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x164d10
movq -0x20(%rbp), %rax
movb $0x0, -0x40(%rbp,%rax)
leaq -0x40(%rbp), %rdi
callq 0x15ccc0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: check_for_8bit_pal
static int check_for_8bit_pal(deark *c, lctx *d, const struct taginfo *tg, i64 num_entries)
{
	i64 i;
	i64 num_samples;
	u8 found_dark = 0;

	if(num_entries<2 || num_entries>256) return 0;
	num_samples = num_entries*3;
	if(num_samples > tg->valcount) return 0;

	for(i=0; i<num_samples; i++) {
		i64 s;

		read_tag_value_as_int64(c, d, tg, i, &s);
		if(s>=256) return 0;
		if(s>1) found_dark = 1;
	}
	if(found_dark) return 1;
	return 0; // All colors are black
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movb $0x0, -0x39(%rbp)
cmpq $0x2, -0x28(%rbp)
jl 0x133fcd
cmpq $0x100, -0x28(%rbp)     # imm = 0x100
jle 0x133fd9
movl $0x0, -0x4(%rbp)
jmp 0x134068
imulq $0x3, -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jle 0x133ff9
movl $0x0, -0x4(%rbp)
jmp 0x134068
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
jge 0x134052
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %rcx
leaq -0x48(%rbp), %r8
callq 0x132fa0
cmpq $0x100, -0x48(%rbp)     # imm = 0x100
jl 0x134037
movl $0x0, -0x4(%rbp)
jmp 0x134068
cmpq $0x1, -0x48(%rbp)
jle 0x134042
movb $0x1, -0x39(%rbp)
jmp 0x134044
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x134001
cmpb $0x0, -0x39(%rbp)
je 0x134061
movl $0x1, -0x4(%rbp)
jmp 0x134068
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: do_leaf_metadata
static void do_leaf_metadata(deark *c, lctx *d, i64 pos1, i64 len)
{
	i64 pos;
	u8 buf[4];
	u8 segtype[40];
	i64 data_len;

	if(len<1) return;
	if(pos1+len > c->infile->len) return;
	de_dbg(c, "leaf metadata at %d size=%d", (int)pos1, (int)len);

	// This format appears to be hierarchical, but for now we only care about
	// the top level.

	pos = pos1;
	while(pos < pos1+len) {
		de_read(buf, pos, 4);
		if(de_memcmp(buf, "PKTS", 4)) {
			break;
		}
		pos+=4;

		pos+=4; // Don't know what these 4 bytes are for.

		de_read(segtype, pos, 40);
		pos+=40;

		// TODO: Is this always big-endian?
		data_len = de_getu32be(pos);
		pos+=4;

		if(!de_memcmp(segtype, "JPEG_preview_data\0", 18)) {
			de_dbg(c, "jpeg preview at %d len=%d", (int)pos, (int)data_len);
			dbuf_create_file_from_slice(c->infile, pos, data_len, "leafthumb.jpg", NULL, DE_CREATEFLAG_IS_AUX);
		}
		pos += data_len;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x1, -0x20(%rbp)
jge 0x1340a4
jmp 0x1341fe
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x1340bf
jmp 0x1341fe
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movl %eax, %ecx
leaq 0x96cc0(%rip), %rsi     # 0x1cad96
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jge 0x1341fe
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x2c(%rbp), %rsi
movq -0x28(%rbp), %rdx
movl $0x4, %ecx
callq 0x164d10
leaq -0x2c(%rbp), %rax
movl (%rax), %eax
subl $0x53544b50, %eax       # imm = 0x53544B50
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x13412f
jmp 0x1341fe
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x60(%rbp), %rsi
movq -0x28(%rbp), %rdx
movl $0x28, %ecx
callq 0x164d10
movq -0x28(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x165470
movq %rax, -0x68(%rbp)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
leaq -0x60(%rbp), %rdi
leaq 0x943c3(%rip), %rsi     # 0x1c855c
movl $0x12, %edx
callq 0x19170
cmpl $0x0, %eax
jne 0x1341ed
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
movq -0x68(%rbp), %rax
movl %eax, %ecx
leaq 0x96bf8(%rip), %rsi     # 0x1cadb7
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq 0x96bf4(%rip), %rcx     # 0x1cadd1
xorl %eax, %eax
movl %eax, %r8d
movl $0x1, %r9d
callq 0x166be0
movq -0x68(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x1340e5
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: identify_makernote
static void identify_makernote(deark *c, lctx *d, const struct taginfo *tg, struct makernote_id_info *mni)
{
	u8 buf[32];
	i64 amt_to_read;

	de_zeromem(buf, sizeof(buf));
	amt_to_read = sizeof(buf);
	if(amt_to_read > tg->total_size) amt_to_read = tg->total_size;
	de_read(buf, tg->val_offset, amt_to_read);

	if(!de_memcmp(buf, "Nikon\x00\x02", 7) &&
		(!de_memcmp(&buf[10], "\x4d\x4d\x00\x2a", 4) ||
		!de_memcmp(&buf[10], "\x49\x49\x2a\x00", 4)))
	{
		// This is one Nikon MakerNote format. There are others.
		mni->mntype = MAKERNOTE_NIKON;
		de_strlcpy(mni->name, "Nikon type 3", sizeof(mni->name));
		goto done;
	}
	else if(!de_memcmp(buf, "Apple iOS\x00\x00\x01\x4d\x4d", 14)) {
		mni->mntype = MAKERNOTE_APPLE_IOS;
		de_strlcpy(mni->name, "Apple iOS", sizeof(mni->name));
		goto done;
	}
	else if(!de_memcmp(buf, "FUJIFILM", 8)) {
		mni->mntype = MAKERNOTE_FUJIFILM;
		de_strlcpy(mni->name, "FujiFilm", sizeof(mni->name));
		goto done;
	}

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)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x19140
movq $0x20, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jle 0x13425a
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x48(%rbp), %rcx
callq 0x164d10
leaq -0x40(%rbp), %rdi
leaq 0x94396(%rip), %rsi     # 0x1c8618
movl $0x7, %edx
callq 0x19170
cmpl $0x0, %eax
jne 0x1342ed
leaq -0x40(%rbp), %rax
addq $0xa, %rax
movl (%rax), %eax
subl $0x2a004d4d, %eax       # imm = 0x2A004D4D
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x1342c5
leaq -0x40(%rbp), %rax
addq $0xa, %rax
movl (%rax), %eax
subl $0x2a4949, %eax         # imm = 0x2A4949
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1342ed
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
movq -0x20(%rbp), %rdi
addq $0x4, %rdi
leaq 0x96de0(%rip), %rsi     # 0x1cb0be
movl $0x20, %edx
callq 0x15aa30
jmp 0x134376
leaq -0x40(%rbp), %rdi
leaq 0x94281(%rip), %rsi     # 0x1c8579
movl $0xe, %edx
callq 0x19170
cmpl $0x0, %eax
jne 0x13432c
movq -0x20(%rbp), %rax
movl $0x2, (%rax)
movq -0x20(%rbp), %rdi
addq $0x4, %rdi
leaq 0x96dab(%rip), %rsi     # 0x1cb0cb
movl $0x20, %edx
callq 0x15aa30
jmp 0x134376
leaq -0x40(%rbp), %rax
movq (%rax), %rax
movabsq $0x4d4c4946494a5546, %rcx # imm = 0x4D4C4946494A5546
subq %rcx, %rax
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x134370
movq -0x20(%rbp), %rax
movl $0x3, (%rax)
movq -0x20(%rbp), %rdi
addq $0x4, %rdi
leaq 0x96d7a(%rip), %rsi     # 0x1cb0de
movl $0x20, %edx
callq 0x15aa30
jmp 0x134376
jmp 0x134372
jmp 0x134374
jmp 0x134376
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: do_makernote_nikon
static void do_makernote_nikon(deark *c, lctx *d, i64 pos1, i64 len)
{
	i64 dpos;
	i64 dlen;
	unsigned int ver;

	if(len<10) return;
	ver = (unsigned int)de_getu16be(pos1+6);
	de_dbg(c, "version: 0x%04x", ver); // This is a guess

	dpos = pos1+10;
	dlen = len-10;
	if(dlen<8) return;
	de_dbg(c, "Nikon MakerNote tag data at %d, len=%d", (int)dpos, (int)dlen);
	de_dbg_indent(c, 1);
	de_run_module_by_id_on_slice2(c, "tiff", "N", c->infile, dpos, dlen);
	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)
cmpq $0xa, -0x20(%rbp)
jge 0x1343a4
jmp 0x134453
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x6, %rsi
callq 0x1651d0
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %edx
leaq 0x8ca79(%rip), %rsi     # 0x1c0e43
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
addq $0xa, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
subq $0xa, %rax
movq %rax, -0x30(%rbp)
cmpq $0x8, -0x30(%rbp)
jge 0x1343f2
jmp 0x134453
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
movq -0x30(%rbp), %rax
movl %eax, %ecx
leaq 0x96cde(%rip), %rsi     # 0x1cb0e7
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 -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
leaq 0xa1b07(%rip), %rsi     # 0x1d5f40
leaq 0x6b9bc(%rip), %rdx     # 0x19fdfc
callq 0x15cab0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: do_makernote_apple_ios
static void do_makernote_apple_ios(deark *c, lctx *d, i64 pos1, i64 len)
{
	unsigned int ver;

	if(len<12) return;
	ver = (unsigned int)de_getu16be(pos1+10);
	de_dbg(c, "version: 0x%04x", ver); // This is a guess
	if(ver!=1) return;
	if(len<20) return;

	// Apple iOS offsets are relative to the beginning of the "Apple iOS"
	// signature, so that's the data we'll pass to the submodule.
	de_dbg(c, "Apple MakerNote tag data at %"I64_FMT", len=%"I64_FMT, pos1, len);
	de_dbg_indent(c, 1);
	de_run_module_by_id_on_slice2(c, "tiff", "A", c->infile, pos1, len);
	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)
cmpq $0xc, -0x20(%rbp)
jge 0x134484
jmp 0x13451f
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0xa, %rsi
callq 0x1651d0
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq 0x8c999(%rip), %rsi     # 0x1c0e43
movb $0x0, %al
callq 0x15b0d0
cmpl $0x1, -0x24(%rbp)
je 0x1344b9
jmp 0x13451f
cmpq $0x14, -0x20(%rbp)
jge 0x1344c2
jmp 0x13451f
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0x96c39(%rip), %rsi     # 0x1cb10e
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
movq -0x20(%rbp), %r9
leaq 0xa1a3b(%rip), %rsi     # 0x1d5f40
leaq 0x96a49(%rip), %rdx     # 0x1caf55
callq 0x15cab0
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: do_makernote_fujifilm
static void do_makernote_fujifilm(deark *c, lctx *d, i64 pos1, i64 len)
{
	if(len<14) return;

	de_dbg(c, "FujiFilm MakerNote tag data at %"I64_FMT", len=%"I64_FMT, pos1, len);
	de_dbg_indent(c, 1);
	de_run_module_by_id_on_slice2(c, "tiff", "F", c->infile, pos1, 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 %rcx, -0x20(%rbp)
cmpq $0xe, -0x20(%rbp)
jge 0x134551
jmp 0x1345ae
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0x96bd3(%rip), %rsi     # 0x1cb137
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
movq -0x20(%rbp), %r9
leaq 0xa19ac(%rip), %rsi     # 0x1d5f40
leaq 0x82eba(%rip), %rdx     # 0x1b7455
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/tiff.c
// Function: do_dbg_print_text_single_value
static void do_dbg_print_text_single_value(deark *c, lctx *d, const struct taginfo *tg,
	const struct tagnuminfo *tni, de_ucstring *dbgline)
{
	struct de_stringreaderdata *srd = NULL;
	de_encoding enc;

	enc = (tg->datatype==DATATYPE_UTF8) ? DE_ENCODING_UTF8 : d->current_textfield_encoding;

	srd = dbuf_read_string(c->infile, tg->val_offset, tg->total_size,
		DE_TIFF_MAX_CHARS_TO_PRINT, DE_CONVFLAG_STOP_AT_NUL, enc);

	ucstring_append_sz(dbgline, " {\"", DE_ENCODING_LATIN1);
	ucstring_append_ucstring(dbgline, srd->str);
	if(srd->was_truncated) {
		ucstring_append_sz(dbgline, "...", DE_ENCODING_LATIN1);
	}
	ucstring_append_sz(dbgline, "\"}", DE_ENCODING_LATIN1);

	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 %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x81, 0xc(%rax)
jne 0x13494b
movl $0x2, %eax
movl %eax, -0x38(%rbp)
jmp 0x134955
movq -0x10(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x34(%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
movl -0x34(%rbp), %r9d
movl $0x1f4, %ecx            # imm = 0x1F4
movl $0x1, %r8d
callq 0x1664c0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x96cb1(%rip), %rsi     # 0x1cb647
movl $0x5, %edx
callq 0x1715e0
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x171460
movq -0x30(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0x1349d0
movq -0x28(%rbp), %rdi
leaq 0x9d683(%rip), %rsi     # 0x1d2049
movl $0x5, %edx
callq 0x1715e0
movq -0x28(%rbp), %rdi
leaq 0x96c70(%rip), %rsi     # 0x1cb64b
movl $0x5, %edx
callq 0x1715e0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x166830
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: do_oldjpeg
static void do_oldjpeg(deark *c, lctx *d, struct page_ctx *pg)
{
	const char *extension;
	unsigned int createflags;
	i64 jpeglength = pg->jpeglength;

	if(pg->jpegoffset==0) return;
	if(!pg->have_jpeglength) {
		// Missing JPEGInterchangeFormatLength tag. Assume it goes to the end
		// of the file.
		jpeglength = c->infile->len - pg->jpegoffset;
	}
	if(jpeglength<1 || jpeglength>DE_MAX_SANE_OBJECT_SIZE) {
		return;
	}

	// Note that the position & length have already been validated, in
	// postprocess_ifd_tags().

	if(dbuf_memcmp(c->infile, pg->jpegoffset, "\xff\xd8\xff", 3)) {
		detiff_warn(c, d, pg, "Expected JPEG data at %"I64_FMT" not found", pg->jpegoffset);
		return;
	}

	// Found an embedded JPEG image or thumbnail that we can extract.
	if(d->is_exif_submodule) {
		extension = "exifthumb.jpg";
		createflags = DE_CREATEFLAG_IS_AUX;
	}
	else if(d->fmt==DE_TIFFFMT_NIKONMN) {
		extension = "nikonthumb.jpg";
		createflags = DE_CREATEFLAG_IS_AUX;
	}
	else {
		extension = "jpg";
		// TODO: Should createflags be set to DE_CREATEFLAG_IS_AUX in some cases?
		createflags = 0;
	}
	dbuf_create_file_from_slice(c->infile, pg->jpegoffset, jpeglength, extension, NULL, createflags);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x70(%rax)
jne 0x134c20
jmp 0x134d18
movq -0x18(%rbp), %rax
cmpb $0x0, 0x12(%rax)
jne 0x134c42
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
subq 0x70(%rcx), %rax
movq %rax, -0x30(%rbp)
cmpq $0x1, -0x30(%rbp)
jl 0x134c53
cmpq $0x5f5e100, -0x30(%rbp) # imm = 0x5F5E100
jle 0x134c58
jmp 0x134d18
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rsi
leaq 0x6b71f(%rip), %rdx     # 0x1a038e
movl $0x3, %ecx
callq 0x166ab0
cmpl $0x0, %eax
je 0x134ca2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x70(%rax), %r8
leaq 0x96b64(%rip), %rcx     # 0x1cb7fd
movb $0x0, %al
callq 0x12dfd0
jmp 0x134d18
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x134cc0
leaq 0x96b6e(%rip), %rax     # 0x1cb821
movq %rax, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
jmp 0x134cf2
movq -0x10(%rbp), %rax
cmpl $0x9, 0x4(%rax)
jne 0x134cde
leaq 0x96b5e(%rip), %rax     # 0x1cb82f
movq %rax, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
jmp 0x134cf0
leaq 0x8a614(%rip), %rax     # 0x1bf2f9
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
jmp 0x134cf2
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rsi
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r9d
xorl %eax, %eax
movl %eax, %r8d
callq 0x166be0
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: is_image_ifd
static int is_image_ifd(deark *c, lctx *d, struct page_ctx *pg)
{
	if(d->fmt==DE_TIFFFMT_JPEGXR) {
		return pg->have_jxr_imageoffset;
	}

	if(!pg->have_imagewidth || pg->imagewidth<1 || pg->imagelength<1) {
		return 0;
	}

	// The Exif spec says of ImageWidth: "In JPEG compressed data, this tag
	// shall not be used because a JPEG marker is used instead".
	// However, a fair number of JPEG/Exif files use it anyway (in IFD#0).
	if(d->is_exif_submodule && pg->ifd_idx_in_main_list==0) {
		if(!pg->have_strip_tags && !pg->have_tile_tags && pg->jpegoffset==0) {
			return 0;
		}
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x7, 0x4(%rax)
jne 0x134dd7
movq -0x20(%rbp), %rax
movzbl 0x1b(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x134e45
movq -0x20(%rbp), %rax
cmpb $0x0, 0x11(%rax)
je 0x134df7
movq -0x20(%rbp), %rax
cmpq $0x1, 0x60(%rax)
jl 0x134df7
movq -0x20(%rbp), %rax
cmpq $0x1, 0x68(%rax)
jge 0x134e00
movl $0x0, -0x4(%rbp)
jmp 0x134e45
movq -0x18(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x134e3e
movq -0x20(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x134e3e
movq -0x20(%rbp), %rax
cmpb $0x0, 0x15(%rax)
jne 0x134e3c
movq -0x20(%rbp), %rax
cmpb $0x0, 0x16(%rax)
jne 0x134e3c
movq -0x20(%rbp), %rax
cmpq $0x0, 0x70(%rax)
jne 0x134e3c
movl $0x0, -0x4(%rbp)
jmp 0x134e45
jmp 0x134e3e
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: detect_lzw_version
static void detect_lzw_version(deark *c, lctx *d, struct page_ctx *pg)
{
	u8 buf[2];

	if(pg->strile_count<1) return;
	// The first LZW code is supposed to be a clear code (=256; 9 bits). If it is
	// LSB-first, presumably this is the old LZW version.
	// So old version should start: 00000000 xxxxxxx1
	// And new version:             10000000 0xxxxxxx
	de_read(buf, pg->strile_data[0].pos, 2);
	if(buf[0]==0x00 && (buf[1]&0x01)) {
		pg->is_old_lzw = 1;
	}
	de_dbg(c, "lzw version: %s", pg->is_old_lzw?"old":"new");
}

// 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
cmpq $0x1, 0xb0(%rax)
jge 0x135004
jmp 0x13507a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x1a(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0xb8(%rax), %rax
movq (%rax), %rdx
movl $0x2, %ecx
callq 0x164d10
movzbl -0x1a(%rbp), %eax
cmpl $0x0, %eax
jne 0x135048
movzbl -0x19(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x135048
movq -0x18(%rbp), %rax
movb $0x1, 0x98(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl 0x98(%rax), %ecx
leaq 0x74eaf(%rip), %rdx     # 0x1a9f0d
leaq 0x91067(%rip), %rax     # 0x1c60cc
cmpl $0x0, %ecx
cmovneq %rax, %rdx
leaq 0x967f3(%rip), %rsi     # 0x1cb866
movb $0x0, %al
callq 0x15b0d0
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: preprocess_fillorder_lsb
static void preprocess_fillorder_lsb(deark *c, lctx *d, struct page_ctx *pg,
	struct decode_page_ctx *dctx)
{
	if(pg->fill_order!=2) return;

	// FillOrder=LSB is ambiguous in general, but we allow it in some special cases.
	if(pg->compression==CMPR_NONE && pg->samples_per_pixel==1 && pg->bits_per_sample==1) {
		dctx->need_to_reverse_bits = 1;
		return;
	}

	if((pg->compression>=2 && pg->compression<=4) || pg->compression==32771) {
		return; // Fax compression - LSB is ok.
	}
	if(pg->compression==CMPR_LZW && pg->is_old_lzw) {
		// We detected that the LZW data in this image uses LSB bit order, so
		// this is probably ok.
		return;
	}

	if(pg->samples_per_pixel==1 && pg->bits_per_sample==4 &&
		(pg->compression==CMPR_NONE || pg->compression==CMPR_LZW))
	{
		// Many examples in the "FM Towns: Free Software Collection" items at
		// <http://discmaster.textfiles.com/cd-rom/>.

		detiff_warn(c, d, pg, "Ambiguous FillOrder for this image type");
		if(d->fillorder_strategy==0 || d->fillorder_strategy==2) {
			dctx->need_to_reverse_nibbles = 1;
		}
		return;
	}

	detiff_warn(c, d, pg, "Unexpected FillOrder for this image type. Ignoring.");
}

// 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
cmpl $0x2, 0x34(%rax)
je 0x1350a7
jmp 0x13519d
movq -0x18(%rbp), %rax
cmpl $0x1, 0x1c(%rax)
jne 0x1350d5
movq -0x18(%rbp), %rax
cmpl $0x1, 0x2c(%rax)
jne 0x1350d5
movq -0x18(%rbp), %rax
cmpl $0x1, 0x28(%rax)
jne 0x1350d5
movq -0x20(%rbp), %rax
movb $0x1, 0xd1(%rax)
jmp 0x13519d
movq -0x18(%rbp), %rax
cmpl $0x2, 0x1c(%rax)
jb 0x1350e9
movq -0x18(%rbp), %rax
cmpl $0x4, 0x1c(%rax)
jbe 0x1350f6
movq -0x18(%rbp), %rax
cmpl $0x8003, 0x1c(%rax)     # imm = 0x8003
jne 0x1350fb
jmp 0x13519d
movq -0x18(%rbp), %rax
cmpl $0x5, 0x1c(%rax)
jne 0x13511a
movq -0x18(%rbp), %rax
movzbl 0x98(%rax), %eax
cmpl $0x0, %eax
je 0x13511a
jmp 0x13519d
movq -0x18(%rbp), %rax
cmpl $0x1, 0x2c(%rax)
jne 0x135183
movq -0x18(%rbp), %rax
cmpl $0x4, 0x28(%rax)
jne 0x135183
movq -0x18(%rbp), %rax
cmpl $0x1, 0x1c(%rax)
je 0x135142
movq -0x18(%rbp), %rax
cmpl $0x5, 0x1c(%rax)
jne 0x135183
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x96721(%rip), %rcx     # 0x1cb876
movb $0x0, %al
callq 0x12dfd0
movq -0x10(%rbp), %rax
movzbl 0x16(%rax), %eax
cmpl $0x0, %eax
je 0x135176
movq -0x10(%rbp), %rax
movzbl 0x16(%rax), %eax
cmpl $0x2, %eax
jne 0x135181
movq -0x20(%rbp), %rax
movb $0x1, 0xd2(%rax)
jmp 0x13519d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x96708(%rip), %rcx     # 0x1cb89e
movb $0x0, %al
callq 0x12dfd0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: decompress_strileset
static int decompress_strileset(deark *c, lctx *d, struct page_ctx *pg,
	struct decode_page_ctx *dctx)
{
	UI sample_idx;
	int retval = 0;

	for(sample_idx=0; sample_idx<dctx->num_planes_to_decode; sample_idx++) {
		dctx->strile_idx = dctx->strileset_idx +(i64)sample_idx * dctx->striles_per_plane;
		retval = decompress_strile(c, d, pg, dctx, sample_idx);
		if(!retval) goto done;
	}
	retval = 1;
done:
	return retval;
}

// 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, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0xc0(%rcx), %eax
jae 0x135235
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rcx
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rdx
imulq 0x28(%rdx), %rax
addq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
callq 0x135960
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x135228
jmp 0x13523c
jmp 0x13522a
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1351d6
movl $0x1, -0x28(%rbp)
movl -0x28(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: set_image_density
static void set_image_density(deark *c, lctx *d, struct page_ctx *pg, de_finfo *fi)
{
	if(!pg->have_density) return;

	if(pg->orientation>=5 && pg->orientation<=8) {
		// For some orientations, the x dimension is the ImageLength dimension.
		fi->density.xdens = pg->density_ImageLength;
		fi->density.ydens = pg->density_ImageWidth;
	}
	else {
		fi->density.xdens = pg->density_ImageWidth;
		fi->density.ydens = pg->density_ImageLength;
	}
	if(pg->resolution_unit==1) {
		fi->density.code = DE_DENSITY_UNK_UNITS;
	}
	else if(pg->resolution_unit==2) {
		fi->density.code = DE_DENSITY_DPI;
	}
	else if(pg->resolution_unit==3) { // pixels/cm
		fi->density.xdens *= 2.54;
		fi->density.ydens *= 2.54;
		fi->density.code = DE_DENSITY_DPI;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, 0x14(%rax)
jne 0x135873
jmp 0x13595c
movq -0x18(%rbp), %rax
cmpl $0x5, 0x20(%rax)
jb 0x1358b3
movq -0x18(%rbp), %rax
cmpl $0x8, 0x20(%rax)
ja 0x1358b3
movq -0x18(%rbp), %rax
movsd 0x58(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x80(%rax)
movq -0x18(%rbp), %rax
movsd 0x50(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x88(%rax)
jmp 0x1358dd
movq -0x18(%rbp), %rax
movsd 0x50(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x80(%rax)
movq -0x18(%rbp), %rax
movsd 0x58(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x88(%rax)
movq -0x18(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x1358f4
movq -0x20(%rbp), %rax
movl $0x1, 0x78(%rax)
jmp 0x13595c
movq -0x18(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x13590b
movq -0x20(%rbp), %rax
movl $0x2, 0x78(%rax)
jmp 0x13595a
movq -0x18(%rbp), %rax
cmpl $0x3, 0x44(%rax)
jne 0x135958
movq -0x20(%rbp), %rax
movsd 0x92cef(%rip), %xmm0    # 0x1c8610
mulsd 0x80(%rax), %xmm0
movsd %xmm0, 0x80(%rax)
movq -0x20(%rbp), %rax
movsd 0x92cd3(%rip), %xmm0    # 0x1c8610
mulsd 0x88(%rax), %xmm0
movsd %xmm0, 0x88(%rax)
movq -0x20(%rbp), %rax
movl $0x2, 0x78(%rax)
jmp 0x13595a
jmp 0x13595c
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tiff.c
// Function: reverse_nibbles_in_membuf
static void reverse_nibbles_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;

		b = dbuf_getbyte(f, i);
		b2 = ((b & 0x0f)<<4) | (b>>4);
		dbuf_writebyte_at(f, i, b2);
	}

	dbuf_flush(f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %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 0x135c34
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x165060
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
andl $0xf, %eax
shll $0x4, %eax
movzbl -0x19(%rbp), %ecx
sarl $0x4, %ecx
orl %ecx, %eax
movb %al, -0x1a(%rbp)
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 0x135be5
movq -0x8(%rbp), %rdi
callq 0x167c30
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tim.c
// Function: de_module_tim
void de_module_tim(deark *c, struct deark_module_info *mi)
{
	mi->id = "tim";
	mi->desc = "PlayStation graphics";
	mi->run_fn = de_run_tim;
	mi->identify_fn = de_identify_tim;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x95d52(%rip), %rcx     # 0x1cb9b9
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x95d48(%rip), %rcx     # 0x1cb9bd
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x135ca0
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x1ed(%rip), %rcx       # 0x135e80
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tim.c
// Function: de_identify_tim
static int de_identify_tim(deark *c)
{
	i64 x;

	if(dbuf_memcmp(c->infile, 0, "\x10\x00\x00\x00", 4))
		return 0;

	x = de_getu32le(4);
	if(x<=3 || x==8 || x==9) {
		if(de_input_file_has_ext(c, "tim")) return 100;
		return 15;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x95b15(%rip), %rdx     # 0x1cb9b4
movl $0x4, %ecx
callq 0x166ab0
cmpl $0x0, %eax
je 0x135eb7
movl $0x0, -0x4(%rbp)
jmp 0x135f10
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
callq 0x165540
movq %rax, -0x18(%rbp)
cmpq $0x3, -0x18(%rbp)
jle 0x135ee2
cmpq $0x8, -0x18(%rbp)
je 0x135ee2
cmpq $0x9, -0x18(%rbp)
jne 0x135f09
movq -0x10(%rbp), %rdi
leaq 0x95acc(%rip), %rsi     # 0x1cb9b9
callq 0x15d180
cmpl $0x0, %eax
je 0x135f00
movl $0x64, -0x4(%rbp)
jmp 0x135f10
movl $0xf, -0x4(%rbp)
jmp 0x135f10
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/tim.c
// Function: do_read_palette
static void do_read_palette(deark *c, lctx *d, i64 pos, i64 ncolors)
{
	i64 k;
	u32 n1, n2;
	char tmps[32];

	de_dbg(c, "CLUT block at %d", (int)pos);
	de_dbg_indent(c, 1);

	for(k=0; k<ncolors && k<256; k++) {
		n1 = (u32)de_getu16le(pos + 2*k);
		n2 = de_bgr555_to_888(n1);
		de_snprintf(tmps, sizeof(tmps), "0x%04x "DE_CHAR_RIGHTARROW" ", (unsigned int)n1);
		de_dbg_pal_entry2(c, k, n2, tmps, NULL, NULL);
		d->pal[k] = n2;
	}

	de_dbg_indent(c, -1);
}

// 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 -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %edx
leaq 0x9591f(%rip), %rsi     # 0x1cbb38
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rcx
xorl %eax, %eax
cmpq -0x20(%rbp), %rcx
movb %al, -0x51(%rbp)
jge 0x136253
cmpq $0x100, -0x28(%rbp)     # imm = 0x100
setl %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x13625c
jmp 0x1362db
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
shlq %rax
addq %rax, %rsi
callq 0x165280
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %edi
callq 0x161940
movl %eax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
movl -0x2c(%rbp), %ecx
movl $0x20, %esi
leaq 0x958b1(%rip), %rdx     # 0x1cbb49
movb $0x0, %al
callq 0x15a980
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x30(%rbp), %edx
leaq -0x50(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x15bdb0
movl -0x30(%rbp), %edx
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movl %edx, 0x20(%rax,%rcx,4)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x136236
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tivariable.c
// Function: de_module_tivariable
void de_module_tivariable(deark *c, struct deark_module_info *mi)
{
	mi->id = "tivariable";
	mi->desc = "TI calculator variable or picture file";
	mi->run_fn = de_run_tivariable;
	mi->identify_fn = de_identify_tivariable;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x9584e(%rip), %rcx     # 0x1cbb55
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x9584b(%rip), %rcx     # 0x1cbb60
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0x136340
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0xdd(%rip), %rcx        # 0x136410
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tivariable.c
// Function: de_run_tivariable
static void de_run_tivariable(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;

	d = de_malloc(c, sizeof(lctx));
	d->fmt = identify_internal(c);

	if(!ti_ver_info_arr[d->fmt].decoder_fn) {
		de_err(c, "Unknown or unsupported TI variable file version");
		goto done;
	}

	de_declare_fmt(c, ti_ver_info_arr[d->fmt].description);
	ti_ver_info_arr[d->fmt].decoder_fn(c, d);

done:
	de_free(c, d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x18, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x136460
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movslq 0x10(%rax), %rcx
leaq 0xecc45(%rip), %rax     # 0x222fd0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
jne 0x1363ad
movq -0x8(%rbp), %rdi
leaq 0x957e3(%rip), %rsi     # 0x1cbb87
movb $0x0, %al
callq 0x15bfb0
jmp 0x1363f4
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq 0x10(%rax), %rcx
leaq 0xecc10(%rip), %rax     # 0x222fd0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
callq 0x15e380
movq -0x18(%rbp), %rax
movslq 0x10(%rax), %rcx
leaq 0xecbf1(%rip), %rax     # 0x222fd0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tivariable.c
// Function: de_identify_tivariable
static int de_identify_tivariable(deark *c)
{
	int fmt;
	fmt = identify_internal(c);
	if(fmt==DE_FMT_NOT_TI) return 0;
	if(fmt==DE_FMT_UNKNOWN_TI) return 10;
	return 100;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x136460
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x136437
movl $0x0, -0x4(%rbp)
jmp 0x13644d
cmpl $0x1, -0x14(%rbp)
jne 0x136446
movl $0xa, -0x4(%rbp)
jmp 0x13644d
movl $0x64, -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/tivariable.c
// Function: identify_internal
static int identify_internal(deark *c)
{
	u8 buf[8];
	int i;

	de_read(buf, 0, 8);

	if(de_memcmp(buf, "**TI", 4)) return DE_FMT_NOT_TI;

	for(i=2; i<DE_FMT_COUNT; i++) {
		if(!de_memcmp(buf, ti_ver_info_arr[i].sig, 8)) {
			return i;
		}
	}
	return DE_FMT_UNKNOWN_TI;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x8, %ecx
callq 0x164d10
leaq -0x18(%rbp), %rax
movl (%rax), %eax
subl $0x49542a2a, %eax       # imm = 0x49542A2A
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x1364a5
movl $0x0, -0x4(%rbp)
jmp 0x1364fb
movl $0x2, -0x1c(%rbp)
cmpl $0xb, -0x1c(%rbp)
jge 0x1364f4
leaq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rdx
leaq 0xecb0f(%rip), %rcx     # 0x222fd0
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
movq (%rcx), %rcx
movq (%rax), %rax
subq %rcx, %rax
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1364e7
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1364fb
jmp 0x1364e9
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1364ac
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/tivariable.c
// Function: do_ti83
static void do_ti83(deark *c, lctx *d)
{
	i64 pos;
	i64 data_section_size;
	i64 data_section_end;
	i64 var_data_size;
	u8 type_id;

	// 0-7: signature
	// 8-10: 0x1a 0x0a 0x00
	// 11-52: comment

	data_section_size = de_getu16le(53);
	de_dbg(c, "data section size: %d", (int)data_section_size);
	data_section_end = 55+data_section_size;
	if(data_section_end > c->infile->len) {
		de_err(c, "Data section goes beyond end of file");
		goto done;
	}

	// Read the variables
	pos = 55;
	while(pos < data_section_end) {
		var_data_size = de_getu16le(pos+2);
		type_id = de_getbyte(pos+4);
		pos += 15;
		if(d->fmt==DE_FMT_TI83F)
			pos += 2;
		de_dbg(c, "var type=0x%02x pos=%d len=%d", (unsigned int)type_id,
			(int)pos, (int)var_data_size);

		if(type_id==0x07) { // guess
			do_ti83_picture_var(c, d, pos);
		}
		else if(type_id==0x1a) {
			do_ti83c_picture_var(c, d, pos);
		}

		pos += var_data_size;
	}

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x35, %esi
callq 0x165280
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0x95773(%rip), %rsi     # 0x1cbcba
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x37, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x136583
movq -0x8(%rbp), %rdi
leaq 0x95759(%rip), %rsi     # 0x1cbcd0
movb $0x0, %al
callq 0x15bfb0
jmp 0x13665a
movq $0x37, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x136658
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x2, %rsi
callq 0x165280
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x4, %rsi
callq 0x165060
movb %al, -0x31(%rbp)
movq -0x18(%rbp), %rax
addq $0xf, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x5, 0x10(%rax)
jne 0x1365ec
movq -0x18(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x31(%rbp), %edx
movq -0x18(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %eax, %r8d
leaq 0x956ed(%rip), %rsi     # 0x1cbcf5
movb $0x0, %al
callq 0x15b0d0
movzbl -0x31(%rbp), %eax
cmpl $0x7, %eax
jne 0x13662b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x136990
jmp 0x136647
movzbl -0x31(%rbp), %eax
cmpl $0x1a, %eax
jne 0x136645
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x136a60
jmp 0x136647
movq -0x30(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x13658b
jmp 0x13665a
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tivariable.c
// Function: do_ti92
static void do_ti92(deark *c, lctx *d)
{
	i64 pos;
	i64 numvars;
	i64 x;
	i64 i;

	// 0-7: signature
	// 8-9: 0x01 0x00
	// 10-17: default folder name
	// 18-57: comment

	numvars = de_getu16le(58);
	de_dbg(c, "number of variables/folders: %d", (int)numvars);
	if(!de_good_image_count(c, numvars)) goto done;

	pos = 60;
	for(i=0; i<numvars; i++) {
		do_ti92_var_table_entry(c, d, pos);
		pos+=16;
	}

	// Data section
	x = de_getu32le(pos);
	de_dbg(c, "reported file size: %d", (int)x);

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x3a, %esi
callq 0x165280
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0x9555e(%rip), %rsi     # 0x1cbe55
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x16a9a0
cmpl $0x0, %eax
jne 0x136912
jmp 0x136984
movq $0x3c, -0x18(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x136957
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x136fe0
movq -0x18(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x136922
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165540
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x7556f(%rip), %rsi     # 0x1abeec
movb $0x0, %al
callq 0x15b0d0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/tivariable.c
// Function: do_ti83_picture_var
static int do_ti83_picture_var(deark *c, lctx *d, i64 pos)
{
	i64 picture_size;

	de_dbg(c, "picture at %d", (int)pos);
	picture_size = de_getu16le(pos);
	de_dbg(c, "picture size: %d", (int)picture_size);

	if(picture_size==21945) {
		d->w = 265;
		d->h = 165;
		return do_bitmap_8ci(c, d, pos+2);
	}

	d->w = 95;
	d->h = 63;
	return do_bitmap(c, d, pos+2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0x9535e(%rip), %rsi     # 0x1cbd13
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x165280
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x9533f(%rip), %rsi     # 0x1cbd21
movb $0x0, %al
callq 0x15b0d0
cmpq $0x55b9, -0x28(%rbp)    # imm = 0x55B9
jne 0x136a24
movq -0x18(%rbp), %rax
movq $0x109, (%rax)          # imm = 0x109
movq -0x18(%rbp), %rax
movq $0xa5, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq $0x2, %rdx
callq 0x136ac0
movl %eax, -0x4(%rbp)
jmp 0x136a53
movq -0x18(%rbp), %rax
movq $0x5f, (%rax)
movq -0x18(%rbp), %rax
movq $0x3f, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq $0x2, %rdx
callq 0x136c90
movl %eax, -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/tivariable.c
// Function: do_ti83c_picture_var
static int do_ti83c_picture_var(deark *c, lctx *d, i64 pos)
{
	// Try to support a type of color image (.8ca).
	// This code may not be correct.
	de_dbg(c, "picture at %d", (int)pos);
	d->w = 133;
	d->h = 83;
	return do_bitmap_8ca(c, d, pos+3);
}

// 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
movl %eax, %edx
leaq 0x9528e(%rip), %rsi     # 0x1cbd13
movb $0x0, %al
callq 0x15b0d0
movq -0x10(%rbp), %rax
movq $0x85, (%rax)
movq -0x10(%rbp), %rax
movq $0x53, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x3, %rdx
callq 0x136d60
addq $0x20, %rsp
popq %rbp
retq
nop