LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
addq $0x40, %rdi
leaq 0x2ae7ba(%rip), %rsi    # 0x3024f8
callq 0x386d0
movl $0x0, 0x1c(%rsp)
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x3a080
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x53da1
movq 0x10(%rsp), %rdi
movq %rdi, %rax
addq $0x40, %rax
movq %rax, (%rsp)
movl 0x1c(%rsp), %esi
callq 0x3a0a0
movq %rax, %rdi
callq 0x44c10
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x1538e0
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x53d4b
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x38(%rax)
je 0x53dcf
jmp 0x53ef9
movq 0x10(%rsp), %rdi
callq 0x3a080
cmpl $0x0, %eax
jne 0x53de3
jmp 0x53ef9
movq 0x10(%rsp), %rdi
callq 0x3a080
cltq
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x29820
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x38(%rax)
cmpq $0x0, 0x38(%rax)
jne 0x53e36
leaq 0x21341a(%rip), %rdi    # 0x267244
movb $0x0, %al
callq 0x1cbff0
jmp 0x53ef9
movq 0x10(%rsp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, 0x48(%rsp)
xorl %esi, %esi
callq 0x3a0a0
movq %rax, %rdi
callq 0x53fe0
movq %rax, %rsi
leaq 0x30(%rsp), %rdi
callq 0x17fdd0
movl $0x0, 0x2c(%rsp)
movq 0x10(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x3a080
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x53ef9
movq 0x10(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x3a0a0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
callq 0x53fe0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x10df80
movq 0x10(%rsp), %rax
addsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x48(%rsp), %xmm0
movq 0x38(%rax), %rax
movslq 0x2c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x18(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x180420
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x53e68
addq $0x58, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVSurvey.cpp
// Function: gaps::GSVSurvey::InvalidateTravelDistances()
void GSVSurvey::
InvalidateTravelDistances(void) 
{
  // Invalidate travel distances
  if (!travel_distances) return;
  delete [] travel_distances;
  travel_distances = NULL;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x38(%rax)
jne 0x53f1c
jmp 0x53f45
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x53f38
movq (%rsp), %rdi
callq 0x296f0
movq 0x8(%rsp), %rax
movq $0x0, 0x38(%rax)
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/./GSVScan.h
// Function: gaps::GSVScan::Viewpoint() const
inline const R3Point& GSVScan::
Viewpoint(void) const
{
  // Return viewpoint of center scanline
  if (NScanlines() == 0) return R3zero_point;
  int center_scanline_index = NScanlines()/2;
  GSVScanline *scanline = Scanline(center_scanline_index);
  return scanline->Pose().Viewpoint();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x3a0d0
cmpl $0x0, %eax
jne 0x5400a
leaq 0x6af29d(%rip), %rax    # 0x7032a0
movq %rax, 0x20(%rsp)
jmp 0x54048
movq (%rsp), %rdi
callq 0x3a0d0
movq (%rsp), %rdi
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %esi
callq 0x3a0f0
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0x44c60
movq %rax, %rdi
callq 0x3a330
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x2929ae(%rip), %rcx    # 0x2e6ac8
addq $0x10, %rcx
movq %rcx, (%rax)
cmpq $0x0, 0x18(%rax)
je 0x5413a
movq 0x18(%rsp), %rsi
movq 0x18(%rsi), %rdi
callq 0x53a90
jmp 0x54138
jmp 0x5413a
jmp 0x5413c
movq 0x18(%rsp), %rdi
callq 0x3a0d0
movl %eax, 0x14(%rsp)
jmp 0x5414c
movl 0x14(%rsp), %eax
cmpl $0x0, %eax
je 0x54180
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x3a0f0
movq %rax, 0x8(%rsp)
jmp 0x54168
movq 0x8(%rsp), %rax
cmpq $0x0, %rax
je 0x5417e
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x5413c
movq 0x18(%rsp), %rdi
addq $0x38, %rdi
callq 0x386c0
movq 0x18(%rsp), %rdi
addq $0x28, %rdi
callq 0x444d0
addq $0x28, %rsp
retq
movq %rax, %rdi
callq 0x44300
nopl (%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x542a0
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x543e2
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x5446f
movq 0x10(%rsp), %rdi
callq 0x54220
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x54403
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x5446f
movq 0x10(%rsp), %rdi
callq 0x54480
movl %eax, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rsp), %rdi
callq 0x4a640
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x54467
movq 0x28(%rsp), %rdi
movl 0x20(%rsp), %esi
callq 0x3a000
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x48350
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x54419
movl 0x24(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::SegmentIndex() const
int GSVScan::
SegmentIndex(void) const
{
  // Get convenient variables
  GSVSegment *segment = Segment();
  if (!segment) 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->NScans();
  }

  // Return segment index
  return segment_index;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x542a0
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x544af
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x5451f
movq 0x8(%rsp), %rdi
callq 0x53fb0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movq 0x8(%rsp), %rax
movl 0x18(%rsp), %ecx
movl %ecx, 0x4(%rsp)
movq 0x18(%rax), %rdi
callq 0x53f60
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x54517
movq 0x20(%rsp), %rdi
movl 0x18(%rsp), %esi
callq 0x3a050
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x3a080
addl 0x1c(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x544c5
movl 0x1c(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::LaserIndex() const
int GSVScan::
LaserIndex(void) const
{
  // Get convenient variables
  GSVLaser *laser = Laser();
  if (!laser) 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->NScans();
  }

  // Return laser index
  return laser_index;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x54260
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x5455f
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x545cf
movq 0x8(%rsp), %rdi
callq 0x53fb0
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movq 0x8(%rsp), %rax
movl 0x18(%rsp), %ecx
movl %ecx, 0x4(%rsp)
movq 0x18(%rax), %rdi
callq 0x565c0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x545c7
movq 0x20(%rsp), %rdi
movl 0x18(%rsp), %esi
callq 0x52f90
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x3a080
addl 0x1c(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x54575
movl 0x1c(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movq 0x10(%rsp), %rdi
movl 0x18(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x3a0d0
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x5464a
movq 0x10(%rsp), %rdi
movl 0x18(%rsp), %esi
callq 0x3a0f0
movq %rax, %rdi
callq 0x3a120
addl 0x1c(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x54603
movl 0x1c(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x28(%rsp)
movq 0x10(%rsp), %rdi
movl 0x28(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x3a0d0
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x546e1
movq 0x10(%rsp), %rdi
movl 0x28(%rsp), %esi
callq 0x3a0f0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
callq 0x44c90
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jle 0x546d2
movl 0x1c(%rsp), %eax
movl %eax, 0x2c(%rsp)
jmp 0x546d4
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x54683
movl 0x2c(%rsp), %eax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x28(%rsp)
movq 0x10(%rsp), %rdi
movl 0x28(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x3a0d0
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x54771
movq 0x10(%rsp), %rdi
movl 0x28(%rsp), %esi
callq 0x3a0f0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
callq 0x57010
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jle 0x54762
movl 0x1c(%rsp), %eax
movl %eax, 0x2c(%rsp)
jmp 0x54764
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x54713
movl 0x2c(%rsp), %eax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movsd %xmm0, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movl %edx, 0x28(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x2c(%rsp), %eax
addl 0x28(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jne 0x54827
movq 0x8(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x3a0f0
movq %rax, 0x40(%rsp)
jmp 0x548b2
movq 0x8(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x3a0f0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x44c80
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
ucomisd 0x30(%rsp), %xmm0
jbe 0x54877
movq 0x8(%rsp), %rdi
movsd 0x30(%rsp), %xmm0
movl 0x2c(%rsp), %esi
movl 0x24(%rsp), %edx
callq 0x547d0
movq %rax, 0x40(%rsp)
jmp 0x548b2
movsd 0x10(%rsp), %xmm1
movsd 0x30(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x548a8
movq 0x8(%rsp), %rdi
movsd 0x30(%rsp), %xmm0
movl 0x24(%rsp), %esi
movl 0x28(%rsp), %edx
callq 0x547d0
movq %rax, 0x40(%rsp)
jmp 0x548b2
movq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::FindScanlineBeforeTimestamp(double) const
GSVScanline *GSVScan::
FindScanlineBeforeTimestamp(RNScalar timestamp) const
{
  // Binary search
  if (NScanlines() == 0) return NULL;
  if (timestamp <= Scanline(0)->Timestamp()) return Scanline(0);
  if (timestamp >= Scanline(NScanlines()-1)->Timestamp()) return Scanline(NScanlines()-1);
  return FindScanlineBeforeTimestamp(timestamp, 0, NScanlines()-1);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movsd %xmm0, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x3a0d0
cmpl $0x0, %eax
jne 0x548f1
movq $0x0, 0x30(%rsp)
jmp 0x549bf
movq 0x18(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %esi, %esi
callq 0x3a0f0
movq %rax, %rdi
callq 0x44c80
movsd 0x10(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x54933
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x3a0f0
movq %rax, 0x30(%rsp)
jmp 0x549bf
movq 0x18(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x3a0d0
movq 0x18(%rsp), %rdi
movl %eax, %esi
subl $0x1, %esi
callq 0x3a0f0
movq %rax, %rdi
callq 0x44c80
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x5498f
movq 0x18(%rsp), %rdi
callq 0x3a0d0
movq 0x18(%rsp), %rdi
movl %eax, %esi
subl $0x1, %esi
callq 0x3a0f0
movq %rax, 0x30(%rsp)
jmp 0x549bf
movq 0x18(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rsp)
callq 0x3a0d0
movq 0x18(%rsp), %rdi
movsd (%rsp), %xmm0
movl %eax, %edx
subl $0x1, %edx
xorl %esi, %esi
callq 0x547d0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq 0x48(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movl 0x24(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x24(%rcx)
cmpl $0x1, %eax
jbe 0x557ee
movl $0x1, 0x54(%rsp)
jmp 0x55950
movq 0x8(%rsp), %rdi
callq 0x3a0d0
cmpl $0x0, %eax
jne 0x5580a
movl $0x1, 0x54(%rsp)
jmp 0x55950
movq 0x8(%rsp), %rdi
callq 0x542a0
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x40(%rsp)
jne 0x5582e
movl $0x0, 0x54(%rsp)
jmp 0x55950
movq 0x40(%rsp), %rdi
callq 0x4f380
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x55852
movl $0x0, 0x54(%rsp)
jmp 0x55950
movq 0x38(%rsp), %rdi
callq 0x4a630
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x55876
movl $0x0, 0x54(%rsp)
jmp 0x55950
movq 0x30(%rsp), %rdi
callq 0x56730
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x5589a
movl $0x0, 0x54(%rsp)
jmp 0x55950
movq 0x28(%rsp), %rdi
leaq 0x21141b(%rip), %rsi    # 0x266cc1
callq 0x2a520
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x558d5
movq 0x28(%rsp), %rsi
leaq 0x211342(%rip), %rdi    # 0x266c06
movb $0x0, %al
callq 0x1cbff0
movl $0x0, 0x54(%rsp)
jmp 0x55950
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x3a0d0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x5593e
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x3a0f0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x1, %edx
callq 0x594d0
cmpl $0x0, %eax
jne 0x5592f
movl $0x0, 0x54(%rsp)
jmp 0x55950
jmp 0x55931
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x558dd
movq 0x20(%rsp), %rdi
callq 0x297e0
movl $0x1, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movl 0x24(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x24(%rcx)
cmpl $0x0, %eax
jbe 0x5598b
movl $0x1, 0x34(%rsp)
jmp 0x559f2
movl $0x0, 0x24(%rsp)
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x3a0d0
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x559ea
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x3a0f0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x598c0
cmpl $0x0, %eax
jne 0x559db
movl $0x0, 0x34(%rsp)
jmp 0x559f2
jmp 0x559dd
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x55993
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::InsertScanline(gaps::GSVScanline*)
void GSVScan::
InsertScanline(GSVScanline *scanline)
{
  // Just checking
  assert(scanline->scan_index == -1);
  assert(scanline->scan == NULL);

  // Insert scanline
  scanline->scan = this;
  scanline->scan_index = scanlines.NEntries();
  scanlines.Insert(scanline);

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x8(%rsp), %rax
movq %rdi, 0x8(%rax)
addq $0x28, %rdi
callq 0x38730
movq (%rsp), %rdi
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x10(%rax)
addq $0x28, %rdi
movq 0x8(%rsp), %rsi
callq 0x47d90
movq (%rsp), %rdi
callq 0x55a60
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::InvalidateBBox()
void GSVScan::
InvalidateBBox(void) 
{
  // Invalidate bounding box
  if (bbox.XMin() != FLT_MAX) {
    bbox = R3Box(FLT_MAX,FLT_MAX,FLT_MAX,-FLT_MAX,-FLT_MAX,-FLT_MAX);
    if (survey) survey->InvalidateBBox();
  }
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x10(%rsp)
addq $0x38, %rdi
callq 0x38b90
movsd 0x210594(%rip), %xmm1   # 0x266018
ucomisd %xmm1, %xmm0
jne 0x55a91
jp 0x55a91
jmp 0x55b13
leaq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movsd 0x210575(%rip), %xmm2   # 0x266018
movsd 0x210575(%rip), %xmm5   # 0x266020
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
movaps %xmm5, %xmm3
movaps %xmm5, %xmm4
callq 0x151b90
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
addq $0x38, %rdi
callq 0x386d0
jmp 0x55ad1
leaq 0x28(%rsp), %rdi
callq 0x386c0
movq 0x10(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x55b11
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x539b0
jmp 0x55b11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x386c0
jmp 0x55b18
jmp 0x55b13
addq $0x68, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x29c10
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScan.cpp
// Function: gaps::GSVScan::RemoveScanline(gaps::GSVScanline*)
void GSVScan::
RemoveScanline(GSVScanline *scanline)
{
  // Just checking
  assert(scanline->scan_index >= 0);
  assert(scanline->scan_index < scanlines.NEntries());
  assert(scanline->scan == this);

  // Remove scanline
  RNArrayEntry *entry = scanlines.KthEntry(scanline->scan_index);
  GSVScanline *tail = scanlines.Tail();
  tail->scan_index = scanline->scan_index;
  scanlines.EntryContents(entry) = tail;
  scanlines.RemoveTail();
  scanline->scan_index = -1;
  scanline->scan = NULL;

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
addq $0x28, %rdi
movq 0x28(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x44390
movq 0x10(%rsp), %rdi
movq %rax, 0x20(%rsp)
addq $0x28, %rdi
callq 0x56740
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x28, %rdi
movq 0x20(%rsp), %rsi
callq 0x56750
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rcx, (%rax)
addq $0x28, %rdi
callq 0x443d0
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rax
movq $0x0, 0x8(%rax)
callq 0x55a60
addq $0x38, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x448, %rsp            # imm = 0x448
movq %rdi, 0x440(%rsp)
movq %rsi, 0x438(%rsp)
movq %rdx, 0x430(%rsp)
movq %rcx, 0x428(%rsp)
movq 0x440(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x438(%rsp)
jne 0x55eb1
movq 0x299122(%rip), %rax    # 0x2eefc8
movq (%rax), %rax
movq %rax, 0x438(%rsp)
cmpq $0x0, 0x430(%rsp)
je 0x55eda
movq 0x438(%rsp), %rdi
movq 0x430(%rsp), %rdx
leaq 0x22a354(%rip), %rsi    # 0x280227
movb $0x0, %al
callq 0x293c0
movq 0x8(%rsp), %rax
movq 0x438(%rsp), %rdi
movl 0x20(%rax), %edx
leaq 0x2114a5(%rip), %rsi    # 0x267396
movb $0x0, %al
callq 0x293c0
cmpq $0x0, 0x428(%rsp)
je 0x55f21
movq 0x438(%rsp), %rdi
movq 0x428(%rsp), %rdx
leaq 0x22a30d(%rip), %rsi    # 0x280227
movb $0x0, %al
callq 0x293c0
movq 0x438(%rsp), %rdi
leaq 0x210ed6(%rip), %rsi    # 0x266e06
movb $0x0, %al
callq 0x293c0
leaq 0x20(%rsp), %rdi
movq 0x430(%rsp), %rdx
leaq 0x210bab(%rip), %rsi    # 0x266af6
movb $0x0, %al
callq 0x2a280
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x3a0d0
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x55fb6
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x3a0f0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq 0x438(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq 0x428(%rsp), %rcx
movq (%rdi), %rax
callq *0x18(%rax)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x55f5a
addq $0x448, %rsp            # imm = 0x448
retq
nop
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movl $0x0, 0x2c(%rsp)
callq 0x3a0d0
cmpl $0x0, %eax
jle 0x56019
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x3a0f0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
callq 0x593f0
cmpl $0x0, %eax
je 0x56017
movq 0x10(%rsp), %rdi
callq 0x557c0
movl $0x1, 0x2c(%rsp)
jmp 0x56019
movq 0x10(%rsp), %rdi
addq $0x38, %rdi
leaq 0x2ac4cf(%rip), %rsi    # 0x3024f8
callq 0x386d0
movl $0x0, 0x1c(%rsp)
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x3a0d0
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x5608c
movq 0x10(%rsp), %rdi
movq %rdi, %rax
addq $0x38, %rax
movq %rax, (%rsp)
movl 0x1c(%rsp), %esi
callq 0x3a0f0
movq %rax, %rdi
callq 0x44cb0
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x1538e0
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x56036
cmpl $0x0, 0x2c(%rsp)
je 0x5609d
movq 0x10(%rsp), %rdi
callq 0x55960
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/./GSVScan.h
// Function: gaps::GSVScan::Timestamp() const
inline double GSVScan::
Timestamp(void) const
{
  // Return timestamp of center scanline
  if (NScanlines() == 0) return -1;
  int center_scanline_index = NScanlines()/2;
  GSVScanline *scanline = Scanline(center_scanline_index);
  return scanline->Timestamp();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x3a0d0
cmpl $0x0, %eax
jne 0x5679c
movsd 0x20f874(%rip), %xmm0   # 0x266008
movsd %xmm0, 0x20(%rsp)
jmp 0x567d3
movq (%rsp), %rdi
callq 0x3a0d0
movq (%rsp), %rdi
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %esi
callq 0x3a0f0
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0x44c80
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScanline.cpp
// Function: gaps::GSVScanline::~GSVScanline()
GSVScanline::
~GSVScanline(void)
{
  // Delete points
  if (points) delete [] points;

  // Remove scanline from laser scan
  if (scan) scan->RemoveScanline(this);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x2900ee(%rip), %rcx    # 0x2e6b08
addq $0x10, %rcx
movq %rcx, (%rax)
cmpq $0x0, 0x28(%rax)
je 0x56a46
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x56a44
movq (%rsp), %rdi
callq 0x296f0
jmp 0x56a46
movq 0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x56a64
movq 0x8(%rsp), %rsi
movq 0x8(%rsi), %rdi
callq 0x55b30
jmp 0x56a62
jmp 0x56a64
movq 0x8(%rsp), %rdi
addq $0x88, %rdi
callq 0x386c0
movq 0x8(%rsp), %rdi
addq $0x38, %rdi
callq 0x5e680
addq $0x18, %rsp
retq
movq %rax, %rdi
callq 0x44300
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x56bc0
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x56d02
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x56d8f
movq 0x30(%rsp), %rdi
callq 0x4f380
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x56d23
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x56d8f
movq 0x10(%rsp), %rdi
callq 0x56da0
movl %eax, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rsp), %rdi
callq 0x4a640
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x56d87
movq 0x28(%rsp), %rdi
movl 0x20(%rsp), %esi
callq 0x3a000
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x48490
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x56d39
movl 0x24(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x56bc0
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x56dd2
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x56e5f
movq 0x10(%rsp), %rdi
callq 0x56b80
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x56df3
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x56e5f
movq 0x10(%rsp), %rdi
callq 0x56f40
movl %eax, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rdi
callq 0x53f60
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x56e57
movq 0x30(%rsp), %rdi
movl 0x20(%rsp), %esi
callq 0x3a050
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x533c0
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x56e09
movl 0x24(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x56b40
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x56ea2
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x56f2f
movq 0x10(%rsp), %rdi
callq 0x56b80
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x56ec3
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x56f2f
movq 0x10(%rsp), %rdi
callq 0x56f40
movl %eax, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rdi
callq 0x565c0
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x56f27
movq 0x30(%rsp), %rdi
movl 0x20(%rsp), %esi
callq 0x52f90
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x533c0
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x56ed9
movl 0x24(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScanline.cpp
// Function: gaps::GSVScanline::SurveyIndex() const
int GSVScanline::
SurveyIndex(void) const
{
  // Get convenient variables
  GSVScan *scan = Scan();
  if (!scan) return -1;
  GSVSurvey *survey = Survey();
  if (!survey) return -1;

  // Compute survey index
  int survey_index = ScanIndex();
  for (int i = 0; i < scan->SurveyIndex(); i++) {
    GSVScan *s = survey->Scan(i);
    survey_index += s->NScanlines();
  }

  // Return survey index
  return survey_index;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x59940
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x56f72
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x56fff
movq 0x10(%rsp), %rdi
callq 0x56b80
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x56f93
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x56fff
movq 0x10(%rsp), %rdi
callq 0x565d0
movl %eax, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rsp), %rdi
callq 0x53fb0
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x56ff7
movq 0x28(%rsp), %rdi
movl 0x20(%rsp), %esi
callq 0x3a0a0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x3a0d0
addl 0x24(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x56fa9
movl 0x24(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x30(%rax)
jne 0x57033
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x5708c
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x566d0
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x14(%rsp)
movq 0x28(%rax), %rdi
movl 0x30(%rax), %eax
subl $0x1, %eax
cltq
imulq $0x50, %rax, %rax
addq %rax, %rdi
callq 0x566d0
movl %eax, 0x10(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x10(%rsp), %eax
jle 0x5707c
movl 0x14(%rsp), %eax
movl %eax, 0x4(%rsp)
jmp 0x57084
movl 0x10(%rsp), %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0xd8, %rsp
movq %rdi, 0xc8(%rsp)
movl %esi, 0xc4(%rsp)
movq 0xc8(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movl 0xc4(%rsp), %edx
leaq 0xa0(%rsp), %rdi
callq 0x59950
movq 0x8(%rsp), %rdi
leaq 0xa0(%rsp), %rax
movq %rax, 0xb8(%rsp)
addq $0x38, %rdi
callq 0x3a330
movq 0x8(%rsp), %rsi
movq %rax, 0x98(%rsp)
addq $0x38, %rsi
leaq 0x78(%rsp), %rdi
callq 0x5e6c0
movq 0x8(%rsp), %rsi
leaq 0x78(%rsp), %rax
movq %rax, 0x90(%rsp)
addq $0x38, %rsi
leaq 0x58(%rsp), %rdi
callq 0x5e730
leaq 0x58(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x90(%rsp), %rsi
movq 0x70(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x181d30
movq 0xb8(%rsp), %rsi
movq 0x98(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x1800f0
leaq 0x28(%rsp), %rdi
callq 0x1810d0
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
leaq 0x2a1a10(%rip), %rax    # 0x2f8e28
movsd (%rax), %xmm1
callq 0x51990
cmpl $0x0, %eax
je 0x57437
xorps %xmm0, %xmm0
movsd %xmm0, 0xd0(%rsp)
jmp 0x574db
movsd 0x20(%rsp), %xmm0
leaq 0x28(%rsp), %rdi
callq 0x182100
movq 0x70(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x181500
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x29b90
movsd %xmm0, 0x10(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x181500
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x574b5
leaq 0x216ae5(%rip), %rax    # 0x26df88
movsd (%rax), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
jmp 0x574cc
leaq 0x216acc(%rip), %rax    # 0x26df88
movsd (%rax), %xmm0
subsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd0(%rsp), %xmm0
addq $0xd8, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScanline.cpp
// Function: gaps::GSVScanline::SetPose(gaps::GSVPose const&)
void GSVScanline::
SetPose(const GSVPose& pose)
{
  // Update points
  if ((NPoints() > 0) && (points) && (!(this->pose.Orientation().IsZero()))) {
    // Determine transformation of points
    R4Matrix matrix = R4identity_matrix;
    matrix.Translate(pose.Viewpoint().Vector());
    matrix.Multiply(pose.Orientation().Matrix());
    matrix.Multiply(this->pose.Orientation().Inverse().Matrix());
    matrix.Translate(-this->pose.Viewpoint().Vector());
    R3Affine transformation(matrix, 0);
    
    // Transform points
    for (int i = 0; i < npoints; i++) {
      points[i].Transform(transformation);
    }
  }

  // Set pose
  this->pose = pose;

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
subq $0x328, %rsp            # imm = 0x328
movq %rdi, 0x320(%rsp)
movq %rsi, 0x318(%rsp)
movq 0x320(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x3a120
cmpl $0x0, %eax
jle 0x57924
movq (%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0x57924
movq (%rsp), %rdi
addq $0x38, %rdi
callq 0x44c70
movq %rax, %rdi
callq 0x59990
cmpl $0x0, %eax
jne 0x57924
leaq 0x298(%rsp), %rdi
leaq 0x2ab193(%rip), %rsi    # 0x302940
callq 0x160750
movq 0x318(%rsp), %rdi
callq 0x3a330
movq %rax, %rsi
leaq 0x280(%rsp), %rdi
callq 0x59a20
leaq 0x298(%rsp), %rdi
leaq 0x280(%rsp), %rsi
callq 0x1620a0
movq 0x318(%rsp), %rdi
callq 0x44c70
movq %rax, %rsi
leaq 0x200(%rsp), %rdi
callq 0x15f540
leaq 0x298(%rsp), %rdi
leaq 0x200(%rsp), %rsi
callq 0x59a60
movq (%rsp), %rdi
addq $0x38, %rdi
callq 0x44c70
movq %rax, %rsi
leaq 0x160(%rsp), %rdi
callq 0x15f990
leaq 0x180(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x15f540
leaq 0x298(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0x59a60
movq (%rsp), %rdi
addq $0x38, %rdi
callq 0x3a330
movq %rax, %rsi
leaq 0x130(%rsp), %rdi
callq 0x59a20
leaq 0x148(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x1821e0
leaq 0x298(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x1620a0
leaq 0x20(%rsp), %rdi
leaq 0x298(%rsp), %rsi
xorl %edx, %edx
callq 0x15c110
movl $0x0, 0x1c(%rsp)
movq (%rsp), %rcx
movl 0x1c(%rsp), %eax
cmpl 0x30(%rcx), %eax
jge 0x5791a
movq (%rsp), %rax
movq 0x28(%rax), %rdi
movslq 0x1c(%rsp), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
addq %rax, %rdi
leaq 0x20(%rsp), %rsi
callq 0x59ab0
jmp 0x578f1
jmp 0x578f3
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x578c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x10(%rsp)
movl %eax, 0xc(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x15c1b0
jmp 0x5794a
leaq 0x20(%rsp), %rdi
callq 0x15c1b0
movq (%rsp), %rdi
movq 0x318(%rsp), %rsi
addq $0x38, %rdi
callq 0x47d40
movq (%rsp), %rdi
callq 0x57960
addq $0x328, %rsp            # imm = 0x328
retq
movq 0x10(%rsp), %rdi
callq 0x29c10
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScanline.cpp
// Function: gaps::GSVScanline::InvalidateBBox()
void GSVScanline::
InvalidateBBox(void) 
{
  // Invalidate bounding box
  if (bbox.XMin() != FLT_MAX) {
    bbox = R3Box(FLT_MAX,FLT_MAX,FLT_MAX,-FLT_MAX,-FLT_MAX,-FLT_MAX);
    if (scan) scan->InvalidateBBox();
  }
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x10(%rsp)
addq $0x88, %rdi
callq 0x38b90
movsd 0x20e691(%rip), %xmm1   # 0x266018
ucomisd %xmm1, %xmm0
jne 0x57994
jp 0x57994
jmp 0x57a19
leaq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movsd 0x20e672(%rip), %xmm2   # 0x266018
movsd 0x20e672(%rip), %xmm5   # 0x266020
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
movaps %xmm5, %xmm3
movaps %xmm5, %xmm4
callq 0x151b90
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
addq $0x88, %rdi
callq 0x386d0
jmp 0x579d7
leaq 0x28(%rsp), %rdi
callq 0x386c0
movq 0x10(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x57a17
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x55a60
jmp 0x57a17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x386c0
jmp 0x57a1e
jmp 0x57a19
addq $0x68, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x29c10
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScanline.cpp
// Function: gaps::LoadColor(double)
static void
LoadColor(double value)
{
  // Load heatmap color
  GLdouble r, g, b;
  if (value <= 0) {
    // Red
    r = 1;
    g = 0;
    b = 0;
  }
  if (value < 0.25) {
    // Red to yellow
    value *= 4;
    r = 1;
    g = value;
    b = 0;
  }
  else if (value < 0.5) {
    // Yellow to green
    value = (value - 0.25) * 4;
    r = 1 - value;
    g = 1;
    b = 0;
  }
  else if (value < 0.75) {
    // Green to cyan
    value = (value - 0.5) * 4;
    r = 0;
    g = 1;
    b = value;
  }
  else if (value < 1) {
    // Cyan to blue
    value = (value - 0.75) * 4;
    r = 0;
    g = 1 - value;
    b = 1;
  }
  else {
    // Blue
    r = 0;
    g = 0;
    b = 1;
  }
  RNLoadRgb(r, g, b);
}

// Assembly:
subq $0x28, %rsp
movsd %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
ucomisd 0x20(%rsp), %xmm0
jb 0x586c5
movsd 0x20d963(%rip), %xmm0   # 0x266010
movsd %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x20d9db(%rip), %xmm0   # 0x2660a8
ucomisd 0x20(%rsp), %xmm0
jbe 0x58711
movsd 0x20ecd3(%rip), %xmm0   # 0x2673b0
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20d91f(%rip), %xmm0   # 0x266010
movsd %xmm0, 0x18(%rsp)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x58858
movsd 0x20d937(%rip), %xmm0   # 0x266050
ucomisd 0x20(%rsp), %xmm0
jbe 0x58775
movsd 0x20(%rsp), %xmm0
movsd 0x20d979(%rip), %xmm1   # 0x2660a8
subsd %xmm1, %xmm0
movsd 0x20ec75(%rip), %xmm1   # 0x2673b0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20d8c3(%rip), %xmm0   # 0x266010
subsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x20d8af(%rip), %xmm0   # 0x266010
movsd %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x58856
movsd 0x20ec2b(%rip), %xmm0   # 0x2673a8
ucomisd 0x20(%rsp), %xmm0
jbe 0x587d1
movsd 0x20(%rsp), %xmm0
movsd 0x20d8bd(%rip), %xmm1   # 0x266050
subsd %xmm1, %xmm0
movsd 0x20ec11(%rip), %xmm1   # 0x2673b0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x20d856(%rip), %xmm0   # 0x266010
movsd %xmm0, 0x10(%rsp)
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x58854
movsd 0x20d837(%rip), %xmm0   # 0x266010
ucomisd 0x20(%rsp), %xmm0
jbe 0x58832
movsd 0x20(%rsp), %xmm0
movsd 0x20ebb9(%rip), %xmm1   # 0x2673a8
subsd %xmm1, %xmm0
movsd 0x20ebb5(%rip), %xmm1   # 0x2673b0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x20d7fa(%rip), %xmm0   # 0x266010
subsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x20d7e6(%rip), %xmm0   # 0x266010
movsd %xmm0, 0x8(%rsp)
jmp 0x58852
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x20d7c4(%rip), %xmm0   # 0x266010
movsd %xmm0, 0x8(%rsp)
jmp 0x58854
jmp 0x58856
jmp 0x58858
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
callq 0x38d60
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScanline.cpp
// Function: gaps::GSVScanline::Print(_IO_FILE*, char const*, char const*) const
void GSVScanline::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print scanline header
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "Scanline %d:", scan_index);
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");

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

  // Print points
  // ???
}

// Assembly:
subq $0x438, %rsp            # imm = 0x438
movq %rdi, 0x430(%rsp)
movq %rsi, 0x428(%rsp)
movq %rdx, 0x420(%rsp)
movq %rcx, 0x418(%rsp)
movq 0x430(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x428(%rsp)
jne 0x59291
movq 0x295d42(%rip), %rax    # 0x2eefc8
movq (%rax), %rax
movq %rax, 0x428(%rsp)
cmpq $0x0, 0x420(%rsp)
je 0x592ba
movq 0x428(%rsp), %rdi
movq 0x420(%rsp), %rdx
leaq 0x226f74(%rip), %rsi    # 0x280227
movb $0x0, %al
callq 0x293c0
movq 0x8(%rsp), %rax
movq 0x428(%rsp), %rdi
movl 0x10(%rax), %edx
leaq 0x20e11f(%rip), %rsi    # 0x2673f0
movb $0x0, %al
callq 0x293c0
cmpq $0x0, 0x418(%rsp)
je 0x59301
movq 0x428(%rsp), %rdi
movq 0x418(%rsp), %rdx
leaq 0x226f2d(%rip), %rsi    # 0x280227
movb $0x0, %al
callq 0x293c0
movq 0x428(%rsp), %rdi
leaq 0x20daf6(%rip), %rsi    # 0x266e06
movb $0x0, %al
callq 0x293c0
leaq 0x10(%rsp), %rdi
movq 0x420(%rsp), %rdx
leaq 0x20d7cb(%rip), %rsi    # 0x266af6
movb $0x0, %al
callq 0x2a280
addq $0x438, %rsp            # imm = 0x438
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScanline.cpp
// Function: gaps::GSVScanline::FindPointIndexWithClosestBeamIndex(int) const
int GSVScanline::
FindPointIndexWithClosestBeamIndex(int query_beam_index) const
{
  // Initialize result
  int closest_delta = INT_MAX;
  int closest_point_index = -1;

  // Search for closest point (by beam index)
  for (int i = 0; i < npoints; i++) {
    const GSVPoint *point = &points[i];
    int delta = abs(point->BeamIndex() - query_beam_index);
    if (delta < closest_delta) {
      closest_delta = delta;
      closest_point_index = i;
      if (closest_delta == 0) break;
    }
  }

  // Return closest point index
  return closest_point_index;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x7fffffff, 0x28(%rsp) # imm = 0x7FFFFFFF
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x20(%rsp)
movq 0x8(%rsp), %rcx
movl 0x20(%rsp), %eax
cmpl 0x30(%rcx), %eax
jge 0x593e4
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movslq 0x20(%rsp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x566d0
subl 0x2c(%rsp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x28(%rsp), %eax
jge 0x593d5
movl 0x14(%rsp), %eax
movl %eax, 0x28(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x28(%rsp)
jne 0x593d3
jmp 0x593e4
jmp 0x593d5
jmp 0x593d7
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x5936f
movl 0x24(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)