LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-util.c
// Function: get_ndigits_for_offset
static int get_ndigits_for_offset(i64 n)
{
	int nd;

	if(n<10) nd=1;
	else if(n<100) nd=2;
	else if(n<1000) nd=3;
	else if(n<10000) nd=4;
	else nd=5;
	return nd;
}

// Assembly:
cmpq $0xa, %rdi
jge 0xe118a
pushq $0x1
jmp 0xe119f
cmpq $0x64, %rdi
jae 0xe1194
pushq $0x2
jmp 0xe119f
cmpq $0x3e8, %rdi            # imm = 0x3E8
jae 0xe11a1
pushq $0x3
popq %rax
retq
cmpq $0x2710, %rdi           # imm = 0x2710
pushq $0x5
popq %rax
sbbl $0x0, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_decode_hex_digit
u8 de_decode_hex_digit(u8 x, int *errorflag)
{
	if(errorflag) *errorflag = 0;
	if(x>='0' && x<='9') return x-48;
	if(x>='A' && x<='F') return x-55;
	if(x>='a' && x<='f') return x-87;
	if(errorflag) *errorflag = 1;
	return 0;
}

// Assembly:
testq %rsi, %rsi
je 0xe11cc
andl $0x0, (%rsi)
leal -0x30(%rdi), %eax
cmpb $0xa, %al
jb 0xe11ed
leal -0x41(%rdi), %eax
cmpb $0x5, %al
ja 0xe11e0
addb $-0x37, %dil
jmp 0xe11eb
leal -0x61(%rdi), %eax
cmpb $0x5, %al
ja 0xe11ee
addb $-0x57, %dil
movl %edi, %eax
retq
testq %rsi, %rsi
je 0xe11f9
movl $0x1, (%rsi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_latin2_to_unicode
static de_rune de_latin2_to_unicode(struct de_encconv_state *es, i32 a)
{
	de_rune n;
	if(a<=0x9f) n = a;
	else if(a>=0xa0 && a<=0xbf) n = (de_rune)latin2table[a-0xa0];
	else if(a>=0x0c0 && a<=0xff) n = (de_rune)windows1250table[a-0x80];
	else n = DE_CODEPOINT_INVALID;
	if(n==0xffff) n = DE_CODEPOINT_INVALID;
	return n;
}

// Assembly:
cmpl $0xa0, %esi
jge 0xe1364
movl %esi, %eax
retq
cmpl $0xbf, %esi
ja 0xe137b
addl $0xffffff60, %esi       # imm = 0xFFFFFF60
leaq 0x58087(%rip), %rax     # 0x139400
jmp 0xe1392
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmpl $0xff, %esi
ja 0xe1363
addl $-0x80, %esi
leaq 0x580ae(%rip), %rax     # 0x139440
leaq (%rax,%rsi,2), %rax
movzwl (%rax), %eax
movzwl %ax, %ecx
cmpw $-0x1, %cx
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmovnel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_cp437c_to_unicode
static de_rune de_cp437c_to_unicode(struct de_encconv_state *es, i32 a)
{
	de_rune n;
	if(a<=0x7f) n = a;
	else if(a>=0x80 && a<=0xff) n = (de_rune)cp437table[a];
	else n = DE_CODEPOINT_INVALID;
	if(n==0xffff) n = DE_CODEPOINT_INVALID;
	return n;
}

// Assembly:
cmpl $0x80, %esi
jge 0xe13b4
movl %esi, %eax
retq
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmpl $0xff, %esi
ja 0xe13ce
movl %esi, %eax
leaq 0x58176(%rip), %rcx     # 0x139540
movzwl (%rcx,%rax,2), %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_cp437h_to_unicode
static de_rune de_cp437h_to_unicode(struct de_encconv_state *es, i32 a)
{
	de_rune n;

	if(a<32 && is_hybrid_codepoint(a)) n = a;
	else n = de_cp437g_to_unicode(NULL, a);
	return n;
}

// Assembly:
cmpl $0x1f, %esi
jg 0xe13e6
cmpl $0xd, %esi
ja 0xe13f3
movl $0x2601, %eax           # imm = 0x2601
btl %esi, %eax
jae 0xe13f3
movl %esi, %eax
retq
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmpl $0xff, %esi
ja 0xe1401
movslq %esi, %rax
leaq 0x58143(%rip), %rcx     # 0x139540
movzwl (%rcx,%rax,2), %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_petscii_to_unicode
static de_rune de_petscii_to_unicode(struct de_encconv_state *es, i32 a)
{
	de_rune n;
	if(a<=0xff) n = petscii1table[a];
	else n = DE_CODEPOINT_INVALID;
	if(n==0xffff) n = DE_CODEPOINT_INVALID;
	if(a==0x0a) {
		// This is a hack to make "-m plaintext -inenc petscii" work with the
		// output from the basic_c64 module.
		if(es->enc_subtype==DE_ENCSUBTYPE_HYBRID) {
			n = 0x0a;
		}
	}
	return n;
}

// Assembly:
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmpl $0xff, %esi
jg 0xe146d
movslq %esi, %rax
leaq 0x584f3(%rip), %rcx     # 0x139940
movl (%rcx,%rax,4), %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmovnel %ecx, %eax
cmpl $0xa, %esi
jne 0xe146d
cmpl $0x3, 0x4(%rdi)
pushq $0xa
popq %rcx
cmovel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_windows1252_to_unicode
static de_rune de_windows1252_to_unicode(struct de_encconv_state *es, i32 a)
{
	de_rune n;
	if(a>=0x80 && a<=0x9f) n = (de_rune)windows1252table[a-0x80];
	else if(a<=0xff) n = a;
	else n = DE_CODEPOINT_INVALID;
	if(n==0xffff) n = DE_CODEPOINT_INVALID;
	return n;
}

// Assembly:
movl %esi, %eax
andl $-0x20, %eax
cmpl $0x80, %eax
jne 0xe148a
addl $-0x80, %esi
leaq 0x588bc(%rip), %rax     # 0x139d40
movzwl (%rax,%rsi,2), %ecx
jmp 0xe1498
cmpl $0x100, %esi            # imm = 0x100
movl $0xfffffff, %ecx        # imm = 0xFFFFFFF
cmovll %esi, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmovnel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_ext_ascii_to_unicode
static de_rune de_ext_ascii_to_unicode(struct de_encconv_state *es, i32 a)
{
	de_rune n;

	if(a<=0x7f) n = a;
	else if(a>=0x80 && a<=0xff) n = (de_rune)((struct ext_ascii_pvt_data*)es->fn_pvt_data)->tbl[a-0x80];
	else n = DE_CODEPOINT_INVALID;
	if(n==0xffff) n = DE_CODEPOINT_INVALID;
	return n;
}

// Assembly:
cmpl $0x80, %esi
jge 0xe14b2
movl %esi, %eax
retq
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmpl $0xff, %esi
ja 0xe14b1
movq 0x10(%rdi), %rax
movq (%rax), %rax
movl %esi, %ecx
movzwl -0x100(%rax,%rcx,2), %eax
movzwl %ax, %ecx
cmpw $-0x1, %cx
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmovnel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_windows874_to_unicode
static de_rune de_windows874_to_unicode(struct de_encconv_state *es, i32 a)
{
	de_rune n = 0xffff;
	if(a<=0x7f || a==0xa0) n = a;
	else if(a==0x80 || a==0x85 || (a>=0x91 && a<=0x97)) n = (de_rune)windows1252table[a-0x80];
	else if((a>=0xa1 && a<=0xda) || (a>=0xdf && a<=0xfb)) n = a + (0xe01 - 0xa1);
	if(n==0xffff) n = DE_CODEPOINT_INVALID;
	return n;
}

// Assembly:
cmpl $0x80, %esi
setl %al
cmpl $0xa0, %esi
sete %cl
orb %al, %cl
jne 0xe151f
cmpl $0x80, %esi
je 0xe1511
cmpl $0x85, %esi
je 0xe1511
leal -0x91(%rsi), %eax
cmpl $0x6, %eax
ja 0xe152e
addl $-0x80, %esi
leaq 0x58825(%rip), %rax     # 0x139d40
movzwl (%rax,%rsi,2), %esi
cmpl $0xffff, %esi           # imm = 0xFFFF
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmovnel %esi, %eax
retq
leal -0xa1(%rsi), %eax
leal -0xdf(%rsi), %ecx
addl $0xd60, %esi            # imm = 0xD60
cmpl $0x1d, %ecx
movl $0xffff, %ecx           # imm = 0xFFFF
cmovbl %esi, %ecx
cmpl $0x3a, %eax
cmovbl %esi, %ecx
movl %ecx, %esi
jmp 0xe151f
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_atarist_to_unicode
static de_rune de_atarist_to_unicode(struct de_encconv_state *es, i32 a)
{
	de_rune n;

	if(a<=0x1f || a==0x7f) {
		if (es->enc_subtype==DE_ENCSUBTYPE_HYBRID || es->enc_subtype==DE_ENCSUBTYPE_CONTROLS) {
			return a;
		}
	}
	if(a<=0x1f) n = atarist_table_lo[a];
	else if(a>=0xb0 && a<=0xff) n = (de_rune)atarist_table_hi[a-0xb0];
	else if(a==0x7f) n = 0x0394;
	else if(a==0x9e) n = 0x00df;
	else n = de_cp437g_to_unicode(NULL, a);
	if(n==0xffff) n = DE_CODEPOINT_INVALID;
	return n;
}

// Assembly:
cmpl $0x20, %esi
setge %al
cmpl $0x7f, %esi
setne %cl
testb %cl, %al
jne 0xe1573
movl 0x4(%rdi), %eax
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0xe158d
movl %esi, %eax
retq
leal -0xb0(%rsi), %eax
cmpl $0x4f, %eax
ja 0xe15af
movl %eax, %eax
leaq 0x58c79(%rip), %rcx     # 0x13a200
movzwl (%rcx,%rax,2), %ecx
jmp 0xe159f
cmpl $0x1f, %esi
jg 0xe15af
movslq %esi, %rax
leaq 0x58be4(%rip), %rcx     # 0x13a180
movl (%rcx,%rax,4), %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmovnel %ecx, %eax
jmp 0xe15de
movl $0x394, %eax            # imm = 0x394
cmpl $0x7f, %esi
je 0xe15de
movl $0xdf, %eax
cmpl $0x9e, %esi
je 0xe15de
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmpl $0xff, %esi
ja 0xe15de
movl %esi, %eax
leaq 0x57f64(%rip), %rcx     # 0x139540
jmp 0xe1587
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_riscos_to_unicode
static de_rune de_riscos_to_unicode(struct de_encconv_state *es, i32 a)
{
	de_rune n;
	if(a>=0x80 && a<=0x9f) n = (de_rune)riscostable[a-0x80];
	else if(a<=0xff) n = a;
	else n = DE_CODEPOINT_INVALID;
	if(n==0xffff) n = DE_CODEPOINT_INVALID;
	return n;
}

// Assembly:
movl %esi, %eax
andl $-0x20, %eax
cmpl $0x80, %eax
jne 0xe1619
addl $-0x80, %esi
leaq 0x58c8d(%rip), %rax     # 0x13a2a0
movzwl (%rax,%rsi,2), %ecx
jmp 0xe1627
cmpl $0x100, %esi            # imm = 0x100
movl $0xfffffff, %ecx        # imm = 0xFFFFFFF
cmovll %esi, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmovnel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_char_to_unicode_ex
de_rune de_char_to_unicode_ex(i32 a, struct de_encconv_state *es)
{
	if(a<0) return DE_CODEPOINT_INVALID;
	if(es->fn) {
		return es->fn(es, a);
	}

	switch(es->enc) {
	case DE_ENCODING_ASCII:
		if(es->enc_subtype==DE_ENCSUBTYPE_PRINTABLE) {
			return (a>=32 && a<=126)?a:DE_CODEPOINT_INVALID;
		}
		return (a<128)?a:DE_CODEPOINT_INVALID;
	case DE_ENCODING_LATIN1:
		return (a<256)?a:DE_CODEPOINT_INVALID;
	default:
		break;
	}
	return a;
}

// Assembly:
testl %edi, %edi
js 0xe168f
movl %edi, %eax
movq 0x8(%rsi), %rcx
testq %rcx, %rcx
je 0xe1695
movq %rsi, %rdi
movl %eax, %esi
jmpq *%rcx
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
retq
movl (%rsi), %ecx
cmpl $0x5, %ecx
je 0xe16af
cmpl $0x1, %ecx
jne 0xe1694
cmpl $0x4, 0x4(%rsi)
jne 0xe16b6
leal -0x20(%rax), %ecx
cmpl $0x5f, %ecx
jmp 0xe16bb
cmpl $0x100, %eax            # imm = 0x100
jmp 0xe16bb
cmpl $0x80, %eax
movl $0xfffffff, %ecx        # imm = 0xFFFFFFF
cmovbl %eax, %ecx
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_uchar_to_utf8
void de_uchar_to_utf8(de_rune u1, u8 *utf8buf, i64 *p_utf8len)
{
	u32 u = (u32)u1;

	// TODO: Maybe there should be a flag to tell what to do with
	// our special codepoints (DE_CODEPOINT_BYTE00, ...).
	if(u1<0 || u1>0x10ffff)	{
		u=0xfffd;
	}

	if(u<=0x7f) {
		*p_utf8len = 1;
		utf8buf[0] = (u8)u;
	}
	else if(u>=0x80 && u<=0x7ff) {
		*p_utf8len = 2;
		utf8buf[0] = 0xc0 | (u8)(u>>6);
		utf8buf[1] = 0x80 | (u&0x3f);
	}
	else if(u>=0x800 && u<=0xffff) {
		*p_utf8len = 3;
		utf8buf[0] = 0xe0 | (u8)(u>>12);
		utf8buf[1] = 0x80 | ((u>>6)&0x3f);
		utf8buf[2] = 0x80 | (u&0x3f);
	}
	else {
		*p_utf8len = 4;
		utf8buf[0] = 0xf0 | (u8)(u>>18);
		utf8buf[1] = 0x80 | ((u>>12)&0x3f);
		utf8buf[2] = 0x80 | ((u>>6)&0x3f);
		utf8buf[3] = 0x80 | (u&0x3f);
	}
}

// Assembly:
cmpl $0x110000, %edi         # imm = 0x110000
movl $0xfffd, %eax           # imm = 0xFFFD
cmovbl %edi, %eax
cmpl $0x7f, %eax
ja 0xe170d
movq $0x1, (%rdx)
movb %al, (%rsi)
retq
cmpl $0x7ff, %eax            # imm = 0x7FF
ja 0xe172d
movq $0x2, (%rdx)
movl %eax, %ecx
shrl $0x6, %ecx
orb $-0x40, %cl
movb %cl, (%rsi)
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x1(%rsi)
retq
cmpl $0xffff, %eax           # imm = 0xFFFF
ja 0xe175b
movq $0x3, (%rdx)
movl %eax, %ecx
shrl $0xc, %ecx
orb $-0x20, %cl
movb %cl, (%rsi)
movl %eax, %ecx
shrl $0x6, %ecx
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x1(%rsi)
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x2(%rsi)
retq
movq $0x4, (%rdx)
movl %eax, %ecx
shrl $0x12, %ecx
orb $-0x10, %cl
movb %cl, (%rsi)
movl %eax, %ecx
shrl $0xc, %ecx
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x1(%rsi)
movl %eax, %ecx
shrl $0x6, %ecx
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x2(%rsi)
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x3(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_utf8_to_uchar
int de_utf8_to_uchar(const u8 *utf8buf, i64 buflen,
	de_rune *p_uchar, i64 *p_utf8len)
{
	i32 u0=0;
	i32 u1=0;
	i32 u2=0;
	i32 u3=0;

	if(buflen<1) return 0;
	u0 = (i32)utf8buf[0];
	if(u0<=0x7f) { // 1-byte UTF-8 char
		*p_utf8len = 1;
		*p_uchar = u0;
		return 1;
	}
	if(buflen<2) return 0;
	if((utf8buf[1]&0xc0)!=0x80) return 0;
	u1 = (i32)utf8buf[1];
	if(u0<=0xdf) { // 2-byte UTF-8 char
		*p_utf8len = 2;
		*p_uchar = ((u0&0x1f)<<6) | (u1&0x3f);
		return 1;
	}
	if(buflen<3) return 0;
	if((utf8buf[2]&0xc0)!=0x80) return 0;
	u2 = (i32)utf8buf[2];
	if(u0<=0xef) { // 3-byte UTF-8 char
		*p_utf8len = 3;
		*p_uchar = ((u0&0x0f)<<12) | ((u1&0x3f)<<6) | (u2&0x3f);
		return 1;
	}
	if(buflen<4) return 0;
	if((utf8buf[3]&0xc0)!=0x80) return 0;
	u3 = (i32)utf8buf[3];
	if(u0<=0xf7) { // 4-byte UTF-8 char
		*p_utf8len = 4;
		*p_uchar = ((u0&0x07)<<18) | ((u1&0x3f)<<12) | ((u2&0x3f)<<6) | (u3&0x3f);
		return 1;
	}
	return 0;
}

// Assembly:
xorl %eax, %eax
testq %rsi, %rsi
jle 0xe18dd
movzbl (%rdi), %r8d
testb %r8b, %r8b
js 0xe17f1
movq $0x1, (%rcx)
movl %r8d, (%rdx)
pushq $0x1
popq %rax
jmp 0xe18dd
cmpq $0x1, %rsi
je 0xe18dd
movzbl 0x1(%rdi), %r9d
movl %r9d, %r10d
andl $-0x40, %r10d
cmpl $0x80, %r10d
jne 0xe18dd
cmpb $-0x21, %r8b
ja 0xe1832
movq $0x2, (%rcx)
andl $0x1f, %r8d
shll $0x6, %r8d
andl $0x3f, %r9d
orl %r9d, %r8d
jmp 0xe17e6
cmpq $0x3, %rsi
jb 0xe18dd
movzbl 0x2(%rdi), %r10d
movl %r10d, %r11d
andl $-0x40, %r11d
cmpl $0x80, %r11d
jne 0xe18dd
cmpb $-0x11, %r8b
ja 0xe1884
movq $0x3, (%rcx)
shll $0xc, %r8d
movzwl %r8w, %eax
andl $0x3f, %r9d
shll $0x6, %r9d
orl %eax, %r9d
andl $0x3f, %r10d
orl %r9d, %r10d
movl %r10d, %r8d
jmp 0xe17e6
cmpq $0x3, %rsi
je 0xe18dd
movzbl 0x3(%rdi), %esi
movl %esi, %edi
andl $-0x40, %edi
cmpl $0x80, %edi
setne %dil
cmpb $-0x8, %r8b
setae %r11b
orb %dil, %r11b
jne 0xe18dd
movq $0x4, (%rcx)
andl $0x7, %r8d
shll $0x12, %r8d
andl $0x3f, %r9d
shll $0xc, %r9d
orl %r8d, %r9d
andl $0x3f, %r10d
shll $0x6, %r10d
orl %r9d, %r10d
andl $0x3f, %esi
orl %r10d, %esi
movl %esi, %r8d
jmp 0xe17e6
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_utf8_to_ascii
void de_utf8_to_ascii(const char *src, char *dst, size_t dstlen, unsigned int flags)
{
	size_t srcpos = 0;
	size_t dstpos = 0;
	unsigned char ch;
	i32 uchar;
	i64 code_len;
	int ret;

	while(1) {
		char sc; // substitution character 1
		char sc2 = 0; // substitution character 2

		if(dstpos >= dstlen-1) {
			dst[dstlen-1] = '\0';
			break;
		}

		ch = (unsigned char)src[srcpos];
		if(ch<0x80) {
			dst[dstpos++] = src[srcpos++];
			if(ch=='\0')
				break;
		}
		else { // Start of a multi-byte UTF8 char

			ret = de_utf8_to_uchar((const u8*)&src[srcpos], 4, &uchar, &code_len);
			if(ret) {
				srcpos += (size_t)code_len;
				switch(uchar) {
				case 0x00d7: sc='x'; break; // Multiplication sign
				case 0x2018: case 0x2019: sc='\''; break; // single quotes
				case 0x201c: case 0x201d: sc='"'; break; // double quotes
				case 0x2192: sc='-'; sc2='>'; break; // Rightwards arrow
				case 0x2264: sc='<'; sc2='='; break;
				case 0x2265: sc='>'; sc2='='; break;
				case 0x2502: sc='|'; break; // Box drawings light vertical
				default: sc = '_';
				}
			}
			else {
				srcpos += 1;
				sc = '?';
			}
			dst[dstpos++] = sc;
			if(sc2 && dstpos<dstlen-1) dst[dstpos++] = sc2;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
decq %rbx
xorl %ebp, %ebp
pushq $0x1
popq %r12
xorl %r13d, %r13d
cmpq %rbx, %rbp
jae 0xe19f1
movb (%r15,%r13), %al
testb %al, %al
js 0xe192a
movb %al, (%r14,%rbp)
je 0xe19f6
incq %rbp
movq %rbp, %rdi
movq %r12, %rax
jmp 0xe19e6
leaq (%r15,%r13), %rdi
pushq $0x4
popq %rsi
leaq 0xc(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0xe17cb
testl %eax, %eax
je 0xe198f
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %ecx
leal -0x2018(%rcx), %edx
cmpl $0x2, %edx
jb 0xe199c
leal -0x201c(%rcx), %edx
cmpl $0x2, %edx
jb 0xe1998
cmpl $0xd7, %ecx
je 0xe19a9
cmpl $0x2192, %ecx           # imm = 0x2192
je 0xe19b6
cmpl $0x2264, %ecx           # imm = 0x2264
je 0xe19ad
cmpl $0x2265, %ecx           # imm = 0x2265
je 0xe19a0
cmpl $0x2502, %ecx           # imm = 0x2502
jne 0xe19bf
movb $0x7c, %dl
jmp 0xe19c1
movb $0x3f, %dl
xorl %ecx, %ecx
movq %r12, %rax
jmp 0xe19c3
movb $0x22, %dl
jmp 0xe19c1
movb $0x27, %dl
jmp 0xe19c1
movb $0x3d, %sil
movb $0x1, %cl
movb $0x3e, %dl
jmp 0xe19c5
movb $0x78, %dl
jmp 0xe19c1
movb $0x3d, %sil
movb $0x1, %cl
movb $0x3c, %dl
jmp 0xe19c5
movb $0x3e, %sil
movb $0x1, %cl
movb $0x2d, %dl
jmp 0xe19c5
movb $0x5f, %dl
xorl %ecx, %ecx
xorl %esi, %esi
leaq 0x1(%rbp), %rdi
movb %dl, (%r14,%rbp)
cmpq %rbx, %rdi
setae %dl
xorb $0x1, %cl
orb %dl, %cl
jne 0xe19e6
movb %sil, 0x1(%r14,%rbp)
addq $0x2, %rbp
movq %rbp, %rdi
addq %rax, %r13
movq %rdi, %rbp
jmp 0xe1901
movb $0x0, (%r14,%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_is_ascii
int de_is_ascii(const u8 *buf, i64 buflen)
{
	i64 i;

	for(i=0; i<buflen; i++) {
		if(buf[i]>=128) return 0;
	}
	return 1;
}

// Assembly:
xorl %ecx, %ecx
testq %rsi, %rsi
cmovleq %rcx, %rsi
pushq $0x1
popq %rax
cmpq %rcx, %rsi
je 0xe1a22
cmpb $0x0, (%rdi,%rcx)
leaq 0x1(%rcx), %rcx
jns 0xe1a11
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: get_stdpal_colors
static const u8 *get_stdpal_colors(int pal_id, int pal_subid, i64 *pncolors)
{
	const u8 *p = NULL;

	*pncolors = 0;

	switch(pal_id) {
	case DE_PALID_CGA:
		*pncolors = 4;
		if(pal_subid>=0 && pal_subid<=5) {
			p = stdpals_cga[pal_subid];
		}
		else {
			p = stdpals_cga[2];
		}
		break;
	case DE_PALID_PC16:
		*pncolors = 16;
		p = stdpal_pc16_colors;
		break;
	case DE_PALID_WIN16:
		*pncolors = 16;
		switch(pal_subid) {
		case 1: p = stdpal_win16_colors_1; break;
		case 2: p = stdpal_win16_colors_2; break;
		default: p = stdpal_win16_colors_0; break;
		}
		break;
	case DE_PALID_EGA64:
		*pncolors = 64;
		p = stdpal_ega64_colors;
		break;
	case DE_PALID_VGA256:
		*pncolors = 256;
		p = stdpal_vga256_colors;
		break;
	}
	return p;
}

// Assembly:
andq $0x0, (%rdx)
cmpl $0x32, %edi
je 0xe1ade
cmpl $0x14, %edi
je 0xe1aae
cmpl $0x1e, %edi
je 0xe1acc
cmpl $0x28, %edi
je 0xe1abd
cmpl $0xa, %edi
jne 0xe1adb
movq $0x4, (%rdx)
cmpl $0x5, %esi
ja 0xe1b09
movl %esi, %eax
imulq $0xc, %rax, %rcx
leaq 0x58876(%rip), %rax     # 0x13a320
addq %rcx, %rax
retq
movq $0x10, (%rdx)
leaq 0x588b4(%rip), %rax     # 0x13a370
retq
movq $0x100, (%rdx)          # imm = 0x100
leaq 0x58a25(%rip), %rax     # 0x13a4f0
retq
movq $0x40, (%rdx)
leaq 0x58956(%rip), %rax     # 0x13a430
retq
xorl %eax, %eax
retq
movq $0x10, (%rdx)
cmpl $0x2, %esi
leaq 0x588e1(%rip), %rax     # 0x13a3d0
leaq 0x5890a(%rip), %rcx     # 0x13a400
cmoveq %rax, %rcx
cmpl $0x1, %esi
leaq 0x5889c(%rip), %rax     # 0x13a3a0
cmovneq %rcx, %rax
retq
leaq 0x58828(%rip), %rax     # 0x13a338
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_copy_std_palette
void de_copy_std_palette(int pal_id, int pal_subid, i64 starting_idx,
	de_color *dstpal, size_t dstpal_capacity, UI flags)
{
	const u8 *pal;
	i64 n_to_copy;
	i64 stdpal_ncolors;

	if(flags & DE_COPYPALFLAG_INITPAL) {
		de_zeromem(dstpal, dstpal_capacity*sizeof(de_color));
	}

	pal = get_stdpal_colors(pal_id, pal_subid, &stdpal_ncolors);
	if(!pal) goto done;
	if(starting_idx >= stdpal_ncolors) goto done;

	n_to_copy = de_min_int((i64)dstpal_capacity, stdpal_ncolors - starting_idx);
	if(n_to_copy<=0) goto done;
	de_copy_palette_from_rgb24(&pal[starting_idx*3], dstpal, (size_t)n_to_copy);
done:
	;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %r15
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movl %edi, %r12d
testb $0x10, %r9b
je 0xe1b43
leaq (,%r15,4), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x18140
leaq 0x8(%rsp), %rdx
movl %r12d, %edi
movl %ebp, %esi
callq 0xe1a74
testq %rax, %rax
je 0xe1b92
movq 0x8(%rsp), %rsi
subq %r14, %rsi
jle 0xe1b92
movq %rax, %r12
movq %r15, %rdi
callq 0xdfb45
testq %rax, %rax
jle 0xe1b92
leaq (%r14,%r14,2), %rcx
addq %rcx, %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %rax, %rdx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xe1b9f
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_color_to_css
void de_color_to_css(de_color color, char *buf, int buflen)
{
	u8 r, g, b;

	buf[0] = '#';
	r = DE_COLOR_R(color);
	g = DE_COLOR_G(color);
	b = DE_COLOR_B(color);

	if(r%17==0 && g%17==0 && b%17==0) {
		// Can use short form.
		buf[1] = g_hexchars[r/17];
		buf[2] = g_hexchars[g/17];
		buf[3] = g_hexchars[b/17];
		buf[4] = '\0';
		return;
	}

	buf[1] = g_hexchars[r/16];
	buf[2] = g_hexchars[r%16];
	buf[3] = g_hexchars[g/16];
	buf[4] = g_hexchars[g%16];
	buf[5] = g_hexchars[b/16];
	buf[6] = g_hexchars[b%16];
	buf[7] = '\0';
}

// Assembly:
pushq %rbp
pushq %rbx
movb $0x23, (%rsi)
movl %edi, %r9d
shrl $0x10, %r9d
movl %edi, %r8d
shrl $0x8, %r8d
movzbl %r9b, %eax
movb $0x11, %r10b
divb %r10b
movl %eax, %ecx
movzbl %ah, %ebp
movzbl %r8b, %eax
divb %r10b
movl %eax, %edx
movzbl %ah, %ebx
orb %bpl, %bl
movzbl %dil, %eax
divb %r10b
movzbl %ah, %ebp
orb %bl, %bpl
je 0xe1c79
movl %edi, %eax
shrl $0x14, %eax
andl $0xf, %eax
leaq 0x59c62(%rip), %r10     # 0x13b897
movb (%rax,%r10), %cl
andl $0xf, %r9d
movb (%r9,%r10), %dl
movl %edi, %eax
shrl $0xc, %eax
andl $0xf, %eax
movb (%rax,%r10), %al
andl $0xf, %r8d
movb (%r8,%r10), %r8b
movl %edi, %r9d
shrl $0x4, %r9d
andl $0xf, %r9d
movb (%r9,%r10), %r9b
movb %r9b, 0x5(%rsi)
andl $0xf, %edi
movb (%rdi,%r10), %dil
movb %dil, 0x6(%rsi)
movb $0x0, 0x7(%rsi)
jmp 0xe1c95
movzbl %cl, %ecx
leaq 0x59c14(%rip), %rdi     # 0x13b897
movb (%rcx,%rdi), %cl
movzbl %dl, %edx
movb (%rdx,%rdi), %dl
movzbl %al, %eax
movb (%rax,%rdi), %al
xorl %r8d, %r8d
movb %cl, 0x1(%rsi)
movb %dl, 0x2(%rsi)
movb %al, 0x3(%rsi)
movb %r8b, 0x4(%rsi)
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_sample_nbit_to_8bit
u8 de_sample_nbit_to_8bit(i64 n, unsigned int x)
{
	unsigned int maxval;

	if(x==0) return 0;
	if(n<1 || n>16) return 0;
	maxval = (1<<n)-1;
	if(x>=maxval) return 255;
	return (u8)(0.5+((((double)x)/(double)maxval)*255.0));
}

// Assembly:
testl %esi, %esi
sete %al
leaq -0x11(%rdi), %rcx
cmpq $-0x10, %rcx
setb %cl
orb %al, %cl
je 0xe1cbc
xorl %eax, %eax
retq
pushq $-0x1
popq %rdx
movl %edi, %ecx
shll %cl, %edx
notl %edx
movb $-0x1, %al
cmpl %esi, %edx
jbe 0xe1cbb
cvtsi2sd %esi, %xmm0
cvtsi2sd %edx, %xmm1
divsd %xmm1, %xmm0
mulsd 0x28a69(%rip), %xmm0    # 0x10a748
addsd 0x28a59(%rip), %xmm0    # 0x10a740
cvttsd2si %xmm0, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_scale_n_to_16bit
void de_scale_n_to_16bit(int n, int x_in, u8 *x_out_hi, u8 *x_out_lo)
{
	double tmp1;
	UI tmp2;

	if(x_in<0) x_in = 0;
	if(x_in>n) x_in = n;
	tmp1 = ((double)x_in / (double)n) * 65535.0;
	tmp2 = (UI)(tmp1 + 0.5);
	*x_out_hi = (tmp2 & 0xff00)>>8;
	*x_out_lo = (tmp2 & 0xff);
}

// Assembly:
xorl %eax, %eax
testl %esi, %esi
cmovgl %esi, %eax
cmpl %edi, %eax
cmovgel %edi, %eax
cvtsi2sd %eax, %xmm0
cvtsi2sd %edi, %xmm1
divsd %xmm1, %xmm0
mulsd 0x59a6c(%rip), %xmm0    # 0x13b800
addsd 0x289a4(%rip), %xmm0    # 0x10a740
cvttsd2si %xmm0, %rax
movb %ah, (%rdx)
movb %al, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_rgb565_to_888
de_color de_rgb565_to_888(u32 x)
{
	u8 cr, cg, cb;
	cr = (u8)(x>>11);
	cg = (u8)((x>>5)&0x3f);
	cb = (u8)(x&0x1f);
	cr = (u8)(0.5+((double)cr)*(255.0/31.0));
	cg = (u8)(0.5+((double)cg)*(255.0/63.0));
	cb = (u8)(0.5+((double)cb)*(255.0/31.0));
	return DE_MAKE_RGB(cr, cg, cb);
}

// Assembly:
movl %edi, %eax
shrl $0xb, %eax
movl %edi, %edx
movl $0xff, %ecx
andl %ecx, %eax
cvtsi2sd %eax, %xmm0
shrl $0x5, %edx
movsd 0x59a45(%rip), %xmm1    # 0x13b808
mulsd %xmm1, %xmm0
movsd 0x28971(%rip), %xmm2    # 0x10a740
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %esi
andl $0x3f, %edx
cvtsi2sd %edx, %xmm0
mulsd 0x59a0a(%rip), %xmm0    # 0x13b7f0
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %edx
andl $0x1f, %edi
cvtsi2sd %edi, %xmm0
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %eax
shll $0x10, %esi
andl %ecx, %edx
shll $0x8, %edx
orl %esi, %edx
andl %ecx, %eax
orl %edx, %eax
orl $0xff000000, %eax       # imm = 0xFF000000
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_bgr555_to_888
de_color de_bgr555_to_888(u32 x)
{
	u8 cr, cg, cb;
	cb = (u8)((x>>10)&0x1f);
	cg = (u8)((x>>5)&0x1f);
	cr = (u8)(x&0x1f);
	cb = (u8)(0.5+((double)cb)*(255.0/31.0));
	cg = (u8)(0.5+((double)cg)*(255.0/31.0));
	cr = (u8)(0.5+((double)cr)*(255.0/31.0));
	return DE_MAKE_RGB(cr, cg, cb);
}

// Assembly:
movl %edi, %eax
shrl $0xa, %eax
movl %edi, %edx
andl $0x1f, %eax
cvtsi2sd %eax, %xmm0
mulsd 0x599dd(%rip), %xmm0    # 0x13b808
addsd 0x2890d(%rip), %xmm0    # 0x10a740
cvttsd2si %xmm0, %eax
shrl $0x5, %edx
movl $0xff, %ecx
andl %ecx, %edx
shll $0x8, %edi
orl %edx, %edi
movd %edi, %xmm0
pand 0x599ce(%rip), %xmm0    # 0x13b820
pxor %xmm1, %xmm1
punpcklbw %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
punpcklwd %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
cvtdq2pd %xmm0, %xmm0
mulpd 0x599c6(%rip), %xmm0    # 0x13b830
addpd 0x3a83e(%rip), %xmm0    # 0x11c6b0
cvttpd2dq %xmm0, %xmm0
packuswb %xmm0, %xmm0
movdqa %xmm0, %xmm2
punpcklwd %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3]
pslld $0x8, %xmm2
psrld $0x10, %xmm0
pslld $0x10, %xmm0
por %xmm2, %xmm0
movd %xmm0, %edx
andl %ecx, %eax
orl %edx, %eax
orl $0xff000000, %eax       # imm = 0xFF000000
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_rgb555_to_888
de_color de_rgb555_to_888(u32 x)
{
	u8 cr, cg, cb;
	cr = (u8)((x>>10)&0x1f);
	cg = (u8)((x>>5)&0x1f);
	cb = (u8)(x&0x1f);
	cr = (u8)(0.5+((double)cr)*(255.0/31.0));
	cg = (u8)(0.5+((double)cg)*(255.0/31.0));
	cb = (u8)(0.5+((double)cb)*(255.0/31.0));
	return DE_MAKE_RGB(cr, cg, cb);
}

// Assembly:
movl %edi, %eax
shrl $0xa, %eax
movl %edi, %ecx
andl $0x1f, %eax
cvtsi2sd %eax, %xmm0
movsd 0x5994f(%rip), %xmm1    # 0x13b808
mulsd %xmm1, %xmm0
movsd 0x2887b(%rip), %xmm2    # 0x10a740
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %edx
shrl $0x5, %ecx
andl $0x1f, %ecx
cvtsi2sd %ecx, %xmm0
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %ecx
andl $0x1f, %edi
cvtsi2sd %edi, %xmm0
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %eax
shll $0x10, %edx
movl $0xff, %esi
andl %esi, %ecx
shll $0x8, %ecx
orl %edx, %ecx
andl %esi, %eax
orl %ecx, %eax
orl $0xff000000, %eax       # imm = 0xFF000000
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_bytes_to_printable_sz
void de_bytes_to_printable_sz(const u8 *s1, i64 s1_len,
	char *s2, i64 s2_size, unsigned int conv_flags, de_ext_encoding src_ee)
{
	i64 i;
	i64 s2_pos = 0;
	de_ext_encoding src_encoding = DE_EXTENC_GET_BASE(src_ee);

	if(src_encoding!=DE_ENCODING_ASCII) {
		s2[0] = '\0';
		return;
	}

	for(i=0; i<s1_len; i++) {
		int is_printable = 0;

		if(s1[i]=='\0' && (conv_flags & DE_CONVFLAG_STOP_AT_NUL)) {
			break;
		}

		if(s1[i]>=32 && s1[i]<=126) {
			is_printable = 1;
		}

		if(is_printable) {
			if(s2_pos < s2_size-1) {
				s2[s2_pos++] = (char)s1[i];
			}
		}
		else if(conv_flags & DE_CONVFLAG_ALLOW_HL) {
			if(s2_pos < s2_size-6) {
				s2[s2_pos++] = 0x01; // DE_CODEPOINT_HL
				s2[s2_pos++] = '<';
				s2[s2_pos++] = de_get_hexcharUC((int)(s1[i]/16));
				s2[s2_pos++] = de_get_hexcharUC((int)(s1[i]%16));
				s2[s2_pos++] = '>';
				s2[s2_pos++] = 0x02; // DE_CODEPOINT_UNHL
			}
		}
		else {
			if(s2_pos < s2_size-1) {
				s2[s2_pos++] = '_';
			}
		}
	}

	s2[s2_pos] = '\0';
}

// Assembly:
pushq %rbp
pushq %rbx
cmpb $0x1, %r9b
jne 0xe1fc1
leaq -0x6(%rcx), %rax
decq %rcx
xorl %r9d, %r9d
testq %rsi, %rsi
cmovleq %r9, %rsi
leaq 0x59969(%rip), %r10     # 0x13b8a8
xorl %r11d, %r11d
cmpq %r11, %rsi
je 0xe1fbe
movb (%rdi,%r11), %bl
testb %bl, %bl
sete %bpl
testb %bpl, %r8b
jne 0xe1fbe
leal -0x20(%rbx), %ebp
cmpb $0x5e, %bpl
ja 0xe1f6a
cmpq %rcx, %r9
jge 0xe1fb9
movb %bl, (%rdx,%r9)
jmp 0xe1f7a
testb $0x20, %r8b
jne 0xe1f7f
cmpq %rcx, %r9
jge 0xe1fb9
movb $0x5f, (%rdx,%r9)
incq %r9
jmp 0xe1fb9
cmpq %rax, %r9
jge 0xe1fb9
movw $0x3c01, (%rdx,%r9)     # imm = 0x3C01
movzbl (%rdi,%r11), %ebx
shrl $0x4, %ebx
movb (%rbx,%r10), %bl
movb %bl, 0x2(%rdx,%r9)
movzbl (%rdi,%r11), %ebx
andl $0xf, %ebx
movb (%rbx,%r10), %bl
movb %bl, 0x3(%rdx,%r9)
movw $0x23e, 0x4(%rdx,%r9)   # imm = 0x23E
addq $0x6, %r9
incq %r11
jmp 0xe1f42
addq %r9, %rdx
movb $0x0, (%rdx)
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_write_codepoint_to_html
void de_write_codepoint_to_html(deark *c, dbuf *f, de_rune ch)
{
	int e; // How to encode this codepoint

	if(ch<0 || ch>0x10ffff || ch==DE_CODEPOINT_INVALID) ch=0xfffd;

	if(ch=='&' || ch=='<' || ch=='>') {
		e = 1; // HTML entity
	}
	else if(ch>=32 && ch<=126) {
		e = 2; // raw byte
	}
	else if(c->ascii_html) {
		e = 1; // HTML entity
	}
	else {
		e = 3; // UTF-8
	}

	if(e==2) {
		dbuf_writebyte(f, (u8)ch);
	}
	else if(e==3) {
		dbuf_write_uchar_as_utf8(f, ch);
	}
	else {
		dbuf_printf(f, "&#%d;", (int)ch);
	}
}

// Assembly:
movl %edx, %eax
movq %rsi, %rcx
cmpl $0x110000, %edx         # imm = 0x110000
movl $0xfffd, %edx           # imm = 0xFFFD
cmovbl %eax, %edx
cmpl $0x26, %edx
sete %al
movl %edx, %esi
andl $0x1ffffd, %esi         # imm = 0x1FFFFD
cmpl $0x3c, %esi
sete %sil
orb %al, %sil
jne 0xe2010
leal -0x20(%rdx), %eax
cmpl $0x5e, %eax
ja 0xe2007
movzbl %dl, %esi
movq %rcx, %rdi
jmp 0xe5bc5
cmpb $0x0, 0xce(%rdi)
je 0xe2021
leaq 0x59829(%rip), %rsi     # 0x13b840
movq %rcx, %rdi
xorl %eax, %eax
jmp 0xe5905
movq %rcx, %rdi
movl %edx, %esi
jmp 0xe1790
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_encoding_name_to_code
de_encoding de_encoding_name_to_code(const char *encname)
{
	size_t k;

	for(k=0; k<DE_ARRAYCOUNT(de_encmap_arr); k++) {
		if(!de_strcasecmp(encname, de_encmap_arr[k].encname)) {
			return de_encmap_arr[k].n;
		}
	}
	return DE_ENCODING_UNKNOWN;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $-0xc
popq %rcx
leaq 0xaf7c3(%rip), %r14     # 0x191800
leaq 0x10(%rcx), %r15
cmpq $0x184, %r15            # imm = 0x184
je 0xe2064
movq 0x14(%rcx,%r14), %rsi
movq %rbx, %rdi
callq 0xde4cb
movq %r15, %rcx
testl %eax, %eax
jne 0xe203d
movl (%r15,%r14), %eax
jmp 0xe2066
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_windows_codepage_to_encoding
de_encoding de_windows_codepage_to_encoding(deark *c, int wincodepage,
	char *encname, size_t encname_len, unsigned int flags)
{
	size_t k;
	const struct de_encmapwin_item *cpinfo = NULL;

	for(k=0; k<DE_ARRAYCOUNT(de_encmapwin_arr); k++) {
		if(de_encmapwin_arr[k].wincodepage == wincodepage) {
			cpinfo = &de_encmapwin_arr[k];
			break;
		}
	}

	if(cpinfo) {
		// Code page is known, though not necessarily supported.
		if(encname) {
			char note_tmp[80];
			if(cpinfo->encname_note) {
				de_snprintf(note_tmp, sizeof(note_tmp), " (%s)", cpinfo->encname_note);
			}
			else {
				note_tmp[0] = '\0';
			}
			de_snprintf(encname, encname_len, "%s%s%s", cpinfo->encname, note_tmp,
				((cpinfo->flags&0x1)==0 && (flags&0x1)!=0)?" (unsupported)":"");
		}
		return (cpinfo->flags&0x1) ? cpinfo->enc : DE_ENCODING_UNKNOWN;
	}

	if(encname) {
		de_strlcpy(encname, "?", encname_len);
	}
	return DE_ENCODING_UNKNOWN;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r14
pushq $-0x20
popq %rax
leaq 0xaf8f3(%rip), %r15     # 0x191980
leaq 0x20(%rax), %r12
cmpq $0x1e0, %r12            # imm = 0x1E0
je 0xe20c9
cmpl %esi, 0x24(%rax,%r15)
movq %r12, %rax
jne 0xe208d
testq %r14, %r14
je 0xe20e4
movq 0x18(%r12,%r15), %rcx
testq %rcx, %rcx
je 0xe20ee
leaq 0x3cae4(%rip), %rdx     # 0x11eb9e
movq %rsp, %rdi
pushq $0x50
popq %rsi
xorl %eax, %eax
callq 0xde40c
jmp 0xe20f2
xorl %ebp, %ebp
testq %r14, %r14
je 0xe213e
leaq 0x3ce0a(%rip), %rsi     # 0x11eee1
movq %r14, %rdi
movq %rbx, %rdx
callq 0xde492
jmp 0xe213e
movl (%r12,%r15), %r13d
andl $0x1, %r13d
jmp 0xe2130
movb $0x0, (%rsp)
movl (%r12,%r15), %r13d
andl $0x1, %r13d
leaq 0x59745(%rip), %r9      # 0x13b846
leaq 0x55b58(%rip), %rax     # 0x137c60
cmovneq %rax, %r9
movq 0x10(%r12,%r15), %rcx
testb $0x1, %bpl
cmoveq %rax, %r9
leaq 0x31f06(%rip), %rdx     # 0x114026
movq %rsp, %r8
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0xde40c
testl %r13d, %r13d
je 0xe213c
movl 0x8(%r12,%r15), %ebp
jmp 0xe213e
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_decode_base16
void de_decode_base16(deark *c, dbuf *inf, i64 pos1, i64 len,
	dbuf *outf, unsigned int flags)
{
	i64 pos = pos1;
	u8 b;
	int bad_warned = 0;
	struct base16_ctx {
		int cbuf_count;
		u8 cbuf[5];
	};
	struct base16_ctx *d = NULL;

	d = de_malloc(c, sizeof(struct base16_ctx));
	pos = pos1;
	d->cbuf_count = 0;
	while(pos<pos1+len) {
		b = dbuf_getbyte_p(inf, &pos);
		if(b>='0' && b<='9') {
			d->cbuf[d->cbuf_count++] = b-48;
		}
		else if(b>='A' && b<='F') {
			d->cbuf[d->cbuf_count++] = b-55;
		}
		else if(b>='a' && b<='f') {
			d->cbuf[d->cbuf_count++] = b-87;
		}
		else if(b==9 || b==10 || b==13 || b==32) {
			; // ignore whitespace
		}
		else {
			if(!bad_warned) {
				de_warn(c, "Bad hex character(s) found (offset %d)", (int)pos);
				bad_warned = 1;
			}
		}

		if(d->cbuf_count>=2) {
			dbuf_writebyte(outf, (d->cbuf[0]<<4)|(d->cbuf[1]));
			d->cbuf_count=0;
		}
	}

	if(d->cbuf_count>0) {
		de_warn(c, "Unexpected end of hex data");
	}

	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r13
pushq $0xc
popq %rsi
movq %rdi, 0x8(%rsp)
callq 0xdecaf
movq %rax, %r14
leaq 0x10(%rsp), %rbp
movq %rbx, (%rbp)
andl $0x0, (%rax)
addq %rbx, %r12
xorl %eax, %eax
movl $0x0, 0x4(%rsp)
cmpq %r12, %rbx
jge 0xe2253
movq %r13, %rdi
movq %rbp, %rsi
callq 0xe3f2a
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0xe21be
movslq (%r14), %rax
leal 0x1(%rax), %edx
movl %edx, (%r14)
movb %cl, 0x4(%r14,%rax)
jmp 0xe21e2
leal -0x41(%rax), %ecx
cmpb $0x5, %cl
ja 0xe21ca
addb $-0x37, %al
jmp 0xe21d4
leal -0x61(%rax), %ecx
cmpb $0x5, %cl
ja 0xe220d
addb $-0x57, %al
movslq (%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r14)
movb %al, 0x4(%r14,%rcx)
movl (%r14), %eax
cmpl $0x2, %eax
jl 0xe2206
movb 0x4(%r14), %al
shlb $0x4, %al
orb 0x5(%r14), %al
movzbl %al, %esi
movq %r15, %rdi
callq 0xe5bc5
andl $0x0, (%r14)
xorl %eax, %eax
movq 0x10(%rsp), %rbx
jmp 0xe2192
cmpl $0x0, 0x4(%rsp)
jne 0xe21e2
cmpb $0x20, %al
ja 0xe2233
movl $0x0, 0x4(%rsp)
movzbl %al, %eax
movabsq $0x100002600, %rcx      # imm = 0x100002600
btq %rax, %rcx
jb 0xe21e2
movl 0x10(%rsp), %edx
movq 0x8(%rsp), %rdi
leaq 0x59612(%rip), %rsi     # 0x13b855
xorl %eax, %eax
callq 0xdf05a
pushq $0x1
popq %rax
movl %eax, 0x4(%rsp)
jmp 0xe21e2
testl %eax, %eax
movq 0x8(%rsp), %rbx
jle 0xe226d
leaq 0x59619(%rip), %rsi     # 0x13b87c
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf05a
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-data.c
// Function: de_cp437like_to_unicode
static de_rune de_cp437like_to_unicode(struct de_encconv_state *es, i32 a,
	const u16 tbl2[128])
{
	de_rune n;

	if(a>0xff) n = DE_CODEPOINT_INVALID;
	else if(a>=0x20 && a<=0x7e) n = a;
	else if(a>=0x80 && a<=0xff) n = (de_rune)tbl2[a-0x80];
	else {
		if(es->enc_subtype==DE_ENCSUBTYPE_CONTROLS ||
			(es->enc_subtype==DE_ENCSUBTYPE_HYBRID && is_hybrid_codepoint(a)))
		{
			n = a;
		}
		else {
			return de_cp437g_to_unicode(es, a);
		}
	}
	return n;
}

// Assembly:
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmpl $0xff, %esi
jg 0xe229e
leal -0x20(%rsi), %eax
cmpl $0x5f, %eax
jae 0xe229f
movl %esi, %eax
retq
cmpl $0x80, %esi
jl 0xe22b5
movl %esi, %eax
leaq (%rdx,%rax,2), %rax
addq $-0x100, %rax
jmp 0xe22df
movl 0x4(%rdi), %eax
cmpl $0x2, %eax
je 0xe229c
cmpl $0x3, %eax
jne 0xe22d1
cmpl $0xd, %esi
ja 0xe22d1
movl $0x2601, %eax           # imm = 0x2601
btl %esi, %eax
jb 0xe229c
movslq %esi, %rax
leaq 0x57265(%rip), %rcx     # 0x139540
leaq (%rcx,%rax,2), %rax
movzwl (%rax), %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-zip.c
// Function: de_zip_create_file
int de_zip_create_file(deark *c)
{
	struct zipw_ctx *zzz;
	const char *opt_level;

	if(c->zip_data) return 1; // Already created. Shouldn't happen.

	zzz = de_malloc(c, sizeof(struct zipw_ctx));
	zzz->c = c;
	c->zip_data = (void*)zzz;
	zzz->crc32o = de_crcobj_create(c, DE_CRCOBJ_CRC32_IEEE);

	zzz->cmprlevel = MZ_BEST_COMPRESSION; // default
	opt_level = de_get_ext_option(c, "archive:zipcmprlevel");
	if(opt_level) {
		i64 opt_level_n = de_atoi64(opt_level);
		if(opt_level_n>9) {
			zzz->cmprlevel = 9;
		}
		else if(opt_level_n<0) {
			zzz->cmprlevel = MZ_DEFAULT_LEVEL;
		}
		else {
			zzz->cmprlevel = (unsigned int)opt_level_n;
		}
	}

	if(c->archive_to_stdout) {
		zzz->pFilename = "[stdout]";
	}
	else {
		if(c->output_archive_filename) {
			zzz->pFilename = c->output_archive_filename;
		}
		else {
			zzz->pFilename = "output.zip";
		}
	}

	if(c->archive_to_stdout) {
		zzz->outf = dbuf_create_unmanaged_file_stdout(c, "[ZIP stdout stream]");
	}
	else {
		de_info(c, "Creating %s", zzz->pFilename);
		zzz->outf = dbuf_create_unmanaged_file(c, zzz->pFilename, c->overwrite_mode, 0);
	}

	zzz->cdir = dbuf_create_membuf(c, 1024, 0);

	if(zzz->outf->btype==DBUF_TYPE_NULL) {
		de_err(c, "Failed to create ZIP file");
		dbuf_close(zzz->outf);
		zzz->outf = NULL;
		return 0;
	}

	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
pushq $0x1
popq %rbx
cmpq $0x0, 0x138(%rdi)
jne 0xe2402
movq %rdi, %r14
pushq $0x38
popq %rsi
callq 0xdecaf
movq %rax, %r15
movq %r14, (%rax)
movq %rax, 0x138(%r14)
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0xe0ae9
movq %rax, 0x30(%r15)
movl $0x9, 0x10(%r15)
leaq 0x5974b(%rip), %rsi     # 0x13ba7b
movq %r14, %rdi
callq 0xdfa87
testq %rax, %rax
je 0xe235c
movq %rax, %rdi
callq 0xdfb3b
testq %rax, %rax
pushq $0x6
popq %rcx
cmovnsl %eax, %ecx
cmpq $0xa, %rax
pushq $0x9
popq %rax
cmovll %ecx, %eax
movl %eax, 0x10(%r15)
cmpb $0x0, 0x88(%r14)
je 0xe2382
leaq 0x59aff(%rip), %rax     # 0x13be6c
movq %rax, 0x8(%r15)
leaq 0x59723(%rip), %rsi     # 0x13ba9b
movq %r14, %rdi
callq 0xe584d
jmp 0xe23c1
movq 0x160(%r14), %rax
testq %rax, %rax
leaq 0x596fd(%rip), %rdx     # 0x13ba90
cmovneq %rax, %rdx
movq %rdx, 0x8(%r15)
leaq 0x5970d(%rip), %rsi     # 0x13baaf
movq %r14, %rdi
xorl %eax, %eax
callq 0xdf37f
movq 0x8(%r15), %rsi
movl 0xd8(%r14), %edx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xe579c
movq %rax, 0x20(%r15)
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
xorl %edx, %edx
callq 0xe59cd
movq %rax, 0x28(%r15)
movq 0x20(%r15), %rax
cmpl $0x0, (%rax)
jne 0xe2402
leaq 0x596d3(%rip), %rsi     # 0x13babb
movq %r14, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq 0x20(%r15), %rdi
callq 0xe5591
andq $0x0, 0x20(%r15)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-zip.c
// Function: do_UT_times
static void do_UT_times(deark *c, struct zipw_md *md,
	dbuf *ef, int is_central)
{
	int have_crtime = 0;
	int have_actime = 0;
	i64 num_timestamps = 0; // Number to write
	i64 actime_unix = 0;
	i64 crtime_unix = 0;
	u8 flags = 0;

	if(md->actime.is_valid) {
		actime_unix = de_timestamp_to_unix_time(&md->actime);
		if(is_valid_32bit_unix_time(actime_unix)) {
			have_actime = 1;
		}
	}

	if(md->crtime.is_valid) {
		crtime_unix = de_timestamp_to_unix_time(&md->crtime);
		if(is_valid_32bit_unix_time(crtime_unix)) {
			have_crtime = 1;
		}
	}

	// Always write mod time
	num_timestamps++;
	flags |= 0x01;

	if(have_actime) {
		if(!is_central) num_timestamps++;
		flags |= 0x02;
	}

	if(have_crtime) {
		if(!is_central) num_timestamps++;
		flags |= 0x04;
	}

	dbuf_writeu16le(ef, 0x5455);
	dbuf_writeu16le(ef, (i64)(1+4*num_timestamps));
	dbuf_writebyte(ef, flags); // tells which fields are present in local header
	dbuf_writei32le(ef, md->modtime_unix);
	if(have_actime && !is_central) {
		dbuf_writei32le(ef, actime_unix);
	}
	if(have_crtime && !is_central) {
		dbuf_writei32le(ef, crtime_unix);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %r12d
movq %rsi, 0x10(%rsp)
movq %rdi, %rbx
movabsq $-0x100000000, %r14     # imm = 0xFFFFFFFF00000000
cmpb $0x0, 0x10(%rdi)
je 0xe277c
leaq 0x10(%rbx), %rdi
callq 0xe0461
movq %rax, 0x28(%rsp)
addq $-0x80000000, %rax      # imm = 0x80000000
cmpq %r14, %rax
setb %bpl
jmp 0xe2788
movq $0x0, 0x28(%rsp)
movb $0x1, %bpl
cmpb $0x0, 0x20(%rbx)
movq %rbx, 0x30(%rsp)
je 0xe27af
leaq 0x20(%rbx), %rdi
callq 0xe0461
movq %rax, 0x20(%rsp)
addq $-0x80000000, %rax      # imm = 0x80000000
cmpq %r14, %rax
setb %bl
jmp 0xe27ba
movq $0x0, 0x20(%rsp)
movb $0x1, %bl
xorl %r13d, %r13d
testl %r12d, %r12d
sete %r13b
setne 0xe(%rsp)
incl %r13d
testb %bpl, %bpl
pushq $0x1
popq %rax
cmovnel %eax, %r13d
movl %ebp, %ecx
movb %bpl, 0xd(%rsp)
leal 0x1(%r13), %ebp
movl %r12d, 0x1c(%rsp)
testl %r12d, %r12d
cmovnel %eax, %ebp
movl %ecx, %eax
xorb $0x1, %al
addb %al, %al
leal 0x1(%rax), %ecx
orb $0x5, %al
movzbl %al, %r12d
movzbl %cl, %r14d
movl $0x5455, %esi           # imm = 0x5455
movq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0xe5f08
movb %bl, 0xf(%rsp)
testb %bl, %bl
cmovel %r12d, %r14d
cmovnel %r13d, %ebp
leaq 0x1(,%rbp,4), %rsi
movzbl %r14b, %r13d
movq %r15, %rdi
callq 0xe5f08
movq %r15, %rdi
movl %r13d, %esi
callq 0xe5bc5
movq 0x30(%rsp), %rax
movq 0x30(%rax), %rsi
movq %r15, %rdi
callq 0xe5f94
movb 0xd(%rsp), %al
orb %al, 0xe(%rsp)
jne 0xe2868
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xe5f94
cmpl $0x0, 0x1c(%rsp)
setne %al
orb 0xf(%rsp), %al
je 0xe2885
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe5f94
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-zip.c
// Function: do_ntfs_times
static void do_ntfs_times(deark *c, struct zipw_md *md,
	dbuf *ef, int is_central)
{
	u64 modtm, actm, crtm;

	dbuf_writeu16le(ef, 0x000a); // = NTFS
	dbuf_writeu16le(ef, 32); // data size
	dbuf_write_zeroes(ef, 4);
	dbuf_writeu16le(ef, 0x0001); // file times element
	dbuf_writeu16le(ef, 24); // element data size
	// We only necessarily know the mod time, but we have to write something for
	// the others.
	modtm = (u64)md->modtime_as_FILETIME;
	actm = (md->actime_as_FILETIME>0) ? (u64)md->actime_as_FILETIME : modtm;
	crtm = (md->crtime_as_FILETIME>0) ? (u64)md->crtime_as_FILETIME : modtm;
	dbuf_writeu64le(ef, modtm);
	dbuf_writeu64le(ef, actm);
	dbuf_writeu64le(ef, crtm);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0xa
popq %rsi
movq %rbx, %rdi
callq 0xe5f08
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0xe5f08
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0xe5d20
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xe5f08
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0xe5f08
movq 0x40(%r14), %rsi
movq 0x48(%r14), %r15
testq %r15, %r15
cmovleq %rsi, %r15
movq 0x50(%r14), %r14
testq %r14, %r14
cmovleq %rsi, %r14
movq %rbx, %rdi
callq 0xe5fd0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe5fd0
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xe5fd0
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-zip.c
// Function: do_riscos_attribs
static void do_riscos_attribs(deark *c, struct zipw_md *md, de_finfo *fi, dbuf *ef)
{
	 if(!fi) return;
	 if(fi->riscos_appended_type) return; // Already handled attribs in a different way
	 if(!fi->has_riscos_data) return;
	 if(md->is_directory) return;
	 if(md->is_volume_label) return;
	 dbuf_writeu16le(ef, 0x4341); // AC
	 dbuf_writeu16le(ef, 20); // data size
	 dbuf_write(ef, (const u8*)"ARC0", 4);

	 // The only thing we really want to write is the file type (part of
	 // the load_addr), but unfortunately there's no way to do just that.
	 dbuf_writeu32le(ef, fi->load_addr);
	 dbuf_writeu32le(ef, fi->exec_addr);

	 // The attributes field has a "gotcha" and/or error: The ZIP documentation
	 // (from Info-Zip zip/unzip) has the Readable and Writable bits swapped
	 // from the standard RISC OS format. I can't assume that all other
	 // programmers will notice that and respect it.
	 // This just sets the file to be user-readable and user-writable.
	 // I'd like to make it public-readable (and not writable), but I don't
	 // see a safe way to do that.
	 dbuf_writeu32le(ef, 0x00000003);

	 dbuf_writeu32le(ef, 0); // reserved
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0xe2933
movq %rsi, %r14
cmpb $0x0, 0x11(%rsi)
je 0xe293b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpb $0x0, 0x10(%r14)
je 0xe2933
cmpb $0x0, 0x59(%rdi)
jne 0xe2933
cmpb $0x0, 0x5a(%rdi)
jne 0xe2933
movq %rdx, %rbx
movl $0x4341, %esi           # imm = 0x4341
movq %rdx, %rdi
callq 0xe5f08
pushq $0x14
popq %rsi
movq %rbx, %rdi
callq 0xe5f08
leaq 0x54586(%rip), %rsi     # 0x136ef6
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0xe46ba
movl 0xa4(%r14), %esi
movq %rbx, %rdi
callq 0xe5f7f
movl 0xa8(%r14), %esi
movq %rbx, %rdi
callq 0xe5f7f
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0xe5f7f
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe5f7f
// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/src/deark-tar.c
// Function: de_tar_create_file
int de_tar_create_file(deark *c)
{
	struct tar_ctx *tctx = NULL;
	int retval = 0;

	if(c->tar_data) return 1;

	tctx = de_malloc(c, sizeof(struct tar_ctx));
	c->tar_data = (void*)tctx;

	if(c->archive_to_stdout) {
		tctx->tar_filename = "[stdout]";
		de_err(c, "TAR to stdout is not implemented");
		de_fatalerror(c);
		goto done;
	}


	if(c->output_archive_filename) {
		tctx->tar_filename = c->output_archive_filename;
	}
	else {
		tctx->tar_filename = "output.tar";
	}

	de_info(c, "Creating %s", tctx->tar_filename);
	tctx->outf = dbuf_create_unmanaged_file(c, tctx->tar_filename,
		c->overwrite_mode, 0);

	if(tctx->outf->btype==DBUF_TYPE_NULL) {
		de_fatalerror(c);
		goto done;
	}

	retval = 1;

done:
	return retval;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
pushq $0x1
popq %rbp
cmpq $0x0, 0x140(%rdi)
jne 0xe3123
movq %rdi, %rbx
pushq $0x28
popq %rsi
callq 0xdecaf
movq %rax, %r14
movq %rax, 0x140(%rbx)
cmpb $0x0, 0x88(%rbx)
je 0xe30de
leaq 0x58dae(%rip), %rax     # 0x13be6c
movq %rax, (%r14)
leaq 0x58b41(%rip), %rsi     # 0x13bc09
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
movq %rbx, %rdi
callq 0xdf4d0
xorl %ebp, %ebp
jmp 0xe3123
movq 0x160(%rbx), %rax
testq %rax, %rax
leaq 0x58b3b(%rip), %rdx     # 0x13bc2a
cmovneq %rax, %rdx
movq %rdx, (%r14)
leaq 0x589b2(%rip), %rsi     # 0x13baaf
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf37f
movq (%r14), %rsi
movl 0xd8(%rbx), %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xe579c
movq %rax, 0x8(%r14)
cmpl $0x0, (%rax)
je 0xe30d2
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq