LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::FindPanoramaBeforeTimestamp(double, int, int) const
GSVPanorama *GSVSegment::
FindPanoramaBeforeTimestamp(RNScalar timestamp, int imin, int imax) const
{
  // Binary search
  int i = (imin + imax) / 2;
  if (i == imin) return Panorama(imin);
  assert(i < imax);
  GSVPanorama *panorama = Panorama(i);
  RNScalar t = panorama->Timestamp();
  if (t > timestamp) return FindPanoramaBeforeTimestamp(timestamp, imin, i);
  else if (t < timestamp) return FindPanoramaBeforeTimestamp(timestamp, i, imax);
  else return panorama;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movl %esi, %ebx
movsd %xmm0, 0x8(%rsp)
movq %rdi, %r15
movl %r14d, %ebp
movl %ebp, %r14d
leal (%r14,%rbx), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
movq 0x40(%r15), %rax
cmpl %ebx, %ebp
je 0x39d90
movslq %ebp, %rcx
movq (%rax,%rcx,8), %r12
movsd 0x70(%r12), %xmm0
ucomisd 0x11430b(%rip), %xmm0   # 0x14e070
jne 0x39d71
jp 0x39d71
movq %r12, %rdi
callq 0x3d230
movsd 0x70(%r12), %xmm0
ucomisd 0x8(%rsp), %xmm0
ja 0x39d37
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movl %ebp, %ebx
ja 0x39d34
jmp 0x39d97
movslq %ebx, %rcx
movq (%rax,%rcx,8), %r12
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::FindPanoramaBeforeTimestamp(double) const
GSVPanorama *GSVSegment::
FindPanoramaBeforeTimestamp(RNScalar timestamp) const
{
  // Binary search
  if (NPanoramas() == 0) return NULL;
  if (timestamp <= Panorama(0)->Timestamp()) return Panorama(0);
  if (timestamp >= Panorama(NPanoramas()-1)->Timestamp()) return Panorama(NPanoramas()-1);
  return FindPanoramaBeforeTimestamp(timestamp, 0, NPanoramas()-1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x4c(%rdi)
je 0x39e3b
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq (%rax), %r14
movsd 0x70(%r14), %xmm1
ucomisd 0x1142a2(%rip), %xmm1   # 0x14e070
movsd %xmm0, (%rsp)
jne 0x39de4
jp 0x39de4
movq %r14, %rdi
callq 0x3d230
movsd (%rsp), %xmm0
movsd 0x70(%r14), %xmm1
ucomisd %xmm0, %xmm1
jae 0x39e3f
movslq 0x4c(%rbx), %rax
movq 0x40(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %r14
movsd 0x70(%r14), %xmm1
ucomisd 0x114265(%rip), %xmm1   # 0x14e070
jne 0x39e1c
jp 0x39e1c
movq %r14, %rdi
callq 0x3d230
movsd (%rsp), %xmm0
ucomisd 0x70(%r14), %xmm0
movslq 0x4c(%rbx), %rdx
jae 0x39e48
decl %edx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x39d1a
xorl %eax, %eax
jmp 0x39e51
movq 0x40(%rbx), %rax
movq (%rax), %rax
jmp 0x39e51
movq 0x40(%rbx), %rax
movq -0x8(%rax,%rdx,8), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::NPoints() const
int GSVSegment::
NPoints(void) const
{
  // Return number of points in all surveys
  int npoints = 0;
  for (int i = 0; i < NSurveys(); i++) 
    npoints += Survey(i)->NPoints();
  return npoints;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x2c(%rdi)
jle 0x39e89
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3f5ae
addl %eax, %ebp
incq %r14
movslq 0x2c(%rbx), %rax
cmpq %rax, %r14
jl 0x39e6c
jmp 0x39e8b
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::Viewpoint(double) const
R3Point GSVSegment::
Viewpoint(RNScalar timestamp) const
{  
  // Return "viewpoint" of the car at timestamp
  if (NPanoramas() == 0) return R3zero_point;
  GSVPanorama *panorama0 = FindPanoramaBeforeTimestamp(timestamp);
  if (!panorama0) return R3zero_point;
  int i0 = panorama0->SegmentIndex();
  if (i0 >= NPanoramas()-1) return panorama0->Viewpoint();
  GSVPanorama *panorama1 = Panorama(i0 + 1);
  RNScalar t0 = panorama0->Timestamp();
  RNScalar t1 = panorama1->Timestamp();
  if (t1 <= t0) return panorama0->Viewpoint();
  RNScalar t = (timestamp - t0) / (t1 - t0);
  if (t <= 0) return panorama0->Viewpoint();
  else if (t >= 1) return panorama1->Viewpoint();
  return (1 - t) * panorama0->Viewpoint() + t * panorama1->Viewpoint();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x4c(%rsi)
je 0x39ff8
movq %rsi, %r15
movq %rsi, %rdi
movsd %xmm0, 0x10(%rsp)
callq 0x39da8
testq %rax, %rax
je 0x39ff8
movq %rax, %r14
movslq 0x10(%rax), %rax
movl 0x4c(%r15), %ecx
decl %ecx
cmpl %ecx, %eax
jge 0x3a004
movq 0x40(%r15), %rcx
movq 0x8(%rcx,%rax,8), %r15
movsd 0x70(%r14), %xmm0
ucomisd 0x114180(%rip), %xmm0   # 0x14e070
jne 0x39efc
jp 0x39efc
movq %r14, %rdi
callq 0x3d230
movsd 0x70(%r14), %xmm2
movsd 0x70(%r15), %xmm0
ucomisd 0x114160(%rip), %xmm0   # 0x14e070
jne 0x39f28
jp 0x39f28
movq %r15, %rdi
movsd %xmm2, 0x8(%rsp)
callq 0x3d230
movsd 0x8(%rsp), %xmm2
movsd 0x70(%r15), %xmm0
ucomisd %xmm0, %xmm2
jae 0x3a004
movsd 0x10(%rsp), %xmm1
subsd %xmm2, %xmm1
subsd %xmm2, %xmm0
divsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jae 0x3a004
ucomisd 0x114128(%rip), %xmm1   # 0x14e088
jae 0x3a03f
movsd 0x11411a(%rip), %xmm0   # 0x14e088
movsd %xmm1, 0x10(%rsp)
subsd %xmm1, %xmm0
movq %r14, %r12
addq $0x28, %r12
movsd 0x28(%r14), %xmm1
ucomisd 0x11407b(%rip), %xmm1   # 0x14e008
jne 0x39fa5
jp 0x39fa5
movq %r14, %rdi
movsd %xmm0, 0x8(%rsp)
callq 0x3cf6e
movsd 0x8(%rsp), %xmm0
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0xd6878
leaq 0x28(%r15), %r14
movsd 0x28(%r15), %xmm0
ucomisd 0x114044(%rip), %xmm0   # 0x14e008
jne 0x39fd0
jp 0x39fd0
movq %r15, %rdi
callq 0x3cf6e
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movsd 0x10(%rsp), %xmm0
callq 0xd6878
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0xd6832
jmp 0x3a030
leaq 0x5a7651(%rip), %rsi    # 0x5e1650
movq %rbx, %rdi
jmp 0x3a02b
movq %r14, %r15
addq $0x28, %r15
movsd 0x28(%r14), %xmm0
ucomisd 0x113fef(%rip), %xmm0   # 0x14e008
jne 0x3a025
jp 0x3a025
movq %r14, %rdi
callq 0x3cf6e
movq %rbx, %rdi
movq %r15, %rsi
callq 0xd5e3e
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x28(%r15), %r14
movsd 0x28(%r15), %xmm0
ucomisd 0x113fb7(%rip), %xmm0   # 0x14e008
jne 0x3a05d
jp 0x3a05d
movq %r15, %rdi
callq 0x3cf6e
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x3a02b
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::Right(double) const
R3Vector GSVSegment::
Right(RNScalar timestamp) const
{
  // Return vector to right of car
  R3Vector front = Front(timestamp);
  R3Vector up = Up(timestamp);
  R3Vector right = front % up;
  right.Normalize();
  return right;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x3a066
leaq 0x11eb32(%rip), %rsi    # 0x158da0
movq %rsp, %r15
movq %r15, %rdi
callq 0xd68d6
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xd721a
movq %rbx, %rdi
callq 0xd6be8
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::RemoveSurvey(gaps::GSVSurvey*)
void GSVSegment::
RemoveSurvey(GSVSurvey *survey)
{
  // Just checking
  assert(survey->segment_index >= 0);
  assert(survey->segment_index < surveys.NEntries());
  assert(survey->segment == this);

  // Remove laser survey
  RNArrayEntry *entry = surveys.KthEntry(survey->segment_index);
  GSVSurvey *tail = surveys.Tail();
  tail->segment_index = survey->segment_index;
  surveys.EntryContents(entry) = tail;
  surveys.RemoveTail();
  survey->segment_index = -1;
  survey->segment = NULL;

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x20, %rdi
movslq 0x10(%rsi), %rax
movq 0x20(%r14), %rcx
movslq 0x2c(%r14), %rdx
movq -0x8(%rcx,%rdx,8), %rsi
movl %eax, 0x10(%rsi)
movq %rsi, (%rcx,%rax,8)
leal -0x1(%rdx), %esi
callq 0xfa9d6
movl $0xffffffff, 0x10(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x8(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3a2bc
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::RemoveTapestry(gaps::GSVTapestry*)
void GSVSegment::
RemoveTapestry(GSVTapestry *tapestry)
{
  // Just checking
  assert(tapestry->segment_index >= 0);
  assert(tapestry->segment_index < tapestries.NEntries());
  assert(tapestry->segment == this);

  // Remove camera tapestry
  RNArrayEntry *entry = tapestries.KthEntry(tapestry->segment_index);
  GSVTapestry *tail = tapestries.Tail();
  tail->segment_index = tapestry->segment_index;
  tapestries.EntryContents(entry) = tail;
  tapestries.RemoveTail();
  tapestry->segment_index = -1;
  tapestry->segment = NULL;

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x30, %rdi
movslq 0x10(%rsi), %rax
movq 0x30(%r14), %rcx
movslq 0x3c(%r14), %rdx
movq -0x8(%rcx,%rdx,8), %rsi
movl %eax, 0x10(%rsi)
movq %rsi, (%rcx,%rax,8)
leal -0x1(%rdx), %esi
callq 0xfa9d6
movl $0xffffffff, 0x10(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x8(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3a2bc
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::RemovePanorama(gaps::GSVPanorama*)
void GSVSegment::
RemovePanorama(GSVPanorama *panorama)
{
  // Just checking
  assert(panorama->segment_index >= 0);
  assert(panorama->segment_index < panoramas.NEntries());
  assert(panorama->segment == this);

  // Remove camera panorama
  RNArrayEntry *entry = panoramas.KthEntry(panorama->segment_index);
  GSVPanorama *tail = panoramas.Tail();
  tail->segment_index = panorama->segment_index;
  panoramas.EntryContents(entry) = tail;
  panoramas.RemoveTail();
  panorama->segment_index = -1;
  panorama->segment = NULL;

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x40, %rdi
movslq 0x10(%rsi), %rax
movq 0x40(%r14), %rcx
movslq 0x4c(%r14), %rdx
movq -0x8(%rcx,%rdx,8), %rsi
movl %eax, 0x10(%rsi)
movq %rsi, (%rcx,%rax,8)
leal -0x1(%rdx), %esi
callq 0xfa9d6
movl $0xffffffff, 0x10(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x8(%rbx)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3a2bc
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::Draw(gaps::RNFlags) const
void GSVSegment::
Draw(RNFlags flags) const
{
  // Draw surveys
  for (int i = 0; i < NSurveys(); i++) {
    GSVSurvey *survey = Survey(i);
    survey->Draw(flags);
  }

  // Draw tapestries
  for (int i = 0; i < NTapestries(); i++) {
    GSVTapestry *tapestry = Tapestry(i);
    tapestry->Draw(flags);
  }
}

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

  // Print segment 
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "Segment %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);
  }

  // Print tapestries
  for (int i = 0; i < NTapestries(); i++) {
    GSVTapestry *tapestry = Tapestry(i);
    tapestry->Print(fp, indented_prefix, suffix);
  }

  // Print panorama
  for (int i = 0; i < NPanoramas(); i++) {
    GSVPanorama *panorama = Panorama(i);
    panorama->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 0x3a537
movq 0x19c9dc(%rip), %rax    # 0x1d6f10
movq (%rax), %r15
testq %r12, %r12
je 0x3a547
movq %r12, %rdi
movq %r15, %rsi
callq 0x27aa0
movl 0x18(%r14), %edx
leaq 0x11497e(%rip), %rsi    # 0x14eed0
movq %r15, %rdi
xorl %eax, %eax
callq 0x27e10
testq %rbx, %rbx
je 0x3a56c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27aa0
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c40
leaq 0x114464(%rip), %rsi    # 0x14e9e4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x2c(%r14)
jle 0x3a5bd
xorl %r13d, %r13d
movq %rsp, %r12
movq 0x20(%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 0x2c(%r14), %rax
cmpq %rax, %r13
jl 0x3a59a
cmpl $0x0, 0x3c(%r14)
jle 0x3a5ed
xorl %r13d, %r13d
movq %rsp, %r12
movq 0x30(%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 0x3c(%r14), %rax
cmpq %rax, %r13
jl 0x3a5ca
cmpl $0x0, 0x4c(%r14)
jle 0x3a61d
xorl %r13d, %r13d
movq %rsp, %r12
movq 0x40(%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 0x4c(%r14), %rax
cmpq %rax, %r13
jl 0x3a5fa
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/GSVSegment.cpp
// Function: gaps::GSVSegment::UpdateBBox()
void GSVSegment::
UpdateBBox(void) 
{
  // Update bounding box
  bbox = R3null_box;
  for (int i = 0; i < NSurveys(); i++) bbox.Union(Survey(i)->BBox());
  for (int i = 0; i < NTapestries(); i++) bbox.Union(Tapestry(i)->BBox());
  for (int i = 0; i < NPanoramas(); i++) bbox.Union(Panorama(i)->Viewpoint());
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x50(%rdi), %r14
addq $0x58, %rdi
leaq 0x1a6360(%rip), %r15    # 0x1e09a8
leaq 0x8(%r15), %rsi
callq 0xd619c
leaq 0x70(%rbx), %rdi
addq $0x20, %r15
movq %r15, %rsi
callq 0xd619c
cmpl $0x0, 0x2c(%rbx)
jle 0x3a6a7
xorl %r12d, %r12d
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x48(%r15), %xmm0
ucomisd 0x113988(%rip), %xmm0   # 0x14e008
jne 0x3a68c
jp 0x3a68c
movq %r15, %rdi
callq 0x3f830
addq $0x40, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbfb20
incq %r12
movslq 0x2c(%rbx), %rax
cmpq %rax, %r12
jl 0x3a66a
cmpl $0x0, 0x3c(%rbx)
jle 0x3a6ed
xorl %r12d, %r12d
movq 0x30(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x40(%r15), %xmm0
ucomisd 0x113942(%rip), %xmm0   # 0x14e008
jne 0x3a6d2
jp 0x3a6d2
movq %r15, %rdi
callq 0x3ed98
addq $0x38, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbfb20
incq %r12
movslq 0x3c(%rbx), %rax
cmpq %rax, %r12
jl 0x3a6b0
cmpl $0x0, 0x4c(%rbx)
jle 0x3a733
xorl %r12d, %r12d
movq 0x40(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x28(%r15), %xmm0
ucomisd 0x1138fc(%rip), %xmm0   # 0x14e008
jne 0x3a718
jp 0x3a718
movq %r15, %rdi
callq 0x3cf6e
addq $0x28, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbfa56
incq %r12
movslq 0x4c(%rbx), %rax
cmpq %rax, %r12
jl 0x3a6f6
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/GSVSegment.cpp
// Function: gaps::GSVSegment::InvalidateNormals()
void GSVSegment::
InvalidateNormals(void)
{
  // Invalidate all normals
  for (int iu = 0; iu < NSurveys(); iu++) {
    GSVSurvey *survey = Survey(iu);
    for (int ia = 0; ia < survey->NScans(); ia++) {
      GSVScan *scan = survey->Scan(ia);
      for (int ie = 0; ie < scan->NScanlines(); ie++) {
        GSVScanline *scanline = scan->Scanline(ie);
        if (!scanline->ArePointsResident()) continue;
        for (int ik = 0; ik < scanline->NPoints(); ik++) {
          GSVPoint& point = (GSVPoint&) scanline->Point(ik);
          point.SetNormal(R3zero_vector);
        }
      }
    }
  }
}

// Assembly:
movslq 0x2c(%rdi), %rax
testq %rax, %rax
jle 0x3b0cd
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x20(%rdi), %rcx
xorl %edx, %edx
leaq 0x11dd05(%rip), %rsi    # 0x158d40
movq (%rcx,%rdx,8), %r8
movslq 0x34(%r8), %rdi
testq %rdi, %rdi
jle 0x3b0ba
movq 0x28(%r8), %r8
xorl %r9d, %r9d
movq (%r8,%r9,8), %r11
movslq 0x34(%r11), %r10
testq %r10, %r10
jle 0x3b0b2
movq 0x28(%r11), %r11
movupd (%rsi), %xmm0
cvtpd2ps %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtsd2ss 0x10(%rsi), %xmm1
xorl %ebx, %ebx
movq (%r11,%rbx,8), %r15
movq 0x28(%r15), %r14
testq %r14, %r14
je 0x3b0aa
movslq 0x30(%r15), %r15
testq %r15, %r15
jle 0x3b0aa
shlq $0x4, %r15
leaq (%r15,%r15,4), %r15
xorl %r12d, %r12d
movlpd %xmm0, 0x20(%r14,%r12)
movss %xmm1, 0x28(%r14,%r12)
addq $0x50, %r12
cmpq %r12, %r15
jne 0x3b093
incq %rbx
cmpq %r10, %rbx
jne 0x3b072
incq %r9
cmpq %rdi, %r9
jne 0x3b04f
incq %rdx
cmpq %rax, %rdx
jne 0x3b03b
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/../../pkgs/R3Shapes/R3Kdtree.cpp
// Function: gaps::R3Kdtree<gaps::GSVPoint const*>::FindAll(gaps::GSVPoint const*, double, double, int (*)(gaps::GSVPoint const*, gaps::GSVPoint const*, void*), void*, gaps::RNArray<gaps::GSVPoint const*>&) const
int R3Kdtree<PtrType>::
FindAll(PtrType query_point,
  RNScalar min_distance, RNScalar max_distance, 
  int (*IsCompatible)(PtrType, PtrType, void *), void *compatible_data, 
  RNArray<PtrType>& points) const
{
  // Check root
  if (!root) return 0;

  // Use squared distances for efficiency
  if (max_distance < 0) return 0;
  if (min_distance < 0) min_distance = 0;
  RNLength min_distance_squared = min_distance * min_distance;
  RNLength max_distance_squared = max_distance * max_distance;

  // Search nodes recursively
  FindAll(root, bbox, 
    query_point, Position(query_point), 
    min_distance_squared, max_distance_squared, 
    IsCompatible, compatible_data, 
    points);

  // Return number of points
  return points.NEntries();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq 0x50(%rdi), %rbp
testq %rbp, %rbp
sete %cl
xorpd %xmm2, %xmm2
ucomisd %xmm1, %xmm2
seta %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x3b297
movq %r8, %rbx
movq %rsi, %r12
movq %rdi, %r13
maxsd %xmm0, %xmm2
mulsd %xmm2, %xmm2
movsd %xmm2, (%rsp)
mulsd %xmm1, %xmm1
movsd %xmm1, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x3b35e
movq %r13, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
leaq 0x10(%rsp), %r8
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %r15, %r9
pushq %rbx
pushq %r14
callq 0x3b746
addq $0x10, %rsp
movl 0xc(%rbx), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVCamera.cpp
// Function: gaps::GSVCamera::~GSVCamera()
GSVCamera::
~GSVCamera(void)
{
  // Remove camera from run
  if (run) run->RemoveCamera(this);

  // Remove camera tapestries from this camera
  while (NTapestries() > 0) RemoveTapestry(Tapestry(0));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x192d97(%rip), %rax    # 0x1ce928
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3bba5
movq %rbx, %rsi
callq 0x38184
cmpl $0x0, 0x24(%rbx)
jle 0x3bbbc
movq 0x18(%rbx), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x3bbe0
jmp 0x3bba5
leaq 0x88(%rbx), %rdi
callq 0xbfe90
addq $0x18, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0xfa836
jmp 0x3bbd7
movq %rax, %rdi
callq 0x39936
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVCamera.cpp
// Function: gaps::GSVCamera::RemoveTapestry(gaps::GSVTapestry*)
void GSVCamera::
RemoveTapestry(GSVTapestry *tapestry)
{
  // Just checking
  assert(tapestry->camera_index >= 0);
  assert(tapestry->camera_index < tapestries.NEntries());
  assert(tapestry->camera == this);

  // Remove tapestry
  RNArrayEntry *entry = tapestries.KthEntry(tapestry->camera_index);
  GSVTapestry *tail = tapestries.Tail();
  tail->camera_index = tapestry->camera_index;
  tapestries.EntryContents(entry) = tail;
  tapestries.RemoveTail();
  tapestry->camera_index = -1;
  tapestry->camera = NULL;

  // Invalidate bounding box
  InvalidateBBox();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x18, %rdi
movslq 0x20(%rsi), %rax
movq 0x18(%r14), %rcx
movslq 0x24(%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 0x3bcb4
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVCamera.cpp
// Function: gaps::GSVCamera::Draw(gaps::RNFlags) const
void GSVCamera::
Draw(RNFlags flags) const
{
  // Draw tapestries
  for (int i = 0; i < NTapestries(); i++) {
    GSVTapestry *tapestry = Tapestry(i);
    tapestry->Draw(flags);
  }
}

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

  // Print camera header
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "Camera %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 tapestries
  for (int i = 0; i < NTapestries(); i++) {
    GSVTapestry *tapestry = Tapestry(i);
    tapestry->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 0x3bdfd
movq 0x19b116(%rip), %rax    # 0x1d6f10
movq (%rax), %r15
testq %r12, %r12
je 0x3be0d
movq %r12, %rdi
movq %r15, %rsi
callq 0x27aa0
movl 0x10(%r14), %edx
leaq 0x113110(%rip), %rsi    # 0x14ef28
movq %r15, %rdi
xorl %eax, %eax
callq 0x27e10
testq %rbx, %rbx
je 0x3be32
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27aa0
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c40
leaq 0x112b9e(%rip), %rsi    # 0x14e9e4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x24(%r14)
jle 0x3be83
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 0x3be60
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/GSVCamera.cpp
// Function: gaps::GSVCamera::UpdateBBox()
void GSVCamera::
UpdateBBox(void) 
{
  // Update bounding box
  bbox = R3null_box;
  for (int i = 0; i < NTapestries(); i++) {
    bbox.Union(Tapestry(i)->BBox());
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x90, %rdi
leaq 0x1a4afb(%rip), %r14    # 0x1e09a8
leaq 0x8(%r14), %rsi
callq 0xd619c
leaq 0xa8(%rbx), %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0xd619c
cmpl $0x0, 0x24(%rbx)
jle 0x3bf16
leaq 0x88(%rbx), %r14
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x40(%r15), %xmm0
ucomisd 0x112119(%rip), %xmm0   # 0x14e008
jne 0x3befb
jp 0x3befb
movq %r15, %rdi
callq 0x3ed98
addq $0x38, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbfb20
incq %r12
movslq 0x24(%rbx), %rax
cmpq %rax, %r12
jl 0x3bed9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVCamera.cpp
// Function: gaps::GSVCamera::DistortedPosition(gaps::R2Point const&) const
R2Point GSVCamera::
DistortedPosition(const R2Point& undistorted_image_position) const
{
  // Check focal lengths
  if (RNIsNegativeOrZero(focal_x) || RNIsNegativeOrZero(focal_y))
    return R2Point(-1,-1);
  
  // Check if there is no distortion
  if ((k1 == 0) && (k2 == 0) && (k3 == 0) && (p1 == 0) && (p2 == 0))
    return undistorted_image_position;
  
  // Undistorted_position and distorted position are both given in pixel coordinates 
  double delta_x = undistorted_image_position.X() - center_x;
  double delta_y = undistorted_image_position.Y() - center_y;
  double dir_x = delta_x / focal_x;
  double dir_y = delta_y / focal_y;
  return DistortedPositionFromUndistortedNormalizedPosition(dir_x, dir_y);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movsd 0x38(%rsi), %xmm2
leaq 0x19c2f0(%rip), %rax    # 0x1d8468
movsd (%rax), %xmm0
ucomisd %xmm2, %xmm0
jae 0x3c1ce
movsd 0x40(%rsi), %xmm3
ucomisd %xmm3, %xmm0
jae 0x3c1ce
movupd 0x58(%rsi), %xmm0
movupd 0x68(%rsi), %xmm1
xorpd %xmm4, %xmm4
cmpneqpd %xmm4, %xmm1
cmpneqpd %xmm4, %xmm0
shufps $0x88, %xmm1, %xmm0     # xmm0 = xmm0[0,2],xmm1[0,2]
movmskps %xmm0, %eax
testl %eax, %eax
jne 0x3c1e7
movsd 0x78(%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3c1e7
jp 0x3c1e7
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xf3310
jmp 0x3c1e2
movsd 0x111e9a(%rip), %xmm0   # 0x14e070
movq %rbx, %rdi
movapd %xmm0, %xmm1
callq 0xf3306
movq %rbx, %rax
popq %rbx
retq
movsd (%rdx), %xmm0
movsd 0x8(%rdx), %xmm1
subsd 0x48(%rsi), %xmm0
subsd 0x50(%rsi), %xmm1
divsd %xmm2, %xmm0
divsd %xmm3, %xmm1
movq %rbx, %rdi
callq 0x3bf22
jmp 0x3c1e2
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVPanorama.cpp
// Function: gaps::GSVPanorama::~GSVPanorama()
GSVPanorama::
~GSVPanorama(void)
{
  // Remove panorama from segment
  if (segment) segment->RemovePanorama(this);

  // Delete images 
  while (NImages() > 0) delete Image(0);

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

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x191d73(%rip), %rax    # 0x1ce968
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3cc1d
movq %rbx, %rsi
callq 0x3a426
jmp 0x3cc1d
movq 0x18(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3cc1d
movq (%rdi), %rax
callq *0x8(%rax)
cmpl $0x0, 0x24(%rbx)
jg 0x3cc0b
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x3cc31
callq 0x27b50
addq $0x18, %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/GSVPanorama.cpp
// Function: gaps::GSVPanorama::Image(char const*) const
GSVImage *GSVPanorama::
Image(const char *name) const
{
  // Return image with matching name
  for (int i = 0; i < NImages(); i++) {
    GSVImage *image = Image(i);
    if (!image->Name()) continue;
    if (!strcmp(image->Name(), name)) return image;
  }

  // None found
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq 0x24(%rdi), %r15
testq %r15, %r15
jle 0x3cd7b
movq %rsi, %rbx
movq 0x18(%rdi), %r12
xorl %r13d, %r13d
movq (%r12,%r13,8), %rbp
movq 0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x3cd69
movq %rbx, %rsi
callq 0x27d90
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
cmoveq %rbp, %r14
jmp 0x3cd6e
movl $0x4, %ecx
testb $0x3, %cl
jne 0x3cd7e
incq %r13
cmpq %r13, %r15
jne 0x3cd44
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVPanorama.cpp
// Function: gaps::GSVPanorama::InsertImage(gaps::GSVImage*)
void GSVPanorama::
InsertImage(GSVImage *image)
{
  // Just checking
  assert(image->panorama_index == -1);
  assert(image->panorama == NULL);

  // Insert image
  image->panorama = this;
  image->panorama_index = images.NEntries();
  images.Insert(image);

  // Invalidate stuff
  viewpoint.Reset(FLT_MAX, FLT_MAX, FLT_MAX);
  timestamp = -1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rdi, 0x18(%rsi)
addq $0x18, %rdi
movl 0x24(%rbx), %edx
movl %edx, 0x20(%rsi)
callq 0xfa862
movaps 0x11219c(%rip), %xmm0   # 0x14ef80
movups %xmm0, 0x28(%rbx)
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x38(%rbx)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x70(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVPanorama.cpp
// Function: gaps::GSVPanorama::RemoveImage(gaps::GSVImage*)
void GSVPanorama::
RemoveImage(GSVImage *image)
{
  // Just checking
  assert(image->panorama_index >= 0);
  assert(image->panorama_index < images.NEntries());
  assert(image->panorama == this);

  // Remove image
  RNArrayEntry *entry = images.KthEntry(image->panorama_index);
  GSVImage *tail = images.Tail();
  tail->panorama_index = image->panorama_index;
  images.EntryContents(entry) = tail;
  images.RemoveTail();
  image->panorama_index = -1;
  image->panorama = NULL;

  // Invalidate stuff
  viewpoint.Reset(FLT_MAX, FLT_MAX, FLT_MAX);
  timestamp = -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x18, %rdi
movslq 0x20(%rsi), %rax
movq 0x18(%r14), %rcx
movslq 0x24(%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)
movaps 0x112136(%rip), %xmm0   # 0x14ef80
movups %xmm0, 0x28(%r14)
movabsq $0x47efffffe0000000, %rax # imm = 0x47EFFFFFE0000000
movq %rax, 0x38(%r14)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x70(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVPanorama.cpp
// Function: gaps::GSVPanorama::Draw(gaps::RNFlags) const
void GSVPanorama::
Draw(RNFlags flags) const
{
  // Draw images
  for (int i = 0; i < NImages(); i++) {
    GSVImage *image = Image(i);
    image->Draw(flags);
  }
}

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

  // Print panorama header
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "Panorama %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 0x3ced7
movq 0x19a03c(%rip), %rax    # 0x1d6f10
movq (%rax), %r15
testq %r12, %r12
je 0x3cee7
movq %r12, %rdi
movq %r15, %rsi
callq 0x27aa0
movl 0x10(%r14), %edx
leaq 0x11209e(%rip), %rsi    # 0x14ef90
movq %r15, %rdi
xorl %eax, %eax
callq 0x27e10
testq %rbx, %rbx
je 0x3cf0c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27aa0
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c40
leaq 0x111ac4(%rip), %rsi    # 0x14e9e4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x24(%r14)
jle 0x3cf5d
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 0x3cf3a
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/GSVPanorama.cpp
// Function: gaps::GSVPanorama::UpdateTimestamp()
void GSVPanorama::
UpdateTimestamp(void) 
{
  // Update timestamp
  timestamp = 0;
  if (NImages() > 0) {
    for (int i = 0; i < NImages(); i++) 
      timestamp += Image(i)->Timestamp();
    timestamp /= NImages();
  }
}

// Assembly:
movq $0x0, 0x70(%rdi)
cmpl $0x0, 0x24(%rdi)
jle 0x3d293
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x24(%rdi), %eax
testl %eax, %eax
jle 0x3d277
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3d79c
addsd 0x70(%rbx), %xmm0
movsd %xmm0, 0x70(%rbx)
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x3d24f
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x70(%rbx), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x70(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/./GSVPanorama.h
// Function: gaps::GSVPanorama::Viewpoint() const
inline const R3Point& GSVPanorama::
Viewpoint(void) const
{
  // Return (average) viewpoint
  if (viewpoint.X() == FLT_MAX) 
    ((GSVPanorama *) this)->UpdatePose();
  return viewpoint;
}

// Assembly:
pushq %rbx
leaq 0x28(%rdi), %rbx
movsd 0x28(%rdi), %xmm0
ucomisd 0x110d62(%rip), %xmm0   # 0x14e008
jne 0x3d2af
jp 0x3d2af
callq 0x3cf6e
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVImage.cpp
// Function: gaps::GSVImage::~GSVImage()
GSVImage::
~GSVImage(void)
{
  // Remove image from tapestry
  if (tapestry) tapestry->RemoveImage(this);

  // Remove image from panorama
  if (panorama) panorama->RemoveImage(this);

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

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x19161d(%rip), %rax    # 0x1ce9a8
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3d39f
movq %rbx, %rsi
callq 0x3ec52
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x3d3b0
movq %rbx, %rsi
callq 0x3ce06
movq 0xb8(%rbx), %rdi
testq %rdi, %rdi
je 0x3d3c1
callq 0x27b50
leaq 0x68(%rbx), %rdi
callq 0x455ba
addq $0x28, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x455ba
movq %rax, %rdi
callq 0x39936
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVImage.cpp
// Function: gaps::GSVImage::SceneIndex() const
int GSVImage::
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->NImages();
  }

  // Return scene index
  return scene_index;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3d459
callq 0x3e87a
movq %rax, %rbx
jmp 0x3d45b
xorl %ebx, %ebx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rbx, %rbx
je 0x3d49c
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x3d49c
movq %r14, %rdi
callq 0x3d4aa
movl %eax, %ebp
cmpl $0x0, 0x10(%rbx)
jle 0x3d49c
xorl %r14d, %r14d
movq 0x8(%r15), %rax
movq (%rax,%r14,8), %rdi
callq 0x37f62
addl %eax, %ebp
incq %r14
movslq 0x10(%rbx), %rax
cmpq %rax, %r14
jl 0x3d481
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/GSVImage.cpp
// Function: gaps::GSVImage::Pose(int) const
GSVPose GSVImage::
Pose(int column_index) const
{
  // Return pose estimate for given column
  int ncolumns = Width();
  if (ncolumns <= 0) return GSVPose(0,0,0,0,0,0,0);
  if (column_index < 0) column_index = ncolumns/2;
  RNScalar t = (RNScalar) column_index / (RNScalar) (ncolumns-1);
  R3Point viewpoint = (1-t)*pose0.Viewpoint() + t*pose1.Viewpoint();
  R3Quaternion orientation = R3QuaternionSlerp(pose0.Orientation(), pose1.Orientation(), t);
  return GSVPose(viewpoint, orientation);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x3d6bc
movq 0x18(%rcx), %rcx
jmp 0x3d6be
xorl %ecx, %ecx
testq %rcx, %rcx
je 0x3d6d0
movl 0x2c(%rcx), %ecx
testl %ecx, %ecx
movl $0x790, %eax            # imm = 0x790
cmovnsl %ecx, %eax
testl %eax, %eax
jle 0x3d76d
movl %eax, %ecx
shrl %ecx
testl %edx, %edx
cmovnsl %edx, %ecx
cvtsi2sd %ecx, %xmm1
decl %eax
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x11098b(%rip), %xmm0   # 0x14e088
subsd %xmm1, %xmm0
leaq 0x30(%r14), %rsi
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0xd6878
leaq 0x70(%r14), %rsi
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movsd 0x8(%rsp), %xmm0
callq 0xd6878
leaq 0x48(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xd6832
leaq 0x48(%r14), %rsi
addq $0x88, %r14
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
movsd 0x8(%rsp), %xmm0
callq 0xc2fbb
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x4546e
jmp 0x3d78b
xorps %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorps %xmm2, %xmm2
xorps %xmm3, %xmm3
xorps %xmm4, %xmm4
xorps %xmm5, %xmm5
xorps %xmm6, %xmm6
movq %rbx, %rdi
callq 0x45560
movq %rbx, %rax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVImage.cpp
// Function: gaps::GSVImage::DistortedPosition(gaps::R2Point const&) const
R2Point GSVImage::
DistortedPosition(const R2Point& undistorted_image_position) const
{
  // Return the position after distortion by the camera lens
  GSVCamera *camera = Camera();
  if (camera) return camera->DistortedPosition(undistorted_image_position);
  else return undistorted_image_position;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x3dc85
movq 0x18(%rax), %rsi
jmp 0x3dc87
xorl %esi, %esi
movq %rbx, %rdi
testq %rsi, %rsi
je 0x3dc96
callq 0x3c168
jmp 0x3dc9e
movq %rdx, %rsi
callq 0xf3310
movq %rbx, %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVImage.cpp
// Function: gaps::GSVImage::UndistortedPosition(gaps::R2Point const&) const
R2Point GSVImage::
UndistortedPosition(const R2Point& distorted_image_position) const
{
  // Return the position after the inverse of distortion by the camera lens
  GSVCamera *camera = Camera();
  if (camera) return camera->UndistortedPosition(distorted_image_position);
  else return distorted_image_position;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x3dcb7
movq 0x18(%rax), %rsi
jmp 0x3dcb9
xorl %esi, %esi
movq %rbx, %rdi
testq %rsi, %rsi
je 0x3dcc8
callq 0x3c20c
jmp 0x3dcd0
movq %rdx, %rsi
callq 0xf3310
movq %rbx, %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVImage.cpp
// Function: gaps::GSVImage::UndistortedPosition(gaps::R3Point const&, int) const
R2Point GSVImage::
UndistortedPosition(const R3Point& world_position, int column_index) const
{
  // Get camera info
  GSVCamera *camera = Camera();
  if (!camera) return 0;
  RNCoord xcenter = camera->XCenter();
  RNCoord ycenter = camera->YCenter();
  RNAngle xfocal = camera->XFocal();
  RNAngle yfocal = camera->YFocal();

  // Transform world point into column's camera coordinate system
  const GSVPose& column_pose = Pose(column_index);
  R3CoordSystem cs(column_pose.Viewpoint(), R3Triad(column_pose.Towards(), column_pose.Up()));
  R3Point camera_position = cs.InverseMatrix() * world_position;
  if (RNIsPositiveOrZero(camera_position.Z())) return R2Point(-1,-1);

  // Compute coordinates of projection
  RNCoord x = xcenter + camera_position.X() * xfocal / -(camera_position.Z());
  RNCoord y = ycenter + camera_position.Y() * yfocal / -(camera_position.Z());
  
  // Fill in point projected onto image
  return R2Point(x, y);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x170, %rsp            # imm = 0x170
movq %rdx, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x3dcf7
movq 0x18(%rax), %rax
jmp 0x3dcf9
xorl %eax, %eax
testq %rax, %rax
je 0x3de0f
movsd 0x48(%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x50(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x38(%rax), %xmm0
movsd %xmm0, (%rsp)
movsd 0x40(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movl %ecx, %edx
callq 0x3d698
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x455c6
leaq 0x38(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x4560c
leaq 0x90(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0xc29b6
leaq 0x58(%rsp), %rsi
leaq 0x110(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0xc24b8
leaq 0x90(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0xc2566
leaq 0x20(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movq %r14, %rdx
callq 0xc61fe
movsd 0x30(%rsp), %xmm2
leaq 0x19a6a8(%rip), %rax    # 0x1d8468
movsd (%rax), %xmm1
xorpd 0x110ee4(%rip), %xmm1   # 0x14ecb0
ucomisd %xmm1, %xmm2
jae 0x3de1b
movsd (%rsp), %xmm1
mulsd 0x20(%rsp), %xmm1
divsd %xmm2, %xmm1
movsd 0x18(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd 0x8(%rsp), %xmm3
mulsd 0x28(%rsp), %xmm3
divsd %xmm2, %xmm3
movsd 0x10(%rsp), %xmm1
subsd %xmm3, %xmm1
movq %rbx, %rdi
callq 0xf3306
jmp 0x3de2f
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf3324
jmp 0x3de39
movsd 0x11024d(%rip), %xmm0   # 0x14e070
movq %rbx, %rdi
movapd %xmm0, %xmm1
callq 0xf3306
leaq 0x50(%rsp), %rdi
callq 0x455ba
movq %rbx, %rax
addq $0x170, %rsp            # imm = 0x170
popq %rbx
popq %r14
popq %r15
retq
jmp 0x3de51
jmp 0x3de51
jmp 0x3de51
jmp 0x3de51
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x455ba
movq %rbx, %rdi
callq 0x28160
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVImage.cpp
// Function: gaps::GSVImage::DistortedPosition(gaps::R3Point const&) const
R2Point GSVImage::
DistortedPosition(const R3Point& world_position) const
{
  // Return position of 3D point in distorted image
  R2Point undistorted_position = UndistortedPosition(world_position);
  if (undistorted_position == R2Point(-1,-1)) return undistorted_position;
  return DistortedPosition(undistorted_position);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x3de66
leaq 0x18(%rsp), %r12
movsd 0x10fed5(%rip), %xmm0   # 0x14e070
movq %r12, %rdi
movaps %xmm0, %xmm1
callq 0xf3306
movq %r15, %rdi
movq %r12, %rsi
callq 0xf35d6
testl %eax, %eax
je 0x3e1c4
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xf3310
jmp 0x3e1d4
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3dc72
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVImage.cpp
// Function: gaps::GSVImage::Print(_IO_FILE*, char const*, char const*) const
void GSVImage::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print image header
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "Image %d:", panorama_index);
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");

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

  // Print image stuff
  // ???
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
testq %rsi, %rsi
jne 0x3e69d
movq 0x198876(%rip), %rax    # 0x1d6f10
movq (%rax), %r14
testq %rbx, %rbx
je 0x3e6ad
movq %rbx, %rdi
movq %r14, %rsi
callq 0x27aa0
movl 0x20(%r12), %edx
leaq 0x110a02(%rip), %rsi    # 0x14f0bb
movq %r14, %rdi
xorl %eax, %eax
callq 0x27e10
testq %r15, %r15
je 0x3e6d3
movq %r15, %rdi
movq %r14, %rsi
callq 0x27aa0
movl $0xa, %edi
movq %r14, %rsi
callq 0x27c40
leaq 0x1102fd(%rip), %rsi    # 0x14e9e4
movq %rsp, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x27140
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVTapestry.cpp
// Function: gaps::GSVTapestry::~GSVTapestry()
GSVTapestry::
~GSVTapestry(void)
{
  // Remove tapestry from segment
  if (segment) segment->RemoveTapestry(this);

  // Remove tapestry from camera
  if (camera) camera->RemoveTapestry(this);

  // Delete images
  while (NImages()) delete Image(0);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x19025b(%rip), %rax    # 0x1ce9e8
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3e7a1
movq %rbx, %rsi
callq 0x3a3ba
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x3e7c6
movq %rbx, %rsi
callq 0x3bbe0
jmp 0x3e7c6
movq 0x28(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3e7c6
movq (%rdi), %rax
callq *0x8(%rax)
cmpl $0x0, 0x34(%rbx)
jne 0x3e7b4
leaq 0x38(%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/GSVTapestry.cpp
// Function: gaps::GSVTapestry::FindImageBeforeTimestamp(double, int, int) const
GSVImage *GSVTapestry::
FindImageBeforeTimestamp(RNScalar timestamp, int imin, int imax) const
{
  // Binary search
  int i = (imin + imax) / 2;
  if (i == imin) return Image(imin);
  assert(i < imax);
  GSVImage *image = Image(i);
  RNScalar t = image->Timestamp();
  if (t > timestamp) return FindImageBeforeTimestamp(timestamp, imin, i);
  else if (t < timestamp) return FindImageBeforeTimestamp(timestamp, i, imax);
  else return image;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movl %esi, %ebx
movsd %xmm0, 0x8(%rsp)
movq %rdi, %r15
movl %r14d, %ebp
movl %ebp, %r14d
leal (%r14,%rbx), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
movq 0x28(%r15), %rax
cmpl %ebx, %ebp
je 0x3e927
movslq %ebp, %rcx
movq (%rax,%rcx,8), %r12
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3d79c
ucomisd 0x8(%rsp), %xmm0
ja 0x3e8e3
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movl %ebp, %ebx
ja 0x3e8e0
jmp 0x3e92e
movslq %ebx, %rcx
movq (%rax,%rcx,8), %r12
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/GSV/GSVTapestry.cpp
// Function: gaps::GSVTapestry::FindImageBeforeTimestamp(double) const
GSVImage *GSVTapestry::
FindImageBeforeTimestamp(RNScalar timestamp) const
{
  // Binary search
  if (NImages() == 0) return NULL;
  if (timestamp <= Image(0)->Timestamp()) return Image(0);
  if (timestamp >= Image(NImages()-1)->Timestamp()) return Image(NImages()-1);
  return FindImageBeforeTimestamp(timestamp, 0, NImages()-1);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
cmpl $0x0, 0x34(%rdi)
je 0x3e9a9
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movsd %xmm0, 0x8(%rsp)
callq 0x3d79c
ucomisd 0x8(%rsp), %xmm0
jae 0x3e9ad
movslq 0x34(%rbx), %rax
movq 0x28(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3d79c
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
movslq 0x34(%rbx), %rdx
jae 0x3e9b6
decl %edx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x10, %rsp
popq %rbx
jmp 0x3e8c6
xorl %eax, %eax
jmp 0x3e9bf
movq 0x28(%rbx), %rax
movq (%rax), %rax
jmp 0x3e9bf
movq 0x28(%rbx), %rax
movq -0x8(%rax,%rdx,8), %rax
addq $0x10, %rsp
popq %rbx
retq
nop