LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/apps/gapsview/gapsview.cpp
// Function: LoadTexture(ImageData*)
static void
LoadTexture(ImageData *data)
{
  // Check if already loaded
  if (data->texture_id > 0) return;

  // Check color image
  if (data->color_image.Width() <= 0) return;
  if (data->color_image.Height() <= 0) return;
  if (data->color_image.Depth() != 3) return;

  // Allocate texture id
  glGenTextures(1, &data->texture_id);
  assert(data->texture_id > 0);

  // Set texture parameters
  glBindTexture(GL_TEXTURE_2D, data->texture_id);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

  // Set texture pixels
  gluBuild2DMipmaps(GL_TEXTURE_2D, 3,
    data->color_image.Width(), data->color_image.Height(),
    GL_RGB, GL_UNSIGNED_BYTE, data->color_image.Pixels());
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
cmpl $0x0, 0x770(%rdi)
je 0x3220e
addq $0x10, %rsp
popq %rbx
retq
movq %rdi, %rbx
cmpl $0x0, (%rdi)
jle 0x32208
cmpl $0x0, 0x4(%rbx)
jle 0x32208
cmpl $0x3, 0x8(%rbx)
jne 0x32208
leaq 0x770(%rbx), %rsi
movl $0x1, %edi
callq 0x27d60
movl 0x770(%rbx), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq 0x27be0
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2802, %esi           # imm = 0x2802
movl $0x2900, %edx           # imm = 0x2900
callq 0x27d20
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2803, %esi           # imm = 0x2803
movl $0x2900, %edx           # imm = 0x2900
callq 0x27d20
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2801, %esi           # imm = 0x2801
movl $0x2701, %edx           # imm = 0x2701
callq 0x27d20
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2800, %esi           # imm = 0x2800
movl $0x2601, %edx           # imm = 0x2601
callq 0x27d20
movl $0x2300, %edi           # imm = 0x2300
movl $0x2200, %esi           # imm = 0x2200
movl $0x2100, %edx           # imm = 0x2100
callq 0x27a40
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movq 0x10(%rbx), %rax
movq %rax, (%rsp)
movl $0xde1, %edi            # imm = 0xDE1
movl $0x3, %esi
movl $0x1907, %r8d           # imm = 0x1907
movl $0x1401, %r9d           # imm = 0x1401
callq 0x27520
jmp 0x32208
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::~GSVScene()
GSVScene::
~GSVScene(void)
{
  // Delete runs
  while (NRuns() > 0) delete Run(0);

  // Delete filename
  if (filename) free(filename);

  // Delete raw data directory name
  if (raw_data_directory_name) free(raw_data_directory_name);

  // Delete cache data_directory name
  if (cache_data_directory_name) free(cache_data_directory_name);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x199d27(%rip), %rax    # 0x1cc820
movq %rax, (%rdi)
movl 0x14(%rdi), %eax
testl %eax, %eax
jle 0x32b1a
movq 0x8(%rbx), %rcx
movq (%rcx), %rdi
testq %rdi, %rdi
je 0x32aff
movq (%rdi), %rax
callq *0x8(%rax)
movl 0x14(%rbx), %eax
jmp 0x32aff
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x32b28
callq 0x27b40
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x32b36
callq 0x27b40
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x32b44
callq 0x27b40
leaq 0x68(%rbx), %rdi
callq 0xc06c4
leaq 0x30(%rbx), %rdi
callq 0xbe790
addq $0x8, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0xf8bea
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::Run(char const*) const
GSVRun *GSVScene::
Run(const char *name) const
{
  // Return run with matching name
  for (int ir = 0; ir < NRuns(); ir++) {
    GSVRun *run = Run(ir);
    if (!run->Name()) continue;
    if (!strcmp(run->Name(), name)) return run;
  }

  // None found
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x14(%rdi), %r15
testq %r15, %r15
jle 0x32bb9
movq %rsi, %rbx
movq 0x8(%rdi), %r12
xorl %r13d, %r13d
movq (%r12,%r13,8), %r14
movq 0x48(%r14), %rdi
testq %rdi, %rdi
je 0x32bb1
movq %rbx, %rsi
callq 0x27d80
testl %eax, %eax
je 0x32bbc
incq %r13
cmpq %r13, %r15
jne 0x32b98
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::NSegments() const
int GSVScene::
NSegments(void) const
{
  // Return number of segments in scene
  int count = 0;
  for (int ir = 0; ir < NRuns(); ir++) {
    GSVRun *run = Run(ir);
    count += run->NSegments();
  }
  return count;
}

// Assembly:
movslq 0x14(%rdi), %rcx
testq %rcx, %rcx
jle 0x32beb
movq 0x8(%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %rdi
addl 0x24(%rdi), %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x32bdb
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::NCameras() const
int GSVScene::
NCameras(void) const
{
  // Return number of cameras in scene
  int count = 0;
  for (int ir = 0; ir < NRuns(); ir++) {
    GSVRun *run = Run(ir);
    count += run->NCameras();
  }
  return count;
}

// Assembly:
movslq 0x14(%rdi), %rcx
testq %rcx, %rcx
jle 0x32c0f
movq 0x8(%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %rdi
addl 0x34(%rdi), %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x32bff
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::NTapestries() const
int GSVScene::
NTapestries(void) const
{
  // Return number of tapestries in scene
  int count = 0;
  for (int i = 0; i < NRuns(); i++) {
    GSVRun *run = Run(i);
    count += run->NTapestries();
  }
  return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x14(%rdi)
jle 0x32c41
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x37d5a
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32c24
jmp 0x32c43
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::NPanoramas() const
int GSVScene::
NPanoramas(void) const
{
  // Return number of panoramas in scene
  int count = 0;
  for (int i = 0; i < NRuns(); i++) {
    GSVRun *run = Run(i);
    count += run->NPanoramas();
  }
  return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x14(%rdi)
jle 0x32c79
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x37d7e
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32c5c
jmp 0x32c7b
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::NImages() const
int GSVScene::
NImages(void) const
{
  // Return number of images in scene
  int count = 0;
  for (int i = 0; i < NRuns(); i++) {
    GSVRun *run = Run(i);
    count += run->NImages();
  }
  return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x14(%rdi)
jle 0x32cb1
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x37da2
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32c94
jmp 0x32cb3
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::NLasers() const
int GSVScene::
NLasers(void) const
{
  // Return number of lasers in scene
  int count = 0;
  for (int ir = 0; ir < NRuns(); ir++) {
    GSVRun *run = Run(ir);
    count += run->NLasers();
  }
  return count;
}

// Assembly:
movslq 0x14(%rdi), %rcx
testq %rcx, %rcx
jle 0x32cdb
movq 0x8(%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %rdi
addl 0x44(%rdi), %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x32ccb
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::NSurveys() const
int GSVScene::
NSurveys(void) const
{
  // Return number of surveys in scene
  int count = 0;
  for (int i = 0; i < NRuns(); i++) {
    GSVRun *run = Run(i);
    count += run->NSurveys();
  }
  return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x14(%rdi)
jle 0x32d0d
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x37dda
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32cf0
jmp 0x32d0f
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::NScans() const
int GSVScene::
NScans(void) const
{
  // Return number of scans in scene
  int count = 0;
  for (int i = 0; i < NRuns(); i++) {
    GSVRun *run = Run(i);
    count += run->NScans();
  }
  return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x14(%rdi)
jle 0x32d45
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x37dfe
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32d28
jmp 0x32d47
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::NScanlines() const
int GSVScene::
NScanlines(void) const
{
  // Return number of scanlines in scene
  int count = 0;
  for (int i = 0; i < NRuns(); i++) {
    GSVRun *run = Run(i);
    count += run->NScanlines();
  }
  return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x14(%rdi)
jle 0x32d7d
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x37e36
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32d60
jmp 0x32d7f
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::NPoints() const
int GSVScene::
NPoints(void) const
{
  // Return number of points in all runs
  int npoints = 0;
  for (int i = 0; i < NRuns(); i++) 
    npoints += Run(i)->NPoints();
  return npoints;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x14(%rdi)
jle 0x32db5
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x37e6e
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32d98
jmp 0x32db7
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::Draw(gaps::RNFlags) const
void GSVScene::
Draw(RNFlags flags) const
{
  // Draw runs
  for (int i = 0; i < NRuns(); i++) {
    GSVRun *run = Run(i);
    run->Draw(flags);
  }
}

// Assembly:
cmpl $0x0, 0x14(%rdi)
jle 0x32e44
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x10(%rax)
incq %r15
movslq 0x14(%r14), %rax
cmpq %rax, %r15
jl 0x32e22
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::Print(_IO_FILE*, char const*, char const*) const
void GSVScene::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print scene header
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "%s", "GSVScene");
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");

  // Add indentation to prefix
  char indented_prefix[1024];
  sprintf(indented_prefix, "%s  ", prefix);

   // Print runs
  for (int i = 0; i < NRuns(); i++) {
    GSVRun *run = Run(i);
    run->Print(fp, indented_prefix, suffix);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
testq %rsi, %rsi
jne 0x32e71
movq 0x1a20a2(%rip), %rax    # 0x1d4f10
movq (%rax), %r15
testq %r12, %r12
je 0x32e81
movq %r12, %rdi
movq %r15, %rsi
callq 0x27a90
leaq 0x119b63(%rip), %rdi    # 0x14c9eb
movq %r15, %rsi
callq 0x27a90
testq %rbx, %rbx
je 0x32ea0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27a90
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c30
leaq 0x119b40(%rip), %rsi    # 0x14c9f4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x14(%r14)
jle 0x32ef1
xorl %r13d, %r13d
movq %rsp, %r12
movq 0x8(%r14), %rax
movq (%rax,%r13,8), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq *0x18(%rax)
incq %r13
movslq 0x14(%r14), %rax
cmpq %rax, %r13
jl 0x32ece
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::CreateCacheDataDirectory(char const*, gaps::GSVRun*) const
int GSVScene::
CreateCacheDataDirectory(const char *subdirectory, GSVRun *run) const
{
  // Check cache directory name
  if (!cache_data_directory_name) return 0;

  // Create the cache subdirectory
  if (subdirectory && (strlen(subdirectory) > 0)) {
    char cmd[4096];
    if (run->Name()) sprintf(cmd, "mkdir -p %s/%s/%s", cache_data_directory_name, subdirectory, run->Name());
    else sprintf(cmd, "mkdir -p %s/%s/Run%d", cache_data_directory_name, subdirectory, run->SceneIndex());
    system(cmd);
  }
  else if (run) {
    char cmd[4096];
    if (run->Name()) sprintf(cmd, "mkdir -p %s/run_data/%s", cache_data_directory_name, run->Name());
    else sprintf(cmd, "mkdir -p %s/run_data/Run%d", cache_data_directory_name, run->SceneIndex());
    system(cmd);
  }
  else {
    char cmd[4096];
    sprintf(cmd, "mkdir -p %s", cache_data_directory_name);
    system(cmd);
  }

  // Return success
  return 1;
}

// Assembly:
movq %rdx, %rax
movq 0x28(%rdi), %rdx
testq %rdx, %rdx
je 0x32fcc
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rsi, %rcx
testq %rsi, %rsi
je 0x32fab
cmpb $0x0, (%rcx)
je 0x32fab
movq 0x48(%rax), %r8
testq %r8, %r8
je 0x32fe8
leaq 0x119a5a(%rip), %rsi    # 0x14c9f9
movq %rsp, %rdi
xorl %eax, %eax
callq 0x27140
jmp 0x33013
testq %rax, %rax
je 0x32fcf
movq 0x48(%rax), %rcx
testq %rcx, %rcx
je 0x32fff
leaq 0x119a60(%rip), %rsi    # 0x14ca20
movq %rsp, %rdi
xorl %eax, %eax
callq 0x27140
jmp 0x33013
xorl %eax, %eax
retq
leaq 0x119a7d(%rip), %rsi    # 0x14ca53
movq %rsp, %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x27140
movq %rbx, %rdi
jmp 0x33016
movl 0x10(%rax), %r8d
leaq 0x119a18(%rip), %rsi    # 0x14ca0b
movq %rsp, %rdi
xorl %eax, %eax
callq 0x27140
jmp 0x33013
movl 0x10(%rax), %ecx
leaq 0x119a2f(%rip), %rsi    # 0x14ca38
movq %rsp, %rdi
xorl %eax, %eax
callq 0x27140
movq %rsp, %rdi
callq 0x277d0
movl $0x1, %eax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::UpdateBBox()
void GSVScene::
UpdateBBox(void) 
{
  // Update bounding box
  bbox = R3null_box;
  for (int i = 0; i < NRuns(); i++) {
    bbox.Union(Run(i)->BBox());
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x38, %rdi
leaq 0x1ab958(%rip), %r14    # 0x1de998
leaq 0x8(%r14), %rsi
callq 0xd4746
leaq 0x50(%rbx), %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0xd4746
cmpl $0x0, 0x14(%rbx)
jle 0x330a3
leaq 0x30(%rbx), %r14
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x58(%r15), %xmm0
ucomisd 0x118f8c(%rip), %xmm0   # 0x14c008
jne 0x33088
jp 0x33088
movq %r15, %rdi
callq 0x381ac
addq $0x50, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbe428
incq %r12
movslq 0x14(%rbx), %rax
cmpq %rax, %r12
jl 0x33066
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::UpdateNormals()
void GSVScene::
UpdateNormals(void) 
{
  // Update normals
  for (int i = 0; i < NRuns(); i++) {
    GSVRun *run = Run(i);
    run->UpdateNormals();
  }
}

// Assembly:
cmpl $0x0, 0x14(%rdi)
jle 0x33166
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x382c4
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x33146
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::InvalidateNormals()
void GSVScene::
InvalidateNormals(void) 
{
  // Invalidate normals
  for (int i = 0; i < NRuns(); i++) {
    GSVRun *run = Run(i);
    run->InvalidateNormals();
  }
}

// Assembly:
cmpl $0x0, 0x14(%rdi)
jle 0x33198
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x382f6
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x33178
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::WriteFile(char const*) const
int GSVScene::
WriteFile(const char *filename) const
{
  // Parse input filename extension
  const char *extension;
  if (!(extension = strrchr(filename, '.'))) {
    RNFail("Filename %s has no extension (e.g., .gsv)\n", filename);
    return 0;
  }

  // Write file of appropriate type
  if (!strncmp(extension, ".gsv", 4)) return WriteGSVFile(filename);

  // Did not recognize extension
  RNFail("Unable to write file %s (unrecognized extension: %s)\n", filename, extension);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movl $0x2e, %esi
callq 0x27a20
testq %rax, %rax
je 0x334f0
movq %rax, %r15
leaq 0x119039(%rip), %rsi    # 0x14c502
movl $0x4, %edx
movq %rax, %rdi
callq 0x273f0
testl %eax, %eax
je 0x33509
leaq 0x1195ed(%rip), %rdi    # 0x14cace
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xfb6f2
jmp 0x33501
leaq 0x119568(%rip), %rdi    # 0x14ca5f
movq %rbx, %rsi
xorl %eax, %eax
callq 0xfb6f2
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rax
movq 0x50(%rax), %rax
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::ReadGSVFile(char const*, int)
int GSVScene::
ReadGSVFile(const char *filename, RNBoolean read_points)
{
  // Get version
  int major_version = GetGSVMajorVersion(filename);
  
  // Open file
  FILE *fp = fopen(filename, "rb");
  if (!fp) {
    RNFail("Unable to open GSV scene file: %s\n", filename);
    return 0;
  }

  // Read file
  if (major_version < 1) {
    if (!ReadGSVStreamFromOldVersion(fp)) return 0;
  }
  else {
    if (!ReadGSVStream(fp)) return 0;
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
callq 0x33e0a
movl %eax, %ebp
leaq 0x118e20(%rip), %rsi    # 0x14cbbb
movq %r15, %rdi
callq 0x27b20
testq %rax, %rax
je 0x33dc2
movq %rax, %rbx
testl %ebp, %ebp
jle 0x33dd7
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq *0x58(%rax)
jmp 0x33de7
leaq 0x118d3b(%rip), %rdi    # 0x14cb04
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0xfb6f2
jmp 0x33dfc
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x33f28
testl %eax, %eax
je 0x33dfa
movq %rbx, %rdi
callq 0x27920
movl $0x1, %ebx
jmp 0x33dfc
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::GetGSVMajorVersion(char const*)
int GSVScene::
GetGSVMajorVersion(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "rb");
  if (!fp) {
    RNFail("Unable to open GSV scene file: %s\n", filename);
    return 0;
  }

  // Read magic keyword
  char magic[16] = { '\0' };
  if (fread(magic, sizeof(char), 16, fp) != (unsigned int) 16) {
    RNFail("Unable to read first bytes from GSV scene file\n");
    fclose(fp);
    return 0;
  }

  // Check magic keyword
  if (strcmp(magic, "GSV")) {
    RNFail("Invalid file format for GSV scene file\n");
    fclose(fp);
    return 0;
  }

  // Read header
  int dummy0, major_version;
  unsigned long long dummy1;
  fread(&dummy0, sizeof(int), 1, fp);
  fread(&dummy0, sizeof(int), 1, fp);
  fread(&dummy1, sizeof(unsigned long long), 1, fp);
  fread(&dummy0, sizeof(int), 1, fp);
  fread(&major_version, sizeof(int), 1, fp);

  // Close file
  fclose(fp);

  // Return major version
  return major_version;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
leaq 0x118d9f(%rip), %rsi    # 0x14cbbb
movq %r14, %rdi
callq 0x27b20
testq %rax, %rax
je 0x33ee7
movq %rax, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
movl $0x1, %esi
movl $0x10, %edx
movq %rax, %rcx
callq 0x27ec0
cmpq $0x10, %rax
jne 0x33efc
cmpl $0x565347, 0x10(%rsp)   # imm = 0x565347
jne 0x33f05
leaq 0xc(%rsp), %r14
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x27ec0
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x27ec0
leaq 0x28(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x27ec0
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x27ec0
leaq 0x8(%rsp), %r14
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x27ec0
movq %rbx, %rdi
callq 0x27920
movl (%r14), %ebp
jmp 0x33f1d
leaq 0x118c16(%rip), %rdi    # 0x14cb04
xorl %ebp, %ebp
movq %r14, %rsi
xorl %eax, %eax
callq 0xfb6f2
jmp 0x33f1d
leaq 0x118cbe(%rip), %rdi    # 0x14cbc1
jmp 0x33f0c
leaq 0x118ce5(%rip), %rdi    # 0x14cbf1
xorl %ebp, %ebp
xorl %eax, %eax
callq 0xfb6f2
movq %rbx, %rdi
callq 0x27920
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::WriteGSVFile(char const*) const
int GSVScene::
WriteGSVFile(const char *filename) const
{
  // Open file
  FILE *fp = fopen(filename, "wb");
  if (!fp) {
    RNFail("Unable to open GSV scene file: %s\n", filename);
    return 0;
  }

  // Write file
  if (!WriteGSVStream(fp)) return 0;

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x117aa6(%rip), %rsi    # 0x14cbbe
movq %rbx, %rdi
callq 0x27b20
testq %rax, %rax
je 0x35147
movq %rax, %r14
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rsi
callq *0x60(%rax)
testl %eax, %eax
je 0x3515c
movq %r14, %rdi
callq 0x27920
movl $0x1, %ebp
jmp 0x3515e
leaq 0x1179b6(%rip), %rdi    # 0x14cb04
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xfb6f2
jmp 0x3515e
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::ReadScanlinePointsFromOldVersion(_IO_FILE*, gaps::GSVScanline*)
int GSVScene::
ReadScanlinePointsFromOldVersion(FILE *fp, GSVScanline *scanline)
{
  // Get current file offset
  scanline->file_offset = RNFileTell(fp);

  // Read number of points
  int npoints;
  fread(&npoints, sizeof(int), 1, fp);
  if (npoints == 0) return 1;

  // Allocate points
  GSVPoint *points = new GSVPoint [ npoints ];
  if (!points) return 0;
  
  // Read positions
  for (int i = 0; i < npoints; i++) {
    R3Point position;
    fread(&position, sizeof(R3Point), 1, fp);
    points[i].SetPosition(position);
  }

  // Set points
  scanline->SetPoints(points, npoints);

  // Delete positions
  delete [] points;

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rsi, %rdi
callq 0xfab43
movq %rax, 0x18(%rbx)
leaq 0xc(%rsp), %r15
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x27ec0
movslq (%r15), %r15
testq %r15, %r15
je 0x37b50
movq %rbx, (%rsp)
movl $0x50, %ecx
movq %r15, %rax
mulq %rcx
movq $-0x1, %r13
cmovnoq %rax, %r13
movq %r13, %rdi
callq 0x27040
movq %rax, %r12
movq %r15, %rax
shlq $0x4, %rax
leaq (%rax,%rax,4), %rbp
xorl %ebx, %ebx
leaq (%r12,%rbx), %rdi
callq 0x45524
addq $0x50, %rbx
cmpq %rbx, %rbp
jne 0x37ade
testl %r15d, %r15d
jle 0x37b39
xorl %ebx, %ebx
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0xd43dc
movl $0x18, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %r14, %rcx
callq 0x27ec0
movaps 0x10(%rsp), %xmm0
movups %xmm0, (%r12,%rbx)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x10(%r12,%rbx)
addq $0x50, %rbx
cmpq %rbx, %rbp
jne 0x37afc
movq (%rsp), %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x4109c
movq %r12, %rdi
callq 0x27ca0
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r12, %rdi
movq %r13, %rsi
callq 0x28330
movq %rbx, %rdi
callq 0x28150
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::~GSVRun()
GSVRun::
~GSVRun(void)
{
  // Remove run from scene
  if (scene) scene->RemoveRun(this);

  // Delete segments
  while (NSegments() > 0) delete Segment(0);

  // Delete cameras
  while (NCameras() > 0) delete Camera(0);

  // Delete lasers
  while (NLasers() > 0) delete Laser(0);

  // Delete name
  if (name) free(name);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x194c59(%rip), %rax    # 0x1cc8a8
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x37c63
movq %rbx, %rsi
callq 0x32dd2
movl 0x24(%rbx), %eax
testl %eax, %eax
jle 0x37c7e
movq 0x18(%rbx), %rcx
movq (%rcx), %rdi
testq %rdi, %rdi
je 0x37c66
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x37c63
movl 0x34(%rbx), %eax
testl %eax, %eax
jle 0x37c99
movq 0x28(%rbx), %rcx
movq (%rcx), %rdi
testq %rdi, %rdi
je 0x37c81
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x37c7e
movl 0x44(%rbx), %eax
testl %eax, %eax
jle 0x37cb4
movq 0x38(%rbx), %rcx
movq (%rcx), %rdi
testq %rdi, %rdi
je 0x37c9c
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x37c99
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x37cc2
callq 0x27b40
leaq 0x50(%rbx), %rdi
callq 0xbe790
leaq 0x38(%rbx), %rdi
callq 0xf8bea
leaq 0x28(%rbx), %rdi
callq 0xf8bea
addq $0x18, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0xf8bea
movq %rax, %rdi
callq 0x3964d
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::Segment(char const*) const
GSVSegment *GSVRun::
Segment(const char *name) const
{
  // Return segment with matching name
  for (int i = 0; i < NSegments(); i++) {
    GSVSegment *segment = Segment(i);
    if (!segment->Name()) continue;
    if (!strcmp(segment->Name(), name)) return segment;
  }

  // None found
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x24(%rdi), %r15
testq %r15, %r15
jle 0x37d4a
movq %rsi, %rbx
movq 0x18(%rdi), %r12
xorl %r13d, %r13d
movq (%r12,%r13,8), %r14
movq 0x88(%r14), %rdi
testq %rdi, %rdi
je 0x37d42
movq %rbx, %rsi
callq 0x27d80
testl %eax, %eax
je 0x37d4d
incq %r13
cmpq %r13, %r15
jne 0x37d26
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::NTapestries() const
int GSVRun::
NTapestries(void) const
{
  // Return number of tapestries in run
  int count = 0;
  for (int is = 0; is < NSegments(); is++) {
    GSVSegment *segment = Segment(is);
    count += segment->NTapestries();
  }
  return count;
}

// Assembly:
movslq 0x24(%rdi), %rcx
testq %rcx, %rcx
jle 0x37d7b
movq 0x18(%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %rdi
addl 0x3c(%rdi), %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x37d6b
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::NPanoramas() const
int GSVRun::
NPanoramas(void) const
{
  // Return number of panoramas in run
  int count = 0;
  for (int is = 0; is < NSegments(); is++) {
    GSVSegment *segment = Segment(is);
    count += segment->NPanoramas();
  }
  return count;
}

// Assembly:
movslq 0x24(%rdi), %rcx
testq %rcx, %rcx
jle 0x37d9f
movq 0x18(%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %rdi
addl 0x4c(%rdi), %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x37d8f
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::NImages() const
int GSVRun::
NImages(void) const
{
  // Return number of images in run
  int count = 0;
  for (int is = 0; is < NSegments(); is++) {
    GSVSegment *segment = Segment(is);
    count += segment->NImages();
  }
  return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x24(%rdi)
jle 0x37dd1
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x39854
addl %eax, %ebp
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x37db4
jmp 0x37dd3
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::NSurveys() const
int GSVRun::
NSurveys(void) const
{
  // Return number of surveys in run
  int count = 0;
  for (int is = 0; is < NSegments(); is++) {
    GSVSegment *segment = Segment(is);
    count += segment->NSurveys();
  }
  return count;
}

// Assembly:
movslq 0x24(%rdi), %rcx
testq %rcx, %rcx
jle 0x37dfb
movq 0x18(%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %rdi
addl 0x2c(%rdi), %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x37deb
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::NScans() const
int GSVRun::
NScans(void) const
{
  // Return number of scans in run
  int count = 0;
  for (int is = 0; is < NSegments(); is++) {
    GSVSegment *segment = Segment(is);
    count += segment->NScans();
  }
  return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x24(%rdi)
jle 0x37e2d
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x398b2
addl %eax, %ebp
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x37e10
jmp 0x37e2f
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::NScanlines() const
int GSVRun::
NScanlines(void) const
{
  // Return number of scanlines in run
  int count = 0;
  for (int is = 0; is < NSegments(); is++) {
    GSVSegment *segment = Segment(is);
    count += segment->NScanlines();
  }
  return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x24(%rdi)
jle 0x37e65
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x39910
addl %eax, %ebp
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x37e48
jmp 0x37e67
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::NPoints() const
int GSVRun::
NPoints(void) const
{
  // Return number of points in all segments
  int npoints = 0;
  for (int i = 0; i < NSegments(); i++) 
    npoints += Segment(i)->NPoints();
  return npoints;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x24(%rdi)
jle 0x37e9d
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x39b3a
addl %eax, %ebp
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x37e80
jmp 0x37e9f
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::RemoveSegment(gaps::GSVSegment*)
void GSVRun::
RemoveSegment(GSVSegment *segment)
{
  // Just checking
  assert(segment->run_index >= 0);
  assert(segment->run_index < segments.NEntries());
  assert(segment->run == this);

  // Remove segment
  RNArrayEntry *entry = segments.KthEntry(segment->run_index);
  GSVSegment *tail = segments.Tail();
  tail->run_index = segment->run_index;
  segments.EntryContents(entry) = tail;
  segments.RemoveTail();
  segment->run_index = -1;
  segment->run = NULL;

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x18, %rdi
movslq 0x18(%rsi), %rax
movq 0x18(%r14), %rcx
movslq 0x24(%r14), %rdx
movq -0x8(%rcx,%rdx,8), %rsi
movl %eax, 0x18(%rsi)
movq %rsi, (%rcx,%rax,8)
leal -0x1(%rdx), %esi
callq 0xf8da0
movl $0xffffffff, 0x18(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x10(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x37ec6
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::RemoveLaser(gaps::GSVLaser*)
void GSVRun::
RemoveLaser(GSVLaser *laser)
{
  // Just checking
  assert(laser->run_index >= 0);
  assert(laser->run_index < lasers.NEntries());
  assert(laser->run == this);

  // Remove laser
  RNArrayEntry *entry = lasers.KthEntry(laser->run_index);
  GSVLaser *tail = lasers.Tail();
  tail->run_index = laser->run_index;
  lasers.EntryContents(entry) = tail;
  lasers.RemoveTail();
  laser->run_index = -1;
  laser->run = NULL;

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x38, %rdi
movslq 0x10(%rsi), %rax
movq 0x38(%r14), %rcx
movslq 0x44(%r14), %rdx
movq -0x8(%rcx,%rdx,8), %rsi
movl %eax, 0x10(%rsi)
movq %rsi, (%rcx,%rax,8)
leal -0x1(%rdx), %esi
callq 0xf8da0
movl $0xffffffff, 0x10(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x8(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x37ec6
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::Draw(gaps::RNFlags) const
void GSVRun::
Draw(RNFlags flags) const
{
  // Draw segments
  for (int i = 0; i < NSegments(); i++) {
    GSVSegment *segment = Segment(i);
    segment->Draw(flags);
  }
}

// Assembly:
cmpl $0x0, 0x24(%rdi)
jle 0x380e8
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x10(%rax)
incq %r15
movslq 0x24(%r14), %rax
cmpq %rax, %r15
jl 0x380c6
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::Print(_IO_FILE*, char const*, char const*) const
void GSVRun::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print run 
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "Run %d:", scene_index);
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");

  // Add indentation to prefix
  char indented_prefix[1024];
  sprintf(indented_prefix, "%s  ", prefix);

   // Print segments
  for (int i = 0; i < NSegments(); i++) {
    GSVSegment *segment = Segment(i);
    segment->Print(fp, indented_prefix, suffix);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
testq %rsi, %rsi
jne 0x38115
movq 0x19cdfe(%rip), %rax    # 0x1d4f10
movq (%rax), %r15
testq %r12, %r12
je 0x38125
movq %r12, %rdi
movq %r15, %rsi
callq 0x27a90
movl 0x10(%r14), %edx
leaq 0x114ba0(%rip), %rsi    # 0x14ccd0
movq %r15, %rdi
xorl %eax, %eax
callq 0x27e00
testq %rbx, %rbx
je 0x3814a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27a90
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c30
leaq 0x114896(%rip), %rsi    # 0x14c9f4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x24(%r14)
jle 0x3819b
xorl %r13d, %r13d
movq %rsp, %r12
movq 0x18(%r14), %rax
movq (%rax,%r13,8), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq *0x18(%rax)
incq %r13
movslq 0x24(%r14), %rax
cmpq %rax, %r13
jl 0x38178
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::UpdateBBox()
void GSVRun::
UpdateBBox(void) 
{
  // Update bounding box
  bbox = R3null_box;
  for (int i = 0; i < NSegments(); i++) bbox.Union(Segment(i)->BBox());
  for (int i = 0; i < NLasers(); i++) bbox.Union(Laser(i)->BBox());
  for (int i = 0; i < NCameras(); i++) bbox.Union(Camera(i)->BBox());
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x50(%rdi), %r14
addq $0x58, %rdi
leaq 0x1a67d2(%rip), %r15    # 0x1de998
leaq 0x8(%r15), %rsi
callq 0xd4746
leaq 0x70(%rbx), %rdi
addq $0x20, %r15
movq %r15, %rsi
callq 0xd4746
cmpl $0x0, 0x24(%rbx)
jle 0x38225
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x58(%r15), %xmm0
ucomisd 0x113e0a(%rip), %xmm0   # 0x14c008
jne 0x3820a
jp 0x3820a
movq %r15, %rdi
callq 0x3a30e
addq $0x50, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbe428
incq %r12
movslq 0x24(%rbx), %rax
cmpq %rax, %r12
jl 0x381e8
cmpl $0x0, 0x44(%rbx)
jle 0x3826b
xorl %r12d, %r12d
movq 0x38(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x40(%r15), %xmm0
ucomisd 0x113dc4(%rip), %xmm0   # 0x14c008
jne 0x38250
jp 0x38250
movq %r15, %rdi
callq 0x3ed54
addq $0x38, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbe428
incq %r12
movslq 0x44(%rbx), %rax
cmpq %rax, %r12
jl 0x3822e
cmpl $0x0, 0x34(%rbx)
jle 0x382b7
xorl %r12d, %r12d
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x90(%r15), %xmm0
ucomisd 0x113d7b(%rip), %xmm0   # 0x14c008
jne 0x38299
jp 0x38299
movq %r15, %rdi
callq 0x3bb5c
addq $0x88, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbe428
incq %r12
movslq 0x34(%rbx), %rax
cmpq %rax, %r12
jl 0x38274
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::UpdateNormals()
void GSVRun::
UpdateNormals(void) 
{
  // Update normals
  for (int i = 0; i < NSegments(); i++) {
    GSVSegment *segment = Segment(i);
    segment->UpdateNormals();
  }
}

// Assembly:
cmpl $0x0, 0x24(%rdi)
jle 0x382f4
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3a420
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x382d4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::InvalidateNormals()
void GSVRun::
InvalidateNormals(void) 
{
  // Invalidate normals
  for (int i = 0; i < NSegments(); i++) {
    GSVSegment *segment = Segment(i);
    segment->InvalidateNormals();
  }
}

// Assembly:
cmpl $0x0, 0x24(%rdi)
jle 0x38326
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3acdc
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x38306
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::~GSVSegment()
GSVSegment::
~GSVSegment(void)
{
  // Remove segment from scene
  assert(scene_index == -1);

  // Remove segment from run
  if (run) run->RemoveSegment(this);

  // Delete surveys
  while (NSurveys() > 0) delete Survey(0);

  // Delete tapestries
  while (NTapestries() > 0) delete Tapestry(0);

  // Delete panoramas
  while (NPanoramas() > 0) delete Panorama(0);

  // Delete name
  if (name) free(name);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x19319f(%rip), %rax    # 0x1cc8e8
movq %rax, (%rdi)
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x3975d
movq %rbx, %rsi
callq 0x37f58
movl 0x2c(%rbx), %eax
testl %eax, %eax
jle 0x39778
movq 0x20(%rbx), %rcx
movq (%rcx), %rdi
testq %rdi, %rdi
je 0x39760
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x3975d
movl 0x3c(%rbx), %eax
testl %eax, %eax
jle 0x39793
movq 0x30(%rbx), %rcx
movq (%rcx), %rdi
testq %rdi, %rdi
je 0x3977b
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x39778
movl 0x4c(%rbx), %eax
testl %eax, %eax
jle 0x397ae
movq 0x40(%rbx), %rcx
movq (%rcx), %rdi
testq %rdi, %rdi
je 0x39796
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x39793
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x397bf
callq 0x27b40
leaq 0x50(%rbx), %rdi
callq 0xbe790
leaq 0x40(%rbx), %rdi
callq 0xf8bea
leaq 0x30(%rbx), %rdi
callq 0xf8bea
addq $0x20, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0xf8bea
movq %rax, %rdi
callq 0x3964d
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::NImages() const
int GSVSegment::
NImages(void) const
{
  // Return number of images in segment
  int count = 0;
  for (int i = 0; i < NTapestries(); i++) {
    GSVTapestry *tapestry = Tapestry(i);
    count += tapestry->NImages();
  }
  return count;
}

// Assembly:
movslq 0x3c(%rdi), %rcx
testq %rcx, %rcx
jle 0x39875
movq 0x30(%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %rdi
addl 0x34(%rdi), %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x39865
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::Image(int) const
GSVImage *GSVSegment::
Image(int image_index) const
{
  // Return image
  for (int i = 0; i < NTapestries(); i++) {
    GSVTapestry *tapestry = Tapestry(i);
    if (image_index >= tapestry->NImages()) image_index -= tapestry->NImages();
    else return tapestry->Image(image_index);
  }

  // Index too high
  return NULL;
}

// Assembly:
movslq 0x3c(%rdi), %rcx
testq %rcx, %rcx
jle 0x398a2
movq 0x30(%rdi), %rdx
xorl %eax, %eax
xorl %edi, %edi
movl %esi, %r8d
movq (%rdx,%rdi,8), %r9
subl 0x34(%r9), %r8d
jl 0x398a5
incq %rdi
movl %r8d, %esi
cmpq %rdi, %rcx
jne 0x3988c
retq
xorl %eax, %eax
retq
movq 0x28(%r9), %rax
movslq %esi, %rcx
movq (%rax,%rcx,8), %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::NScans() const
int GSVSegment::
NScans(void) const
{
  // Return number of scans in segment
  int count = 0;
  for (int i = 0; i < NSurveys(); i++) {
    GSVSurvey *survey = Survey(i);
    count += survey->NScans();
  }
  return count;
}

// Assembly:
movslq 0x2c(%rdi), %rcx
testq %rcx, %rcx
jle 0x398d3
movq 0x20(%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %rdi
addl 0x34(%rdi), %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x398c3
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::Scan(int) const
GSVScan *GSVSegment::
Scan(int scan_index) const
{
  // Return scan
  for (int i = 0; i < NSurveys(); i++) {
    GSVSurvey *survey = Survey(i);
    if (scan_index >= survey->NScans()) scan_index -= survey->NScans();
    else return survey->Scan(scan_index);
  }

  // Index too high
  return NULL;
}

// Assembly:
movslq 0x2c(%rdi), %rcx
testq %rcx, %rcx
jle 0x39900
movq 0x20(%rdi), %rdx
xorl %eax, %eax
xorl %edi, %edi
movl %esi, %r8d
movq (%rdx,%rdi,8), %r9
subl 0x34(%r9), %r8d
jl 0x39903
incq %rdi
movl %r8d, %esi
cmpq %rdi, %rcx
jne 0x398ea
retq
xorl %eax, %eax
retq
movq 0x28(%r9), %rax
movslq %esi, %rcx
movq (%rax,%rcx,8), %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::NScanlines() const
int GSVSegment::
NScanlines(void) const
{
  // Return number of scanlines in segment
  int count = 0;
  for (int i = 0; i < NSurveys(); i++) {
    GSVSurvey *survey = Survey(i);
    count += survey->NScanlines();
  }
  return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x2c(%rdi)
jle 0x3993f
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3efa8
addl %eax, %ebp
incq %r14
movslq 0x2c(%rbx), %rax
cmpq %rax, %r14
jl 0x39922
jmp 0x39941
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::Scanline(int) const
GSVScanline *GSVSegment::
Scanline(int scanline_index) const
{
  // Return scanline
  for (int i = 0; i < NSurveys(); i++) {
    GSVSurvey *survey = Survey(i);
    if (scanline_index >= survey->NScanlines()) scanline_index -= survey->NScanlines();
    else return survey->Scanline(scanline_index);
  }

  // Index too high
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x2c(%rdi)
jle 0x39988
movl %esi, %ebx
movq %rdi, %r14
xorl %r12d, %r12d
movq 0x20(%r14), %rax
movq (%rax,%r12,8), %r15
movq %r15, %rdi
callq 0x3efa8
movq %r15, %rdi
cmpl %eax, %ebx
jl 0x39996
callq 0x3efa8
subl %eax, %ebx
incq %r12
movslq 0x2c(%r14), %rax
cmpq %rax, %r12
jl 0x3995e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3efcc
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::Panorama(char const*) const
GSVPanorama *GSVSegment::
Panorama(const char *name) const
{
  // Return panorama with matching name
  for (int i = 0; i < NPanoramas(); i++) {
    GSVPanorama *panorama = Panorama(i);
    if (!panorama->Name()) continue;
    if (!strcmp(panorama->Name(), name)) return panorama;
  }

  // None found
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x4c(%rdi), %r15
testq %r15, %r15
jle 0x399e5
movq %rsi, %rbx
movq 0x40(%rdi), %r12
xorl %r13d, %r13d
movq (%r12,%r13,8), %r14
movq 0x78(%r14), %rdi
testq %rdi, %rdi
je 0x399dd
movq %rbx, %rsi
callq 0x27d80
testl %eax, %eax
je 0x399e8
incq %r13
cmpq %r13, %r15
jne 0x399c4
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::FindPanoramaBeforeTimestamp(double, int, int) const
GSVPanorama *GSVSegment::
FindPanoramaBeforeTimestamp(RNScalar timestamp, int imin, int imax) const
{
  // Binary search
  int i = (imin + imax) / 2;
  if (i == imin) return Panorama(imin);
  assert(i < imax);
  GSVPanorama *panorama = Panorama(i);
  RNScalar t = panorama->Timestamp();
  if (t > timestamp) return FindPanoramaBeforeTimestamp(timestamp, imin, i);
  else if (t < timestamp) return FindPanoramaBeforeTimestamp(timestamp, i, imax);
  else return panorama;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movl %esi, %ebx
movsd %xmm0, 0x8(%rsp)
movq %rdi, %r15
movl %r14d, %ebp
movl %ebp, %r14d
leal (%r14,%rbx), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
movq 0x40(%r15), %rax
cmpl %ebx, %ebp
je 0x39a6c
movslq %ebp, %rcx
movq (%rax,%rcx,8), %r12
movsd 0x70(%r12), %xmm0
ucomisd 0x11262f(%rip), %xmm0   # 0x14c070
jne 0x39a54
jp 0x39a54
movq %r12, %rdi
callq 0x3cebc
movsd 0x70(%r12), %xmm0
ucomisd 0x8(%rsp), %xmm0
ja 0x39a13
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movl %ebp, %ebx
ja 0x39a10
jmp 0x39a73
movslq %ebx, %rcx
movq (%rax,%rcx,8), %r12
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop