LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/Mikejmoffitt[P]romtools/bsplit/bsplit.c
// Function: exchange_nybbles
void exchange_nybbles(const char *in_fname, const char *out_fname)
{
	int c;
	FILE *fin, *fout;
	fout = fopen(out_fname, "wb");
	if (!fout)
	{
		fprintf(stderr, "Couldn't open %s.\n", out_fname);
		return;
	}
	fin = fopen(in_fname, "rb");
	if (!fin)
	{
		fprintf(stderr, "Couldn't open %s.\n", in_fname);
		fclose(fout);
		return;
	}

	do
	{
		c = fgetc(fin);
		if (c == EOF)
		{
			break;
		}
		fputc(((c & 0xF) << 4) | ((c & 0xF0) >> 4), fout);
	} while (c != EOF);

	fclose(fout);
	fclose(fin);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0xa33(%rip), %rsi       # 0x201a
movq %r14, %rdi
callq 0x10a0
testq %rax, %rax
je 0x164c
movq %rax, %rbx
leaq 0xa06(%rip), %rsi       # 0x2004
movq %r15, %rdi
callq 0x10a0
testq %rax, %rax
je 0x166c
movq %rax, %r14
movq %r14, %rdi
callq 0x1060
cmpl $-0x1, %eax
je 0x1637
movl %eax, %ecx
shll $0x4, %ecx
movzbl %cl, %ecx
shrl $0x4, %eax
andl $0xf, %eax
orl %ecx, %eax
movl %eax, %edi
movq %rbx, %rsi
callq 0x1070
jmp 0x160e
movq %rbx, %rdi
callq 0x1040
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1040
movq 0x29a5(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x9aa(%rip), %rsi       # 0x2007
movq %r14, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x1080
movq 0x2985(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x98a(%rip), %rsi       # 0x2007
movq %r15, %rdx
xorl %eax, %eax
callq 0x1080
movq %rbx, %rdi
jmp 0x1642
// File: /workspace/github_c_makefile_star2_O1/Mikejmoffitt[P]romtools/bsplit/bsplit.c
// Function: exchange_halfnybbles
void exchange_halfnybbles(const char *in_fname, const char *out_fname)
{
	int c;
	uint8_t byte;
	FILE *fin, *fout;
	fout = fopen(out_fname, "wb");
	if (!fout)
	{
		fprintf(stderr, "Couldn't open %s.\n", out_fname);
		return;
	}
	fin = fopen(in_fname, "rb");
	if (!fin)
	{
		fprintf(stderr, "Couldn't open %s.\n", in_fname);
		fclose(fout);
		return;
	}

	do
	{
		c = fgetc(fin);
		if (c == EOF)
		{
			break;
		}
		byte = c;
		c = ((byte & 0x03) << 2) | ((byte & 0x0C) >> 2) | (((byte & 0x30) << 2) | ((byte & 0xC0) >> 2));

		fputc(c, fout);
	} while (c != EOF);

	fclose(fout);
	fclose(fin);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x97c(%rip), %rsi       # 0x201a
movq %r14, %rdi
callq 0x10a0
testq %rax, %rax
je 0x16ff
movq %rax, %rbx
leaq 0x94f(%rip), %rsi       # 0x2004
movq %r15, %rdi
callq 0x10a0
testq %rax, %rax
je 0x171f
movq %rax, %r14
movq %r14, %rdi
callq 0x1060
cmpl $-0x1, %eax
je 0x16ea
movl %eax, %ecx
shrl $0x2, %ecx
andl $0x33, %ecx
andl $0x33, %eax
leal (%rcx,%rax,4), %edi
movq %rbx, %rsi
callq 0x1070
jmp 0x16c5
movq %rbx, %rdi
callq 0x1040
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1040
movq 0x28f2(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x8f7(%rip), %rsi       # 0x2007
movq %r14, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x1080
movq 0x28d2(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0x8d7(%rip), %rsi       # 0x2007
movq %r15, %rdx
xorl %eax, %eax
callq 0x1080
movq %rbx, %rdi
jmp 0x16f5
// File: /workspace/github_c_makefile_star2_O1/Mikejmoffitt[P]romtools/bsplit/bsplit.c
// Function: usage
void usage(const char *name)
{
	printf("Usage: %s [op]\n", name);
	printf("    split: s in out.even out.odd <bytes per>\n");
	printf("  combine: c in.even in.odd out <bytes per>\n");
	printf(" exchange: x in out\n");
	printf(" ex. 4bit: n in out\n");
	printf(" ex. 2bit: z in out\n");
}

// Assembly:
pushq %rax
movq %rdi, %rsi
leaq 0x8d3(%rip), %rdi       # 0x201d
xorl %eax, %eax
callq 0x1050
leaq 0x8f8(%rip), %rdi       # 0x2050
callq 0x1030
leaq 0x919(%rip), %rdi       # 0x207d
callq 0x1030
leaq 0x939(%rip), %rdi       # 0x20a9
callq 0x1030
leaq 0x941(%rip), %rdi       # 0x20bd
callq 0x1030
leaq 0x949(%rip), %rdi       # 0x20d1
popq %rax
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/Mikejmoffitt[P]romtools/bsplit/bsplit.c
// Function: main
int main(int argc, char **argv)
{
	if (argc < 2)
	{
		usage(argv[0]);
		return 0;
	}

	int bytes = 1;

	if (argc > 5)
	{
		bytes = atoi(argv[5]);
		printf("Using %d bytes interleave cadence\n", bytes);
	}

	if (argv[1][0] == 's')
	{
		if (argc < 5)
		{
			usage(argv[0]);
			return 0;
		}
		printf("Splitting\n");
		split(argv[2], argv[3], argv[4], bytes);
	}
	else if (argv[1][0] == 'c')
	{
		if (argc < 5)
		{
			usage(argv[0]);
			return 0;
		}
		printf("Combining\n");
		combine(argv[2], argv[3], argv[4], bytes);
	}
	else if (argv[1][0] == 'x')
	{
		if (argc < 4)
		{
			usage(argv[0]);
			return 0;
		}
		printf("Exchanging bytes\n");
		exchange(argv[2], argv[3]);
	}
	else if (argv[1][0] == 'n')
	{
		if (argc < 4)
		{
			usage(argv[0]);
			return 0;
		}
		printf("Exchanging nybbles\n");
		exchange_nybbles(argv[2], argv[3]);
	}
	else if (argv[1][0] == 'z')
	{
		if (argc < 4)
		{
			usage(argv[0]);
			return 0;
		}
		printf("Exchanging half-nybbles\n");
		exchange_halfnybbles(argv[2], argv[3]);
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
cmpl $0x1, %edi
jg 0x17a9
movq (%rbx), %rdi
callq 0x173f
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl %edi, %r14d
movl $0x1, %ebp
cmpl $0x6, %edi
jl 0x17d1
movq 0x28(%rbx), %rdi
callq 0x10b0
movl %eax, %ebp
leaq 0x865(%rip), %rdi       # 0x202d
movl %eax, %esi
xorl %eax, %eax
callq 0x1050
movq 0x8(%rbx), %rax
movzbl (%rax), %eax
cmpl $0x72, %eax
jle 0x1817
cmpl $0x7a, %eax
je 0x1849
cmpl $0x78, %eax
je 0x1871
cmpl $0x73, %eax
jne 0x17a2
cmpl $0x4, %r14d
jle 0x179a
leaq 0x92e(%rip), %rdi       # 0x212b
callq 0x1030
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
movl %ebp, %ecx
callq 0x11bc
jmp 0x17a2
cmpl $0x63, %eax
je 0x1899
cmpl $0x6e, %eax
jne 0x17a2
cmpl $0x3, %r14d
jle 0x179a
leaq 0x8cb(%rip), %rdi       # 0x20fd
callq 0x1030
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
callq 0x15d5
jmp 0x17a2
cmpl $0x3, %r14d
jle 0x179a
leaq 0x88b(%rip), %rdi       # 0x20e5
callq 0x1030
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
callq 0x168c
jmp 0x17a2
cmpl $0x3, %r14d
jle 0x179a
leaq 0x88e(%rip), %rdi       # 0x2110
callq 0x1030
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
callq 0x14e8
jmp 0x17a2
cmpl $0x4, %r14d
jle 0x179a
leaq 0x877(%rip), %rdi       # 0x2121
callq 0x1030
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
movl %ebp, %ecx
callq 0x1396
jmp 0x17a2
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/sonic.c
// Function: freeStreamBuffers
static void freeStreamBuffers(sonicStream stream) {
  if (stream->inputBuffer != NULL) {
    sonicFree(stream->inputBuffer);
  }
  if (stream->outputBuffer != NULL) {
    sonicFree(stream->outputBuffer);
  }
  if (stream->pitchBuffer != NULL) {
    sonicFree(stream->pitchBuffer);
  }
  if (stream->downSampleBuffer != NULL) {
    sonicFree(stream->downSampleBuffer);
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x1478
callq 0x1030
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x1486
callq 0x1030
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x1494
callq 0x1030
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x14a3
popq %rbx
jmp 0x1030
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/sonic.c
// Function: sonicIntCreateStream
sonicStream sonicCreateStream(int sampleRate, int numChannels) {
  sonicStream stream =
      (sonicStream)sonicCalloc(1, sizeof(struct sonicStreamStruct));

  sampleRate = CLAMP(sampleRate, SONIC_MIN_SAMPLE_RATE, SONIC_MAX_SAMPLE_RATE);
  numChannels = CLAMP(numChannels, SONIC_MIN_CHANNELS, SONIC_MAX_CHANNELS);
  if (stream == NULL) {
    return NULL;
  }
  if (!allocateStreamBuffers(stream, sampleRate, numChannels)) {
    return NULL;
  }
  stream->speed = 1.0f;
  stream->pitch = 1.0f;
  stream->volume = 1.0f;
  stream->rate = 1.0f;
  stream->oldRatePosition = 0;
  stream->newRatePosition = 0;
  stream->quality = 0;
  return stream;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movl %edi, %ebp
movl $0x1, %edi
movl $0x88, %esi
callq 0x10a0
testq %rax, %rax
je 0x1523
movq %rax, %rbx
cmpl $0x20, %r14d
movl $0x20, %eax
cmovll %r14d, %eax
cmpl $0x2, %eax
movl $0x1, %edx
cmovgel %eax, %edx
movl $0x7a120, %eax          # imm = 0x7A120
cmpl %eax, %ebp
cmovll %ebp, %eax
cmpl $0x3e9, %eax            # imm = 0x3E9
movl $0x3e8, %esi            # imm = 0x3E8
cmovgel %eax, %esi
movq %rbx, %rdi
callq 0x152d
testl %eax, %eax
je 0x1523
movabsq $0x3f8000003f800000, %rax # imm = 0x3F8000003F800000
movq %rax, 0x28(%rbx)
movq %rax, 0x30(%rbx)
movq $0x0, 0x44(%rbx)
movl $0x0, 0x4c(%rbx)
jmp 0x1525
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/sonic.c
// Function: sonicIntReadFloatFromStream
int sonicReadFloatFromStream(sonicStream stream, float* samples,
                             int maxSamples) {
  int numSamples = stream->numOutputSamples;
  int remainingSamples = 0;
  short* buffer;
  int count;

  if (numSamples == 0) {
    return 0;
  }
  if (numSamples > maxSamples) {
    remainingSamples = numSamples - maxSamples;
    numSamples = maxSamples;
  }
  buffer = stream->outputBuffer;
  count = numSamples * stream->numChannels;
  while (count--) {
    *samples++ = (*buffer++) / 32767.0f;
  }
  if (remainingSamples > 0) {
    memmove(stream->outputBuffer,
            stream->outputBuffer + numSamples * stream->numChannels,
            remainingSamples * sizeof(short) * stream->numChannels);
  }
  stream->numOutputSamples = remainingSamples;
  return numSamples;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl 0x64(%rdi), %eax
testl %eax, %eax
je 0x1789
movl %edx, %ebx
movq %rdi, %r14
xorl %ecx, %ecx
movl %eax, %r15d
subl %edx, %r15d
cmovll %eax, %ebx
cmovlel %ecx, %r15d
movq 0x8(%rdi), %rdi
movslq 0x50(%r14), %rdx
movslq %ebx, %rax
imulq %rdx, %rax
testl %eax, %eax
je 0x176d
movl %eax, %ecx
xorl %r8d, %r8d
movss 0x28c2(%rip), %xmm0     # 0x4010
movswl (%rdi,%r8,2), %r9d
xorps %xmm1, %xmm1
cvtsi2ss %r9d, %xmm1
divss %xmm0, %xmm1
movss %xmm1, (%rsi,%r8,4)
incq %r8
cmpl %r8d, %ecx
jne 0x174e
testl %r15d, %r15d
jle 0x1783
leaq (%rdi,%rax,2), %rsi
leal (%r15,%r15), %eax
imulq %rax, %rdx
callq 0x1130
movl %r15d, 0x64(%r14)
jmp 0x178b
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/sonic.c
// Function: sonicIntReadShortFromStream
int sonicReadShortFromStream(sonicStream stream, short* samples,
                             int maxSamples) {
  int numSamples = stream->numOutputSamples;
  int remainingSamples = 0;

  if (numSamples == 0) {
    return 0;
  }
  if (numSamples > maxSamples) {
    remainingSamples = numSamples - maxSamples;
    numSamples = maxSamples;
  }
  memcpy(samples, stream->outputBuffer,
         numSamples * sizeof(short) * stream->numChannels);
  if (remainingSamples > 0) {
    memmove(stream->outputBuffer,
            stream->outputBuffer + numSamples * stream->numChannels,
            remainingSamples * sizeof(short) * stream->numChannels);
  }
  stream->numOutputSamples = remainingSamples;
  return numSamples;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x64(%rdi), %eax
testl %eax, %eax
je 0x17fb
movl %edx, %ebx
movq %rdi, %r14
xorl %ecx, %ecx
movl %eax, %r15d
subl %edx, %r15d
cmovll %eax, %ebx
cmovlel %ecx, %r15d
movq 0x8(%rdi), %rax
movslq %ebx, %r12
movslq 0x50(%rdi), %rdx
imulq %r12, %rdx
addq %rdx, %rdx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x10e0
testl %r15d, %r15d
jle 0x17f5
movq 0x8(%r14), %rdi
movslq 0x50(%r14), %rax
imulq %rax, %r12
leaq (%rdi,%r12,2), %rsi
leal (%r15,%r15), %edx
imulq %rax, %rdx
callq 0x1130
movl %r15d, 0x64(%r14)
jmp 0x17fd
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/sonic.c
// Function: sonicIntReadUnsignedCharFromStream
int sonicReadUnsignedCharFromStream(sonicStream stream, unsigned char* samples,
                                    int maxSamples) {
  int numSamples = stream->numOutputSamples;
  int remainingSamples = 0;
  short* buffer;
  int count;

  if (numSamples == 0) {
    return 0;
  }
  if (numSamples > maxSamples) {
    remainingSamples = numSamples - maxSamples;
    numSamples = maxSamples;
  }
  buffer = stream->outputBuffer;
  count = numSamples * stream->numChannels;
  while (count--) {
    *samples++ = (char)((*buffer++) >> 8) + 128;
  }
  if (remainingSamples > 0) {
    memmove(stream->outputBuffer,
            stream->outputBuffer + numSamples * stream->numChannels,
            remainingSamples * sizeof(short) * stream->numChannels);
  }
  stream->numOutputSamples = remainingSamples;
  return numSamples;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl 0x64(%rdi), %eax
testl %eax, %eax
je 0x187c
movl %edx, %ebx
movq %rdi, %r14
xorl %ecx, %ecx
movl %eax, %r15d
subl %edx, %r15d
cmovll %eax, %ebx
cmovlel %ecx, %r15d
movl 0x50(%rdi), %ecx
imull %ebx, %ecx
testl %ecx, %ecx
je 0x1851
movq 0x8(%r14), %rax
movl %ecx, %ecx
xorl %edx, %edx
movb 0x1(%rax,%rdx,2), %dil
addb $-0x80, %dil
movb %dil, (%rsi,%rdx)
incq %rdx
cmpl %edx, %ecx
jne 0x183d
testl %r15d, %r15d
jle 0x1876
movq 0x8(%r14), %rdi
movslq 0x50(%r14), %rax
movslq %ebx, %rcx
imulq %rax, %rcx
leaq (%rdi,%rcx,2), %rsi
leal (%r15,%r15), %edx
imulq %rax, %rdx
callq 0x1130
movl %r15d, 0x64(%r14)
jmp 0x187e
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/sonic.c
// Function: sonicIntFlushStream
int sonicFlushStream(sonicStream stream) {
  int maxRequired = stream->maxRequired;
  int remainingSamples = stream->numInputSamples;
  float speed = stream->speed / stream->pitch;
  float rate = stream->rate * stream->pitch;
  int expectedOutputSamples =
      stream->numOutputSamples +
      (int)((remainingSamples / speed + stream->numPitchSamples) / rate + 0.5f);

  /* Add enough silence to flush both input and pitch buffers. */
  if (!enlargeInputBufferIfNeeded(stream, remainingSamples + 2 * maxRequired)) {
    return 0;
  }
  memset(stream->inputBuffer + remainingSamples * stream->numChannels, 0,
         2 * maxRequired * sizeof(short) * stream->numChannels);
  stream->numInputSamples += 2 * maxRequired;
  if (!sonicWriteShortToStream(stream, NULL, 0)) {
    return 0;
  }
  /* Throw away any extra samples we generated due to the silence we added */
  if (stream->numOutputSamples > expectedOutputSamples) {
    stream->numOutputSamples = expectedOutputSamples;
  }
  /* Empty input and pitch buffers */
  stream->numInputSamples = 0;
  stream->inputPlayTime = 0.0f;
  stream->timeError = 0.0f;
  stream->numPitchSamples = 0;
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movslq 0x74(%rdi), %r15
movslq 0x60(%rdi), %r14
movss 0x28(%rdi), %xmm0
movss 0x30(%rdi), %xmm1
divss %xmm1, %xmm0
cvtsi2ss %r14d, %xmm2
divss %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtsi2ssl 0x68(%rdi), %xmm0
mulss 0x34(%rdi), %xmm1
addss %xmm2, %xmm0
divss %xmm1, %xmm0
addss 0x2747(%rip), %xmm0     # 0x4014
cvttss2si %xmm0, %r12d
addl 0x64(%rdi), %r12d
addq %r15, %r15
leal (%r14,%r15), %esi
callq 0x1948
testl %eax, %eax
je 0x193b
movslq 0x50(%rbx), %rax
imulq %rax, %r14
addq %r14, %r14
addq (%rbx), %r14
movq %r15, %rdx
imulq %rax, %rdx
addq %rdx, %rdx
xorl %ebp, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x1090
addl %r15d, 0x60(%rbx)
movq %rbx, %rdi
callq 0x1ab2
testl %eax, %eax
je 0x193d
cmpl %r12d, 0x64(%rbx)
jle 0x1924
movl %r12d, 0x64(%rbx)
xorl %eax, %eax
movl %eax, 0x60(%rbx)
movq $0x0, 0x3c(%rbx)
movl %eax, 0x68(%rbx)
movl $0x1, %ebp
jmp 0x193d
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/sonic.c
// Function: enlargeInputBufferIfNeeded
static int enlargeInputBufferIfNeeded(sonicStream stream, int numSamples) {
  int inputBufferSize = stream->inputBufferSize;

  if (stream->numInputSamples + numSamples > inputBufferSize) {
    stream->inputBufferSize += (inputBufferSize >> 1) + numSamples;
    stream->inputBuffer = (short*)sonicRealloc(
        stream->inputBuffer, inputBufferSize, stream->inputBufferSize,
        sizeof(short) * stream->numChannels);
    if (stream->inputBuffer == NULL) {
      return 0;
    }
  }
  return 1;
}

// Assembly:
movl 0x54(%rdi), %eax
movl 0x60(%rdi), %ecx
addl %esi, %ecx
cmpl %eax, %ecx
jle 0x197d
pushq %rbx
movq %rdi, %rbx
movl %eax, %ecx
sarl %ecx
addl %eax, %esi
addl %ecx, %esi
movl %esi, 0x54(%rdi)
movq (%rdi), %rdi
imull 0x50(%rbx), %esi
addl %esi, %esi
movslq %esi, %rsi
callq 0x1120
movq %rax, (%rbx)
testq %rax, %rax
popq %rbx
je 0x1983
movl $0x1, %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/sonic.c
// Function: sonicIntChangeFloatSpeed
int sonicChangeFloatSpeed(float* samples, int numSamples, float speed,
                          float pitch, float rate, float volume,
                          int useChordPitch, int sampleRate, int numChannels) {
  sonicStream stream = sonicCreateStream(sampleRate, numChannels);

  sonicSetSpeed(stream, speed);
  sonicSetPitch(stream, pitch);
  sonicSetRate(stream, rate);
  sonicSetVolume(stream, volume);
  sonicWriteFloatToStream(stream, samples, numSamples);
  sonicFlushStream(stream);
  numSamples = sonicSamplesAvailable(stream);
  sonicReadFloatFromStream(stream, samples, numSamples);
  sonicDestroyStream(stream);
  return numSamples;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movaps %xmm3, 0x30(%rsp)
movaps %xmm2, 0x20(%rsp)
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl %esi, %ebp
movq %rdi, %r14
movl %ecx, %edi
movl %r8d, %esi
callq 0x1100
movq %rax, %rbx
movss 0x1a54(%rip), %xmm0     # 0x4000
movaps %xmm0, %xmm1
movaps (%rsp), %xmm4
minss %xmm4, %xmm1
movss 0x1a45(%rip), %xmm2     # 0x4004
cmpltss %xmm2, %xmm4
movaps %xmm4, %xmm3
andnps %xmm1, %xmm3
andps %xmm2, %xmm4
orps %xmm3, %xmm4
movss %xmm4, 0x28(%rax)
movaps %xmm0, %xmm1
movaps 0x10(%rsp), %xmm4
minss %xmm4, %xmm1
cmpltss %xmm2, %xmm4
movaps %xmm4, %xmm3
andnps %xmm1, %xmm3
andps %xmm2, %xmm4
orps %xmm3, %xmm4
movss %xmm4, 0x30(%rax)
movaps 0x20(%rsp), %xmm3
minss %xmm3, %xmm0
cmpltss %xmm2, %xmm3
movaps %xmm3, %xmm1
andnps %xmm0, %xmm1
andps %xmm2, %xmm3
orps %xmm1, %xmm3
movss %xmm3, 0x34(%rax)
movq $0x0, 0x44(%rax)
movss 0x19e2(%rip), %xmm0     # 0x4008
movaps 0x30(%rsp), %xmm3
minss %xmm3, %xmm0
movss 0x19d5(%rip), %xmm1     # 0x400c
cmpltss %xmm1, %xmm3
movaps %xmm3, %xmm2
andnps %xmm0, %xmm2
andps %xmm1, %xmm3
orps %xmm2, %xmm3
movss %xmm3, 0x2c(%rax)
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x1040
movq %rbx, %rdi
callq 0x1060
movl 0x64(%rbx), %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x10f0
movq %rbx, %rdi
callq 0x1467
movq %rbx, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/sonic.c
// Function: removeInputSamples
static void removeInputSamples(sonicStream stream, int position) {
  int remainingSamples = stream->numInputSamples - position;

  if (remainingSamples > 0) {
    memmove(stream->inputBuffer,
            stream->inputBuffer + position * stream->numChannels,
            remainingSamples * sizeof(short) * stream->numChannels);
  }
  /* If we play 3/4ths of the samples, then the expected play time of the
     remaining samples is 1/4th of the original expected play time. */
  stream->inputPlayTime =
      (stream->inputPlayTime * remainingSamples) / stream->numInputSamples;
  stream->numInputSamples = remainingSamples;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x60(%rdi), %r14d
subl %esi, %r14d
jle 0x27d2
movq (%rbx), %rdi
movslq 0x50(%rbx), %rax
movslq %esi, %rcx
imulq %rax, %rcx
leaq (%rdi,%rcx,2), %rsi
leal (%r14,%r14), %edx
imulq %rax, %rdx
callq 0x1130
cvtsi2ss %r14d, %xmm0
mulss 0x3c(%rbx), %xmm0
cvtsi2ssl 0x60(%rbx), %xmm1
divss %xmm1, %xmm0
movss %xmm0, 0x3c(%rbx)
movl %r14d, 0x60(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/sonic.c
// Function: enlargeOutputBufferIfNeeded
static int enlargeOutputBufferIfNeeded(sonicStream stream, int numSamples) {
  int outputBufferSize = stream->outputBufferSize;

  if (stream->numOutputSamples + numSamples > outputBufferSize) {
    stream->outputBufferSize += (outputBufferSize >> 1) + numSamples;
    stream->outputBuffer = (short*)sonicRealloc(
        stream->outputBuffer, outputBufferSize, stream->outputBufferSize,
        sizeof(short) * stream->numChannels);
    if (stream->outputBuffer == NULL) {
      return 0;
    }
  }
  return 1;
}

// Assembly:
movl 0x5c(%rdi), %eax
movl 0x64(%rdi), %ecx
addl %esi, %ecx
cmpl %eax, %ecx
jle 0x282d
pushq %rbx
movq %rdi, %rbx
movl %eax, %ecx
sarl %ecx
addl %eax, %esi
addl %ecx, %esi
movl %esi, 0x5c(%rdi)
movq 0x8(%rdi), %rdi
imull 0x50(%rbx), %esi
addl %esi, %esi
movslq %esi, %rsi
callq 0x1120
movq %rax, 0x8(%rbx)
testq %rax, %rax
popq %rbx
je 0x2833
movl $0x1, %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/sonic.c
// Function: findPitchPeriodInRange
static int findPitchPeriodInRange(short* samples, int minPeriod, int maxPeriod,
                                  int* retMinDiff, int* retMaxDiff) {
  int period, bestPeriod = 0, worstPeriod = 255;
  short* s;
  short* p;
  short sVal, pVal;
  unsigned long diff, minDiff = 1, maxDiff = 0;
  int i;

  for (period = minPeriod; period <= maxPeriod; period++) {
    diff = 0;
    s = samples;
    p = samples + period;
    for (i = 0; i < period; i++) {
      sVal = *s++;
      pVal = *p++;
      diff += sVal >= pVal ? (unsigned short)(sVal - pVal)
                           : (unsigned short)(pVal - sVal);
    }
    /* Note that the highest number of samples we add into diff will be less
       than 256, since we skip samples.  Thus, diff is a 24 bit number, and
       we can safely multiply by numSamples without overflow */
    if (bestPeriod == 0 || diff * bestPeriod < minDiff * period) {
      minDiff = diff;
      bestPeriod = period;
    }
    if (diff * worstPeriod > maxDiff * period) {
      maxDiff = diff;
      worstPeriod = period;
    }
  }
  *retMinDiff = minDiff / bestPeriod;
  *retMaxDiff = maxDiff / worstPeriod;
  return bestPeriod;
}

// Assembly:
movq %rcx, %r10
cmpl %edx, %esi
jle 0x284c
movl $0x1, %eax
xorl %r9d, %r9d
xorl %edi, %edi
jmp 0x2926
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r10, -0x10(%rsp)
movq %r8, -0x8(%rsp)
movslq %esi, %r10
incl %edx
movl %esi, %r11d
leaq (%rdi,%r10,2), %r14
movl $0xff, %ebx
xorl %eax, %eax
movl $0x1, %ecx
xorl %r9d, %r9d
testq %r10, %r10
jle 0x28b4
xorl %r12d, %r12d
xorl %r15d, %r15d
movzwl (%rdi,%r12,2), %ebp
movzwl (%r14,%r12,2), %r13d
movl %ebp, %r8d
subw %r13w, %r8w
movl %r8d, %esi
negl %esi
cmpw %r13w, %bp
cmovgel %r8d, %esi
movzwl %si, %esi
addq %rsi, %r15
incq %r12
cmpl %r12d, %r11d
jne 0x2886
jmp 0x28b7
xorl %r15d, %r15d
testl %r9d, %r9d
je 0x28cf
movslq %r9d, %rsi
imulq %r15, %rsi
movq %rcx, %r8
imulq %r10, %r8
cmpq %r8, %rsi
jae 0x28d5
movl %r10d, %r9d
movq %r15, %rcx
movslq %ebx, %rbx
movq %r15, %rsi
imulq %rbx, %rsi
movq %rax, %r8
imulq %r10, %r8
cmpq %r8, %rsi
cmoval %r10d, %ebx
cmovaq %r15, %rax
incq %r10
incq %r11
addq $0x2, %r14
cmpl %r10d, %edx
jne 0x287b
movslq %ebx, %rsi
xorl %edx, %edx
divq %rsi
movq %rax, %rdi
movq -0x8(%rsp), %r8
movq -0x10(%rsp), %r10
movq %rcx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movslq %r9d, %r9
xorl %edx, %edx
divq %r9
movl %eax, (%r10)
movl %edi, (%r8)
movl %r9d, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/wave.c
// Function: closeFile
static void closeFile(waveFile file) {
  FILE* soundFile = file->soundFile;

  if (soundFile != NULL) {
    fclose(soundFile);
    file->soundFile = NULL;
  }
  free(file);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x2c15
callq 0x1070
movq $0x0, 0x8(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/wave.c
// Function: openOutputWaveFile
waveFile openOutputWaveFile(const char* fileName, int sampleRate, int numChannels) {
  waveFile file;
  FILE* soundFile = fopen(fileName, "wb");

  if (soundFile == NULL) {
    fprintf(stderr, "Unable to open wave file %s for writing\n", fileName);
    return NULL;
  }
  file = (waveFile)calloc(1, sizeof(struct waveFileStruct));
  file->soundFile = soundFile;
  file->sampleRate = sampleRate;
  file->numChannels = numChannels;
  writeHeader(file, sampleRate, numChannels);
  if (file->failed) {
    closeFile(file);
    return NULL;
  }
  return file;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %r15
leaq 0x18f5(%rip), %rsi      # 0x452e
callq 0x1140
testq %rax, %rax
je 0x2e22
movq %rax, %r12
movl $0x1, %edi
movl $0x20, %esi
callq 0x10a0
movq %rax, %rbx
movq %r12, 0x8(%rax)
movl %ebp, 0x4(%rax)
movl %r14d, (%rax)
leaq 0x192d(%rip), %rsi      # 0x459a
movq %rax, %rdi
movl $0x4, %edx
callq 0x3027
movb $0x24, %cl
xorl %eax, %eax
movb %cl, 0xc(%rsp,%rax)
incq %rax
xorl %ecx, %ecx
cmpq $0x4, %rax
jne 0x2c7e
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x3027
leaq 0x18f9(%rip), %rsi      # 0x459f
movq %rbx, %rdi
movl $0x4, %edx
callq 0x3027
leaq 0x18ea(%rip), %rsi      # 0x45a4
movq %rbx, %rdi
movl $0x4, %edx
callq 0x3027
movb $0x10, %cl
xorl %eax, %eax
movb %cl, 0xc(%rsp,%rax)
incq %rax
xorl %ecx, %ecx
cmpq $0x4, %rax
jne 0x2ccb
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x3027
movb $0x1, %cl
xorl %eax, %eax
movb %cl, 0xc(%rsp,%rax)
incq %rax
xorl %ecx, %ecx
cmpq $0x1, %rax
je 0x2cf0
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x3027
xorl %eax, %eax
movswl %r14w, %r14d
movb %r14b, 0xc(%rsp,%rax)
shrl $0x8, %r14d
incq %rax
cmpq $0x1, %rax
je 0x2d13
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x3027
xorl %eax, %eax
movl %ebp, %ecx
movb %cl, 0xc(%rsp,%rax)
sarl $0x8, %ecx
incq %rax
cmpq $0x4, %rax
jne 0x2d3f
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x3027
addl %ebp, %ebp
xorl %eax, %eax
movb %bpl, 0xc(%rsp,%rax)
sarl $0x8, %ebp
incq %rax
cmpq $0x4, %rax
jne 0x2d65
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x3027
movb $0x2, %cl
xorl %eax, %eax
movb %cl, 0xc(%rsp,%rax)
incq %rax
xorl %ecx, %ecx
cmpq $0x1, %rax
je 0x2d8c
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x3027
movb $0x10, %cl
xorl %eax, %eax
movb %cl, 0xc(%rsp,%rax)
incq %rax
xorl %ecx, %ecx
cmpq $0x1, %rax
je 0x2db1
leaq 0xc(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x3027
leaq 0x1848(%rip), %rsi      # 0x4624
movq %rbx, %rdi
movl $0x4, %edx
callq 0x3027
movl $0x0, (%r14)
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x3027
cmpl $0x0, 0x14(%rbx)
je 0x2e12
movq %rbx, %rdi
callq 0x2bfb
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x41cf(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x16fe(%rip), %rsi      # 0x4531
xorl %ebx, %ebx
movq %r15, %rdx
xorl %eax, %eax
callq 0x10c0
jmp 0x2e12
// File: /workspace/github_c_makefile_star2_O1/waywardgeek[P]sonic/wave.c
// Function: closeWaveFile
int closeWaveFile(waveFile file) {
  FILE* soundFile = file->soundFile;
  int passed = 1;

  if (!file->isInput) {
    if (fseek(soundFile, 4, SEEK_SET) != 0) {
      fprintf(stderr, "Failed to seek on input file.\n");
      passed = 0;
    } else {
      /* Now update the file to have the correct size. */
      writeInt(file, file->bytesWritten - 8);
      if (file->failed) {
        fprintf(stderr, "Failed to write wave file size.\n");
        passed = 0;
      }
      if (fseek(soundFile, 40, SEEK_SET) != 0) {
        fprintf(stderr, "Failed to seek on input file.\n");
        passed = 0;
      } else {
        /* Now update the file to have the correct size. */
        writeInt(file, file->bytesWritten - 48);
        if (file->failed) {
          fprintf(stderr, "Failed to write wave file size.\n");
          passed = 0;
        }
      }
    }
  }
  closeFile(file);
  return passed;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x1, %ebp
cmpl $0x0, 0x18(%rdi)
jne 0x2ef0
movq 0x8(%rbx), %r14
xorl %ebp, %ebp
movl $0x4, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1110
testl %eax, %eax
jne 0x2f03
movl 0x10(%rbx), %eax
addl $-0x8, %eax
xorl %ecx, %ecx
movb %al, 0x8(%rsp,%rcx)
sarl $0x8, %eax
incq %rcx
cmpq $0x4, %rcx
jne 0x2e80
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x3027
movl $0x1, %ebp
cmpl $0x0, 0x14(%rbx)
jne 0x2f0a
movl $0x28, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1110
testl %eax, %eax
jne 0x2f13
movl 0x10(%rbx), %eax
addl $-0x30, %eax
xorl %ecx, %ecx
movb %al, 0xc(%rsp,%rcx)
sarl $0x8, %eax
incq %rcx
cmpq $0x4, %rcx
jne 0x2ec8
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x3027
cmpl $0x0, 0x14(%rbx)
jne 0x2f1a
movq %rbx, %rdi
callq 0x2bfb
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x11d4
jmp 0x2ef0
callq 0x11f0
xorl %ebp, %ebp
jmp 0x2ead
callq 0x120c
jmp 0x2f1f
callq 0x1228
xorl %ebp, %ebp
jmp 0x2ef0
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %ecx
movl %ecx, %eax
imull %edx, %eax
cmpl $0x801, %eax            # imm = 0x801
jl 0x2f4f
leal (%rcx,%rcx), %esi
movl $0x1000, %eax           # imm = 0x1000
xorl %edx, %edx
idivl %esi
movl %eax, %edx
xorl %eax, %eax
cmpl $0x0, 0x14(%r14)
jne 0x2f71
imull %edx, %ecx
addl %ecx, %ecx
movslq %ecx, %rdx
movq 0x8(%r14), %rcx
movq %rsp, %rdi
movl $0x1, %esi
callq 0x1050
movl (%r14), %esi
leal (%rsi,%rsi), %ecx
cltd
idivl %ecx
movl %eax, %ecx
imull %esi, %ecx
testl %ecx, %ecx
jle 0x2f96
movl %ecx, %ecx
xorl %edx, %edx
movzwl (%rsp,%rdx,2), %esi
movw %si, (%rbx,%rdx,2)
incq %rdx
cmpl %edx, %ecx
jne 0x2f87
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %rbx
imull (%rdi), %edx
testl %edx, %edx
jle 0x2ffc
movq %rsi, %r14
movl %edx, %r12d
xorl %r13d, %r13d
movq %rsp, %r15
xorl %edx, %edx
cmpl $0x1000, %edx           # imm = 0x1000
jne 0x2fe3
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x3027
xorl %edx, %edx
movzwl (%r14,%r13,2), %eax
movslq %edx, %rcx
leal 0x2(%rcx), %edx
movw %ax, (%rsp,%rcx)
incq %r13
cmpq %r13, %r12
jne 0x2fc9
jmp 0x2ffe
xorl %edx, %edx
testl %edx, %edx
je 0x300d
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x3027
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_O1/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 0x302e
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
movslq %edx, %r15
movq 0x8(%rdi), %rcx
movl $0x1, %esi
movq %rax, %rdi
movq %r15, %rdx
callq 0x1150
movq %rax, %r14
cmpq %r15, %rax
jne 0x3062
addl %r14d, 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x14(%rbx), %rdi
callq 0x1244
jmp 0x3058
// File: /workspace/github_c_makefile_star2_O1/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 0x30c5
leaq 0xd(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x30f5
movslq %r15d, %rax
movb $0x0, 0xd(%rsp,%rax)
movq %r14, %rdi
movq %r12, %rsi
callq 0x10b0
testl %eax, %eax
jne 0x30cc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x126c
jmp 0x30ec
movq 0x3f25(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x1576(%rip), %rsi      # 0x4653
leaq 0xd(%rsp), %rcx
movq %r14, %rdx
xorl %eax, %eax
callq 0x10c0
movl $0x1, 0x14(%rbx)
jmp 0x30b9
// File: /workspace/github_c_makefile_star2_O1/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 0x30fc
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
movslq %edx, %r14
movq 0x8(%rdi), %rcx
movl $0x1, %esi
movq %rax, %rdi
movq %r14, %rdx
callq 0x1050
cmpl %r14d, %eax
jne 0x312a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq $0x14, %rbx
movq %rbx, %rdi
callq 0x1288
jmp 0x3122
// File: /workspace/github_c_makefile_star2_O1/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
leaq -0x34(%rbp), %rbx
leaq 0xe5c(%rip), %r14       # 0x2004
leaq -0x38(%rbp), %r15
leaq 0x2ead(%rip), %r12      # 0x4060
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1080
movl %eax, %r13d
movl $0x401f0002, -0x38(%rbp) # imm = 0x401F0002
movl $0x2, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1050
movl %r13d, %edi
movq %r15, %rsi
movl $0x10, %edx
callq 0x1060
movl 0x7024(%rip), %edx      # 0x8218
movl %r13d, %edi
movq %r12, %rsi
callq 0x1030
movl $0x3, %edi
callq 0x1070
movl %r13d, %edi
callq 0x1040
jmp 0x11b3
// File: /workspace/github_c_makefile_star2_O1/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 0x998a(%rip), %xmm1     # 0xc010
ucomisd %xmm1, %xmm0
jbe 0x26c5
movsd 0x8(%rdi), %xmm1
subsd 0x8(%rsi), %xmm1
andpd 0x9972(%rip), %xmm1     # 0xc010
ucomisd %xmm1, %xmm0
jbe 0x26c5
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_O1/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, %r12
cmpq $0x1, %rdi
adcq $0x0, %r12
movq %rsi, %r14
cmpq $0x1, %rsi
adcq $0x0, %r14
movq %r12, %rax
mulq %r14
seto %cl
cmpq $-0x10, %rax
setae %dl
orb %cl, %dl
jne 0x2983
addq $0x10, %rax
movq %rax, %rdi
callq 0x2150
testq %rax, %rax
je 0x2983
movq %rax, %r15
movq %r12, (%rax)
movq %r14, 0x8(%rax)
imulq %r12, %r14
testq %r14, %r14
je 0x2986
movq %r15, %rdi
addq $0x10, %rdi
movzbl %bl, %esi
movq %r14, %rdx
callq 0x2060
jmp 0x2986
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x29db
movabsq $0x1fffffffffffffff, %rax # imm = 0x1FFFFFFFFFFFFFFF
andq %r12, %rax
xorl %ecx, %ecx
xorl %edx, %edx
divq %r15
cmpq $-0x11, %rdi
ja 0x2a1f
cmpq %r14, %rax
je 0x29e1
jmp 0x2a1f
cmpq $-0x11, %rdi
ja 0x2a1d
addq $0x10, %rdi
callq 0x2150
testq %rax, %rax
je 0x2a1d
movq %rax, %rcx
movq %r15, (%rax)
movq %r14, 0x8(%rax)
testq %rbx, %rbx
leaq 0x96cd(%rip), %rax      # 0xc0d0
cmovneq %rbx, %rax
testq %r12, %r12
je 0x2a1f
xorl %edx, %edx
movq %rax, 0x10(%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %r12
jne 0x2a0e
jmp 0x2a1f
xorl %ecx, %ecx
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/TurkeyMcMac[P]ts3d/src/do-ts3d-game.c
// Function: write_save_state
static int write_save_state(struct save_state *save, const char *state_file,
	struct logger *log, struct menu *menu)
{
	FILE *to = fopen(state_file, "w");
	int ret = 0;
	if (!to || save_state_write(save, to)) {
		int errnum = errno;
		FILE *print = logger_get_output(log, LOGGER_ERROR);
		if (print) {
			logger_printf(log, LOGGER_ERROR,
				"Failed to write state information to %s: %s\n",
				state_file, strerror(errnum));
			logger_printf(log, LOGGER_ERROR,
				"The information is below. Copy this to %s or"
				" to another location (see ts3d -h output):\n",
				state_file);
			save_state_write(save, print);
		}
		menu_set_message(menu, "SAVE ERROR!! QUIT NOW AND READ LOG!");
		beep();
		ret = -1;
	}
	if (to) fclose(to);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r15
leaq 0x7fdf(%rip), %rsi      # 0xc203
movq %r12, %rdi
callq 0x2160
movq %rax, %rbx
testq %rax, %rax
je 0x4247
movq %r15, %rdi
movq %rbx, %rsi
callq 0xa4c1
testl %eax, %eax
je 0x42cc
movq %r14, (%rsp)
callq 0x2320
movl (%rax), %r14d
movq %r13, %rdi
movl $0x4, %esi
callq 0x6d87
testq %rax, %rax
je 0x42b0
movq %rax, %rbp
movl %r14d, %edi
callq 0x2260
leaq 0x7f8e(%rip), %rdx      # 0xc205
movq %r13, %rdi
movl $0x4, %esi
movq %r12, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x6e97
leaq 0x7f9f(%rip), %rdx      # 0xc232
movq %r13, %rdi
movl $0x4, %esi
movq %r12, %rcx
xorl %eax, %eax
callq 0x6e97
movq %r15, %rdi
movq %rbp, %rsi
callq 0xa4c1
leaq 0x7fd3(%rip), %rsi      # 0xc28a
movq (%rsp), %rdi
callq 0x8b42
callq 0x2170
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x42ce
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x42db
movq %rbx, %rdi
callq 0x23e0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x47f1
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2570
movq 0x20(%rbx), %rdi
callq 0x2570
movq %rbx, %rdi
popq %rbx
jmp 0x2570
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq %rsi, %rax
shlq $0x5, %rax
leaq (%rax,%rax,2), %rdi
callq 0xb1ac
movq %rax, (%r14)
movq %rbx, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rdi
callq 0xb1ac
movq %rax, 0x8(%r14)
movq $0x0, 0x10(%r14)
movq %rbx, 0x18(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rax
movq %rcx, (%rsp)
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rdi), %rsi
movq 0x10(%rdi), %r13
movq 0x18(%rdi), %r14
leaq 0x18(%rdi), %rdx
movl $0x60, %ecx
callq 0x4c08
movq %rax, %r12
movq 0x18(%rbx), %rax
cmpq %r14, %rax
je 0x48bb
movq 0x8(%rbx), %rdi
shlq $0x4, %rax
leaq (%rax,%rax,2), %rsi
callq 0xb2d4
movq %rax, 0x8(%rbx)
leaq (,%r13,2), %rcx
addq %r13, %rcx
shlq $0x4, %rcx
addq 0x8(%rbx), %rcx
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq (%rsp), %r8
callq 0x48f5
movq 0x10(%rbx), %rax
decq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4943
callq 0x2490
cltq
xorl %edx, %edx
divq 0x18(%r14)
jmp 0x4945
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 0x76bb(%rip), %xmm1     # 0xc028
mulsd %xmm0, %xmm1
movsd %xmm1, 0x48(%r15)
movsd 0x60(%r14), %xmm1
movsd %xmm1, 0x50(%r15)
movsd 0x68(%r14), %xmm1
movsd %xmm1, 0x58(%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_O1/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 0x4bee
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 0x4b8b
cmpq $0x0, 0x20(%r9,%rdx,2)
jle 0x4b94
ucomisd 0x50(%r9,%rdx,2), %xmm0
jb 0x4bde
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)
incq %r8
movq 0x10(%rax), %rcx
addq $0x30, %rdx
cmpq %rcx, %r8
jb 0x4b74
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rdi, %r15
movq (%rsi), %rax
cmpq (%rdx), %rax
jb 0x4c3d
movq %rax, %rcx
shrq %rcx
leaq (%rax,%rcx), %rsi
incq %rsi
movq %rsi, (%rdx)
movq (%r15), %rdi
imulq %rbx, %rsi
callq 0xb2d4
movq %rax, (%r15)
movq (%r14), %rax
leaq 0x1(%rax), %rcx
imulq %rax, %rbx
addq (%r15), %rbx
movq %rcx, (%r14)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rdi, %rbx
movq (%rsi), %r14
addq %r14, %rcx
movq %rcx, (%rsi)
cmpq (%rdx), %rcx
jbe 0x4c87
movq %rcx, %rax
shrq %rax
leaq (%rcx,%rax), %rsi
incq %rsi
movq %rsi, (%rdx)
movq (%rbx), %rdi
callq 0xb2d4
movq %rax, (%rbx)
addq (%rbx), %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)