LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/misc3.c
// Function: qip_do_v2
static void qip_do_v2(deark *c, de_arch_lctx *d)
{
	i64 pos;
	i64 index_pos;
	i64 index_len;
	i64 index_endpos;
	i64 i;
	struct de_arch_member_data *md = NULL;

	pos = 2;
	d->num_members = de_getu16le_p(&pos);
	de_dbg(c, "number of members: %"I64_FMT, d->num_members);
	index_len = de_getu32le_p(&pos);
	de_dbg(c, "index size: %"I64_FMT, index_len); // ??
	d->crco = de_crcobj_create(c, DE_CRCOBJ_CRC32_IEEE);
	index_pos = 16;

	de_dbg(c, "index at %"I64_FMT, index_pos);
	index_endpos = index_pos+index_len;
	if(index_endpos > c->infile->len) goto done;
	pos = index_pos;

	for(i=0; i<d->num_members; i++) {
		if(pos+16 > index_endpos) goto done;

		if(md) {
			de_arch_destroy_md(c, md);
			md = NULL;
		}
		md = de_arch_create_md(c, d);

		md->member_hdr_pos = de_getu32le_p(&pos);
		(void)do_qip_member(c, d, md);
		pos += 12;
	}

done:
	if(md) {
		de_arch_destroy_md(c, md);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x2, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x1652c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0xfe7a4(%rip), %rsi     # 0x1a0503
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x165580
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x10a017(%rip), %rsi    # 0x1abda1
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x15eac0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq $0x10, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x123684(%rip), %rsi    # 0x1c5445
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jle 0xa1deb
jmp 0xa1e96
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jge 0xa1e94
movq -0x18(%rbp), %rax
addq $0x10, %rax
cmpq -0x30(%rbp), %rax
jle 0xa1e1d
jmp 0xa1e96
cmpq $0x0, -0x40(%rbp)
je 0xa1e39
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x17c1a0
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x17c120
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x165580
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0xa1eb0
movq -0x18(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xa1dfb
jmp 0xa1e96
cmpq $0x0, -0x40(%rbp)
je 0xa1eaa
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x17c1a0
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/misc3.c
// Function: read_pcxgxlib_filename
static void read_pcxgxlib_filename(deark *c, de_arch_lctx *d, struct de_arch_member_data *md,
	i64 pos)
{
	de_ucstring *tmps = NULL;

	tmps = ucstring_create(c);
	dbuf_read_to_ucstring(c->infile, pos, 8, tmps, DE_CONVFLAG_STOP_AT_NUL,
		d->input_encoding);
	ucstring_strip_trailing_spaces(tmps);
	ucstring_append_ucstring(md->filename, tmps);
	ucstring_empty(tmps);
	dbuf_read_to_ucstring(c->infile, pos+8, 4, tmps, DE_CONVFLAG_STOP_AT_NUL,
		d->input_encoding);
	ucstring_strip_trailing_spaces(tmps);
	if(tmps->len>1) {
		// The extension part includes the dot. If len==1, there is no extension.
		ucstring_append_ucstring(md->filename, tmps);
	}
	ucstring_destroy(tmps);
}

// 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
callq 0x1711d0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movl 0x18(%rax), %r9d
movl $0x8, %edx
movl $0x1, %r8d
callq 0x1669f0
movq -0x28(%rbp), %rdi
callq 0x171360
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x171460
movq -0x28(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movl 0x18(%rax), %r9d
movl $0x4, %edx
movl $0x1, %r8d
callq 0x1669f0
movq -0x28(%rbp), %rdi
callq 0x171360
movq -0x28(%rbp), %rax
cmpq $0x1, 0x10(%rax)
jle 0xa2729
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x171460
movq -0x28(%rbp), %rdi
callq 0x171750
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/misc3.c
// Function: mdcd_decompressor_fn
static void mdcd_decompressor_fn(struct de_arch_member_data *md)
{
	deark *c = md->c;

	if(md->cmpr_meth==1) {
		struct de_lzw_params delzwp;

		de_zeromem(&delzwp, sizeof(struct de_lzw_params));
		delzwp.fmt = DE_LZWFMT_ZOOLZD;
		fmtutil_decompress_lzw(c, md->dcmpri, md->dcmpro, md->dres, &delzwp);
	}
	else if(md->cmpr_meth==0) {
		fmtutil_decompress_uncompressed(c, md->dcmpri, md->dcmpro, md->dres, 0);
	}
	else {
		de_dfilter_set_generic_error(c, md->dres, NULL);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x90(%rax)
jne 0xa2d4b
leaq -0x24(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x19140
movl $0x4, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0xb8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rcx
leaq -0x24(%rbp), %r8
callq 0x1843b0
jmp 0xa2da1
movq -0x8(%rbp), %rax
cmpl $0x0, 0x90(%rax)
jne 0xa2d87
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0xb8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rcx
xorl %r8d, %r8d
callq 0x1778b0
jmp 0xa2d9f
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x177560
jmp 0xa2da1
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/misc3.c
// Function: dclimplode_header_at
static int dclimplode_header_at(deark *c, i64 pos)
{
	u8 b;

	b = de_getbyte(pos);
	if(b>1) return 0;
	b = de_getbyte(pos+1);
	if(b<4 || b>6) return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165060
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x1, %eax
jle 0xa3046
movl $0x0, -0x4(%rbp)
jmp 0xa3080
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
callq 0x165060
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0x4, %eax
jl 0xa3070
movzbl -0x19(%rbp), %eax
cmpl $0x6, %eax
jle 0xa3079
movl $0x0, -0x4(%rbp)
jmp 0xa3080
movl $0x1, -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/misc3.c
// Function: lif_kdc_convert_hdr
static int lif_kdc_convert_hdr(deark *c, i64 pos1, dbuf *f2)
{
	i64 pos = pos1;
	int i;
	int errorflag = 0;

	for(i=0; i<17; i++) {
		u8 b0, b1;
		u8 x0, x1;

		b0 = de_getbyte_p(&pos);
		b1 = de_getbyte_p(&pos);
		x0 = de_decode_hex_digit(b0, &errorflag);
		if(errorflag) return 0;
		x1 = de_decode_hex_digit(b1, &errorflag);
		if(errorflag) return 0;
		dbuf_writebyte(f2, (u8)((x0<<4)|x1));
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
cmpl $0x11, -0x2c(%rbp)
jge 0xa3b61
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165170
movb %al, -0x31(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x165170
movb %al, -0x32(%rbp)
leaq -0x30(%rbp), %rsi
movzbl -0x31(%rbp), %edi
callq 0x1600b0
movb %al, -0x33(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0xa3b1b
movl $0x0, -0x4(%rbp)
jmp 0xa3b68
leaq -0x30(%rbp), %rsi
movzbl -0x32(%rbp), %edi
callq 0x1600b0
movb %al, -0x34(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0xa3b3a
movl $0x0, -0x4(%rbp)
jmp 0xa3b68
movq -0x20(%rbp), %rdi
movzbl -0x33(%rbp), %eax
shll $0x4, %eax
movzbl -0x34(%rbp), %ecx
orl %ecx, %eax
movzbl %al, %esi
callq 0x168380
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xa3aca
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/misc3.c
// Function: lif_method2_decompressor_fn
static void lif_method2_decompressor_fn(struct de_arch_member_data *md)
{
	deark *c = md->c;
	struct de_lzw_params delzwp;

	de_zeromem(&delzwp, sizeof(struct de_lzw_params));
	delzwp.fmt = DE_LZWFMT_ZOOLZD;
	fmtutil_decompress_lzw(c, md->dcmpri, md->dcmpro, md->dres, &delzwp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
leaq -0x24(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x19140
movl $0x4, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0xb8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rcx
leaq -0x24(%rbp), %r8
callq 0x1843b0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/misc3.c
// Function: lif_read_field
static i64 lif_read_field(dbuf *f, i64 pos1, i64 len, int *perrflag)
{
	i64 val = 0;
	i64 i;
	i64 pos = pos1;

	for(i=0; i<len; i++) {
		u8 b;
		i64 nv;

		b = dbuf_getbyte_p(f, &pos);
		if(b>='0' && b<='9') {
			nv = b - 48;
		}
		else if(b>='a' && b<='f') {
			nv = b - 87;
		}
		else {
			*perrflag = 1;
			return 0;
		}

		val = (val<<4) | nv;
	}
	return val;
}

// 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)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0xa3cb7
movq -0x10(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x165170
movb %al, -0x41(%rbp)
movzbl -0x41(%rbp), %eax
cmpl $0x30, %eax
jl 0xa3c5f
movzbl -0x41(%rbp), %eax
cmpl $0x39, %eax
jg 0xa3c5f
movzbl -0x41(%rbp), %eax
subl $0x30, %eax
cltq
movq %rax, -0x50(%rbp)
jmp 0xa3c96
movzbl -0x41(%rbp), %eax
cmpl $0x61, %eax
jl 0xa3c80
movzbl -0x41(%rbp), %eax
cmpl $0x66, %eax
jg 0xa3c80
movzbl -0x41(%rbp), %eax
subl $0x57, %eax
cltq
movq %rax, -0x50(%rbp)
jmp 0xa3c94
movq -0x28(%rbp), %rax
movl $0x1, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0xa3cbf
jmp 0xa3c96
movq -0x30(%rbp), %rax
shlq $0x4, %rax
orq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xa3c20
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/misc3.c
// Function: hit_calc_hdr_checksum
static UI hit_calc_hdr_checksum(struct de_arch_member_data *md)
{
	struct de_crcobj *crco = NULL;
	UI x;

	crco = de_crcobj_create(md->c, DE_CRCOBJ_SUM_BYTES);
	de_crcobj_addslice(crco, md->d->inf, md->member_hdr_pos, 2);
	de_crcobj_addslice(crco, md->d->inf, md->member_hdr_pos+3,
		md->member_hdr_size-3);
	x = de_crcobj_getval(crco);
	x &= 0xff;
	de_crcobj_destroy(crco);
	return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x30, %esi
callq 0x15eac0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdx
movl $0x2, %ecx
callq 0x15f500
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdx
addq $0x3, %rdx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
subq $0x3, %rcx
callq 0x15f500
movq -0x10(%rbp), %rdi
callq 0x15f340
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
andl $0xff, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x15f2e0
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/misc3.c
// Function: binary_ii_is_member_at
static int binary_ii_is_member_at(dbuf *f, i64 pos, u8 check_nr, int nr_expected)
{
	if(dbuf_memcmp(f, pos, (const void*)"\x0a\x47\x4c", 3)) return 0;
	if(dbuf_getbyte(f, pos+18) != 0x02) return 0;
	if(check_nr) {
		int nr;

		nr = (int)dbuf_getbyte(f, pos+127);
		if(nr != nr_expected) return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movl %ecx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq 0x10db37(%rip), %rdx    # 0x1b1e9e
movl $0x3, %ecx
callq 0x166ab0
cmpl $0x0, %eax
je 0xa437f
movl $0x0, -0x4(%rbp)
jmp 0xa43d8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x12, %rsi
callq 0x165060
movzbl %al, %eax
cmpl $0x2, %eax
je 0xa43a1
movl $0x0, -0x4(%rbp)
jmp 0xa43d8
cmpb $0x0, -0x19(%rbp)
je 0xa43d1
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x7f, %rsi
callq 0x165060
movzbl %al, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
je 0xa43cf
movl $0x0, -0x4(%rbp)
jmp 0xa43d8
jmp 0xa43d1
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/misc3.c
// Function: tc_decompressor_fn
static void tc_decompressor_fn(struct de_arch_member_data *md)
{
	deark *c = md->c;

	if(md->cmpr_meth==0) {
		fmtutil_decompress_uncompressed(c, md->dcmpri, md->dcmpro, md->dres, 0);
	}
	else if(md->cmpr_meth==1) {
		tc_decompress_rle(md);
	}
	else {
		de_dfilter_set_generic_error(c, md->dres, NULL);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x90(%rax)
jne 0xa4d53
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0xb8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rcx
xorl %r8d, %r8d
callq 0x1778b0
jmp 0xa4d85
movq -0x8(%rbp), %rax
cmpl $0x1, 0x90(%rax)
jne 0xa4d6b
movq -0x8(%rbp), %rdi
callq 0xa4d90
jmp 0xa4d83
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x177560
jmp 0xa4d85
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: de_module_iccprofile
void de_module_iccprofile(deark *c, struct deark_module_info *mi)
{
	mi->id = "iccprofile";
	mi->desc = "ICC profile";
	mi->run_fn = de_run_iccprofile;
	mi->identify_fn = de_identify_iccprofile;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x10cfd9(%rip), %rcx    # 0x1b1fe0
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x1140d9(%rip), %rcx    # 0x1b90ee
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x1c(%rip), %rcx        # 0xa5040
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x8d(%rip), %rcx        # 0xa50c0
movq %rcx, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: de_run_iccprofile
static void de_run_iccprofile(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos;

	d = de_malloc(c, sizeof(lctx));

	pos = 0;
	do_read_header(c, d, pos);
	pos += 128;
	do_read_main_tags(c, d, pos);

	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 $0xb8, %esi
callq 0x15b780
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xa5110
movq -0x20(%rbp), %rax
addq $0x80, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xa5770
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x15b820
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: format_4cc_dbgstr
static const char *format_4cc_dbgstr(const struct de_fourcc *tmp4cc,
	char *buf, size_t buflen, UI flags)
{
	char str[40];

	if((tmp4cc->id==0) && (flags&0x2))
		de_strlcpy(str, "(none)", sizeof(str));
	else
		de_snprintf(str, sizeof(str), "'%s'", tmp4cc->id_dbgstr);

	if(flags&0x1)
		de_snprintf(buf, buflen, "0x%08x=%s", (UI)tmp4cc->id, str);
	else
		de_strlcpy(buf, str, buflen);

	return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jne 0xa5973
movl -0x1c(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xa5973
leaq -0x50(%rbp), %rdi
leaq 0x127bbb(%rip), %rsi    # 0x1cd522
movl $0x28, %edx
callq 0x15aa30
jmp 0xa5992
leaq -0x50(%rbp), %rdi
movq -0x8(%rbp), %rcx
addq $0x10, %rcx
movl $0x28, %esi
leaq 0x1204af(%rip), %rdx    # 0x1c5e3a
movb $0x0, %al
callq 0x15a980
movl -0x1c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xa59c0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
leaq -0x50(%rbp), %r8
leaq 0x10c7a4(%rip), %rdx    # 0x1b215b
movb $0x0, %al
callq 0x15a980
jmp 0xa59d1
movq -0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x15aa30
movq -0x10(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: dbg_timestamp
static void dbg_timestamp(deark *c, i64 pos1, const char *name)
{
	i64 n[6];
	i64 pos = pos1;
	i64 i;
	char timestamp_buf[64];

	for(i=0; i<6; i++) {
		n[i] = de_getu16be_p(&pos);
	}

	if(n[0]!=0) {
		struct de_timestamp ts;

		de_make_timestamp(&ts, n[0], n[1], n[2], n[3], n[4], n[5]);
		ts.tzcode = DE_TZCODE_UTC;
		de_dbg_timestamp_to_string(c, &ts, timestamp_buf, sizeof(timestamp_buf), 0);
	}
	else {
		de_strlcpy(timestamp_buf, "(none)", sizeof(timestamp_buf));
	}

	de_dbg(c, "%s: %s", name, timestamp_buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
cmpq $0x6, -0x60(%rbp)
jge 0xa5a39
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x58(%rbp), %rsi
callq 0x165210
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, -0x50(%rbp,%rax,8)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0xa5a07
cmpq $0x0, -0x50(%rbp)
je 0xa5a90
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %r9
movq -0x28(%rbp), %rax
leaq -0xb0(%rbp), %rdi
movq %rax, (%rsp)
callq 0x15d830
movb $0x1, -0xaf(%rbp)
movq -0x8(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
leaq -0xb0(%rbp), %rsi
movl $0x40, %ecx
xorl %r8d, %r8d
callq 0x15e2d0
jmp 0xa5aa8
leaq -0xa0(%rbp), %rdi
leaq 0x127a84(%rip), %rsi    # 0x1cd522
movl $0x40, %edx
callq 0x15aa30
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0xa0(%rbp), %rcx
leaq 0x12f408(%rip), %rsi    # 0x1d4ec6
movb $0x0, %al
callq 0x15b0d0
addq $0xc0, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: do_main_tag
static void do_main_tag(deark *c, lctx *d, struct tagset_type *tgs,
	i64 tagindex, i64 pos_in_tagtable)
{
	struct de_fourcc tag4cc;
	const struct taginfo *ti;
	const char *tname;
	i64 tagdataoffset;
	i64 tagdatalen;

	dbuf_read_fourcc(c->infile, pos_in_tagtable, &tag4cc, 4, 0x0);
	tagdataoffset = de_getu32be(pos_in_tagtable+4);
	tagdatalen = de_getu32be(pos_in_tagtable+8);
	ti = lookup_taginfo(d, tag4cc.id);
	if(ti && ti->name)
		tname = ti->name;
	else
		tname = "?";
	de_dbg(c, "tag #%d %s (%s) tpos=%"I64_FMT" dpos=%"I64_FMT" dlen=%"I64_FMT, (int)tagindex,
		format_4cc_dbgstr(&tag4cc, d->tmpbuf1, sizeof(d->tmpbuf1), 0x0), tname,
		pos_in_tagtable, tgs->data_area_pos+tagdataoffset, tagdatalen);

	de_dbg_indent(c, 1);
	do_tag_data(c, d, tgs, tagindex, tagdataoffset, tagdatalen);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
leaq -0x58(%rbp), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0x169860
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
addq $0x4, %rsi
callq 0x165470
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
addq $0x8, %rsi
callq 0x165470
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0xa5d40
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0xa5c3e
movq -0x60(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xa5c3e
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0xa5c49
leaq 0x111fe8(%rip), %rax    # 0x1b7c2d
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x20(%rbp), %rax
movl %eax, -0x7c(%rbp)
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
leaq -0x58(%rbp), %rdi
movl $0x50, %edx
xorl %ecx, %ecx
callq 0xa5930
movq -0x88(%rbp), %rdi
movl -0x7c(%rbp), %edx
movq %rax, %rcx
movq -0x68(%rbp), %r8
movq -0x28(%rbp), %r9
movq -0x18(%rbp), %rax
movq 0x8(%rax), %r10
addq -0x70(%rbp), %r10
movq -0x78(%rbp), %rax
leaq 0x10c523(%rip), %rsi    # 0x1b21c2
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x70(%rbp), %r8
movq -0x78(%rbp), %r9
callq 0xa5e00
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: lookup_taginfo
static const struct taginfo *lookup_taginfo(lctx *d, u32 id)
{
	size_t k;
	for(k=0; k<DE_ARRAYCOUNT(taginfo_arr); k++) {
		if((taginfo_arr[k].flags & 0x1) && d->profile_ver_major>=4) continue;
		if((taginfo_arr[k].flags & 0x2) && d->profile_ver_major<4) continue;
		if(taginfo_arr[k].id == id) {
			return &taginfo_arr[k];
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x4b, -0x20(%rbp)
jae 0xa5df2
movq -0x20(%rbp), %rcx
leaq 0x172227(%rip), %rax    # 0x217f90
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xa5d86
movq -0x10(%rbp), %rax
cmpl $0x4, (%rax)
jb 0xa5d86
jmp 0xa5de1
movq -0x20(%rbp), %rcx
leaq 0x1721ff(%rip), %rax    # 0x217f90
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xa5dae
movq -0x10(%rbp), %rax
cmpl $0x4, (%rax)
jae 0xa5dae
jmp 0xa5de1
movq -0x20(%rbp), %rcx
leaq 0x1721d7(%rip), %rax    # 0x217f90
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0xa5ddf
movq -0x20(%rbp), %rcx
leaq 0x1721be(%rip), %rax    # 0x217f90
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0xa5dfa
jmp 0xa5de1
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xa5d53
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: is_duplicate_data
static int is_duplicate_data(deark *c, lctx *d, struct tagset_type *tgs,
	i64 tagindex, i64 tagdataoffset, i64 tagdatalen,
	i64 *idx_of_dup)
{
	i64 k;

	for(k=0; k<tagindex && k<tgs->num_tags; k++) {
		if(tgs->tags_seen[k].offset==tagdataoffset &&
			tgs->tags_seen[k].len==tagdatalen)
		{
			*idx_of_dup = k;
			return 1;
		}
	}

	*idx_of_dup = -1;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rcx
xorl %eax, %eax
cmpq -0x28(%rbp), %rcx
movb %al, -0x41(%rbp)
jge 0xa6099
movq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x18(%rcx), %rax
setl %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0xa60a2
jmp 0xa6102
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
cmpq -0x30(%rbp), %rax
jne 0xa60ef
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
cmpq -0x38(%rbp), %rax
jne 0xa60ef
movq -0x40(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0xa6114
jmp 0xa60f1
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xa6078
movq 0x10(%rbp), %rax
movq $-0x1, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: lookup_datatypeinfo
static const struct datatypeinfo *lookup_datatypeinfo(u32 id)
{
	size_t k;
	for(k=0; k<DE_ARRAYCOUNT(datatypeinfo_arr); k++) {
		if(datatypeinfo_arr[k].id == id) {
			return &datatypeinfo_arr[k];
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x2e, -0x18(%rbp)
jae 0xa6171
leaq 0x172303(%rip), %rax    # 0x218440
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0xa6161
leaq 0x1722ed(%rip), %rax    # 0x218440
imulq $0x18, -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0xa6179
jmp 0xa6163
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xa612f
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: typedec_hexdump
static void typedec_hexdump(deark *c, struct typedec_params *p)
{
	UI rsvd;

	if(p->len<8) return;
	rsvd = (UI)de_getu32be(p->pos1+4);
	de_dbg(c, "reserved/etc.: 0x%08x", rsvd);
	de_dbg_hexdump(c, c->infile, p->pos1+8, p->len-8, 256, NULL, 0x1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x8, 0x18(%rax)
jge 0xa619d
jmp 0xa6209
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
addq $0x4, %rsi
callq 0x165470
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq 0x10c739(%rip), %rsi    # 0x1b2900
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
addq $0x8, %rdx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
subq $0x8, %rcx
movl $0x100, %r8d            # imm = 0x100
xorl %eax, %eax
movl %eax, %r9d
movl $0x1, (%rsp)
callq 0x15b840
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: typedec_XYZ
static void typedec_XYZ(deark *c, struct typedec_params *p)
{
	i64 xyz_count;
	i64 k;

	if(p->len<8) return;
	xyz_count = (p->len-8)/12;
	for(k=0; k<xyz_count; k++) {
		struct XYZ_type xyz;

		read_XYZ(c, p->pos1+8+12*k, &xyz);
		de_dbg(c, "XYZ[%d]: %.5f, %.5f, %.5f", (int)k,
			xyz.v[0], xyz.v[1], xyz.v[2]);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x8, 0x18(%rax)
jge 0xa6230
jmp 0xa62b2
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
subq $0x8, %rax
movl $0xc, %ecx
cqto
idivq %rcx
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0xa62b2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
addq $0x8, %rsi
imulq $0xc, -0x20(%rbp), %rax
addq %rax, %rsi
leaq -0x38(%rbp), %rdx
callq 0xa5ad0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
movsd -0x38(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x28(%rbp), %xmm2
leaq 0x10c4b5(%rip), %rsi    # 0x1b2752
movb $0x3, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xa6252
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: typedec_dict
static void typedec_dict(deark *c, struct typedec_params *p)
{
	i64 pos = p->pos1 + 8;
	i64 nrec;
	i64 reclen;
	i64 i;

	if(p->len<16) goto done;

	nrec = de_getu32be_p(&pos);
	de_dbg(c, "num records: %u", (UI)nrec);
	reclen = de_getu32be_p(&pos);
	de_dbg(c, "rec len: %u", (UI)reclen);
	if(reclen!=16 && reclen!=24 && reclen!=32) goto done;
	if(pos+nrec*reclen > p->pos1 + p->len) goto done;
	if(nrec>MAX_TAGS_PER_TAGSET) goto done;

	for(i=0; i<nrec; i++) {
		do_dict_string(c, p, pos, "name");
		pos += 8;
		do_dict_string(c, p, pos, "value");
		pos += 8;
		if(reclen>=24) {
			do_dict_string(c, p, pos, "display name");
			pos += 8;
		}
		if(reclen>=32) {
			do_dict_string(c, p, pos, "display value");
			pos += 8;
		}
	}

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x10, 0x18(%rax)
jge 0xa6570
jmp 0xa66e6
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x1654b0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0x10c216(%rip), %rsi    # 0x1b27ac
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x1654b0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x1137a7(%rip), %rsi    # 0x1b9d6a
movb $0x0, %al
callq 0x15b0d0
cmpq $0x10, -0x28(%rbp)
je 0xa65e4
cmpq $0x18, -0x28(%rbp)
je 0xa65e4
cmpq $0x20, -0x28(%rbp)
je 0xa65e4
jmp 0xa66e6
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
imulq -0x28(%rbp), %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x10(%rbp), %rdx
addq 0x18(%rdx), %rcx
cmpq %rcx, %rax
jle 0xa660e
jmp 0xa66e6
cmpq $0x1f4, -0x20(%rbp)     # imm = 0x1F4
jle 0xa661d
jmp 0xa66e6
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0xa66e4
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x10d9a8(%rip), %rcx    # 0x1b3fee
callq 0xa6e30
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x118eee(%rip), %rcx    # 0x1bf558
callq 0xa6e30
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
cmpq $0x18, -0x28(%rbp)
jl 0xa66a6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x10c127(%rip), %rcx    # 0x1b27bc
callq 0xa6e30
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
cmpq $0x20, -0x28(%rbp)
jl 0xa66d1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x10c109(%rip), %rcx    # 0x1b27c9
callq 0xa6e30
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
jmp 0xa66d3
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xa6625
jmp 0xa66e6
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: typedec_mluc
static void typedec_mluc(deark *c, struct typedec_params *p)
{
	i64 pos = p->pos1;
	i64 num_recs;
	i64 recsize;
	i64 rec_array_startpos;
	i64 rec;

	if(p->len<12) goto done;
	pos += 8;

	num_recs = de_getu32be(pos);
	de_dbg(c, "number of records: %u", (UI)num_recs);
	pos += 4;

	recsize = de_getu32be(pos);
	de_dbg(c, "record size: %u", (UI)recsize);
	if(recsize<12) goto done;
	pos += 4;

	rec_array_startpos = pos;

	for(rec=0; rec<num_recs; rec++) {
		if(rec_array_startpos+rec*recsize > p->pos1+p->len) break;

		de_dbg(c, "record #%u at %"I64_FMT, (UI)rec, pos);
		de_dbg_indent(c, 1);
		do_mluc_record(c, p->d, p->pos1, pos, recsize);
		de_dbg_indent(c, -1);
		pos += recsize;
	}

done:
	;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0xc, 0x18(%rax)
jge 0xa671c
jmp 0xa6862
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165470
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
leaq 0x10610e(%rip), %rsi    # 0x1ac85c
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165470
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x10c074(%rip), %rsi    # 0x1b27fb
movb $0x0, %al
callq 0x15b0d0
cmpq $0xc, -0x28(%rbp)
jge 0xa679a
jmp 0xa6862
movq -0x18(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0xa6860
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
imulq -0x28(%rbp), %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x10(%rbp), %rdx
addq 0x18(%rdx), %rcx
cmpq %rcx, %rax
jle 0xa67eb
jmp 0xa6860
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
movq -0x18(%rbp), %rcx
leaq 0x10c00b(%rip), %rsi    # 0x1b280b
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0xa6f40
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15b560
movq -0x28(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xa67b6
jmp 0xa6862
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: typedec_sf32
static void typedec_sf32(deark *c, struct typedec_params *p)
{
	i64 count;
	i64 i;
	i64 pos = p->pos1 + 8;
	double val;

	if(p->len<8) return;
	count = (p->len-8)/4;
	for(i=0; i<count && i<64; i++) {
		val = read_s15Fixed16Number(c->infile, pos);
		pos += 4;
		de_dbg(c, "arr[%d] = %.5f", (int)i, val);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x8, 0x18(%rax)
jge 0xa68a0
jmp 0xa6932
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
subq $0x8, %rax
movl $0x4, %ecx
cqto
idivq %rcx
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpq -0x18(%rbp), %rcx
movb %al, -0x31(%rbp)
jge 0xa68dc
cmpq $0x40, -0x20(%rbp)
setl %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0xa68e5
jmp 0xa6932
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0xa5b40
movsd %xmm0, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %edx
movsd -0x30(%rbp), %xmm0
leaq 0x10bf4c(%rip), %rsi    # 0x1b2869
movb $0x1, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xa68c2
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: typedec_text
static void typedec_text(deark *c, struct typedec_params *p)
{
	de_ucstring *s = NULL;
	i64 textlen = p->len-8;
	de_ext_encoding enc;

	if(textlen<0) goto done;

	if(p->type_id==0x75746638U) {
		enc = DE_ENCODING_UTF8;
	}
	else {
		enc = DE_ENCODING_ASCII;
	}

	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, p->pos1+8, textlen, DE_DBG_MAX_STRLEN,
		s, 0, enc);
	ucstring_truncate_at_NUL(s);
	de_dbg(c, "text: \"%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 $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
subq $0x8, %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jge 0xa6d94
jmp 0xa6e1c
movq -0x10(%rbp), %rax
cmpl $0x75746638, 0x20(%rax) # imm = 0x75746638
jne 0xa6daa
movl $0x2, -0x24(%rbp)
jmp 0xa6db1
movl $0x1, -0x24(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
addq $0x8, %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %r8
movl -0x24(%rbp), %eax
movl $0x1f4, %ecx            # imm = 0x1F4
xorl %r9d, %r9d
movl %eax, (%rsp)
callq 0x166a40
movq -0x18(%rbp), %rdi
callq 0x1712b0
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x172500
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0x11fc3d(%rip), %rsi    # 0x1c6a52
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rdi
callq 0x171750
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: do_dict_string
static void do_dict_string(deark *c, struct typedec_params *p, i64 itempos, const char *itemname)
{
	de_ucstring *s = NULL;
	i64 dpos_rel, dpos_abs, dlen;

	dpos_rel = de_getu32be(itempos);
	dpos_abs = p->pos1 + dpos_rel;
	dlen = de_getu32be(itempos+4);
	if(dpos_abs + dlen > p->pos1 + p->len) goto done;
	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(c->infile, dpos_abs, dlen, DE_DBG_MAX_STRLEN, s, 0, DE_ENCODING_UTF16BE);
	de_dbg(c, "%s: dpos=%"I64_FMT", dlen=%"I64_FMT", string=\"%s\"", itemname, dpos_abs, dlen,
		ucstring_getpsz_d(s));

done:
	ucstring_destroy(s);
}

// 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)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x165470
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x4, %rsi
callq 0x165470
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
addq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x10(%rbp), %rdx
addq 0x18(%rdx), %rcx
cmpq %rcx, %rax
jle 0xa6ead
jmp 0xa6f2c
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x28(%rbp), %r8
movl $0x1f4, %ecx            # imm = 0x1F4
xorl %r9d, %r9d
movl $0x4, (%rsp)
callq 0x166a40
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
callq 0x172650
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
movq %rax, %r9
leaq 0x10b8b2(%rip), %rsi    # 0x1b27d7
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rdi
callq 0x171750
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/iccprofile.c
// Function: do_mluc_record
static void do_mluc_record(deark *c, lctx *d, i64 tagstartpos,
	i64 pos, i64 recsize)
{
	de_ucstring *s = NULL;
	i64 string_len;
	i64 string_offset;

	s = ucstring_create(c);

	dbuf_read_to_ucstring(c->infile, pos, 2, s, 0, DE_ENCODING_ASCII);
	de_dbg(c, "language code: '%s'", ucstring_getpsz(s));
	ucstring_empty(s);

	dbuf_read_to_ucstring(c->infile, pos+2, 2, s, 0, DE_ENCODING_ASCII);
	de_dbg(c, "country code: '%s'", ucstring_getpsz(s));
	ucstring_empty(s);

	string_len = de_getu32be(pos+4);
	string_offset = de_getu32be(pos+8);
	de_dbg(c, "string offset=%"I64_FMT"+%"I64_FMT", len=%"I64_FMT" bytes", tagstartpos,
		string_offset, string_len);

	dbuf_read_to_ucstring_n(c->infile, tagstartpos+string_offset, string_len, DE_DBG_MAX_STRLEN*2,
		s, 0, DE_ENCODING_UTF16BE);
	ucstring_truncate_at_NUL(s);
	de_dbg(c, "string: \"%s\"", ucstring_getpsz(s));

	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1711d0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rcx
movl $0x2, %edx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rdi
callq 0x172500
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x10b86a(%rip), %rsi    # 0x1b281d
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x2, %rsi
movq -0x30(%rbp), %rcx
movl $0x2, %edx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rdi
callq 0x172500
movq -0x50(%rbp), %rdi
movq %rax, %rdx
leaq 0x10b828(%rip), %rsi    # 0x1b2831
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rdi
callq 0x171210
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
callq 0x165470
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
callq 0x165470
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %r8
leaq 0x10b7e2(%rip), %rsi    # 0x1b2844
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
addq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %r8
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %r9d, %r9d
movl $0x4, (%rsp)
callq 0x166a40
movq -0x30(%rbp), %rdi
callq 0x1712b0
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rdi
callq 0x172500
movq -0x48(%rbp), %rdi
movq %rax, %rdx
leaq 0x12415d(%rip), %rsi    # 0x1cb21a
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rdi
callq 0x171750
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/icns.c
// Function: de_module_icns
void de_module_icns(deark *c, struct deark_module_info *mi)
{
	mi->id = "icns";
	mi->desc = "Macintosh icon";
	mi->run_fn = de_run_icns;
	mi->identify_fn = de_identify_icns;
	mi->help_fn = de_help_icns;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x10b824(%rip), %rcx    # 0x1b291b
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
leaq 0x10b81b(%rip), %rcx    # 0x1b2920
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
leaq 0x2c(%rip), %rcx        # 0xa7140
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
leaq 0x2ed(%rip), %rcx       # 0xa7410
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
leaq 0x35e(%rip), %rcx       # 0xa7490
movq %rcx, 0x28(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/icns.c
// Function: de_identify_icns
static int de_identify_icns(deark *c)
{
	i64 fsize;

	if(dbuf_memcmp(c->infile, 0, "icns", 4)) return 0;

	fsize = de_getu32be(4);
	if(fsize == c->infile->len) return 100;
	return 20;
}

// 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 0x10b4ec(%rip), %rdx    # 0x1b291b
movl $0x4, %ecx
callq 0x166ab0
cmpl $0x0, %eax
je 0xa7447
movl $0x0, -0x4(%rbp)
jmp 0xa747f
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x4, %esi
callq 0x165470
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x18(%rcx), %rax
jne 0xa7478
movl $0x64, -0x4(%rbp)
jmp 0xa747f
movl $0x14, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/icns.c
// Function: init_masktype_info
static void init_masktype_info(lctx *d)
{
	size_t i;
	struct mti_struct {
		u8 masktype;
		u8 nbits;
		UI width, height;
	};
	static const struct mti_struct mti[NUM_MASKTYPES] = {
		{ MASKTYPEID_16_12_1,   1, 16,  12  },
		{ MASKTYPEID_16_16_1,   1, 16,  16  },
		{ MASKTYPEID_32_32_1,   1, 32,  32  },
		{ MASKTYPEID_48_48_1,   1, 48,  48  },
		{ MASKTYPEID_16_16_8,   8, 16,  16  },
		{ MASKTYPEID_32_32_8,   8, 32,  32  },
		{ MASKTYPEID_48_48_8,   8, 48,  48  },
		{ MASKTYPEID_128_128_8, 8, 128, 128 }
	};

	for(i=0; i<DE_ARRAYCOUNT(mti); i++) {
		d->mask[mti[i].masktype].nbits = mti[i].nbits;
		d->mask[mti[i].masktype].width = mti[i].width;
		d->mask[mti[i].masktype].height = mti[i].height;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
cmpq $0x8, -0x10(%rbp)
jae 0xa758e
leaq 0x10b77e(%rip), %rax    # 0x1b2c60
imulq $0xc, -0x10(%rbp), %rcx
addq %rcx, %rax
movb 0x1(%rax), %cl
movq -0x8(%rbp), %rax
addq $0x10, %rax
leaq 0x10b764(%rip), %rdx    # 0x1b2c60
imulq $0xc, -0x10(%rbp), %rsi
addq %rsi, %rdx
movzbl (%rdx), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movb %cl, 0x9(%rax)
leaq 0x10b748(%rip), %rax    # 0x1b2c60
imulq $0xc, -0x10(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x8(%rbp), %rax
addq $0x10, %rax
leaq 0x10b72e(%rip), %rdx    # 0x1b2c60
imulq $0xc, -0x10(%rbp), %rsi
addq %rsi, %rdx
movzbl (%rdx), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
leaq 0x10b712(%rip), %rax    # 0x1b2c60
imulq $0xc, -0x10(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x8(%rbp), %rax
addq $0x10, %rax
leaq 0x10b6f8(%rip), %rdx    # 0x1b2c60
imulq $0xc, -0x10(%rbp), %rsi
addq %rsi, %rdx
movzbl (%rdx), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xa74d0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/icns.c
// Function: extract_masks
static void extract_masks(deark *c, lctx *d)
{
	size_t i;
	char tokenbuf[32];

	de_dbg(c, "extracting masks");
	for(i=0; i<NUM_MASKTYPES; i++) {
		if(d->mask[i].img) {
			de_snprintf(tokenbuf, sizeof(tokenbuf), "mask%ux%ux%u",
				d->mask[i].width, d->mask[i].height, (UI)d->mask[i].nbits);
			de_bitmap_write_to_file(d->mask[i].img, tokenbuf, DE_CREATEFLAG_OPT_IMAGE);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x10b193(%rip), %rsi    # 0x1b2bfe
movb $0x0, %al
callq 0x15b0d0
movq $0x0, -0x18(%rbp)
cmpq $0x8, -0x18(%rbp)
jae 0xa7b37
movq -0x10(%rbp), %rax
addq $0x10, %rax
movq -0x18(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, 0x18(%rax)
je 0xa7b24
leaq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x10, %rax
movq -0x18(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
movq -0x10(%rbp), %rax
addq $0x10, %rax
movq -0x18(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl 0x10(%rax), %r8d
movq -0x10(%rbp), %rax
addq $0x10, %rax
movq -0x18(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movzbl 0x9(%rax), %r9d
movl $0x20, %esi
leaq 0x10b117(%rip), %rdx    # 0x1b2c0f
movb $0x0, %al
callq 0x15a980
movq -0x10(%rbp), %rax
addq $0x10, %rax
movq -0x18(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rdi
leaq -0x40(%rbp), %rsi
movl $0x2, %edx
callq 0x16afd0
jmp 0xa7b26
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xa7a7a
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)