LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x19bb7f(%rip), %rax    # 0x1ce820
movq %rax, (%rdi)
cmpl $0x0, 0x14(%rdi)
jle 0x32cc2
movq 0x8(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x32cbc
movq (%rdi), %rax
callq *0x8(%rax)
cmpl $0x0, 0x14(%rbx)
jg 0x32caa
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x32cd0
callq 0x27b50
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x32cde
callq 0x27b50
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x32cec
callq 0x27b50
leaq 0x68(%rbx), %rdi
callq 0xc1dc4
leaq 0x30(%rbx), %rdi
callq 0xbfe90
addq $0x8, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0xfa836
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq 0x14(%rdi), %r15
testq %r15, %r15
jle 0x32d76
movq %rsi, %rbx
movq 0x8(%rdi), %r12
xorl %r13d, %r13d
movq (%r12,%r13,8), %rbp
movq 0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x32d64
movq %rbx, %rsi
callq 0x27d90
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
cmoveq %rbp, %r14
jmp 0x32d69
movl $0x4, %ecx
testb $0x3, %cl
jne 0x32d79
incq %r13
cmpq %r13, %r15
jne 0x32d42
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32dad
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 0x32d9d
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32dd1
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 0x32dc1
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32e03
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x37f1a
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32de6
jmp 0x32e05
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32e3b
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x37f3e
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32e1e
jmp 0x32e3d
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32e73
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x37f62
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32e56
jmp 0x32e75
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32e9d
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 0x32e8d
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32ecf
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x37f9a
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32eb2
jmp 0x32ed1
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32f07
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x37fbe
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32eea
jmp 0x32f09
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32f3f
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x37ff6
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32f22
jmp 0x32f41
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32f77
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3802e
addl %eax, %ebp
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x32f5a
jmp 0x32f79
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x33006
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 0x32fe4
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x33033
movq 0x1a3ee0(%rip), %rax    # 0x1d6f10
movq (%rax), %r15
testq %r12, %r12
je 0x33043
movq %r12, %rdi
movq %r15, %rsi
callq 0x27aa0
leaq 0x11b991(%rip), %rdi    # 0x14e9db
movq %r15, %rsi
callq 0x27aa0
testq %rbx, %rbx
je 0x33062
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27aa0
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c40
leaq 0x11b96e(%rip), %rsi    # 0x14e9e4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x14(%r14)
jle 0x330b3
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 0x33090
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3318e
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rsi, %rcx
testq %rsi, %rsi
je 0x3316d
cmpb $0x0, (%rcx)
je 0x3316d
movq 0x48(%rax), %r8
testq %r8, %r8
je 0x331aa
leaq 0x11b888(%rip), %rsi    # 0x14e9e9
movq %rsp, %rdi
xorl %eax, %eax
callq 0x27140
jmp 0x331d5
testq %rax, %rax
je 0x33191
movq 0x48(%rax), %rcx
testq %rcx, %rcx
je 0x331c1
leaq 0x11b88e(%rip), %rsi    # 0x14ea10
movq %rsp, %rdi
xorl %eax, %eax
callq 0x27140
jmp 0x331d5
xorl %eax, %eax
retq
leaq 0x11b8ab(%rip), %rsi    # 0x14ea43
movq %rsp, %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x27140
movq %rbx, %rdi
jmp 0x331d8
movl 0x10(%rax), %r8d
leaq 0x11b846(%rip), %rsi    # 0x14e9fb
movq %rsp, %rdi
xorl %eax, %eax
callq 0x27140
jmp 0x331d5
movl 0x10(%rax), %ecx
leaq 0x11b85d(%rip), %rsi    # 0x14ea28
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_O1/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 0x1ad7a6(%rip), %r14    # 0x1e09a8
leaq 0x8(%r14), %rsi
callq 0xd619c
leaq 0x50(%rbx), %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0xd619c
cmpl $0x0, 0x14(%rbx)
jle 0x33265
leaq 0x30(%rbx), %r14
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x58(%r15), %xmm0
ucomisd 0x11adca(%rip), %xmm0   # 0x14e008
jne 0x3324a
jp 0x3324a
movq %r15, %rdi
callq 0x3836c
addq $0x50, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbfb20
incq %r12
movslq 0x14(%rbx), %rax
cmpq %rax, %r12
jl 0x33228
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x33328
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x38484
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x33308
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3335a
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x384b6
incq %r14
movslq 0x14(%rbx), %rax
cmpq %rax, %r14
jl 0x3333a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::UpdatePointIdentifiers()
void GSVScene::
UpdatePointIdentifiers(void) 
{
  // Update all point identifiers
  int point_identifier = 0;
  for (int ir = 0; ir < NRuns(); ir++) {
    GSVRun *run = Run(ir);
    for (int is = 0; is < run->NSegments(); is++) {
      GSVSegment *segment = run->Segment(is);
      for (int iu = 0; iu < segment->NSurveys(); iu++) {
        GSVSurvey *survey = segment->Survey(iu);
        for (int ia = 0; ia < survey->NScans(); ia++) {
          GSVScan *scan = survey->Scan(ia);
          scan->ReadPoints();
          for (int ie = 0; ie < scan->NScanlines(); ie++) {
            GSVScanline *scanline = scan->Scanline(ie);
            for (int ik = 0; ik < scanline->NPoints(); ik++) {
              scanline->SetPointIdentifier(ik, point_identifier++);
            }
          }
          scan->ReleasePoints();
        }
      }
    }
  }

  // Just checking
  assert(point_identifier == NPoints());
}

// Assembly:
cmpl $0x0, 0x14(%rdi)
jle 0x33483
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorl %ecx, %ecx
xorl %ebp, %ebp
movq %rdi, 0x8(%rsp)
movq 0x8(%rdi), %rax
movq %rcx, 0x10(%rsp)
movq (%rax,%rcx,8), %rcx
cmpl $0x0, 0x24(%rcx)
jle 0x3345b
xorl %edx, %edx
movq %rcx, 0x18(%rsp)
movq 0x18(%rcx), %rax
movq %rdx, 0x20(%rsp)
movq (%rax,%rdx,8), %rbx
cmpl $0x0, 0x2c(%rbx)
jle 0x33441
xorl %r15d, %r15d
movq 0x20(%rbx), %rax
movq (%rax,%r15,8), %r12
cmpl $0x0, 0x34(%r12)
jle 0x33431
xorl %r13d, %r13d
movq 0x28(%r12), %rax
movq (%rax,%r13,8), %r14
movq %r14, %rdi
callq 0x405e6
movslq 0x34(%r14), %rax
testq %rax, %rax
jle 0x3341c
movq 0x28(%r14), %rcx
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
movslq 0x30(%rsi), %rdi
testq %rdi, %rdi
jle 0x33414
movq 0x28(%rsi), %rsi
shlq $0x4, %rdi
leaq (%rdi,%rdi,4), %rdi
xorl %r8d, %r8d
movl %ebp, 0x38(%rsi,%r8)
incl %ebp
addq $0x50, %r8
cmpq %r8, %rdi
jne 0x33404
incq %rdx
cmpq %rax, %rdx
jne 0x333e8
movq %r14, %rdi
callq 0x406c0
incq %r13
movslq 0x34(%r12), %rax
cmpq %rax, %r13
jl 0x333c8
incq %r15
movslq 0x2c(%rbx), %rax
cmpq %rax, %r15
jl 0x333b5
movq 0x20(%rsp), %rdx
incq %rdx
movq 0x18(%rsp), %rcx
movslq 0x24(%rcx), %rax
cmpq %rax, %rdx
jl 0x3339b
movq 0x10(%rsp), %rcx
incq %rcx
movq 0x8(%rsp), %rdi
movslq 0x14(%rdi), %rax
cmpq %rax, %rcx
jl 0x3337d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x336bc
movq %rax, %r15
leaq 0x11ae60(%rip), %rsi    # 0x14e4f5
movl $0x4, %edx
movq %rax, %rdi
callq 0x273f0
testl %eax, %eax
je 0x336d5
leaq 0x11b411(%rip), %rdi    # 0x14eabe
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xfd64a
jmp 0x336cd
leaq 0x11b38c(%rip), %rdi    # 0x14ea4f
movq %rbx, %rsi
xorl %eax, %eax
callq 0xfd64a
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_O1/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 0x33ff6
movl %eax, %ebp
leaq 0x11ac24(%rip), %rsi    # 0x14ebab
movq %r15, %rdi
callq 0x27b30
testq %rax, %rax
je 0x33fae
movq %rax, %rbx
testl %ebp, %ebp
jle 0x33fc3
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq *0x58(%rax)
jmp 0x33fd3
leaq 0x11ab3f(%rip), %rdi    # 0x14eaf4
xorl %ebx, %ebx
movq %r15, %rsi
xorl %eax, %eax
callq 0xfd64a
jmp 0x33fe8
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x34114
testl %eax, %eax
je 0x33fe6
movq %rbx, %rdi
callq 0x27920
movl $0x1, %ebx
jmp 0x33fe8
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_O1/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 0x11aba3(%rip), %rsi    # 0x14ebab
movq %r14, %rdi
callq 0x27b30
testq %rax, %rax
je 0x340d3
movq %rax, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
movl $0x1, %esi
movl $0x10, %edx
movq %rax, %rcx
callq 0x27ed0
cmpq $0x10, %rax
jne 0x340e8
cmpl $0x565347, 0x10(%rsp)   # imm = 0x565347
jne 0x340f1
leaq 0xc(%rsp), %r14
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x27ed0
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x27ed0
leaq 0x28(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x27ed0
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x27ed0
leaq 0x8(%rsp), %r14
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x27ed0
movq %rbx, %rdi
callq 0x27920
movl (%r14), %ebp
jmp 0x34109
leaq 0x11aa1a(%rip), %rdi    # 0x14eaf4
xorl %ebp, %ebp
movq %r14, %rsi
xorl %eax, %eax
callq 0xfd64a
jmp 0x34109
leaq 0x11aac2(%rip), %rdi    # 0x14ebb1
jmp 0x340f8
leaq 0x11aae9(%rip), %rdi    # 0x14ebe1
xorl %ebp, %ebp
xorl %eax, %eax
callq 0xfd64a
movq %rbx, %rdi
callq 0x27920
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1198ce(%rip), %rsi    # 0x14ebae
movq %rbx, %rdi
callq 0x27b30
testq %rax, %rax
je 0x3530f
movq %rax, %r14
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rsi
callq *0x60(%rax)
testl %eax, %eax
je 0x35324
movq %r14, %rdi
callq 0x27920
movl $0x1, %ebp
jmp 0x35326
leaq 0x1197de(%rip), %rdi    # 0x14eaf4
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %eax, %eax
callq 0xfd64a
jmp 0x35326
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_O1/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 0xfc9f7
movq %rax, 0x18(%rbx)
leaq 0xc(%rsp), %r15
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x27ed0
movslq (%r15), %r15
testq %r15, %r15
je 0x37cfa
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 0x459f0
addq $0x50, %rbx
cmpq %rbx, %rbp
jne 0x37c88
testl %r15d, %r15d
jle 0x37ce3
xorl %ebx, %ebx
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0xd5e2c
movl $0x18, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %r14, %rcx
callq 0x27ed0
movaps 0x10(%rsp), %xmm0
movups %xmm0, (%r12,%rbx)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x10(%r12,%rbx)
addq $0x50, %rbx
cmpq %rbx, %rbp
jne 0x37ca6
movq (%rsp), %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x4152e
movq %r12, %rdi
callq 0x27cb0
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 0x28340
movq %rbx, %rdi
callq 0x28160
// File: /workspace/github_cpp_makefile_star2_O1/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 0x196ab1(%rip), %rax    # 0x1ce8a8
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x37e1f
movq %rbx, %rsi
callq 0x32f94
jmp 0x37e1f
movq 0x18(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x37e1f
movq (%rdi), %rax
callq *0x8(%rax)
cmpl $0x0, 0x24(%rbx)
jg 0x37e0d
jmp 0x37e39
movq 0x28(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x37e39
movq (%rdi), %rax
callq *0x8(%rax)
cmpl $0x0, 0x34(%rbx)
jg 0x37e27
jmp 0x37e53
movq 0x38(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x37e53
movq (%rdi), %rax
callq *0x8(%rax)
cmpl $0x0, 0x44(%rbx)
jg 0x37e41
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x37e67
callq 0x27b50
leaq 0x50(%rbx), %rdi
callq 0xbfe90
leaq 0x38(%rbx), %rdi
callq 0xfa836
leaq 0x28(%rbx), %rdi
callq 0xfa836
addq $0x18, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0xfa836
movq %rax, %rdi
callq 0x39936
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq 0x24(%rdi), %r15
testq %r15, %r15
jle 0x37f05
movq %rsi, %rbx
movq 0x18(%rdi), %r12
xorl %r13d, %r13d
movq (%r12,%r13,8), %rbp
movq 0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x37ef3
movq %rbx, %rsi
callq 0x27d90
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
cmoveq %rbp, %r14
jmp 0x37ef8
movl $0x4, %ecx
testb $0x3, %cl
jne 0x37f08
incq %r13
cmpq %r13, %r15
jne 0x37ece
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x37f3b
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 0x37f2b
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x37f5f
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 0x37f4f
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x37f91
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x39b40
addl %eax, %ebp
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x37f74
jmp 0x37f93
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x37fbb
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 0x37fab
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x37fed
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x39ba4
addl %eax, %ebp
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x37fd0
jmp 0x37fef
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x38025
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x39c08
addl %eax, %ebp
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x38008
jmp 0x38027
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3805d
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x39e5a
addl %eax, %ebp
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x38040
jmp 0x3805f
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xfa9d6
movl $0xffffffff, 0x18(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x10(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x38086
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVRun.cpp
// Function: gaps::GSVRun::RemoveCamera(gaps::GSVCamera*)
void GSVRun::
RemoveCamera(GSVCamera *camera)
{
  // Just checking
  assert(camera->run_index >= 0);
  assert(camera->run_index < cameras.NEntries());
  assert(camera->run == this);

  // Remove camera
  RNArrayEntry *entry = cameras.KthEntry(camera->run_index);
  GSVCamera *tail = cameras.Tail();
  tail->run_index = camera->run_index;
  cameras.EntryContents(entry) = tail;
  cameras.RemoveTail();
  camera->run_index = -1;
  camera->run = NULL;

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x28, %rdi
movslq 0x10(%rsi), %rax
movq 0x28(%r14), %rcx
movslq 0x34(%r14), %rdx
movq -0x8(%rcx,%rdx,8), %rsi
movl %eax, 0x10(%rsi)
movq %rsi, (%rcx,%rax,8)
leal -0x1(%rdx), %esi
callq 0xfa9d6
movl $0xffffffff, 0x10(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x8(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x38086
// File: /workspace/github_cpp_makefile_star2_O1/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 0xfa9d6
movl $0xffffffff, 0x10(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x8(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x38086
// File: /workspace/github_cpp_makefile_star2_O1/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 0x382a8
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 0x38286
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x382d5
movq 0x19ec3e(%rip), %rax    # 0x1d6f10
movq (%rax), %r15
testq %r12, %r12
je 0x382e5
movq %r12, %rdi
movq %r15, %rsi
callq 0x27aa0
movl 0x10(%r14), %edx
leaq 0x1169d0(%rip), %rsi    # 0x14ecc0
movq %r15, %rdi
xorl %eax, %eax
callq 0x27e10
testq %rbx, %rbx
je 0x3830a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27aa0
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c40
leaq 0x1166c6(%rip), %rsi    # 0x14e9e4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x24(%r14)
jle 0x3835b
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 0x38338
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1a8622(%rip), %r15    # 0x1e09a8
leaq 0x8(%r15), %rsi
callq 0xd619c
leaq 0x70(%rbx), %rdi
addq $0x20, %r15
movq %r15, %rsi
callq 0xd619c
cmpl $0x0, 0x24(%rbx)
jle 0x383e5
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x58(%r15), %xmm0
ucomisd 0x115c4a(%rip), %xmm0   # 0x14e008
jne 0x383ca
jp 0x383ca
movq %r15, %rdi
callq 0x3a62e
addq $0x50, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbfb20
incq %r12
movslq 0x24(%rbx), %rax
cmpq %rax, %r12
jl 0x383a8
cmpl $0x0, 0x44(%rbx)
jle 0x3842b
xorl %r12d, %r12d
movq 0x38(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x40(%r15), %xmm0
ucomisd 0x115c04(%rip), %xmm0   # 0x14e008
jne 0x38410
jp 0x38410
movq %r15, %rdi
callq 0x3f190
addq $0x38, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbfb20
incq %r12
movslq 0x44(%rbx), %rax
cmpq %rax, %r12
jl 0x383ee
cmpl $0x0, 0x34(%rbx)
jle 0x38477
xorl %r12d, %r12d
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x90(%r15), %xmm0
ucomisd 0x115bbb(%rip), %xmm0   # 0x14e008
jne 0x38459
jp 0x38459
movq %r15, %rdi
callq 0x3be94
addq $0x88, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbfb20
incq %r12
movslq 0x34(%rbx), %rax
cmpq %rax, %r12
jl 0x38434
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x384b4
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3a740
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x38494
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x384e6
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3b01a
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x384c6
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x194eb3(%rip), %rax    # 0x1ce8e8
movq %rax, (%rdi)
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x39a5d
movq %rbx, %rsi
callq 0x38118
jmp 0x39a5d
movq 0x20(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x39a5d
movq (%rdi), %rax
callq *0x8(%rax)
cmpl $0x0, 0x2c(%rbx)
jg 0x39a4b
jmp 0x39a77
movq 0x30(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x39a77
movq (%rdi), %rax
callq *0x8(%rax)
cmpl $0x0, 0x3c(%rbx)
jg 0x39a65
jmp 0x39a91
movq 0x40(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x39a91
movq (%rdi), %rax
callq *0x8(%rax)
cmpl $0x0, 0x4c(%rbx)
jg 0x39a7f
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x39aa8
callq 0x27b50
leaq 0x50(%rbx), %rdi
callq 0xbfe90
leaq 0x40(%rbx), %rdi
callq 0xfa836
leaq 0x30(%rbx), %rdi
callq 0xfa836
addq $0x20, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0xfa836
movq %rax, %rdi
callq 0x39936
// File: /workspace/github_cpp_makefile_star2_O1/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 0x39b61
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 0x39b51
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x39ba1
movq 0x30(%rdi), %rdx
xorl %edi, %edi
movl %esi, %r8d
movq (%rdx,%rdi,8), %r10
movl 0x34(%r10), %r9d
subl %r9d, %r8d
jge 0x39b91
movq 0x28(%r10), %rax
movslq %esi, %r8
movq (%rax,%r8,8), %rax
movl %esi, %r8d
cmpl %r9d, %esi
jl 0x39ba3
incq %rdi
movl %r8d, %esi
cmpq %rdi, %rcx
jne 0x39b76
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x39bc5
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 0x39bb5
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x39c05
movq 0x20(%rdi), %rdx
xorl %edi, %edi
movl %esi, %r8d
movq (%rdx,%rdi,8), %r10
movl 0x34(%r10), %r9d
subl %r9d, %r8d
jge 0x39bf5
movq 0x28(%r10), %rax
movslq %esi, %r8
movq (%rax,%r8,8), %rax
movl %esi, %r8d
cmpl %r9d, %esi
jl 0x39c07
incq %rdi
movl %r8d, %esi
cmpq %rdi, %rcx
jne 0x39bda
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x39c37
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3f3e8
addl %eax, %ebp
incq %r14
movslq 0x2c(%rbx), %rax
cmpq %rax, %r14
jl 0x39c1a
jmp 0x39c39
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x2c(%rdi)
jle 0x39c9d
movl %esi, %ebp
movq %rdi, %rbx
xorl %r13d, %r13d
movq 0x20(%rbx), %rax
movq (%rax,%r13,8), %r12
movq %r12, %rdi
callq 0x3f3e8
movl %eax, %r15d
movq %r12, %rdi
cmpl %eax, %ebp
jge 0x39c81
movl %ebp, %esi
callq 0x3f40c
movq %rax, %r14
movl %ebp, %ecx
jmp 0x39c8a
callq 0x3f3e8
movl %ebp, %ecx
subl %eax, %ecx
cmpl %r15d, %ebp
jl 0x39ca0
incq %r13
movslq 0x2c(%rbx), %rax
movl %ecx, %ebp
cmpq %rax, %r13
jl 0x39c59
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq 0x4c(%rdi), %r15
testq %r15, %r15
jle 0x39d04
movq %rsi, %rbx
movq 0x40(%rdi), %r12
xorl %r13d, %r13d
movq (%r12,%r13,8), %rbp
movq 0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x39cf2
movq %rbx, %rsi
callq 0x27d90
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
cmoveq %rbp, %r14
jmp 0x39cf7
movl $0x4, %ecx
testb $0x3, %cl
jne 0x39d07
incq %r13
cmpq %r13, %r15
jne 0x39cd0
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop