LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/waywardgeek[P]sonic/wave.c
// Function: readFromWaveFile
int readFromWaveFile(waveFile file, short* buffer, int maxSamples) {
  int i, bytesRead, samplesRead;
  int bytePos = 0;
  unsigned char bytes[WAVE_BUF_LEN];
  short sample;

  if (maxSamples * file->numChannels * 2 > WAVE_BUF_LEN) {
    maxSamples = WAVE_BUF_LEN / (file->numChannels * 2);
  }
  bytesRead = readBytes(file, bytes, maxSamples * file->numChannels * 2);
  samplesRead = bytesRead / (file->numChannels * 2);
  for (i = 0; i < samplesRead * file->numChannels; i++) {
    sample = bytes[bytePos++];
    sample |= (unsigned int)bytes[bytePos++] << 8;
    *buffer++ = sample;
  }
  return samplesRead;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %ecx
movl %ecx, %eax
imull %edx, %eax
cmpl $0x801, %eax            # imm = 0x801
jl 0x2a12
leal (%rcx,%rcx), %esi
movl $0x1000, %eax           # imm = 0x1000
xorl %edx, %edx
idivl %esi
movl %eax, %edx
xorl %r15d, %r15d
cmpl $0x0, 0x14(%r14)
je 0x2a20
xorl %eax, %eax
jmp 0x2a3a
imull %edx, %ecx
addl %ecx, %ecx
movslq %ecx, %rdx
movq 0x8(%r14), %rcx
movq %rsp, %rdi
pushq $0x1
popq %rsi
callq 0x1050
movl (%r14), %ecx
leal (%rcx,%rcx), %esi
cltd
idivl %esi
movl %eax, %edx
imull %ecx, %edx
testl %edx, %edx
cmovlel %r15d, %edx
cmpl %r15d, %edx
je 0x2a5f
movzwl (%rsp,%r15,2), %ecx
movw %cx, (%rbx,%r15,2)
incq %r15
jmp 0x2a4b
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/waywardgeek[P]sonic/wave.c
// Function: writeToWaveFile
int writeToWaveFile(waveFile file, short* buffer, int numSamples) {
  int i;
  int bytePos = 0;
  unsigned char bytes[WAVE_BUF_LEN];
  short sample;
  int total = numSamples * file->numChannels;

  for (i = 0; i < total; i++) {
    if (bytePos == WAVE_BUF_LEN) {
      writeBytes(file, bytes, bytePos);
      bytePos = 0;
    }
    sample = buffer[i];
    bytes[bytePos++] = sample;
    bytes[bytePos++] = sample >> 8;
  }
  if (bytePos != 0) {
    writeBytes(file, bytes, bytePos);
  }
  return !file->failed;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
imull (%rdi), %r14d
xorl %r13d, %r13d
testl %r14d, %r14d
cmovlel %r13d, %r14d
movq %rsp, %r12
xorl %edx, %edx
cmpq %r13, %r14
je 0x2acb
cmpl $0x1000, %edx           # imm = 0x1000
jne 0x2ab7
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x2af4
xorl %edx, %edx
movzwl (%r15,%r13,2), %eax
movslq %edx, %rcx
leal 0x2(%rcx), %edx
movw %ax, (%rsp,%rcx)
incq %r13
jmp 0x2a98
testl %edx, %edx
je 0x2ada
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x2af4
xorl %eax, %eax
cmpl $0x0, 0x14(%rbx)
sete %al
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/waywardgeek[P]sonic/wave.c
// Function: writeBytes
static void writeBytes(waveFile file, void* bytes, int length) {
  size_t bytesWritten;

  if (file->failed) {
    return;
  }
  bytesWritten = fwrite(bytes, sizeof(char), length, file->soundFile);
  if (bytesWritten != length) {
    fprintf(stderr, "Unable to write to output file");
    file->failed = 1;
  }
  file->bytesWritten += bytesWritten;
}

// Assembly:
cmpl $0x0, 0x14(%rdi)
je 0x2afb
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movslq %edx, %r15
movq 0x8(%rdi), %rcx
pushq $0x1
popq %rax
movq %rsi, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x1170
movq %rax, %r14
cmpq %r15, %rax
jne 0x2b2d
addl %r14d, 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq 0x34c4(%rip), %rax      # 0x5ff8
movq (%rax), %rcx
leaq 0xbac(%rip), %rdi       # 0x36ea
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
callq 0x1170
movl $0x1, 0x14(%rbx)
jmp 0x2b23
// File: /workspace/github_c_makefile_star2_O2/waywardgeek[P]sonic/wave.c
// Function: expectString
static void expectString(waveFile file, char* expectedString) {
  char buf[11]; /* Be sure that we never call with a longer string */
  int length = strlen(expectedString);

  if (length > 10) {
    fprintf(stderr, "Internal error: expected string too long\n");
    file->failed = 1;
  } else {
    readExactBytes(file, buf, length);
    buf[length] = '\0';
    if (strcmp(expectedString, buf)) {
      fprintf(stderr, "Unsupported wave file format: Expected '%s', got '%s;\n",
          expectedString, buf);
      file->failed = 1;
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1080
movq %rax, %r15
cmpl $0xb, %r15d
jge 0x2baa
leaq 0xd(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x2c38
movslq %r15d, %rax
movb $0x0, 0xd(%rsp,%rax)
movq %r14, %rdi
movq %r12, %rsi
callq 0x10b0
testl %eax, %eax
jne 0x2bc8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x3447(%rip), %rax      # 0x5ff8
movq (%rax), %rcx
leaq 0xa9e(%rip), %rdi       # 0x3659
pushq $0x29
popq %rsi
pushq $0x1
popq %rdx
callq 0x1170
jmp 0x2be8
movq 0x3429(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0xaaa(%rip), %rsi       # 0x3683
leaq 0xd(%rsp), %rcx
movq %r14, %rdx
xorl %eax, %eax
callq 0x10c0
movl $0x1, 0x14(%rbx)
jmp 0x2b9e
// File: /workspace/github_c_makefile_star2_O2/waywardgeek[P]sonic/wave.c
// Function: readInt
static int readInt(waveFile file) {
  unsigned char bytes[4];
  int value = 0, i;

  readExactBytes(file, bytes, 4);
  for (i = 3; i >= 0; i--) {
    value <<= 8;
    value |= bytes[i];
  }
  return value;
}

// Assembly:
pushq %rax
leaq 0x4(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x2c38
pushq $0x3
popq %rcx
xorl %eax, %eax
testl %ecx, %ecx
js 0x2c18
shll $0x8, %eax
movl %ecx, %edx
movzbl 0x4(%rsp,%rdx), %edx
orl %edx, %eax
decl %ecx
jmp 0x2c04
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/waywardgeek[P]sonic/wave.c
// Function: readShort
static int readShort(waveFile file) {
  unsigned char bytes[2];
  int value = 0, i;

  readExactBytes(file, bytes, 2);
  for (i = 1; i >= 0; i--) {
    value <<= 8;
    value |= bytes[i];
  }
  return value;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0xe(%rsp), %rbx
pushq $0x2
popq %rdx
movq %rbx, %rsi
callq 0x2c38
movzwl (%rbx), %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/waywardgeek[P]sonic/wave.c
// Function: readExactBytes
static void readExactBytes(waveFile file, void* bytes, int length) {
  int numRead;

  if (file->failed) {
    return;
  }
  numRead = fread(bytes, sizeof(char), length, file->soundFile);
  if (numRead != length) {
    fprintf(stderr, "Failed to read requested bytes from input file\n");
    file->failed = 1;
  }
}

// Assembly:
cmpl $0x0, 0x14(%rdi)
je 0x2c3f
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq %edx, %r14
movq 0x8(%rdi), %rcx
pushq $0x1
popq %rax
movq %rsi, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x1050
cmpl %r14d, %eax
jne 0x2c6b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x3386(%rip), %rax      # 0x5ff8
movq (%rax), %rcx
leaq 0xa3e(%rip), %rdi       # 0x36ba
pushq $0x2f
popq %rsi
pushq $0x1
popq %rdx
callq 0x1170
movl $0x1, 0x14(%rbx)
jmp 0x2c63
// File: /workspace/github_c_makefile_star2_O2/lacework-dev[P]strace_lab_PUBLIC/./src/example_3.c
// Function: main
int main(int argc, char *argv[])
{
	
	struct sockaddr_in serv_addr;
    // while true loop so the parent process doesn't die.
    while (1)  {
        int sock = socket(AF_INET, SOCK_STREAM, 0);

        serv_addr.sin_family = AF_INET;
        serv_addr.sin_port = htons(PORT);

        inet_pton(AF_INET, "127.0.0.1", &serv_addr.sin_addr);
        connect(sock, (struct sockaddr *) &serv_addr, sizeof (serv_addr));
		write(sock, payload, payload_len);

        sleep(3);
        close(sock);
    }

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
pushq $0x2
popq %r14
pushq $0x10
popq %rbx
leaq 0x2eb5(%rip), %r15      # 0x4060
pushq $0x3
popq %r12
movl %r14d, %edi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x1080
movl %eax, %r13d
movl $0x401f0002, -0x38(%rbp) # imm = 0x401F0002
movl %r14d, %edi
leaq 0xe34(%rip), %rsi       # 0x2004
leaq -0x34(%rbp), %rdx
callq 0x1050
movl %r13d, %edi
leaq -0x38(%rbp), %rsi
movl %ebx, %edx
callq 0x1060
movl 0x702b(%rip), %edx      # 0x8218
movl %r13d, %edi
movq %r15, %rsi
callq 0x1030
movl %r12d, %edi
callq 0x1070
movl %r13d, %edi
callq 0x1040
jmp 0x11af
// File: /workspace/github_c_makefile_star2_O2/zpole[P]IICV/src/check.h
// Function: check_impl
static void
check_impl (int condition,
            const char * file,
            int line,
            const char * format, ...)
{
  va_list args;
  va_start(args, format) ;
  if (! condition) {
    fprintf(stderr, "%s:%d: check failed: ", file, line) ;
    vfprintf(stderr, format, args) ;
    fprintf(stderr, "\n") ;
    exit (1) ;
  }
  va_end(args) ;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rcx, %rbx
movl %edx, %ecx
leaq 0x20(%rsp), %rdx
movq %r8, 0x20(%rdx)
movq %r9, 0x28(%rdx)
testb %al, %al
je 0x169f
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)
movq %rdx, 0x10(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000020, %rax     # imm = 0x3000000020
movq %rax, (%rsp)
testl %edi, %edi
je 0x16ce
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
movq 0x2923(%rip), %r14      # 0x3ff8
movq (%r14), %rdi
leaq 0xa08(%rip), %rsi       # 0x20e7
leaq 0x955(%rip), %rdx       # 0x203b
xorl %eax, %eax
callq 0x1050
movq (%r14), %rdi
movq %rsp, %rdx
movq %rbx, %rsi
callq 0x10a0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x1030
pushq $0x1
popq %rdi
callq 0x10b0
// File: /workspace/github_c_makefile_star2_O2/TurkeyMcMac[P]ts3d/src/body.c
// Function: bodies_collide
bool bodies_collide(struct body *a, struct body *b)
{
	d3d_scalar touch_dist = a->radius + b->radius;
	if (fabs(a->pos.x - b->pos.x) < touch_dist
	 && fabs(a->pos.y - b->pos.y) < touch_dist) {
		a->health -= b->damage;
		b->health -= a->damage;
		return true;
	}
	return false;
}

// Assembly:
movsd (%rdi), %xmm1
movsd 0x10(%rdi), %xmm0
addsd 0x10(%rsi), %xmm0
subsd (%rsi), %xmm1
andpd 0x897a(%rip), %xmm1     # 0xb010
ucomisd %xmm1, %xmm0
jbe 0x26d5
movsd 0x8(%rdi), %xmm1
subsd 0x8(%rsi), %xmm1
andpd 0x8962(%rip), %xmm1     # 0xb010
ucomisd %xmm1, %xmm0
jbe 0x26d5
movsd 0x18(%rdi), %xmm0
subsd 0x20(%rsi), %xmm0
movsd %xmm0, 0x18(%rdi)
movsd 0x18(%rsi), %xmm0
subsd 0x20(%rdi), %xmm0
movsd %xmm0, 0x18(%rsi)
movb $0x1, %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/TurkeyMcMac[P]ts3d/src/d3d.c
// Function: d3d_new_texture
d3d_texture *d3d_new_texture(size_t width, size_t height, d3d_pixel fill)
{
	if (width < 1) width = 1;
	if (height < 1) height = 1;
	size_t size = texture_size(width, height);
	if (size == 0) return NULL;
	d3d_texture *txtr = d3d_malloc(size);
	if (!txtr) return NULL;
	txtr->width = width;
	txtr->height = height;
	for (size_t i = 0; i < width * height; ++i) {
		txtr->pixels[i] = fill;
	}
	return txtr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r15
cmpq $0x1, %rdi
adcq $0x0, %r15
movq %rsi, %r12
cmpq $0x1, %rsi
adcq $0x0, %r12
movq %r15, %rax
mulq %r12
movq %rax, %r14
seto %al
cmpq $-0x10, %r14
setae %cl
orb %al, %cl
jne 0x295d
leaq 0x10(%r14), %rdi
callq 0x2150
testq %rax, %rax
je 0x295d
movq %r15, (%rax)
movq %r12, 0x8(%rax)
xorl %ecx, %ecx
cmpq %rcx, %r14
je 0x295f
movb %bl, 0x10(%rax,%rcx)
incq %rcx
jmp 0x294f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/TurkeyMcMac[P]ts3d/src/d3d.c
// Function: d3d_new_board
d3d_board *d3d_new_board(size_t width, size_t height, const d3d_block_s *fill)
{
	size_t size = offsetof(d3d_board, blocks);
	size_t blocks_size = width * height * sizeof(d3d_block_s *);
	if (width != 0 && blocks_size / sizeof(d3d_block_s *) / width != height)
		return NULL;
	CHECKED_ADD(size, blocks_size);
	d3d_board *board = d3d_malloc(size);
	if (!board) return NULL;
	board->width = width;
	board->height = height;
	static const d3d_block_s empty_block = {{ NULL, NULL, NULL, NULL,
		NULL, NULL }};
	if (!fill) fill = &empty_block;
	for (size_t i = 0; i < width * height; ++i) {
		board->blocks[i] = fill;
	}
	return board;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %r12
imulq %rdi, %r12
leaq (,%r12,8), %rdi
testq %r15, %r15
je 0x29b1
movabsq $0x1fffffffffffffff, %rax # imm = 0x1FFFFFFFFFFFFFFF
andq %r12, %rax
xorl %ecx, %ecx
xorl %edx, %edx
divq %r15
cmpq $-0x11, %rdi
ja 0x29f0
cmpq %r14, %rax
je 0x29b7
jmp 0x29f0
cmpq $-0x11, %rdi
ja 0x29ee
addq $0x10, %rdi
callq 0x2150
testq %rax, %rax
je 0x29ee
movq %rax, %rcx
movq %r15, (%rax)
movq %r14, 0x8(%rax)
testq %rbx, %rbx
leaq 0x872f(%rip), %rax      # 0xb108
cmovneq %rbx, %rax
xorl %edx, %edx
cmpq %rdx, %r12
je 0x29f0
movq %rax, 0x10(%rcx,%rdx,8)
incq %rdx
jmp 0x29df
xorl %ecx, %ecx
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/TurkeyMcMac[P]ts3d/src/ent.c
// Function: ent_type_free
void ent_type_free(struct ent_type *ent)
{
	if (!ent) return;
	free(ent->name);
	free(ent->frames);
	free(ent);
}

// Assembly:
testq %rdi, %rdi
je 0x4587
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2580
movq 0x20(%rbx), %rdi
callq 0x2580
movq %rbx, %rdi
popq %rbx
jmp 0x2580
retq
// File: /workspace/github_c_makefile_star2_O2/TurkeyMcMac[P]ts3d/src/ent.c
// Function: ents_init
void ents_init(struct ents *ents, size_t cap)
{
	ents->ents = xmalloc(cap * sizeof(*ents->ents));
	ents->sprites = xmalloc(cap * sizeof(*ents->sprites));
	ents->num = 0;
	ents->cap = cap;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
imulq $0x60, %rsi, %rdi
callq 0xa7d0
movq %rax, (%r14)
imulq $0x30, %rbx, %rdi
callq 0xa7d0
movq %rax, 0x8(%r14)
andq $0x0, 0x10(%r14)
movq %rbx, 0x18(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/TurkeyMcMac[P]ts3d/src/ent.c
// Function: ents_add
ent_id ents_add(struct ents *ents, struct ent_type *type, enum team team,
	const d3d_vec_s *pos)
{
	size_t old_num = ents->num;
	size_t old_cap = ents->cap;
	struct ent *ent = GROWE(ents->ents, ents->num, ents->cap);
	if (ents->cap != old_cap) {
		ents->sprites = xrealloc(ents->sprites, ents->cap
			* sizeof(*ents->sprites));
	}
	ent_init(ent, type, team, &ents->sprites[old_num], pos);
	return ents->num - 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0x10(%rdi), %r14
movq 0x10(%rdi), %rbx
movq 0x18(%rdi), %rbp
leaq 0x18(%rdi), %rdx
pushq $0x60
popq %rcx
movq %r14, %rsi
callq 0x4954
movq %rax, %r13
movq 0x8(%r12), %rax
movq 0x18(%r12), %rcx
cmpq %rbp, %rcx
je 0x4640
imulq $0x30, %rcx, %rsi
movq %rax, %rdi
callq 0xa8f4
movq %rax, 0x8(%r12)
imulq $0x30, %rbx, %rcx
addq %rax, %rcx
movq %r13, %rdi
movq %r15, %rsi
movl 0xc(%rsp), %edx
movq 0x10(%rsp), %r8
callq 0x4670
movq (%r14), %rax
decq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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)
andl $0x0, 0x1c(%rdi)
movq 0x38(%rsi), %rax
movq %rax, 0x20(%rdi)
cmpb $0x1, 0x40(%rsi)
jne 0x46bb
callq 0x24a0
cltq
xorl %edx, %edx
divq 0x18(%r14)
jmp 0x46bd
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 0x69db(%rip), %xmm1     # 0xb0c0
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_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r13d, %r13d
xorl %eax, %eax
xorl %r14d, %r14d
movq 0x10(%rbx), %rbp
cmpq %rbp, %r14
jae 0x492d
movq (%rbx), %r15
movq %rax, (%rsp)
leaq (%r15,%rax), %r12
movq %r12, %rdi
callq 0x4865
testb %al, %al
je 0x491c
decq %rbp
movq %rbp, 0x10(%rbx)
imulq $0x60, %rbp, %rax
addq %rax, %r15
pushq $0xc
popq %rcx
movq %r12, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x8(%rbx), %rax
imulq $0x30, 0x10(%rbx), %rcx
movups (%rax,%rcx), %xmm0
movups 0x10(%rax,%rcx), %xmm1
movups 0x20(%rax,%rcx), %xmm2
movups %xmm2, 0x20(%rax,%r13)
movups %xmm1, 0x10(%rax,%r13)
movups %xmm0, (%rax,%r13)
incq %r14
movq (%rsp), %rax
addq $0x60, %rax
addq $0x30, %r13
jmp 0x48ba
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x498e
movq %rdi, %r15
movq %rcx, %rsi
shrq %rsi
addq %rcx, %rsi
incq %rsi
movq %rsi, (%rdx)
imulq %rbx, %rsi
movq %rax, %rdi
callq 0xa8f4
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_O2/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 0x49d7
movq %rdi, %rbx
movq %rcx, %rsi
shrq %rsi
addq %rcx, %rsi
incq %rsi
movq %rsi, (%rdx)
movq %rax, %rdi
callq 0xa8f4
movq %rax, (%rbx)
addq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x4a1e
pushq %rbx
movl %edx, %ebx
addq $0x8, %rdi
callq 0x9f6a
testq %rax, %rax
je 0x4a21
movq (%rax), %rax
cmpb $0x0, 0x4(%rax)
jne 0x4a21
movl %ebx, %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
cmpl %ecx, (%rax)
jne 0x4a21
shrl $0xc, %ebx
andb $0x1, %bl
movb %bl, 0x4(%rax)
addq $0x8, %rax
jmp 0x4a23
xorl %eax, %eax
retq
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5d78(%rip), %rcx      # 0xa7d0
movq 0xc551(%rip), %r8       # 0x10fb0
leaq 0x5e8e(%rip), %r9       # 0xa8f4
leaq 0x10(%rsp), %r12
pushq $0x8
popq %rdx
movq %r12, %rdi
xorl %esi, %esi
callq 0x515c
leaq 0x60(%rip), %r8         # 0x4adf
movl $0x2000, %edx           # imm = 0x2000
movq %r12, %rdi
movq %r13, %rsi
movq %r13, %rcx
callq 0x5213
movq %r15, 0x2000(%r13)
movl $0x1, 0x2010(%r13)
leaq 0x8(%rsp), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4b61
movq %r12, %rdi
callq 0x52d1
movq %r14, %rdi
callq 0x23f0
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_O2/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 %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq (%rdi), %rdi
movq (%rsi), %rdx
movq 0x2008(%rbx), %rcx
pushq $0x1
popq %rsi
callq 0x22f0
movq %rax, %r15
movq (%r12), %rax
movq %r15, %r12
addq %rax, %r12
pushq $0xa
popq %rbp
movq %r12, %rdx
subq %rax, %rdx
movq %rax, %rdi
movl %ebp, %esi
callq 0x20d0
testq %rax, %rax
je 0x4b35
incl 0x2010(%rbx)
incq %rax
jmp 0x4b15
cmpq (%r14), %r15
jae 0x4b55
movq %r15, (%r14)
movq 0x2008(%rbx), %rdi
callq 0x23e0
xorl %ecx, %ecx
testl %eax, %eax
pushq $-0x14
popq %rax
cmovnel %ecx, %eax
jmp 0x4b58
pushq $0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
pushq %rax
cmpb $0x0, 0x4(%rdi)
je 0x4ec9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x2, %eax
je 0x4f12
cmpl $0x4, %eax
je 0x4efe
cmpl $0x3, %eax
jne 0x4ebd
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rdi
cmpq 0x8(%rbx), %r15
jae 0x4f02
addq %r14, %rdi
callq 0x4eaf
incq %r15
addq $0x20, %r14
jmp 0x4ee3
movq 0x8(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2580
leaq 0x8(%rbx), %r14
pushq $0x8
popq %r15
xorl %r12d, %r12d
cmpq (%r14), %r12
jae 0x4f3d
movq 0x18(%rbx), %rax
movq -0x8(%rax,%r15), %rdi
movq (%rax,%r15), %rsi
callq 0x4f50
incq %r12
addq $0x10, %r15
jmp 0x4f1d
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x9ff4
// File: /workspace/github_c_makefile_star2_O2/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 0x4faa
movq 0x8(%rsi), %rcx
pushq $-0x1
popq %rax
cmpl $0x5, (%rcx)
movl %eax, %esi
jne 0x4f91
movsd 0x8(%rcx), %xmm0
movsd %xmm0, (%rdi)
xorl %esi, %esi
cmpq $0x1, %rdx
je 0x4fad
cmpl $0x5, 0x20(%rcx)
jne 0x4fad
movsd 0x28(%rcx), %xmm0
movsd %xmm0, 0x8(%rdi)
movl %esi, %eax
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x2
popq %r13
leaq 0x6467(%rip), %rbp      # 0xb434
leaq 0x64a3(%rip), %r12      # 0xb477
movsbl (%r15), %edx
testl %edx, %edx
je 0x50a9
movzbl %dl, %eax
leal -0x8(%rax), %ecx
cmpl $0x5, %ecx
ja 0x5007
movslq (%rbp,%rcx,4), %rax
addq %rbp, %rax
jmpq *%rax
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x646c(%rip), %rdx      # 0xb46e
jmp 0x5092
cmpl $0x5c, %eax
je 0x5085
cmpl $0x22, %eax
jne 0x5020
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x644a(%rip), %rdx      # 0xb468
jmp 0x5092
movq %r14, %rdi
movq %rbx, %rsi
cmpb $0x1f, %dl
ja 0x50a2
pushq $0x7
popq %rdx
callq 0x9d86
movzbl (%r15), %edx
movq %rax, %rdi
leaq 0x643c(%rip), %rsi      # 0xb47d
xorl %eax, %eax
callq 0x2230
decq (%r14)
jmp 0x509a
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x6420(%rip), %rdx      # 0xb47a
jmp 0x5092
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x640b(%rip), %rdx      # 0xb474
jmp 0x5092
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x63f9(%rip), %rdx      # 0xb471
jmp 0x5092
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
jmp 0x5092
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x63d9(%rip), %rdx      # 0xb46b
movq %r13, %rcx
callq 0x9dae
incq %r15
jmp 0x4fd4
callq 0x9e18
jmp 0x509a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
pushq $-0x1
popq %rbx
leaq 0x6373(%rip), %rbp      # 0xb44c
movq %r12, %rdi
movq %r14, %rsi
callq 0x5304
testl %eax, %eax
jne 0x5149
cmpq $0x1, %r13
jne 0x5102
movq (%r14), %rsi
testq %rsi, %rsi
je 0x5102
movq %r15, %rdi
callq 0x2390
testl %eax, %eax
je 0x5147
movl 0x10(%r14), %eax
cmpq $0x6, %rax
ja 0x512e
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
incq %r13
jmp 0x512e
decq %r13
jmp 0x512e
xorl %r13d, %r13d
jmp 0x512e
movq 0x18(%r14), %rdi
callq 0x2580
movq (%r14), %rdi
callq 0x2580
testq %r13, %r13
jg 0x50d9
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andl $0x0, 0x10(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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, %r14
movq %rdi, %rbx
testq %rcx, %rcx
leaq 0x9c(%rip), %rax        # 0x520c
cmovneq %rcx, %rax
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 0x73(%rip), %rcx        # 0x5210
movq %rcx, %xmm0
leaq 0x66(%rip), %rcx        # 0x520f
movq %rcx, %xmm3
punpcklqdq %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0]
pand %xmm2, %xmm3
pandn %xmm1, %xmm2
por %xmm3, %xmm2
movdqu %xmm2, 0x8(%rdi)
andl $0x0, 0x58(%rdi)
testq %rsi, %rsi
setne %cl
cmpq $0x18, %rdx
setae %dl
orb %cl, %dl
jne 0x51e5
movl $0x400, 0x58(%rbx)      # imm = 0x400
movb $0x0, 0x57(%rbx)
jmp 0x51fd
testq %rsi, %rsi
jne 0x51f4
movq %r14, %rdi
callq *%rax
testq %rax, %rax
je 0x5207
movq %r14, 0x50(%rbx)
andq $0x0, 0x48(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $-0x1
popq %rax
jmp 0x51ff
// File: /workspace/github_c_makefile_star2_O2/TurkeyMcMac[P]ts3d/src/json.c
// Function: json_source_string
void json_source_string(json_reader *reader, const char *str, size_t len)
{
	reader->ctx = NULL;
	reader->buf = (char *)str;
	reader->bufsiz = len;
	reader->head = 0;
	reader->refill = refill_dont;
	reader->flags |= SOURCE_DEPLETED;
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
movq %rsi, 0x20(%rdi)
movq %rdx, 0x28(%rdi)
leaq -0x19(%rip), %rax       # 0x5238
movq %rax, 0x18(%rdi)
orb $0x1, 0x59(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/TurkeyMcMac[P]ts3d/src/json.c
// Function: refill_stdio
static int refill_stdio(char **buf, size_t *size, void *ctx)
{
	FILE *file = ctx;
	size_t got = fread(*buf, 1, *size, file);
	if (got < *size) {
		*size = got;
		return feof(file) ? 0 : -JSON_ERROR_ERRNO;
	}
	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq (%rdi), %rdi
movq (%rsi), %rdx
pushq $0x1
popq %rsi
movq %rbx, %rcx
callq 0x22f0
cmpq (%r14), %rax
jae 0x52ad
movq %rax, (%r14)
movq %rbx, %rdi
callq 0x23e0
xorl %ecx, %ecx
testl %eax, %eax
pushq $-0x14
popq %rax
cmovnel %ecx, %eax
jmp 0x52b0
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5301
testq %rdx, %rdx
je 0x52f6
movq 0x38(%rdi), %rax
movq %rax, (%rdx)
pushq $0x1
popq %rax
testq %rsi, %rsi
je 0x5300
movl %ecx, (%rsi)
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x556b
jne 0x5559
orb $0x1, 0x59(%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rbx)
andq $0x0, 0x38(%rbx)
xorl %eax, %eax
jmp 0x5581
movl %eax, %ecx
movl 0x58(%rbx), %edx
pushq $-0x1
popq %rax
testb %dl, %dl
jne 0x5581
negl %ecx
movzbl %cl, %ecx
orl %ecx, %edx
movl %edx, 0x58(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movabsq $0x100002e00, %r15      # imm = 0x100002E00
pushq $-0x1
popq %rbx
movq 0x28(%r14), %rax
movq 0x38(%r14), %rcx
cmpq %rax, %rcx
jae 0x55c6
movq 0x20(%r14), %rdx
movzbl (%rdx,%rcx), %edx
cmpq $0x20, %rdx
ja 0x55db
btq %rdx, %r15
jae 0x55db
incq %rcx
movq %rcx, 0x38(%r14)
jmp 0x55a4
testb $0x1, 0x59(%r14)
jne 0x55db
movq %r14, %rdi
callq 0x5530
testl %eax, %eax
je 0x559c
jmp 0x55dd
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5bea
testl %eax, %eax
js 0x5a40
cmpl %r15d, %eax
jne 0x5a4a
movq %r14, %rdi
callq 0x5e02
movl %ebp, 0x10(%rbx)
jmp 0x5a4e
xorl %eax, %eax
cmpb 0x58(%r14), %al
sbbl %eax, %eax
jmp 0x5a50
decq 0x38(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5bea
testl %eax, %eax
js 0x5a8d
movl %eax, %ecx
cmpl %r15d, %eax
jne 0x5a96
movq %rbx, %rdi
callq 0x5e02
movl %ebp, 0x10(%r14)
xorl %eax, %eax
jmp 0x5aad
xorl %eax, %eax
cmpb 0x58(%rbx), %al
sbbl %eax, %eax
jmp 0x5aad
xorl %eax, %eax
cmpl $0x2c, %ecx
je 0x5aad
movl 0x58(%rbx), %ecx
pushq $-0x1
popq %rax
testb %cl, %cl
jne 0x5aad
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_O2/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 0x5bea
pushq $-0x1
popq %rbp
testl %eax, %eax
js 0x5b6b
cmpl $0x22, %eax
jne 0x5b55
pushq $0x10
popq %rdi
callq *(%r14)
testq %rax, %rax
je 0x5b7a
movq %rax, (%rbx)
leaq 0x8(%rbx), %r15
andq $0x0, 0x8(%rbx)
leaq 0x8(%rsp), %r12
movq %r14, %rdi
callq 0x5bea
cmpl $0x22, %eax
je 0x5b8f
testl %eax, %eax
js 0x5bc9
cmpl $0x5c, %eax
jne 0x5b32
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x5e26
jmp 0x5b4f
cmpl $0x20, %eax
jb 0x5bd6
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
movl %eax, %r8d
callq 0x5cf4
testl %eax, %eax
je 0x5b08
jmp 0x5b64
movl 0x58(%r14), %eax
testb %al, %al
jne 0x5b64
orl $0xc, %eax
movl %eax, 0x58(%r14)
movq (%rbx), %rdi
callq *0x8(%r14)
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 0x5b89
orl $0x9, %eax
movl %eax, 0x58(%r14)
andq $0x0, (%rbx)
jmp 0x5b6b
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0x5cf4
testl %eax, %eax
jne 0x5b64
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 0x5b6b
movl 0x58(%r14), %eax
testb %al, %al
jne 0x5b64
orl $0xf, %eax
jmp 0x5b60
decq 0x38(%r14)
movl 0x58(%r14), %eax
testb %al, %al
jne 0x5b64
orl $0x11, %eax
jmp 0x5b60
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $-0x1
popq %rbx
movq 0x38(%r14), %rax
cmpq 0x28(%r14), %rax
jb 0x5c13
testb $0x1, 0x59(%r14)
jne 0x5c23
movq %r14, %rdi
callq 0x5530
testl %eax, %eax
je 0x5bf4
jmp 0x5c23
movq 0x20(%r14), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x38(%r14)
movzbl (%rcx,%rax), %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5c63
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 0x5cf4
movzbl 0x57(%rbx), %eax
cmpq $0x17, %rax
jb 0x5cba
leaq 0x40(%rbx), %r15
movq 0xf(%r15), %rax
movq %rax, 0xf(%rsp)
movups (%r15), %xmm0
movaps %xmm0, (%rsp)
pushq $0x18
popq %r14
movq %r14, %rdi
callq *(%rbx)
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x5cd0
movq 0xf(%rsp), %rcx
movq %rcx, 0xf(%rax)
movaps (%rsp), %xmm0
movups %xmm0, (%rax)
movq 0x40(%rbx), %rax
movb %bpl, 0x17(%rax)
movq %r14, 0x50(%rbx)
movq %r14, 0x48(%rbx)
andb $-0x5, 0x59(%rbx)
jmp 0x5cc5
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(%r15)
movaps (%rsp), %xmm0
movups %xmm0, (%r15)
movb $0x17, 0x57(%rbx)
movl 0x58(%rbx), %eax
testb %al, %al
jne 0x5cc5
orl $0x9, %eax
movl %eax, 0x58(%rbx)
jmp 0x5cc5
// File: /workspace/github_c_makefile_star2_O2/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 0x5d44
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 0x5d5b
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
pushq $-0x1
popq %rax
testb %cl, %cl
jne 0x5d4c
orl $0x9, %ecx
movl %ecx, 0x58(%r15)
jmp 0x5d4c
// File: /workspace/github_c_makefile_star2_O2/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 0x5dce
subq %rsi, %r15
addq 0x20(%r14), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x2510
movq %r14, %rdi
callq 0x5530
testl %eax, %eax
je 0x5dc7
pushq $-0x1
popq %rbx
jmp 0x5de1
movq %r14, %rdi
callq 0x5bea
testl %eax, %eax
js 0x5df0
movb %al, (%r12,%r15)
incq %r15
cmpq %rbx, %r15
jb 0x5db4
jmp 0x5de1
addq 0x20(%r14), %rsi
movq %r12, %rdi
movq %rbx, %rdx
callq 0x2510
addq %rbx, 0x38(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movb 0x59(%r14), %al
andb $0x1, %al
xorl %ebx, %ebx
cmpb $0x1, %al
sbbq %rbx, %rbx
orq %r15, %rbx
jmp 0x5de1
// File: /workspace/github_c_makefile_star2_O2/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 0x5e19
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0x5e18
decq %rax
movq %rax, 0x48(%rdi)
retq
movb 0x57(%rdi), %al
testb %al, %al
je 0x5e18
decb %al
movb %al, 0x57(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq $0x3
popq %rdx
xorl %ecx, %ecx
pushq $-0x1
popq %rsi
xorl %eax, %eax
testq %rdx, %rdx
js 0x6098
movsbl (%rdi,%rdx), %r8d
orl $0x20, %r8d
leal -0x30(%r8), %r9d
cmpl $0xa, %r9d
jb 0x6083
leal -0x61(%r8), %r9d
cmpl $0x5, %r9d
ja 0x6095
addl $-0x26, %r8d
movl %r8d, %r9d
movl %r9d, %r8d
shlq %cl, %r8
orq %r8, %rax
decq %rdx
addq $0x4, %rcx
jmp 0x605a
movq %rsi, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x60ef
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 0x6111
movq %r15, (%r13)
movq %rax, (%rbp)
movq (%r14), %rdi
movq (%rsp), %r8
addq %rax, %rdi
movq %r8, %rsi
movq %rbx, %rdx
callq 0x2510
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
pushq $-0x1
popq %rax
testb %cl, %cl
jne 0x6102
orl $0x9, %ecx
movl %ecx, 0x58(%r12)
jmp 0x6102