LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-tar.c
// Function: add_exthdr_item
static void add_exthdr_item(deark *c, struct tar_ctx *tctx,
	dbuf *extdata, const char *name, const char *val, i64 *ppos)
{
	i64 len1;
	i64 item_len = 0;
	char *tmps = NULL;

	len1 = (i64)de_strlen(name) + (i64)de_strlen(val) + 3;
	// This size of the size field depends on itself. Ugh.
	if(len1<=8) item_len = len1+1;
	else if(len1<=97) item_len = len1+2;
	else if(len1<=996) item_len = len1+3;
	else if(len1<=9995) item_len = len1+4;
	else if(len1<=99994) item_len = len1+5;
	else if(len1<=999993) item_len = len1+6;
	else { // Error
		(*ppos)++;
		goto done;
	}

	tmps = de_malloc(c, item_len+1);
	de_snprintf(tmps, (size_t)(item_len+1), "%"I64_FMT" %s=%s\n", item_len, name, val);
	dbuf_write_at(extdata, *ppos, (const u8*)tmps, item_len);
	(*ppos) += item_len;

done:
	de_free(c, tmps);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %r14
movq %rdx, %rdi
callq 0x180e0
movq %rax, %r15
movq %r13, %rdi
callq 0x180e0
addq %r15, %rax
movl $0x4, %ecx
cmpq $0x6, %rax
jl 0xeee2e
movl $0x5, %ecx
cmpq $0x5f, %rax
jl 0xeee2e
movl $0x6, %ecx
cmpq $0x3e2, %rax            # imm = 0x3E2
jl 0xeee2e
movl $0x7, %ecx
cmpq $0x2709, %rax           # imm = 0x2709
jl 0xeee2e
movl $0x8, %ecx
cmpq $0x18698, %rax          # imm = 0x18698
jl 0xeee2e
movl $0x9, %ecx
cmpq $0xf4236, %rax          # imm = 0xF4236
jg 0xeeea6
movq %rbp, 0x8(%rsp)
leaq (%rax,%rcx), %rbp
movq %r12, 0x10(%rsp)
movq %rbx, %r12
leaq (%rax,%rcx), %rbx
incq %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe969b
movq %rax, %r15
leaq 0x59d2d(%rip), %rdx     # 0x148b88
movq %rax, %rdi
movq %rbx, %rsi
movq %r12, %rbx
movq %rbp, %rcx
movq 0x8(%rsp), %r8
movq %r13, %r9
xorl %eax, %eax
callq 0xe8d67
movq (%r12), %rsi
movq 0x10(%rsp), %rdi
movq %r15, %rdx
movq %rbp, %rcx
callq 0xf11f9
addq %rbp, (%rbx)
movq %r14, %rdi
movq %r15, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9752
movl $0x1, %ebp
xorl %r15d, %r15d
jmp 0xeee8a
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_standard_read
i64 dbuf_standard_read(dbuf *f, u8 *buf, i64 n, i64 *fpos)
{
	i64 amt_to_read;

	if(*fpos < 0 || *fpos >= f->len) return 0;

	amt_to_read = n;
	if(*fpos + amt_to_read > f->len) amt_to_read = f->len - *fpos;
	dbuf_read(f, buf, *fpos, amt_to_read);
	*fpos += amt_to_read;
	return amt_to_read;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rax
movq (%rcx), %rdx
testq %rdx, %rdx
js 0xef0c8
movq %rcx, %r14
movq 0x18(%rdi), %rcx
movq %rcx, %rbx
subq %rdx, %rbx
jle 0xef0c8
leaq (%rdx,%rax), %r8
cmpq %rcx, %r8
cmovleq %rax, %rbx
movq %rbx, %rcx
callq 0xeeee8
addq %rbx, (%r14)
jmp 0xef0ca
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_getbyte
u8 dbuf_getbyte(dbuf *f, i64 pos)
{
	u8 b;

	if(pos<0 || pos>=f->len) return 0x00;

	if(pos<f->rcache_bytes_used) {
		return f->rcache[pos];
	}
	if(f->btype==DBUF_TYPE_MEMBUF) {
		return f->membuf_buf[pos];
	}

	dbuf_read(f, &b, pos, 1);
	return b;
}

// Assembly:
testq %rsi, %rsi
js 0xef0f5
movq %rsi, %rdx
cmpq %rsi, 0x18(%rdi)
jle 0xef0f5
cmpq %rdx, 0xc0(%rdi)
jle 0xef0f8
movq 0xc8(%rdi), %rax
jmp 0xef101
xorl %eax, %eax
retq
cmpl $0x3, (%rdi)
jne 0xef105
movq 0x78(%rdi), %rax
movb (%rax,%rdx), %al
retq
pushq %rbx
subq $0x10, %rsp
leaq 0xf(%rsp), %rbx
movl $0x1, %ecx
movq %rbx, %rsi
callq 0xeeee8
movb (%rbx), %al
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_getu16be_p
i64 dbuf_getu16be_p(dbuf *f, i64 *ppos)
{
	u8 m[2];
	dbuf_read(f, m, *ppos, 2);
	(*ppos) += 2;
	return de_getu16be_direct(m);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rsi), %rdx
leaq 0x6(%rsp), %r14
movl $0x2, %ecx
movq %r14, %rsi
callq 0xeeee8
addq $0x2, (%rbx)
movzwl (%r14), %eax
rolw $0x8, %ax
movzwl %ax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_getu16le_p
i64 dbuf_getu16le_p(dbuf *f, i64 *ppos)
{
	u8 m[2];
	dbuf_read(f, m, *ppos, 2);
	(*ppos) += 2;
	return de_getu16le_direct(m);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rsi), %rdx
leaq 0x6(%rsp), %r14
movl $0x2, %ecx
movq %r14, %rsi
callq 0xeeee8
addq $0x2, (%rbx)
movzwl (%r14), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_geti16be
i64 dbuf_geti16be(dbuf *f, i64 pos)
{
	i64 n;
	n = dbuf_getu16be(f, pos);
	if(n>=32768) n -= 65536;
	return n;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rdx
leaq 0xe(%rsp), %rbx
movl $0x2, %ecx
movq %rbx, %rsi
callq 0xeeee8
movzbl 0x1(%rbx), %eax
movzbl (%rbx), %ecx
movl %ecx, %edx
shll $0x8, %edx
leaq (%rdx,%rax), %rsi
testb %cl, %cl
leaq -0x10000(%rdx,%rax), %rax
cmovnsq %rsi, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_geti16le
i64 dbuf_geti16le(dbuf *f, i64 pos)
{
	i64 n;
	n = dbuf_getu16le(f, pos);
	if(n>=32768) n -= 65536;
	return n;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rdx
leaq 0xe(%rsp), %rbx
movl $0x2, %ecx
movq %rbx, %rsi
callq 0xeeee8
movzbl (%rbx), %eax
movzbl 0x1(%rbx), %ecx
movl %ecx, %edx
shll $0x8, %edx
leaq (%rdx,%rax), %rsi
testb %cl, %cl
leaq -0x10000(%rdx,%rax), %rax
cmovnsq %rsi, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_geti16be_p
i64 dbuf_geti16be_p(dbuf *f, i64 *ppos)
{
	i64 n;
	n = dbuf_geti16be(f, *ppos);
	(*ppos) += 2;
	return n;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rsi), %rdx
leaq 0x6(%rsp), %r14
movl $0x2, %ecx
movq %r14, %rsi
callq 0xeeee8
movzbl 0x1(%r14), %eax
movzbl (%r14), %ecx
movl %ecx, %edx
shll $0x8, %edx
leaq (%rdx,%rax), %rsi
testb %cl, %cl
leaq -0x10000(%rdx,%rax), %rax
cmovnsq %rsi, %rax
addq $0x2, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_geti16le_p
i64 dbuf_geti16le_p(dbuf *f, i64 *ppos)
{
	i64 n;
	n = dbuf_geti16le(f, *ppos);
	(*ppos) += 2;
	return n;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rsi), %rdx
leaq 0x6(%rsp), %r14
movl $0x2, %ecx
movq %r14, %rsi
callq 0xeeee8
movzbl (%r14), %eax
movzbl 0x1(%r14), %ecx
movl %ecx, %edx
shll $0x8, %edx
leaq (%rdx,%rax), %rsi
testb %cl, %cl
leaq -0x10000(%rdx,%rax), %rax
cmovnsq %rsi, %rax
addq $0x2, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_getu32be_p
i64 dbuf_getu32be_p(dbuf *f, i64 *ppos)
{
	u8 m[4];
	dbuf_read(f, m, *ppos, 4);
	(*ppos) += 4;
	return de_getu32be_direct(m);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rsi), %rdx
leaq 0x4(%rsp), %r14
movl $0x4, %ecx
movq %r14, %rsi
callq 0xeeee8
addq $0x4, (%rbx)
movl (%r14), %eax
bswapl %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_getu32le_p
i64 dbuf_getu32le_p(dbuf *f, i64 *ppos)
{
	u8 m[4];
	dbuf_read(f, m, *ppos, 4);
	(*ppos) += 4;
	return de_getu32le_direct(m);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rsi), %rdx
leaq 0x4(%rsp), %r14
movl $0x4, %ecx
movq %r14, %rsi
callq 0xeeee8
addq $0x4, (%rbx)
movl (%r14), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: de_getfloat64x_direct
double de_getfloat64x_direct(deark *c, const u8 *m, int is_le)
{
	char buf[8];
	double val = 0.0;

	if(c->can_decode_fltpt<0) {
		init_fltpt_decoder(c);
	}
	if(!c->can_decode_fltpt) return 0.0;

	de_memcpy(buf, m, 8);

	if(is_le != c->host_is_le) {
		int i;
		char tmpc;
		// Reverse order of bytes
		for(i=0; i<4; i++) {
			tmpc = buf[i]; buf[i] = buf[7-i]; buf[7-i] = tmpc;
		}
	}

	de_memcpy(&val, buf, 8);
	return (double)val;
}

// Assembly:
cmpl $0x0, 0xf0(%rdi)
jns 0xef98a
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0xf0(%rdi)
cmpl $0x0, 0xf0(%rdi)
je 0xef9cb
movq (%rsi), %rax
movq %rax, -0x8(%rsp)
cmpl %edx, 0xf4(%rdi)
je 0xef9c4
leaq -0x1(%rsp), %rax
xorl %ecx, %ecx
movb -0x8(%rsp,%rcx), %dl
movb (%rax), %sil
movb %sil, -0x8(%rsp,%rcx)
movb %dl, (%rax)
incq %rcx
decq %rax
cmpq $0x4, %rcx
jne 0xef9aa
movsd -0x8(%rsp), %xmm0
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_read_ascii_number
int dbuf_read_ascii_number(dbuf *f, i64 pos, i64 fieldsize,
	int base, i64 *value)
{
	char buf[32];

	*value = 0;
	if(fieldsize>(i64)(sizeof(buf)-1)) return 0;

	dbuf_read(f, (u8*)buf, pos, fieldsize);
	buf[fieldsize] = '\0';

	*value = de_strtoll(buf, NULL, base);
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq $0x0, (%r8)
xorl %eax, %eax
cmpq $0x1f, %rdx
jg 0xefa55
movq %r8, %rbx
movl %ecx, %ebp
movq %rsi, %rdx
movq %rsp, %r15
movq %r15, %rsi
movq %r14, %rcx
callq 0xeeee8
movb $0x0, (%rsp,%r14)
movq %r15, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x109895
movq %rax, (%rbx)
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_getRGB
de_color dbuf_getRGB(dbuf *f, i64 pos, unsigned int flags)
{
	u8 buf[3];
	dbuf_read(f, buf, pos, 3);
	if(flags&DE_GETRGBFLAG_BGR)
		return DE_MAKE_RGB(buf[2], buf[1], buf[0]);
	return DE_MAKE_RGB(buf[0], buf[1], buf[2]);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movq %rsi, %rdx
leaq 0xd(%rsp), %rsi
movl $0x3, %ecx
callq 0xeeee8
testb $0x1, %bl
jne 0xefa96
movzbl 0xd(%rsp), %ecx
shll $0x10, %ecx
movzbl 0xe(%rsp), %eax
shll $0x8, %eax
orl %ecx, %eax
movb 0xf(%rsp), %cl
jmp 0xefaac
movzbl 0xf(%rsp), %ecx
shll $0x10, %ecx
movzbl 0xe(%rsp), %eax
shll $0x8, %eax
orl %ecx, %eax
movb 0xd(%rsp), %cl
movzbl %cl, %ecx
addl %ecx, %eax
addl $0xff000000, %eax       # imm = 0xFF000000
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_copy
void dbuf_copy(dbuf *inf, i64 input_offset, i64 input_len, dbuf *outf)
{
	u8 tmpbuf[256];

	// Fast paths, if the data to copy is all in memory

	if(inf->rcache &&
		(input_offset>=0) && (input_offset+input_len<=inf->rcache_bytes_used))
	{
		dbuf_write(outf, &inf->rcache[input_offset], input_len);
		return;
	}

	if(inf->btype==DBUF_TYPE_MEMBUF &&
		(input_offset>=0) && (input_offset+input_len<=inf->len))
	{
		dbuf_write(outf, &inf->membuf_buf[input_offset], input_len);
		return;
	}

	if(input_len<=(i64)sizeof(tmpbuf)) {
		// Fast path for small sizes
		dbuf_read(inf, tmpbuf, input_offset, input_len);
		dbuf_write(outf, tmpbuf, input_len);
		return;
	}

	dbuf_buffered_read(inf, input_offset, input_len, copy_cbfn, (void*)outf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %rdx
movq 0xc8(%rdi), %rsi
testq %rsi, %rsi
sete %al
testq %rdx, %rdx
sets %cl
orb %al, %cl
jne 0xefaf5
leaq (%rbx,%rdx), %rax
cmpq 0xc0(%rdi), %rax
jle 0xefb5c
testq %rdx, %rdx
js 0xefb09
cmpl $0x3, (%rdi)
jne 0xefb09
leaq (%rbx,%rdx), %rax
cmpq 0x18(%rdi), %rax
jle 0xefb64
cmpq $0x100, %rbx            # imm = 0x100
jg 0xefb3b
movq %rsp, %r15
movq %r15, %rsi
movq %rbx, %rcx
callq 0xeeee8
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xefb82
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2c4(%rip), %rcx       # 0xefe06
movq %rdx, %rsi
movq %rbx, %rdx
movq %r14, %r8
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %r15
jmp 0xefc28
addq %rdx, %rsi
movq %r14, %rdi
jmp 0xefb6e
addq 0x78(%rdi), %rdx
movq %r14, %rdi
movq %rdx, %rsi
movq %rbx, %rdx
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %r15
jmp 0xefb82
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_write
void dbuf_write(dbuf *f, const u8 *m, i64 len)
{
	if(!f->wbuffer) {
		dbuf_write_unbuffered(f, m, len);
		return;
	}

	if(len<=0) return;

	if(len > DE_WBUFFER_SIZE/2) {
		// This item doesn't fit in the buffer, even by itself, or we
		// consider it "large".
		// Flush the buffer, write the item, done.
		// TODO: Decide what the "large" threshold should be, or if there should
		// even be one.
		if(f->wbuffer_bytes_used!=0) dbuf_flush(f);
		dbuf_write_unbuffered(f, m, len);
		return;
	}

	if(f->wbuffer_bytes_used + len > DE_WBUFFER_SIZE) {
		// This item fits in the buffer by itself, but currently the buffer
		// is too full.
		// Flush the buffer, copy the item to the buffer, done.
		dbuf_flush(f);
		de_memcpy(f->wbuffer, m, (size_t)len);
		f->wbuffer_bytes_used = len;
		return;
	}

	// There is room for this item in the buffer, even without flushing it first.
	de_memcpy(&f->wbuffer[f->wbuffer_bytes_used], m, (size_t)len);
	f->wbuffer_bytes_used += len;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x48(%rdi), %rsi
testq %rsi, %rsi
je 0xefbc4
testq %rbx, %rbx
jle 0xefc22
movq 0x40(%r14), %rdx
cmpq $0x101, %rbx            # imm = 0x101
jl 0xefbd7
testq %rdx, %rdx
je 0xefbc4
movq %r14, %rdi
callq 0xf1072
movq $0x0, 0x40(%r14)
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0xf1072
leaq (%rdx,%rbx), %rax
cmpq $0x201, %rax            # imm = 0x201
jl 0xefc0d
testq %rdx, %rdx
je 0xefbf8
movq %r14, %rdi
callq 0xf1072
movq $0x0, 0x40(%r14)
movq 0x48(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x181e0
movq %rbx, 0x40(%r14)
jmp 0xefc22
addq %rdx, %rsi
movq %rsi, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x181e0
addq %rbx, 0x40(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: copy_at_cbfn
static int copy_at_cbfn(struct de_bufferedreadctx *brctx, const u8 *buf,
	i64 buf_len)
{
	struct copy_at_ctx *ctx = (struct copy_at_ctx*)brctx->userdata;

	dbuf_write_at(ctx->outf, ctx->outpos, buf, buf_len);
	ctx->outpos += buf_len;
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %rdx
movq (%rdi), %r14
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq %rbx, %rcx
callq 0xf11f9
addq %rbx, 0x8(%r14)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_search_byte
int dbuf_search_byte(dbuf *f, const u8 b, i64 startpos,
	i64 haystack_len, i64 *foundpos)
{
	i64 i;

	for(i=0; i<haystack_len; i++) {
		if(b == dbuf_getbyte(f, startpos+i)) {
			*foundpos = startpos+i;
			return 1;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testq %rcx, %rcx
jle 0xf0099
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0xef0d5
cmpb %bpl, %al
je 0xf0091
incq %r15
decq %r12
jne 0xf0077
jmp 0xf0099
movq %r15, (%r14)
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: de_destroy_stringreaderdata
void de_destroy_stringreaderdata(deark *c, struct de_stringreaderdata *srd)
{
	if(!srd) return;
	de_free(c, srd->sz);
	de_free(c, srd->sz_utf8);
	ucstring_destroy(srd->str);
	de_free(c, srd);
}

// Assembly:
testq %rsi, %rsi
je 0xf00e9
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rsi
callq 0xe9752
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0xe9752
movq 0x18(%rbx), %rdi
callq 0xf6bb0
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe9752
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_read_to_ucstring_ex
void dbuf_read_to_ucstring_ex(dbuf *f, i64 pos1, i64 len,
	de_ucstring *s, unsigned int conv_flags, struct de_encconv_state *es)
{
	i64 nbytes_remaining;
	i64 pos = pos1;
	int stop_at_nul = 0;
#define READTOUCSTRING_BUFLEN 256
	u8 buf[READTOUCSTRING_BUFLEN];

	if(conv_flags & DE_CONVFLAG_STOP_AT_NUL) {
		stop_at_nul = 1;
		// We handle STOP_AT_NUL ourselves, so don't pass it on.
		conv_flags -= DE_CONVFLAG_STOP_AT_NUL;
	}

	// Note: It might be sensible to use dbuf_buffered_read() here, but I've
	// decided against it for now.
	nbytes_remaining = len;
	do {
		i64 nbytes_to_read;
		i64 nbytes_in_buf;
		unsigned int conv_flags_to_use_this_time;

		// Lack of DE_CONVFLAG_PARTIAL_DATA flag signals end of data, which
		// isn't necessarily a no-op even with len=0.
		// That's why we always do this loop at least once.

		nbytes_to_read = de_min_int(nbytes_remaining, READTOUCSTRING_BUFLEN);
		dbuf_read(f, buf, pos, nbytes_to_read);
		pos += nbytes_to_read;
		nbytes_in_buf = nbytes_to_read;
		nbytes_remaining -= nbytes_to_read;

		if(stop_at_nul) {
			char *tmpp;

			tmpp = de_memchr(buf, 0x00, (size_t)nbytes_in_buf);
			if(tmpp) {
				nbytes_in_buf = (const u8*)tmpp - buf;
				nbytes_remaining = 0;
			}
		}

		conv_flags_to_use_this_time = conv_flags;
		if(nbytes_remaining>0) {
			// The caller may have already set this flag, in which case we will use
			// it every time.
			// If not, we still use it for all but the final call to ucstring_append_bytes_ex().
			conv_flags_to_use_this_time |= DE_CONVFLAG_PARTIAL_DATA;
		}

		ucstring_append_bytes_ex(s, buf, nbytes_in_buf, conv_flags_to_use_this_time, es);
	} while(nbytes_remaining>0);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %r9, 0x18(%rsp)
movl %r8d, %ebp
movq %rcx, 0x10(%rsp)
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, 0x8(%rsp)
movl %r8d, %r13d
andl $-0x2, %ebp
movl %ebp, 0x4(%rsp)
orl $0x40, %ebp
leaq 0x20(%rsp), %rbx
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
callq 0xea792
movq %rax, %r14
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %rax, %rcx
callq 0xeeee8
subq %r14, %r15
testb $0x1, %r13b
je 0xf0176
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x18150
movq %rax, %rdx
subq %rbx, %rdx
testq %rax, %rax
movl $0x0, %eax
cmovneq %rax, %r15
cmoveq %r14, %rdx
jmp 0xf0179
movq %r14, %rdx
movl %ebp, %ecx
testq %r15, %r15
jg 0xf0184
movl 0x4(%rsp), %ecx
addq %r14, %r12
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq 0x18(%rsp), %r8
callq 0xf6c10
testq %r15, %r15
jg 0xf0125
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_memcmp
int dbuf_memcmp(dbuf *f, i64 pos, const void *s, size_t n)
{
	u8 buf1[128];

	if(f->rcache &&
		pos >= 0 &&
		pos + (i64)n <= f->rcache_bytes_used)
	{
		// Fastest path: Compare directly to cache.
		return de_memcmp(s, &f->rcache[pos], n);
	}

	if(n<=sizeof(buf1)) {
		// Use a stack buffer if small enough.
		dbuf_read(f, buf1, pos, n);
		return de_memcmp(buf1, s, n);
	}

	// Fallback method.
	return !dbuf_buffered_read(f, pos, n, dbufmemcmp_cbfn, (void*)s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %rdx
movq 0xc8(%rdi), %rsi
testq %rsi, %rsi
sete %al
testq %rdx, %rdx
sets %cl
orb %al, %cl
jne 0xf0297
leaq (%rbx,%rdx), %rax
cmpq 0xc0(%rdi), %rax
jle 0xf02e9
cmpq $0x80, %rbx
ja 0xf02be
movq %rsp, %r15
movq %r15, %rsi
movq %rbx, %rcx
callq 0xeeee8
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x18170
jmp 0xf02dc
leaq 0x3e(%rip), %rcx        # 0xf0303
movq %rdx, %rsi
movq %rbx, %rdx
movq %r14, %r8
callq 0xefc28
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
addq %rdx, %rsi
movq %r14, %rdi
movq %rbx, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x18170
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_create_file_from_slice
int dbuf_create_file_from_slice(dbuf *inf, i64 pos, i64 data_size,
	const char *ext, de_finfo *fi, unsigned int createflags)
{
	dbuf *f;
	f = dbuf_create_output_file(inf->c, ext, fi, createflags);
	if(!f) return 0;
	dbuf_copy(inf, pos, data_size, f);
	dbuf_close(f);
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rdi
movq %rcx, %rsi
movq %r8, %rdx
movl %r9d, %ecx
callq 0xf037a
testq %rax, %rax
je 0xf036c
movq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %rax, %rcx
callq 0xefabc
movq %r12, %rdi
callq 0xf0b13
movl $0x1, %eax
jmp 0xf036e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_create_unmanaged_file
dbuf *dbuf_create_unmanaged_file(deark *c, const char *fname, int overwrite_mode,
	unsigned int flags)
{
	dbuf *f;
	char msgbuf[200];

	f = create_dbuf_lowlevel(c);
	f->is_managed = 0;
	f->name = de_strdup(c, fname);

	f->btype = DBUF_TYPE_OFILE;
	f->max_len_hard = c->max_output_file_size;
	f->fp = de_fopen_for_write(c, f->name, msgbuf, sizeof(msgbuf),
		c->overwrite_mode, flags);

	if(!f->fp) {
		de_err(c, "Failed to write %s: %s", f->name, msgbuf);
		f->btype = DBUF_TYPE_NULL;
		c->serious_error_flag = 1;
	}

	return f;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movl %ecx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movl $0xd8, %esi
callq 0xe969b
movq %rax, %r14
movq %rbx, 0x8(%rax)
movl $0xffffffff, 0x64(%rax) # imm = 0xFFFFFFFF
movb $0x0, 0x4(%rax)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xea3c7
movq %rax, 0x68(%r14)
movl $0x2, (%r14)
movq 0xb0(%rbx), %rcx
movq %rcx, 0x20(%r14)
movl 0xd8(%rbx), %r8d
movq %rsp, %rdx
movl $0xc8, %ecx
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %r9d
callq 0x1099c3
movq %rax, 0x10(%r14)
testq %rax, %rax
jne 0xf0dcf
movq 0x68(%r14), %rdx
leaq 0x57ecb(%rip), %rsi     # 0x148c82
movq %rsp, %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movl $0x0, (%r14)
movb $0x1, 0x4c(%rbx)
movq %r14, %rax
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_create_unmanaged_file_stdout
dbuf *dbuf_create_unmanaged_file_stdout(deark *c, const char *name)
{
	dbuf *f;

	f = create_dbuf_lowlevel(c);
	f->is_managed = 0;
	f->name = de_strdup(c, name);
	f->btype = DBUF_TYPE_STDOUT;
	f->max_len_hard = c->max_output_file_size;
	f->fp = stdout;
	return f;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0xd8, %esi
callq 0xe969b
movq %rax, %r15
movq %r14, 0x8(%rax)
movl $0xffffffff, 0x64(%rax) # imm = 0xFFFFFFFF
movb $0x0, 0x4(%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0xea3c7
movq %rax, 0x68(%r15)
movl $0x5, (%r15)
movq 0xb0(%r14), %rax
movq %rax, 0x20(%r15)
movq 0x9e1a1(%rip), %rax     # 0x18efd0
movq (%rax), %rax
movq %rax, 0x10(%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_disable_wbuffer
void dbuf_disable_wbuffer(dbuf *f)
{
	if(!f->wbuffer) return;
	dbuf_flush(f);
	de_free(f->c, f->wbuffer);
	f->wbuffer = NULL;
}

// Assembly:
movq 0x48(%rdi), %rsi
testq %rsi, %rsi
je 0xf0ea3
pushq %rbx
movq %rdi, %rbx
movq 0x40(%rdi), %rdx
testq %rdx, %rdx
je 0xf0e8d
movq %rbx, %rdi
callq 0xf1072
movq $0x0, 0x40(%rbx)
movq 0x8(%rbx), %rdi
movq 0x48(%rbx), %rsi
callq 0xe9752
movq $0x0, 0x48(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_create_membuf
dbuf *dbuf_create_membuf(deark *c, i64 initialsize, unsigned int flags)
{
	dbuf *f;

	f = create_dbuf_lowlevel(c);
	f->btype = DBUF_TYPE_MEMBUF;
	f->max_len_hard = DE_MAX_MEMBUF_SIZE;

	if(initialsize>0) {
		if(initialsize > f->max_len_hard) {
			do_on_dbuf_size_exceeded(f);
		}
		f->membuf_buf = de_malloc(c, initialsize);
		f->membuf_alloc = initialsize;
	}

	if(flags&0x01) {
		dbuf_set_length_limit(f, initialsize);
	}

	return f;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r15
movl $0xd8, %esi
callq 0xe969b
movq %rax, %r14
movq %r15, 0x8(%rax)
movl $0xffffffff, 0x64(%rax) # imm = 0xFFFFFFFF
movl $0x3, (%rax)
movq $0x77359400, 0x20(%rax) # imm = 0x77359400
testq %rbx, %rbx
jle 0xf100d
cmpq $0x77359401, %rbx       # imm = 0x77359401
jl 0xf0ffa
movq %r14, %rdi
callq 0xf102d
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe969b
movq %rax, 0x78(%r14)
movq %rbx, 0x70(%r14)
testb $0x1, %bpl
je 0xf101f
movl $0x1, 0x30(%r14)
movq %rbx, 0x28(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: do_on_dbuf_size_exceeded
static void do_on_dbuf_size_exceeded(dbuf *f)
{
	de_err(f->c, "Maximum %s size of %"I64_FMT" bytes exceeded",
		(f->btype==DBUF_TYPE_MEMBUF)?"membuf":"output file",
		f->max_len_hard);
	de_fatalerror(f->c);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
cmpl $0x3, (%rbx)
leaq 0x57ec5(%rip), %rax     # 0x148f04
leaq 0x3dfbf(%rip), %rdx     # 0x12f005
cmoveq %rax, %rdx
movq 0x20(%rbx), %rcx
leaq 0x57e89(%rip), %rsi     # 0x148ede
xorl %eax, %eax
callq 0xe9df7
movq 0x8(%rbx), %rdi
popq %rbx
jmp 0xea084
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_write_unbuffered
static void dbuf_write_unbuffered(dbuf *f, const u8 *m, i64 len)
{
	if(len<=0) return;
	if(f->len + len > f->max_len_hard) {
		do_on_dbuf_size_exceeded(f);
	}

	if(f->crco_for_oinfo) {
		de_crcobj_addbuf(f->crco_for_oinfo, m, len);
	}
	if(f->writelistener_cb) {
		f->writelistener_cb(f, f->userdata_for_writelistener, m, len);
	}

	switch(f->btype) {
	case DBUF_TYPE_OFILE:
	case DBUF_TYPE_STDOUT:
		if(!f->fp) return;
		if(f->c->debug_level>=4) {
			de_dbgx(f->c, 4, "writing %"I64_FMT" bytes to %s", len, f->name);
		}
		fwrite(m, 1, (size_t)len, f->fp);
		f->len += len;
		return;
	case DBUF_TYPE_MEMBUF:
		if(f->c->debug_level>=4 && f->name) {
			de_dbgx(f->c, 4, "appending %"I64_FMT" bytes to membuf %s", len, f->name);
		}
		membuf_append(f, m, len);
		return;
	case DBUF_TYPE_ODBUF:
		dbuf_write(f->parent_dbuf, m, len);
		f->len += len;
		return;
	case DBUF_TYPE_CUSTOM:
		if(f->customwrite_fn) {
			f->customwrite_fn(f, f->userdata_for_customwrite, m, len);
		}
		f->len += len;
		return;
	case DBUF_TYPE_NULL:
		f->len += len;
		return;
	}

	de_internal_err_fatal(f->c, "Invalid output file type (%d)", f->btype);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdx, %rdx
jle 0xf11b8
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x18(%rdi), %rax
addq %rdx, %rax
cmpq 0x20(%rdi), %rax
jle 0xf109e
movq %r14, %rdi
callq 0xf102d
movq 0x80(%r14), %rdi
testq %rdi, %rdi
je 0xf10b5
movq %r15, %rsi
movq %rbx, %rdx
callq 0xebe72
movq 0x90(%r14), %rax
testq %rax, %rax
je 0xf10d3
movq 0x88(%r14), %rsi
movq %r14, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq *%rax
movl (%r14), %edx
cmpq $0x9, %rdx
ja 0xf1153
leaq 0x57b25(%rip), %rax     # 0x148c08
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpq $0x0, 0x10(%r14)
je 0xf11b8
movq 0x8(%r14), %rdi
cmpl $0x4, (%rdi)
jl 0xf111a
movq 0x68(%r14), %r8
leaq 0x57e00(%rip), %rdx     # 0x148f0b
movl $0x4, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0xe94f3
movq 0x10(%r14), %rcx
movl $0x1, %esi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x182a0
jmp 0xf11b4
movq 0xb0(%r14), %rax
testq %rax, %rax
je 0xf11b4
movq 0xa8(%r14), %rsi
movq %r14, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq *%rax
jmp 0xf11b4
movq 0x8(%r14), %rdi
leaq 0x57de6(%rip), %rsi     # 0x148f44
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xea0a6
movq 0x8(%r14), %rdi
cmpl $0x4, (%rdi)
jl 0xf1192
movq 0x68(%r14), %r8
testq %r8, %r8
je 0xf1192
leaq 0x57da0(%rip), %rdx     # 0x148f23
movl $0x4, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0xe94f3
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0xf13b1
movq 0x50(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xefb82
addq %rbx, 0x18(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_writebyte
void dbuf_writebyte(dbuf *f, u8 n)
{
	// Optimization
	if(f->wbuffer && f->wbuffer_bytes_used<DE_WBUFFER_SIZE) {
		f->wbuffer[f->wbuffer_bytes_used++] = n;
		return;
	}

	dbuf_write(f, &n, 1);
}

// Assembly:
pushq %rax
movb %sil, 0x7(%rsp)
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0xf11e8
movq 0x40(%rdi), %rcx
cmpq $0x1ff, %rcx            # imm = 0x1FF
jg 0xf11e8
leaq 0x1(%rcx), %rdx
movq %rdx, 0x40(%rdi)
movb %sil, (%rax,%rcx)
jmp 0xf11f7
leaq 0x7(%rsp), %rsi
movl $0x1, %edx
callq 0xefb82
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_write_at
void dbuf_write_at(dbuf *f, i64 pos, const u8 *m, i64 len)
{
	if(len<1 || pos<0) return;

	if(pos + len > f->max_len_hard) {
		do_on_dbuf_size_exceeded(f);
	}

	if(f->btype==DBUF_TYPE_MEMBUF) {
		i64 amt_overwrite, amt_newzeroes, amt_append;

		if(pos+len <= f->len) { // entirely within the current file
			amt_overwrite = len;
			amt_newzeroes = 0;
			amt_append = 0;
		}
		else if(pos >= f->len) { // starts after the end of the current file
			amt_overwrite = 0;
			amt_newzeroes = pos - f->len;
			amt_append = len;
		}
		else { // overlaps the end of the current file
			amt_overwrite = f->len - pos;
			amt_newzeroes = 0;
			amt_append = len - amt_overwrite;
		}

		if(amt_overwrite>0) {
			de_memcpy(&f->membuf_buf[pos], m, (size_t)amt_overwrite);
		}
		if(amt_newzeroes>0) {
			dbuf_write_zeroes(f, amt_newzeroes);
		}
		if(amt_append>0) {
			membuf_append(f, &m[amt_overwrite], amt_append);
		}
	}
	else if(f->btype==DBUF_TYPE_OFILE && !f->is_managed) {
		i64 curpos = de_ftell(f->fp);
		if(pos != curpos) {
			de_fseek(f->fp, pos, SEEK_SET);
		}
		fwrite(m, 1, (size_t)len, f->fp);
		if(pos+len > f->len) {
			f->len = pos+len;
		}
	}
	else if(f->btype==DBUF_TYPE_NULL) {
		if(pos+len > f->len) {
			f->len = pos+len;
		}
	}
	else {
		de_internal_err_fatal(f->c, "Attempt to seek on non-seekable stream");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
testq %rcx, %rcx
setle %al
testq %rsi, %rsi
sets %cl
orb %al, %cl
je 0xf1226
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
leaq (%r15,%rsi), %r13
cmpq 0x20(%rdi), %r13
jle 0xf1241
movq %rbx, %rdi
callq 0xf102d
movl (%rbx), %eax
testl %eax, %eax
je 0xf12db
cmpl $0x2, %eax
je 0xf127a
cmpl $0x3, %eax
jne 0xf1284
movq 0x18(%rbx), %rcx
cmpq %rcx, %r13
jle 0xf12a4
movq %rcx, %rax
subq %r12, %rax
jle 0xf12ee
subq %rax, %r15
xorl %ebp, %ebp
movq %r15, %r13
movq %rax, %r15
jmp 0xf12fa
cmpb $0x0, 0x4(%rbx)
je 0xf12ab
testl %eax, %eax
je 0xf12db
movq 0x8(%rbx), %rdi
leaq 0x57b29(%rip), %rsi     # 0x148db8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xea0a6
xorl %ebp, %ebp
xorl %r13d, %r13d
jmp 0xf12fa
movq 0x10(%rbx), %rdi
callq 0x109ad1
cmpq %r12, %rax
je 0xf12c7
movq 0x10(%rbx), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x109acc
movq 0x10(%rbx), %rcx
movl $0x1, %esi
movq %r14, %rdi
movq %r15, %rdx
callq 0x182a0
cmpq 0x18(%rbx), %r13
jle 0xf1217
movq %r13, 0x18(%rbx)
jmp 0xf1217
movq %r12, %rbp
subq %rcx, %rbp
movq %r15, %r13
xorl %r15d, %r15d
testq %r15, %r15
jle 0xf1311
addq 0x78(%rbx), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x181e0
testq %rbp, %rbp
jle 0xf1321
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xf1346
testq %r13, %r13
jle 0xf1217
addq %r15, %r14
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf13b1
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_write_run
void dbuf_write_run(dbuf *f, u8 n, i64 len)
{
	u8 buf[1024];
	i64 amt_left;
	i64 amt_to_write;

	if(len<=0) return;
	de_memset(buf, n, (size_t)len<sizeof(buf) ? (size_t)len : sizeof(buf));
	amt_left = len;
	while(amt_left > 0) {
		if(amt_left < (i64)sizeof(buf))
			amt_to_write = amt_left;
		else
			amt_to_write = (i64)sizeof(buf);
		dbuf_write(f, buf, amt_to_write);
		amt_left -= amt_to_write;
	}
}

// Assembly:
testq %rdx, %rdx
jle 0xf1529
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rdx, %rbx
movq %rdi, %r14
movl $0x400, %r13d           # imm = 0x400
cmpq %r13, %rdx
movl $0x400, %edx            # imm = 0x400
cmovbq %rbx, %rdx
movzbl %sil, %esi
movq %rsp, %r15
movq %r15, %rdi
callq 0x18140
cmpq %r13, %rbx
movl $0x400, %r12d           # imm = 0x400
cmovlq %rbx, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xefb82
subq %r12, %rbx
jg 0xf14f9
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: membuf_append
static void membuf_append(dbuf *f, const u8 *m, i64 mlen)
{
	i64 new_alloc_size;

	if(f->has_len_limit) {
		if(f->len + mlen > f->len_limit) {
			mlen = f->len_limit - f->len;
		}
	}

	if(mlen<=0) return;

	if(mlen > f->membuf_alloc - f->len) {
		// Need to allocate more space
		new_alloc_size = (f->membuf_alloc + mlen)*2;
		if(new_alloc_size<1024) new_alloc_size=1024;
		if(new_alloc_size > f->max_len_hard) new_alloc_size = f->max_len_hard;
		if(f->c->debug_level>=4) {
			de_dbgx(f->c, 4, "increasing membuf size %"I64_FMT" -> %"I64_FMT,
				f->membuf_alloc, new_alloc_size);
		}
		if(f->len + mlen > f->max_len_hard) {
			do_on_dbuf_size_exceeded(f);
		}
		f->membuf_buf = de_realloc(f->c, f->membuf_buf, f->membuf_alloc, new_alloc_size);
		f->membuf_alloc = new_alloc_size;
	}

	de_memcpy(&f->membuf_buf[f->len], m, (size_t)mlen);
	f->len += mlen;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpl $0x0, 0x30(%rdi)
je 0xf13e0
movq 0x18(%r14), %rax
movq 0x28(%r14), %rcx
movq %rcx, %rdx
subq %rax, %rdx
addq %rbx, %rax
cmpq %rcx, %rax
cmovgq %rdx, %rbx
testq %rbx, %rbx
jle 0xf1482
movq 0x70(%r14), %rcx
movq %rcx, %rax
subq 0x18(%r14), %rax
cmpq %rax, %rbx
jle 0xf146b
leaq (%rcx,%rbx), %rax
addq %rax, %rax
cmpq $0x401, %rax            # imm = 0x401
movl $0x400, %r12d           # imm = 0x400
cmovgeq %rax, %r12
movq 0x8(%r14), %rdi
movq 0x20(%r14), %rax
cmpq %rax, %r12
cmovgeq %rax, %r12
cmpl $0x4, (%rdi)
jl 0xf143a
leaq 0x57b37(%rip), %rdx     # 0x148f62
movl $0x4, %esi
movq %r12, %r8
xorl %eax, %eax
callq 0xe94f3
movq 0x18(%r14), %rax
addq %rbx, %rax
cmpq 0x20(%r14), %rax
jle 0xf144f
movq %r14, %rdi
callq 0xf102d
movq 0x78(%r14), %rsi
movq 0x8(%r14), %rdi
movq 0x70(%r14), %rdx
movq %r12, %rcx
callq 0xea328
movq %rax, 0x78(%r14)
movq %r12, 0x70(%r14)
movq 0x78(%r14), %rdi
addq 0x18(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x181e0
addq %rbx, 0x18(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_writebyte_at
void dbuf_writebyte_at(dbuf *f, i64 pos, u8 n)
{
	if(f->btype==DBUF_TYPE_MEMBUF && pos>=0 && pos<f->len) {
		// Fast path when overwriting a byte in a membuf
		f->membuf_buf[pos] = n;
		return;
	}

	dbuf_write_at(f, pos, &n, 1);
}

// Assembly:
pushq %rax
movb %dl, 0x7(%rsp)
testq %rsi, %rsi
js 0xf14ac
cmpl $0x3, (%rdi)
jne 0xf14ac
cmpq %rsi, 0x18(%rdi)
jle 0xf14ac
movq 0x78(%rdi), %rax
movb %dl, (%rax,%rsi)
jmp 0xf14bb
leaq 0x7(%rsp), %rdx
movl $0x1, %ecx
callq 0xf11f9
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_truncate
void dbuf_truncate(dbuf *f, i64 desired_len)
{
	dbuf_flush(f);
	if(desired_len<0) desired_len=0;
	if(desired_len>f->len) {
		dbuf_write_zeroes(f, desired_len - f->len);
	}
	else if(desired_len<f->len) {
		if(f->btype==DBUF_TYPE_MEMBUF || f->btype==DBUF_TYPE_CUSTOM) {
			f->len = desired_len;
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x40(%rdi), %rdx
testq %rdx, %rdx
je 0xf1551
movq 0x48(%rbx), %rsi
movq %rbx, %rdi
callq 0xf1072
movq $0x0, 0x40(%rbx)
xorl %eax, %eax
testq %r14, %r14
cmovgq %r14, %rax
movq %rax, %rsi
subq 0x18(%rbx), %rsi
jle 0xf1572
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xf1346
jge 0xf1584
movl (%rbx), %ecx
cmpl $0x9, %ecx
je 0xf1580
cmpl $0x3, %ecx
jne 0xf1584
movq %rax, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_writei16le
void dbuf_writei16le(dbuf *f, i64 n)
{
	if(n<0) {
		dbuf_writeu16le(f, n+65536);
	}
	else {
		dbuf_writeu16le(f, n);
	}
}

// Assembly:
pushq %rax
movl %esi, %ecx
shrl $0x8, %ecx
testq %rsi, %rsi
js 0xf15de
leaq 0x6(%rsp), %rax
jmp 0xf15e3
leaq 0x4(%rsp), %rax
movb %sil, (%rax)
movb %cl, 0x1(%rax)
movl $0x2, %edx
movq %rax, %rsi
callq 0xefb82
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_writei16be
void dbuf_writei16be(dbuf *f, i64 n)
{
	if(n<0) {
		dbuf_writeu16be(f, n+65536);
	}
	else {
		dbuf_writeu16be(f, n);
	}
}

// Assembly:
pushq %rax
movl %esi, %ecx
shrl $0x8, %ecx
testq %rsi, %rsi
js 0xf160a
leaq 0x6(%rsp), %rax
jmp 0xf160f
leaq 0x4(%rsp), %rax
movb %cl, (%rax)
movb %sil, 0x1(%rax)
movl $0x2, %edx
movq %rax, %rsi
callq 0xefb82
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_writei32le
void dbuf_writei32le(dbuf *f, i64 n)
{
	if(n<0) {
		dbuf_writeu32le(f, n+0x100000000LL);
	}
	else {
		dbuf_writeu32le(f, n);
	}}

// Assembly:
pushq %rax
movl %esi, %ecx
shrl $0x8, %ecx
movl %esi, %edx
shrl $0x10, %edx
movl %esi, %r8d
shrl $0x18, %r8d
testq %rsi, %rsi
js 0xf167a
leaq 0x4(%rsp), %rax
jmp 0xf167d
movq %rsp, %rax
movb %sil, (%rax)
movb %cl, 0x1(%rax)
movb %dl, 0x2(%rax)
movb %r8b, 0x3(%rax)
movl $0x4, %edx
movq %rax, %rsi
callq 0xefb82
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_writei32be
void dbuf_writei32be(dbuf *f, i64 n)
{
	if(n<0) {
		dbuf_writeu32be(f, n+0x100000000LL);
	}
	else {
		dbuf_writeu32be(f, n);
	}
}

// Assembly:
pushq %rax
movl %esi, %ecx
shrl $0x18, %ecx
movl %esi, %edx
shrl $0x10, %edx
movl %esi, %r8d
shrl $0x8, %r8d
testq %rsi, %rsi
js 0xf16b7
leaq 0x4(%rsp), %rax
jmp 0xf16ba
movq %rsp, %rax
movb %cl, (%rax)
movb %dl, 0x1(%rax)
movb %r8b, 0x2(%rax)
movb %sil, 0x3(%rax)
movl $0x4, %edx
movq %rax, %rsi
callq 0xefb82
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xf184f
movq %rsi, %r15
movl $0xd8, %esi
movq %r14, %rdi
callq 0xe969b
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 0x10989a
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0xf182b
testb $0x1, 0xc(%rsp)
je 0xf17ad
movl $0x7, (%rbx)
movl $0x0, 0xb8(%rbx)
movq %rbx, %rdi
callq 0xf1866
cmpq $0x0, 0xc8(%rbx)
jne 0xf1856
cmpl $0x1, 0xb8(%rbx)
jne 0xf1856
cmpl $0x1, (%rbx)
jne 0xf1856
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 0xe969b
movq %rax, 0xc8(%rbx)
movq 0x10(%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x109acc
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 0xf1856
leaq 0x575ad(%rip), %rsi     # 0x148ddf
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9df7
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe9752
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_O1/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 0xf1888
cmpl $0x7, %eax
jne 0xf193c
leaq 0x10(%rbx), %rax
jmp 0xf188f
movq 0x9d749(%rip), %rax     # 0x18efd8
movq (%rax), %r14
movq $0x0, 0xc0(%rbx)
xorl %r15d, %r15d
movl $0x40000, %r13d         # imm = 0x40000
cmpq %r15, 0xc0(%rbx)
jl 0xf18de
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 0xea328
movq %rax, 0xc8(%rbx)
movq %r12, %r15
movq 0xc0(%rbx), %rdi
movq %r15, %r12
subq %rdi, %r12
jle 0xf1931
addq 0xc8(%rbx), %rdi
movl $0x1, %esi
movq %r12, %rdx
movq %r14, %rcx
callq 0x18080
testq %rax, %rax
jle 0xf1931
cmpq %r12, %rax
jg 0xf1931
addq %rax, 0xc0(%rbx)
movq %r14, %rdi
callq 0x181c0
testl %eax, %eax
jne 0xf1931
movq %r14, %rdi
callq 0x18060
testl %eax, %eax
je 0xf18a6
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_O1/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 0xe969b
movq %rax, %r14
movq %rbx, 0x8(%rax)
movl $0xffffffff, 0x64(%rax) # imm = 0xFFFFFFFF
movl $0x6, (%rax)
movl $0x0, 0xb8(%rax)
movq %rax, %rdi
callq 0xf1866
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_open_input_subfile
dbuf *dbuf_open_input_subfile(dbuf *parent, i64 offset, i64 size)
{
	dbuf *f;
	deark *c;

	c = parent->c;
	f = create_dbuf_lowlevel(c);
	f->btype = DBUF_TYPE_IDBUF;
	f->parent_dbuf = parent;
	f->offset_into_parent_dbuf = offset;
	f->len = size;
	return f;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %r12
movl $0xd8, %esi
movq %r12, %rdi
callq 0xe969b
movq %r12, 0x8(%rax)
movl $0xffffffff, 0x64(%rax) # imm = 0xFFFFFFFF
movl $0x4, (%rax)
movq %r15, 0x50(%rax)
movq %r14, 0x58(%rax)
movq %rbx, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/src/deark-dbuf.c
// Function: dbuf_create_custom_dbuf
dbuf *dbuf_create_custom_dbuf(deark *c, i64 apparent_size, unsigned int flags)
{
	dbuf *f;

	f = create_dbuf_lowlevel(c);
	f->btype = DBUF_TYPE_CUSTOM;
	f->len = apparent_size;
	f->max_len_hard = DE_DUMMY_MAX_FILE_SIZE;
	return f;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0xd8, %esi
callq 0xe969b
movq %r14, 0x8(%rax)
movl $0xffffffff, 0x64(%rax) # imm = 0xFFFFFFFF
movl $0x9, (%rax)
movq %rbx, 0x18(%rax)
movabsq $0x100000000000000, %rcx # imm = 0x100000000000000
movq %rcx, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xf1ac4
xorl %r15d, %r15d
addq %r14, %r8
js 0xf1b37
xorl %r14d, %r14d
movq 0x18(%rdi), %rax
xorl %r15d, %r15d
subq %r14, %rax
jl 0xf1b37
cmpq %rax, %r8
cmovlq %r8, %rax
cmpq %rdx, %rax
setl %cl
cmpq $0x401, %rdx            # imm = 0x401
setge %r8b
orb %cl, %r8b
jne 0xf1b37
testq %rdx, %rdx
jle 0xf1b2e
xorps %xmm0, %xmm0
movq %rsp, %r12
movaps %xmm0, (%r12)
movaps %xmm0, 0x10(%r12)
movq %rsi, (%r12)
movq %rdx, 0x8(%r12)
leaq 0x33(%rip), %rcx        # 0xf1b46
movq %r14, %rsi
movq %rax, %rdx
movq %r12, %r8
callq 0xefc28
cmpl $0x0, 0x10(%r12)
je 0xf1b37
addq 0x18(%rsp), %r14
movq %r14, (%rbx)
movl $0x1, %r15d
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq