LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0xebeb2
movl %esi, %eax
retq
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmpl $0xff, %esi
ja 0xebeb1
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_O3/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 0xebf1f
cmpl $0x80, %esi
je 0xebf11
cmpl $0x85, %esi
je 0xebf11
leal -0x91(%rsi), %eax
cmpl $0x6, %eax
ja 0xebf2e
addl $-0x80, %esi
leaq 0x5b2f5(%rip), %rax     # 0x147210
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 0xebf1f
// File: /workspace/github_c_makefile_star2_O3/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 0xebf73
movl 0x4(%rdi), %eax
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0xebf8d
movl %esi, %eax
retq
leal -0xb0(%rsi), %eax
cmpl $0x4f, %eax
ja 0xebfaf
movl %eax, %eax
leaq 0x5b749(%rip), %rcx     # 0x1476d0
movzwl (%rcx,%rax,2), %ecx
jmp 0xebf9f
cmpl $0x1f, %esi
jg 0xebfaf
movslq %esi, %rax
leaq 0x5b6b4(%rip), %rcx     # 0x147650
movl (%rcx,%rax,4), %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmovnel %ecx, %eax
jmp 0xebfde
movl $0x394, %eax            # imm = 0x394
cmpl $0x7f, %esi
je 0xebfde
movl $0xdf, %eax
cmpl $0x9e, %esi
je 0xebfde
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
cmpl $0xff, %esi
ja 0xebfde
movl %esi, %eax
leaq 0x5aa34(%rip), %rcx     # 0x146a10
jmp 0xebf87
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-data.c
// Function: de_palmcs_to_unicode
static de_rune de_palmcs_to_unicode(struct de_encconv_state *es, i32 a)
{
	de_rune n;
	// This is not perfect, but the diamond/club/heart/spade characters seem to
	// be about the only printable characters common to all versions of this
	// encoding, that differ from Windows-1252.
	if(a>=0x8d && a<=0x90) n = (de_rune)palmcstable[a-0x8d];
	else n = de_windows1252_to_unicode(NULL, a);
	return n;
}

// Assembly:
leal -0x8d(%rsi), %eax
cmpl $0x3, %eax
ja 0xebff8
movl %eax, %eax
leaq 0x5cced(%rip), %rcx     # 0x148ce0
movzwl (%rcx,%rax,2), %eax
retq
movl %esi, %eax
andl $-0x20, %eax
cmpl $0x80, %eax
jne 0xec014
addl $-0x80, %esi
leaq 0x5b202(%rip), %rax     # 0x147210
movzwl (%rax,%rsi,2), %ecx
jmp 0xec022
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_O3/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 0xec04d
addl $-0x80, %esi
leaq 0x5b729(%rip), %rax     # 0x147770
movzwl (%rax,%rsi,2), %ecx
jmp 0xec05b
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_O3/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 0xec0c3
movl %edi, %eax
movq 0x8(%rsi), %rcx
testq %rcx, %rcx
je 0xec0c9
movq %rsi, %rdi
movl %eax, %esi
jmpq *%rcx
movl $0xfffffff, %eax        # imm = 0xFFFFFFF
retq
movl (%rsi), %ecx
cmpl $0x5, %ecx
je 0xec0e3
cmpl $0x1, %ecx
jne 0xec0c8
cmpl $0x4, 0x4(%rsi)
jne 0xec0ea
leal -0x20(%rax), %ecx
cmpl $0x5f, %ecx
jmp 0xec0ef
cmpl $0x100, %eax            # imm = 0x100
jmp 0xec0ef
cmpl $0x80, %eax
movl $0xfffffff, %ecx        # imm = 0xFFFFFFF
cmovbl %eax, %ecx
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xec141
movq $0x1, (%rdx)
movb %al, (%rsi)
retq
cmpl $0x7ff, %eax            # imm = 0x7FF
ja 0xec161
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 0xec18f
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_O3/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 0xec313
movzbl (%rdi), %r8d
testb %r8b, %r8b
js 0xec227
movq $0x1, (%rcx)
movl %r8d, (%rdx)
movl $0x1, %eax
jmp 0xec313
cmpq $0x1, %rsi
je 0xec313
movzbl 0x1(%rdi), %r9d
movl %r9d, %r10d
andl $-0x40, %r10d
cmpl $0x80, %r10d
jne 0xec313
cmpb $-0x21, %r8b
ja 0xec268
movq $0x2, (%rcx)
andl $0x1f, %r8d
shll $0x6, %r8d
andl $0x3f, %r9d
orl %r9d, %r8d
jmp 0xec21a
cmpq $0x3, %rsi
jb 0xec313
movzbl 0x2(%rdi), %r10d
movl %r10d, %r11d
andl $-0x40, %r11d
cmpl $0x80, %r11d
jne 0xec313
cmpb $-0x11, %r8b
ja 0xec2ba
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 0xec21a
cmpq $0x3, %rsi
je 0xec313
movzbl 0x3(%rdi), %esi
movl %esi, %edi
andl $-0x40, %edi
cmpl $0x80, %edi
setne %dil
cmpb $-0x8, %r8b
setae %r11b
orb %dil, %r11b
jne 0xec313
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 0xec21a
retq
// File: /workspace/github_c_makefile_star2_O3/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
decq %rbx
je 0xec432
movq %rdi, %r15
xorl %ebp, %ebp
leaq 0x10(%rsp), %r13
xorl %r12d, %r12d
movb (%r15,%rbp), %al
testb %al, %al
js 0xec35d
movb %al, (%r14,%r12)
je 0xec437
incq %r12
movl $0x1, %eax
jmp 0xec3ff
leaq (%r15,%rbp), %rdi
movl $0x4, %esi
leaq 0xc(%rsp), %rdx
movq %r13, %rcx
callq 0xec1ff
movl $0x1, %ecx
testl %eax, %eax
je 0xec3a7
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %esi
cmpl $0x2191, %esi           # imm = 0x2191
jg 0xec3b3
leal -0x2018(%rsi), %edx
cmpl $0x2, %edx
jb 0xec3e5
leal -0x201c(%rsi), %edx
cmpl $0x2, %edx
jae 0xec3e9
movb $0x22, %dl
jmp 0xec3f5
movb $0x3f, %dl
movq %r12, %rsi
movl $0x1, %eax
jmp 0xec3f8
cmpl $0x2264, %esi           # imm = 0x2264
jg 0xec3d1
cmpl $0x2192, %esi           # imm = 0x2192
je 0xec413
cmpl $0x2264, %esi           # imm = 0x2264
jne 0xec3f3
movb $0x3d, %dl
movb $0x3c, %cl
jmp 0xec41d
cmpl $0x2265, %esi           # imm = 0x2265
je 0xec419
cmpl $0x2502, %esi           # imm = 0x2502
jne 0xec3f3
movb $0x7c, %dl
jmp 0xec3f5
movb $0x27, %dl
jmp 0xec3f5
movb $0x78, %dl
cmpl $0xd7, %esi
je 0xec3f5
movb $0x5f, %dl
movq %r12, %rsi
addq %rcx, %r12
movb %dl, (%r14,%rsi)
movq %r12, %rsi
addq %rax, %rbp
movq %rsi, %r12
cmpq %rbx, %rsi
jb 0xec33e
jmp 0xec432
movb $0x3e, %dl
movb $0x2d, %cl
jmp 0xec41d
movb $0x3d, %dl
movb $0x3e, %cl
leaq 0x1(%r12), %rsi
movb %cl, (%r14,%r12)
movl $0x2, %ecx
cmpq %rbx, %rsi
jb 0xec3f8
jmp 0xec402
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_O3/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:
movq $0x0, (%rdx)
xorl %eax, %eax
cmpl $0x1d, %edi
jle 0xec4fd
cmpl $0x1e, %edi
je 0xec516
cmpl $0x28, %edi
je 0xec525
cmpl $0x32, %edi
jne 0xec533
movq $0x10, (%rdx)
cmpl $0x2, %esi
leaq 0x5b3bd(%rip), %rax     # 0x1478a0
leaq 0x5b3e6(%rip), %rcx     # 0x1478d0
cmoveq %rax, %rcx
cmpl $0x1, %esi
leaq 0x5b378(%rip), %rax     # 0x147870
cmovneq %rcx, %rax
retq
cmpl $0xa, %edi
je 0xec534
cmpl $0x14, %edi
jne 0xec533
movq $0x10, (%rdx)
leaq 0x5b32b(%rip), %rax     # 0x147840
retq
movq $0x40, (%rdx)
leaq 0x5b3dc(%rip), %rax     # 0x147900
retq
movq $0x100, (%rdx)          # imm = 0x100
leaq 0x5b48d(%rip), %rax     # 0x1479c0
retq
movq $0x4, (%rdx)
cmpl $0x5, %esi
ja 0xec552
movl %esi, %eax
leaq (%rax,%rax,2), %rax
leaq 0x5b2a3(%rip), %rcx     # 0x1477f0
leaq (%rcx,%rax,4), %rax
retq
leaq 0x5b2af(%rip), %rax     # 0x147808
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xec58c
leaq (,%r15,4), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x18140
leaq 0x8(%rsp), %rdx
movl %r12d, %edi
movl %ebp, %esi
callq 0xec4b5
testq %rax, %rax
je 0xec5f1
movq 0x8(%rsp), %rsi
subq %r14, %rsi
jle 0xec5f1
movq %rax, %r12
movq %r15, %rdi
callq 0xe9c3b
testq %rax, %rax
jle 0xec5f1
leaq (%r14,%r14,2), %rcx
addq %r12, %rcx
addq $0x2, %rcx
xorl %edx, %edx
movzbl -0x2(%rcx), %esi
shll $0x10, %esi
movzbl -0x1(%rcx), %edi
shll $0x8, %edi
orl %esi, %edi
movzbl (%rcx), %esi
orl %edi, %esi
orl $0xff000000, %esi       # imm = 0xFF000000
movl %esi, (%rbx,%rdx,4)
incq %rdx
addq $0x3, %rcx
cmpq %rdx, %rax
jne 0xec5c7
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
movb $0x23, (%rsi)
movl %edi, %ecx
shrl $0x10, %ecx
movl %edi, %eax
shrl $0x8, %eax
movl $0xff, %r9d
movl %ecx, %edx
andl %r9d, %edx
imull $0xf1, %edx, %edx
shrl $0xc, %edx
movl %edx, %r8d
shll $0x4, %r8d
orl %edx, %r8d
movl %ecx, %r10d
subb %r8b, %r10b
movl %eax, %r8d
andl %r9d, %r8d
imull $0xf1, %r8d, %r8d
shrl $0xc, %r8d
movl %r8d, %r11d
shll $0x4, %r11d
orl %r8d, %r11d
movl %eax, %ebx
subb %r11b, %bl
orb %r10b, %bl
andl %edi, %r9d
imull $0xf1, %r9d, %r9d
shrl $0xc, %r9d
movl %r9d, %r10d
shll $0x4, %r10d
orl %r9d, %r10d
movl %edi, %r11d
subb %r10b, %r11b
orb %bl, %r11b
je 0xec714
movl %edi, %edx
shrl $0x14, %edx
andl $0xf, %edx
leaq 0x5c698(%rip), %r9      # 0x148d67
movb (%rdx,%r9), %dl
andl $0xf, %ecx
movb (%rcx,%r9), %cl
movl %edi, %r8d
shrl $0xc, %r8d
andl $0xf, %r8d
movb (%r8,%r9), %r8b
andl $0xf, %eax
movb (%rax,%r9), %al
movl %edi, %r10d
shrl $0x4, %r10d
andl $0xf, %r10d
movb (%r10,%r9), %r10b
movb %r10b, 0x5(%rsi)
andl $0xf, %edi
movb (%rdi,%r9), %dil
movb %dil, 0x6(%rsi)
movb $0x0, 0x7(%rsi)
jmp 0xec732
movzbl %dl, %eax
leaq 0x5c649(%rip), %rdi     # 0x148d67
movb (%rax,%rdi), %dl
movzbl %r8b, %eax
movb (%rax,%rdi), %cl
movzbl %r9b, %eax
movb (%rax,%rdi), %r8b
xorl %eax, %eax
movb %dl, 0x1(%rsi)
movb %cl, 0x2(%rsi)
movb %r8b, 0x3(%rsi)
movb %al, 0x4(%rsi)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xec758
xorl %eax, %eax
retq
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edi, %ecx
shll %cl, %edx
notl %edx
movb $-0x1, %al
cmpl %esi, %edx
jbe 0xec757
cvtsi2sd %esi, %xmm0
cvtsi2sd %edx, %xmm1
divsd %xmm1, %xmm0
mulsd 0x2b0bb(%rip), %xmm0    # 0x117838
addsd 0x2b0ab(%rip), %xmm0    # 0x117830
cvttsd2si %xmm0, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5c49e(%rip), %xmm0    # 0x148cd0
addsd 0x2aff6(%rip), %xmm0    # 0x117830
cvttsd2si %xmm0, %rax
movb %ah, (%rdx)
movb %al, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5c477(%rip), %xmm1    # 0x148cd8
mulsd %xmm1, %xmm0
movsd 0x2afc3(%rip), %xmm2    # 0x117830
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %esi
andl $0x3f, %edx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
mulsd 0x5c439(%rip), %xmm0    # 0x148cc0
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %edx
andl $0x1f, %edi
xorps %xmm0, %xmm0
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_O3/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 0x5c409(%rip), %xmm0    # 0x148cd8
addsd 0x2af59(%rip), %xmm0    # 0x117830
cvttsd2si %xmm0, %eax
shrl $0x5, %edx
movl $0xff, %ecx
andl %ecx, %edx
shll $0x8, %edi
orl %edx, %edi
movd %edi, %xmm0
pand 0x5c3fa(%rip), %xmm0    # 0x148cf0
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 0x5c3f2(%rip), %xmm0    # 0x148d00
addpd 0x3cfea(%rip), %xmm0    # 0x129900
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_O3/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 0x5c37b(%rip), %xmm1    # 0x148cd8
mulsd %xmm1, %xmm0
movsd 0x2aec7(%rip), %xmm2    # 0x117830
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %edx
shrl $0x5, %ecx
andl $0x1f, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %ecx
andl $0x1f, %edi
xorps %xmm0, %xmm0
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_O3/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 0xeca6a
testq %rsi, %rsi
jle 0xeca65
leaq -0x6(%rcx), %r9
decq %rcx
xorl %r10d, %r10d
leaq 0x5c38b(%rip), %r11     # 0x148d78
xorl %eax, %eax
movb (%rdi,%r10), %bl
testb %bl, %bl
sete %bpl
testb %bpl, %r8b
jne 0xeca67
leal -0x20(%rbx), %ebp
cmpb $0x5e, %bpl
ja 0xeca11
cmpq %rcx, %rax
jge 0xeca5b
movb %bl, (%rdx,%rax)
jmp 0xeca20
testb $0x20, %r8b
jne 0xeca25
cmpq %rcx, %rax
jge 0xeca5b
movb $0x5f, (%rdx,%rax)
incq %rax
jmp 0xeca5b
cmpq %r9, %rax
jge 0xeca5b
movw $0x3c01, (%rdx,%rax)    # imm = 0x3C01
movzbl (%rdi,%r10), %ebx
shrl $0x4, %ebx
movb (%rbx,%r11), %bl
movb %bl, 0x2(%rdx,%rax)
movzbl (%rdi,%r10), %ebx
andl $0xf, %ebx
movb (%rbx,%r11), %bl
movb %bl, 0x3(%rdx,%rax)
movw $0x23e, 0x4(%rdx,%rax)  # imm = 0x23E
addq $0x6, %rax
incq %r10
cmpq %r10, %rsi
jne 0xec9ef
jmp 0xeca67
xorl %eax, %eax
addq %rax, %rdx
movb $0x0, (%rdx)
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %eax
movq %rsi, %rbx
cmpl $0x110000, %edx         # imm = 0x110000
movl $0xfffd, %edx           # imm = 0xFFFD
cmovbl %eax, %edx
cmpl $0x26, %edx
sete %al
movl %edx, %ecx
andl $0x1ffffd, %ecx         # imm = 0x1FFFFD
cmpl $0x3c, %ecx
sete %cl
orb %al, %cl
jne 0xecac9
leal -0x20(%rdx), %eax
cmpl $0x5e, %eax
ja 0xecac0
movzbl %dl, %esi
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xf0bd6
cmpb $0x0, 0xce(%rdi)
je 0xecae3
leaq 0x5c240(%rip), %rsi     # 0x148d10
movq %rbx, %rdi
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xf08da
leaq 0x4(%rsp), %r14
leaq 0x8(%rsp), %r15
movl %edx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0xec124
movq (%r15), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xef547
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x8, %r14d
leaq 0xa1cd9(%rip), %r15     # 0x18e800
movq (%r14,%r15), %rsi
movq %rbx, %rdi
callq 0xe8252
testl %eax, %eax
je 0xecb48
addq $0x10, %r14
cmpq $0x188, %r14            # imm = 0x188
jne 0xecb27
xorl %eax, %eax
jmp 0xecb4d
movl -0x4(%r14,%r15), %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
xorl %r15d, %r15d
leaq 0xa1e0c(%rip), %r12     # 0x18e980
cmpl %esi, 0x4(%r15,%r12)
je 0xecbaa
addq $0x20, %r15
cmpq $0x1e0, %r15            # imm = 0x1E0
jne 0xecb74
xorl %ebp, %ebp
testq %r14, %r14
je 0xecc2b
leaq 0x3f5b7(%rip), %rsi     # 0x12c151
movq %r14, %rdi
movq %rbx, %rdx
callq 0xe8219
jmp 0xecc2b
testq %r14, %r14
je 0xecbd1
movq 0x18(%r15,%r12), %rcx
testq %rcx, %rcx
je 0xecbdb
leaq 0x3f24e(%rip), %rdx     # 0x12be0e
movq %rsp, %rdi
movl $0x50, %esi
xorl %eax, %eax
callq 0xe8193
jmp 0xecbdf
movl (%r15,%r12), %r13d
andl $0x1, %r13d
jmp 0xecc1d
movb $0x0, (%rsp)
movl (%r15,%r12), %r13d
andl $0x1, %r13d
leaq 0x5c128(%rip), %r9      # 0x148d16
leaq 0x584bb(%rip), %rax     # 0x1450b0
cmovneq %rax, %r9
movq 0x10(%r15,%r12), %rcx
testb $0x1, %bpl
cmoveq %rax, %r9
leaq 0x34509(%rip), %rdx     # 0x121116
movq %rsp, %r8
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0xe8193
testl %r13d, %r13d
je 0xecc29
movl 0x8(%r15,%r12), %ebp
jmp 0xecc2b
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_O3/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, %rbp
movq %rsi, %r13
movl $0xc, %esi
movq %rdi, 0x10(%rsp)
callq 0xe8b2b
movq %rax, %r14
movq %rbp, 0x8(%rsp)
movl $0x0, (%rax)
testq %r12, %r12
jle 0xecd57
addq %rbp, %r12
leaq 0x8(%rsp), %rbp
xorl %ebx, %ebx
movq %r13, %rdi
movq %rbp, %rsi
callq 0xeeb4b
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0xecca9
movslq (%r14), %rax
leal 0x1(%rax), %edx
movl %edx, (%r14)
movb %cl, 0x4(%r14,%rax)
jmp 0xecccd
leal -0x41(%rax), %ecx
cmpb $0x5, %cl
ja 0xeccb5
addb $-0x37, %al
jmp 0xeccbf
leal -0x61(%rax), %ecx
cmpb $0x5, %cl
ja 0xecd04
addb $-0x57, %al
movslq (%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r14)
movb %al, 0x4(%r14,%rcx)
movl (%r14), %eax
cmpl $0x1, %eax
jle 0xeccfb
movb 0x4(%r14), %al
shlb $0x4, %al
orb 0x5(%r14), %al
movzbl %al, %esi
movq %r15, %rdi
callq 0xf0bd6
movl $0x0, (%r14)
cmpq %r12, 0x8(%rsp)
jl 0xecc86
jmp 0xecd57
cmpq %r12, 0x8(%rsp)
jl 0xecc86
jmp 0xecd3f
testl %ebx, %ebx
jne 0xecccd
cmpb $0x20, %al
ja 0xecd21
xorl %ebx, %ebx
movzbl %al, %eax
movabsq $0x100002600, %rcx      # imm = 0x100002600
btq %rax, %rcx
jb 0xecccd
movl 0x8(%rsp), %edx
movq 0x10(%rsp), %rdi
leaq 0x5bff4(%rip), %rsi     # 0x148d25
xorl %eax, %eax
callq 0xe8faa
movl $0x1, %ebx
jmp 0xecccd
cmpl $0x1, %eax
jne 0xecd57
leaq 0x5c001(%rip), %rsi     # 0x148d4c
movq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0xe8faa
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0xe8be2
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/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 0xecd8a
leal -0x20(%rsi), %eax
cmpl $0x5f, %eax
jae 0xecd8b
movl %esi, %eax
retq
cmpl $0x80, %esi
jl 0xecda1
movl %esi, %eax
leaq (%rdx,%rax,2), %rax
addq $-0x100, %rax
jmp 0xecdcb
movl 0x4(%rdi), %eax
cmpl $0x2, %eax
je 0xecd88
cmpl $0x3, %eax
jne 0xecdbd
cmpl $0xd, %esi
ja 0xecdbd
movl $0x2601, %eax           # imm = 0x2601
btl %esi, %eax
jb 0xecd88
movslq %esi, %rax
leaq 0x59c49(%rip), %rcx     # 0x146a10
leaq (%rcx,%rax,2), %rax
movzwl (%rax), %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %ebx
cmpq $0x0, 0x138(%rdi)
jne 0xecefb
movq %rdi, %r14
movl $0x38, %esi
callq 0xe8b2b
movq %rax, %r15
movq %r14, (%rax)
movq %rax, 0x138(%r14)
movq %r14, %rdi
movl $0x10, %esi
callq 0xeb499
movq %rax, 0x30(%r15)
movl $0x9, 0x10(%r15)
leaq 0x5c129(%rip), %rsi     # 0x148f4b
movq %r14, %rdi
callq 0xe9b74
testq %rax, %rax
je 0xece52
movq %rax, %rdi
callq 0xe9c2f
testq %rax, %rax
movl $0x6, %ecx
cmovnsl %eax, %ecx
cmpq $0xa, %rax
movl $0x9, %eax
cmovll %ecx, %eax
movl %eax, 0x10(%r15)
cmpb $0x0, 0x88(%r14)
je 0xece78
leaq 0x5c4d9(%rip), %rax     # 0x14933c
movq %rax, 0x8(%r15)
leaq 0x5c0fd(%rip), %rsi     # 0x148f6b
movq %r14, %rdi
callq 0xf07f6
jmp 0xeceb7
movq 0x160(%r14), %rax
testq %rax, %rax
leaq 0x5c0d7(%rip), %rdx     # 0x148f60
cmovneq %rax, %rdx
movq %rdx, 0x8(%r15)
leaq 0x5c0e7(%rip), %rsi     # 0x148f7f
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9393
movq 0x8(%r15), %rsi
movl 0xd8(%r14), %edx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xf074a
movq %rax, 0x20(%r15)
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
xorl %edx, %edx
callq 0xf09c5
movq %rax, 0x28(%r15)
movq 0x20(%r15), %rax
cmpl $0x0, (%rax)
jne 0xecefb
leaq 0x5c0ad(%rip), %rsi     # 0x148f8b
movq %r14, %rdi
xorl %eax, %eax
callq 0xe9295
movq 0x20(%r15), %rdi
callq 0xf052b
movq $0x0, 0x20(%r15)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xed279
leaq 0x10(%rbx), %rdi
callq 0xeacfd
movq %rax, 0x28(%rsp)
addq $-0x80000000, %rax      # imm = 0x80000000
cmpq %r14, %rax
setb %bpl
jmp 0xed285
movq $0x0, 0x28(%rsp)
movb $0x1, %bpl
cmpb $0x0, 0x20(%rbx)
movq %rbx, 0x30(%rsp)
je 0xed2ac
leaq 0x20(%rbx), %rdi
callq 0xeacfd
movq %rax, 0x20(%rsp)
addq $-0x80000000, %rax      # imm = 0x80000000
cmpq %r14, %rax
setb %bl
jmp 0xed2b7
movq $0x0, 0x20(%rsp)
movb $0x1, %bl
xorl %r13d, %r13d
testl %r12d, %r12d
sete %r13b
setne 0xe(%rsp)
incl %r13d
testb %bpl, %bpl
movl $0x1, %eax
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 0xf0f95
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 0xf0f95
movq %r15, %rdi
movl %r13d, %esi
callq 0xf0bd6
movq 0x30(%rsp), %rax
movq 0x30(%rax), %rsi
movq %r15, %rdi
callq 0xf1059
movb 0xd(%rsp), %al
orb %al, 0xe(%rsp)
jne 0xed367
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xf1059
cmpl $0x0, 0x1c(%rsp)
setne %al
orb 0xf(%rsp), %al
je 0xed384
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 0xf1059
// File: /workspace/github_c_makefile_star2_O3/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
movl $0xa, %esi
movq %rbx, %rdi
callq 0xf0f95
movl $0x20, %esi
movq %rbx, %rdi
callq 0xf0f95
movl $0x4, %esi
movq %rbx, %rdi
callq 0xf0d35
movl $0x1, %esi
movq %rbx, %rdi
callq 0xf0f95
movl $0x18, %esi
movq %rbx, %rdi
callq 0xf0f95
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 0xf10d7
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf10d7
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xf10d7
// File: /workspace/github_c_makefile_star2_O3/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 0xed43c
movq %rsi, %r14
cmpb $0x0, 0x11(%rsi)
je 0xed444
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpb $0x0, 0x10(%r14)
je 0xed43c
cmpb $0x0, 0x59(%rdi)
jne 0xed43c
cmpb $0x0, 0x5a(%rdi)
jne 0xed43c
movq %rdx, %rbx
movl $0x4341, %esi           # imm = 0x4341
movq %rdx, %rdi
callq 0xf0f95
movl $0x14, %esi
movq %rbx, %rdi
callq 0xf0f95
leaq 0x56ecb(%rip), %rsi     # 0x144346
movl $0x4, %edx
movq %rbx, %rdi
callq 0xef547
movl 0xa4(%r14), %esi
movq %rbx, %rdi
callq 0xf1042
movl 0xa8(%r14), %esi
movq %rbx, %rdi
callq 0xf1042
movl $0x3, %esi
movq %rbx, %rdi
callq 0xf1042
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xf1042
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %ebp
cmpq $0x0, 0x140(%rdi)
jne 0xedc63
movq %rdi, %rbx
movl $0x28, %esi
callq 0xe8b2b
movq %rax, %r14
movq %rax, 0x140(%rbx)
cmpb $0x0, 0x88(%rbx)
je 0xedc1e
leaq 0x5b73e(%rip), %rax     # 0x14933c
movq %rax, (%r14)
leaq 0x5b4d1(%rip), %rsi     # 0x1490d9
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
movq %rbx, %rdi
callq 0xe9522
xorl %ebp, %ebp
jmp 0xedc63
movq 0x160(%rbx), %rax
testq %rax, %rax
leaq 0x5b4cb(%rip), %rdx     # 0x1490fa
cmovneq %rax, %rdx
movq %rdx, (%r14)
leaq 0x5b342(%rip), %rsi     # 0x148f7f
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9393
movq (%r14), %rsi
movl 0xd8(%rbx), %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xf074a
movq %rax, 0x8(%r14)
cmpl $0x0, (%rax)
je 0xedc12
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-tar.c
// Function: de_tar_close_file
void de_tar_close_file(deark *c)
{
	struct tar_ctx *tctx = (struct tar_ctx *)c->tar_data;

	if(!tctx) return;
	if(tctx->outf) {
		dbuf_write_zeroes(tctx->outf, 512*2);
		dbuf_close(tctx->outf);
		de_crcobj_destroy(tctx->crco_cksum);
	}
	destroy_md(c, tctx->md);
	de_free(c, tctx);
	c->tar_data = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x140(%rdi), %r14
testq %r14, %r14
je 0xedcc4
movq %rdi, %rbx
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0xedca2
movl $0x400, %esi            # imm = 0x400
callq 0xf0d35
movq 0x8(%r14), %rdi
callq 0xf052b
movq 0x10(%r14), %rdi
callq 0xeb858
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0xedccc
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
movq $0x0, 0x140(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-tar.c
// Function: prepare_timestamp_exthdr
static void prepare_timestamp_exthdr(deark *c, struct tar_md *md, int tsidx)
{
	i64 unix_time;
	i64 subsec = 0;
	int is_high_prec = 0;
	struct timestamp_data *tsd = &md->tsdata[tsidx];

	if(!tsd->timestamp.is_valid) return;

	unix_time = tsd->timestamp_unix;

	if(unix_time>=0 && tsd->timestamp.precision>DE_TSPREC_1SEC) {
		subsec = de_timestamp_get_subsec(&tsd->timestamp);
		if(subsec!=0) is_high_prec = 1;
	}

	if(tsidx!=DE_TIMESTAMPIDX_MODIFY || is_high_prec || unix_time<0 || unix_time>0x1ffffffffLL) {
		tsd->need_exthdr = 1;
	}
	else {
		return;
	}

	if(is_high_prec) {
		de_snprintf(tsd->exthdr_sz, sizeof(tsd->exthdr_sz),
			"%"I64_FMT".%07"I64_FMT, unix_time, subsec);
	}
	else {
		de_snprintf(tsd->exthdr_sz, sizeof(tsd->exthdr_sz),
			"%"I64_FMT, unix_time);
	}

	// Max length for this item is around 29, so we allow 2 bytes for the
	// length field.
	// E.g. "28 mtime=1222333444.5555555\n"
	md->extdata_nbytes_needed += 2 + 1 + 5 + 1 + (i64)de_strlen(tsd->exthdr_sz) + 1;
}

// Assembly:
movl %esi, %eax
shlq $0x6, %rax
cmpb $0x0, 0x40(%rdi,%rax)
je 0xee068
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq (%rdi,%rax), %r14
addq $0x40, %r14
movq 0x10(%r14), %r15
testq %r15, %r15
js 0xee026
movl %esi, %ebp
movabsq $0x1ffffffff, %r12      # imm = 0x1FFFFFFFF
cmpb $0x1f, 0x2(%r14)
jb 0xee017
movq %r14, %rdi
callq 0xea8b1
testq %rax, %rax
setne %cl
testl %ebp, %ebp
setne %dl
cmpq %r12, %r15
seta %sil
orb %cl, %dl
orb %sil, %dl
je 0xee060
movb $0x1, 0x18(%r14)
testq %rax, %rax
je 0xee02b
leaq 0x19(%r14), %rdi
leaq 0x5b102(%rip), %rdx     # 0x149105
movl $0x20, %esi
movq %r15, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xe8193
jmp 0xee045
testl %ebp, %ebp
setne %al
cmpq %r12, %r15
seta %cl
orb %al, %cl
je 0xee060
movb $0x1, 0x18(%r14)
leaq 0x19(%r14), %rdi
leaq 0x3b7ab(%rip), %rdx     # 0x1297e1
movl $0x20, %esi
movq %r15, %rcx
xorl %eax, %eax
callq 0xe8193
addq $0x19, %r14
movq %r14, %rdi
callq 0x180e0
movq 0x28(%rbx), %rcx
addq %rcx, %rax
addq $0xa, %rax
movq %rax, 0x28(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq