LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVTapestry.cpp
// Function: gaps::GSVTapestry::Print(_IO_FILE*, char const*, char const*) const
void GSVTapestry::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print tapestry header
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "Tapestry %d:", segment_index);
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");

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

   // Print images
  for (int i = 0; i < NImages(); i++) {
    GSVImage *image = Image(i);
    image->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 0x3ed01
movq 0x198212(%rip), %rax    # 0x1d6f10
movq (%rax), %r15
testq %r12, %r12
je 0x3ed11
movq %r12, %rdi
movq %r15, %rsi
callq 0x27aa0
movl 0x10(%r14), %edx
leaq 0x1103ba(%rip), %rsi    # 0x14f0d6
movq %r15, %rdi
xorl %eax, %eax
callq 0x27e10
testq %rbx, %rbx
je 0x3ed36
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27aa0
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c40
leaq 0x10fc9a(%rip), %rsi    # 0x14e9e4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x34(%r14)
jle 0x3ed87
xorl %r13d, %r13d
movq %rsp, %r12
movq 0x28(%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 0x34(%r14), %rax
cmpq %rax, %r13
jl 0x3ed64
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/GSVTapestry.cpp
// Function: gaps::GSVTapestry::UpdateBBox()
void GSVTapestry::
UpdateBBox(void) 
{
  // Update bounding box
  bbox = R3null_box;
  for (int i = 0; i < NImages(); i++) {
    bbox.Union(Image(i)->Pose().Viewpoint());
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
addq $0x40, %rdi
leaq 0x1a1bf5(%rip), %r14    # 0x1e09a8
leaq 0x8(%r14), %rsi
callq 0xd619c
leaq 0x58(%rbx), %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0xd619c
cmpl $0x0, 0x34(%rbx)
jle 0x3ee15
leaq 0x38(%rbx), %r14
leaq 0x8(%rsp), %r15
xorl %r13d, %r13d
movq %rsp, %r12
movq 0x28(%rbx), %rax
movq (%rax,%r13,8), %rsi
movq %r12, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3d698
movq %r14, %rdi
movq %r15, %rsi
callq 0xbfa56
movq %r12, %rdi
callq 0x455ba
incq %r13
movslq 0x34(%rbx), %rax
cmpq %rax, %r13
jl 0x3ede1
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x455ba
movq %rbx, %rdi
callq 0x28160
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVLaser.cpp
// Function: gaps::GSVLaser::GSVLaser(int)
GSVLaser::
GSVLaser(int device_type)
  : run(NULL),
    run_index(-1),
    surveys(),
    device_type(device_type),
    max_sweep_index(0),
    max_beam_index(0),
    bbox(FLT_MAX,FLT_MAX,FLT_MAX,-FLT_MAX,-FLT_MAX,-FLT_MAX),
    data(NULL)
{
  // Set max sweep and beam indices
  if (device_type == GSV_SICK_LASER) {
    max_sweep_index = 0;
    max_beam_index = 179;
  }
  else if (device_type == GSV_VLP16_LASER) {
    max_sweep_index = 1799;
    max_beam_index = 15;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x18fbdd(%rip), %rax    # 0x1cea28
movq %rax, (%rdi)
xorl %r15d, %r15d
movq %r15, 0x8(%rdi)
movl $0xffffffff, 0x10(%rdi) # imm = 0xFFFFFFFF
leaq 0x18(%rdi), %r14
movq %r14, %rdi
callq 0xfa7cc
movl %ebp, 0x28(%rbx)
movq %r15, 0x2c(%rbx)
leaq 0x38(%rbx), %rdi
movsd 0x10f18d(%rip), %xmm0   # 0x14e008
movsd 0x10f2a5(%rip), %xmm3   # 0x14e128
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
movaps %xmm3, %xmm4
movaps %xmm3, %xmm5
callq 0xbf0d8
movq $0x0, 0x70(%rbx)
cmpl $0x1, %ebp
je 0x3eeb0
cmpl $0x2, %ebp
jne 0x3eebc
movsd 0x110252(%rip), %xmm0   # 0x14f100
jmp 0x3eeb8
movsd 0x110258(%rip), %xmm0   # 0x14f110
movlps %xmm0, 0x2c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0xfa836
movq %rbx, %rdi
callq 0x28160
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVLaser.cpp
// Function: gaps::GSVLaser::~GSVLaser()
GSVLaser::
~GSVLaser(void)
{
  // Remove laser from run
  if (run) run->RemoveLaser(this);

  // Remove surveys from this laser
  while (NSurveys() > 0) RemoveSurvey(Survey(0));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x18fb43(%rip), %rax    # 0x1cea28
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3eef9
movq %rbx, %rsi
callq 0x381f0
cmpl $0x0, 0x24(%rbx)
jle 0x3ef10
movq 0x18(%rbx), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x3ef30
jmp 0x3eef9
leaq 0x38(%rbx), %rdi
callq 0xbfe90
addq $0x18, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0xfa836
jmp 0x3ef28
movq %rax, %rdi
callq 0x39936
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVLaser.cpp
// Function: gaps::GSVLaser::Draw(gaps::RNFlags) const
void GSVLaser::
Draw(RNFlags flags) const
{
  // Draw surveys
  for (int i = 0; i < NSurveys(); i++) {
    GSVSurvey *survey = Survey(i);
    survey->Draw(flags);
  }
}

// Assembly:
cmpl $0x0, 0x24(%rdi)
jle 0x3f0cc
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 0x3f0aa
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVLaser.cpp
// Function: gaps::GSVLaser::Print(_IO_FILE*, char const*, char const*) const
void GSVLaser::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print laser header
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "Laser %d:", run_index);
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");

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

 // Print surveys
  for (int i = 0; i < NSurveys(); i++) {
    GSVSurvey *survey = Survey(i);
    survey->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 0x3f0f9
movq 0x197e1a(%rip), %rax    # 0x1d6f10
movq (%rax), %r15
testq %r12, %r12
je 0x3f109
movq %r12, %rdi
movq %r15, %rsi
callq 0x27aa0
movl 0x10(%r14), %edx
leaq 0x11000c(%rip), %rsi    # 0x14f120
movq %r15, %rdi
xorl %eax, %eax
callq 0x27e10
testq %rbx, %rbx
je 0x3f12e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27aa0
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c40
leaq 0x10f8a2(%rip), %rsi    # 0x14e9e4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x24(%r14)
jle 0x3f17f
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 0x3f15c
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/GSVLaser.cpp
// Function: gaps::GSVLaser::UpdateBBox()
void GSVLaser::
UpdateBBox(void) 
{
  // Update bounding box
  bbox = R3null_box;
  for (int i = 0; i < NSurveys(); i++) {
    bbox.Union(Survey(i)->BBox());
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x40, %rdi
leaq 0x1a1802(%rip), %r14    # 0x1e09a8
leaq 0x8(%r14), %rsi
callq 0xd619c
leaq 0x58(%rbx), %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0xd619c
cmpl $0x0, 0x24(%rbx)
jle 0x3f209
leaq 0x38(%rbx), %r14
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x48(%r15), %xmm0
ucomisd 0x10ee26(%rip), %xmm0   # 0x14e008
jne 0x3f1ee
jp 0x3f1ee
movq %r15, %rdi
callq 0x3f830
addq $0x40, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbfb20
incq %r12
movslq 0x24(%rbx), %rax
cmpq %rax, %r12
jl 0x3f1cc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSurvey.cpp
// Function: gaps::GSVSurvey::~GSVSurvey()
GSVSurvey::
~GSVSurvey(void)
{
  // Remove survey from segment
  if (segment) segment->RemoveSurvey(this);

  // Remove survey from laser
  if (laser) laser->RemoveSurvey(this);

  // Delete scans
  while (NScans()) delete Scan(0);

  // Delete travel distances
  if (travel_distances) delete [] travel_distances;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x18f7c7(%rip), %rax    # 0x1cea68
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3f2b5
movq %rbx, %rsi
callq 0x3a34e
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x3f2da
movq %rbx, %rsi
callq 0x3ef30
jmp 0x3f2da
movq 0x28(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3f2da
movq (%rdi), %rax
callq *0x8(%rax)
cmpl $0x0, 0x34(%rbx)
jne 0x3f2c8
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x3f2ee
callq 0x27cb0
leaq 0x40(%rbx), %rdi
callq 0xbfe90
addq $0x28, %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/GSVSurvey.cpp
// Function: gaps::GSVSurvey::NScanlines() const
int GSVSurvey::
NScanlines(void) const
{
  // Return number of scanlines in survey
  int count = 0;
  for (int i = 0; i < NScans(); i++) {
    GSVScan *scan = Scan(i);
    count += scan->NScanlines();
  }
  return count;
}

// Assembly:
movslq 0x34(%rdi), %rcx
testq %rcx, %rcx
jle 0x3f409
movq 0x28(%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %rdi
addl 0x34(%rdi), %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x3f3f9
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSurvey.cpp
// Function: gaps::GSVSurvey::Scanline(int) const
GSVScanline *GSVSurvey::
Scanline(int scanline_index) const
{
  // Return scanline
  for (int i = 0; i < NScans(); i++) {
    GSVScan *scan = Scan(i);
    if (scanline_index >= scan->NScanlines()) scanline_index -= scan->NScanlines();
    else return scan->Scanline(scanline_index);
  }

  // Index too high
  return NULL;
}

// Assembly:
movslq 0x34(%rdi), %rcx
testq %rcx, %rcx
jle 0x3f449
movq 0x28(%rdi), %rdx
xorl %edi, %edi
movl %esi, %r8d
movq (%rdx,%rdi,8), %r10
movl 0x34(%r10), %r9d
subl %r9d, %r8d
jge 0x3f439
movq 0x28(%r10), %rax
movslq %esi, %r8
movq (%rax,%r8,8), %rax
movl %esi, %r8d
cmpl %r9d, %esi
jl 0x3f44b
incq %rdi
movl %r8d, %esi
cmpq %rdi, %rcx
jne 0x3f41e
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSurvey.cpp
// Function: gaps::GSVSurvey::FindScanBeforeTravelDistance(double, int, int) const
GSVScan *GSVSurvey::
FindScanBeforeTravelDistance(RNScalar travel_distance, int imin, int imax) const
{
  // Binary search
  int i = (imin + imax) / 2;
  if (i == imin) return Scan(imin);
  assert(i < imax);
  GSVScan *scan = Scan(i);
  RNScalar t = TravelDistance(scan->SurveyIndex());
  if (t > travel_distance) return FindScanBeforeTravelDistance(travel_distance, imin, i);
  else if (t < travel_distance) return FindScanBeforeTravelDistance(travel_distance, i, imax);
  else return scan;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %ebx
movq %rdi, %r15
movsd %xmm0, (%rsp)
movl %r14d, %ebp
movl %ebp, %r14d
leal (%r14,%rbx), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
movq 0x28(%r15), %rax
cmpl %ebx, %ebp
je 0x3f521
movslq %ebp, %rcx
movq (%rax,%rcx,8), %r12
movslq 0x20(%r12), %r13
cmpq $0x0, 0x38(%r15)
jne 0x3f507
movq %r15, %rdi
callq 0x3f8b6
movsd (%rsp), %xmm0
movq 0x38(%r15), %rax
movsd (%rax,%r13,8), %xmm1
ucomisd %xmm0, %xmm1
ja 0x3f4cf
ucomisd %xmm1, %xmm0
movl %ebp, %ebx
ja 0x3f4cc
jmp 0x3f528
movslq %ebx, %rcx
movq (%rax,%rcx,8), %r12
movq %r12, %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/GSVSurvey.cpp
// Function: gaps::GSVSurvey::FindScanBeforeTravelDistance(double) const
GSVScan *GSVSurvey::
FindScanBeforeTravelDistance(RNScalar travel_distance) const
{
  // Binary search
  if (NScans() == 0) return NULL;
  if (travel_distance <= TravelDistance(0)) return Scan(0);
  if (travel_distance >= TravelDistance(NScans()-1)) return Scan(NScans()-1);
  return FindScanBeforeTravelDistance(travel_distance, 0, NScans()-1);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
cmpl $0x0, 0x34(%rdi)
je 0x3f592
movq %rdi, %rbx
cmpq $0x0, 0x38(%rdi)
jne 0x3f563
movq %rbx, %rdi
movsd %xmm0, 0x8(%rsp)
callq 0x3f8b6
movsd 0x8(%rsp), %xmm0
movq 0x38(%rbx), %rax
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jae 0x3f596
movslq 0x34(%rbx), %rdx
movq 0x38(%rbx), %rax
ucomisd -0x8(%rax,%rdx,8), %xmm0
jae 0x3f59f
decl %edx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x10, %rsp
popq %rbx
jmp 0x3f4b4
xorl %eax, %eax
jmp 0x3f5a8
movq 0x28(%rbx), %rax
movq (%rax), %rax
jmp 0x3f5a8
movq 0x28(%rbx), %rax
movq -0x8(%rax,%rdx,8), %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSurvey.cpp
// Function: gaps::GSVSurvey::NPoints() const
int GSVSurvey::
NPoints(void) const
{
  // Return number of points in all scans
  int npoints = 0;
  for (int i = 0; i < NScans(); i++) 
    npoints += Scan(i)->NPoints();
  return npoints;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x34(%rdi)
jle 0x3f5dd
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3fc72
addl %eax, %ebp
incq %r14
movslq 0x34(%rbx), %rax
cmpq %rax, %r14
jl 0x3f5c0
jmp 0x3f5df
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/GSVSurvey.cpp
// Function: gaps::GSVSurvey::MaxBeamIndex() const
int GSVSurvey::
MaxBeamIndex(void) const
{
  // Initialize result
  int max_beam_index = -1;

  // Find maximum beam index of any point in any scan
  for (int i = 0; i < NScans(); i++) {
    GSVScan *scan = Scan(i);
    int m = scan->MaxBeamIndex();
    if (m > max_beam_index) max_beam_index = m;
  }

  // Return result
  return max_beam_index;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x0, 0x34(%rdi)
jle 0x3f61c
movq %rdi, %r14
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movq 0x28(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x3fcc8
cmpl %ebx, %eax
cmovgl %eax, %ebx
incq %r15
movslq 0x34(%r14), %rax
cmpq %rax, %r15
jl 0x3f5fc
jmp 0x3f621
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSurvey.cpp
// Function: gaps::GSVSurvey::RemoveScan(gaps::GSVScan*)
void GSVSurvey::
RemoveScan(GSVScan *scan)
{
  // Just checking
  assert(scan->survey_index >= 0);
  assert(scan->survey_index < scans.NEntries());
  assert(scan->survey == this);

  // Remove scan
  RNArrayEntry *entry = scans.KthEntry(scan->survey_index);
  GSVScan *tail = scans.Tail();
  tail->survey_index = scan->survey_index;
  scans.EntryContents(entry) = tail;
  scans.RemoveTail();
  scan->survey_index = -1;
  scan->survey = NULL;

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x28, %rdi
movslq 0x20(%rsi), %rax
movq 0x28(%r14), %rcx
movslq 0x34(%r14), %rdx
movq -0x8(%rcx,%rdx,8), %rsi
movl %eax, 0x20(%rsi)
movq %rsi, (%rcx,%rax,8)
leal -0x1(%rdx), %esi
callq 0xfa9d6
movl $0xffffffff, 0x20(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x18(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3f64a
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSurvey.cpp
// Function: gaps::GSVSurvey::Draw(gaps::RNFlags) const
void GSVSurvey::
Draw(RNFlags flags) const
{
  // Draw scans
  for (int i = 0; i < NScans(); i++) {
    GSVScan *scan = Scan(i);
    scan->Draw(flags);
  }
}

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

  // Print survey header
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "Survey %d:", segment_index);
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");

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

   // Print scans
  for (int i = 0; i < NScans(); i++) {
    GSVScan *scan = Scan(i);
    scan->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 0x3f799
movq 0x19777a(%rip), %rax    # 0x1d6f10
movq (%rax), %r15
testq %r12, %r12
je 0x3f7a9
movq %r12, %rdi
movq %r15, %rsi
callq 0x27aa0
movl 0x10(%r14), %edx
leaq 0x10f987(%rip), %rsi    # 0x14f13b
movq %r15, %rdi
xorl %eax, %eax
callq 0x27e10
testq %rbx, %rbx
je 0x3f7ce
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27aa0
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c40
leaq 0x10f202(%rip), %rsi    # 0x14e9e4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x34(%r14)
jle 0x3f81f
xorl %r13d, %r13d
movq %rsp, %r12
movq 0x28(%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 0x34(%r14), %rax
cmpq %rax, %r13
jl 0x3f7fc
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/GSVSurvey.cpp
// Function: gaps::GSVSurvey::UpdateBBox()
void GSVSurvey::
UpdateBBox(void) 
{
  // Update bounding box
  bbox = R3null_box;
  for (int i = 0; i < NScans(); i++) {
    bbox.Union(Scan(i)->BBox());
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x48, %rdi
leaq 0x1a1162(%rip), %r14    # 0x1e09a8
leaq 0x8(%r14), %rsi
callq 0xd619c
leaq 0x60(%rbx), %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0xd619c
cmpl $0x0, 0x34(%rbx)
jle 0x3f8a9
leaq 0x40(%rbx), %r14
xorl %r12d, %r12d
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x40(%r15), %xmm0
ucomisd 0x10e786(%rip), %xmm0   # 0x14e008
jne 0x3f88e
jp 0x3f88e
movq %r15, %rdi
callq 0x40a24
addq $0x38, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbfb20
incq %r12
movslq 0x34(%rbx), %rax
cmpq %rax, %r12
jl 0x3f86c
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/GSVSurvey.cpp
// Function: gaps::GSVSurvey::UpdateTravelDistances()
void GSVSurvey::
UpdateTravelDistances(void) 
{
  // Check stuff
  if (travel_distances) return;
  if (NScans() == 0) return;

  // Allocate travel distances
  travel_distances = new RNLength [ NScans() ];
  if (!travel_distances) {
    RNFail("Unable to allocate travel distances\n");
    return;
  }

  // Compute travel distances
  RNLength travel_distance = 0;
  R3Point prev_viewpoint = Scan(0)->Viewpoint();
  for (int i = 0; i < NScans(); i++) {
    GSVScan *scan = Scan(i);
    const R3Point& viewpoint = scan->Viewpoint();
    travel_distance += R3Distance(viewpoint, prev_viewpoint);
    travel_distances[i] = travel_distance;
    prev_viewpoint = viewpoint;
  }
}

// Assembly:
cmpq $0x0, 0x38(%rdi)
je 0x3f8be
retq
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movslq 0x34(%rdi), %rax
testq %rax, %rax
je 0x3f9b3
movq %rax, %rcx
shlq $0x3, %rcx
testl %eax, %eax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0x27040
movq %rax, 0x38(%rbx)
movq 0x28(%rbx), %rax
movq (%rax), %rax
movl 0x34(%rax), %ecx
testl %ecx, %ecx
je 0x3f920
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
movq 0x28(%rax), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rsi
addq $0x40, %rsi
jmp 0x3f927
leaq 0x5a1d29(%rip), %rsi    # 0x5e1650
leaq 0x8(%rsp), %rdi
callq 0xd5e3e
cmpl $0x0, 0x34(%rbx)
jle 0x3f9b3
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
xorl %r12d, %r12d
leaq 0x5a1d06(%rip), %r13    # 0x5e1650
leaq 0x8(%rsp), %r14
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %rax
movl 0x34(%rax), %ecx
movq %r13, %r15
testl %ecx, %ecx
je 0x3f979
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
movq 0x28(%rax), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %r15
addq $0x40, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x9d528
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movq 0x38(%rbx), %rax
movsd %xmm1, (%rsp)
movsd %xmm1, (%rax,%r12,8)
movq %r14, %rdi
movq %r15, %rsi
callq 0xd619c
incq %r12
movslq 0x34(%rbx), %rax
cmpq %rax, %r12
jl 0x3f94f
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::~GSVScan()
GSVScan::
~GSVScan(void)
{
  // Remove scan from survey
  if (survey) survey->RemoveScan(this);

  // Delete scanlines
  while (NScanlines()) delete Scanline(0);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x18f047(%rip), %rax    # 0x1ceaa8
movq %rax, (%rdi)
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x3fa89
movq %rbx, %rsi
callq 0x3f6ea
jmp 0x3fa89
movq 0x28(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3fa89
movq (%rdi), %rax
callq *0x8(%rax)
cmpl $0x0, 0x34(%rbx)
jne 0x3fa77
leaq 0x38(%rbx), %rdi
callq 0xbfe90
addq $0x28, %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/GSVScan.cpp
// Function: gaps::GSVScan::SceneIndex() const
int GSVScan::
SceneIndex(void) const
{
  // Get convenient variables
  GSVRun *run = Run();
  if (!run) return -1;
  GSVScene *scene = run->Scene();
  if (!scene) return -1;

  // Compute scene index
  int scene_index = RunIndex();
  for (int ir = 0; ir < run->SceneIndex(); ir++) {
    GSVRun *r = scene->Run(ir);
    scene_index += r->NScans();
  }

  // Return scene index
  return scene_index;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x3fb27
callq 0x3f39c
movq %rax, %rbx
jmp 0x3fb29
xorl %ebx, %ebx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rbx, %rbx
je 0x3fb6a
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x3fb6a
movq %r14, %rdi
callq 0x3fb78
movl %eax, %ebp
cmpl $0x0, 0x10(%rbx)
jle 0x3fb6a
xorl %r14d, %r14d
movq 0x8(%r15), %rax
movq (%rax,%r14,8), %rdi
callq 0x37fbe
addl %eax, %ebp
incq %r14
movslq 0x10(%rbx), %rax
cmpq %rax, %r14
jl 0x3fb4f
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/GSVScan.cpp
// Function: gaps::GSVScan::RunIndex() const
int GSVScan::
RunIndex(void) const
{
  // Get convenient variables
  GSVSegment *segment = Segment();
  if (!segment) return -1;
  GSVRun *run = Run();
  if (!run) return -1;

  // Compute run index
  int run_index = SegmentIndex();
  for (int i = 0; i < segment->RunIndex(); i++) {
    GSVSegment *s = run->Segment(i);
    run_index += s->NScans();
  }

  // Return run index
  return run_index;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x3fb92
movq 0x8(%rdi), %r12
jmp 0x3fb95
xorl %r12d, %r12d
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r12, %r12
je 0x3fbe7
testq %rdi, %rdi
je 0x3fbae
callq 0x3f39c
movq %rax, %r14
jmp 0x3fbb1
xorl %r14d, %r14d
testq %r14, %r14
je 0x3fbe7
movq %r15, %rdi
callq 0x3fbf6
movl %eax, %ebx
cmpl $0x0, 0x18(%r12)
jle 0x3fbe7
xorl %r15d, %r15d
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x39ba4
addl %eax, %ebx
incq %r15
movslq 0x18(%r12), %rax
cmpq %rax, %r15
jl 0x3fbcb
movl %ebx, %eax
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/GSVScan.cpp
// Function: gaps::GSVScan::NPoints() const
int GSVScan::
NPoints(void) const
{
  // Return number of points in all scanlines
  int npoints = 0;
  for (int i = 0; i < NScanlines(); i++) 
    npoints += Scanline(i)->NPoints();
  return npoints;
}

// Assembly:
movslq 0x34(%rdi), %rcx
testq %rcx, %rcx
jle 0x3fc93
movq 0x28(%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %rdi
addl 0x30(%rdi), %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x3fc83
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::MaxSweepIndex() const
int GSVScan::
MaxSweepIndex(void) const
{
  // Initialize result
  int max_sweep_index = -1;

  // Find maximum sweep index of any point in any scanline
  for (int i = 0; i < NScanlines(); i++) {
    GSVScanline *scanline = Scanline(i);
    int m = scanline->SweepIndex();
    if (m > max_sweep_index) max_sweep_index = m;
  }

  // Return result
  return max_sweep_index;
}

// Assembly:
movslq 0x34(%rdi), %rcx
testq %rcx, %rcx
jle 0x3fcc2
movq 0x28(%rdi), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %esi, %esi
movq (%rdx,%rsi,8), %rdi
movl 0x80(%rdi), %edi
cmpl %eax, %edi
cmovgl %edi, %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x3fcaa
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::MaxBeamIndex() const
int GSVScan::
MaxBeamIndex(void) const
{
  // Initialize result
  int max_beam_index = -1;

  // Find maximum beam index of any point in any scanline
  for (int i = 0; i < NScanlines(); i++) {
    GSVScanline *scanline = Scanline(i);
    int m = scanline->MaxBeamIndex();
    if (m > max_beam_index) max_beam_index = m;
  }

  // Return result
  return max_beam_index;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x0, 0x34(%rdi)
jle 0x3fcfe
movq %rdi, %r14
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movq 0x28(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x41292
cmpl %ebx, %eax
cmovgl %eax, %ebx
incq %r15
movslq 0x34(%r14), %rax
cmpq %rax, %r15
jl 0x3fcde
jmp 0x3fd03
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::FindScanlineBeforeTimestamp(double, int, int) const
GSVScanline *GSVScan::
FindScanlineBeforeTimestamp(RNScalar timestamp, int imin, int imax) const
{
  // Binary search
  int i = (imin + imax) / 2;
  if (i == imin) return Scanline(imin);
  assert(i < imax);
  GSVScanline *scanline = Scanline(i);
  RNScalar t = scanline->Timestamp();
  if (t > timestamp) return FindScanlineBeforeTimestamp(timestamp, imin, i);
  else if (t < timestamp) return FindScanlineBeforeTimestamp(timestamp, i, imax);
  else return scanline;
}

// Assembly:
movq 0x28(%rdi), %rcx
movl %edx, %edi
movl %edi, %edx
leal (%rdx,%rsi), %eax
movl %eax, %edi
shrl $0x1f, %edi
addl %eax, %edi
sarl %edi
cmpl %esi, %edi
je 0x3fd77
movslq %edi, %rax
movq (%rcx,%rax,8), %rax
movsd 0x78(%rax), %xmm1
ucomisd %xmm0, %xmm1
ja 0x3fd4a
ucomisd %xmm1, %xmm0
movl %edi, %esi
ja 0x3fd48
retq
movslq %esi, %rax
movq (%rcx,%rax,8), %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::ReadPoints()
int GSVScan::
ReadPoints(void) 
{
  // Check read counter
  if (++read_count > 1) return 1;

  // Get the scene filename
  if (NScanlines() == 0) return 1;
  GSVSegment *segment = Segment();
  if (!segment) return 0;
  GSVRun *run = segment->Run();
  if (!run) return 0;
  GSVScene *scene = run->Scene();
  if (!scene) return 0;
  const char *filename = scene->Filename();
  if (!filename) return 0;

  // Open file
  FILE *fp = fopen(filename, "rb");
  if (!fp) {
    RNFail("Unable to open GSV scene file: %s\n", filename);
    return 0;
  }

  // Read scanlines
  for (int i = 0; i < NScanlines(); i++) {
    GSVScanline *scanline = Scanline(i);
    if (!scanline->ReadPoints(fp)) return 0;
  }

  // Close file 
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x24(%rdi), %eax
incl %eax
movl %eax, 0x24(%rdi)
movl $0x1, %ebx
cmpl $0x1, %eax
ja 0x406b2
movq %rdi, %r14
cmpl $0x0, 0x34(%rdi)
je 0x406b2
movq 0x18(%r14), %rax
xorl %ebx, %ebx
testq %rax, %rax
je 0x40622
movq 0x8(%rax), %rax
jmp 0x40624
xorl %eax, %eax
testq %rax, %rax
je 0x406b2
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x406b2
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x406b2
movq 0x18(%rax), %r12
testq %r12, %r12
je 0x406b2
leaq 0x10e55c(%rip), %rsi    # 0x14ebab
movq %r12, %rdi
callq 0x27b30
testq %rax, %rax
je 0x4069f
movq %rax, %r15
cmpl $0x0, 0x34(%r14)
jle 0x40690
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x42cfe
testl %eax, %eax
je 0x406b2
incq %r12
movslq 0x34(%r14), %rax
cmpq %rax, %r12
jl 0x4066b
movq %r15, %rdi
callq 0x27920
movl $0x1, %ebx
jmp 0x406b2
leaq 0x10e44e(%rip), %rdi    # 0x14eaf4
xorl %ebx, %ebx
movq %r12, %rsi
xorl %eax, %eax
callq 0xfd64a
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::ReleasePoints()
int GSVScan::
ReleasePoints(void) 
{
  // Check read counter
  if (--read_count > 0) return 1;

  // Release points
  for (int i = 0; i < NScanlines(); i++) {
    GSVScanline *scanline = Scanline(i);
    if (!scanline->ReleasePoints()) return 0;
  }

  // Return success
  return 1;
}

// Assembly:
decl 0x24(%rdi)
movl $0x1, %eax
je 0x406cb
retq
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x34(%rdi)
setle %bpl
jle 0x40713
movq 0x28(%rbx), %rax
movq (%rax), %rdi
callq 0x42f82
testl %eax, %eax
je 0x40713
movl $0x1, %r14d
movslq 0x34(%rbx), %rax
cmpq %rax, %r14
setge %bpl
jge 0x40713
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x42f82
incq %r14
testl %eax, %eax
jne 0x406f2
movzbl %bpl, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::Draw(gaps::RNFlags) const
void GSVScan::
Draw(RNFlags flags) const
{
  if (flags & GSV_DRAW_POINTS_WITH_LASER_INDEX_COLOR) {
    // Draw points  colored by laser index
    const int ncolors = 3;
    GLfloat color[3][3] = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } };
    int laser_index = (Laser()) ? Laser()->RunIndex() : 0;
    RNLoadRgb(color[laser_index % ncolors]);
    for (int i = 0; i < NScanlines(); i++) {
      GSVScanline *scanline = Scanline(i);
      scanline->Draw(flags);
    }
  }
  else if (flags & GSV_DRAW_MESHES_WITHOUT_COLOR) {
    glEnable(GL_CULL_FACE);
    static GSVMesh *last_mesh = NULL;
    static const GSVScan *last_scan = NULL;
    if (this != last_scan) {
      if (last_mesh) delete last_mesh;
      last_mesh = Mesh();
      last_scan = this;
    }
    if (last_mesh) last_mesh->Draw();
    glDisable(GL_CULL_FACE);
  }
  else {
    // Draw scanlines
    for (int i = 0; i < NScanlines(); i++) {
      GSVScanline *scanline = Scanline(i);
      scanline->Draw(flags);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
testb $0x1, %r14b
jne 0x40869
btl $0x10, %r14d
jb 0x408f9
cmpl $0x0, 0x34(%rbx)
jle 0x408ef
xorl %r15d, %r15d
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x10(%rax)
incq %r15
movslq 0x34(%rbx), %rax
cmpq %rax, %r15
jl 0x40847
jmp 0x408ef
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movaps %xmm0, 0x10(%rsp)
movl $0x3f800000, %eax       # imm = 0x3F800000
movl %eax, (%rsp)
movl %eax, 0x10(%rsp)
movl %eax, 0x20(%rsp)
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x408ba
cmpq $0x0, 0x18(%rax)
je 0x408ba
movq 0x18(%rax), %rax
movslq 0x10(%rax), %rax
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
cltq
jmp 0x408bc
xorl %eax, %eax
leaq (%rax,%rax,2), %rax
leaq (%rsp,%rax,4), %rdi
callq 0x27380
cmpl $0x0, 0x34(%rbx)
jle 0x408ef
xorl %r15d, %r15d
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x10(%rax)
incq %r15
movslq 0x34(%rbx), %rax
cmpq %rax, %r15
jl 0x408d2
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl $0xb44, %edi            # imm = 0xB44
callq 0x27880
cmpq %rbx, 0x19ce56(%rip)    # 0x1dd760
je 0x40934
movq 0x19ce45(%rip), %rdi    # 0x1dd758
testq %rdi, %rdi
je 0x4091e
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x403b0
movq %rax, 0x19ce2b(%rip)    # 0x1dd758
movq %rbx, 0x19ce2c(%rip)    # 0x1dd760
movq 0x19ce1d(%rip), %rdi    # 0x1dd758
testq %rdi, %rdi
je 0x4094e
movq (%rdi), %rax
movl $0x772, %esi            # imm = 0x772
callq *0x120(%rax)
movl $0xb44, %edi            # imm = 0xB44
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x27200
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::Print(_IO_FILE*, char const*, char const*) const
void GSVScan::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print scan header
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "Scan %d:", survey_index);
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");

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

   // Print scanlines
  for (int i = 0; i < NScanlines(); i++) {
    GSVScanline *scanline = Scanline(i);
    scanline->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 0x4098d
movq 0x196586(%rip), %rax    # 0x1d6f10
movq (%rax), %r15
testq %r12, %r12
je 0x4099d
movq %r12, %rdi
movq %r15, %rsi
callq 0x27aa0
movl 0x20(%r14), %edx
leaq 0x10e899(%rip), %rsi    # 0x14f241
movq %r15, %rdi
xorl %eax, %eax
callq 0x27e10
testq %rbx, %rbx
je 0x409c2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27aa0
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c40
leaq 0x10e00e(%rip), %rsi    # 0x14e9e4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x34(%r14)
jle 0x40a13
xorl %r13d, %r13d
movq %rsp, %r12
movq 0x28(%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 0x34(%r14), %rax
cmpq %rax, %r13
jl 0x409f0
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/GSVScan.cpp
// Function: gaps::GSVScan::UpdateBBox()
void GSVScan::
UpdateBBox(void) 
{
  // Read points (assumes all scanlines are in memory or not) 
  RNBoolean read_points = FALSE;
  if (NScanlines() > 0) {
    GSVScanline *scanline = Scanline(0);
    if (scanline->DoesBBoxNeedUpdate()) {
      ReadPoints();
      read_points = TRUE;
    }
  }

  // Update bounding box
  bbox = R3null_box;
  for (int i = 0; i < NScanlines(); i++) {
    bbox.Union(Scanline(i)->BBox());
  }

  // Release points
  if (read_points) {
    ReleasePoints();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x34(%rdi)
jle 0x40a55
movq 0x28(%rbx), %rax
movq (%rax), %rdi
callq 0x42c46
testl %eax, %eax
sete %bpl
je 0x40a58
movq %rbx, %rdi
callq 0x405e6
xorl %ebp, %ebp
jmp 0x40a58
movb $0x1, %bpl
leaq 0x40(%rbx), %rdi
leaq 0x19ff45(%rip), %r14    # 0x1e09a8
leaq 0x8(%r14), %rsi
callq 0xd619c
leaq 0x58(%rbx), %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0xd619c
cmpl $0x0, 0x34(%rbx)
jle 0x40ac3
leaq 0x38(%rbx), %r14
xorl %r12d, %r12d
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %r15
movq %r15, %rdi
callq 0x42c46
testl %eax, %eax
je 0x40aa5
movq %r15, %rdi
callq 0x42c60
addq $0x88, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbfb20
incq %r12
movslq 0x34(%rbx), %rax
cmpq %rax, %r12
jl 0x40a89
testb %bpl, %bpl
je 0x40ad1
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x406c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScanline.cpp
// Function: gaps::GSVScanline::RunIndex() const
int GSVScanline::
RunIndex(void) const
{
  // Get convenient variables
  GSVSegment *segment = Segment();
  if (!segment) return -1;
  GSVRun *run = segment->Run();
  if (!run) return -1;

  // Compute run index
  int run_index = SegmentIndex();
  for (int i = 0; i < segment->RunIndex(); i++) {
    GSVSegment *s = run->Segment(i);
    run_index += s->NScanlines();
  }

  // Return runindex
  return run_index;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x4110f
callq 0x3faf8
movq %rax, %rbx
jmp 0x41111
xorl %ebx, %ebx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rbx, %rbx
je 0x41152
movq 0x10(%rbx), %r15
testq %r15, %r15
je 0x41152
movq %r14, %rdi
callq 0x41160
movl %eax, %ebp
cmpl $0x0, 0x18(%rbx)
jle 0x41152
xorl %r14d, %r14d
movq 0x18(%r15), %rax
movq (%rax,%r14,8), %rdi
callq 0x39c08
addl %eax, %ebp
incq %r14
movslq 0x18(%rbx), %rax
cmpq %rax, %r14
jl 0x41137
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/GSVScanline.cpp
// Function: gaps::GSVScanline::SegmentIndex() const
int GSVScanline::
SegmentIndex(void) const
{
  // Get convenient variables
  GSVSegment *segment = Segment();
  if (!segment) return -1;
  GSVSurvey *survey = Survey();
  if (!survey) return -1;

  // Compute segment index
  int segment_index = SurveyIndex();
  for (int i = 0; i < survey->SegmentIndex(); i++) {
    GSVSurvey *s = segment->Survey(i);
    segment_index += s->NScanlines();
  }

  // Return segment index
  return segment_index;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x4117d
callq 0x3faf8
movq %rax, %rbx
jmp 0x4117f
xorl %ebx, %ebx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rbx, %rbx
je 0x411cf
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x41198
movq 0x18(%rax), %r15
jmp 0x4119b
xorl %r15d, %r15d
testq %r15, %r15
je 0x411cf
movq %r14, %rdi
callq 0x41258
movl %eax, %ebp
cmpl $0x0, 0x10(%r15)
jle 0x411cf
xorl %r14d, %r14d
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3f3e8
addl %eax, %ebp
incq %r14
movslq 0x10(%r15), %rax
cmpq %rax, %r14
jl 0x411b4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScanline.cpp
// Function: gaps::GSVScanline::LaserIndex() const
int GSVScanline::
LaserIndex(void) const
{
  // Get convenient variables
  GSVLaser *laser = Laser();
  if (!laser) return -1;
  GSVSurvey *survey = Survey();
  if (!survey) return -1;

  // Compute laser index
  int laser_index = SurveyIndex();
  for (int i = 0; i < survey->LaserIndex(); i++) {
    GSVSurvey *s = laser->Survey(i);
    laser_index += s->NScanlines();
  }

  // Return laser index
  return laser_index;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x411f9
callq 0x3fae6
movq %rax, %rbx
jmp 0x411fb
xorl %ebx, %ebx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rbx, %rbx
je 0x4124b
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x41214
movq 0x18(%rax), %r15
jmp 0x41217
xorl %r15d, %r15d
testq %r15, %r15
je 0x4124b
movq %r14, %rdi
callq 0x41258
movl %eax, %ebp
cmpl $0x0, 0x20(%r15)
jle 0x4124b
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3f3e8
addl %eax, %ebp
incq %r14
movslq 0x20(%r15), %rax
cmpq %rax, %r14
jl 0x41230
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScanline.cpp
// Function: gaps::GSVScanline::MaxBeamIndex() const
int GSVScanline::
MaxBeamIndex(void) const
{
  // Check first and last points
  if (npoints == 0) return -1;
  int i0 = points[0].BeamIndex();
  int i1 = points[npoints-1].BeamIndex();
  return (i0 > i1) ? i0 : i1;
}

// Assembly:
movslq 0x30(%rdi), %rax
testq %rax, %rax
je 0x412b6
movq 0x28(%rdi), %rcx
movzbl 0x46(%rcx), %edx
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
movzbl -0xa(%rcx,%rax), %eax
cmpl %eax, %edx
cmovgl %edx, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScanline.cpp
// Function: gaps::GSVScanline::EstimatedGroundZ() const
RNCoord GSVScanline::
EstimatedGroundZ(void) const
{
  // Get convenient variables
  GSVLaser *laser = Laser();
  const double vlp16_laser_height = 2.0;
  const int sick_scan_ground_index = 25;
  const int sick_radius = 1;

  // Check device
  if ((laser->DeviceType() == GSV_SICK_LASER) &&
      (NPoints() > 0) &&
      (NPoints() > sick_scan_ground_index+sick_radius) &&
      points) {

    // Get three points around scan_ground_index
    R3Point p0 = PointPosition(NPoints() - sick_scan_ground_index - sick_radius);
    R3Point p1 = PointPosition(NPoints() - sick_scan_ground_index);
    R3Point p2 = PointPosition(NPoints() - sick_scan_ground_index + sick_radius);

    // Find median Z coordinate
    RNCoord z;
    if (p0.Z() < p1.Z()) {
      if (p1.Z() < p2.Z()) {
        z = p1.Z();
      }
      else {
        if (p0.Z() < p2.Z()) z = p2.Z();
        else z = p0.Z();
      }
    }
    else {
      if (p0.Z() < p2.Z()) {
        z = p0.Z();
      }
      else {
        if (p1.Z() < p2.Z()) z = p2.Z();
        else z = p1.Z();
      }
    }
  
    // Return estimate of ground Z coordinate
    return z;
  }
  else {
    const GSVPose& pose = Pose();
    const R3Point& viewpoint = pose.Viewpoint();
    return viewpoint.Z() - vlp16_laser_height;
  }

  // Should not get here
  return RN_UNKNOWN;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x3fae6
cmpl $0x2, 0x28(%rax)
jne 0x412f6
movslq 0x30(%rbx), %rax
testq %rax, %rax
jle 0x412f6
cmpl $0x1b, %eax
setl %dl
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
sete %sil
orb %dl, %sil
je 0x4130d
movsd 0x50(%rbx), %xmm0
addsd 0x10df4d(%rip), %xmm0   # 0x14f250
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
movsd -0x820(%rcx,%rax), %xmm0
movsd -0x818(%rcx,%rax), %xmm1
movsd -0x810(%rcx,%rax), %xmm2
leaq 0x38(%rsp), %r14
movq %r14, %rdi
callq 0xd5e2e
movslq 0x30(%rbx), %rax
movq 0x28(%rbx), %rcx
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
movsd -0x7d0(%rcx,%rax), %xmm0
movsd -0x7c8(%rcx,%rax), %xmm1
movsd -0x7c0(%rcx,%rax), %xmm2
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0xd5e2e
movslq 0x30(%rbx), %rax
movq 0x28(%rbx), %rcx
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
movsd -0x780(%rcx,%rax), %xmm0
movsd -0x778(%rcx,%rax), %xmm1
movsd -0x770(%rcx,%rax), %xmm2
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xd5e2e
movsd 0x10(%r14), %xmm2
movsd 0x10(%r15), %xmm3
ucomisd %xmm2, %xmm3
movsd 0x10(%rbx), %xmm1
jbe 0x413d8
ucomisd %xmm3, %xmm1
movapd %xmm3, %xmm0
ja 0x41303
maxsd %xmm2, %xmm1
jmp 0x413ea
ucomisd %xmm2, %xmm1
movapd %xmm2, %xmm0
ja 0x41303
maxsd %xmm3, %xmm1
movapd %xmm1, %xmm0
jmp 0x41303
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVScanline.cpp
// Function: gaps::GSVScanline::PointAngle(int) const
RNAngle GSVScanline::
PointAngle(int point_index) const
{
  // Return angle of laser when point was sampled (0 - PI)
  const R3Point& position = PointPosition(point_index);
  const R3Point& viewpoint = pose.Viewpoint();
  const R3Vector& towards = pose.Towards();
  const R3Vector& up = pose.Up();
  R3Vector right = towards % up;
  R3Vector v = position - viewpoint;
  RNLength distance = v.Length();
  if (RNIsZero(distance)) return 0;
  v /= distance;
  RNScalar dot = -(v.Dot(up));
  RNAngle angle = acos(dot);
  if (v.Dot(right) > 0) angle = RN_PI_OVER_TWO + angle;
  else angle = RN_PI_OVER_TWO - angle;
  return angle;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movslq %esi, %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
movsd (%rax,%rcx), %xmm0
movsd 0x8(%rax,%rcx), %xmm1
movsd 0x10(%rax,%rcx), %xmm2
leaq 0x78(%rsp), %r14
movq %r14, %rdi
callq 0xd5e2e
leaq 0x38(%rbx), %r15
addq $0x40, %rbx
leaq 0x60(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x455c6
leaq 0x48(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x4560c
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xd721a
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xd6090
movq %r15, %rdi
callq 0xd69cc
leaq 0x196fda(%rip), %rax    # 0x1d8468
movsd (%rax), %xmm2
movapd 0x10d816(%rip), %xmm1   # 0x14ecb0
xorpd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x414ae
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm2
jae 0x41518
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0xd74f4
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0xd6b5e
xorpd 0x10d7e0(%rip), %xmm0   # 0x14ecb0
callq 0x278b0
movapd %xmm0, (%rsp)
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0xd6b5e
leaq 0x118dda(%rip), %rax    # 0x15a2c8
movapd 0x10d7ba(%rip), %xmm2   # 0x14ecb0
movapd (%rsp), %xmm3
xorpd %xmm3, %xmm2
xorpd %xmm1, %xmm1
cmpltsd %xmm0, %xmm1
andpd %xmm1, %xmm3
andnpd %xmm2, %xmm1
orpd %xmm3, %xmm1
addsd (%rax), %xmm1
movapd %xmm1, %xmm0
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop