LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/vlenhart[P]q3bsp/./stringdict.h
// Function: StringDict::Get(char const*)
StringRef Get(const char *text)
  {
    const char *foo = mStringTable.Get(text);
    StringRef ref;
    ref.Set(foo);
    return ref;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x30(%rbp)
movq %rdi, %rax
movq %rax, -0x28(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9690
movq -0x30(%rbp), %rdi
movq %rax, -0x20(%rbp)
callq 0x9750
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x9770
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x9790
movq -0x58(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x97b0
movq -0x58(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0x9820
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x97f0
testb $0x1, %al
jne 0x96ea
jmp 0x96fc
leaq -0x20(%rbp), %rdi
callq 0x9850
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x9743
movq -0x18(%rbp), %rdi
callq 0x3150
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x3040
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3260
movq -0x58(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x9870
movq %rax, -0x50(%rbp)
movb %dl, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x8(%rbp)
subl $0x66, %eax
je 0xaa2a
jmp 0xaa04
movl -0x8(%rbp), %eax
subl $0x6e, %eax
je 0xaa21
jmp 0xaa0e
movl -0x8(%rbp), %eax
subl $0x74, %eax
jne 0xaa31
jmp 0xaa18
movl $0x9, -0x4(%rbp)
jmp 0xaa31
movl $0xa, -0x4(%rbp)
jmp 0xaa31
movl $0xc, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0x9750
callq 0x91c0
movq %rax, %rsi
movq -0x10(%rbp), %rdx
leaq -0x18(%rbp), %rdi
callq 0xdc50
movq -0x30(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xdca0
movq -0x30(%rbp), %rdi
movq $0x0, 0x8(%rdi)
movl $0x0, 0x10(%rdi)
callq 0xdce0
movq %rax, %rdi
leaq 0x1b826(%rip), %rsi     # 0x29157
callq 0x3370
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xda68
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x3340
movq -0x20(%rbp), %rdi
callq 0x3030
movq %rax, %rcx
movq -0x30(%rbp), %rax
movl %ecx, 0x10(%rax)
cmpl $0x0, 0x10(%rax)
je 0xda5f
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x3340
movq -0x30(%rbp), %rax
movl 0x10(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x3040
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x8(%rax)
je 0xd9a9
jmp 0xd9c8
leaq 0x1c1af(%rip), %rdi     # 0x29b5f
leaq 0x1c1ae(%rip), %rsi     # 0x29b65
movl $0x2a, %edx
leaq 0x1c1ac(%rip), %rcx     # 0x29b6f
callq 0x31c0
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xda5d
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movslq 0x10(%rax), %rsi
movq -0x20(%rbp), %rcx
movl $0x1, %edx
callq 0x3460
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0xd9fc
jmp 0xda1b
leaq 0x1cb91(%rip), %rdi     # 0x2a594
leaq 0x1c15b(%rip), %rsi     # 0x29b65
movl $0x2e, %edx
leaq 0x1c159(%rip), %rcx     # 0x29b6f
callq 0x31c0
cmpl $0x0, -0x24(%rbp)
jne 0xda4d
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0xda41
movq -0x38(%rbp), %rdi
movl $0x1, %esi
callq 0x32b0
movq -0x30(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rax
movslq 0x10(%rcx), %rcx
movb $0x0, (%rax,%rcx)
jmp 0xda5f
movq -0x20(%rbp), %rdi
callq 0x3290
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rcx
movq %rcx, 0x18(%rax)
movl 0x10(%rax), %ecx
movl %ecx, 0x20(%rax)
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, 0x18(%rax)
jne 0xdae4
movq $0x0, -0x8(%rbp)
jmp 0xdc40
jmp 0xdae6
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x21(%rbp)
je 0xdb24
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0xa, %ecx
movb %al, -0x21(%rbp)
je 0xdb24
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
sete %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0xdb2d
jmp 0xdb6a
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movl 0x20(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x20(%rax)
cmpl $0x0, 0x20(%rax)
jne 0xdb65
movq -0x20(%rbp), %rax
movq $0x0, 0x18(%rax)
movq $0x0, -0x8(%rbp)
jmp 0xdc40
jmp 0xdae6
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x22(%rbp)
je 0xdbb1
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0xa, %ecx
movb %al, -0x22(%rbp)
je 0xdbb1
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
setne %al
movb %al, -0x22(%rbp)
movb -0x22(%rbp), %al
testb $0x1, %al
jne 0xdbba
jmp 0xdbe9
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movl 0x20(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x20(%rax)
cmpl $0x0, 0x20(%rax)
jne 0xdbe7
movq -0x20(%rbp), %rax
movq $0x0, 0x18(%rax)
jmp 0xdbe9
jmp 0xdb76
movq -0x20(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0xdbfe
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movb $0x0, (%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xdc19
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rax
movl 0x20(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x20(%rax)
cmpl $0x0, 0x20(%rax)
jne 0xdc38
movq -0x20(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movq %r9, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
cltd
idivl %ecx
movl %eax, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xe3a2
movq -0x38(%rbp), %rdi
movl -0x10(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %r8
movslq -0x28(%rbp), %rax
imulq $0x28, %rax, %rax
addq %rax, %r8
callq 0xe5a0
movl -0x24(%rbp), %eax
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0xe36e
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0xe3e4
movq -0x38(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %r8
movl -0x2c(%rbp), %eax
imull -0x14(%rbp), %eax
cltq
imulq $0x28, %rax, %rax
addq %rax, %r8
movl $0x1, %ecx
callq 0xe5a0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xe3a9
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xe7e0
leaq -0x3c(%rbp), %rdi
callq 0xe7e0
leaq -0x48(%rbp), %rdi
callq 0xe7e0
movq -0x10(%rbp), %rsi
leaq -0x54(%rbp), %rdi
callq 0xe7f0
movq -0x18(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0xe7f0
movq -0x20(%rbp), %rsi
leaq -0x6c(%rbp), %rdi
callq 0xe7f0
movl $0x0, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0xe585
leaq -0x30(%rbp), %rdi
leaq -0x54(%rbp), %rsi
leaq -0x60(%rbp), %rdx
movss 0x1b6be(%rip), %xmm0    # 0x29b90
callq 0xe830
leaq -0x3c(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x6c(%rbp), %rdx
movss 0x1b6a5(%rip), %xmm0    # 0x29b90
callq 0xe830
leaq -0x6c(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x3c(%rbp), %rdx
movss 0x1b68c(%rip), %xmm0    # 0x29b90
callq 0xe830
leaq -0x78(%rbp), %rdi
leaq -0x6c(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0xe8a0
leaq -0x48(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0xe900
movss -0x48(%rbp), %xmm1
movss -0x48(%rbp), %xmm2
movss -0x44(%rbp), %xmm0
mulss -0x44(%rbp), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss -0x40(%rbp), %xmm0
movss -0x40(%rbp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x7c(%rbp)
movss 0x1b62a(%rip), %xmm0    # 0x29b8c
ucomiss -0x7c(%rbp), %xmm0
jbe 0xe56a
jmp 0xe585
leaq -0x60(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xe900
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xe4b4
movl -0x24(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq %r8, -0x20(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xe730
leaq -0x80(%rbp), %rdi
callq 0xe730
movl -0x10(%rbp), %eax
subl $0x1, %eax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
cltd
idivl %ecx
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jle 0xe71e
movl -0x24(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl -0x10(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0xe70b
movl -0x2c(%rbp), %eax
addl -0x24(%rbp), %eax
imull -0x14(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %eax
imull -0x14(%rbp), %eax
cltq
imulq $0x28, %rax, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
movslq -0x30(%rbp), %rax
imulq $0x28, %rax, %rax
addq %rax, %rdx
leaq -0x58(%rbp), %rdi
movss 0x1b544(%rip), %xmm0    # 0x29b90
callq 0xe940
movq -0x20(%rbp), %rsi
movslq -0x30(%rbp), %rax
imulq $0x28, %rax, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
movl -0x2c(%rbp), %eax
movl -0x24(%rbp), %ecx
shll %ecx
addl %ecx, %eax
imull -0x14(%rbp), %eax
cltq
imulq $0x28, %rax, %rax
addq %rax, %rdx
leaq -0x80(%rbp), %rdi
movss 0x1b509(%rip), %xmm0    # 0x29b90
callq 0xe940
movq -0x20(%rbp), %rdi
movslq -0x30(%rbp), %rax
imulq $0x28, %rax, %rax
addq %rax, %rdi
leaq -0x58(%rbp), %rsi
leaq -0x80(%rbp), %rdx
movss 0x1b4e5(%rip), %xmm0    # 0x29b90
callq 0xe940
cmpl $0x0, -0x28(%rbp)
jle 0xe6f9
movq -0x20(%rbp), %rdi
movl -0x2c(%rbp), %eax
addl -0x28(%rbp), %eax
imull -0x14(%rbp), %eax
cltq
imulq $0x28, %rax, %rax
addq %rax, %rdi
leaq -0x58(%rbp), %rsi
callq 0xe780
movq -0x20(%rbp), %rdi
movl -0x2c(%rbp), %eax
imull $0x3, -0x28(%rbp), %ecx
addl %ecx, %eax
imull -0x14(%rbp), %eax
cltq
imulq $0x28, %rax, %rax
addq %rax, %rdi
leaq -0x80(%rbp), %rsi
callq 0xe780
jmp 0xe6fb
movl -0x24(%rbp), %eax
shll %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0xe5ff
movl -0x24(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x24(%rbp)
jmp 0xe5e0
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movss %xmm0, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movss -0x1c(%rbp), %xmm0
callq 0xe830
movq -0x28(%rbp), %rdi
addq $0xc, %rdi
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
movq -0x18(%rbp), %rdx
addq $0xc, %rdx
movss -0x1c(%rbp), %xmm0
callq 0xe9f0
movq -0x28(%rbp), %rdi
addq $0x14, %rdi
movq -0x10(%rbp), %rsi
addq $0x14, %rsi
movq -0x18(%rbp), %rdx
addq $0x14, %rdx
movss -0x1c(%rbp), %xmm0
callq 0xe9f0
movq -0x28(%rbp), %rdi
addq $0x1c, %rdi
movq -0x10(%rbp), %rsi
addq $0x1c, %rsi
movq -0x18(%rbp), %rdx
addq $0x1c, %rdx
movss -0x1c(%rbp), %xmm0
callq 0xe830
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movss %xmm0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movss (%rcx), %xmm0
movq -0x10(%rbp), %rcx
subss (%rcx), %xmm0
movss %xmm0, (%rax)
movq -0x18(%rbp), %rcx
movss 0x4(%rcx), %xmm0
movq -0x10(%rbp), %rcx
subss 0x4(%rcx), %xmm0
movss %xmm0, 0x4(%rax)
movss -0x1c(%rbp), %xmm0
mulss (%rax), %xmm0
movss %xmm0, (%rax)
movss -0x1c(%rbp), %xmm0
mulss 0x4(%rax), %xmm0
movss %xmm0, 0x4(%rax)
movq -0x10(%rbp), %rcx
movss (%rcx), %xmm0
addss (%rax), %xmm0
movss %xmm0, (%rax)
movq -0x10(%rbp), %rcx
movss 0x4(%rcx), %xmm0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x4(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
cmpl 0x1ab61(%rip), %eax     # 0x29c29
je 0xf0d0
movb $0x0, -0x1(%rbp)
jmp 0xf13d
movq -0x20(%rbp), %rax
cmpl $0x2e, 0x4(%rax)
je 0xf0e0
movb $0x0, -0x1(%rbp)
jmp 0xf13d
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
cmpl $0x11, -0x2c(%rbp)
jge 0xf139
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rdx
movq %rdx, %rcx
addq $0x8, %rcx
movq %rcx, -0x28(%rbp)
movslq -0x2c(%rbp), %rcx
movq (%rdx), %rdx
movq %rdx, 0x8(%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xf109
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
testb $0x1, (%rax)
je 0xf175
jmp 0xf194
leaq 0x1aab2(%rip), %rdi     # 0x29c2e
leaq 0x1aaaf(%rip), %rsi     # 0x29c32
movl $0x171, %edx            # imm = 0x171
leaq 0x1acbd(%rip), %rcx     # 0x29e4c
callq 0x31c0
movq -0xa8(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rdx
movl $0xd, %esi
leaq -0x14(%rbp), %rcx
leaq -0x18(%rbp), %r8
callq 0xff80
movq %rax, -0x20(%rbp)
movslq -0x14(%rbp), %rax
cmpq $0x68, %rax
jne 0xf1c5
jmp 0xf1e4
leaq 0x1aca8(%rip), %rdi     # 0x29e74
leaq 0x1aa5f(%rip), %rsi     # 0x29c32
movl $0x175, %edx            # imm = 0x175
leaq 0x1ac6d(%rip), %rcx     # 0x29e4c
callq 0x31c0
movq -0xa8(%rbp), %rdi
addq $0xa8, %rdi
callq 0x12600
movq -0xa8(%rbp), %rdi
addq $0xa8, %rdi
movslq -0x18(%rbp), %rsi
callq 0x12620
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0xf293
movq -0x20(%rbp), %rsi
leaq -0x90(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x102f0
movq -0xa8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
addq $0xa8, %rdi
callq 0x12740
jmp 0xf250
movq -0x20(%rbp), %rax
addq $0x68, %rax
movq %rax, -0x20(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x105d0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf215
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x105d0
jmp 0xf29c
addq $0xb0, %rsp
popq %rbp
retq
movq -0x98(%rbp), %rdi
callq 0x34f0
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
testb $0x1, (%rax)
je 0xf2cf
jmp 0xf2ee
leaq 0x1a958(%rip), %rdi     # 0x29c2e
leaq 0x1a955(%rip), %rsi     # 0x29c32
movl $0x1cf, %edx            # imm = 0x1CF
leaq 0x1ac1c(%rip), %rcx     # 0x29f05
callq 0x31c0
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rdx
movl $0xb, %esi
leaq -0x14(%rbp), %rcx
leaq -0x18(%rbp), %r8
callq 0xff80
movq %rax, -0x20(%rbp)
movslq -0x14(%rbp), %rax
cmpq $0x4, %rax
jne 0xf31c
jmp 0xf33b
leaq 0x1ac0d(%rip), %rdi     # 0x29f30
leaq 0x1a908(%rip), %rsi     # 0x29c32
movl $0x1d4, %edx            # imm = 0x1D4
leaq 0x1abcf(%rip), %rcx     # 0x29f05
callq 0x31c0
movq -0x30(%rbp), %rdi
addq $0xf0, %rdi
callq 0x12a10
movq -0x30(%rbp), %rdi
addq $0xf0, %rdi
movslq -0x18(%rbp), %rsi
callq 0x12a30
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0xf3a3
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %eax
movw %ax, -0x26(%rbp)
addq $0xf0, %rdi
leaq -0x26(%rbp), %rsi
callq 0x12b20
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf366
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
testb $0x1, (%rax)
je 0xf3cf
jmp 0xf3ee
leaq 0x1a858(%rip), %rdi     # 0x29c2e
leaq 0x1a855(%rip), %rsi     # 0x29c32
movl $0x186, %edx            # imm = 0x186
leaq 0x1aaa3(%rip), %rcx     # 0x29e8c
callq 0x31c0
movq -0x58(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rdx
movl $0xa, %esi
leaq -0x14(%rbp), %rcx
leaq -0x18(%rbp), %r8
callq 0xff80
movq %rax, -0x20(%rbp)
movslq -0x14(%rbp), %rax
cmpq $0x2c, %rax
jne 0xf41c
jmp 0xf43b
leaq 0x1aa94(%rip), %rdi     # 0x29eb7
leaq 0x1a808(%rip), %rsi     # 0x29c32
movl $0x18a, %edx            # imm = 0x18A
leaq 0x1aa56(%rip), %rcx     # 0x29e8c
callq 0x31c0
movq -0x58(%rbp), %rdi
addq $0xc0, %rdi
callq 0x127b0
movq -0x58(%rbp), %rdi
addq $0xc0, %rdi
movslq -0x18(%rbp), %rsi
callq 0x127d0
movq -0x58(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
callq 0x128f0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0xf507
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x105e0
movq -0x58(%rbp), %rdi
movss 0x1a715(%rip), %xmm0    # 0x29bb0
mulss -0x50(%rbp), %xmm0
movss %xmm0, -0x50(%rbp)
movss 0x1a707(%rip), %xmm0    # 0x29bb4
mulss -0x4c(%rbp), %xmm0
movss %xmm0, -0x4c(%rbp)
movss 0x1a6f1(%rip), %xmm0    # 0x29bb0
mulss -0x48(%rbp), %xmm0
movss %xmm0, -0x48(%rbp)
addq $0x108, %rdi            # imm = 0x108
leaq -0x50(%rbp), %rsi
callq 0x12940
movq -0x58(%rbp), %rdi
addq $0xc0, %rdi
leaq -0x50(%rbp), %rsi
callq 0x129a0
movq -0x20(%rbp), %rax
addq $0x2c, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf476
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
testb $0x1, (%rax)
je 0xf852
jmp 0xf871
leaq 0x1a3d5(%rip), %rdi     # 0x29c2e
leaq 0x1a3d2(%rip), %rsi     # 0x29c32
movl $0x66, %edx
leaq 0x1a3d0(%rip), %rcx     # 0x29c3c
callq 0x31c0
movq -0x78(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rdx
movl $0x1, %esi
leaq -0x14(%rbp), %rcx
leaq -0x18(%rbp), %r8
callq 0xff80
movq -0x78(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0xd8, %rdi
callq 0x12310
movq -0x78(%rbp), %rdi
addq $0xd8, %rdi
movslq -0x18(%rbp), %rsi
callq 0x12330
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0xf903
movq -0x20(%rbp), %rsi
leaq -0x6c(%rbp), %rdi
callq 0x12430
movq -0x78(%rbp), %rdi
addq $0xd8, %rdi
leaq -0x6c(%rbp), %rsi
callq 0x12470
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf8be
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, 0x120(%rax)
movl $0x58, %edi
callq 0x32a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
callq 0x12b90
jmp 0xf94a
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, 0x120(%rax)
leaq -0x20(%rbp), %rdi
callq 0x12c10
movq -0x40(%rbp), %rdi
addq $0xa8, %rdi
callq 0x12c30
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x40(%rbp), %rdi
addq $0xa8, %rdi
callq 0x12ca0
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x12c60
testb $0x1, %al
jne 0xf9a8
jmp 0xfa2d
leaq -0x20(%rbp), %rdi
callq 0x12cd0
movq %rax, %rdi
movq -0x40(%rbp), %rax
movq %rax, %rsi
addq $0xf0, %rsi
movq %rax, %rdx
addq $0xc0, %rdx
movq %rax, %rcx
addq $0xd8, %rcx
movq %rax, %r8
addq $0x1f0, %r8             # imm = 0x1F0
movq %rax, %r9
addq $0x8, %r9
movq %rax, %r10
addq $0x10, %r10
movq 0x120(%rax), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x107b0
leaq -0x20(%rbp), %rdi
callq 0x12cf0
jmp 0xf97e
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x58, %esi
callq 0x32b0
jmp 0xfa33
addq $0x50, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rdi
callq 0x34f0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
testb $0x1, (%rax)
je 0xfaef
jmp 0xfb0e
leaq 0x1a138(%rip), %rdi     # 0x29c2e
leaq 0x1a135(%rip), %rsi     # 0x29c32
movl $0xf6, %edx
leaq 0x1a20f(%rip), %rcx     # 0x29d18
callq 0x31c0
movq -0x28(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rdx
movl $0x4, %esi
leaq -0x14(%rbp), %rcx
leaq -0x18(%rbp), %r8
callq 0xff80
movq -0x28(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0x1b8, %rdi            # imm = 0x1B8
movq -0x20(%rbp), %rsi
movq -0x20(%rbp), %rdx
movslq -0x18(%rbp), %rax
imulq $0x30, %rax, %rax
addq %rax, %rdx
callq 0x12570
movq -0x28(%rbp), %rdi
addq $0x1b8, %rdi            # imm = 0x1B8
callq 0x125a0
movslq -0x18(%rbp), %rcx
cmpq %rcx, %rax
jne 0xfb6e
jmp 0xfb8d
leaq 0x1a1cc(%rip), %rdi     # 0x29d41
leaq 0x1a0b6(%rip), %rsi     # 0x29c32
movl $0xfd, %edx
leaq 0x1a190(%rip), %rcx     # 0x29d18
callq 0x31c0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vlenhart[P]q3bsp/q3bsp.cpp
// Function: Quake3BSP::ReadEntities(void const*)
void Quake3BSP::ReadEntities(const void *mem)
{
  assert( mOk );
  int lsize;
  int lcount;
  
  const char *elements = (const char *) mHeader.LumpInfo(Q3_ENTITIES,mem,lsize,lcount);
  assert( lsize == sizeof(char) );

  mEntities.clear();

  const char *estart=elements;
  const char *p=estart;
  int level=0;
  for (int i=0; i<lcount; i++)
  {
	 if (*p == '{') {
		 level++;
		 if (level == 1) estart = p+1;
	 } else if (*p == '}') {
		 level--;
		 if (level == 0) {
			EntityReference *e=new EntityReference(estart,p-estart-1);

		    mEntities.push_back(*e);
			estart = p+1;
		 }
	 }
	 p++;

  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
testb $0x1, (%rax)
je 0xfcdf
jmp 0xfcfe
leaq 0x19f48(%rip), %rdi     # 0x29c2e
leaq 0x19f45(%rip), %rsi     # 0x29c32
movl $0x2bd, %edx            # imm = 0x2BD
leaq 0x1a3ac(%rip), %rcx     # 0x2a0a5
callq 0x31c0
movq -0x58(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rdx
xorl %esi, %esi
leaq -0x14(%rbp), %rcx
leaq -0x18(%rbp), %r8
callq 0xff80
movq %rax, -0x20(%rbp)
movslq -0x14(%rbp), %rax
cmpq $0x1, %rax
jne 0xfd29
jmp 0xfd48
leaq 0x1a3a0(%rip), %rdi     # 0x2a0d0
leaq 0x19efb(%rip), %rsi     # 0x29c32
movl $0x2c2, %edx            # imm = 0x2C2
leaq 0x1a362(%rip), %rcx     # 0x2a0a5
callq 0x31c0
movq -0x58(%rbp), %rdi
addq $0x1d0, %rdi            # imm = 0x1D0
callq 0x12f00
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0xfe55
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7b, %eax
jne 0xfdae
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
cmpl $0x1, -0x34(%rbp)
jne 0xfda9
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xfe3b
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7d, %eax
jne 0xfe39
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0xfe37
movl $0x20, %edi
callq 0x32a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x60(%rbp)
movq -0x28(%rbp), %rsi
movl -0x30(%rbp), %eax
movl %esi, %edx
notl %edx
addl %eax, %edx
callq 0x12f20
jmp 0xfdf1
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
addq $0x1d0, %rdi            # imm = 0x1D0
movq -0x40(%rbp), %rsi
callq 0x12f80
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xfe37
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
movl $0x20, %esi
callq 0x32b0
jmp 0xfe5b
jmp 0xfe39
jmp 0xfe3b
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xfd76
addq $0x60, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x34f0
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vlenhart[P]q3bsp/q3bsp.cpp
// Function: QuakeNode::QuakeNode(int const*)
QuakeNode::QuakeNode(const int *node)
{
  const dnode_t *n = (const dnode_t*) node;

  mPlane = node[0];
  mLeftChild = node[1];
  mRightChild = node[2];

  mBound.r1.x = float( node[3] );
  mBound.r1.y = float( node[4] );
  mBound.r1.z = float( node[5] );
  mBound.r2.x = float( node[6] );
  mBound.r2.y = float( node[7] );
  mBound.r2.z = float( node[8] );

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0xa4, %rdi
callq 0x11cd0
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x98(%rax)
movq -0x10(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, 0x9c(%rax)
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0xa0(%rax)
movq -0x10(%rbp), %rcx
cvtsi2ssl 0xc(%rcx), %xmm0
movss %xmm0, 0xa4(%rax)
movq -0x10(%rbp), %rcx
cvtsi2ssl 0x10(%rcx), %xmm0
movss %xmm0, 0xa8(%rax)
movq -0x10(%rbp), %rcx
cvtsi2ssl 0x14(%rcx), %xmm0
movss %xmm0, 0xac(%rax)
movq -0x10(%rbp), %rcx
cvtsi2ssl 0x18(%rcx), %xmm0
movss %xmm0, 0xb0(%rax)
movq -0x10(%rbp), %rcx
cvtsi2ssl 0x1c(%rcx), %xmm0
movss %xmm0, 0xb4(%rax)
movq -0x10(%rbp), %rcx
cvtsi2ssl 0x20(%rcx), %xmm0
movss %xmm0, 0xb8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vlenhart[P]q3bsp/q3bsp.cpp
// Function: QuakeLeaf::QuakeLeaf(int const*)
QuakeLeaf::QuakeLeaf(const int *node)
{
  const dleaf_t *n = (const dleaf_t*) node;

  mCluster = node[0];
  mArea    = node[1];

  mBound.r1.x = float( node[2] );
  mBound.r1.y = float( node[3] );
  mBound.r1.z = float( node[4] );

  mBound.r2.x = float( node[5] );
  mBound.r2.y = float( node[6] );
  mBound.r2.z = float( node[7] );

  mFirstFace      = node[8];
  mFaceCount      = node[9];
  mFirstUnknown   = node[10];
  mNumberUnknowns = node[11];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0x8, %rdi
callq 0x11cd0
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rcx
cvtsi2ssl 0x8(%rcx), %xmm0
movss %xmm0, 0x8(%rax)
movq -0x10(%rbp), %rcx
cvtsi2ssl 0xc(%rcx), %xmm0
movss %xmm0, 0xc(%rax)
movq -0x10(%rbp), %rcx
cvtsi2ssl 0x10(%rcx), %xmm0
movss %xmm0, 0x10(%rax)
movq -0x10(%rbp), %rcx
cvtsi2ssl 0x14(%rcx), %xmm0
movss %xmm0, 0x14(%rax)
movq -0x10(%rbp), %rcx
cvtsi2ssl 0x18(%rcx), %xmm0
movss %xmm0, 0x18(%rax)
movq -0x10(%rbp), %rcx
cvtsi2ssl 0x1c(%rcx), %xmm0
movss %xmm0, 0x1c(%rax)
movq -0x10(%rbp), %rcx
movl 0x20(%rcx), %ecx
movl %ecx, 0x20(%rax)
movq -0x10(%rbp), %rcx
movl 0x24(%rcx), %ecx
movl %ecx, 0x24(%rax)
movq -0x10(%rbp), %rcx
movl 0x28(%rcx), %ecx
movl %ecx, 0x28(%rax)
movq -0x10(%rbp), %rcx
movl 0x2c(%rcx), %ecx
movl %ecx, 0x2c(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vlenhart[P]q3bsp/q3bsp.cpp
// Function: QuakeVertex::QuakeVertex(int const*)
QuakeVertex::QuakeVertex(const int *vert)
{

  const drawVert_t *n = (const drawVert_t *) vert;

  const float *fvert = (const float *) vert;

  mPos.x = fvert[0];
  mPos.y = fvert[1];
  mPos.z = fvert[2];

  mTexel1.x = fvert[3];
  mTexel1.y = fvert[4];

  mTexel2.x = fvert[5];
  mTexel2.y = fvert[6];

  mNormal.x = fvert[7];
  mNormal.y = fvert[8];
  mNormal.z = fvert[9];

  mColor    = (unsigned int) vert[10];

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0xe7e0
movq -0x28(%rbp), %rdi
addq $0xc, %rdi
callq 0xe9e0
movq -0x28(%rbp), %rdi
addq $0x14, %rdi
callq 0xe9e0
movq -0x28(%rbp), %rdi
addq $0x1c, %rdi
callq 0xe7e0
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movss (%rcx), %xmm0
movss %xmm0, (%rax)
movq -0x20(%rbp), %rcx
movss 0x4(%rcx), %xmm0
movss %xmm0, 0x4(%rax)
movq -0x20(%rbp), %rcx
movss 0x8(%rcx), %xmm0
movss %xmm0, 0x8(%rax)
movq -0x20(%rbp), %rcx
movss 0xc(%rcx), %xmm0
movss %xmm0, 0xc(%rax)
movq -0x20(%rbp), %rcx
movss 0x10(%rcx), %xmm0
movss %xmm0, 0x10(%rax)
movq -0x20(%rbp), %rcx
movss 0x14(%rcx), %xmm0
movss %xmm0, 0x14(%rax)
movq -0x20(%rbp), %rcx
movss 0x18(%rcx), %xmm0
movss %xmm0, 0x18(%rax)
movq -0x20(%rbp), %rcx
movss 0x1c(%rcx), %xmm0
movss %xmm0, 0x1c(%rax)
movq -0x20(%rbp), %rcx
movss 0x20(%rcx), %xmm0
movss %xmm0, 0x20(%rax)
movq -0x20(%rbp), %rcx
movss 0x24(%rcx), %xmm0
movss %xmm0, 0x24(%rax)
movq -0x10(%rbp), %rcx
movl 0x28(%rcx), %ecx
movl %ecx, 0x28(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vlenhart[P]q3bsp/q3bsp.cpp
// Function: QuakeVertex::Get(LightMapVertex&) const
void QuakeVertex::Get(LightMapVertex &vtx) const
{
  vtx.mPos.x    = mPos.x;
  vtx.mPos.y    = mPos.y;
  vtx.mPos.z    = mPos.z;


  vtx.mTexel1.x = mTexel1.x;
  vtx.mTexel1.y = mTexel1.y;

  vtx.mTexel2.x = mTexel2.x;
  vtx.mTexel2.y = mTexel2.y;

  vtx.mColor.x    = float((mColor>>0) & 0xFF) / 255.0f;
  vtx.mColor.y    = float((mColor>>8) & 0xFF) / 255.0f;
  vtx.mColor.z    = float((mColor>>16) & 0xFF) / 255.0f;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movss (%rax), %xmm0
movq -0x10(%rbp), %rcx
movss %xmm0, (%rcx)
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rcx
movss %xmm0, 0x4(%rcx)
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rcx
movss %xmm0, 0x8(%rcx)
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rcx
movss %xmm0, 0xc(%rcx)
movss 0x10(%rax), %xmm0
movq -0x10(%rbp), %rcx
movss %xmm0, 0x10(%rcx)
movss 0x14(%rax), %xmm0
movq -0x10(%rbp), %rcx
movss %xmm0, 0x14(%rcx)
movss 0x18(%rax), %xmm0
movq -0x10(%rbp), %rcx
movss %xmm0, 0x18(%rcx)
movzbl 0x28(%rax), %ecx
cvtsi2ss %ecx, %xmm0
movss 0x188ac(%rip), %xmm1    # 0x2900c
divss %xmm1, %xmm0
movq -0x10(%rbp), %rcx
movss %xmm0, 0x1c(%rcx)
movzbl 0x29(%rax), %ecx
cvtsi2ss %ecx, %xmm0
divss %xmm1, %xmm0
movq -0x10(%rbp), %rcx
movss %xmm0, 0x20(%rcx)
movzbl 0x2a(%rax), %eax
cvtsi2ss %eax, %xmm0
movss 0x1887a(%rip), %xmm1    # 0x2900c
divss %xmm1, %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x24(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vlenhart[P]q3bsp/q3bsp.cpp
// Function: ShaderReference::GetShaderFileName(char*)
void ShaderReference::GetShaderFileName(char *tname)
{
  strcpy(tname,"");
  int len = strlen(mName);
  if ( !len ) 
	  return;
  
  const char *foo = &mName[0];
  while ( *foo && *foo != '/' ) foo++;

  if ( !*foo ) return;
  foo++;
  
  char *dest = tname;
  while ( *foo && *foo != '/' )
  {
    *dest++ = *foo++;
  }
  *dest = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x19d43(%rip), %rsi     # 0x2ada6
callq 0x3260
movq -0x30(%rbp), %rdi
callq 0x3150
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x1107f
jmp 0x1112d
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x31(%rbp)
je 0x110a5
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x110ae
jmp 0x110bc
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x11087
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x110c7
jmp 0x1112d
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x32(%rbp)
je 0x110f9
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
setne %al
movb %al, -0x32(%rbp)
movb -0x32(%rbp), %al
testb $0x1, %al
jne 0x11102
jmp 0x11126
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb (%rax), %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
jmp 0x110db
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vlenhart[P]q3bsp/q3bsp.cpp
// Function: ShaderReference::GetTextureName(char*)
void ShaderReference::GetTextureName(char *tname)
{
  strcpy(tname,"null");
  int len = strlen(mName);
  if ( !len ) return;
  const char *foo = &mName[len-1];
  while ( *foo && *foo != '/' ) foo--;
  if ( !*foo ) return;
  foo++;
  char *dest = tname;
  while ( *foo )
  {
    *dest++ = *foo++;
  }
  *dest = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x18953(%rip), %rsi     # 0x29ab6
callq 0x3260
movq -0x30(%rbp), %rdi
callq 0x3150
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x1117f
jmp 0x1121b
movq -0x30(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x31(%rbp)
je 0x111b1
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x111ba
jmp 0x111c8
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x11193
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x111d3
jmp 0x1121b
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x11214
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb (%rax), %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
jmp 0x111e7
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/vlenhart[P]q3bsp/q3bsp.cpp
// Function: Quake3BSP::SaveEntitiesVRML2(_IO_FILE*, VFormatOptions&) const
void Quake3BSP::SaveEntitiesVRML2(
			FILE *fph,
            VFormatOptions &options) const 
{
  if ( mEntities.size() )
  {
    if ( fph )
    {
      fprintf(fph,"DEF Entities Group {\n");
      fprintf(fph,"children [\n");

      EntityReferenceVector::const_iterator i;

      for (i=mEntities.begin(); i!=mEntities.end(); ++i)
      {
			SaveEntity(*i,fph,options);
      }

      fprintf(fph,"]}\n");

    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
addq $0x1d0, %rdi            # imm = 0x1D0
callq 0x13090
cmpq $0x0, %rax
je 0x118b9
cmpq $0x0, -0x10(%rbp)
je 0x118b7
movq -0x10(%rbp), %rdi
leaq 0x1898b(%rip), %rsi     # 0x2a1a3
movb $0x0, %al
callq 0x3430
movq -0x10(%rbp), %rdi
leaq 0x1898f(%rip), %rsi     # 0x2a1b9
movb $0x0, %al
callq 0x3430
leaq -0x20(%rbp), %rdi
callq 0x130b0
movq -0x38(%rbp), %rdi
addq $0x1d0, %rdi            # imm = 0x1D0
callq 0x130d0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rdi
addq $0x1d0, %rdi            # imm = 0x1D0
callq 0x13140
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x13100
testb $0x1, %al
jne 0x1187d
jmp 0x118a5
leaq -0x20(%rbp), %rdi
callq 0x13170
movq -0x38(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x11230
leaq -0x20(%rbp), %rdi
callq 0x13190
jmp 0x11856
movq -0x10(%rbp), %rdi
leaq 0x18915(%rip), %rsi     # 0x2a1c5
movb $0x0, %al
callq 0x3430
jmp 0x118b9
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/vlenhart[P]q3bsp/q3bsp.cpp
// Function: Quake3BSP::SaveNode(int, _IO_FILE*, VFormatOptions&)
void Quake3BSP::SaveNode(
			int nodeNum, 
			FILE *fph,
            VFormatOptions &options)

{
	if (nodeNum<0) {
		// negative numbers are -(leafs+1), not nodes
		int leafNum = - (nodeNum+1);
		SaveNodeBsp(&mLeaves[leafNum],fph,options);
	}
	else {
		SaveNodeBsp(&mNodes[nodeNum],fph,options);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x1191c
movq -0x30(%rbp), %rdi
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x24(%rbp)
addq $0x1b8, %rdi            # imm = 0x1B8
movslq -0x24(%rbp), %rsi
callq 0x131b0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x11950
jmp 0x11944
movq -0x30(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
movslq -0xc(%rbp), %rsi
callq 0x131d0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x11ae0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)