LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/lha.c
// Function: exthdr_unixuidgid
static void exthdr_unixuidgid(deark *c, lctx *d, struct member_data *md,
	u8 id, const struct exthdr_type_info_struct *e,
	i64 pos, i64 dlen)
{
	i64 uid, gid;
	if(dlen<4) return;

	// It's strange that the GID comes first, while the UID comes first in the
	// level-0 "extended area".
	gid = de_getu16le(pos);
	de_dbg(c, "gid: %d", (int)gid);
	uid = de_getu16le(pos+2);
	de_dbg(c, "uid: %d", (int)uid);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x4, 0x20(%rsp)
jge 0x87c79
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r9, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %r9, %rsi
callq 0xeebc8
leaq 0xa4523(%rip), %rsi     # 0x12c1b5
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
addq $0x2, %r14
movq %r14, %rsi
callq 0xeebc8
leaq 0xa44f8(%rip), %rsi     # 0x12c1ad
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8617
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/lha.c
// Function: read_windows_FILETIME
static void read_windows_FILETIME(deark *c, lctx *d, struct member_data *md,
	i64 pos, int tsidx, const char *name)
{
	i64 t_FILETIME;
	char timestamp_buf[64];
	struct de_timestamp tmp_timestamp;

	t_FILETIME = de_geti64le(pos);
	de_FILETIME_to_timestamp(t_FILETIME, &tmp_timestamp, 0x1);
	if(t_FILETIME<=0) tmp_timestamp.is_valid = 0;
	de_timestamp_to_string(&tmp_timestamp, timestamp_buf, sizeof(timestamp_buf), 0);
	de_dbg(c, "%s: %"I64_FMT" (%s)", name, t_FILETIME, timestamp_buf);
	apply_timestamp(c, d, md, tsidx, &tmp_timestamp, 90);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r14
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r15
movq 0x18(%rdi), %rdi
movq %rdx, %rsi
callq 0xeef09
movq %rax, %r12
movq %rsp, %rsi
movq %rax, %rdi
movl $0x1, %edx
callq 0xea829
testq %r12, %r12
jg 0x87d7d
movb $0x0, (%rsp)
movq %rsp, %rdi
leaq 0x10(%rsp), %r13
movl $0x40, %edx
movq %r13, %rsi
xorl %ecx, %ecx
callq 0xeaf46
leaq 0x8ee96(%rip), %rsi     # 0x116c31
movq %r15, %rdi
movq %r14, %rdx
movq %r12, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0xe8617
testl %ebp, %ebp
js 0x87de0
cmpb $0x0, (%rsp)
je 0x87de0
movl %ebp, %eax
leaq (%rax,%rax,2), %rax
cmpl $0x5a, 0x90(%rbx,%rax,8)
jg 0x87de0
leaq (%rbx,%rax,8), %rax
addq $0x80, %rax
movups (%rsp), %xmm0
movups %xmm0, (%rax)
movl $0x5a, 0x10(%rax)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/lha.c
// Function: looks_like_car_member
static int looks_like_car_member(deark *c, i64 pos)
{
	u8 b[16];

	de_read(b, pos, 16);
	if(b[2]!='-' || b[3]!='l'|| b[4]!='h' || b[6]!='-') return 0;
	if(b[5]!='0' && b[5]!='5') return 0;
	if((int)b[0] != (int)b[15] + 25) return 0;
	if(dbuf_memcmp(c->infile, pos + (i64)b[15] + 24, (const u8*)"\x20\x00\x00", 3)) return 0;
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq %rsp, %r15
movl $0x10, %ecx
movq %r15, %rsi
movq %rbx, %rdx
callq 0xee8d4
xorl %eax, %eax
cmpb $0x2d, 0x2(%r15)
jne 0x87e78
cmpb $0x6c, 0x3(%rsp)
jne 0x87e78
cmpb $0x68, 0x4(%rsp)
jne 0x87e78
cmpb $0x2d, 0x6(%rsp)
jne 0x87e78
movzbl 0x5(%rsp), %ecx
cmpl $0x35, %ecx
je 0x87e42
cmpl $0x30, %ecx
jne 0x87e78
movzbl (%rsp), %edx
movzbl 0xf(%rsp), %ecx
leal 0x19(%rcx), %esi
cmpl %edx, %esi
jne 0x87e78
movq 0x18(%r14), %rdi
leaq (%rbx,%rcx), %rsi
addq $0x18, %rsi
leaq 0xa48e9(%rip), %rdx     # 0x12c74e
movl $0x3, %ecx
callq 0xefc85
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/lha.c
// Function: looks_like_lharc_sfx_com
static int looks_like_lharc_sfx_com(deark *c, int *is_larc)
{
	u64 v;
	i64 pos = 0;
	u8 b;

	b = de_getbyte_p(&pos);
	if(b!=0xeb) return 0;
	b = de_getbyte_p(&pos);
	pos += (i64)b;
	// I don't know how good this test is, but I don't trust the text signature.
	// It's not formatted consistently. And because the source code was released,
	// who knows what weirdness is out there?
	if(b==0x60 || b==0x6c) {
		v = dbuf_getu64be(c->infile, pos);
		if(v==0xfcbc0001bb0601e8ULL) {
			return 1;
		}
	}
	else if(b==0x1c) {
		v = dbuf_getu64be(c->infile, pos);
		if(v==0xfc8cc8030602018eULL) {
			*is_larc = 1;
			return 1;
		}
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
movq 0x18(%rdi), %rdi
callq 0xeeb4b
movl %eax, %ecx
xorl %eax, %eax
cmpb $-0x15, %cl
jne 0x87f65
movq 0x18(%r14), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0xeeb4b
movzbl %al, %eax
movq (%r15), %rsi
addq %rax, %rsi
movq %rsi, (%r15)
cmpb $0x1c, %al
je 0x87f3e
cmpl $0x6c, %eax
je 0x87f1c
cmpl $0x60, %eax
jne 0x87f63
movq 0x18(%r14), %rdi
callq 0xef072
movq %rax, %rcx
movl $0x1, %eax
movabsq $-0x343fffe44f9fe18, %rdx # imm = 0xFCBC0001BB0601E8
cmpq %rdx, %rcx
jne 0x87f63
jmp 0x87f65
movq 0x18(%r14), %rdi
callq 0xef072
movabsq $-0x37337fcf9fdfe72, %rcx # imm = 0xFC8CC8030602018E
cmpq %rcx, %rax
jne 0x87f63
movl $0x1, (%rbx)
movl $0x1, %eax
jmp 0x87f65
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/lha.c
// Function: is_lharc_data_at
static int is_lharc_data_at(deark *c, i64 pos, i64 *pfoundpos)
{
	u8 b[5];

	if(pos+21 > c->infile->len) return 0;
	de_read(b, pos+2, sizeof(b));
	if(b[0]!='-' || b[1]!='l' || b[4]!='-') return 0;
	if(b[2]!='h' && b[2]!='z') return 0;
	*pfoundpos = pos;
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x15(%rsi), %rax
xorl %ebx, %ebx
cmpq 0x18(%rdi), %rax
jg 0x87fcb
movq %rdx, %r14
movq %rsi, %r15
leaq 0x2(%rsi), %rdx
leaq 0x3(%rsp), %r12
movl $0x5, %ecx
movq %r12, %rsi
callq 0xee8d4
cmpb $0x2d, (%r12)
jne 0x87fcb
cmpb $0x6c, 0x4(%rsp)
jne 0x87fcb
cmpb $0x2d, 0x7(%rsp)
jne 0x87fcb
movzbl 0x5(%rsp), %eax
cmpl $0x7a, %eax
je 0x87fc3
cmpl $0x68, %eax
jne 0x87fcb
movq %r15, (%r14)
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/j2c.c
// Function: de_module_j2c
void de_module_j2c(deark *c, struct deark_module_info *mi)
{
	mi->id = "j2c";
	mi->desc = "JPEG 2000 codestream";
	mi->run_fn = de_run_j2c;
	mi->identify_fn = de_identify_j2c;
}

// Assembly:
leaq 0x8e1db(%rip), %rax     # 0x1161be
movq %rax, (%rsi)
leaq 0xa4765(%rip), %rax     # 0x12c752
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x88008
movq %rax, 0x18(%rsi)
leaq 0x402(%rip), %rax       # 0x88405
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/j2c.c
// Function: handler_cod
static void handler_cod(deark *c, lctx *d, struct page_ctx *pg,
	const struct marker_info *mi, i64 pos1, i64 len)
{
	i64 pos = pos1;
	u8 coding_style;
	de_ucstring *s = NULL;
	u8 b;
	i64 n;

	if(len<5) goto done;
	coding_style = de_getbyte_p(&pos);
	s = ucstring_create(c);

	if((coding_style&0xf8)==0) {
		switch(coding_style&0x01) {
		case 0x0: ucstring_append_flags_item(s, "entropy coder, without partitions"); break;
		case 0x1: ucstring_append_flags_item(s, "entropy coder, with partitions"); break;
		}
		switch((coding_style&0x02)>>1) {
		case 0x0: ucstring_append_flags_item(s, "no SOP segments"); break;
		case 0x1: ucstring_append_flags_item(s, "has SOP segments"); break;
		}
		switch((coding_style&0x04)>>2) {
		case 0x0: ucstring_append_flags_item(s, "no EPH segments"); break;
		case 0x1: ucstring_append_flags_item(s, "has EPH segments"); break;
		}
	}
	else {
		ucstring_append_flags_item(s, "?");
	}
	de_dbg(c, "coding style: 0x%02x (%s)", (unsigned int)coding_style,
		ucstring_getpsz(s));

	b = de_getbyte_p(&pos);
	de_dbg(c, "progression order: %d", (int)b);
	n = de_getu16be_p(&pos);
	de_dbg(c, "number of layers: %d", (int)n);
	(void)de_getbyte_p(&pos);

	if(pos < pos1+len) {
		// TODO
		de_dbg2(c, "[not decoding the rest of this segment]");
	}

done:
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, (%rsp)
cmpq $0x5, %r9
jge 0x88636
xorl %r14d, %r14d
jmp 0x8874c
movq %r9, %r15
movq %r8, %r12
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %rsp, %rsi
callq 0xeeb4b
movl %eax, %r13d
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r14
movzbl %r13b, %ebp
cmpb $0x7, %bpl
ja 0x886b7
leaq 0xa43f2(%rip), %rax     # 0x12ca5c
leaq 0xa43c9(%rip), %rsi     # 0x12ca3a
testb $0x1, %r13b
cmovneq %rax, %rsi
movq %r14, %rdi
callq 0xf7105
testb $0x2, %r13b
leaq 0xa43ef(%rip), %rax     # 0x12ca7b
leaq 0xa43f8(%rip), %rsi     # 0x12ca8b
cmoveq %rax, %rsi
movq %r14, %rdi
callq 0xf7105
cmpb $0x4, %r13b
leaq 0xa43f2(%rip), %rax     # 0x12ca9c
leaq 0xa43fb(%rip), %rsi     # 0x12caac
cmovbq %rax, %rsi
jmp 0x886be
leaq 0xa3a93(%rip), %rsi     # 0x12c151
movq %r14, %rdi
callq 0xf7105
movq %r14, %rdi
callq 0xf705c
leaq 0xa43e8(%rip), %rsi     # 0x12cabd
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %rsp, %r13
movq %r13, %rsi
callq 0xeeb4b
movzbl %al, %edx
leaq 0xa43da(%rip), %rsi     # 0x12cad7
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xeeb91
leaq 0xa43d3(%rip), %rsi     # 0x12caed
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xeeb4b
addq %r12, %r15
cmpq %r15, (%r13)
jge 0x8874c
leaq 0xa43c0(%rip), %rsi     # 0x12cb02
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe87e4
movq %r14, %rdi
callq 0xf6753
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/j2c.c
// Function: handler_qcd
static void handler_qcd(deark *c, lctx *d, struct page_ctx *pg,
	const struct marker_info *mi, i64 pos1, i64 len)
{
	i64 pos = pos1;
	u8 q_style;

	if(len<1) goto done;
	q_style = de_getbyte_p(&pos);
	de_dbg(c, "quantization style: 0x%02x", (unsigned int)q_style);

	if(pos < pos1+len) {
		// TODO
		de_dbg2(c, "[not decoding the rest of this segment]");
	}
done:
	;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, (%rsp)
testq %r9, %r9
jle 0x889b6
movq %r9, %r14
movq %r8, %r15
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0xeeb4b
movzbl %al, %edx
leaq 0xa422c(%rip), %rsi     # 0x12cbbe
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
addq %r15, %r14
cmpq %r14, (%r12)
jge 0x889b6
leaq 0xa4156(%rip), %rsi     # 0x12cb02
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe87e4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/j2c.c
// Function: handler_qcc
static void handler_qcc(deark *c, lctx *d, struct page_ctx *pg,
	const struct marker_info *mi, i64 pos1, i64 len)
{
	i64 pos = pos1;
	i64 compnum;

	if(pg->ncomp<257) {
		compnum = de_getbyte_p(&pos);
	}
	else {
		compnum = de_getu16be_p(&pos);
	}
	de_dbg(c, "component number: %d", (int)compnum);

	if(pos < pos1+len) {
		// TODO
		de_dbg2(c, "[not decoding the rest of this segment]");
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r9, %r14
movq %r8, %r15
movq %rdi, %rbx
movq %r8, 0x8(%rsp)
cmpq $0x100, (%rdx)          # imm = 0x100
movq 0x18(%rdi), %rdi
leaq 0x8(%rsp), %rsi
jg 0x889f5
callq 0xeeb4b
movzbl %al, %edx
jmp 0x889fd
callq 0xeeb91
movq %rax, %rdx
leaq 0xa41d5(%rip), %rsi     # 0x12cbd9
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
addq %r15, %r14
cmpq %r14, 0x8(%rsp)
jge 0x88a29
leaq 0xa40e3(%rip), %rsi     # 0x12cb02
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe87e4
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/j2c.c
// Function: handler_cme
static void handler_cme(deark *c, lctx *d, struct page_ctx *pg,
	const struct marker_info *mi, i64 pos, i64 data_size)
{
	i64 reg_val;
	i64 comment_pos;
	i64 comment_size;
	const char *name;

	if(data_size<2) goto done;

	reg_val = de_getu16be(pos);
	switch(reg_val) {
	case 0: name="binary"; break;
	case 1: name="text"; break;
	default: name="?";
	}
	de_dbg(c, "comment/extension type: %d (%s)", (int)reg_val, name);

	comment_pos = pos+2;
	comment_size = data_size-2;

	if(reg_val==1) {
		handle_comment(c, d, comment_pos, comment_size);
	}
	else {
		de_dbg_hexdump(c, c->infile, comment_pos, comment_size, 256, NULL, 0x1);
	}

done:
	;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x2, %r9
jl 0x88b3b
movq %r9, %r14
movq %r8, %r15
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq %r8, %rsi
callq 0xeeb67
movq %rax, %r12
cmpq $0x1, %rax
leaq 0xa4293(%rip), %rax     # 0x12ccfb
leaq 0xa36e2(%rip), %rdx     # 0x12c151
cmoveq %rax, %rdx
testq %r12, %r12
leaq 0xb793c(%rip), %rcx     # 0x1403b9
cmovneq %rdx, %rcx
leaq 0xa4166(%rip), %rsi     # 0x12cbee
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
addq $0x2, %r15
addq $-0x2, %r14
cmpq $0x1, %r12
jne 0x88b19
cmpl $0x1, 0x90(%rbx)
jg 0x88b47
testq %r14, %r14
je 0x88b3b
cmpl $0x0, (%rbx)
jle 0x88b3b
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r12
movq 0x18(%rbx), %rdi
movl $0x5, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r15, %rsi
movq %r14, %rdx
movq %rax, %r8
xorl %r9d, %r9d
callq 0xefc2a
movq %r12, %rdi
callq 0xf70f6
leaq 0x8bd87(%rip), %rsi     # 0x114880
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf6753
movq 0x18(%rbx), %rsi
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
xorl %r9d, %r9d
callq 0xe8bea
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
testq %r14, %r14
je 0x88b3b
leaq 0x8f9e0(%rip), %rsi     # 0x118533
movq %rbx, %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0xefda1
movq %rax, %r12
movq 0x18(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
movl $0x5, %ecx
movq %rax, %r8
movl $0x2, %r9d
callq 0xf1883
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf052b
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/j2c.c
// Function: handler_sot
static void handler_sot(deark *c, lctx *d, struct page_ctx *pg,
	const struct marker_info *mi, i64 pos1, i64 len)
{
	i64 x;
	i64 b;
	i64 pos = pos1;

	pg->j2c_sot_pos = 0;
	pg->j2c_sot_length = 0;
	if(len<8) return;

	pg->j2c_sot_pos = pos1 - 4;
	x = de_getu16be_p(&pos);
	de_dbg(c, "tile number: %d", (int)x);
	pg->j2c_sot_length = de_getu32be_p(&pos);
	de_dbg(c, "length: %u", (unsigned int)pg->j2c_sot_length);
	b = de_getbyte_p(&pos);
	de_dbg(c, "tile-part instance: %d", (int)b);
	b = de_getbyte_p(&pos);
	de_dbg(c, "number of tile-parts: %d", (int)b);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r8, 0x8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdx)
cmpq $0x8, %r9
jl 0x88c49
movq %rdx, %r15
movq %rdi, %rbx
addq $-0x4, %r8
movq %r8, 0x8(%rdx)
movq 0x18(%rdi), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0xeeb91
leaq 0xa4034(%rip), %rsi     # 0x12cc0e
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeed31
movq %rax, 0x10(%r15)
leaq 0xa53bc(%rip), %rsi     # 0x12dfb9
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeeb4b
movzbl %al, %edx
leaq 0xa3fff(%rip), %rsi     # 0x12cc1e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeeb4b
movzbl %al, %edx
leaq 0xa3ff6(%rip), %rsi     # 0x12cc35
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/ogg.c
// Function: de_module_ogg
void de_module_ogg(deark *c, struct deark_module_info *mi)
{
	mi->id = "ogg";
	mi->desc = "Ogg multimedia";
	mi->run_fn = de_run_ogg;
	mi->identify_fn = de_identify_ogg;
	mi->help_fn = de_help_ogg;
}

// Assembly:
leaq 0x99d42(%rip), %rax     # 0x122dca
movq %rax, (%rsi)
leaq 0xa3c97(%rip), %rax     # 0x12cd29
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x890b8
movq %rax, 0x18(%rsi)
leaq 0x6c2(%rip), %rax       # 0x8976a
movq %rax, 0x20(%rsi)
leaq 0x706(%rip), %rax       # 0x897b9
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/ogg.c
// Function: de_identify_ogg
static int de_identify_ogg(deark *c)
{
	i64 pos = 0;

	if(!c->detection_data->id3.detection_attempted) {
		de_err(c, "ogg detection requires id3 module");
		return 0;
	}

	if(c->detection_data->id3.has_id3v2) {
		pos = (i64)c->detection_data->id3.bytes_at_start;
	}

	if(!dbuf_memcmp(c->infile, pos, "OggS", 4))
		return 100;

	return 0;
}

// Assembly:
pushq %rbx
movq 0x28(%rdi), %rax
cmpb $0x0, 0x14(%rax)
je 0x89782
xorl %ebx, %ebx
cmpb $0x0, 0x15(%rax)
je 0x89794
movl 0x18(%rax), %esi
jmp 0x89796
leaq 0xa388d(%rip), %rsi     # 0x12d016
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xe9295
jmp 0x897b5
xorl %esi, %esi
movq 0x18(%rdi), %rdi
leaq 0xa3897(%rip), %rdx     # 0x12d038
movl $0x4, %ecx
callq 0xefc85
testl %eax, %eax
movl $0x64, %eax
cmovel %eax, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/ogg.c
// Function: do_theora_vorbis_after_headers
static void do_theora_vorbis_after_headers(deark *c, lctx *d, struct stream_info *si)
{
	i64 pos = 0;
	int saved_indent_level;
	dbuf *f = NULL;

	de_dbg_indent_save(c, &saved_indent_level);
	if(si->stream_state!=0) goto done;
	if(!si->header_stream) goto done;
	if(!si->sti) goto done;
	f = si->header_stream;

	de_dbg(c, "[decoding %s comment/setup headers, %d bytes]",
		si->sti->name, (int)si->header_stream->len);
	de_dbg_indent(c, 1);

	// Make sure the comment header signature is present.
	if(si->stream_type==STREAMTYPE_VORBIS) {
		if(dbuf_memcmp(f, 0, "\x03" "vorbis", 7)) {
			goto done;
		}
		pos += 7;
	}
	else if(si->stream_type==STREAMTYPE_THEORA) {
		if(dbuf_memcmp(f, 0, "\x81" "theora", 7)) {
			goto done;
		}
		pos += 7;
	}

	do_vorbis_comment_block(c, d, f, pos);

	// TODO: "Setup" header

done:
	si->stream_state = 1;
	dbuf_close(si->header_stream);
	si->header_stream = NULL;
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
callq 0xe8a1c
cmpl $0x0, 0x20(%r14)
je 0x89817
movl $0x1, 0x20(%r14)
movq 0x28(%r14), %rdi
callq 0xf052b
movq $0x0, 0x28(%r14)
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x28(%r14), %r15
testq %r15, %r15
je 0x897e6
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x897e6
movq 0x18(%rax), %rdx
movl 0x18(%r15), %ecx
leaq 0xa3551(%rip), %rsi     # 0x12cd89
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movl (%r14), %eax
cmpl $0x2, %eax
je 0x89868
cmpl $0x1, %eax
jne 0x8988c
leaq 0xa3551(%rip), %rdx     # 0x12cdb7
jmp 0x8986f
leaq 0xa3550(%rip), %rdx     # 0x12cdbf
movl $0x7, %r12d
movl $0x7, %ecx
movq %r15, %rdi
xorl %esi, %esi
callq 0xefc85
testl %eax, %eax
jne 0x897e6
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x8989f
jmp 0x897e6
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/ogg.c
// Function: do_vorbis_comment_block
static void do_vorbis_comment_block(deark *c, lctx *d, dbuf *f, i64 pos1)
{
	i64 pos = pos1;
	i64 n;
	i64 ncomments;
	i64 k;
	de_ucstring *s = NULL;

	n = dbuf_getu32le_p(f, &pos);
	if(pos+n > f->len) goto done;
	s = ucstring_create(c);
	dbuf_read_to_ucstring_n(f, pos, n, DE_DBG_MAX_STRLEN, s, 0, DE_ENCODING_UTF8);
	de_dbg(c, "vendor: \"%s\"", ucstring_getpsz_d(s));
	pos += n;

	ncomments = dbuf_getu32le_p(f, &pos);
	de_dbg(c, "number of comments: %d", (int)ncomments);

	for(k=0; k<ncomments; k++) {
		if(pos+4 > f->len) goto done;
		n = dbuf_getu32le_p(f, &pos);
		if(pos+n > f->len) goto done;
		ucstring_empty(s);
		dbuf_read_to_ucstring_n(f, pos, n, DE_DBG_MAX_STRLEN, s, 0, DE_ENCODING_UTF8);
		de_dbg(c, "comment[%d]: \"%s\"", (int)k, ucstring_getpsz_d(s));
		pos += n;
	}

done:
	ucstring_destroy(s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %r15
movq %rdx, (%r15)
movq %rsi, %rdi
movq %r15, %rsi
callq 0xeed83
movq %rax, %r12
movq (%r15), %rax
addq %r12, %rax
cmpq 0x18(%rbx), %rax
jle 0x898dd
xorl %r15d, %r15d
jmp 0x899e9
movq %r14, %rdi
callq 0xf6410
movq %rax, %r15
leaq 0x10(%rsp), %r13
movq (%r13), %rsi
movl $0x2, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %r8
xorl %r9d, %r9d
callq 0xefc2a
movq %r15, %rdi
callq 0xf70f6
leaq 0xa34aa(%rip), %rsi     # 0x12cdc7
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
addq %r12, (%r13)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xeed83
movq %rax, %r12
leaq 0xa3491(%rip), %rsi     # 0x12cdd4
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
testq %r12, %r12
jle 0x899e9
leaq 0x10(%rsp), %rax
movq (%rax), %r13
xorl %ebp, %ebp
addq $0x4, %r13
cmpq 0x18(%rbx), %r13
jg 0x899e9
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0xeed83
movq %rax, %r13
movq 0x10(%rsp), %rax
addq %r13, %rax
cmpq 0x18(%rbx), %rax
jg 0x899e9
movq %r15, %rdi
callq 0xf6423
movq 0x10(%rsp), %rsi
movl $0x2, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %rbx, %rdi
movq %r13, %rdx
movq %r15, %r8
xorl %r9d, %r9d
callq 0xefc2a
movq %r15, %rdi
callq 0xf70f6
movq %r14, %rdi
leaq 0xa3424(%rip), %rsi     # 0x12cdeb
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
addq 0x10(%rsp), %r13
movq %r13, 0x10(%rsp)
incq %rbp
cmpq %rbp, %r12
jne 0x89963
movq %r15, %rdi
callq 0xf6753
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/ogg.c
// Function: declare_ogg_format
static void declare_ogg_format(deark *c, lctx *d)
{
	char tmps[80];
	const char *name = NULL;

	if(d->format_declared) return;
	d->format_declared = 1;

	// There's no nice way, that I know of, to characterize the contents of an Ogg
	// file. But I think it's worth trying.

	if(d->bitstream_count<1) {
		// If there are zero streams : "other"
	}
	else if(d->found_ogm) {
		// else if there's an OGM stream of any kind...
		name="OGM";
	}
	else if(d->found_skeleton) {
		// else If there's a Skeleton stream...
		name="Skeleton";
	}
	else if(d->first_stream_type_valid && d->first_stream_sti &&
		!d->has_unknown_or_multiple_stream_types)
	{
		// else if all streams are the same known type: that stream type
		name = d->first_stream_sti->name;
	}
	else if(d->found_theora && d->found_vorbis && !d->has_non_vorbis_non_theora_stream) {
		// else if there are Theora and Vorbis streams and nothing else...
		name="Theora+Vorbis";
	}
	else if(d->found_theora) {
		// else if there's a Theora stream...
		name="Theora+other";
	}
	// (else "other")

	de_snprintf(tmps, sizeof(tmps), "Ogg %s", name?name:"(other)");
	de_declare_fmt(c, tmps);
}

// Assembly:
cmpb $0x0, 0x20(%rsi)
je 0x89a07
retq
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movb $0x1, 0x20(%rsi)
cmpq $0x0, 0x10(%rsi)
jle 0x89a73
cmpb $0x0, 0x22(%rsi)
je 0x89a2b
leaq 0xa35c7(%rip), %rax     # 0x12cff0
jmp 0x89a75
cmpb $0x0, 0x21(%rsi)
je 0x89a3a
leaq 0xa3252(%rip), %rax     # 0x12cc8a
jmp 0x89a75
cmpl $0x0, 0x28(%rsi)
je 0x89a4f
movq 0x38(%rsi), %rax
testq %rax, %rax
je 0x89a4f
cmpl $0x0, 0x30(%rsi)
je 0x89ab8
cmpb $0x0, 0x24(%rsi)
je 0x89a73
cmpb $0x0, 0x23(%rsi)
je 0x89aaf
cmpl $0x0, 0x34(%rsi)
leaq 0xa358e(%rip), %rcx     # 0x12cff4
leaq 0xa3595(%rip), %rax     # 0x12d002
cmoveq %rcx, %rax
jmp 0x89a75
xorl %eax, %eax
testq %rax, %rax
leaq 0xa1d6f(%rip), %rcx     # 0x12b7ee
cmovneq %rax, %rcx
leaq 0xa3585(%rip), %rdx     # 0x12d00f
movq %rsp, %r14
movl $0x50, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0xe8193
movq %rbx, %rdi
movq %r14, %rsi
callq 0xeb125
addq $0x58, %rsp
popq %rbx
popq %r14
retq
leaq 0xa354c(%rip), %rax     # 0x12d002
jmp 0x89a75
movq 0x18(%rax), %rax
jmp 0x89a75
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/olepropset.c
// Function: de_module_olepropset
void de_module_olepropset(deark *c, struct deark_module_info *mi)
{
	mi->id = "olepropset";
	mi->desc = "OLE Property Set";
	mi->run_fn = de_run_olepropset;
	mi->flags |= DE_MODFLAG_HIDDEN;
}

// Assembly:
leaq 0x90488(%rip), %rax     # 0x119f4f
movq %rax, (%rsi)
leaq 0xa366f(%rip), %rax     # 0x12d140
movq %rax, 0x8(%rsi)
leaq 0x9(%rip), %rax         # 0x89ae5
movq %rax, 0x18(%rsi)
orb $0x1, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/olepropset.c
// Function: do_prop_CodePageString2
static void do_prop_CodePageString2(deark *c, lctx *d, struct propset_struct *si,
	const char *name, i64 dpos, int is_dict_name, i64 *bytes_consumed,
	de_ucstring *s)
{
	i64 n_raw;
	int is_utf16 = (si->code_page==1200);
	de_encoding encoding = si->encoding;

	if(is_utf16 && is_dict_name && d->asciipropnames) {
		// A hack that the user can enable. Some dictionaries use an 8-bit
		// encoding even though they have CodePage=1200, and I don't know
		// how to detect this.
		is_utf16 = 0;
		encoding = DE_ENCODING_ASCII;
	}

	n_raw = dbuf_getu32le(d->f, dpos);

	if(is_utf16) {
		i64 n;

		if(is_dict_name) {
			n = n_raw*2;
		}
		else {
			n = n_raw;
		}
		dbuf_read_to_ucstring_n(d->f, dpos+4, n, DE_DBG_MAX_STRLEN*2, s,
			0, encoding);
		ucstring_truncate_at_NUL(s);
		if(is_dict_name) {
			*bytes_consumed = 4 + de_pad_to_4(n_raw*2);
		}
		else {
			*bytes_consumed = 4 + de_pad_to_4(n_raw);
		}
	}
	else {
		dbuf_read_to_ucstring_n(d->f, dpos+4, n_raw, DE_DBG_MAX_STRLEN, s,
			DE_CONVFLAG_STOP_AT_NUL, encoding);
		*bytes_consumed = 4 + n_raw;
	}
	de_dbg(c, "%s: \"%s\"", name, ucstring_getpsz(s));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r13
movq %r8, 0x20(%rsp)
movl %ecx, 0xc(%rsp)
movq %rsi, %rbx
movq %rdi, 0x18(%rsp)
movq 0x70(%rsp), %r15
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x60(%rsp), %ebp
cmpl $0x4b0, %edx            # imm = 0x4B0
setne %al
testl %ebp, %ebp
sete %cl
orb %al, %cl
jne 0x8a71d
movl 0xc(%rbx), %r14d
movq (%rbx), %rdi
movq %r13, %rsi
callq 0xeed61
movq %rax, %r12
movl $0x1, %eax
testl %r14d, %r14d
jne 0x8a77a
jmp 0x8a737
movl %edx, %r14d
movq (%rbx), %rdi
movq %r13, %rsi
callq 0xeed61
movq %rax, %r12
cmpl $0x4b0, %r14d           # imm = 0x4B0
jne 0x8a776
leaq (%r12,%r12), %r14
testl %ebp, %ebp
movq %r12, %rdx
cmovneq %r14, %rdx
movq (%rbx), %rdi
addq $0x4, %r13
movl 0xc(%rsp), %eax
movl %eax, (%rsp)
movl $0x3e8, %ecx            # imm = 0x3E8
movq %r13, %rsi
movq %r15, %r8
xorl %r9d, %r9d
callq 0xefc2a
movq %r15, %rdi
callq 0xf6461
testl %ebp, %ebp
je 0x8a79f
movq %r14, %rdi
jmp 0x8a7a2
movl 0xc(%rsp), %eax
movq (%rbx), %rdi
addq $0x4, %r13
movl %eax, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %r8
movl $0x1, %r9d
callq 0xefc2a
jmp 0x8a7aa
movq %r12, %rdi
callq 0xe9c87
movq %rax, %r12
addq $0x4, %r12
movq 0x10(%rsp), %rax
movq %r12, (%rax)
movq %r15, %rdi
callq 0xf705c
leaq 0xa1965(%rip), %rsi     # 0x12c12a
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rdx
movq %rax, %rcx
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe8617
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/olepropset.c
// Function: get_prop_data_type_name
static char *get_prop_data_type_name(char *buf, size_t buf_len, u32 dt)
{
	const char *name = NULL;
	const char *prefix = "";
	size_t k;

	if(dt>=0x1000 && dt<0x2000) {
		prefix = "vector of ";
		dt -= 0x1000;
	}
	else if(dt>=0x2000 && dt<0x3000) {
		prefix = "array of ";
		dt -= 0x2000;
	}

	for(k=0; k<DE_ARRAYCOUNT(prop_data_type_info_arr); k++) {
		if(prop_data_type_info_arr[k].dt == dt) {
			name = prop_data_type_info_arr[k].name;
			break;
		}
	}

	if(name) {
		de_snprintf(buf, buf_len, "%s%s", prefix, name);
	}
	else {
		de_strlcpy(buf, "?", buf_len);
	}

	return buf;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl %esi, %eax
andl $0xfffff000, %eax       # imm = 0xFFFFF000
cmpl $0x1000, %eax           # imm = 0x1000
jne 0x8a808
addl $0xfffff000, %esi       # imm = 0xFFFFF000
leaq 0xa307e(%rip), %rcx     # 0x12d884
jmp 0x8a82a
leal -0x2000(%rsi), %edx
cmpl $0x2000, %eax           # imm = 0x2000
cmovnel %esi, %edx
leaq 0xa3072(%rip), %rax     # 0x12d88f
leaq 0xba88c(%rip), %rcx     # 0x1450b0
cmoveq %rax, %rcx
movl %edx, %esi
movl $0x8, %eax
leaq 0xfa9da(%rip), %rdx     # 0x185210
cmpl %esi, -0x8(%rax,%rdx)
je 0x8a84a
addq $0x10, %rax
cmpq $0x158, %rax            # imm = 0x158
jne 0x8a836
jmp 0x8a86b
movq (%rax,%rdx), %r8
testq %r8, %r8
je 0x8a86b
leaq 0xbbd13(%rip), %rdx     # 0x14656d
movl $0x50, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8193
jmp 0x8a87f
leaq 0xa18df(%rip), %rsi     # 0x12c151
movl $0x50, %edx
movq %rbx, %rdi
callq 0xe8219
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/olepropset.c
// Function: do_prop_any_int
static void do_prop_any_int(deark *c, lctx *d, struct propset_struct *si,
	struct prop_info_struct *pinfo, const char *name, i64 pos,
	unsigned int nbytes, int is_signed)
{
	i64 n;
	char descr[200];

	// FIXME: This doesn't really support uint64.
	n = dbuf_getint_ext(d->f, pos, nbytes, 1, is_signed);

	descr[0] = '\0';

	if(pinfo->prop_id==0x00000001U) { // code page
		// Code page is usually a *signed* 16-bit int, which means the maximum
		// value is 32767, even though code pages can go up to 65535.
		// Apparently, code pages over 32767 are stored as negative numbers.
		if(de_int_in_range(n, -32768, -1)) {
			si->code_page = (int)(n + 65536);
		}
		else {
			si->code_page = (int)n;
		}

		si->encoding = de_windows_codepage_to_encoding(c, si->code_page,
			descr, sizeof(descr), 0x1);
		if(si->encoding==DE_ENCODING_UNKNOWN) {
			si->encoding = DE_ENCODING_ASCII;
		}
	}

	if(descr[0]) {
		de_dbg(c, "%s: %"I64_FMT" (%s)", name, n, descr);
	}
	else {
		de_dbg(c, "%s: %"I64_FMT, name, n);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, %r12
movq %rdi, %r14
movl 0x100(%rsp), %edx
movl 0x108(%rsp), %r8d
movq %rsi, %rdi
movq %r9, %rsi
movl $0x1, %ecx
callq 0xef0f6
movq %rax, %r15
movb $0x0, (%rsp)
cmpl $0x1, (%r13)
jne 0x8b028
movq %r15, %rdi
movq $-0x8000, %rsi          # imm = 0x8000
movq $-0x1, %rdx
callq 0xe9c51
leal 0x10000(%r15), %esi
testl %eax, %eax
cmovel %r15d, %esi
movl %esi, 0xc(%r12)
movq %rsp, %r13
movl $0xc8, %ecx
movq %r14, %rdi
movq %r13, %rdx
movl $0x1, %r8d
callq 0xecb53
cmpl $0x1, %eax
adcl $0x0, %eax
movl %eax, 0x10(%r12)
cmpb $0x0, (%r13)
je 0x8b028
leaq 0x8bc1e(%rip), %rsi     # 0x116c31
movq %rsp, %r8
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe8617
jmp 0x8b03f
leaq 0x97288(%rip), %rsi     # 0x1222b7
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe8617
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iso9660.c
// Function: de_module_iso9660
void de_module_iso9660(deark *c, struct deark_module_info *mi)
{
	mi->id = "iso9660";
	mi->desc = "ISO 9660 (CD-ROM) image";
	mi->run_fn = de_run_iso9660;
	mi->identify_fn = de_identify_iso9660;
	mi->help_fn = de_help_iso9660;
}

// Assembly:
leaq 0xa29f9(%rip), %rax     # 0x12da50
movq %rax, (%rsi)
leaq 0xa29f7(%rip), %rax     # 0x12da58
movq %rax, 0x8(%rsi)
leaq 0x1b(%rip), %rax        # 0x8b087
movq %rax, 0x18(%rsi)
leaq 0x6e2(%rip), %rax       # 0x8b759
movq %rax, 0x20(%rsi)
leaq 0x709(%rip), %rax       # 0x8b78b
movq %rax, 0x28(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iso9660.c
// Function: de_identify_iso9660
static int de_identify_iso9660(deark *c)
{
	if(cdsig_at2(c->infile, 32768, 32768+2048)) {
		// Confidence is practically 100%, but since hybrid formats are
		// possible, we want other modules to be able to have precedence.
		return 80;
	}
	return 0;
}

// Assembly:
pushq %rbx
movq 0x18(%rdi), %rbx
movl $0x8000, %esi           # imm = 0x8000
movq %rbx, %rdi
callq 0x8de77
testl %eax, %eax
je 0x8b787
movl $0x8800, %esi           # imm = 0x8800
movq %rbx, %rdi
callq 0x8de77
movl %eax, %ecx
movl $0x50, %eax
testl %ecx, %ecx
jne 0x8b789
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iso9660.c
// Function: de_module_cd_raw
void de_module_cd_raw(deark *c, struct deark_module_info *mi)
{
	mi->id = "cd_raw";
	mi->desc = "Raw CD image";
	mi->run_fn = de_run_cd_raw;
	mi->identify_fn = de_identify_cd_raw;
}

// Assembly:
leaq 0xa22a9(%rip), %rax     # 0x12da70
movq %rax, (%rsi)
leaq 0xa22a6(%rip), %rax     # 0x12da77
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x8b7ec
movq %rax, 0x18(%rsi)
leaq 0x1c8(%rip), %rax       # 0x8b9af
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iso9660.c
// Function: de_run_cd_raw
static void de_run_cd_raw(deark *c, de_module_params *mparams)
{
	struct cdraw_params cdrp;

	cdraw_setdefaults(&cdrp);
	cdraw_detect_params(c->infile, &cdrp);
	if(!cdrp.ok) {
		de_err(c, "Failed to detect raw CD format");
		goto done;
	}

	de_dbg(c, "total bytes/sector: %"I64_FMT, cdrp.sector_total_len);
	de_dbg(c, "data bytes/sector: %"I64_FMT, cdrp.sector_dlen);
	de_dbg(c, "data offset: %"I64_FMT, cdrp.sector_data_offset);

	do_cdraw_convert(c, &cdrp);

done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movl $0x0, (%r14)
movl $0x800, %eax            # imm = 0x800
movq %rax, 0x8(%r14)
movq %rax, 0x10(%r14)
movq $0x0, 0x18(%r14)
leaq 0xa9f98(%rip), %rax     # 0x1357bd
movq %rax, 0x20(%r14)
movq 0x18(%rdi), %rdi
movq %r14, %rsi
callq 0x8deea
cmpl $0x0, (%r14)
je 0x8b990
movq 0x18(%rsp), %r13
leaq 0xa2f38(%rip), %rsi     # 0x12e783
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x20(%rsp), %r15
leaq 0xa2f35(%rip), %rsi     # 0x12e79b
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x28(%rsp), %r12
leaq 0xa598e(%rip), %rsi     # 0x13120d
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
callq 0xea504
movq %rax, 0x8(%rsp)
movq %r13, %r14
shlq $0x4, %r14
addq %r12, %r14
movq 0x18(%rbx), %rdi
leaq 0xa2f08(%rip), %rdx     # 0x12e7b6
movl $0x6, %ecx
movq %r14, %rsi
callq 0xefc85
testl %eax, %eax
jne 0x8b930
movq %rbx, %rdi
callq 0xf6410
movq %rax, %rbp
movq 0x18(%rbx), %rdi
addq $0x28, %r14
movl $0x20, %edx
movq %r14, %rsi
movq %rax, %rcx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0xefbd7
movq %rbp, %rdi
callq 0xf64a0
movq %rbp, %rdi
callq 0xf67a3
testl %eax, %eax
je 0x8b930
movq %rbp, %rdi
callq 0xf70f6
leaq 0xa2eac(%rip), %rsi     # 0x12e7bd
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0xea53f
movq %rbp, %rdi
callq 0xf6753
movq 0x30(%rsp), %rsi
movq %rbx, %rdi
movq 0x8(%rsp), %rbp
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0xefda1
movq %rax, %r14
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %r12
jge 0x8b96f
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0xef481
addq %r13, %r12
jmp 0x8b952
movq %r14, %rdi
callq 0xf052b
movq %rbx, %rdi
movq %rbp, %rsi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xea50e
leaq 0xa2dcd(%rip), %rsi     # 0x12e764
movq %rbx, %rdi
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9295
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iso9660.c
// Function: de_module_nrg
void de_module_nrg(deark *c, struct deark_module_info *mi)
{
	mi->id = "nrg";
	mi->desc = "NRG CD-ROM image";
	mi->run_fn = de_run_nrg;
	mi->identify_fn = de_identify_nrg;
}

// Assembly:
leaq 0xa20a0(%rip), %rax     # 0x12da84
movq %rax, (%rsi)
leaq 0xa209a(%rip), %rax     # 0x12da88
movq %rax, 0x8(%rsi)
leaq 0x10(%rip), %rax        # 0x8ba09
movq %rax, 0x18(%rsi)
leaq 0x1f5(%rip), %rax       # 0x8bbf9
movq %rax, 0x20(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iso9660.c
// Function: read_datetime17
static void read_datetime17(deark *c, lctx *d, i64 pos, int fieldlen,
	struct de_timestamp *ts)
{
	i64 yr, mo, da;
	i64 hr, mi, se, hs;
	i64 offs;

	de_zeromem(ts, sizeof(struct de_timestamp));
	yr = read_decimal_substr(c->infile, pos, 4);
	if(yr==0) return;
	mo = read_decimal_substr(c->infile, pos+4, 2);
	da = read_decimal_substr(c->infile, pos+6, 2);
	hr = read_decimal_substr(c->infile, pos+8, 2);
	mi = read_decimal_substr(c->infile, pos+10, 2);
	se = read_decimal_substr(c->infile, pos+12, 2);
	hs = read_decimal_substr(c->infile, pos+14, 2);
	if(fieldlen==16) {
		offs = 0;
	}
	else {
		offs = dbuf_geti8(c->infile, pos+16);
	}
	de_make_timestamp(ts, yr, mo, da, hr, mi, se);
	de_timestamp_set_subsec(ts, ((double)hs)/100.0);
	de_timestamp_cvt_to_utc(ts, -offs*60*15);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r12
xorpd %xmm0, %xmm0
movupd %xmm0, (%rcx)
movq 0x18(%rdi), %rdi
leaq 0x10(%rsp), %r15
movl $0x4, %ecx
movq %r15, %rsi
movq %r14, %rdx
callq 0xee8d4
movb $0x0, 0x4(%r15)
movq %r15, %rdi
callq 0xe9c2f
testq %rax, %rax
je 0x8d95c
movq %rbx, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq 0x18(%r12), %rdi
leaq 0x4(%r14), %rdx
leaq 0x10(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rsi
callq 0xee8d4
xorl %r13d, %r13d
movb %r13b, 0x2(%r15)
movq %r15, %rdi
callq 0xe9c2f
movq %rax, 0x40(%rsp)
movq 0x18(%r12), %rdi
leaq 0x6(%r14), %rdx
leaq 0x10(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rsi
callq 0xee8d4
movb %r13b, 0x2(%r15)
movq %r15, %rdi
callq 0xe9c2f
movq %rax, 0x38(%rsp)
movq 0x18(%r12), %rdi
leaq 0x8(%r14), %rdx
leaq 0x10(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rsi
callq 0xee8d4
movb %r13b, 0x2(%r15)
movq %r15, %rdi
callq 0xe9c2f
movq %rax, 0x30(%rsp)
movq 0x18(%r12), %rdi
leaq 0xa(%r14), %rdx
leaq 0x10(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rsi
callq 0xee8d4
movb %r13b, 0x2(%r15)
movq %r15, %rdi
callq 0xe9c2f
movq %rax, 0x28(%rsp)
movq 0x18(%r12), %rdi
leaq 0xc(%r14), %rdx
leaq 0x10(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rsi
callq 0xee8d4
movb %r13b, 0x2(%r15)
movq %r15, %rdi
callq 0xe9c2f
movq %rax, %rbx
movq 0x18(%r12), %rdi
leaq 0xe(%r14), %rdx
leaq 0x10(%rsp), %r15
movl $0x2, %ecx
movq %r15, %rsi
callq 0xee8d4
movb %r13b, 0x2(%r15)
movq %r15, %rdi
callq 0xe9c2f
movq %rax, %r15
cmpl $0x10, %ebp
je 0x8d912
movq 0x18(%r12), %rdi
addq $0x10, %r14
movq %r14, %rsi
callq 0xeeb33
imulq $-0x384, %rax, %r13     # imm = 0xFC7C
movq %rbx, (%rsp)
movq 0x48(%rsp), %rbx
movq %rbx, %rdi
movq 0x50(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x28(%rsp), %r9
callq 0xea98e
cvtsi2sd %r15, %xmm0
divsd 0x9219f(%rip), %xmm0    # 0x11fae8
movq %rbx, %rdi
callq 0xea849
movq %rbx, %rdi
movq %r13, %rsi
callq 0xead31
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iso9660.c
// Function: dbg_timestamp
static void dbg_timestamp(deark *c, struct de_timestamp *ts, const char *field_name)
{
	char timestamp_buf[64];

	if(ts->is_valid) {
		de_dbg_timestamp_to_string(c, ts, timestamp_buf, sizeof(timestamp_buf), 0);
		de_dbg(c, "%s: %s", field_name, timestamp_buf);
	}
	else {
		de_dbg(c, "%s: (not set)", field_name);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdx, %rbx
movq %rdi, %r14
cmpb $0x0, (%rsi)
je 0x8d9b6
movq %rsp, %r15
movl $0x40, %ecx
movq %r14, %rdi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0xeb0d6
leaq 0xbb9e6(%rip), %rsi     # 0x149382
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0xe8617
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x9e702(%rip), %rsi     # 0x12c0bf
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xe8617
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iso9660.c
// Function: free_dir_record
static void free_dir_record(deark *c, struct dir_record *dr)
{
	if(!dr) return;
	ucstring_destroy(dr->fname);
	ucstring_destroy(dr->rr_name);
	de_free(c, dr);
}

// Assembly:
testq %rsi, %rsi
je 0x8da06
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x38(%rsi), %rdi
callq 0xf6753
movq 0x40(%rbx), %rdi
callq 0xf6753
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8be2
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iso9660.c
// Function: read_datetime7
static void read_datetime7(deark *c, lctx *d, i64 pos, int fieldlen,
	struct de_timestamp *ts)
{
	i64 yr, mo, da;
	i64 hr, mi, se;
	i64 offs;

	ts->is_valid = 0;

	yr = de_getbyte(pos);
	mo = de_getbyte(pos+1);
	if(mo==0) return;
	da = de_getbyte(pos+2);
	hr = de_getbyte(pos+3);
	mi = de_getbyte(pos+4);
	se = de_getbyte(pos+5);
	if(fieldlen==6) {
		offs = 0;
	}
	else {
		offs = dbuf_geti8(c->infile, pos+6);
	}

	de_make_timestamp(ts, 1900+yr, mo, da, hr, mi, se);
	de_timestamp_cvt_to_utc(ts, -offs*60*15);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r13
movb $0x0, (%rcx)
movq 0x18(%rdi), %rdi
callq 0xeead3
movl %eax, %r15d
movq 0x18(%r13), %rdi
leaq 0x1(%r14), %rsi
callq 0xeead3
testb %al, %al
je 0x8daa3
movzbl %r15b, %r15d
movzbl %al, %eax
movq %rax, 0x20(%rsp)
movq 0x18(%r13), %rdi
leaq 0x2(%r14), %rsi
callq 0xeead3
movzbl %al, %eax
movq %rax, 0x18(%rsp)
movq 0x18(%r13), %rdi
leaq 0x3(%r14), %rsi
callq 0xeead3
movzbl %al, %eax
movq %rax, 0x10(%rsp)
movq 0x18(%r13), %rdi
leaq 0x4(%r14), %rsi
callq 0xeead3
movzbl %al, %r12d
movq 0x18(%r13), %rdi
leaq 0x5(%r14), %rsi
callq 0xeead3
movl %ebp, %ecx
movzbl %al, %ebp
cmpl $0x6, %ecx
jne 0x8dab2
xorl %r14d, %r14d
jmp 0x8dac9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%r13), %rdi
addq $0x6, %r14
movq %r14, %rsi
callq 0xeeb33
imulq $-0x384, %rax, %r14     # imm = 0xFC7C
addq $0x76c, %r15            # imm = 0x76C
movq %rbp, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %r8
movq %r12, %r9
callq 0xea98e
movq %rbx, %rdi
movq %r14, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xead31
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iso9660.c
// Function: do_Apple_AA_HFS
static void do_Apple_AA_HFS(deark *c, lctx *d, struct dir_record *dr, i64 pos1, i64 len)
{
	unsigned int finder_flags;
	struct de_fourcc type4cc;
	struct de_fourcc creator4cc;
	i64 pos = pos1+4;

	de_dbg(c, "Apple AA/HFS extension at %"I64_FMT, pos1);
	de_dbg_indent(c, 1);
	dbuf_read_fourcc(c->infile, pos, &type4cc, 4, 0x0);
	de_dbg(c, "type: '%s'", type4cc.id_dbgstr);
	pos += 4;
	dbuf_read_fourcc(c->infile, pos, &creator4cc, 4, 0x0);
	de_dbg(c, "creator: '%s'", creator4cc.id_dbgstr);
	pos += 4;
	finder_flags = (unsigned int)de_getu16be_p(&pos);
	de_dbg(c, "finder flags: 0x%04x", finder_flags);
	de_dbg_indent(c, -1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4(%rsi), %r15
leaq 0xa062c(%rip), %rsi     # 0x12e3c2
movq %r14, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
leaq 0x40(%rsp), %rdx
movq %r15, %rsi
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1762
leaq 0x50(%rsp), %rdx
leaq 0x94078(%rip), %rsi     # 0x121e4a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
leaq 0x8(%r14), %rsi
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1762
leaq 0x20(%rsp), %rdx
leaq 0xa64e9(%rip), %rsi     # 0x1342eb
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
addq $0xc, %r14
leaq 0x8(%rsp), %rsi
movq %r14, (%rsi)
movq 0x18(%rbx), %rdi
callq 0xeeb91
leaq 0x86b22(%rip), %rsi     # 0x11494a
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iso9660.c
// Function: cdsig_at
static int cdsig_at(dbuf *f, i64 pos)
{
	u8 buf[14];
	u8 ty;

	dbuf_read(f, buf, pos, sizeof(buf));
	if(!de_memcmp(&buf[1], g_sig_CD001, 5)) {
		ty = buf[0];
	}
	else if(!de_memcmp(&buf[1], g_sig_CD_I, 5)) {
		ty = buf[0];
	}
	else if(!de_memcmp(&buf[9], g_sig_CDROM, 5)) {
		ty = buf[8];
	}
	else {
		return 0;
	}
	if(ty>3 && ty<255) return 0;
	return 1;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rdx
leaq 0x2(%rsp), %rbx
movl $0xe, %ecx
movq %rbx, %rsi
callq 0xee8d4
movl $0x30304443, %eax       # imm = 0x30304443
xorl 0x1(%rbx), %eax
movzbl 0x5(%rbx), %ecx
xorl $0x31, %ecx
orl %eax, %ecx
je 0x8ded6
movl $0x492d4443, %eax       # imm = 0x492D4443
xorl 0x3(%rsp), %eax
movzbl 0x7(%rsp), %ecx
xorl $0x20, %ecx
orl %eax, %ecx
je 0x8ded6
movl $0x4f524443, %ecx       # imm = 0x4F524443
xorl 0xb(%rsp), %ecx
movzbl 0xf(%rsp), %edx
xorl $0x4d, %edx
xorl %eax, %eax
orl %ecx, %edx
jne 0x8dee4
movb 0xa(%rsp), %cl
jmp 0x8deda
movb 0x2(%rsp), %cl
incb %cl
xorl %eax, %eax
cmpb $0x5, %cl
setb %al
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/iso9660.c
// Function: my_preprocess_nrg_chunk_fn
static int my_preprocess_nrg_chunk_fn(struct de_iffctx *ictx)
{
	const char *name = NULL;

	switch(ictx->chunkctx->chunk4cc.id) {
	case CODE_CDTX: name = "CD-text"; break;
	case CODE_CUES: case CODE_CUEX: name = "cue sheet"; break;
	case CODE_DAOI: case CODE_DAOX: name = "DAO info"; break;
	case CODE_ETNF: name = "extended track info"; break;
	case CODE_SINF: name = "session info"; break;
	}

	if(name) {
		ictx->chunkctx->chunk_name = name;
	}
	return 1;
}

// Assembly:
movq 0x128(%rdi), %rax
movl 0x4(%rax), %ecx
cmpl $0x44414f48, %ecx       # imm = 0x44414F48
jle 0x8e0f2
cmpl $0x45544e45, %ecx       # imm = 0x45544E45
jg 0x8e113
cmpl $0x44414f49, %ecx       # imm = 0x44414F49
je 0x8e0e9
cmpl $0x44414f58, %ecx       # imm = 0x44414F58
jne 0x8e140
leaq 0xa075c(%rip), %rcx     # 0x12e84c
jmp 0x8e13c
cmpl $0x43445458, %ecx       # imm = 0x43445458
je 0x8e12c
cmpl $0x43554553, %ecx       # imm = 0x43554553
je 0x8e10a
cmpl $0x43554558, %ecx       # imm = 0x43554558
jne 0x8e140
leaq 0xa0731(%rip), %rcx     # 0x12e842
jmp 0x8e13c
cmpl $0x45544e46, %ecx       # imm = 0x45544E46
je 0x8e135
cmpl $0x53494e46, %ecx       # imm = 0x53494E46
jne 0x8e140
leaq 0xa073f(%rip), %rcx     # 0x12e869
jmp 0x8e13c
leaq 0xa0707(%rip), %rcx     # 0x12e83a
jmp 0x8e13c
leaq 0xa0719(%rip), %rcx     # 0x12e855
movq %rcx, 0x58(%rax)
movl $0x1, %eax
retq