LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0x39b1b
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq (%rax), %r14
movsd 0x70(%r14), %xmm1
ucomisd 0x1125c6(%rip), %xmm1   # 0x14c070
movsd %xmm0, (%rsp)
jne 0x39ac6
jp 0x39ac6
movq %r14, %rdi
callq 0x3cebc
movsd (%rsp), %xmm0
movsd 0x70(%r14), %xmm1
ucomisd %xmm0, %xmm1
jae 0x39b1f
movslq 0x4c(%rbx), %rax
movq 0x40(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %r14
movsd 0x70(%r14), %xmm1
ucomisd 0x112589(%rip), %xmm1   # 0x14c070
jne 0x39afe
jp 0x39afe
movq %r14, %rdi
callq 0x3cebc
movsd (%rsp), %xmm0
movsd 0x70(%r14), %xmm1
ucomisd %xmm1, %xmm0
movslq 0x4c(%rbx), %rdx
jae 0x39b28
decl %edx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x399f6
xorl %eax, %eax
jmp 0x39b31
movq 0x40(%rbx), %rax
movq (%rax), %rax
jmp 0x39b31
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_O3/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 0x39b69
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3f162
addl %eax, %ebp
incq %r14
movslq 0x2c(%rbx), %rax
cmpq %rax, %r14
jl 0x39b4c
jmp 0x39b6b
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::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 0x39cd8
movq %rsi, %r15
movq %rsi, %rdi
movsd %xmm0, 0x10(%rsp)
callq 0x39a84
testq %rax, %rax
je 0x39cd8
movq %rax, %r14
movslq 0x10(%rax), %rax
movl 0x4c(%r15), %ecx
decl %ecx
cmpl %ecx, %eax
jge 0x39ce4
movq 0x40(%r15), %rcx
movq 0x8(%rcx,%rax,8), %r15
movsd 0x70(%r14), %xmm2
ucomisd 0x1124a0(%rip), %xmm2   # 0x14c070
jne 0x39be2
jp 0x39be2
movq %r14, %rdi
callq 0x3cebc
movsd 0x70(%r14), %xmm2
movsd 0x70(%r15), %xmm0
ucomisd 0x112480(%rip), %xmm0   # 0x14c070
jne 0x39c0e
jp 0x39c0e
movq %r15, %rdi
movsd %xmm2, 0x8(%rsp)
callq 0x3cebc
movsd 0x8(%rsp), %xmm2
movsd 0x70(%r15), %xmm0
ucomisd %xmm0, %xmm2
jae 0x39ce4
movsd 0x10(%rsp), %xmm1
subsd %xmm2, %xmm1
subsd %xmm2, %xmm0
divsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jae 0x39ce4
ucomisd 0x112438(%rip), %xmm1   # 0x14c078
jae 0x39d1f
movsd 0x11242a(%rip), %xmm0   # 0x14c078
movsd %xmm1, 0x10(%rsp)
subsd %xmm1, %xmm0
movq %r14, %r12
addq $0x28, %r12
movsd 0x28(%r14), %xmm1
ucomisd 0x11239b(%rip), %xmm1   # 0x14c008
jne 0x39c85
jp 0x39c85
movq %r14, %rdi
movsd %xmm0, 0x8(%rsp)
callq 0x3cc14
movsd 0x8(%rsp), %xmm0
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0xd4e22
leaq 0x28(%r15), %r14
movsd 0x28(%r15), %xmm0
ucomisd 0x112364(%rip), %xmm0   # 0x14c008
jne 0x39cb0
jp 0x39cb0
movq %r15, %rdi
callq 0x3cc14
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movsd 0x10(%rsp), %xmm0
callq 0xd4e22
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0xd4ddc
jmp 0x39d10
leaq 0x5a5961(%rip), %rsi    # 0x5df640
movq %rbx, %rdi
jmp 0x39d0b
movq %r14, %r15
addq $0x28, %r15
movsd 0x28(%r14), %xmm0
ucomisd 0x11230f(%rip), %xmm0   # 0x14c008
jne 0x39d05
jp 0x39d05
movq %r14, %rdi
callq 0x3cc14
movq %rbx, %rdi
movq %r15, %rsi
callq 0xd43ee
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x28(%r15), %r14
movsd 0x28(%r15), %xmm0
ucomisd 0x1122d7(%rip), %xmm0   # 0x14c008
jne 0x39d3d
jp 0x39d3d
movq %r15, %rdi
callq 0x3cc14
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x39d0b
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x39d46
leaq 0x11ce7a(%rip), %rsi    # 0x156dc8
movq %rsp, %r15
movq %r15, %rdi
callq 0xd4e82
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xd57a6
movq %rbx, %rdi
callq 0xd5188
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3a1bf
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 0x3a1a2
cmpl $0x0, 0x3c(%r14)
jle 0x3a1e6
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 0x3a1c9
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3a217
movq 0x19acfc(%rip), %rax    # 0x1d4f10
movq (%rax), %r15
testq %r12, %r12
je 0x3a227
movq %r12, %rdi
movq %r15, %rsi
callq 0x27a90
movl 0x18(%r14), %edx
leaq 0x112c9e(%rip), %rsi    # 0x14ced0
movq %r15, %rdi
xorl %eax, %eax
callq 0x27e00
testq %rbx, %rbx
je 0x3a24c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27a90
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c30
leaq 0x112794(%rip), %rsi    # 0x14c9f4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x2c(%r14)
jle 0x3a29d
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 0x3a27a
cmpl $0x0, 0x3c(%r14)
jle 0x3a2cd
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 0x3a2aa
cmpl $0x0, 0x4c(%r14)
jle 0x3a2fd
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 0x3a2da
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/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 0x1a4670(%rip), %r15    # 0x1de998
leaq 0x8(%r15), %rsi
callq 0xd4746
leaq 0x70(%rbx), %rdi
addq $0x20, %r15
movq %r15, %rsi
callq 0xd4746
cmpl $0x0, 0x2c(%rbx)
jle 0x3a387
xorl %r12d, %r12d
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x48(%r15), %xmm0
ucomisd 0x111ca8(%rip), %xmm0   # 0x14c008
jne 0x3a36c
jp 0x3a36c
movq %r15, %rdi
callq 0x3f3e4
addq $0x40, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbe428
incq %r12
movslq 0x2c(%rbx), %rax
cmpq %rax, %r12
jl 0x3a34a
cmpl $0x0, 0x3c(%rbx)
jle 0x3a3cd
xorl %r12d, %r12d
movq 0x30(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x40(%r15), %xmm0
ucomisd 0x111c62(%rip), %xmm0   # 0x14c008
jne 0x3a3b2
jp 0x3a3b2
movq %r15, %rdi
callq 0x3e954
addq $0x38, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbe428
incq %r12
movslq 0x3c(%rbx), %rax
cmpq %rax, %r12
jl 0x3a390
cmpl $0x0, 0x4c(%rbx)
jle 0x3a413
xorl %r12d, %r12d
movq 0x40(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x28(%r15), %xmm0
ucomisd 0x111c1c(%rip), %xmm0   # 0x14c008
jne 0x3a3f8
jp 0x3a3f8
movq %r15, %rdi
callq 0x3cc14
addq $0x28, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbe362
incq %r12
movslq 0x4c(%rbx), %rax
cmpq %rax, %r12
jl 0x3a3d6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/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 0x3ad8f
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x20(%rdi), %rcx
xorl %edx, %edx
leaq 0x11c06b(%rip), %rsi    # 0x156d68
movq (%rcx,%rdx,8), %r8
movslq 0x34(%r8), %rdi
testq %rdi, %rdi
jle 0x3ad7c
movq 0x28(%r8), %r8
xorl %r9d, %r9d
movq (%r8,%r9,8), %r11
movslq 0x34(%r11), %r10
testq %r10, %r10
jle 0x3ad74
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 0x3ad6c
movslq 0x30(%r15), %r15
testq %r15, %r15
jle 0x3ad6c
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 0x3ad55
incq %rbx
cmpq %r10, %rbx
jne 0x3ad34
incq %r9
cmpq %rdi, %r9
jne 0x3ad11
incq %rdx
cmpq %rax, %rdx
jne 0x3acfd
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3af55
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 0x3b012
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 0x3b406
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_O3/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1910d4(%rip), %rax    # 0x1cc928
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3b868
movq %rbx, %rsi
callq 0x37fc4
leaq 0x18(%rbx), %r14
cmpl $0x0, 0x24(%rbx)
jle 0x3b883
movq 0x18(%rbx), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x3b8ac
jmp 0x3b86c
addq $0x88, %rbx
movq %rbx, %rdi
callq 0xbe790
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xf8bea
jmp 0x3b8a3
movq %rax, %rdi
callq 0x3964d
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3ba98
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 0x3ba76
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3bac5
movq 0x19944e(%rip), %rax    # 0x1d4f10
movq (%rax), %r15
testq %r12, %r12
je 0x3bad5
movq %r12, %rdi
movq %r15, %rsi
callq 0x27a90
movl 0x10(%r14), %edx
leaq 0x111448(%rip), %rsi    # 0x14cf28
movq %r15, %rdi
xorl %eax, %eax
callq 0x27e00
testq %rbx, %rbx
je 0x3bafa
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27a90
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c30
leaq 0x110ee6(%rip), %rsi    # 0x14c9f4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x24(%r14)
jle 0x3bb4b
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 0x3bb28
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/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 0x1a2e23(%rip), %r14    # 0x1de998
leaq 0x8(%r14), %rsi
callq 0xd4746
leaq 0xa8(%rbx), %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0xd4746
cmpl $0x0, 0x24(%rbx)
jle 0x3bbde
leaq 0x88(%rbx), %r14
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %r15
movsd 0x40(%r15), %xmm0
ucomisd 0x110451(%rip), %xmm0   # 0x14c008
jne 0x3bbc3
jp 0x3bbc3
movq %r15, %rdi
callq 0x3e954
addq $0x38, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xbe428
incq %r12
movslq 0x24(%rbx), %rax
cmpq %rax, %r12
jl 0x3bba1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x19a62e(%rip), %rax    # 0x1d6458
movsd (%rax), %xmm0
ucomisd %xmm2, %xmm0
jae 0x3be80
movsd 0x40(%rsi), %xmm3
ucomisd %xmm3, %xmm0
jae 0x3be80
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 0x3be99
movsd 0x78(%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3be99
jp 0x3be99
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xf171c
jmp 0x3be94
movsd 0x1101e8(%rip), %xmm0   # 0x14c070
movq %rbx, %rdi
movapd %xmm0, %xmm1
callq 0xf1712
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 0x3bbea
jmp 0x3be94
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1900ab(%rip), %rax    # 0x1cc968
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3c8d1
movq %rbx, %rsi
callq 0x3a106
movl 0x24(%rbx), %eax
testl %eax, %eax
jle 0x3c8ec
movq 0x18(%rbx), %rcx
movq (%rcx), %rdi
testq %rdi, %rdi
je 0x3c8d4
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x3c8d1
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x3c8fa
callq 0x27b40
addq $0x18, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0xf8bea
movq %rax, %rdi
callq 0x3964d
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x24(%rdi), %r15
testq %r15, %r15
jle 0x3ca26
movq %rsi, %rbx
movq 0x18(%rdi), %r12
xorl %r13d, %r13d
movq (%r12,%r13,8), %r14
movq 0xb8(%r14), %rdi
testq %rdi, %rdi
je 0x3ca1e
movq %rbx, %rsi
callq 0x27d80
testl %eax, %eax
je 0x3ca29
incq %r13
cmpq %r13, %r15
jne 0x3ca02
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/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 0xf8c16
movaps 0x1104f6(%rip), %xmm0   # 0x14cf80
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_O3/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 0xf8da0
movl $0xffffffff, 0x20(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x18(%rbx)
movaps 0x110490(%rip), %xmm0   # 0x14cf80
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_O3/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 0x3cb50
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 0x3cb2e
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3cb7d
movq 0x198396(%rip), %rax    # 0x1d4f10
movq (%rax), %r15
testq %r12, %r12
je 0x3cb8d
movq %r12, %rdi
movq %r15, %rsi
callq 0x27a90
movl 0x10(%r14), %edx
leaq 0x1103f8(%rip), %rsi    # 0x14cf90
movq %r15, %rdi
xorl %eax, %eax
callq 0x27e00
testq %rbx, %rbx
je 0x3cbb2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27a90
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c30
leaq 0x10fe2e(%rip), %rsi    # 0x14c9f4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x24(%r14)
jle 0x3cc03
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 0x3cbe0
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/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 0x3cf10
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3d3f8
addsd 0x70(%rbx), %xmm0
movsd %xmm0, 0x70(%rbx)
incq %r14
movslq 0x24(%rbx), %rax
cmpq %rax, %r14
jl 0x3ced4
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x70(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x10f0e4(%rip), %xmm0   # 0x14c008
jne 0x3cf2d
jp 0x3cf2d
callq 0x3cc14
movq %rbx, %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x18f99d(%rip), %rax    # 0x1cc9a8
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3d01f
movq %rbx, %rsi
callq 0x3e80e
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x3d030
movq %rbx, %rsi
callq 0x3caac
movq 0xb8(%rbx), %rdi
testq %rdi, %rdi
je 0x3d041
callq 0x27b40
leaq 0x68(%rbx), %rdi
callq 0x450ee
addq $0x28, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x450ee
movq %rax, %rdi
callq 0x3964d
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movq 0x8(%rdi), %rdi
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x3d11b
callq 0x3e436
testq %rax, %rax
je 0x3d11b
movq %rax, %r14
movq 0x8(%rax), %r12
testq %r12, %r12
je 0x3d11b
movq %r15, %rdi
callq 0x3d12a
movl %eax, %ebx
cmpl $0x0, 0x10(%r14)
jle 0x3d11b
xorl %r15d, %r15d
movq 0x8(%r12), %rax
movq (%rax,%r15,8), %rdi
callq 0x37da2
addl %eax, %ebx
incq %r15
movslq 0x10(%r14), %rax
cmpq %rax, %r15
jl 0x3d0ff
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/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 %rdi, %rbx
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x3d32c
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x3d32c
movq %rsi, %r14
movl 0x2c(%rax), %eax
testl %eax, %eax
js 0x3d34f
jne 0x3d354
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 0x45094
jmp 0x3d3e7
movl $0x790, %eax            # imm = 0x790
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 0x10ecff(%rip), %xmm0   # 0x14c078
subsd %xmm1, %xmm0
leaq 0x30(%r14), %rsi
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0xd4e22
leaq 0x70(%r14), %rsi
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movsd 0x8(%rsp), %xmm0
callq 0xd4e22
leaq 0x48(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xd4ddc
leaq 0x48(%r14), %rsi
addq $0x88, %r14
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
movsd 0x8(%rsp), %xmm0
callq 0xc18bb
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x44fa2
movq %rbx, %rax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVImage.cpp
// Function: gaps::GSVImage::UndistortedImage() const
RNAngle GSVImage::
YFov(void) const
{
  // Return field of view in vertical direction
  GSVCamera *camera = Camera();
  if (!camera) return 0;
  return camera->YFov();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1428, %rsp           # imm = 0x1428
movq 0x18(%rdi), %r14
testq %r14, %r14
je 0x3d7b5
movq %rdi, %rbx
movl 0x20(%rdi), %r13d
movq %r14, %rdi
callq 0x3c9ac
movl %eax, %ebp
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x3d7b5
movq 0x10(%rax), %r15
testq %r15, %r15
je 0x3d7b5
movl 0x18(%rax), %r14d
movq 0x48(%r15), %rsi
testq %rsi, %rsi
je 0x3d5e6
leaq 0x20(%rsp), %rdi
callq 0x27870
jmp 0x3d5fd
movl 0x10(%r15), %edx
leaq 0x10f45c(%rip), %rsi    # 0x14ca4d
leaq 0x20(%rsp), %rdi
xorl %eax, %eax
callq 0x27140
movq 0x8(%r15), %r12
testq %r12, %r12
je 0x3d7b5
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x3d7b5
movl %r14d, 0x14(%rsp)
movq 0x18(%rax), %r14
testq %r14, %r14
je 0x3d7b5
movq 0x28(%r12), %rdx
testq %rdx, %rdx
je 0x3d6b7
movl %r13d, (%rsp)
leaq 0x10f9ed(%rip), %rsi    # 0x14d02f
leaq 0x420(%rsp), %rdi
leaq 0x20(%rsp), %rcx
movl 0x14(%rsp), %r8d
movl %ebp, %r9d
xorl %eax, %eax
callq 0x27140
leaq 0x420(%rsp), %rdi
callq 0xfaac4
testl %eax, %eax
je 0x3d6b7
movl $0x18, %edi
callq 0x27930
movq %rax, %rbx
movq %rax, %rdi
callq 0xf1fa4
leaq 0x420(%rsp), %rsi
movq %rbx, %rdi
callq 0xf1fc8
testl %eax, %eax
jne 0x3d7b7
leaq 0x10f9c9(%rip), %rdi    # 0x14d06c
leaq 0x420(%rsp), %rsi
xorl %eax, %eax
callq 0xfb6f2
jmp 0x3d7a0
movq %r14, 0x18(%rsp)
movq %rbx, %rdi
callq 0x3d45a
testq %rax, %rax
je 0x3d7b5
movq %rax, %r14
movl $0x18, %edi
callq 0x27930
movq %rax, %rbx
movl (%r14), %esi
movl 0x4(%r14), %edx
movq %rax, %rdi
movl $0x3, %ecx
callq 0xf22c6
movq 0x18(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3bf1c
testl %eax, %eax
je 0x3d792
cmpq $0x0, 0x28(%r12)
je 0x3d77b
leaq 0x10f994(%rip), %rsi    # 0x14d0ac
movq %r12, %rdi
movq %r15, %rdx
callq 0x32f6e
testl %eax, %eax
je 0x3d77b
movq 0x28(%r12), %rdx
movl %r13d, (%rsp)
leaq 0x10f8f8(%rip), %rsi    # 0x14d02f
leaq 0x420(%rsp), %r15
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
movl 0x14(%rsp), %r8d
movl %ebp, %r9d
xorl %eax, %eax
callq 0x27140
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf4144
testl %eax, %eax
jne 0x3d77b
leaq 0x10f953(%rip), %rdi    # 0x14d0bf
leaq 0x420(%rsp), %rsi
xorl %eax, %eax
callq 0xfb6f2
movq %r14, %rdi
callq 0xf2520
movl $0x18, %esi
movq %r14, %rdi
callq 0x27950
jmp 0x3d7b7
leaq 0x10f8f8(%rip), %rdi    # 0x14d091
xorl %eax, %eax
callq 0xfb6f2
movq %rbx, %rdi
callq 0xf2520
movl $0x18, %esi
movq %rbx, %rdi
callq 0x27950
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x1428, %rsp           # imm = 0x1428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3d7ce
movq %rax, %r14
movl $0x18, %esi
movq %rbx, %rdi
callq 0x27950
movq %r14, %rdi
callq 0x28150
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3d8b8
movq 0x18(%rax), %rsi
testq %rsi, %rsi
je 0x3d8b8
movq %rbx, %rdi
callq 0x3be1a
jmp 0x3d8c3
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xf171c
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3d8e8
movq 0x18(%rax), %rsi
testq %rsi, %rsi
je 0x3d8e8
movq %rbx, %rdi
callq 0x3bebe
jmp 0x3d8f3
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xf171c
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rdi, %rbx
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x3da31
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x3da31
movq %rdx, %r14
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 0x3d2fe
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x450fa
leaq 0x38(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x45140
leaq 0x90(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0xc12c2
leaq 0x58(%rsp), %rsi
leaq 0x110(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0xc0dc4
leaq 0x90(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0xc0e72
leaq 0x20(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movq %r14, %rdx
callq 0xc4a56
movsd 0x30(%rsp), %xmm2
leaq 0x198a76(%rip), %rax    # 0x1d6458
movsd (%rax), %xmm1
xorpd 0x10f2d2(%rip), %xmm1   # 0x14ccc0
ucomisd %xmm1, %xmm2
jae 0x3da3d
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 0xf1712
jmp 0x3da51
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf1730
jmp 0x3da5b
movsd 0x10e62b(%rip), %xmm0   # 0x14c070
movq %rbx, %rdi
movapd %xmm0, %xmm1
callq 0xf1712
leaq 0x50(%rsp), %rdi
callq 0x450ee
movq %rbx, %rax
addq $0x170, %rsp            # imm = 0x170
popq %rbx
popq %r14
popq %r15
retq
jmp 0x3da73
jmp 0x3da73
jmp 0x3da73
jmp 0x3da73
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x450ee
movq %rbx, %rdi
callq 0x28150
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3da88
leaq 0x18(%rsp), %r12
movsd 0x10e2ef(%rip), %xmm0   # 0x14c070
movq %r12, %rdi
movaps %xmm0, %xmm1
callq 0xf1712
movq %r15, %rdi
movq %r12, %rsi
callq 0xf19e2
testl %eax, %eax
je 0x3ddaa
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xf171c
jmp 0x3ddba
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3d898
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3e25d
movq 0x196cb6(%rip), %rax    # 0x1d4f10
movq (%rax), %r14
testq %rbx, %rbx
je 0x3e26d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x27a90
movl 0x20(%r12), %edx
leaq 0x10ee70(%rip), %rsi    # 0x14d0e9
movq %r14, %rdi
xorl %eax, %eax
callq 0x27e00
testq %r15, %r15
je 0x3e293
movq %r15, %rdi
movq %r14, %rsi
callq 0x27a90
movl $0xa, %edi
movq %r14, %rsi
callq 0x27c30
leaq 0x10e74d(%rip), %rsi    # 0x14c9f4
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_O3/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 0x18e69b(%rip), %rax    # 0x1cc9e8
movq %rax, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3e361
movq %rbx, %rsi
callq 0x3a09a
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x3e372
movq %rbx, %rsi
callq 0x3b8ac
movl 0x34(%rbx), %eax
testl %eax, %eax
je 0x3e38d
movq 0x28(%rbx), %rcx
movq (%rcx), %rdi
testq %rdi, %rdi
je 0x3e375
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x3e372
leaq 0x38(%rbx), %rdi
callq 0xbe790
addq $0x28, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0xf8bea
movq %rax, %rdi
callq 0x3964d
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/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 0x3e4e3
movslq %ebp, %rcx
movq (%rax,%rcx,8), %r12
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3d3f8
ucomisd 0x8(%rsp), %xmm0
ja 0x3e49f
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movl %ebp, %ebx
ja 0x3e49c
jmp 0x3e4ea
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_O3/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 0x3e565
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movsd %xmm0, 0x8(%rsp)
callq 0x3d3f8
ucomisd 0x8(%rsp), %xmm0
jae 0x3e569
movslq 0x34(%rbx), %rax
movq 0x28(%rbx), %rcx
movq -0x8(%rcx,%rax,8), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x3d3f8
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
movslq 0x34(%rbx), %rdx
jae 0x3e572
decl %edx
movq %rbx, %rdi
xorl %esi, %esi
addq $0x10, %rsp
popq %rbx
jmp 0x3e482
xorl %eax, %eax
jmp 0x3e57b
movq 0x28(%rbx), %rax
movq (%rax), %rax
jmp 0x3e57b
movq 0x28(%rbx), %rax
movq -0x8(%rax,%rdx,8), %rax
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVTapestry.cpp
// Function: gaps::GSVTapestry::Print(_IO_FILE*, char const*, char const*) const
void GSVTapestry::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

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

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

   // Print images
  for (int i = 0; i < NImages(); i++) {
    GSVImage *image = Image(i);
    image->Print(fp, indented_prefix, suffix);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
testq %rsi, %rsi
jne 0x3e8bd
movq 0x196656(%rip), %rax    # 0x1d4f10
movq (%rax), %r15
testq %r12, %r12
je 0x3e8cd
movq %r12, %rdi
movq %r15, %rsi
callq 0x27a90
movl 0x10(%r14), %edx
leaq 0x10e82c(%rip), %rsi    # 0x14d104
movq %r15, %rdi
xorl %eax, %eax
callq 0x27e00
testq %rbx, %rbx
je 0x3e8f2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27a90
movl $0xa, %edi
movq %r15, %rsi
callq 0x27c30
leaq 0x10e0ee(%rip), %rsi    # 0x14c9f4
movq %rsp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x27140
cmpl $0x0, 0x34(%r14)
jle 0x3e943
xorl %r13d, %r13d
movq %rsp, %r12
movq 0x28(%r14), %rax
movq (%rax,%r13,8), %rdi
movq (%rdi), %rax
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq *0x18(%rax)
incq %r13
movslq 0x34(%r14), %rax
cmpq %rax, %r13
jl 0x3e920
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/GSV/GSVTapestry.cpp
// Function: gaps::GSVTapestry::UpdateBBox()
void GSVTapestry::
UpdateBBox(void) 
{
  // Update bounding box
  bbox = R3null_box;
  for (int i = 0; i < NImages(); i++) {
    bbox.Union(Image(i)->Pose().Viewpoint());
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
addq $0x40, %rdi
leaq 0x1a0029(%rip), %r14    # 0x1de998
leaq 0x8(%r14), %rsi
callq 0xd4746
leaq 0x58(%rbx), %rdi
addq $0x20, %r14
movq %r14, %rsi
callq 0xd4746
cmpl $0x0, 0x34(%rbx)
jle 0x3e9d1
leaq 0x38(%rbx), %r14
leaq 0x8(%rsp), %r15
xorl %r13d, %r13d
movq %rsp, %r12
movq 0x28(%rbx), %rax
movq (%rax,%r13,8), %rsi
movq %r12, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3d2fe
movq %r14, %rdi
movq %r15, %rsi
callq 0xbe362
movq %r12, %rdi
callq 0x450ee
incq %r13
movslq 0x34(%rbx), %rax
cmpq %rax, %r13
jl 0x3e99d
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x450ee
movq %rbx, %rdi
callq 0x28150
nop