LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/ent.c
// Function: ent_init
static void ent_init(struct ent *ent, struct ent_type *type, enum team team,
	d3d_sprite_s *sprite, const d3d_vec_s *pos)
{
	ent->vel.x = ent->vel.y = 0;
	ent->type = type;
	ent->team = type->team_override == TEAM_INVALID ?
		team : type->team_override;
	ent->worth = 0;
	ent->lifetime = type->lifetime;
	ent->frame = type->random_start_frame ? rand() % type->n_frames : 0;
	ent->frame_duration = type->frames[0].duration;
	ent->body.pos = *pos;
	ent->body.radius = type->width / 2;
	ent->body.health = type->health;
	ent->body.damage = type->damage;
	sprite->txtr = type->frames[0].txtr;
	sprite->transparent = TRANSPARENT_PIXEL;
	sprite->scale.x = type->width;
	sprite->scale.y = type->height;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rsi, 0x10(%rdi)
movl 0x5c(%rsi), %eax
cmpl $-0x1, %eax
cmovnel %eax, %edx
movl %edx, 0x18(%rdi)
movl $0x0, 0x1c(%rdi)
movq 0x38(%rsi), %rax
movq %rax, 0x20(%rdi)
cmpb $0x1, 0x40(%rsi)
jne 0x497a
callq 0x2490
cltq
xorl %edx, %edx
divq 0x18(%r14)
jmp 0x497c
xorl %edx, %edx
movq %rdx, 0x28(%r15)
movq 0x20(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x30(%r15)
movups (%r12), %xmm0
movups %xmm0, 0x38(%r15)
movsd 0x8(%r14), %xmm0
movsd 0x774c(%rip), %xmm1     # 0xc0f0
mulsd %xmm0, %xmm1
movsd %xmm1, 0x48(%r15)
movups 0x60(%r14), %xmm1
movups %xmm1, 0x50(%r15)
movq 0x20(%r14), %rax
movq (%rax), %rax
movq %rax, 0x20(%rbx)
movb $-0x1, 0x28(%rbx)
movsd %xmm0, 0x10(%rbx)
movsd 0x10(%r14), %xmm0
movsd %xmm0, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/ent.c
// Function: ents_clean_up_dead
void ents_clean_up_dead(struct ents *ents)
{
	for (size_t i = 0; i < ents->num; ++i) {
		struct ent *ent = &ents->ents[i];
		if (ent_is_dead(ent)) {
			--ents->num;
			*ent = ents->ents[ents->num];
			ents->sprites[i] = ents->sprites[ents->num];
		}
	}
}

// Assembly:
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x4c12
movq %rdi, %rax
xorl %edx, %edx
xorpd %xmm0, %xmm0
xorl %r8d, %r8d
movq (%rax), %r9
movq 0x10(%r9,%rdx,2), %rsi
cmpq $0x0, 0x38(%rsi)
js 0x4baf
cmpq $0x0, 0x20(%r9,%rdx,2)
jle 0x4bb8
ucomisd 0x50(%r9,%rdx,2), %xmm0
jb 0x4c06
leaq (%r9,%rdx,2), %rdi
decq %rcx
movq %rcx, 0x10(%rax)
leaq (%rcx,%rcx,2), %rsi
shlq $0x5, %rsi
addq %r9, %rsi
movl $0xc, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rsi
leaq (%rsi,%rsi,2), %rsi
shlq $0x4, %rsi
movups (%rcx,%rsi), %xmm1
movups 0x10(%rcx,%rsi), %xmm2
movups 0x20(%rcx,%rsi), %xmm3
movups %xmm3, 0x20(%rcx,%rdx)
movups %xmm2, 0x10(%rcx,%rdx)
movups %xmm1, (%rcx,%rdx)
movq 0x10(%rax), %rcx
incq %r8
addq $0x30, %rdx
cmpq %rcx, %r8
jb 0x4b98
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/grow.c
// Function: growe
void *growe(void **bufp, size_t *lenp, size_t *capp, size_t esize)
{
	if (*lenp >= *capp) {
		*capp = *lenp + *lenp / 2 + 1;
		*bufp = xrealloc(*bufp, *capp * esize);
	}
	return (char *)*bufp + (*lenp)++ * esize;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rsi, %r14
movq (%rsi), %rcx
movq (%rdi), %rax
cmpq (%rdx), %rcx
jb 0x4c66
movq %rdi, %r15
movq %rcx, %rsi
shrq %rsi
addq %rcx, %rsi
incq %rsi
movq %rsi, (%rdx)
imulq %rbx, %rsi
movq %rax, %rdi
callq 0xb1a8
movq %rax, (%r15)
movq (%r14), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r14)
imulq %rcx, %rbx
addq %rax, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/grow.c
// Function: growc
char *growc(char **bufp, size_t *lenp, size_t *capp, size_t num)
{
	size_t old_len = *lenp;
	*lenp += num;
	if (*lenp > *capp) {
		*capp = *lenp + *lenp / 2 + 1;
		*bufp = xrealloc(*bufp, *capp);
	}
	return *bufp + old_len;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rsi), %r14
addq %r14, %rcx
movq %rcx, (%rsi)
movq (%rdi), %rax
cmpq (%rdx), %rcx
jbe 0x4caf
movq %rdi, %rbx
movq %rcx, %rsi
shrq %rsi
addq %rcx, %rsi
incq %rsi
movq %rsi, (%rdx)
movq %rax, %rdi
callq 0xb1a8
movq %rax, (%rbx)
addq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json-util.c
// Function: json_map_get
union json_node_data *json_map_get(struct json_node *map, const char *key,
	int kind)
{
	if (map->kind != JN_MAP) return NULL;
	void **got = table_get(&map->d.map, key);
	if (!got) return NULL;
	struct json_node *nd = *got;
	if (nd->taken) return NULL;
	if (nd->kind != (enum json_node_kind)(kind & ~TAKE_NODE)) return NULL;
	nd->taken = (kind & TAKE_NODE) != 0;
	return &nd->d;
}

// Assembly:
cmpl $0x2, (%rdi)
jne 0x4cf6
pushq %rbx
movl %edx, %ebx
addq $0x8, %rdi
callq 0xa772
testq %rax, %rax
je 0x4cf9
movq (%rax), %rax
cmpb $0x0, 0x4(%rax)
jne 0x4cf9
movl %ebx, %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
cmpl %ecx, (%rax)
jne 0x4cf9
shrl $0xc, %ebx
andb $0x1, %bl
movb %bl, 0x4(%rax)
addq $0x8, %rax
jmp 0x4cfb
xorl %eax, %eax
retq
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json-util.c
// Function: parse_json_tree
int parse_json_tree(const char *name, FILE *file, struct logger *log,
	struct json_node *root)
{
	json_reader rdr;
	struct json_reader_ctx ctx;
	ctx.file = file;
	ctx.log = log;
	json_alloc(&rdr, NULL, 8, xmalloc, free, xrealloc);
	json_source(&rdr, ctx.buf, sizeof(ctx.buf), &ctx, refill);
	ctx.name = name;
	ctx.line = 1;
	char *key;
	parse_node(&rdr, root, &key);
	json_free(&rdr);
	fclose(file);
	return root->kind == JN_ERROR ? -1 : 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2090, %rsp           # imm = 0x2090
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x70(%rsp), %r13
movq %rsi, 0x2008(%r13)
movq %rdx, 0x2018(%r13)
leaq 0x6350(%rip), %rcx      # 0xb080
movq 0xc279(%rip), %r8       # 0x10fb0
leaq 0x646a(%rip), %r9       # 0xb1a8
leaq 0x10(%rsp), %r12
movl $0x8, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x550c
leaq 0x60(%rip), %r8         # 0x4db9
movl $0x2000, %edx           # imm = 0x2000
movq %r12, %rdi
movq %r13, %rsi
movq %r13, %rcx
callq 0x55cd
movq %r15, 0x2000(%r13)
movl $0x1, 0x2010(%r13)
leaq 0x8(%rsp), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4e65
movq %r12, %rdi
callq 0x5692
movq %r14, %rdi
callq 0x23e0
xorl %eax, %eax
cmpl $0x7, (%rbx)
sete %al
negl %eax
addq $0x2090, %rsp           # imm = 0x2090
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json-util.c
// Function: refill
static int refill(char **buf, size_t *size, void *ctx_v)
{
	struct json_reader_ctx *ctx = ctx_v;
	size_t got = fread(*buf, 1, *size, ctx->file);
	char *left = *buf;
	while ((left = memchr(left, '\n', got - (left - *buf)))) {
		++ctx->line;
		++left;
	}
	if (got < *size) {
		*size = got;
		return feof(ctx->file) ? 0 : -JSON_ERROR_ERRNO;
	}
	return 1;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq (%rdi), %rdi
movq (%rsi), %rdx
movq 0x2008(%rbx), %rcx
movl $0x1, %esi
callq 0x22e0
movq %rax, %r15
movq (%r12), %r12
movq %r12, %rdi
movl $0xa, %esi
movq %rax, %rdx
callq 0x20d0
testq %rax, %rax
je 0x4e31
movq %r15, %r13
addq %r12, %r13
movl 0x2010(%rbx), %ebp
incl %ebp
movl %ebp, 0x2010(%rbx)
incq %rax
movq %r13, %rdx
subq %rax, %rdx
movq %rax, %rdi
movl $0xa, %esi
callq 0x20d0
incl %ebp
testq %rax, %rax
jne 0x4e0e
movl $0x1, %eax
cmpq (%r14), %r15
jae 0x4e56
movq %r15, (%r14)
movq 0x2008(%rbx), %rdi
callq 0x23d0
xorl %ecx, %ecx
testl %eax, %eax
movl $0xffffffec, %eax       # imm = 0xFFFFFFEC
cmovnel %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json-util.c
// Function: free_json_tree
void free_json_tree(struct json_node *nd)
{
	if (nd->taken) return;
	switch (nd->kind) {
		const char *k;
		void **v;
	case JN_MAP:
		TABLE_FOR_EACH(&nd->d.map, k, v) {
			free_json_pair(k, *v);
		}
		table_free(&nd->d.map);
		break;
	case JN_LIST:
		for (size_t i = 0; i < nd->d.list.n_vals; ++i) {
			free_json_tree(&nd->d.list.vals[i]);
		}
		free(nd->d.list.vals);
		break;
	case JN_STRING:
		free(nd->d.str);
		break;
	default:
		break;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpb $0x0, 0x4(%rdi)
je 0x522e
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x2, %eax
je 0x5280
cmpl $0x4, %eax
je 0x526e
cmpl $0x3, %eax
jne 0x5224
cmpq $0x0, 0x8(%rbx)
je 0x5268
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rdi
addq %r14, %rdi
callq 0x5215
incq %r15
addq $0x20, %r14
cmpq 0x8(%rbx), %r15
jb 0x524f
movq 0x10(%rbx), %rdi
jmp 0x5272
movq 0x8(%rbx), %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2570
leaq 0x8(%rbx), %r14
cmpq $0x0, 0x8(%rbx)
je 0x52c3
movl $0x8, %r12d
xorl %r13d, %r13d
movq 0x18(%rbx), %rax
movq -0x8(%rax,%r12), %rdi
movq (%rax,%r12), %r15
callq 0x2570
movq %r15, %rdi
callq 0x5215
movq %r15, %rdi
callq 0x2570
incq %r13
addq $0x10, %r12
cmpq 0x8(%rbx), %r13
jb 0x5294
movq %r14, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xa7fc
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json-util.c
// Function: parse_json_vec
int parse_json_vec(d3d_vec_s *vec, const struct json_node_data_list *list)
{
	int retval = 0;
	vec->x = vec->y = 0;
	if (list->n_vals < 1) return -1;
	if (list->vals[0].kind == JN_NUMBER) {
		vec->x = list->vals[0].d.num;
	} else {
		retval |= -1;
	}
	if (list->n_vals >= 2 && list->vals[1].kind == JN_NUMBER) {
		vec->y = list->vals[1].d.num;
	} else {
		retval |= -1;
	}
	return retval;
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq (%rsi), %rdx
testq %rdx, %rdx
je 0x5319
movq 0x8(%rsi), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x5, (%rcx)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
jne 0x5300
movsd 0x8(%rcx), %xmm0
movsd %xmm0, (%rdi)
xorl %esi, %esi
cmpq $0x1, %rdx
je 0x531e
cmpl $0x5, 0x20(%rcx)
jne 0x531e
movsd 0x28(%rcx), %xmm0
movsd %xmm0, 0x8(%rdi)
movl %esi, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json-util.c
// Function: escape_text_json
void escape_text_json(const char *text, struct string *buf, size_t *cap)
{
	while (*text) {
		switch (*text) {
		case '"':
			string_pushn(buf, cap, "\\\"", 2);
			break;
		case '\\':
			string_pushn(buf, cap, "\\\\", 2);
			break;
		case '\b':
			string_pushn(buf, cap, "\\b", 2);
			break;
		case '\f':
			string_pushn(buf, cap, "\\f", 2);
			break;
		case '\n':
			string_pushn(buf, cap, "\\n", 2);
			break;
		case '\r':
			string_pushn(buf, cap, "\\r", 2);
			break;
		case '\t':
			string_pushn(buf, cap, "\\t", 2);
			break;
		default:
			if ((unsigned char)*text < 32) {
				char *space = string_grow(buf, cap, 7);
				sprintf(space, "\\u%04X", (unsigned char)*text);
				buf->len -= 1; // Ignore NUL that was appended.
			} else {
				string_pushc(buf, cap, *text);
			}
			break;
		}
		++text;
	}
}

// Assembly:
movb (%rdi), %al
testb %al, %al
je 0x5466
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
incq %r15
leaq 0x711d(%rip), %r13      # 0xc464
leaq 0x7153(%rip), %rbp      # 0xc4a1
leaq 0x7152(%rip), %r12      # 0xc4a7
movzbl %al, %ecx
leal -0x8(%rcx), %edx
cmpl $0x5, %edx
ja 0x5381
movslq (%r13,%rdx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
movl $0x2, %ecx
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x7122(%rip), %rdx      # 0xc49e
jmp 0x5433
cmpl $0x5c, %ecx
je 0x5421
cmpl $0x22, %ecx
jne 0x53a6
movl $0x2, %ecx
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x70f7(%rip), %rdx      # 0xc498
jmp 0x5433
cmpb $0x1f, %al
ja 0x5448
movl $0x7, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa569
movzbl -0x1(%r15), %edx
movq %rax, %rdi
leaq 0x70e0(%rip), %rsi      # 0xc4ad
xorl %eax, %eax
callq 0x2230
decq (%r14)
jmp 0x5438
movl $0x2, %ecx
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x70bf(%rip), %rdx      # 0xc4aa
jmp 0x5433
movl $0x2, %ecx
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x70a5(%rip), %rdx      # 0xc4a4
jmp 0x5433
movl $0x2, %ecx
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
jmp 0x5433
movl $0x2, %ecx
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
jmp 0x5433
movl $0x2, %ecx
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x7068(%rip), %rdx      # 0xc49b
callq 0xa591
movb (%r15), %al
incq %r15
testb %al, %al
jne 0x5355
jmp 0x5458
movsbl %al, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa606
jmp 0x5438
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json-util.c
// Function: scan_json_key
int scan_json_key(json_reader *rdr, const char *key, struct json_item *item)
{
	long depth = 0;
	do {
		if (json_read_item(rdr, item)) return -1;
		if (depth == 1
		 && item->key.bytes
		 && !strcmp(key, item->key.bytes))
			return 0;
		switch (item->type) {
		case JSON_LIST:
		case JSON_MAP:
			++depth;
			break;
		case JSON_END_LIST:
		case JSON_END_MAP:
			--depth;
			break;
		case JSON_EMPTY:
			depth = 0;
			break;
		case JSON_STRING:
			free(item->val.str.bytes);
			break;
		default:
			break;
		}
		free(item->key.bytes);
	} while (depth > 0);
	item->type = JSON_EMPTY;
	item->key.len = 0;
	item->key.bytes = NULL;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
leaq 0x6ff9(%rip), %r13      # 0xc47c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x56c7
testl %eax, %eax
jne 0x54f0
cmpq $0x1, %r12
jne 0x54ac
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x54ac
movq %r14, %rdi
callq 0x2380
testl %eax, %eax
je 0x54ec
movl 0x10(%rbx), %eax
cmpq $0x6, %rax
ja 0x54d2
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
incq %r12
jmp 0x54d2
decq %r12
jmp 0x54d2
movq 0x18(%rbx), %rdi
callq 0x2570
movq (%rbx), %rdi
callq 0x2570
testq %r12, %r12
jg 0x5483
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl $0x0, 0x10(%rbx)
xorl %eax, %eax
jmp 0x54f5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq (%rbx), %rdi
callq 0x2570
jmp 0x54df
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: json_alloc
int json_alloc(json_reader *reader,
	void *stack, size_t stacksiz,
	void *(*alloc)(size_t),
	void  (*dealloc)(void *),
	void *(*resize)(void *, size_t))
{
	reader->alloc = alloc ? alloc : alloc_fail;
	reader->dealloc = dealloc ? dealloc : dealloc_noop;
	reader->resize = resize ? resize : realloc_fail;
	reader->flags = 0;
	if (!stack && stacksiz <= sizeof(reader->stack.small.frames)
		/* Just in case, make sure the small size can't overflow: */
		&& (size_t)UCHAR_MAX >= sizeof(reader->stack.small.frames))
	{
		reader->flags |= SMALL_STACK;
		reader->stack.small.size = 0;
	} else {
		if (!stack && !(stack = reader->alloc(stacksiz))) return -1;
		reader->stack.big.cap = stacksiz;
		reader->stack.big.size = 0;
	}
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
testq %rcx, %rcx
leaq 0xa9(%rip), %rax        # 0x55c6
cmovneq %rcx, %rax
movq %rdi, %r14
movq %rax, (%rdi)
movq %r9, %xmm0
movq %r8, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
pxor %xmm0, %xmm0
pcmpeqd %xmm1, %xmm0
pshufd $0xb1, %xmm0, %xmm2     # xmm2 = xmm0[1,0,3,2]
pand %xmm0, %xmm2
leaq 0x7d(%rip), %rcx        # 0x55ca
movq %rcx, %xmm0
leaq 0x70(%rip), %rcx        # 0x55c9
movq %rcx, %xmm3
punpcklqdq %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0]
pand %xmm2, %xmm3
pandn %xmm1, %xmm2
por %xmm3, %xmm2
movdqu %xmm2, 0x8(%rdi)
movl $0x0, 0x58(%rdi)
testq %rsi, %rsi
setne %cl
cmpq $0x18, %rdx
setae %dl
orb %cl, %dl
jne 0x559a
movl $0x400, 0x58(%r14)      # imm = 0x400
movb $0x0, 0x57(%r14)
jmp 0x55b5
testq %rsi, %rsi
jne 0x55a9
movq %rbx, %rdi
callq *%rax
testq %rax, %rax
je 0x55bf
movq %rbx, 0x50(%r14)
movq $0x0, 0x48(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x55b7
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: json_get_last_error
int json_get_last_error(const json_reader *reader,
	enum json_type *code, size_t *erridx)
{
	if (has_error(reader)) {
		if (erridx) *erridx = reader->head;
		if (code) *code = reader->flags & 0xFF;
		return 1;
	}
	return 0;
}

// Assembly:
movzbl 0x58(%rdi), %ecx
testl %ecx, %ecx
je 0x56c4
testq %rdx, %rdx
je 0x56b7
movq 0x38(%rdi), %rax
movq %rax, (%rdx)
movl $0x1, %eax
testq %rsi, %rsi
je 0x56c3
movl %ecx, (%rsi)
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: refill
static int refill(json_reader *reader)
{
	size_t newsiz = reader->bufsiz;
	/* WARNING: Must refer to &reader->buf for refill_fd to work! */
	int retval = reader->refill(&reader->buf, &newsiz, reader->ctx);
	if (retval < 0) {
		set_error(reader, -retval & 0xFF);
		return -1;
	}
	if (retval == 0) reader->flags |= SOURCE_DEPLETED;
	reader->bufsiz = newsiz;
	reader->head = 0;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x28(%rdi), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
addq $0x20, %rdi
movq 0x30(%rbx), %rdx
callq *0x18(%rbx)
testl %eax, %eax
js 0x5946
jne 0x5931
orb $0x1, 0x59(%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rbx)
movq $0x0, 0x38(%rbx)
xorl %eax, %eax
jmp 0x595e
movl %eax, %ecx
movl 0x58(%rbx), %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %dl, %dl
jne 0x595e
negl %ecx
movzbl %cl, %ecx
orl %ecx, %edx
movl %edx, 0x58(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: skip_spaces
static int skip_spaces(json_reader *reader)
{
	for (;;) {
		while (is_in_range(reader)) {
			if (!is_space(reader->buf[reader->head])) return 0;
			++reader->head;
		}
		if (reader->flags & SOURCE_DEPLETED) return 0;
		if (refill(reader)) return -1;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movabsq $0x100002e00, %r14      # imm = 0x100002E00
movq 0x28(%rbx), %rax
movq 0x38(%rbx), %rcx
cmpq %rax, %rcx
jae 0x59b1
movq 0x20(%rbx), %rdx
negq %rax
incq %rcx
movzbl -0x1(%rdx,%rcx), %esi
cmpq $0x20, %rsi
ja 0x59ca
btq %rsi, %r14
jae 0x59ca
movq %rcx, 0x38(%rbx)
leaq (%rax,%rcx), %rsi
incq %rsi
incq %rcx
cmpq $0x1, %rsi
jne 0x598c
testb $0x1, 0x59(%rbx)
jne 0x59ca
movq %rbx, %rdi
callq 0x5908
testl %eax, %eax
je 0x5975
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x59cc
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: try_compound_end
static int try_compound_end(json_reader *reader, int endch,
	enum json_type type, struct json_item *result)
{
	int ch;
	NEXT_CHAR(reader, ch, return -has_error(reader));
	if (ch == endch) {
		pop_frame(reader);
		result->type = type;
	} else {
		reexamine_char(reader);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
callq 0x6056
testl %eax, %eax
js 0x5e94
cmpl %r15d, %eax
jne 0x5e9e
movq %r14, %rdi
callq 0x627b
movl %ebp, 0x10(%rbx)
jmp 0x5ea2
xorl %eax, %eax
cmpb 0x58(%r14), %al
sbbl %eax, %eax
jmp 0x5ea4
decq 0x38(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: parse_after_elem
static int parse_after_elem(json_reader *reader, int endch,
	enum json_type type, struct json_item *result)
{
	int ch;
	NEXT_CHAR(reader, ch, return -has_error(reader));
	if (ch == endch) {
		pop_frame(reader);
		result->type = type;
	} else if (ch != ',') {
		set_error(reader, JSON_ERROR_BRACKETS);
		return -1;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r14
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %rbx
callq 0x6056
testl %eax, %eax
js 0x5ee1
movl %eax, %ecx
cmpl %r15d, %eax
jne 0x5eea
movq %rbx, %rdi
callq 0x627b
movl %ebp, 0x10(%r14)
xorl %eax, %eax
jmp 0x5f03
xorl %eax, %eax
cmpb 0x58(%rbx), %al
sbbl %eax, %eax
jmp 0x5f03
xorl %eax, %eax
cmpl $0x2c, %ecx
je 0x5f03
movl 0x58(%rbx), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %cl, %cl
jne 0x5f03
orl $0xe, %ecx
movl %ecx, 0x58(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: parse_string
static int parse_string(json_reader *reader, struct json_string *str)
{
	int ch;
	char *oldbytes;
	size_t cap = 16;
	NEXT_CHAR(reader, ch, return -1);
	if (ch != '"') goto error_expected_string;
	str->bytes = alloc(reader, cap);
	if (!str->bytes) return -1;
	str->len = 0;
	while ((ch = next_char(reader)) != '"') {
		if (ch < 0) goto error_unclosed_quote;
		if (ch == '\\') {
			if (escape_char(reader, str, &cap))
				goto error;
		} else if (ch < 32) {
			goto error_control_char;
		} else {
			if (push_byte(reader, &str->bytes, &str->len, &cap, ch))
				goto error;
		}
	}
	if (push_byte(reader, &str->bytes, &str->len, &cap, '\0')) goto error;
	oldbytes = str->bytes;
	str->bytes = reader->resize(str->bytes, str->len);
	if (!str->bytes) str->bytes = oldbytes;
	--str->len; /* Because of the NUL terminator */
	return 0;

error_expected_string:
	set_error(reader, JSON_ERROR_EXPECTED_STRING);
	goto error;

error_unclosed_quote:
	set_error(reader, JSON_ERROR_UNCLOSED_QUOTE);
	goto error;

error_control_char:
	reexamine_char(reader);
	set_error(reader, JSON_ERROR_CONTROL_CHAR);
	goto error;

error:
	reader->dealloc(str->bytes);
	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq $0x10, 0x8(%rsp)
callq 0x6056
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x6029
cmpl $0x22, %eax
jne 0x5ffb
movl $0x10, %edi
callq *(%r14)
testq %rax, %rax
je 0x6013
movq %rax, (%rbx)
leaq 0x8(%rbx), %r15
movq $0x0, 0x8(%rbx)
movq %r14, %rdi
callq 0x6056
cmpl $0x22, %eax
je 0x5fc1
leaq 0x8(%rsp), %r12
testl %eax, %eax
js 0x6038
cmpl $0x5c, %eax
jne 0x5f93
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x629f
jmp 0x5fb0
cmpl $0x20, %eax
jb 0x6045
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
movl %eax, %r8d
callq 0x6163
testl %eax, %eax
jne 0x600a
movq %r14, %rdi
callq 0x6056
cmpl $0x22, %eax
jne 0x5f76
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0x6163
testl %eax, %eax
jne 0x600a
movq (%rbx), %r15
movq 0x8(%rbx), %rsi
movq %r15, %rdi
callq *0x10(%r14)
testq %rax, %rax
cmoveq %r15, %rax
movq %rax, (%rbx)
decq 0x8(%rbx)
xorl %ebp, %ebp
jmp 0x6029
movl 0x58(%r14), %eax
testb %al, %al
jne 0x600a
orl $0xc, %eax
movl %eax, 0x58(%r14)
movq (%rbx), %rdi
callq *0x8(%r14)
jmp 0x6029
movl 0x58(%r14), %eax
testb %al, %al
jne 0x6022
orl $0x9, %eax
movl %eax, 0x58(%r14)
movq $0x0, (%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x58(%r14), %eax
testb %al, %al
jne 0x600a
orl $0xf, %eax
jmp 0x6006
decq 0x38(%r14)
movl 0x58(%r14), %eax
testb %al, %al
jne 0x600a
orl $0x11, %eax
jmp 0x6006
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: next_char
static int next_char(json_reader *reader)
{
	while (!is_in_range(reader) && (reader->flags & SOURCE_DEPLETED) == 0) {
		if (refill(reader)) return -1;
	}
	if (is_in_range(reader))
		return (unsigned char)reader->buf[reader->head++];
	return -1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x38(%rbx), %rax
cmpq 0x28(%rbx), %rax
jb 0x607f
testb $0x1, 0x59(%rbx)
jne 0x608f
movq %rbx, %rdi
callq 0x5908
testl %eax, %eax
je 0x6061
jmp 0x608f
movq 0x20(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x38(%rbx)
movzbl (%rcx,%rax), %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: push_frame
static int push_frame(json_reader *reader, int frame)
{
	if (reader->flags & SMALL_STACK) {
		/* Temporary stack holding buffer: */
		char tmp[sizeof(reader->stack.small.frames)];
		if (reader->stack.small.size >= sizeof(tmp)) {
			/* The small stack must be embiggened. */
			memcpy(tmp, reader->stack.small.frames, sizeof(tmp));
			size_t size = sizeof(tmp) + 1;
			if (!(reader->stack.big.frames = reader->alloc(size))) {
				/* Failure to allocate; revert and report. */
				memcpy(reader->stack.small.frames, tmp,
					sizeof(tmp));
				reader->stack.small.size = sizeof(tmp);
				set_error(reader, JSON_ERROR_MEMORY);
				return -1;
			}
			memcpy(reader->stack.big.frames, tmp, sizeof(tmp));
			reader->stack.big.frames[size - 1] = frame;
			reader->stack.big.cap = size;
			reader->stack.big.size = size;
			reader->flags &= ~SMALL_STACK;
		} else {
			reader->stack.small.frames[reader->stack.small.size++] =
				frame;
		}
		return 0;
	} else {
		return push_byte(reader, &reader->stack.big.frames,
			&reader->stack.big.size, &reader->stack.big.cap, frame);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
testb $0x4, 0x59(%rdi)
jne 0x60ce
leaq 0x40(%rbx), %rsi
leaq 0x48(%rbx), %rdx
leaq 0x50(%rbx), %rcx
movq %rbx, %rdi
movl %ebp, %r8d
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6163
movzbl 0x57(%rbx), %eax
cmpq $0x17, %rax
jb 0x6129
leaq 0x40(%rbx), %r14
movq 0xf(%r14), %rax
movq %rax, 0xf(%rsp)
movups (%r14), %xmm0
movaps %xmm0, (%rsp)
movl $0x18, %r15d
movl $0x18, %edi
callq *(%rbx)
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x613f
movq 0xf(%rsp), %rcx
movq %rcx, 0xf(%rax)
movaps (%rsp), %xmm0
movups %xmm0, (%rax)
movq 0x40(%rbx), %rax
movb %bpl, 0x17(%rax)
movq %r15, 0x50(%rbx)
movq %r15, 0x48(%rbx)
andb $-0x5, 0x59(%rbx)
jmp 0x6134
leal 0x1(%rax), %ecx
movb %cl, 0x57(%rbx)
movb %bpl, 0x40(%rbx,%rax)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0xf(%rsp), %rax
movq %rax, 0xf(%r14)
movaps (%rsp), %xmm0
movups %xmm0, (%r14)
movb $0x17, 0x57(%rbx)
movl 0x58(%rbx), %eax
testb %al, %al
jne 0x6134
orl $0x9, %eax
movl %eax, 0x58(%rbx)
jmp 0x6134
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: push_byte
static int push_byte(json_reader *reader, char **bytes,
	size_t *len, size_t *cap, int ch)
{
	if (*len >= *cap) {
		size_t new_cap = *cap + *cap / 2 + 1;
		char *new_bytes = reader->resize(*bytes, new_cap);
		if (!new_bytes) {
			set_error(reader, JSON_ERROR_MEMORY);
			return -1;
		}
		*cap = new_cap;
		*bytes = new_bytes;
	}
	(*bytes)[*len] = ch;
	++*len;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movq %rcx, %r12
movq %rdx, %r14
movq (%rdx), %rcx
movq (%r12), %rdx
movq (%rsi), %rax
cmpq %rdx, %rcx
jb 0x61b3
movq %rsi, %r13
movq %rdi, %r15
movq %rdx, %rcx
shrq %rcx
leaq (%rdx,%rcx), %rbp
incq %rbp
movq %rax, %rdi
movq %rbp, %rsi
callq *0x10(%r15)
testq %rax, %rax
je 0x61ca
movq %rbp, (%r12)
movq %rax, (%r13)
movq (%r14), %rcx
movb %bl, (%rax,%rcx)
incq (%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x58(%r15), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %cl, %cl
jne 0x61bb
orl $0x9, %ecx
movl %ecx, 0x58(%r15)
jmp 0x61bb
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: next_chars
static long next_chars(json_reader *reader, char *buf, size_t bufsiz)
{
	if (reader->head + bufsiz <= reader->bufsiz) {
		memcpy(buf, reader->buf + reader->head, bufsiz);
		reader->head += bufsiz;
	} else {
		size_t i;
		size_t easy_copy = reader->bufsiz - reader->head;
		memcpy(buf, reader->buf + reader->head, easy_copy);
		if (refill(reader)) return -1;
		for (i = easy_copy; i < bufsiz; ++i) {
			int ch;
			NEXT_CHAR(reader, ch, return
				reader->flags & SOURCE_DEPLETED ? (long)i : -1);
			buf[i] = ch;
		}
	}
	return bufsiz;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
movq 0x28(%rdi), %r15
movq 0x38(%rdi), %rsi
leaq (%rsi,%rdx), %rax
cmpq %r15, %rax
jbe 0x6245
subq %rsi, %r15
addq 0x20(%r14), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x2500
movq %r14, %rdi
callq 0x5908
movl %eax, %ecx
movq $-0x1, %rax
testl %ecx, %ecx
jne 0x625b
jmp 0x623e
movq %r14, %rdi
callq 0x6056
testl %eax, %eax
js 0x6267
movb %al, (%r12,%r15)
incq %r15
cmpq %rbx, %r15
jb 0x622b
jmp 0x6258
addq 0x20(%r14), %rsi
movq %r12, %rdi
movq %rbx, %rdx
callq 0x2500
addq %rbx, 0x38(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movb 0x59(%r14), %cl
andb $0x1, %cl
xorl %eax, %eax
cmpb $0x1, %cl
sbbq %rax, %rax
orq %r15, %rax
jmp 0x625b
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: pop_frame
static int pop_frame(json_reader *reader)
{
	if (reader->flags & SMALL_STACK) {
		if (reader->stack.small.size == 0) return FRAME_EMPTY;
		return reader->stack.small.frames[--reader->stack.small.size];
	} else {
		if (reader->stack.big.size == 0) return FRAME_EMPTY;
		return reader->stack.big.frames[--reader->stack.big.size];
	}
}

// Assembly:
testb $0x4, 0x59(%rdi)
jne 0x6292
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0x6291
decq %rax
movq %rax, 0x48(%rdi)
retq
movb 0x57(%rdi), %al
testb %al, %al
je 0x6291
decb %al
movb %al, 0x57(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: hex_short
static long hex_short(const char hex[4])
{
	long num = 0;
	unsigned shift = 0;
	long i;
	for (i = 3, shift = 0; i >= 0; --i, shift += 4) {
		int dig = to_lower(hex[i]);
		long nibble;
		if (is_digit(dig)) nibble = to_digit(dig);
		else if (dig >= 'a' && dig <= 'f') nibble = 10 + to_digit(dig);
		else return -1;
		num |= nibble << shift;
	}
	return num;
}

// Assembly:
addq $0x3, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
movsbl (%rdi), %edx
orl $0x20, %edx
leal -0x30(%rdx), %esi
cmpl $0xa, %esi
jb 0x654f
leal -0x61(%rdx), %esi
cmpl $0x5, %esi
ja 0x6565
addl $-0x26, %edx
movl %edx, %esi
movl %esi, %edx
shlq %cl, %rdx
orq %rdx, %rax
addq $0x4, %rcx
decq %rdi
cmpq $0x10, %rcx
jne 0x6534
retq
movq $-0x1, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: push_bytes
static int push_bytes(json_reader *reader, char **bytes,
	size_t *len, size_t *cap, const char *buf, size_t bufsiz)
{
	if (*len + bufsiz > *cap) {
		size_t new_cap = *len + bufsiz;
		char *new_bytes;
		new_cap += new_cap / 2;
		new_bytes = reader->resize(*bytes, new_cap);
		if (!new_bytes) {
			set_error(reader, JSON_ERROR_MEMORY);
			return -1;
		}
		*cap = new_cap;
		*bytes = new_bytes;
	}
	memcpy(*bytes + *len, buf, bufsiz);
	*len += bufsiz;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %rcx, %r13
movq %rdx, %r14
movq %rdi, %r12
movq (%rdx), %rdi
leaq (%rdi,%r9), %rcx
movq (%rsi), %rax
cmpq (%r13), %rcx
jbe 0x65c3
movq %rsi, %rbp
movq %r8, (%rsp)
movq %rcx, %r15
shrq %r15
addq %rcx, %r15
movq %rax, %rdi
movq %r15, %rsi
callq *0x10(%r12)
testq %rax, %rax
je 0x65e5
movq %r15, (%r13)
movq %rax, (%rbp)
movq (%r14), %rdi
movq (%rsp), %r8
addq %rax, %rdi
movq %r8, %rsi
movq %rbx, %rdx
callq 0x2500
addq %rbx, (%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x58(%r12), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %cl, %cl
jne 0x65d6
orl $0x9, %ecx
movl %ecx, 0x58(%r12)
jmp 0x65d6
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/json.c
// Function: codepoint_to_utf8
static size_t codepoint_to_utf8(long cp, char buf[4])
{
	if (cp <= 0x7F) {
		buf[0] = cp;
		return 1;
	} else if (cp <= 0x7FF) {
		buf[0] = 0xC0 | (cp >> 6);
		buf[1] = 0x80 | (cp & 0x3F);
		return 2;
	} else if (cp <= 0xFFFF) {
		buf[0] = 0xE0 | (cp >> 12);
		buf[1] = 0x80 | ((cp >> 6) & 0x3F);
		buf[2] = 0x80 | (cp & 0x3F);
		return 3;
	} else {
		buf[0] = 0xF0 | (cp >> 18);
		buf[1] = 0x80 | ((cp >> 12) & 0x3F);
		buf[2] = 0x80 | ((cp >> 6) & 0x3F);
		buf[3] = 0x80 | (cp & 0x3F);
		return 4;
	}
}

// Assembly:
cmpq $0x7f, %rdi
jg 0x660c
movb %dil, (%rsi)
movl $0x1, %eax
retq
movl %edi, %eax
cmpq $0x7ff, %rdi            # imm = 0x7FF
ja 0x6630
shrl $0x6, %eax
orb $-0x40, %al
movb %al, (%rsi)
andb $0x3f, %dil
orb $-0x80, %dil
movb %dil, 0x1(%rsi)
movl $0x2, %eax
retq
cmpq $0xffff, %rdi           # imm = 0xFFFF
ja 0x665e
shrl $0xc, %eax
orb $-0x20, %al
movb %al, (%rsi)
movl %edi, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x1(%rsi)
andb $0x3f, %dil
orb $-0x80, %dil
movb %dil, 0x2(%rsi)
movl $0x3, %eax
retq
shrl $0x12, %eax
orb $-0x10, %al
movb %al, (%rsi)
movl %edi, %eax
shrl $0xc, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x1(%rsi)
movl %edi, %eax
shrl $0x6, %eax
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x2(%rsi)
andb $0x3f, %dil
orb $-0x80, %dil
movb %dil, 0x3(%rsi)
movl $0x4, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/loader.c
// Function: loader_init
void loader_init(struct loader *ldr, const char *root)
{
	ldr->txtrs_dir = mid_cat(root, DIRSEP, "textures");
	table_init(&ldr->txtrs, 16);
	ldr->ents_dir = mid_cat(root, DIRSEP, "ents");
	table_init(&ldr->ents, 16);
	ldr->maps_dir = mid_cat(root, DIRSEP, "maps");
	table_init(&ldr->maps, 16);
	color_map_init(&ldr->colors);
	// Default background pixel:
	color_map_add_pair(&ldr->colors, pixel(PC_BLACK, PC_BLACK));
	ldr->log = NULL;
	ldr->empty_txtr = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x5d93(%rip), %rdx      # 0xc649
movq %rsi, %rdi
movl $0x2f, %esi
callq 0xade9
movq %rax, 0x20(%rbx)
leaq 0x8(%rbx), %rdi
movl $0x10, %esi
callq 0xa624
leaq 0x5d76(%rip), %rdx      # 0xc652
movq %r14, %rdi
movl $0x2f, %esi
callq 0xade9
movq %rax, 0x40(%rbx)
leaq 0x28(%rbx), %rdi
movl $0x10, %esi
callq 0xa624
leaq 0x5d55(%rip), %rdx      # 0xc657
movq %r14, %rdi
movl $0x2f, %esi
callq 0xade9
movq %rax, 0x60(%rbx)
leaq 0x48(%rbx), %rdi
movl $0x10, %esi
callq 0xa624
leaq 0x68(%rbx), %r14
movq %r14, %rdi
callq 0xa950
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
callq 0xa96a
movq %r15, 0xb0(%rbx)
movq %r15, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/loader.c
// Function: loader_map_path
char *loader_map_path(const struct loader *ldr, const char *name)
{
	size_t cap = 10;
	struct string buf;
	string_init(&buf, cap);
	string_pushz(&buf, &cap, ldr->maps_dir);
	string_pushc(&buf, &cap, DIRSEP);
	string_pushz(&buf, &cap, name);
	string_pushn(&buf, &cap, ".json", 6);
	string_shrink_to_fit(&buf);
	return buf.text;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %r12
movq %rsp, %r14
movq $0xa, (%r14)
leaq 0x8(%rsp), %rbx
movl $0xa, %esi
movq %rbx, %rdi
callq 0xa550
movq 0x60(%r12), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa5bf
movq %rbx, %rdi
movq %r14, %rsi
movl $0x2f, %edx
callq 0xa606
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xa5bf
leaq 0x5d85(%rip), %rdx      # 0xc731
movl $0x6, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa591
movq %rbx, %rdi
callq 0xa57b
movq 0x8(%rbx), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/loader.c
// Function: loadj
static void **loadj(table *tab, const char *root, const char *name, FILE **file,
	struct logger *log)
{
	char *fname = mid_cat(name, '.', "json");
	void **loaded = load(tab, root, fname, file, log);
	if (!*file) free(fname);
	return loaded;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %rax
movq %rsi, %r12
movq %rdi, %r13
leaq 0x5d25(%rip), %rdx      # 0xc732
movq %rax, %rdi
movl $0x2e, %esi
callq 0xade9
movq %rax, %rbx
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0x6ab3
movq %rax, %r14
cmpq $0x0, (%r15)
jne 0x6a42
movq %rbx, %rdi
callq 0x2570
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/loader.c
// Function: loader_texture
d3d_texture **loader_texture(struct loader *ldr, const char *name, FILE **file)
{
	char *fname = str_dup(name);
	d3d_texture **loaded = (d3d_texture **)load(&ldr->txtrs, ldr->txtrs_dir,
		fname, file, ldr->log);
	if (!*file) free(fname);
	return loaded;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0xada8
movq %rax, %rbx
leaq 0x8(%r14), %rdi
movq 0x20(%r14), %rsi
movq 0xb0(%r14), %r8
movq %rax, %rdx
movq %r15, %rcx
callq 0x6ab3
movq %rax, %r14
cmpq $0x0, (%r15)
jne 0x6aaa
movq %rbx, %rdi
callq 0x2570
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/loader.c
// Function: load
static void **load(table *tab, const char *root, const char *name, FILE **file,
	struct logger *log)
{
	void **item = table_get(tab, name);
	*file = NULL;
	if (!item) {
		char *path = mid_cat(root, DIRSEP, name);
		*file = fopen(path, "r");
		if (*file) {
			logger_printf(log, LOGGER_INFO, "Loading %s\n", path);
			table_add(tab, name, NULL);
			item = table_get(tab, name);
		} else {
			logger_printf(log, LOGGER_ERROR,
				"Cannot load %s\n", path);
		}
		free(path);
	}
	return item;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rdx, %rsi
callq 0xa772
movq %rax, %rbp
movq $0x0, (%r13)
testq %rax, %rax
jne 0x6b6d
movq %rbx, %rdi
movl $0x2f, %esi
movq %r14, %rdx
callq 0xade9
movq %rax, %rbx
leaq 0x59a5(%rip), %rsi      # 0xc4a8
movq %rax, %rdi
callq 0x2160
movq %rax, (%r13)
testq %rax, %rax
je 0x6b4a
leaq 0x5b8a(%rip), %rdx      # 0xc6a5
movq %r12, %rdi
movl $0x1, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6e50
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xa645
movq %r15, %rdi
movq %r14, %rsi
callq 0xa772
movq %rax, %rbp
jmp 0x6b65
leaq 0x5b60(%rip), %rdx      # 0xc6b1
xorl %ebp, %ebp
movq %r12, %rdi
movl $0x4, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6e50
movq %rbx, %rdi
callq 0x2570
movq %rbp, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/loader.c
// Function: loader_empty_texture
const d3d_texture *loader_empty_texture(struct loader *ldr)
{
	if (!ldr->empty_txtr)
		ldr->empty_txtr = assert_alloc(d3d_new_texture(1, 1,
			TRANSPARENT_PIXEL));
	return ldr->empty_txtr;
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x6b88
retq
pushq %rbx
movq %rdi, %rbx
movl $0x1, %edi
movl $0x1, %esi
movl $0xff, %edx
callq 0x2900
movq %rax, %rdi
callq 0xb1d6
movq %rax, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/loader.c
// Function: loader_print_summary
void loader_print_summary(struct loader *ldr)
{
	logger_printf(ldr->log, LOGGER_INFO,
		"Load summary: %lu maps, %lu entity types, %lu textures, "
		"%lu color pairs\n",
		(unsigned long)table_count(&ldr->maps),
		(unsigned long)table_count(&ldr->ents),
		(unsigned long)table_count(&ldr->txtrs),
		(unsigned long)color_map_count_pairs(&ldr->colors));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movq 0xb0(%rdi), %rbx
addq $0x48, %rdi
callq 0xa7f8
movq %rax, %r15
leaq 0x28(%r14), %rdi
callq 0xa7f8
movq %rax, %r12
leaq 0x8(%r14), %rdi
callq 0xa7f8
movq %rax, %r13
addq $0x68, %r14
movq %r14, %rdi
callq 0xaa00
movq %rax, (%rsp)
leaq 0x5a5d(%rip), %rdx      # 0xc65c
movq %rbx, %rdi
movl $0x1, %esi
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x6e50
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/loader.c
// Function: loader_free
void loader_free(struct loader *ldr)
{
	const char *key;
	void **val;
	d3d_free_texture(ldr->empty_txtr);
	TABLE_FOR_EACH(&ldr->txtrs, key, val) {
		free((char *)key);
		d3d_free_texture(*val);
	}
	table_free(&ldr->txtrs);
	free(ldr->txtrs_dir);
	TABLE_FOR_EACH(&ldr->ents, key, val) {
		free((char *)key);
		ent_type_free(*val);
	}
	table_free(&ldr->ents);
	free(ldr->ents_dir);
	TABLE_FOR_EACH(&ldr->maps, key, val) {
		free((char *)key);
		map_free(*val);
	}
	table_free(&ldr->maps);
	free(ldr->maps_dir);
	color_map_destroy(&ldr->colors);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x3a49
leaq 0x8(%rbx), %r14
cmpq $0x0, 0x8(%rbx)
je 0x6c8e
movl $0x8, %r15d
xorl %r12d, %r12d
movq 0x18(%rbx), %r13
movq -0x8(%r13,%r15), %rdi
callq 0x2570
movq (%r13,%r15), %rdi
callq 0x3a49
incq %r12
addq $0x10, %r15
cmpq 0x8(%rbx), %r12
jb 0x6c69
movq %r14, %rdi
callq 0xa7fc
movq 0x20(%rbx), %rdi
callq 0x2570
leaq 0x28(%rbx), %r14
cmpq $0x0, 0x28(%rbx)
je 0x6cd8
movl $0x8, %r15d
xorl %r12d, %r12d
movq 0x38(%rbx), %r13
movq -0x8(%r13,%r15), %rdi
callq 0x2570
movq (%r13,%r15), %rdi
callq 0x47fc
incq %r12
addq $0x10, %r15
cmpq 0x28(%rbx), %r12
jb 0x6cb3
movq %r14, %rdi
callq 0xa7fc
movq 0x40(%rbx), %rdi
callq 0x2570
leaq 0x48(%rbx), %r14
cmpq $0x0, 0x48(%rbx)
je 0x6d22
movl $0x8, %r15d
xorl %r12d, %r12d
movq 0x58(%rbx), %r13
movq -0x8(%r13,%r15), %rdi
callq 0x2570
movq (%r13,%r15), %rdi
callq 0x85b5
incq %r12
addq $0x10, %r15
cmpq 0x48(%rbx), %r12
jb 0x6cfd
movq %r14, %rdi
callq 0xa7fc
movq 0x60(%rbx), %rdi
callq 0x2570
addq $0x68, %rbx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xaa16
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/logger.c
// Function: logger_set_output
void logger_set_output(struct logger *log, int which, FILE *dest, bool do_free)
{
	if (!log) return;
	if ((which & LOGGER_ALL) == LOGGER_ALL) {
		log->do_free &= ~LOGGER_ALL;
		log->flags &= ~LOGGER_ALL;
		log->info = log->warning = log->error = dest;
		if (dest) {
			log->flags |= LOGGER_ALL;
			if (do_free) log->do_free |= LOGGER_ALL;
		}
	} else {
		int mode = get_mode(which);
		log->do_free &= ~mode;
		*get_filep(log, mode) = dest;
		if (dest) {
			log->flags |= mode;
			if (do_free) log->do_free |= mode;
		} else {
			log->flags &= ~mode;
		}
	}
}

// Assembly:
testq %rdi, %rdi
je 0x6e4f
movl %esi, %eax
notl %eax
testb $0x7, %al
jne 0x6ddd
movl (%rdi), %esi
movl 0x20(%rdi), %eax
movl %eax, %r8d
andl $-0x8, %r8d
movl %r8d, 0x20(%rdi)
movl %esi, %r8d
andl $-0x8, %r8d
movl %r8d, (%rdi)
movq %rdx, 0x18(%rdi)
movq %rdx, 0x10(%rdi)
movq %rdx, 0x8(%rdi)
testq %rdx, %rdx
je 0x6e4f
orl $0x7, %esi
movl %esi, (%rdi)
testb %cl, %cl
je 0x6e4f
orl $0x7, %eax
movl %eax, 0x20(%rdi)
retq
movl $0x8, %r9d
movl $0x1, %eax
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
testb $0x1, %sil
jne 0x6e24
testb $0x2, %sil
jne 0x6e13
testb $0x4, %sil
je 0x6e24
movl $0x18, %r9d
movl $0x4, %eax
movl $0xfffffffb, %r8d       # imm = 0xFFFFFFFB
jmp 0x6e24
movl $0x10, %r9d
movl $0x2, %eax
movl $0xfffffffd, %r8d       # imm = 0xFFFFFFFD
movl 0x20(%rdi), %esi
andl %r8d, %esi
movl %esi, 0x20(%rdi)
movq %rdx, (%rdi,%r9)
movl (%rdi), %r9d
testq %rdx, %rdx
je 0x6e49
orl %eax, %r9d
movl %r9d, (%rdi)
testb %cl, %cl
je 0x6e4f
orl %eax, %esi
movl %esi, 0x20(%rdi)
retq
andl %r8d, %r9d
movl %r9d, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/logger.c
// Function: logger_printf
void logger_printf(struct logger *log, int flags, const char *format, ...)
{
	if (!log) return;
	int mode = get_mode(flags);
	if (!(log->flags & mode)) return;
	FILE *file = *get_filep(log, mode);
	fputs(get_prefix(log, mode), file);
	va_list args;
	va_start(args, format);
	vfprintf(file, format, args);
	va_end(args);
	fflush(file);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x6ea4
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rdi, %rdi
je 0x6f52
movq %rdx, %rbx
movl $0x1, %eax
testb $0x1, %sil
jne 0x6ed1
movl $0x2, %eax
testb $0x2, %sil
jne 0x6ed1
andl $0x4, %esi
shrl $0x2, %esi
leal (%rsi,%rsi,2), %eax
incl %eax
testl %eax, (%rdi)
je 0x6f52
xorl %ecx, %ecx
cmpl $0x2, %eax
sete %cl
leaq 0x8(,%rcx,8), %rcx
leaq 0x57dd(%rip), %rdx      # 0xc6c9
leaq 0x57ce(%rip), %rsi      # 0xc6c1
cmoveq %rdx, %rsi
cmpl $0x4, %eax
movl $0x18, %eax
cmovneq %rcx, %rax
movq (%rdi,%rax), %r14
leaq 0x57c6(%rip), %rdi      # 0xc6d4
cmovneq %rsi, %rdi
movq %r14, %rsi
callq 0x2290
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x2550
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/TurkeyMcMac[P]ts3d/src/logger.c
// Function: logger_free
void logger_free(struct logger *log)
{
	if (!log) return;
	// Make sure no files are closed twice.
	FILE *filei = NULL, *filew = NULL, *filee = NULL;
	if ((log->do_free & LOGGER_INFO)
	 && (filei = *get_filep(log, LOGGER_INFO)))
		fclose(filei);
	if ((log->do_free & LOGGER_WARNING)
	 && (filew = *get_filep(log, LOGGER_WARNING))
	 && !(filew == filei && log->do_free & LOGGER_INFO))
		fclose(filew);
	if ((log->do_free & LOGGER_ERROR)
	 && (filee = *get_filep(log, LOGGER_ERROR))
	 && !(filee == filei && log->do_free & LOGGER_INFO)
	 && !(filee == filew && log->do_free & LOGGER_WARNING))
		fclose(filee);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x6fe3
movq %rdi, %rbx
movl 0x20(%rdi), %eax
testb $0x1, %al
je 0x6f87
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x6f87
movq %r14, %rdi
callq 0x23e0
movl 0x20(%rbx), %eax
jmp 0x6f8a
xorl %r14d, %r14d
testb $0x2, %al
je 0x6fb4
movq 0x10(%rbx), %r15
testq %r15, %r15
je 0x6fb4
cmpq %r14, %r15
sete %dl
movq %r14, %rcx
testb %dl, %al
jne 0x6fb6
movq %r15, %rdi
callq 0x23e0
movl 0x20(%rbx), %eax
movq %r15, %rcx
jmp 0x6fb6
xorl %ecx, %ecx
testb $0x4, %al
je 0x6fe3
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x6fe3
cmpq %r14, %rdi
sete %dl
testb %dl, %al
jne 0x6fe3
cmpq %rcx, %rdi
sete %cl
shrb %al
testb %cl, %al
jne 0x6fe3
popq %rbx
popq %r14
popq %r15
jmp 0x23e0
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)