LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/ender672[P]liboil/benchmark.c
// Function: do_bench
void do_bench(struct bench_image image, double ratio, int iterations)
{
	int i, out_width, out_height;
	clock_t t_min, t_tmp;

	out_width = round(image.width * ratio);
	out_height = 500000; /* reasonable maximum height */

	oil_fix_ratio(image.width, image.height, &out_width, &out_height);

	t_min = 0;
	for (i=0; i<iterations; i++) {
		t_tmp = resize(image, out_width, out_height);
		if (!t_min || t_tmp < t_min) {
			t_min = t_tmp;
		}
	}

	printf("    to %4dx%4d %6.2fms\n", out_width, out_height, time_to_ms(t_min));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edi, %ebx
leaq 0x50(%rsp), %r15
movl 0x8(%r15), %ebp
movl 0xc(%r15), %r14d
cvtsi2sd %ebp, %xmm1
mulsd %xmm1, %xmm0
callq 0x1060
cvttsd2si %xmm0, %eax
leaq 0x24(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x20(%rsp), %rcx
movl $0x7a120, (%rcx)        # imm = 0x7A120
movl %ebp, %edi
movl %r14d, %esi
callq 0x2d4c
xorl %r14d, %r14d
testl %ebx, %ebx
cmovlel %r14d, %ebx
movl 0x24(%rsp), %esi
movl 0x20(%rsp), %edx
subl $0x1, %ebx
jb 0x31ab
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movupd (%r15), %xmm0
movupd %xmm0, (%rsp)
movl %esi, %edi
movl %edx, %esi
callq 0x304a
cmpq %r14, %rax
movq %r14, %rcx
cmovlq %rax, %rcx
testq %r14, %r14
cmoveq %rax, %rcx
movq %rcx, %r14
jmp 0x316c
cvtsi2sd %r14, %xmm0
divsd 0xf48(%rip), %xmm0      # 0x4100
leaq 0xf99(%rip), %rdi       # 0x4158
movb $0x1, %al
callq 0x10e0
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ender672[P]liboil/benchmark.c
// Function: do_bench_sizes
void do_bench_sizes(char *name, char *path, enum oil_colorspace cs, int iterations)
{
	struct bench_image image;

	image = png(path, cs);

	printf("%dx%d %s\n", image.width, image.height, name);

	do_bench(image, 0.01, iterations);
	do_bench(image, 0.125, iterations);
	do_bench(image, 0.8, iterations);
	do_bench(image, 2.14, iterations);

	free(image.buffer);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %ecx, %ebx
movq %rdi, %r15
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x3296
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
leaq 0xf75(%rip), %rdi       # 0x4170
movq %r15, %rcx
xorl %eax, %eax
callq 0x10e0
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movsd 0xeea(%rip), %xmm0      # 0x4108
movl %ebx, %edi
callq 0x311d
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movsd 0xed2(%rip), %xmm0      # 0x4110
movl %ebx, %edi
callq 0x311d
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movsd 0xeba(%rip), %xmm0      # 0x4118
movl %ebx, %edi
callq 0x311d
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movsd 0xea2(%rip), %xmm0      # 0x4120
movl %ebx, %edi
callq 0x311d
movq (%r14), %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/./stb_image_write.h
// Function: stbi_write_tga
int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data)
{
   int has_alpha = (comp == 2 || comp == 4);
   int colorbytes = has_alpha ? comp-1 : comp;
   int format = colorbytes < 2 ? 3 : 2; // 3 color channels (RGB/RGBA) = 2, 1 color channel (Y/YA) = 3
   return outfile(filename, -1,-1, x, y, comp, 0, (void *) data, has_alpha, 0,
                  "111 221 2222 11", 0,0,format, 0,0,0, 0,0,x,y, (colorbytes+has_alpha)*8, has_alpha*8);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl %ecx, %r9d
movl %esi, %ecx
leal -0x2(%r9), %esi
xorl %eax, %eax
testl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
sete %al
movl %r9d, %r10d
subl %eax, %r10d
xorl %esi, %esi
cmpl $0x2, %r10d
setl %sil
orl $0x2, %esi
leal (,%r9,8), %r10d
movl %r10d, 0x78(%rsp)
movl %edx, 0x70(%rsp)
movl %ecx, 0x68(%rsp)
andl $0x0, 0x60(%rsp)
leaq 0xc5b1(%rip), %r10      # 0x1020f
andl $0x0, 0x58(%rsp)
movq %r10, 0x20(%rsp)
andl $0x0, 0x50(%rsp)
movq %r8, 0x8(%rsp)
andl $0x0, 0x48(%rsp)
movl %eax, 0x10(%rsp)
andl $0x0, 0x40(%rsp)
shll $0x3, %eax
andl $0x0, 0x30(%rsp)
movl %eax, 0x80(%rsp)
andl $0x0, 0x28(%rsp)
movl %esi, 0x38(%rsp)
andl $0x0, 0x18(%rsp)
andl $0x0, (%rsp)
movl %edx, %r8d
xorl %eax, %eax
callq 0x38d2
addq $0x90, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/./stb_image_write.h
// Function: stbiw__write_run_data(_IO_FILE*, int, unsigned char)
void stbiw__write_run_data(FILE *f, int length, unsigned char databyte)
{
   unsigned char lengthbyte = (unsigned char) (length+128);
   STBIW_ASSERT(length+128 <= 255);
   fwrite(&lengthbyte, 1, 1, f);
   fwrite(&databyte, 1, 1, f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpl $0x80, %esi
jge 0x3d8f
movl %edx, %r14d
movq %rdi, %rbx
movsbl %sil, %edi
xorl $-0x80, %edi
movq %rbx, %rsi
callq 0x22e0
movsbl %r14b, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x22e0
leaq 0xc489(%rip), %rdi      # 0x1021f
leaq 0xc494(%rip), %rsi      # 0x10231
leaq 0xc4a1(%rip), %rcx      # 0x10245
movl $0x109, %edx            # imm = 0x109
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/./stb_image_write.h
// Function: stbiw__write_dump_data(_IO_FILE*, int, unsigned char*)
void stbiw__write_dump_data(FILE *f, int length, unsigned char *data)
{
   unsigned char lengthbyte = (unsigned char )(length & 0xff);
   STBIW_ASSERT(length <= 128); // inconsistent with spec but consistent with official code
   fwrite(&lengthbyte, 1, 1, f);
   fwrite(data, length, 1, f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x81, %esi
jge 0x3df0
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
movsbl %r15b, %edi
movq %rbx, %rsi
callq 0x22e0
movslq %r15d, %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2440
leaq 0xc485(%rip), %rdi      # 0x1027c
leaq 0xc433(%rip), %rsi      # 0x10231
leaq 0xc485(%rip), %rcx      # 0x1028a
movl $0x111, %edx            # imm = 0x111
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/./stb_image_write.h
// Function: stbi_write_hdr
int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data)
{
   int i;
   FILE *f;
   if (y <= 0 || x <= 0 || data == NULL) return 0;
   f = fopen(filename, "wb");
   if (f) {
      /* Each component is stored separately. Allocate scratch space for full output scanline. */
      unsigned char *scratch = (unsigned char *) STBIW_MALLOC(x*4);
      fprintf(f, "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n"      );
      fprintf(f, "EXPOSURE=          1.0000000000000\n\n-Y %d +X %d\n"                 , y, x);
      for(i=0; i < y; i++)
         stbiw__write_hdr_scanline(f, x, comp, scratch, data + comp*i*x);
      STBIW_FREE(scratch);
      fclose(f);
   }
   return f != NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, -0x2c(%rbp)
movl %edx, %ebx
testl %edx, %edx
setle %al
movq %rsi, -0x38(%rbp)
testl %esi, %esi
setle %cl
orb %al, %cl
movq %r8, -0x40(%rbp)
testq %r8, %r8
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x41ae
leaq 0xc1b5(%rip), %rsi      # 0x102c4
callq 0x22a0
movq %rax, %r12
testq %rax, %rax
je 0x41a6
movq -0x38(%rbp), %r15
leal (,%r15,4), %edi
callq 0x2300
movq %rax, %r13
leaq 0xc18c(%rip), %rdi      # 0x102c7
pushq $0x41
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rcx
callq 0x2440
leaq 0xc1b9(%rip), %rsi      # 0x10309
xorl %r14d, %r14d
movq %r12, %rdi
movl %ebx, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x2330
movl %ebx, %eax
movl -0x2c(%rbp), %ebx
imull %r15d, %ebx
movl %eax, %r15d
subq $0x1, %r15
jb 0x4196
movslq %r14d, %r14
movq -0x40(%rbp), %rax
leaq (%rax,%r14,4), %r8
movq %r12, %rdi
movq -0x38(%rbp), %rsi
movl -0x2c(%rbp), %edx
movq %r13, %rcx
callq 0x3e0f
addl %ebx, %r14d
jmp 0x416e
movq %r13, %rdi
callq 0x22b0
movq %r12, %rdi
callq 0x2210
xorl %eax, %eax
testq %r12, %r12
setne %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/./stb_image_write.h
// Function: stbiw__sbgrowf(void**, int, int)
static void *stbiw__sbgrowf(void **arr, int increment, int itemsize)
{
   int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1;
   void *p = STBIW_REALLOC(*arr ? stbiw__sbraw(*arr) : 0, itemsize * m + sizeof(int)*2);
   STBIW_ASSERT(p);
   if (p) {
      if (!*arr) ((int *) p)[1] = 0;
      *arr = (void *) ((int *) p + 2);
      stbiw__sbm(*arr) = m;
   }
   return *arr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x48ac
movl -0x8(%rax), %ecx
leal 0x1(,%rcx,2), %r14d
jmp 0x48b0
pushq $0x2
popq %r14
leaq -0x8(%rax), %rdi
testq %rax, %rax
cmoveq %rax, %rdi
imull %r14d, %esi
movslq %esi, %rsi
addq $0x8, %rsi
callq 0x23d0
testq %rax, %rax
je 0x48ec
cmpq $0x0, (%rbx)
jne 0x48da
andl $0x0, 0x4(%rax)
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, (%rbx)
movl %r14d, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xcd9d(%rip), %rdi      # 0x11690
leaq 0xb937(%rip), %rsi      # 0x10231
leaq 0xbd89(%rip), %rcx      # 0x1068a
movl $0x196, %edx            # imm = 0x196
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/./stb_image_write.h
// Function: stbiw__zlib_flushf(unsigned char*, unsigned int*, int*)
static unsigned char *stbiw__zlib_flushf(unsigned char *data, unsigned int *bitbuffer, int *bitcount)
{
   while (*bitcount >= 8) {
      stbiw__sbpush(data, (unsigned char) *bitbuffer);
      *bitbuffer >>= 8;
      *bitcount -= 8;
   }
   return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rax
leaq -0x28(%rbp), %r15
movq %rdi, (%r15)
movl (%rdx), %ecx
pushq $0x1
popq %r12
cmpl $0x8, %ecx
jl 0x4974
testq %rax, %rax
je 0x4945
movl -0x4(%rax), %ecx
leal 0x1(%rcx), %edx
cmpl -0x8(%rax), %edx
jl 0x495a
movq %r15, %rdi
movl %r12d, %esi
callq 0x488d
movq -0x28(%rbp), %rax
movl -0x4(%rax), %ecx
leal 0x1(%rcx), %edx
movb (%r14), %sil
movl %edx, -0x4(%rax)
movslq %ecx, %rcx
movb %sil, (%rax,%rcx)
shrl $0x8, (%r14)
movl (%rbx), %ecx
addl $-0x8, %ecx
movl %ecx, (%rbx)
jmp 0x4930
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/./stb_image_write.h
// Function: stbiw__crc32(unsigned char*, int)
unsigned int stbiw__crc32(unsigned char *buffer, int len)
{
   static unsigned int crc_table[256];
   unsigned int crc = ~0u;
   int i,j;
   if (crc_table[1] == 0)
      for(i=0; i < 256; i++)
         for (crc_table[i]=i, j=0; j < 8; ++j)
            crc_table[i] = (crc_table[i] >> 1) ^ (crc_table[i] & 1 ? 0xedb88320 : 0);
   for (i=0; i < len; ++i)
      crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)];
   return ~crc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x1488c(%rip)     # 0x19294
leaq 0x14881(%rip), %rcx     # 0x19290
je 0x4a3e
xorl %edx, %edx
testl %esi, %esi
cmovlel %edx, %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rdx, %rsi
je 0x4a3a
movzbl %al, %r8d
shrl $0x8, %eax
movzbl (%rdi,%rdx), %r9d
xorl %r9d, %r8d
xorl (%rcx,%r8,4), %eax
incq %rdx
jmp 0x4a1d
notl %eax
popq %rbp
retq
xorl %eax, %eax
movl $0x8, %edx
cmpq $0x100, %rax            # imm = 0x100
je 0x4a11
movl %edx, %r9d
movl %eax, %r8d
subl $0x1, %r9d
jb 0x4a72
movl %r8d, %r10d
shrl %r10d
andl $0x1, %r8d
negl %r8d
andl $0xedb88320, %r8d       # imm = 0xEDB88320
xorl %r10d, %r8d
jmp 0x4a53
movl %r8d, (%rcx,%rax,4)
incq %rax
jmp 0x4a45
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/./stb_image_write.h
// Function: stbi_write_png
int stbi_write_png(char const *filename, int x, int y, int comp, const void *data, int stride_bytes)
{
   FILE *f;
   int len;
   unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len);
   if (!png) return 0;
   f = fopen(filename, "wb");
   if (!f) { STBIW_FREE(png); return 0; }
   fwrite(png, 1, len, f);
   fclose(f);
   STBIW_FREE(png);
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %r9d, %r10d
movl %ecx, %eax
movl %edx, %ecx
movl %esi, %edx
movq %rdi, %r14
leaq -0x14(%rbp), %r9
movq %r8, %rdi
movl %r10d, %esi
movl %eax, %r8d
callq 0x4a7b
testq %rax, %rax
je 0x50cf
movq %rax, %rbx
leaq 0xb225(%rip), %rsi      # 0x102c4
movq %r14, %rdi
callq 0x22a0
testq %rax, %rax
je 0x50d4
movq %rax, %r14
movslq -0x14(%rbp), %rdx
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rcx
callq 0x2440
movq %r14, %rdi
callq 0x2210
pushq $0x1
popq %r14
jmp 0x50d7
xorl %r14d, %r14d
jmp 0x50df
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x22b0
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/./main.h
// Function: strlwr(char*)
char * strlwr(char * string) {
    int length = strlen(string);
    for (int i = 0; i < length; ++i)
    {
        string[i] = tolower(string[i]);
    }
    return string;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2110
movq %rax, %r14
xorl %r15d, %r15d
testl %r14d, %r14d
cmovlel %r15d, %r14d
cmpq %r15, %r14
je 0x5122
movsbl (%rbx,%r15), %edi
callq 0x2340
movb %al, (%rbx,%r15)
incq %r15
jmp 0x510a
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/./main.h
// Function: strupr(char*)
char * strupr(char * string) {
    int length = strlen(string);
    for (int i = 0; i < length; ++i)
    {
        string[i] = toupper(string[i]);
    }
    return string;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2110
movq %rax, %r14
xorl %r15d, %r15d
testl %r14d, %r14d
cmovlel %r15d, %r14d
cmpq %r15, %r14
je 0x5167
movsbl (%rbx,%r15), %edi
callq 0x2410
movb %al, (%rbx,%r15)
incq %r15
jmp 0x514f
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/./stable.h
// Function: StringTable::Get(char const*)
const char * Get(const char *str)
  {
    CharPtrSet::iterator found;
    found = mStrings.find( str );
    if ( found != mStrings.end() ) return (*found);
    int l = strlen(str);
    char *mem = new char[l+1];
    strcpy(mem,str);
    mStrings.insert( mem );
    return mem;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq -0x20(%rbp), %rax
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x5c1e
leaq 0x8(%rbx), %rcx
cmpq %rcx, %rax
je 0x5bdc
movq 0x20(%rax), %rax
jmp 0x5c12
movq -0x20(%rbp), %r14
movq %r14, %rdi
callq 0x2110
incl %eax
movslq %eax, %rdi
callq 0x2040
leaq -0x28(%rbp), %r15
movq %rax, (%r15)
movq %rax, %rdi
movq %r14, %rsi
callq 0x21f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5ca8
movq (%r15), %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/arglist.cpp
// Function: TranslateEscapedChar(int)
int TranslateEscapedChar( int ch )
{
  switch( ch )
  {
  case 't':
    ch = '\t';
    break;
  case 'n':
    ch = '\n';
    break;
  case 'f':
    ch = '\f';
    break;
  }
  return ch;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x66, %edi
je 0x5f93
movl %edi, %eax
cmpl $0x6e, %edi
je 0x5f8c
cmpl $0x74, %eax
jne 0x5f98
movl $0x9, %eax
jmp 0x5f98
movl $0xa, %eax
jmp 0x5f98
movl $0xc, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/arglist.cpp
// Function: ZNK7ArgListcvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEv
ArgList::operator String ( void ) const
{
  CharVector result;

  result.clear();
  for(unsigned int argc = 0; argc < mArgs.size(); ++argc )
  {
    if( argc != 0 )
    {
      result.push_back( ' ' );
    }

    if( mArgs[argc].size() != 0 )
    {
      for(unsigned int index = 0; index < mArgs[argc].size(); ++index )
      {
        const String &foo = mArgs[argc];
        int ch = foo[index];

        assert( ch != '\0' );
        if( isspace( ch ) || ch == '"' || ch == '\\' )
        {
          result.push_back( '\\' );
        }
        result.push_back( ch );
      }
    }
    else
    {
      result.push_back( '"' );
      result.push_back( '"' );
    }
  }
  return String( &result[0], result.size() );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, -0x38(%rbp)
movq %rdi, -0x40(%rbp)
leaq -0x60(%rbp), %r13
andq $0x0, 0x10(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, (%r13)
xorl %r15d, %r15d
leaq -0x29(%rbp), %r14
movl %r15d, %r15d
movq -0x38(%rbp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %r15, %rcx
jbe 0x6392
testq %r15, %r15
je 0x62e8
movb $0x20, -0x29(%rbp)
movq %r13, %rdi
movq %r14, %rsi
callq 0x6a34
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %r15, %rbx
shlq $0x5, %rbx
cmpq $0x0, 0x8(%rax,%rbx)
movq %r15, -0x48(%rbp)
je 0x6368
xorl %r15d, %r15d
movl %r15d, %r15d
cmpq %r15, 0x8(%rax,%rbx)
jbe 0x6386
movq %r13, %r12
addq %rbx, %rax
movq (%rax), %rax
movsbl (%rax,%r15), %r13d
testl %r13d, %r13d
je 0x63c8
movl %r13d, %edi
callq 0x2060
testl %eax, %eax
je 0x6358
movb $0x5c, -0x29(%rbp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x6a34
movb %r13b, -0x29(%rbp)
movq %r12, %r13
movq %r12, %rdi
movq %r14, %rsi
callq 0x6a34
incl %r15d
movq -0x38(%rbp), %rax
movq (%rax), %rax
jmp 0x62fe
movzbl %r13b, %eax
cmpl $0x5c, %eax
je 0x632b
cmpl $0x22, %eax
je 0x632b
jmp 0x633a
movb $0x22, -0x29(%rbp)
movq %r13, %rdi
movq %r14, %rsi
callq 0x6a34
movb $0x22, -0x29(%rbp)
movq %r13, %rdi
movq %r14, %rsi
callq 0x6a34
movq -0x48(%rbp), %r15
incl %r15d
jmp 0x62af
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x40(%rbp), %rbx
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x5ed0
leaq -0x60(%rbp), %rdi
callq 0x6820
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa75d(%rip), %rdi      # 0x10b2c
leaq 0xa761(%rip), %rsi      # 0x10b37
leaq 0xa766(%rip), %rcx      # 0x10b43
movl $0xf2, %edx
callq 0x2180
jmp 0x63f1
jmp 0x63f1
jmp 0x63f1
jmp 0x63f1
jmp 0x63f1
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x6820
movq %rbx, %rdi
callq 0x23e0
nop
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/fload.cpp
// Function: Fload::Fload(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Fload::Fload(const String& fname)
{
  mName = SGET( fname );
  mData = 0;
  mLen = 0;

  FILE *fph = fopen( mName, "rb");
  if ( fph )
  {
    fseek(fph, 0L, SEEK_END);
    mLen = ftell(fph);
    if ( mLen )
    {
      fseek(fph, 0L, SEEK_SET);
      mData = (void *) new unsigned char[mLen+1];
      assert( mData );
      if ( mData )
      {
        int r = fread(mData, mLen, 1, fph);
        assert( r );
        if ( !r )
        {
          delete (char *) mData;
          mData = 0;
        }
		((char *)mData)[mLen]=0;
      }
    }
    fclose(fph);
  }
  mReadLoc = (char *)mData;
  mReadLen = mLen;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x9fef(%rip), %rax      # 0x10bb2
movq %rax, (%rdi)
callq 0x5aca
movq (%r14), %rsi
movq %rax, %rdi
callq 0x5bae
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
andl $0x0, 0x10(%rbx)
leaq 0x95ff(%rip), %rsi      # 0x101e8
movq %rax, %rdi
callq 0x22a0
testq %rax, %rax
je 0x6c5b
movq %rax, %r14
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x2270
movq %r14, %rdi
callq 0x2030
movl %eax, 0x10(%rbx)
testl %eax, %eax
je 0x6c53
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2270
movslq 0x10(%rbx), %r15
leaq 0x1(%r15), %rdi
callq 0x2040
movq %rax, 0x8(%rbx)
pushq $0x1
popq %rdx
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x2360
testl %eax, %eax
je 0x6c74
movq 0x8(%rbx), %rax
movslq 0x10(%rbx), %rcx
movb $0x0, (%rax,%rcx)
movq %r14, %rdi
callq 0x2210
movq 0x8(%rbx), %rax
movq %rax, 0x18(%rbx)
movl 0x10(%rbx), %eax
movl %eax, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa91e(%rip), %rdi      # 0x11599
leaq 0x9f09(%rip), %rsi      # 0x10b8b
leaq 0x9f0c(%rip), %rcx      # 0x10b95
pushq $0x2e
popq %rdx
callq 0x2180
nop
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/fload.cpp
// Function: Fload::GetString()
char * Fload::GetString(void)
{
  if ( !mReadLoc )
  {
    return 0;
  }

  // now advance read pointer to end of string and stomp a zero
  // byte on top of it as a null string terminator.
  while ( *mReadLoc == 0 || *mReadLoc == 10 || *mReadLoc == 13 )
  {
    mReadLoc++;
    mReadLen--;
    if ( !mReadLen )
    {
      mReadLoc = 0;
      return 0;
    }
  }

  char *ret = mReadLoc; // current read location is string location

  while ( *mReadLoc && *mReadLoc != 10 && *mReadLoc != 13 )
  {
    mReadLoc++;
    mReadLen--;
    if ( !mReadLen )
    {
      mReadLoc = 0;
      break;
    }
  }

  if ( mReadLen ) *mReadLoc = 0; // replace line feeds with null terminated strings.

  if ( mReadLoc ) mReadLoc++;
  mReadLen--;

  if ( !mReadLen )
  {
    mReadLoc = 0;
  }
  return ret;
}

// Assembly:
movq 0x18(%rdi), %rcx
testq %rcx, %rcx
je 0x6d03
pushq %rbp
movq %rsp, %rbp
pushq %rbx
movl 0x20(%rdi), %edx
leal -0x1(%rdx), %esi
movabsq $0x1, %r9
xorl %eax, %eax
movl $0x2401, %r11d          # imm = 0x2401
xorl %r8d, %r8d
movzbl -0x1(%rcx,%r9), %r10d
cmpl $0xd, %r10d
ja 0x6d06
btl %r10d, %r11d
jae 0x6d06
leaq (%rcx,%r9), %r10
movq %r10, 0x18(%rdi)
movl %esi, 0x20(%rdi)
decq %r8
incq %r9
addl $-0x1, %esi
jb 0x6cd3
andq $0x0, 0x18(%rdi)
popq %rbx
popq %rbp
retq
xorl %eax, %eax
retq
movl %edx, %r9d
negl %r9d
movq %rcx, %rax
subq %r8, %rax
negq %r8
movl $0x2401, %r11d          # imm = 0x2401
cmpb $0xd, %r10b
ja 0x6d2b
movzbl %r10b, %r10d
btl %r10d, %r11d
jb 0x6d4c
leaq (%rcx,%r8), %r10
incq %r10
movq %r10, 0x18(%rdi)
leal (%r9,%r8), %ebx
movl %esi, 0x20(%rdi)
cmpl $-0x1, %ebx
je 0x6d65
movb (%r10), %r10b
incq %r8
decl %esi
jmp 0x6d1b
addq %r8, %rcx
cmpl %edx, %r8d
je 0x6d60
movb $0x0, (%rcx)
movq 0x18(%rdi), %rcx
testq %rcx, %rcx
je 0x6d6b
incq %rcx
jmp 0x6d67
xorl %ecx, %ecx
movq %rcx, 0x18(%rdi)
decl 0x20(%rdi)
jne 0x6d00
jmp 0x6cfb
nop
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/patch.cpp
// Function: PatchSurface::FillPatch(int, int, int, int, LightMapVertex*)
void PatchSurface::FillPatch(int controlx,int controly,int sizex,int sizey,LightMapVertex *p)
{
  int stepx = (sizex-1) / (controlx-1);
  for (int u = 0; u < sizex; u += stepx)
  {
  	FillCurve(controly, sizey,sizex,p+u);
  }
  for (int v = 0; v < sizey; v++)
  {
  	FillCurve(controlx, sizex, 1, p + v * sizex);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r15
movl %r8d, -0x2c(%rbp)
movl %ecx, %r14d
movl %edx, -0x30(%rbp)
leal -0x1(%r14), %eax
movq %rsi, -0x48(%rbp)
leal -0x1(%rsi), %ecx
cltd
idivl %ecx
movslq %eax, %rcx
movslq %r14d, %rax
movq %rax, -0x38(%rbp)
movq %rcx, %r12
imulq $0x28, %rcx, %rax
movq %rax, -0x40(%rbp)
xorl %r13d, %r13d
movq %r9, %rbx
cmpq -0x38(%rbp), %r13
jge 0x715d
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
movl %r14d, %ecx
movq %rbx, %r8
callq 0x72fe
addq %r12, %r13
addq -0x40(%rbp), %rbx
jmp 0x713d
xorl %ebx, %ebx
movl -0x2c(%rbp), %eax
testl %eax, %eax
cmovgl %eax, %ebx
imulq $0x28, -0x38(%rbp), %r13
pushq $0x1
popq %r12
subq $0x1, %rbx
jb 0x718d
movq -0x48(%rbp), %rsi
movl %r14d, %edx
movl %r12d, %ecx
movq %r15, %r8
callq 0x72fe
addq %r13, %r15
jmp 0x7170
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/patch.cpp
// Function: PatchSurface::FindLevel(Vector3d<float> const&, Vector3d<float> const&, Vector3d<float> const&) const
int PatchSurface::FindLevel(const Vector3d<float> &cv0,
                            const Vector3d<float> &cv1,
                            const Vector3d<float> &cv2) const
{
  int level;
  Vector3d<float> a,b,dist;

  Vector3d<float> v0 = cv0; // init control points.
  Vector3d<float> v1 = cv1;
  Vector3d<float> v2 = cv2;

  /* Subdivide on the left until tolerance is reached */
  for (level=0; level <MAXMESHLEVEL-1; level++)
  {
	  /* Subdivide on the left */
    a.Lerp(v0,v1,0.5f);
    b.Lerp(v1,v2,0.5f);
    v2.Lerp(a,b,0.5f);

	  /* Find distance moved */
    dist = v2-v1;

    float dist2 = dist.x*dist.x + dist.y*dist.y + dist.z*dist.z;
    if ( dist2 < MINDIST ) break;

	  /* Insert new middle vertex */
    v1 = a;
  }

  return level;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movss (%rsi), %xmm0
leaq -0x58(%rbp), %rax
movss %xmm0, (%rax)
movss 0x4(%rsi), %xmm0
movss %xmm0, 0x4(%rax)
movss 0x8(%rsi), %xmm0
movss %xmm0, 0x8(%rax)
movss (%rdx), %xmm0
leaq -0x34(%rbp), %r14
movss %xmm0, (%r14)
movss 0x4(%rdx), %xmm0
movss %xmm0, 0x4(%r14)
movss 0x8(%rdx), %xmm0
movss %xmm0, 0x8(%r14)
movss (%rcx), %xmm0
leaq -0x40(%rbp), %r15
movss %xmm0, (%r15)
movss 0x4(%rcx), %xmm0
movss %xmm0, 0x4(%r15)
movss 0x8(%rcx), %xmm0
movss %xmm0, 0x8(%r15)
xorl %r12d, %r12d
leaq -0x4c(%rbp), %r13
leaq -0x64(%rbp), %rbx
cmpl $0x4, %r12d
je 0x72ec
movq %r13, %rdi
leaq -0x58(%rbp), %rsi
movq %r14, %rdx
movss 0x9956(%rip), %xmm0     # 0x10bb8
callq 0x7558
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movss 0x9940(%rip), %xmm0     # 0x10bb8
callq 0x7558
movq %r15, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movss 0x992a(%rip), %xmm0     # 0x10bb8
callq 0x7558
movss -0x40(%rbp), %xmm0
movss -0x3c(%rbp), %xmm1
subss -0x34(%rbp), %xmm0
subss -0x30(%rbp), %xmm1
movss -0x38(%rbp), %xmm2
subss -0x2c(%rbp), %xmm2
mulss %xmm1, %xmm1
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
mulss %xmm2, %xmm2
addss %xmm0, %xmm2
movss 0x98ef(%rip), %xmm0     # 0x10bbc
ucomiss %xmm2, %xmm0
ja 0x72ec
movss -0x4c(%rbp), %xmm0
movss %xmm0, -0x34(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x30(%rbp)
incl %r12d
jmp 0x7246
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/patch.cpp
// Function: PatchSurface::FillCurve(int, int, int, LightMapVertex*)
void PatchSurface::FillCurve(int numcp, int size, int stride,LightMapVertex *p)
{
  int step, halfstep, i, mid;
  LightMapVertex a,b;

  step = (size-1) / (numcp-1);

  while (step > 0)
  {
	  halfstep = step / 2;
  	for (i=0; i < size-1; i += step*2)
	  {
	    mid = (i+step)*stride;
      a.Lerp(p[i*stride],p[mid],0.5f);
      b.Lerp(p[mid],p[(i+step*2)*stride],0.5f);
      p[mid].Lerp(a,b,0.5f);

//	    vec_avg(p[i*stride], p[mid], a);
//	    vec_avg(p[mid], p[(i+step*2)*stride], b);
//	    vec_avg(a, b, p[mid]);

	    if (halfstep > 0)
	    {
		    p[(i+halfstep)*stride]   = a;
    		p[(i+3*halfstep)*stride] = b;
	    }
	  }
  	step /= 2;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r8, -0x38(%rbp)
movl %edx, %edi
decl %edi
decl %esi
movl %edi, %eax
cltd
idivl %esi
movl %eax, %r12d
movslq %edi, %rdx
movq %rdx, -0x70(%rbp)
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
movq %rcx, -0x30(%rbp)
testl %r12d, %r12d
jle 0x74f9
movl %r12d, %edx
shrl %edx
leal (%r12,%r12), %ecx
leal (%rdx,%rdx,2), %esi
movslq %ecx, %rdi
movl %r12d, %r8d
movq -0x30(%rbp), %rcx
imulq %rcx, %r8
movq %r8, -0x60(%rbp)
movq %rcx, %r8
movq %rdi, -0x68(%rbp)
imulq %rdi, %r8
movq %r8, -0x58(%rbp)
movq %rdx, -0x40(%rbp)
imulq %rcx, %rdx
addq $0x24, %rdx
movq %rdx, -0x48(%rbp)
imulq %rcx, %rsi
addq $0x24, %rsi
movq %rsi, -0x50(%rbp)
movq -0x38(%rbp), %r13
xorl %ecx, %ecx
cmpq -0x70(%rbp), %rcx
jge 0x74ed
movq %rcx, -0x78(%rbp)
movq -0x60(%rbp), %rcx
leaq (%rcx,%r13), %r15
leaq -0xa0(%rbp), %rdi
movq %r13, %rsi
movq %r15, %rdx
movss 0x97ff(%rip), %xmm0     # 0x10bb8
callq 0x75ca
movq -0x58(%rbp), %rax
leaq (%rax,%r13), %rbx
leaq -0xc8(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movss 0x97da(%rip), %xmm0     # 0x10bb8
callq 0x75ca
movq %r15, %rdi
leaq -0xa0(%rbp), %rsi
movq %r14, %rdx
movss 0x97c0(%rip), %xmm0     # 0x10bb8
callq 0x75ca
cmpl $0x1, %r12d
je 0x74dd
movss -0xa0(%rbp), %xmm0
movq -0x48(%rbp), %rdx
movss %xmm0, -0x24(%r13,%rdx)
movss -0x9c(%rbp), %xmm0
movss %xmm0, -0x20(%r13,%rdx)
movss -0x98(%rbp), %xmm0
movss %xmm0, -0x1c(%r13,%rdx)
leaq -0x94(%rbp), %rcx
movups (%rcx), %xmm0
movups %xmm0, -0x18(%r13,%rdx)
movss -0x84(%rbp), %xmm0
movss %xmm0, -0x8(%r13,%rdx)
movss -0x80(%rbp), %xmm0
movss %xmm0, -0x4(%r13,%rdx)
movss -0x7c(%rbp), %xmm0
movss %xmm0, (%r13,%rdx)
movss -0xc8(%rbp), %xmm0
movq -0x50(%rbp), %rdx
movss %xmm0, -0x24(%r13,%rdx)
movss -0xc4(%rbp), %xmm0
movss %xmm0, -0x20(%r13,%rdx)
movss -0xc0(%rbp), %xmm0
movss %xmm0, -0x1c(%r13,%rdx)
leaq -0xbc(%rbp), %rcx
movups (%rcx), %xmm0
movups %xmm0, -0x18(%r13,%rdx)
movss -0xac(%rbp), %xmm0
movss %xmm0, -0x8(%r13,%rdx)
movss -0xa8(%rbp), %xmm0
movss %xmm0, -0x4(%r13,%rdx)
movss -0xa4(%rbp), %xmm0
movss %xmm0, (%r13,%rdx)
movq -0x78(%rbp), %rcx
addq -0x68(%rbp), %rcx
movq %rbx, %r13
jmp 0x738e
movq -0x40(%rbp), %rax
movl %eax, %r12d
jmp 0x7336
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/./vformat.h
// Function: LightMapVertex::Lerp(LightMapVertex const&, LightMapVertex const&, float)
void Lerp(const LightMapVertex &a,const LightMapVertex &b,float p)
  {
    mPos.Lerp(a.mPos,b.mPos,p);
    mTexel1.Lerp(a.mTexel1,b.mTexel1,p);
    mTexel2.Lerp(a.mTexel2,b.mTexel2,p);
    mColor.Lerp(a.mColor,b.mColor,p);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movss %xmm0, -0x1c(%rbp)
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x7558
leaq 0xc(%r15), %rdi
leaq 0xc(%r14), %rsi
leaq 0xc(%rbx), %rdx
movss -0x1c(%rbp), %xmm0
callq 0x763c
leaq 0x14(%r15), %rdi
leaq 0x14(%r14), %rsi
leaq 0x14(%rbx), %rdx
movss -0x1c(%rbp), %xmm0
callq 0x763c
addq $0x1c, %r15
addq $0x1c, %r14
addq $0x1c, %rbx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movss -0x1c(%rbp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7558
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/./vector.h
// Function: Vector2d<float>::Lerp(Vector2d<float> const&, Vector2d<float> const&, float)
void Lerp(const Vector2d<Type>& from,const Vector2d<Type>& to,float slerp)
  {
    x = to.x - from.x;
    y = to.y - from.y;
    x*=slerp;
    y*=slerp;
    x+=from.x;
    y+=from.y;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movss (%rdx), %xmm1
movss 0x4(%rdx), %xmm2
subss (%rsi), %xmm1
subss 0x4(%rsi), %xmm2
mulss %xmm0, %xmm1
movss %xmm1, (%rdi)
mulss %xmm0, %xmm2
movss %xmm2, 0x4(%rdi)
addss (%rsi), %xmm1
movss %xmm1, (%rdi)
addss 0x4(%rsi), %xmm2
movss %xmm2, 0x4(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/q3bsp.cpp
// Function: QuakeHeader::SetHeader(void const*)
bool QuakeHeader::SetHeader(const void *mem)  // returns true if valid quake header.
{
  const int *ids = (const int *) mem;
  #define BSPHEADERID  (*(int*)"IBSP")
  #define BSPVERSION 46
  if ( ids[0] != BSPHEADERID ) return false;
  if ( ids[1] != BSPVERSION ) return false;
  mId      = ids[0];
  mVersion = ids[1];
  const QuakeLump *lump = (const QuakeLump *) &ids[2];
  for (int i=0; i<NUM_LUMPS; i++) mLumps[i] = *lump++;
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x50534249, (%rsi)     # imm = 0x50534249
jne 0x7a0f
cmpl $0x2e, 0x4(%rsi)
jne 0x7a0f
movl $0x50534249, (%rdi)     # imm = 0x50534249
movl 0x4(%rsi), %eax
movl %eax, 0x4(%rdi)
movabsq $0x1, %rax
cmpq $0x12, %rax
je 0x7a13
movq (%rsi,%rax,8), %rcx
movq %rcx, (%rdi,%rax,8)
incq %rax
jmp 0x79fc
xorl %eax, %eax
jmp 0x7a15
movb $0x1, %al
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/q3bsp.cpp
// Function: Quake3BSP::ReadFaces(void const*)
void Quake3BSP::ReadFaces(const void *mem)
{
  assert( mOk );
  int lsize;
  int lcount;
  const int *faces = (const int *) mHeader.LumpInfo(Q3_FACES,mem,lsize,lcount);
  assert( lsize == sizeof(int)*26 );

  mFaces.clear();
  mFaces.reserve( lcount );

  for (int i=0; i<lcount; i++)
  {
    QuakeFace f(faces);

    mFaces.push_back(f);

    faces+=26;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
cmpb $0x0, (%rdi)
je 0x7acd
movq %rsi, %rdx
movq %rdi, %r15
addq $0x18, %rdi
pushq $0xd
popq %rsi
leaq -0x28(%rbp), %r14
leaq -0x24(%rbp), %r8
movq %r14, %rcx
callq 0x8482
cmpl $0x68, (%r14)
jne 0x7aec
movq %rax, %rbx
leaq 0xa8(%r15), %r14
movq 0xa8(%r15), %rax
cmpq %rax, 0xb0(%r15)
je 0x7a7b
movq %rax, 0xb0(%r15)
movslq -0x24(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x9632
xorl %r12d, %r12d
testl %r15d, %r15d
cmovgl %r15d, %r12d
leaq -0x94(%rbp), %r15
subl $0x1, %r12d
jb 0x7abd
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8616
movq %r14, %rdi
movq %r15, %rsi
callq 0x96d2
addq $0x68, %rbx
jmp 0x7a9b
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9139(%rip), %rdi      # 0x10c0d
leaq 0x9136(%rip), %rsi      # 0x10c11
leaq 0x9349(%rip), %rcx      # 0x10e2b
movl $0x171, %edx            # imm = 0x171
callq 0x2180
leaq 0x9360(%rip), %rdi      # 0x10e53
leaq 0x9117(%rip), %rsi      # 0x10c11
leaq 0x932a(%rip), %rcx      # 0x10e2b
movl $0x175, %edx            # imm = 0x175
callq 0x2180
nop
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/q3bsp.cpp
// Function: Quake3BSP::ReadElements(void const*)
void Quake3BSP::ReadElements(const void *mem)
{
  assert( mOk );
  int lsize;
  int lcount;
  // LUMP_DRAWINDEXES
  const int *elements = (const int *) mHeader.LumpInfo(Q3_ELEMS,mem,lsize,lcount);
  assert( lsize == sizeof(int) );

  mElements.clear();
  mElements.reserve( lcount );

  for (int i=0; i<lcount; i++)
  {
    unsigned short ic = (unsigned short)(*elements);
    mElements.push_back(ic);
    elements++;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpb $0x0, (%rdi)
je 0x7bbe
movq %rsi, %rdx
movq %rdi, %r15
addq $0x18, %rdi
pushq $0xb
popq %rsi
leaq -0x34(%rbp), %r14
leaq -0x30(%rbp), %r8
movq %r14, %rcx
callq 0x8482
cmpl $0x4, (%r14)
jne 0x7bdd
movq %rax, %rbx
leaq 0xf0(%r15), %r14
movq 0xf0(%r15), %rax
cmpq %rax, 0xf8(%r15)
je 0x7b6e
movq %rax, 0xf8(%r15)
movslq -0x30(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x9802
xorl %r12d, %r12d
testl %r15d, %r15d
movl $0x0, %r13d
cmovgl %r15d, %r13d
leaq -0x2a(%rbp), %r15
cmpl %r12d, %r13d
je 0x7baf
movzwl (%rbx,%r12,4), %eax
movw %ax, -0x2a(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x9896
incq %r12
jmp 0x7b91
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9048(%rip), %rdi      # 0x10c0d
leaq 0x9045(%rip), %rsi      # 0x10c11
leaq 0x9311(%rip), %rcx      # 0x10ee4
movl $0x1cf, %edx            # imm = 0x1CF
callq 0x2180
leaq 0x932b(%rip), %rdi      # 0x10f0f
leaq 0x9026(%rip), %rsi      # 0x10c11
leaq 0x92f2(%rip), %rcx      # 0x10ee4
movl $0x1d4, %edx            # imm = 0x1D4
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/q3bsp.cpp
// Function: Quake3BSP::ReadVertices(void const*)
void Quake3BSP::ReadVertices(const void *mem)
{
  assert( mOk );
  int lsize;
  int lcount;
  const int *vertices = (const int *) mHeader.LumpInfo(Q3_VERTS,mem,lsize,lcount);
  assert( lsize == sizeof(int)*11 );

  mVertices.clear();
  mVertices.reserve( lcount );

  mBound.InitMinMax();

  for (int i=0; i<lcount; i++)
  {
    QuakeVertex v(vertices);

    #define RECIP (1.0f/45.0f)

    v.mPos.x*=RECIP;
    v.mPos.y*=-RECIP;
    v.mPos.z*=RECIP;

    mBound.MinMax(v.mPos);
    mVertices.push_back(v);
    vertices+=11;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
cmpb $0x0, (%rdi)
je 0x7d1f
movq %rsi, %rdx
movq %rdi, %r12
addq $0x18, %rdi
pushq $0xa
popq %rsi
leaq -0x3c(%rbp), %r14
leaq -0x2c(%rbp), %r8
movq %r14, %rcx
callq 0x8482
cmpl $0x2c, (%r14)
jne 0x7d3e
movq %rax, %rbx
leaq 0xc0(%r12), %r14
movq 0xc0(%r12), %rax
cmpq %rax, 0xc8(%r12)
je 0x7c62
movq %rax, 0xc8(%r12)
movslq -0x2c(%rbp), %rsi
movq %rsi, -0x38(%rbp)
movq %r14, %rdi
callq 0x970e
leaq 0x108(%r12), %r15
movaps 0x8f5f(%rip), %xmm0     # 0x10be0
movups %xmm0, 0x108(%r12)
xorl %r13d, %r13d
movq -0x38(%rbp), %rax
testl %eax, %eax
cmovgl %eax, %r13d
movabsq $-0x319194d7319194d8, %rax # imm = 0xCE6E6B28CE6E6B28
movq %rax, 0x118(%r12)
leaq -0x68(%rbp), %r12
subl $0x1, %r13d
jb 0x7d10
movq %r12, %rdi
movq %rbx, %rsi
callq 0x881a
movss -0x68(%rbp), %xmm0
movss 0x8f25(%rip), %xmm1     # 0x10bf0
mulss %xmm1, %xmm0
movss %xmm0, -0x68(%rbp)
movss -0x64(%rbp), %xmm0
mulss 0x8f13(%rip), %xmm0     # 0x10bf4
movss %xmm0, -0x64(%rbp)
movss -0x60(%rbp), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, -0x60(%rbp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x97ae
movq %r14, %rdi
movq %r12, %rsi
callq 0x97c6
addq $0x2c, %rbx
jmp 0x7cad
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8ee7(%rip), %rdi      # 0x10c0d
leaq 0x8ee4(%rip), %rsi      # 0x10c11
leaq 0x9137(%rip), %rcx      # 0x10e6b
movl $0x186, %edx            # imm = 0x186
callq 0x2180
leaq 0x9151(%rip), %rdi      # 0x10e96
leaq 0x8ec5(%rip), %rsi      # 0x10c11
leaq 0x9118(%rip), %rcx      # 0x10e6b
movl $0x18a, %edx            # imm = 0x18A
callq 0x2180
nop
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/q3bsp.cpp
// Function: Quake3BSP::ReadLightmaps(void const*)
void Quake3BSP::ReadLightmaps(const void *mem)
{
  assert( mOk );

  int lsize;
  int lcount;
  const unsigned char *maps = (const unsigned char *) mHeader.LumpInfo(Q3_LIGHTMAPS,mem,lsize,lcount);
  unsigned char *lmaps = new unsigned char[lcount];
  memcpy(lmaps,maps,lcount);

  for (int j=0; j<lcount; j++)
  {
    unsigned int c = lmaps[j];
    lmaps[j] = (unsigned char) c;
  }

  #define LMWID 128
  #define LMHIT 128
  #define LMSIZE (LMWID*LMHIT*3)

  int texcount = lcount / LMSIZE;

  unsigned char *map = lmaps;

  for (int i=0; i<texcount; i++)
  {
    char scratch[256];
    sprintf(scratch,"%slm%s%02d",mLmPrefix.Get(),mCodeName.Get(),i);
    String sname = scratch;
    if (mUsePng) {
      String bname = sname+".png";
      stbi_write_png(bname.c_str(), LMWID, LMHIT, 3, map, LMWID*3);
    } else {
      String bname = sname+".bmp";
      stbi_write_bmp(bname.c_str(), LMWID, LMHIT, 3, map);
    }
    map+=LMSIZE;
  }


  delete lmaps;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
cmpb $0x0, (%rdi)
je 0x7ebe
movq %rsi, %rdx
movq %rdi, %rbx
addq $0x18, %rdi
pushq $0xe
popq %rsi
leaq -0x40(%rbp), %rcx
leaq -0x3c(%rbp), %r14
movq %r14, %r8
callq 0x8482
movq %rax, %r15
movslq (%r14), %r14
movq %r14, %rdi
callq 0x2040
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x21c0
movl $0xc000, %ecx           # imm = 0xC000
movl %r14d, %eax
cltd
idivl %ecx
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movl %eax, -0x2c(%rbp)
leaq -0x80(%rbp), %r12
movq %r13, -0x38(%rbp)
xorl %r15d, %r15d
cmpl %r15d, -0x2c(%rbp)
je 0x7ea0
movq 0x10(%rbx), %rcx
movq 0x1f0(%rbx), %rdx
leaq -0x180(%rbp), %r14
movq %r14, %rdi
leaq 0x924c(%rip), %rsi      # 0x11049
movl %r15d, %r8d
xorl %eax, %eax
callq 0x2080
movq %r12, %rdi
movq %r14, %rsi
leaq -0x60(%rbp), %r14
movq %r14, %rdx
callq 0x5b0c
cmpb $0x1, 0x1e8(%rbx)
jne 0x7e55
movq %r14, %rdi
movq %r12, %rsi
leaq 0x90ab(%rip), %rdx      # 0x10eda
callq 0x5b47
movq -0x60(%rbp), %rdi
movl $0x80, %esi
movl $0x80, %edx
pushq $0x3
popq %rcx
movq %r13, %r8
movl $0x180, %r9d            # imm = 0x180
callq 0x5067
jmp 0x7e80
movq %r14, %rdi
movq %r12, %rsi
leaq 0x907d(%rip), %rdx      # 0x10edf
callq 0x5b47
movq -0x60(%rbp), %rdi
movl $0x80, %esi
movl $0x80, %edx
pushq $0x3
popq %rcx
movq %r13, %r8
callq 0x380c
leaq -0x60(%rbp), %rdi
callq 0x2120
addq $0xc000, %r13           # imm = 0xC000
movq %r12, %rdi
callq 0x2120
incl %r15d
jmp 0x7dd7
pushq $0x1
popq %rsi
movq -0x38(%rbp), %rdi
callq 0x2230
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8d48(%rip), %rdi      # 0x10c0d
leaq 0x8d45(%rip), %rsi      # 0x10c11
leaq 0x8fdb(%rip), %rcx      # 0x10eae
movl $0x1a3, %edx            # imm = 0x1A3
callq 0x2180
jmp 0x7edf
movq %rax, %rbx
jmp 0x7ef2
jmp 0x7ee6
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x2120
leaq -0x80(%rbp), %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x23e0
nop
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/q3bsp.cpp
// Function: Quake3BSP::ReadShaders(void const*)
void Quake3BSP::ReadShaders(const void *mem)
{
  assert( mOk );
  int lsize;
  int lcount;

  const unsigned char *smem = (const unsigned char *) mHeader.LumpInfo(Q3_SHADERREFS,mem,lsize,lcount);

  mShaders.clear();
  mShaders.reserve( lcount );

  for (int i=0; i<lcount; i++)
  {
    ShaderReference s(smem);
    mShaders.push_back(s);
    smem+=lsize;
  }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
cmpb $0x0, (%rdi)
je 0x7fcd
movq %rsi, %rdx
movq %rdi, %r15
addq $0x18, %rdi
pushq $0x1
popq %rsi
leaq -0x30(%rbp), %rcx
leaq -0x2c(%rbp), %r8
callq 0x8482
movq %rax, %rbx
leaq 0xd8(%r15), %r14
movq 0xd8(%r15), %rax
cmpq %rax, 0xe0(%r15)
je 0x7f59
movq %rax, 0xe0(%r15)
movslq -0x2c(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x9536
movslq -0x30(%rbp), %r12
xorl %r13d, %r13d
testl %r15d, %r15d
cmovgl %r15d, %r13d
addq $0x40, %rbx
leaq -0x80(%rbp), %r15
subl $0x1, %r13d
jb 0x7fbe
leaq -0x40(%rbx), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movaps %xmm3, -0x50(%rbp)
movaps %xmm2, -0x60(%rbp)
movaps %xmm1, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movq (%rbx), %rax
movq %rax, -0x40(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x95fc
addq %r12, %rbx
jmp 0x7f7e
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8c39(%rip), %rdi      # 0x10c0d
leaq 0x8c36(%rip), %rsi      # 0x10c11
leaq 0x8c39(%rip), %rcx      # 0x10c1b
pushq $0x66
popq %rdx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/q3bsp.cpp
// Function: Quake3BSP::BuildVertexBuffers()
void Quake3BSP::BuildVertexBuffers(void)
{
  mMesh = 0;
  mMesh = new VertexMesh;

  QuakeFaceVector::iterator i;
  for (i=mFaces.begin(); i!=mFaces.end(); ++i)
  {
    (*i).Build(mElements,mVertices,mShaders,mLmPrefix,mName,mCodeName,*mMesh);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
andq $0x0, 0x120(%rdi)
pushq $0x58
popq %rdi
callq 0x2220
movq %rax, %r14
movq %rax, %rdi
callq 0x98be
movq %r14, 0x120(%rbx)
movq 0xa8(%rbx), %r14
leaq 0xf0(%rbx), %rax
movq %rax, -0x38(%rbp)
leaq 0xc0(%rbx), %rax
movq %rax, -0x30(%rbp)
leaq 0xd8(%rbx), %r13
leaq 0x1f0(%rbx), %r15
leaq 0x10(%rbx), %r12
cmpq 0xb0(%rbx), %r14
je 0x8080
movq %r14, %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq %r13, %rcx
movq %r15, %r8
pushq 0x120(%rbx)
pushq %r12
callq 0x891a
addq $0x10, %rsp
addq $0x6c, %r14
jmp 0x804f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x58
popq %rsi
movq %r14, %rdi
callq 0x2230
movq %rbx, %rdi
callq 0x23e0
nop
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/q3bsp.cpp
// Function: Quake3BSP::ReadPlanes(void const*)
void Quake3BSP::ReadPlanes(const void *mem)
{
  assert( mOk );
  int lsize;
  int lcount;
  const dplane_t *planes = (const dplane_t *) mHeader.LumpInfo(Q3_PLANES,mem,lsize,lcount);

  mPlanes.assign(planes,planes+lcount);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpb $0x0, (%rdi)
je 0x80f7
movq %rsi, %rdx
movq %rdi, %rbx
addq $0x18, %rdi
pushq $0x2
popq %rsi
leaq -0x18(%rbp), %rcx
leaq -0x14(%rbp), %r14
movq %r14, %r8
callq 0x8482
addq $0x128, %rbx            # imm = 0x128
movslq (%r14), %rdx
shlq $0x4, %rdx
addq %rax, %rdx
movq %rbx, %rdi
movq %rax, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x9e5c
leaq 0x8b0f(%rip), %rdi      # 0x10c0d
leaq 0x8b0c(%rip), %rsi      # 0x10c11
leaq 0x8b9a(%rip), %rcx      # 0x10ca6
movl $0xde, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/q3bsp.cpp
// Function: Quake3BSP::ReadLeaves(void const*)
void Quake3BSP::ReadLeaves(const void *mem)
{
  assert( mOk );
  int lsize;
  int lcount;
  const dleaf_t *nodes= (const dleaf_t *) mHeader.LumpInfo(Q3_LEAFS,mem,lsize,lcount);


  mLeaves.assign(nodes,nodes+lcount);
  assert(mLeaves.size() == lcount);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpb $0x0, (%rdi)
je 0x8180
movq %rsi, %rdx
movq %rdi, %rbx
addq $0x18, %rdi
pushq $0x4
popq %rsi
leaq -0x18(%rbp), %rcx
leaq -0x14(%rbp), %r14
movq %r14, %r8
callq 0x8482
leaq 0x1b8(%rbx), %rdi
movslq (%r14), %r14
imulq $0x30, %r14, %rdx
addq %rax, %rdx
movq %rax, %rsi
callq 0xa198
movq 0x1c0(%rbx), %rax
subq 0x1b8(%rbx), %rax
pushq $0x30
popq %rcx
cqto
idivq %rcx
cmpq %r14, %rax
jne 0x819f
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x8a86(%rip), %rdi      # 0x10c0d
leaq 0x8a83(%rip), %rsi      # 0x10c11
leaq 0x8b62(%rip), %rcx      # 0x10cf7
movl $0xf6, %edx
callq 0x2180
leaq 0x8b7a(%rip), %rdi      # 0x10d20
leaq 0x8a64(%rip), %rsi      # 0x10c11
leaq 0x8b43(%rip), %rcx      # 0x10cf7
movl $0xfd, %edx
callq 0x2180
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/q3bsp.cpp
// Function: Quake3BSP::ReadLeafSurfaces(void const*)
void Quake3BSP::ReadLeafSurfaces(const void *mem)
{
  assert( mOk );
  int lsize;
  int lcount;
  const int *nodes= (const int *) mHeader.LumpInfo(Q3_LFACES,mem,lsize,lcount);


  mLeafSurfaces.assign(nodes,nodes+lcount);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpb $0x0, (%rdi)
je 0x820c
movq %rsi, %rdx
movq %rdi, %rbx
addq $0x18, %rdi
pushq $0x5
popq %rsi
leaq -0x18(%rbp), %rcx
leaq -0x14(%rbp), %r14
movq %r14, %r8
callq 0x8482
addq $0x158, %rbx            # imm = 0x158
movslq (%r14), %rcx
leaq (%rax,%rcx,4), %rdx
movq %rbx, %rdi
movq %rax, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xa34a
leaq 0x89fa(%rip), %rdi      # 0x10c0d
leaq 0x89f7(%rip), %rsi      # 0x10c11
leaq 0x8b18(%rip), %rcx      # 0x10d39
movl $0x104, %edx            # imm = 0x104
callq 0x2180
nop
// File: /workspace/github_c_makefile_star2_O2/vlenhart[P]q3bsp/q3bsp.cpp
// Function: Quake3BSP::ReadNodes(void const*)
void Quake3BSP::ReadNodes(const void *mem)
{
  assert( mOk );
  int lsize;
  int lcount;
  const dnode_t *nodes= (const dnode_t *) mHeader.LumpInfo(Q3_NODES,mem,lsize,lcount);


  mNodes.assign(nodes,nodes+lcount);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpb $0x0, (%rdi)
je 0x827d
movq %rsi, %rdx
movq %rdi, %rbx
addq $0x18, %rdi
pushq $0x3
popq %rsi
leaq -0x18(%rbp), %rcx
leaq -0x14(%rbp), %r14
movq %r14, %r8
callq 0x8482
addq $0x140, %rbx            # imm = 0x140
movslq (%r14), %rcx
imulq $0x24, %rcx, %rdx
addq %rax, %rdx
movq %rbx, %rdi
movq %rax, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x9fe6
leaq 0x8989(%rip), %rdi      # 0x10c0d
leaq 0x8986(%rip), %rsi      # 0x10c11
leaq 0x8a3d(%rip), %rcx      # 0x10ccf
movl $0xe9, %edx
callq 0x2180