LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_open_input_file
dbuf *dbuf_open_input_file(deark *c, const char *fn)
{
	dbuf *f;
	unsigned int returned_flags = 0;
	char msgbuf[200];

	if(!fn) {
		c->serious_error_flag = 1;
		return NULL;
	}
	f = create_dbuf_lowlevel(c);
	f->btype = DBUF_TYPE_IFILE;
	f->rcache_policy = DE_RCACHE_POLICY_ENABLED;

	f->fp = de_fopen_for_read(c, fn, &f->len, msgbuf, sizeof(msgbuf), &returned_flags);

	if(!f->fp) {
		de_err(c, "Can't read %s: %s", fn, msgbuf);
		de_free(c, f);
		c->serious_error_flag = 1;
		return NULL;
	}

	if(returned_flags & 0x1) {
		// This "file" is actually a pipe.
		f->btype = DBUF_TYPE_FIFO;
		f->rcache_policy = DE_RCACHE_POLICY_NONE;
		populate_rcache_from_pipe(f);
	}

	if(!f->rcache && f->rcache_policy==DE_RCACHE_POLICY_ENABLED) {
		populate_rcache(f);
	}

	return f;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xe0, %rsp
movq %rdi, %r14
movl $0x0, 0xc(%rsp)
testq %rsi, %rsi
je 0xf124c
movq %rsi, %r15
movl $0xd8, %esi
movq %r14, %rdi
callq 0xe8b2b
movq %rax, %rbx
movq %r14, 0x8(%rax)
movl $0xffffffff, 0x64(%rax) # imm = 0xFFFFFFFF
movl $0x1, %eax
movl %eax, (%rbx)
movl %eax, 0xb8(%rbx)
leaq 0x18(%rbx), %rdx
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %r9
movl $0xc8, %r8d
movq %r14, %rdi
movq %r15, %rsi
callq 0x109382
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0xf1228
testb $0x1, 0xc(%rsp)
je 0xf11aa
movl $0x7, (%rbx)
movl $0x0, 0xb8(%rbx)
movq %rbx, %rdi
callq 0xf1263
cmpq $0x0, 0xc8(%rbx)
jne 0xf1253
cmpl $0x1, 0xb8(%rbx)
jne 0xf1253
cmpl $0x1, (%rbx)
jne 0xf1253
movq 0x8(%rbx), %rdi
movq 0x18(%rbx), %r14
movl $0x40000, %eax          # imm = 0x40000
cmpq %rax, %r14
cmovgeq %rax, %r14
movl $0x40000, %esi          # imm = 0x40000
callq 0xe8b2b
movq %rax, 0xc8(%rbx)
movq 0x10(%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1095b4
movq 0x10(%rbx), %rcx
movq 0xc8(%rbx), %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x18080
movq %rax, 0xc0(%rbx)
movl $0x0, 0x34(%rbx)
jmp 0xf1253
leaq 0x58148(%rip), %rsi     # 0x149377
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9295
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe8be2
movb $0x1, 0x4c(%r14)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0xe0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: populate_rcache_from_pipe
static void populate_rcache_from_pipe(dbuf *f)
{
	FILE *fp;
	i64 cache_bytes_alloc = 0;

	if(f->btype==DBUF_TYPE_STDIN) {
		fp = stdin;
	}
	else if(f->btype==DBUF_TYPE_FIFO) {
		fp = f->fp;
	}
	else {
		return;
	}

	f->rcache_bytes_used = 0;

	while(1) {
		i64 bytes_to_read, bytes_read;

		if(f->rcache_bytes_used >= cache_bytes_alloc) {
			i64 old_cache_size, new_cache_size;

			// Cache is full. Increase its size.
			old_cache_size = cache_bytes_alloc;
			new_cache_size = old_cache_size*2;
			if(new_cache_size<DE_RCACHE_SIZE) new_cache_size = DE_RCACHE_SIZE;
			f->rcache = de_realloc(f->c, f->rcache, old_cache_size, new_cache_size);
			cache_bytes_alloc = new_cache_size;
		}

		// Try to read as many bytes as it would take to fill the cache.
		bytes_to_read = cache_bytes_alloc - f->rcache_bytes_used;
		if(bytes_to_read<1) break; // Shouldn't happen

		bytes_read = fread(&f->rcache[f->rcache_bytes_used], 1, (size_t)bytes_to_read, fp);
		if(bytes_read<1 || bytes_read>bytes_to_read) break;
		f->rcache_bytes_used += bytes_read;
		if(feof(fp) || ferror(fp)) break;
	}

	f->len = f->rcache_bytes_used;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x6, %eax
je 0xf1285
cmpl $0x7, %eax
jne 0xf133c
leaq 0x10(%rbx), %rax
jmp 0xf128c
movq 0x9dd4c(%rip), %rax     # 0x18efd8
movq (%rax), %r14
movq $0x0, 0xc0(%rbx)
xorl %r15d, %r15d
movl $0x40000, %r13d         # imm = 0x40000
movq 0xc0(%rbx), %rdi
cmpq %r15, %rdi
jl 0xf12e5
leaq (%r15,%r15), %r12
cmpq $0x40001, %r12          # imm = 0x40001
cmovlq %r13, %r12
movq 0x8(%rbx), %rdi
movq 0xc8(%rbx), %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0xe97c6
movq %rax, 0xc8(%rbx)
movq 0xc0(%rbx), %rdi
movq %r12, %r15
movq %r15, %r12
subq %rdi, %r12
jle 0xf1331
addq 0xc8(%rbx), %rdi
movl $0x1, %esi
movq %r12, %rdx
movq %r14, %rcx
callq 0x18080
testq %rax, %rax
jle 0xf1331
cmpq %r12, %rax
jg 0xf1331
addq %rax, 0xc0(%rbx)
movq %r14, %rdi
callq 0x181c0
testl %eax, %eax
jne 0xf1331
movq %r14, %rdi
callq 0x18060
testl %eax, %eax
je 0xf12a3
movq 0xc0(%rbx), %rax
movq %rax, 0x18(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_open_input_stdin
dbuf *dbuf_open_input_stdin(deark *c)
{
	dbuf *f;

	f = create_dbuf_lowlevel(c);
	f->btype = DBUF_TYPE_STDIN;

	// Set to NONE, to make sure we don't try to auto-populate the cache later.
	f->rcache_policy = DE_RCACHE_POLICY_NONE;

	populate_rcache_from_pipe(f);

	return f;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0xd8, %esi
callq 0xe8b2b
movq %rax, %r14
movq %rbx, 0x8(%rax)
movl $0xffffffff, 0x64(%rax) # imm = 0xFFFFFFFF
movl $0x6, (%rax)
movl $0x0, 0xb8(%rax)
movq %rax, %rdi
callq 0xf1263
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_search
int dbuf_search(dbuf *f, const u8 *needle, i64 needle_len,
	i64 startpos, i64 haystack_len, i64 *foundpos)
{
	int retval = 0;
	struct search_ctx sctx;

	*foundpos = 0;

	if(startpos < 0) {
		haystack_len += startpos;
		if(haystack_len < 0) {
			goto done;
		}
		startpos = 0;
	}
	if(startpos > f->len) {
		goto done;
	}
	if(haystack_len > f->len - startpos) {
		haystack_len = f->len - startpos;
	}
	if(needle_len > haystack_len) {
		goto done;
	}
	if(needle_len > DE_BUFFERED_READ_MIN_BLKSIZE) {
		goto done;
	}
	if(needle_len<1) {
		retval = 1;
		*foundpos = startpos;
		goto done;
	}

	de_zeromem(&sctx, sizeof(struct search_ctx));
	sctx.needle = needle;
	sctx.needle_len = needle_len;
	(void)dbuf_buffered_read(f, startpos, haystack_len, search_cbfn, (void*)&sctx);
	if(sctx.foundflag) {
		*foundpos = startpos + sctx.foundpos_rel;
		retval = 1;
	}

done:
	return retval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %rcx, %r14
movq $0x0, (%r9)
testq %rcx, %rcx
jns 0xf14c4
xorl %r15d, %r15d
addq %r14, %r8
js 0xf1534
xorl %r14d, %r14d
movq 0x18(%rdi), %rax
xorl %r15d, %r15d
subq %r14, %rax
jl 0xf1534
cmpq %rax, %r8
cmovlq %r8, %rax
cmpq %rdx, %rax
setl %cl
cmpq $0x401, %rdx            # imm = 0x401
setge %r8b
orb %cl, %r8b
jne 0xf1534
testq %rdx, %rdx
jle 0xf152b
xorps %xmm0, %xmm0
leaq 0x8(%rsp), %r12
movups %xmm0, 0x10(%r12)
movq %rsi, (%r12)
movq %rdx, 0x8(%r12)
leaq 0x33(%rip), %rcx        # 0xf1543
movq %r14, %rsi
movq %rax, %rdx
movq %r12, %r8
callq 0xef5e4
cmpl $0x0, 0x10(%r12)
je 0xf1534
addq 0x20(%rsp), %r14
movq %r14, (%rbx)
movl $0x1, %r15d
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: search_cbfn
static int search_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	struct search_ctx *sctx = (struct search_ctx*)brctx->userdata;
	i64 i;
	i64 num_starting_positions_to_check;

	if(buf_len < sctx->needle_len) return 0;
	num_starting_positions_to_check = buf_len + 1 - sctx->needle_len;

	for(i=0; i<num_starting_positions_to_check; i++) {
		if(sctx->needle[0]==buf[i] &&
			!de_memcmp(sctx->needle, &buf[i], (size_t)sctx->needle_len))
		{
			sctx->foundpos_rel = brctx->offset+i;
			sctx->foundflag = 1;
			return 0;
		}
	}

	if(brctx->eof_flag) return 0;
	brctx->bytes_consumed = num_starting_positions_to_check;
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq (%rdi), %rcx
movq 0x8(%rcx), %r13
xorl %eax, %eax
cmpq %rdx, %r13
jg 0xf15f8
movq %rdx, %r15
movq %rcx, (%rsp)
movq %rdi, 0x8(%rsp)
movq %rdx, %rax
subq %r13, %rax
incq %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
jle 0xf15bb
movq %rsi, %r12
movq (%rsp), %rax
movq (%rax), %rbp
movb (%rbp), %r14b
notq %r15
addq %r13, %r15
xorl %ebx, %ebx
cmpb (%r12), %r14b
jne 0xf15b0
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x18230
testl %eax, %eax
je 0xf15db
decq %rbx
incq %r12
cmpq %rbx, %r15
jne 0xf1598
movq 0x8(%rsp), %rcx
cmpb $0x0, 0x20(%rcx)
movl $0x0, %eax
jne 0xf15f8
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rcx)
movl $0x1, %eax
jmp 0xf15f8
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
subq %rbx, %rax
movq (%rsp), %rcx
movq %rax, 0x18(%rcx)
movl $0x1, 0x10(%rcx)
xorl %eax, %eax
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-dbuf.c
// Function: dbuf_get_utf16_NULterm_len
int dbuf_get_utf16_NULterm_len(dbuf *f, i64 pos1, i64 bytes_avail,
	i64 *bytes_consumed)
{
	i64 x;
	i64 pos = pos1;

	*bytes_consumed = bytes_avail;
	while(1) {
		if(pos1+bytes_avail-pos < 2) {
			break;
		}
		x = dbuf_getu16le(f, pos);
		pos += 2;
		if(x==0) {
			*bytes_consumed = pos - pos1;
			return 1;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movq %rdx, (%rcx)
leaq 0x6(%rsp), %rbp
xorl %ebx, %ebx
cmpq $0x2, %r15
jl 0xf165c
leaq (%r12,%rbx), %rdx
movl $0x2, %ecx
movq %r13, %rdi
movq %rbp, %rsi
callq 0xee8d4
addq $-0x2, %r15
addq $0x2, %rbx
cmpw $0x0, 0x6(%rsp)
jne 0xf1628
movq %rbx, (%r14)
movl $0x1, %eax
jmp 0xf165e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_find_line
int dbuf_find_line(dbuf *f, i64 pos1, i64 *pcontent_len, i64 *ptotal_len)
{
	u8 b0, b1;
	i64 pos;
	i64 eol_pos = 0;
	i64 eol_size = 0;

	*pcontent_len = 0;
	*ptotal_len = 0;
	if(pos1<0 || pos1>=f->len) {
		return 0;
	}

	pos = pos1;

	while(1) {
		if(pos>=f->len) {
			// No EOL.
			eol_pos = pos;
			eol_size = 0;
			break;
		}

		b0 = dbuf_getbyte(f, pos);

		if(b0==0x0d) {
			eol_pos = pos;
			// Look ahead at the next byte.
			b1 = dbuf_getbyte(f, pos+1);
			if(b1==0x0a) {
				// CR+LF
				eol_size = 2;
				break;
			}
			// LF
			eol_pos = pos;
			eol_size = 1;
			break;
		}
		else if(b0==0x0a) {
			eol_pos = pos;
			eol_size = 1;
			break;
		}

		pos++;
	}

	*pcontent_len = eol_pos - pos1;
	*ptotal_len = *pcontent_len + eol_size;

	return (*ptotal_len > 0);
}

// Assembly:
xorl %eax, %eax
movq %rax, (%rdx)
movq %rax, (%rcx)
testq %rsi, %rsi
js 0xf1700
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r13
cmpq %rsi, 0x18(%rdi)
jle 0xf16f2
movq %rcx, %rbx
movq %rdx, %r14
xorl %ebp, %ebp
movq %r15, %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0xeead3
cmpb $0xa, %al
je 0xf16dc
movzbl %al, %eax
cmpl $0xd, %eax
je 0xf16c2
incq %r12
cmpq 0x18(%r13), %r12
jl 0xf16a0
jmp 0xf16e1
leaq 0x1(%r12), %rsi
movq %r13, %rdi
callq 0xeead3
xorl %ebp, %ebp
cmpb $0xa, %al
sete %bpl
incq %rbp
jmp 0xf16e1
movl $0x1, %ebp
subq %r15, %r12
movq %r12, (%r14)
xorl %eax, %eax
addq %rbp, %r12
movq %r12, (%rbx)
setg %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_dump_to_file
int dbuf_dump_to_file(dbuf *inf, const char *fn)
{
	dbuf *outf;
	deark *c = inf->c;

	outf = dbuf_create_unmanaged_file(c, fn, DE_OVERWRITEMODE_STANDARD, 0);
	dbuf_copy(inf, 0, inf->len, outf);
	dbuf_close(outf);
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
xorl %ecx, %ecx
callq 0xf074a
movq %rax, %r14
movq 0x18(%rbx), %rdx
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0xef481
movq %r14, %rdi
callq 0xf052b
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_read_fourcc
void dbuf_read_fourcc(dbuf *f, i64 pos, struct de_fourcc *fcc,
	int nbytes, unsigned int flags)
{
	if(nbytes<1 || nbytes>4) return;

	de_zeromem(fcc->bytes, 4);
	dbuf_read(f, fcc->bytes, pos, (i64)nbytes);
	if(flags&DE_4CCFLAG_REVERSED) {
		reverse_fourcc(fcc->bytes, nbytes);
	}

	fcc->id = (u32)de_getu32be_direct(fcc->bytes);
	if(nbytes<4) {
		fcc->id >>= (4-(unsigned int)nbytes)*8;
	}

	de_bytes_to_printable_sz(fcc->bytes, (i64)nbytes,
		fcc->id_sanitized_sz, sizeof(fcc->id_sanitized_sz),
		0, DE_ENCODING_ASCII);
	de_bytes_to_printable_sz(fcc->bytes, (i64)nbytes,
		fcc->id_dbgstr, sizeof(fcc->id_dbgstr),
		DE_CONVFLAG_ALLOW_HL, DE_ENCODING_ASCII);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r15d
leal -0x5(%r15), %eax
cmpl $-0x4, %eax
jae 0xf1780
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %r8d, %ebp
movq %rdx, %rbx
movq %rsi, %rdx
movl $0x0, (%rbx)
movl %r15d, %r14d
movq %rbx, %rsi
movq %r14, %rcx
callq 0xee8d4
testb $0x1, %bpl
je 0xf17d0
cmpl $0x2, %r15d
jb 0xf17d0
movl %r14d, %eax
shrl %eax
leaq (%r14,%rbx), %rcx
decq %rcx
xorl %edx, %edx
movb (%rbx,%rdx), %sil
movb (%rcx), %dil
movb %dil, (%rbx,%rdx)
movb %sil, (%rcx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0xf17b7
movl (%rbx), %eax
bswapl %eax
leal (,%r15,8), %ecx
movb $0x20, %dl
subb %cl, %dl
xorl %esi, %esi
cmpl $0x4, %r15d
movzbl %dl, %ecx
cmovgel %esi, %ecx
shrl %cl, %eax
movl %eax, 0x4(%rbx)
leaq 0x8(%rbx), %rdx
movl $0x8, %ecx
movq %rbx, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xec9c7
leaq 0x10(%rbx), %rdx
movl $0x20, %ecx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x20, %r8d
movl $0x1, %r9d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xec9c7
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: text2utf8_cbfn
static int text2utf8_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	struct textconvctx_struct *tcctx = (struct textconvctx_struct*)brctx->userdata;
	UI conv_flags;

	// There's no limit to how much data dbuf_buffered_read() could send us
	// at once, so we won't try to put it all in a ucstring at once.
	brctx->bytes_consumed = de_min_int(buf_len, 4096);

	// For best results, ucstring_append_bytes_ex() needs to be told whether there will
	// be any more bytes after this.
	if(brctx->eof_flag && brctx->bytes_consumed==buf_len)
		conv_flags = 0;
	else
		conv_flags = DE_CONVFLAG_PARTIAL_DATA;

	ucstring_empty(tcctx->tmpstr);
	ucstring_append_bytes_ex(tcctx->tmpstr, buf, brctx->bytes_consumed, conv_flags,
		&tcctx->es);
	ucstring_write_as_utf8(brctx->c, tcctx->tmpstr, tcctx->outf, 0);
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %r12
movl $0x1000, %esi           # imm = 0x1000
movq %rdx, %rdi
callq 0xe9c3b
movq %rax, 0x18(%rbx)
cmpb $0x0, 0x20(%rbx)
sete %cl
cmpq %r14, %rax
setne %al
orb %cl, %al
movzbl %al, %ebp
shll $0x6, %ebp
movq 0x8(%r12), %rdi
callq 0xf6423
movq 0x8(%r12), %rdi
movq 0x18(%rbx), %rdx
leaq 0x10(%r12), %r8
movq %r15, %rsi
movl %ebp, %ecx
callq 0xf67b3
movq 0x8(%rbx), %rdi
movq (%r12), %rdx
movq 0x8(%r12), %rsi
xorl %ecx, %ecx
callq 0xf6da2
movl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: de_bitbuf_lowlevel_add_bits
void de_bitbuf_lowlevel_add_bits(struct de_bitbuf_lowlevel *bbll, u64 n, UI nbits)
{
	if(bbll->nbits_in_bitbuf+nbits>64) return;
	if(bbll->is_lsb==0) {
		bbll->bit_buf = (bbll->bit_buf<<nbits) | n;
	}
	else {
		bbll->bit_buf |= (u64)n << bbll->nbits_in_bitbuf;
	}
	bbll->nbits_in_bitbuf += nbits;
}

// Assembly:
movl 0x4(%rdi), %ecx
leal (%rcx,%rdx), %eax
cmpl $0x40, %eax
ja 0xf1b5d
cmpb $0x0, (%rdi)
je 0xf1b4a
shlq %cl, %rsi
orq %rsi, 0x8(%rdi)
jmp 0xf1b5a
movq 0x8(%rdi), %r8
movl %edx, %ecx
shlq %cl, %r8
orq %rsi, %r8
movq %r8, 0x8(%rdi)
movl %eax, 0x4(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: de_bitbuf_lowlevel_add_byte
void de_bitbuf_lowlevel_add_byte(struct de_bitbuf_lowlevel *bbll, u8 n)
{
	if(bbll->nbits_in_bitbuf>56) return;
	if(bbll->is_lsb==0) {
		bbll->bit_buf = (bbll->bit_buf<<8) | n;
	}
	else {
		bbll->bit_buf |= (u64)n << bbll->nbits_in_bitbuf;
	}
	bbll->nbits_in_bitbuf += 8;
}

// Assembly:
movl 0x4(%rdi), %ecx
cmpq $0x38, %rcx
ja 0xf1b92
cmpb $0x0, (%rdi)
je 0xf1b79
movzbl %sil, %eax
shlq %cl, %rax
orq %rax, 0x8(%rdi)
jmp 0xf1b8c
movq 0x8(%rdi), %rax
shlq $0x8, %rax
movzbl %sil, %edx
orq %rax, %rdx
movq %rdx, 0x8(%rdi)
addl $0x8, %ecx
movl %ecx, 0x4(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: de_bitbuf_lowlevel_get_bits
u64 de_bitbuf_lowlevel_get_bits(struct de_bitbuf_lowlevel *bbll, UI nbits)
{
	u64 n;
	u64 mask;

	if(nbits > bbll->nbits_in_bitbuf) return 0;
	mask = ((u64)1 << nbits)-1;
	if(bbll->is_lsb==0) {
		bbll->nbits_in_bitbuf -= nbits;
		n = (bbll->bit_buf >> bbll->nbits_in_bitbuf) & mask;
	}
	else {
		n = bbll->bit_buf & mask;
		bbll->bit_buf >>= nbits;
		bbll->nbits_in_bitbuf -= nbits;
	}
	return n;
}

// Assembly:
movl 0x4(%rdi), %edx
movl %edx, %r9d
subl %esi, %r9d
jae 0xf1ba1
xorl %eax, %eax
retq
movq $-0x1, %r8
movl %esi, %ecx
shlq %cl, %r8
notq %r8
cmpb $0x0, (%rdi)
je 0xf1bc7
movl %esi, %ecx
movq 0x8(%rdi), %rax
movq %rax, %rdx
shrq %cl, %rdx
movq %rdx, 0x8(%rdi)
jmp 0xf1bd5
subl %esi, %edx
movq 0x8(%rdi), %rax
movl %edx, %ecx
shrq %cl, %rax
movl %edx, %r9d
andq %r8, %rax
movl %r9d, 0x4(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: de_bitreader_getbits
u64 de_bitreader_getbits(struct de_bitreader *bitrd, UI nbits)
{
	if(bitrd->eof_flag) return 0;
	if(nbits==0) {
		// TODO: Decide if we always want to do this. Could risk infinite loops
		// with this successful no-op.
		return 0;
	}
	if(nbits > 57) {
		bitrd->eof_flag = 1;
		return 0;
	}

	while(bitrd->bbll.nbits_in_bitbuf < nbits) {
		u8 b;

		if(bitrd->curpos >= bitrd->endpos) {
			bitrd->eof_flag = 1;
			return 0;
		}
		b = dbuf_getbyte_p(bitrd->f, &bitrd->curpos);
		de_bitbuf_lowlevel_add_byte(&bitrd->bbll, b);
	}

	return de_bitbuf_lowlevel_get_bits(&bitrd->bbll, nbits);
}

// Assembly:
xorl %eax, %eax
testl %esi, %esi
je 0xf1c47
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpb $0x0, 0x18(%rdi)
jne 0xf1c43
movl %esi, %ebp
cmpl $0x39, %esi
jbe 0xf1c0d
movb $0x1, 0x18(%rbx)
jmp 0xf1c41
leaq 0x20(%rbx), %r14
movl 0x24(%rbx), %edx
cmpl %ebp, %edx
jae 0xf1c3b
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
jge 0xf1c07
movq (%rbx), %rdi
callq 0xeead3
incq 0x8(%rbx)
movzbl %al, %esi
movq %r14, %rdi
callq 0xf1b5e
jmp 0xf1c11
movl %edx, %edi
subl %ebp, %edi
jae 0xf1c48
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq $-0x1, %rsi
movl %ebp, %ecx
shlq %cl, %rsi
notq %rsi
cmpb $0x0, (%r14)
je 0xf1c6f
movl %ebp, %ecx
movq 0x28(%rbx), %rax
movq %rax, %rdx
shrq %cl, %rdx
movq %rdx, 0x28(%rbx)
jmp 0xf1c7c
subl %ebp, %edx
movq 0x28(%rbx), %rax
movl %edx, %ecx
shrq %cl, %rax
movl %edx, %edi
andq %rsi, %rax
movl %edi, 0x24(%rbx)
jmp 0xf1c43
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: de_bitbuf_describe_curpos
char *de_bitbuf_describe_curpos(struct de_bitbuf_lowlevel *bbll, i64 pos1,
	 char *buf, size_t buf_len)
{
	i64 curpos;
	UI nwholebytes;
	UI nbits;

	nwholebytes = (i64)(bbll->nbits_in_bitbuf / 8);
	nbits = bbll->nbits_in_bitbuf % 8;
	curpos = pos1 - (i64)nwholebytes;

	if(nbits==0) {
		de_snprintf(buf, buf_len, "%"I64_FMT, curpos);
	}
	else {
		de_snprintf(buf, buf_len, "%"I64_FMT"+%ubits", curpos-1, (UI)(8-nbits));
	}
	return buf;
}

// Assembly:
pushq %rbx
movq %rcx, %rax
movq %rdx, %rbx
movq %rsi, %rcx
movl 0x4(%rdi), %edx
movl %edx, %esi
shrl $0x3, %esi
subq %rsi, %rcx
andl $0x7, %edx
je 0xf1cda
decq %rcx
movl $0x8, %r8d
subl %edx, %r8d
leaq 0x577a0(%rip), %rdx     # 0x14946b
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xe8193
jmp 0xf1cee
leaq 0x37b00(%rip), %rdx     # 0x1297e1
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xe8193
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-dbuf.c
// Function: slice_is_ascii_cbfn
static int slice_is_ascii_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	struct textconvctx_struct *tcctx = (struct textconvctx_struct*)brctx->userdata;
	UI conv_flags;

	brctx->bytes_consumed = de_min_int(buf_len, 4096);

	if(brctx->eof_flag && brctx->bytes_consumed==buf_len)
		conv_flags = 0;
	else
		conv_flags = DE_CONVFLAG_PARTIAL_DATA;

	ucstring_empty(tcctx->tmpstr);
	ucstring_append_bytes_ex(tcctx->tmpstr, buf, brctx->bytes_consumed, conv_flags,
		&tcctx->es);
	if(!ucstring_is_ascii(tcctx->tmpstr)) {
		return 0;
	}
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %r12
movl $0x1000, %esi           # imm = 0x1000
movq %rdx, %rdi
callq 0xe9c3b
movq %rax, 0x18(%r15)
cmpb $0x0, 0x20(%r15)
sete %cl
cmpq %rbx, %rax
setne %al
orb %cl, %al
movzbl %al, %ebx
shll $0x6, %ebx
movq 0x8(%r12), %rdi
callq 0xf6423
movq 0x8(%r12), %rdi
movq 0x18(%r15), %rdx
leaq 0x10(%r12), %r8
movq %r14, %rsi
movl %ebx, %ecx
callq 0xf67b3
movq 0x8(%r12), %rdi
callq 0xf6d24
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_good_dimensions
int de_bitmap_good_dimensions(de_bitmap *img, UI flags)
{
	if(img->is_internal) {
		// Images for internal use, that aren't going to be written to a file,
		// should not respect the "-maxdim" setting from the user.
		//
		// Note - The is_internal flag should only be used for images with
		// a fixed size, that does not depend on width/height fields in the
		// input file.
		if(img->width<1 || img->width>MAX_INTERNAL_IMAGE_DIMENSION ||
			img->height<1 || img->height>MAX_INTERNAL_IMAGE_DIMENSION)
		{
			de_internal_err_nonfatal(img->c, "Bad temp bitmap size");
			return 0;
		}
	}
	else if(flags & 0x1) {
		if(!de_good_image_dimensions(img->c, img->width, img->height)) {
			return 0;
		}
	}
	else {
		if(!de_good_image_dimensions_noerr(img->c, img->width, img->height)) {
			return 0;
		}
	}
	return 1;
}

// Assembly:
pushq %rbx
cmpb $0x0, 0x38(%rdi)
je 0xf1e3b
movq $-0x2711, %rax          # imm = 0xD8EF
movq 0x8(%rdi), %rcx
addq %rax, %rcx
cmpq $-0x2710, %rcx          # imm = 0xD8F0
jb 0xf1e26
movq 0x10(%rdi), %rcx
addq %rax, %rcx
cmpq %rax, %rcx
ja 0xf1e90
movq (%rdi), %rdi
leaq 0x57789(%rip), %rsi     # 0x1495b9
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xe9640
jmp 0xf1e95
testb $0x1, %sil
jne 0xf1e79
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %rax
testq %rcx, %rcx
setle %dl
testq %rax, %rax
setle %sil
xorl %ebx, %ebx
orb %dl, %sil
jne 0xf1e95
movq (%rdi), %rdx
movq 0xa8(%rdx), %rdx
cmpq %rcx, %rdx
setl %cl
cmpq %rax, %rdx
setl %al
orb %cl, %al
je 0xf1e90
jmp 0xf1e95
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdx
movq %rax, %rdi
callq 0xf1db1
testl %eax, %eax
je 0xf1e99
movl $0x1, %ebx
movl %ebx, %eax
popq %rbx
retq
xorl %ebx, %ebx
jmp 0xf1e95
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_good_image_count
int de_good_image_count(deark *c, i64 n)
{
	i64 maximages;

	maximages = DE_MAX_IMAGES_PER_FILE;
	if(c->max_output_files>DE_MAX_IMAGES_PER_FILE) {
		maximages = c->max_output_files;
	}

	if(n<0 || n>maximages) {
		de_err(c, "Bad or unsupported number of images (%d)", (int)n);
		return 0;
	}
	return 1;
}

// Assembly:
pushq %rbx
movq %rsi, %rdx
movl 0x9c(%rdi), %ecx
cmpl $0x2711, %ecx           # imm = 0x2711
movl $0x2710, %eax           # imm = 0x2710
cmovgel %ecx, %eax
testq %rsi, %rsi
js 0xf1ec4
movl $0x1, %ebx
cmpq %rdx, %rax
jae 0xf1ed4
leaq 0x57703(%rip), %rsi     # 0x1495ce
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xe9295
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_is_grayscale_palette
int de_is_grayscale_palette(const de_color *pal, i64 num_entries)
{
	i64 k;
	de_colorsample cr;

	for(k=0; k<num_entries; k++) {
		cr = DE_COLOR_R(pal[k]);
		if(cr != DE_COLOR_G(pal[k])) return 0;
		if(cr != DE_COLOR_B(pal[k])) return 0;
	}
	return 1;
}

// Assembly:
movl $0x1, %eax
testq %rsi, %rsi
jle 0xf1f16
xorl %ecx, %ecx
movl $0xff, %edx
movl (%rdi,%rcx,4), %r8d
movl %r8d, %r9d
shrl $0x10, %r9d
andl %edx, %r9d
movl %r8d, %r10d
shrl $0x8, %r10d
andl %edx, %r10d
cmpl %r10d, %r9d
jne 0xf1f17
andl %edx, %r8d
cmpl %r8d, %r9d
jne 0xf1f17
incq %rcx
cmpq %rcx, %rsi
jne 0xf1ee9
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_alloc_pixels
static void de_bitmap_alloc_pixels(de_bitmap *img)
{
	if(img->bitmap) {
		de_bitmap_free_pixels(img);
	}

	if(!de_bitmap_good_dimensions(img, 0x1)) {
		// This function is not allowed to fail. If something goes wrong, create
		// a dummy image, and set invalid_image_flag.
		img->invalid_image_flag = 1;

		img->width = 1;
		img->height = 1;
	}

	img->bitmap_size = (img->width*img->bytes_per_pixel) * img->height;
	img->bitmap = de_malloc(img->c, img->bitmap_size);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rsi
testq %rsi, %rsi
je 0xf218f
leaq 0x28(%rbx), %r14
movq (%rbx), %rdi
callq 0xe8be2
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf1dfc
testl %eax, %eax
je 0xf21aa
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %rax
jmp 0xf21c3
movl $0x1, 0x20(%rbx)
movl $0x1, %eax
movq %rax, 0x8(%rbx)
movq %rax, 0x10(%rbx)
movl $0x1, %ecx
movslq 0x24(%rbx), %rsi
imulq %rcx, %rsi
imulq %rax, %rsi
movq %rsi, 0x30(%rbx)
movq (%rbx), %rdi
callq 0xe8b2b
movq %rax, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: get_optimized_image
static void get_optimized_image(de_bitmap *img1, struct image_scan_opt_data *optctx)
{
	int opt_bytes_per_pixel;

	scan_image(img1, optctx);

	if(!optctx->is_nonbilevel) {
		// We don't optimize this type of image here. It will be handled
		// by the PNG encoder.
		return;
	}

	opt_bytes_per_pixel = optctx->has_color ? 3 : 1;
	if(optctx->has_trns) opt_bytes_per_pixel++;

	if(opt_bytes_per_pixel>=img1->bytes_per_pixel) {
		return;
	}

	optctx->optimg = de_bitmap_clone_noalloc(img1);
	optctx->optimg->bytes_per_pixel = opt_bytes_per_pixel;
	de_bitmap_copy_rect(img1, optctx->optimg, 0, 0, img1->width, img1->height, 0, 0, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0xf396a
cmpb $0x0, 0x3(%r14)
je 0xf2282
xorl %eax, %eax
cmpb $0x0, (%r14)
setne %al
xorl %ecx, %ecx
cmpb $0x0, 0x1(%r14)
setne %cl
leal (%rcx,%rax,2), %ebp
incl %ebp
cmpl 0x24(%rbx), %ebp
jge 0xf2282
movq (%rbx), %r15
movl $0x40, %esi
movq %r15, %rdi
callq 0xe8b2b
movq %r15, (%rax)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x30(%rbx), %xmm3
movups %xmm2, 0x20(%rax)
movups %xmm3, 0x30(%rax)
movups %xmm0, (%rax)
movups %xmm1, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
movq %rax, 0x8(%r14)
movl %ebp, 0x24(%rax)
movq 0x8(%rbx), %r8
movq 0x10(%rbx), %r9
movups %xmm0, (%rsp)
movl $0x0, 0x10(%rsp)
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xf36d0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_destroy
void de_bitmap_destroy(de_bitmap *b)
{
	if(b) {
		deark *c = b->c;

		de_bitmap_free_pixels(b);
		de_free(c, b);
	}
}

// Assembly:
testq %rdi, %rdi
je 0xf22cf
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x28(%rdi), %rsi
testq %rsi, %rsi
je 0xf22b5
movq %r14, %rdi
callq 0xe8be2
movq $0x0, 0x28(%rbx)
movq $0x0, 0x30(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe8be2
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_write_to_file
void de_bitmap_write_to_file(de_bitmap *img, const char *token,
	unsigned int createflags)
{
	deark *c = img->c;

	if(token && token[0]) {
		de_finfo *tmpfi = de_finfo_create(c);
		de_finfo_set_name_from_sz(c, tmpfi, token, 0, DE_ENCODING_UTF8);
		de_bitmap_write_to_file_finfo(img, tmpfi, createflags);
		de_finfo_destroy(c, tmpfi);
	}
	else {
		de_bitmap_write_to_file_finfo(img, NULL, createflags);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
testq %rsi, %rsi
je 0xf233e
movq %rsi, %r15
cmpb $0x0, (%rsi)
je 0xf233e
movq (%r14), %r12
movq %r12, %rdi
callq 0xea504
movq %rax, %r13
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
movl $0x2, %r8d
callq 0xea78f
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
movl %ebx, %ecx
callq 0xf1f1a
movq %r12, %rdi
movq %r13, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xea50e
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl %ebx, %ecx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xf1f1a
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_setsample
void de_bitmap_setsample(de_bitmap *img, i64 x, i64 y,
	i64 samplenum, de_colorsample v)
{
	i64 pos;

	if(!img->bitmap) de_bitmap_alloc_pixels(img);
	if(!img->bitmap) return;
	if(x<0 || y<0 || x>=img->width || y>=img->height) return;
	if(samplenum<0 || samplenum>3) return;
	pos = (img->width*img->bytes_per_pixel)*y + img->bytes_per_pixel*x;

	switch(img->bytes_per_pixel) {
	case 1: // gray
		if(samplenum<3) {
			img->bitmap[pos] = v;
		}
		break;
	case 2: // gray+alpha
		if(samplenum==3) {
			img->bitmap[pos+1] = v;
		}
		else {
			img->bitmap[pos] = v;
		}
		break;
	case 3: // RGB
		if(samplenum<3) {
			img->bitmap[pos+samplenum] = v;
		}
		break;
	case 4: // RGBA
		img->bitmap[pos+samplenum] = v;
		break;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r13
movq 0x28(%rdi), %rax
testq %rax, %rax
jne 0xf2382
movq %r13, %rdi
callq 0xf216c
movq 0x28(%r13), %rax
testq %rax, %rax
sete %cl
movq %r12, %rdx
orq %r15, %rdx
sets %dl
orb %cl, %dl
jne 0xf23fb
movq 0x8(%r13), %rcx
cmpq %r15, %rcx
jle 0xf23fb
cmpq $0x3, %r14
ja 0xf23fb
cmpq %r12, 0x10(%r13)
jle 0xf23fb
movslq 0x24(%r13), %rsi
leal -0x1(%rsi), %edx
cmpl $0x3, %edx
ja 0xf23fb
imulq %r12, %rcx
addq %r15, %rcx
imulq %rsi, %rcx
leaq 0x57154(%rip), %rsi     # 0x14951c
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
cmpq $0x3, %r14
je 0xf23fb
addq %rcx, %rax
jmp 0xf23f9
cmpq $0x3, %r14
je 0xf23fb
addq %rcx, %rax
addq %r14, %rax
jmp 0xf23f9
xorl %edx, %edx
cmpq $0x3, %r14
sete %dl
addq %rcx, %rax
addq %rdx, %rax
movb %bl, (%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_setpixel_gray
void de_bitmap_setpixel_gray(de_bitmap *img, i64 x, i64 y, de_colorsample v)
{
	i64 pos;

	if(!img->bitmap) de_bitmap_alloc_pixels(img);
	if(!img->bitmap) return;
	if(x<0 || y<0 || x>=img->width || y>=img->height) return;
	pos = (img->width*img->bytes_per_pixel)*y + img->bytes_per_pixel*x;

	img->bitmap[pos] = v;
	switch(img->bytes_per_pixel) {
	case 2: // gray+alpha
		img->bitmap[pos+1] = 255;
		break;
	case 3: // RGB
		img->bitmap[pos+1] = v;
		img->bitmap[pos+2] = v;
		break;
	case 4: // RGBA
		img->bitmap[pos+1] = v;
		img->bitmap[pos+2] = v;
		img->bitmap[pos+3] = 255;
		break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rdi), %rcx
testq %rcx, %rcx
jne 0xf242c
movq %rbx, %rdi
callq 0xf216c
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
sete %al
movq %r15, %rdx
orq %r14, %rdx
sets %dl
orb %al, %dl
jne 0xf24af
movq 0x8(%rbx), %rax
cmpq %r14, %rax
jle 0xf24af
cmpq %r15, 0x10(%rbx)
jle 0xf24af
movslq 0x24(%rbx), %rdx
imulq %r15, %rax
addq %r14, %rax
imulq %rdx, %rax
movb %bpl, (%rcx,%rax)
movl 0x24(%rbx), %edx
movl $0x1, %ecx
cmpl $0x2, %edx
je 0xf24a6
cmpl $0x3, %edx
je 0xf248f
cmpl $0x4, %edx
jne 0xf24af
movq 0x28(%rbx), %rcx
movb %bpl, 0x1(%rcx,%rax)
movb $-0x1, %dl
movl $0x3, %esi
movl $0x2, %ecx
jmp 0xf2496
movl $0x2, %esi
movl %ebp, %edx
movq 0x28(%rbx), %rdi
addq %rax, %rdi
movb %bpl, (%rcx,%rdi)
movq %rsi, %rcx
jmp 0xf24a8
movb $-0x1, %dl
addq 0x28(%rbx), %rax
movb %dl, (%rcx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_setpixel_rgba
void de_bitmap_setpixel_rgba(de_bitmap *img, i64 x, i64 y,
	de_color color)
{
	i64 pos;

	if(!img->bitmap) de_bitmap_alloc_pixels(img);
	if(!img->bitmap) return;
	if(x<0 || y<0 || x>=img->width || y>=img->height) return;
	pos = (img->width*img->bytes_per_pixel)*y + img->bytes_per_pixel*x;

	switch(img->bytes_per_pixel) {
	case 4:
		img->bitmap[pos]   = DE_COLOR_R(color);
		img->bitmap[pos+1] = DE_COLOR_G(color);
		img->bitmap[pos+2] = DE_COLOR_B(color);
		img->bitmap[pos+3] = DE_COLOR_A(color);
		break;
	case 3:
		img->bitmap[pos]   = DE_COLOR_R(color);
		img->bitmap[pos+1] = DE_COLOR_G(color);
		img->bitmap[pos+2] = DE_COLOR_B(color);
		break;
	case 2:
		img->bitmap[pos]   = DE_COLOR_G(color);
		img->bitmap[pos+1] = DE_COLOR_A(color);
		break;
	case 1:
		// TODO: We could do real grayscale conversion, but for now we
		// assume this won't happen, or that if it does the color given to
		// us is a gray shade.
		img->bitmap[pos]   = DE_COLOR_G(color);
		break;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
movq 0x28(%rdi), %rcx
testq %rcx, %rcx
jne 0xf24e7
movq %r14, %rdi
callq 0xf216c
movq 0x28(%r14), %rcx
testq %rcx, %rcx
sete %al
movq %r12, %rdx
orq %r15, %rdx
sets %dl
orb %al, %dl
jne 0xf2586
movq 0x8(%r14), %rax
cmpq %r15, %rax
jle 0xf2586
cmpq %r12, 0x10(%r14)
jle 0xf2586
movslq 0x24(%r14), %rsi
leal -0x1(%rsi), %edx
cmpl $0x3, %edx
ja 0xf2586
imulq %r12, %rax
addq %r15, %rax
imulq %rsi, %rax
leaq 0x57001(%rip), %rsi     # 0x14952c
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
movb %bh, (%rcx,%rax)
jmp 0xf2586
movl %ebx, %edx
shrl $0x10, %edx
movb %dl, (%rcx,%rax)
movq 0x28(%r14), %rcx
movb %bh, 0x1(%rcx,%rax)
movq 0x28(%r14), %rcx
movb %bl, 0x2(%rcx,%rax)
jmp 0xf2586
movl %ebx, %edx
shrl $0x10, %edx
movb %dl, (%rcx,%rax)
movq 0x28(%r14), %rcx
movb %bh, 0x1(%rcx,%rax)
movq 0x28(%r14), %rcx
movb %bl, 0x2(%rcx,%rax)
shrl $0x18, %ebx
movq 0x28(%r14), %rcx
movb %bl, 0x3(%rcx,%rax)
jmp 0xf2586
movb %bh, (%rcx,%rax)
shrl $0x18, %ebx
movq 0x28(%r14), %rcx
movb %bl, 0x1(%rcx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_getpixel
de_color de_bitmap_getpixel(de_bitmap *img, i64 x, i64 y)
{
	i64 pos;

	if(!img) return 0;
	if(!img->bitmap) return 0;
	if(x<0 || y<0 || x>=img->width || y>=img->height) return 0;
	pos = (img->width*img->bytes_per_pixel)*y + img->bytes_per_pixel*x;

	switch(img->bytes_per_pixel) {
	case 4:
		return DE_MAKE_RGBA(img->bitmap[pos], img->bitmap[pos+1],
			img->bitmap[pos+2], img->bitmap[pos+3]);
	case 3:
		return DE_MAKE_RGBA(img->bitmap[pos], img->bitmap[pos+1],
			img->bitmap[pos+2], 0xff);
		break;
	case 2:
		return DE_MAKE_RGBA(img->bitmap[pos], img->bitmap[pos],
			img->bitmap[pos], img->bitmap[pos+1]);
		break;
	case 1:
		return DE_MAKE_RGBA(img->bitmap[pos], img->bitmap[pos],
			img->bitmap[pos], 0xff);
		break;
	}
	return 0;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0xf264a
movq 0x28(%rdi), %rcx
testq %rcx, %rcx
sete %r8b
movq %rdx, %r9
orq %rsi, %r9
sets %r9b
orb %r8b, %r9b
jne 0xf264a
movq 0x8(%rdi), %r8
cmpq %rsi, %r8
jle 0xf264a
cmpq %rdx, 0x10(%rdi)
jle 0xf264a
movslq 0x24(%rdi), %r9
leal -0x1(%r9), %edi
cmpl $0x3, %edi
ja 0xf264a
imulq %rdx, %r8
addq %rsi, %r8
imulq %r9, %r8
leaq 0x56f4f(%rip), %rax     # 0x14953c
movslq (%rax,%rdi,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movzbl (%rcx,%r8), %eax
imull $0x10101, %eax, %eax    # imm = 0x10101
jmp 0xf261e
movzbl (%rcx,%r8), %eax
shll $0x10, %eax
movzbl 0x1(%rcx,%r8), %edx
shll $0x8, %edx
orl %eax, %edx
movzbl 0x2(%rcx,%r8), %eax
orl %edx, %eax
orl $0xff000000, %eax       # imm = 0xFF000000
retq
movzbl 0x3(%rcx,%r8), %eax
shll $0x18, %eax
movzbl (%rcx,%r8), %edx
shll $0x10, %edx
orl %eax, %edx
movzbl 0x1(%rcx,%r8), %esi
shll $0x8, %esi
orl %edx, %esi
movzbl 0x2(%rcx,%r8), %eax
orl %esi, %eax
retq
movzbl 0x1(%rcx,%r8), %eax
shll $0x18, %eax
movzbl (%rcx,%r8), %ecx
movl %ecx, %edx
shll $0x10, %edx
orl %eax, %edx
movl %ecx, %eax
shll $0x8, %eax
orl %edx, %eax
orl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_create
de_bitmap *de_bitmap_create(deark *c, i64 width, i64 height, int bypp)
{
	de_bitmap *img;
	img = de_bitmap_create_noinit(c);
	img->width = width;
	img->unpadded_width = width;
	img->height = height;
	img->bytes_per_pixel = bypp;
	//img->rowspan = img->width * img->bytes_per_pixel;
	return img;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl $0x40, %esi
callq 0xe8b2b
movq %r12, (%rax)
movq %r15, 0x8(%rax)
movq %r15, 0x18(%rax)
movq %r14, 0x10(%rax)
movl %ebx, 0x24(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_bitmap_create2
de_bitmap *de_bitmap_create2(deark *c, i64 npwidth, i64 pdwidth, i64 height, int bypp)
{
	de_bitmap *img;

	if(pdwidth<npwidth) pdwidth = npwidth;

	img = de_bitmap_create(c, pdwidth, height, bypp);

	if(npwidth>0 && npwidth<img->width) {
		img->unpadded_width = npwidth;
	}

	return img;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
movl $0x40, %esi
callq 0xe8b2b
testq %rbx, %rbx
setle %cl
cmpq %rbx, %r15
cmovleq %rbx, %r15
movq %r12, (%rax)
movq %r15, 0x8(%rax)
movq %r15, 0x18(%rax)
movq %r14, 0x10(%rax)
movl %ebp, 0x24(%rax)
setle %dl
orb %cl, %dl
jne 0xf26f0
movq %rbx, 0x18(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_get_bits_symbol
u8 de_get_bits_symbol(dbuf *f, i64 bps, i64 rowstart, i64 index)
{
	i64 byte_offset;
	u8 b;
	u8 x = 0;

	switch(bps) {
	case 1:
		byte_offset = rowstart + index/8;
		b = dbuf_getbyte(f, byte_offset);
		x = (b >> (7 - index%8)) & 0x01;
		break;
	case 2:
		byte_offset = rowstart + index/4;
		b = dbuf_getbyte(f, byte_offset);
		x = (b >> (2 * (3 - index%4))) & 0x03;
		break;
	case 4:
		byte_offset = rowstart + index/2;
		b = dbuf_getbyte(f, byte_offset);
		x = (b >> (4 * (1 - index%2))) & 0x0f;
		break;
	case 8:
		byte_offset = rowstart + index;
		x = dbuf_getbyte(f, byte_offset);
	}
	return x;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %eax, %eax
decq %rsi
cmpq $0x7, %rsi
ja 0xf27ae
movq %rcx, %rbx
leaq 0x56e36(%rip), %rcx     # 0x14954c
movslq (%rcx,%rsi,4), %rsi
addq %rcx, %rsi
jmpq *%rsi
leaq 0x7(%rbx), %r14
testq %rbx, %rbx
cmovnsq %rbx, %r14
sarq $0x3, %r14
addq %r14, %rdx
movq %rdx, %rsi
callq 0xeead3
movzbl %al, %eax
shll $0x3, %r14d
subl %r14d, %ebx
movb $0x7, %cl
subb %bl, %cl
movzbl %cl, %ecx
btl %ecx, %eax
setb %al
jmp 0xf27ae
movq %rbx, %r14
shrq $0x3f, %r14
addq %rbx, %r14
sarq %r14
addq %r14, %rdx
movq %rdx, %rsi
callq 0xeead3
movzbl %al, %eax
addl %r14d, %r14d
subl %r14d, %ebx
shll $0x2, %ebx
movb $0x4, %cl
subb %bl, %cl
shrl %cl, %eax
andb $0xf, %al
jmp 0xf27ae
leaq 0x3(%rbx), %r14
testq %rbx, %rbx
cmovnsq %rbx, %r14
sarq $0x2, %r14
addq %r14, %rdx
movq %rdx, %rsi
callq 0xeead3
movzbl %al, %eax
shll $0x2, %r14d
subl %r14d, %ebx
addl %ebx, %ebx
movb $0x6, %cl
subb %bl, %cl
shrl %cl, %eax
andb $0x3, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq %rdx, %rbx
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xeead3
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_get_bits_symbol_lsb
u8 de_get_bits_symbol_lsb(dbuf *f, i64 bps, i64 rowstart, i64 index)
{
	i64 byte_offset;
	u8 b;
	u8 x = 0;

	switch(bps) {
	case 1:
		byte_offset = rowstart + index/8;
		b = dbuf_getbyte(f, byte_offset);
		x = (b >> (index%8)) & 0x01;
		break;
	case 2:
		byte_offset = rowstart + index/4;
		b = dbuf_getbyte(f, byte_offset);
		x = (b >> (2 * (index%4))) & 0x03;
		break;
	case 4:
		byte_offset = rowstart + index/2;
		b = dbuf_getbyte(f, byte_offset);
		x = (b >> (4 * (index%2))) & 0x0f;
		break;
	case 8:
		byte_offset = rowstart + index;
		x = dbuf_getbyte(f, byte_offset);
	}
	return x;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %eax, %eax
decq %rsi
cmpq $0x7, %rsi
ja 0xf2872
movq %rcx, %rbx
leaq 0x56d87(%rip), %rcx     # 0x14956c
movslq (%rcx,%rsi,4), %rsi
addq %rcx, %rsi
jmpq *%rsi
leaq 0x7(%rbx), %r14
testq %rbx, %rbx
cmovnsq %rbx, %r14
sarq $0x3, %r14
addq %r14, %rdx
movq %rdx, %rsi
callq 0xeead3
movzbl %al, %eax
shll $0x3, %r14d
subl %r14d, %ebx
btl %ebx, %eax
setb %al
jmp 0xf2872
movq %rbx, %r14
shrq $0x3f, %r14
addq %rbx, %r14
sarq %r14
addq %r14, %rdx
movq %rdx, %rsi
callq 0xeead3
movzbl %al, %eax
addl %r14d, %r14d
subl %r14d, %ebx
shll $0x2, %ebx
movl %ebx, %ecx
shrl %cl, %eax
andb $0xf, %al
jmp 0xf2872
leaq 0x3(%rbx), %r14
testq %rbx, %rbx
cmovnsq %rbx, %r14
sarq $0x2, %r14
addq %r14, %rdx
movq %rdx, %rsi
callq 0xeead3
movzbl %al, %eax
shll $0x2, %r14d
subl %r14d, %ebx
addl %ebx, %ebx
movl %ebx, %ecx
shrl %cl, %eax
andb $0x3, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq %rdx, %rbx
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xeead3
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_get_bits_symbol2
u8 de_get_bits_symbol2(dbuf *f, int nbits, i64 bytepos, i64 bitpos)
{
	u8 b0, b1;
	int bits_in_first_byte;
	int bits_in_second_byte;

	bits_in_first_byte = 8-(bitpos%8);

	b0 = dbuf_getbyte(f, bytepos + bitpos/8);

	if(bits_in_first_byte<8) {
		b0 &= (0xff >> (8-bits_in_first_byte)); // Zero out insignificant bits
	}

	if(bits_in_first_byte == nbits) {
		// First byte has all the bits
		return b0;
	}
	else if(bits_in_first_byte >= nbits) {
		// First byte has all the bits
		return b0 >> (bits_in_first_byte - nbits);
	}

	bits_in_second_byte = nbits - bits_in_first_byte;
	b1 = dbuf_getbyte(f, bytepos + bitpos/8 +1);

	return (b0<<bits_in_second_byte) | (b1>>(8-bits_in_second_byte));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movl %esi, %ebx
leaq 0x7(%rcx), %r14
testq %rcx, %rcx
cmovnsq %rcx, %r14
movq %rdi, %r15
movq %r14, %rax
andq $-0x8, %rax
subq %rax, %r12
movl $0x8, %r13d
subl %r12d, %r13d
sarq $0x3, %r14
addq %rdx, %r14
movq %r14, %rsi
callq 0xeead3
movl $0xff, %ebp
movl %r12d, %ecx
shrl %cl, %ebp
movl $0xff, %ecx
testq %r12, %r12
cmovlel %ecx, %ebp
andb %al, %bpl
movl %r13d, %ecx
subl %ebx, %ecx
je 0xf2919
jge 0xf2913
subl %r13d, %ebx
incq %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0xeead3
movzbl %bpl, %edx
movl %ebx, %ecx
shll %cl, %edx
movzbl %al, %ebp
movb $0x8, %cl
subb %bl, %cl
shrl %cl, %ebp
orl %edx, %ebp
jmp 0xf2919
movzbl %bpl, %ebp
shrl %cl, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_unpack_pixels_bilevel_from_byte
void de_unpack_pixels_bilevel_from_byte(de_bitmap *img, i64 xpos, i64 ypos,
	u8 val, UI npixels, unsigned int flags)
{
	UI i;
	u8 xv;

	if(npixels>8) return;
	xv = (flags & DE_CVTF_WHITEISZERO) ? 0xff : 0x00;

	for(i=0; i<npixels; i++) {
		u8 x;

		if(flags & DE_CVTF_LSBFIRST) {
			x = (val & 0x01) ? 0xff : 0x00;
			val >>= 1;
		}
		else {
			x = (val & 0x80) ? 0xff : 0x00;
			val <<= 1;
		}

		x ^= xv;
		if(x==0x00 && (flags & DE_CVTF_ONLYWHITE)) continue;
		de_bitmap_setpixel_gray(img, xpos+(i64)i, ypos, x);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
leal -0x1(%r8), %eax
cmpl $0x7, %eax
ja 0xf2997
movl %r9d, %ebx
movl %ecx, %ebp
movq %rsi, %r15
movq %rdi, %r12
movl %ebx, %r13d
andb $0x1, %r13b
negb %r13b
movl %r8d, %r14d
movl %ebp, %eax
testb $0x2, %bl
jne 0xf2969
sarb $0x7, %al
addb %bpl, %bpl
jmp 0xf2970
andb $0x1, %al
negb %al
shrb %bpl
testb $0x4, %bl
je 0xf297a
cmpb %r13b, %al
je 0xf298f
xorb %r13b, %al
movzbl %al, %ecx
movq %r12, %rdi
movq %r15, %rsi
movq (%rsp), %rdx
callq 0xf2405
incq %r15
decq %r14
jne 0xf295a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/src/deark-bitmap.c
// Function: de_convert_pixels_bilevel
void de_convert_pixels_bilevel(dbuf *f, i64 pos1, de_bitmap *img,
	i64 xpos1, i64 ypos, i64 npixels, unsigned int flags)
{
	i64 pos = pos1;
	i64 xpos = xpos1;
	i64 npixels_remaining = npixels;
	i64 npixels_this_time;

	while(npixels_remaining>0) {
		u8 b;

		b = dbuf_getbyte_p(f, &pos);
		npixels_this_time = de_min_int(npixels_remaining, 8);
		de_unpack_pixels_bilevel_from_byte(img, xpos, ypos, b,
			(UI)npixels_this_time, flags);
		npixels_remaining -= npixels_this_time;
		xpos += 8;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
testq %r9, %r9
jle 0xf2a19
movq %r9, %rbx
movq %r8, %rbp
movq %rcx, %r15
movq %rdi, %r13
movq %rdx, 0x8(%rsp)
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
callq 0xeeb4b
movq %rbp, %r12
movl %eax, %ebp
movl $0x8, %esi
movq %rbx, %rdi
callq 0xe9c3b
movq %rax, %r14
movzbl %bpl, %ecx
movq %r12, %rbp
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movl %r14d, %r8d
movl 0x50(%rsp), %r9d
callq 0xf292a
addq $0x8, %r15
subq %r14, %rbx
jg 0xf29cf
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-bitmap.c
// Function: de_convert_and_write_image_bilevel
void de_convert_and_write_image_bilevel(dbuf *f, i64 fpos,
	i64 width, i64 height, i64 rowspan, unsigned int cvtflags,
	de_finfo *fi, unsigned int createflags)
{
	de_bitmap *img = NULL;
	deark *c = f->c;

	if(!de_good_image_dimensions(c, width, height)) return;

	img = de_bitmap_create(c, width, height, 1);
	de_convert_image_bilevel(f, fpos, rowspan, img, cvtflags);
	de_bitmap_write_to_file_finfo(img, fi, createflags | DE_CREATEFLAG_IS_BWIMG);
	de_bitmap_destroy(img);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, 0xc(%rsp)
movq %r8, 0x20(%rsp)
movq %rcx, %r14
movq %rdx, %rbp
movq %rsi, 0x18(%rsp)
movq %rdi, %r13
movl 0x68(%rsp), %ebx
movq 0x60(%rsp), %r12
movq 0x8(%rdi), %r15
movq %r15, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0xf1db1
testl %eax, %eax
je 0xf2b4c
movl $0x40, %esi
movq %r15, %rdi
callq 0xe8b2b
movq %r12, 0x10(%rsp)
movq %rax, %r12
movq %r15, (%rax)
movq %rbp, 0x8(%rax)
movq %rbp, 0x18(%rax)
movq %r14, 0x10(%rax)
movl $0x1, 0x24(%rax)
movq %r13, %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %rax, %rcx
movl 0xc(%rsp), %r8d
callq 0xf2a40
orl $0x8, %ebx
movq %r12, %rdi
xorl %esi, %esi
movq 0x10(%rsp), %rdx
movl %ebx, %ecx
callq 0xf1f1a
movq %r12, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf228d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq