LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3CatmullRomSpline.cpp
// Function: gaps::R3CatmullRomSpline::BlendingWeight(double, int) const
RNScalar R3CatmullRomSpline::
BlendingWeight(RNScalar t, int k) const
{
  // In interval i through i+1, 
  // k=-1: V(i-1)
  // k=0: V(i)
  // k=1: V(i+1)
  // k=2: V(i+2)
  // t \in [0,1]

  // Compute powers of t
  double t2 = t * t;
  double t3 = t * t2;

  // Compute blending function
  switch (k) {
  case -1: return -tao*t + 2*tao*t2 -tao*t3;
  case 0: return 1 + (tao-3)*t2 + (2-tao)*t3;
  case 1: return tao*t + (3-2*tao)*t2 + (tao-2)*t3;
  case 2: return -tao*t2 + tao*t3;
  }

  // All other vertex_positions
  return 0;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movsd %xmm0, -0x18(%rsp)
movl %esi, -0x1c(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x40(%rsp)
movsd -0x18(%rsp), %xmm0
mulsd %xmm0, %xmm0
movsd %xmm0, -0x28(%rsp)
movsd -0x18(%rsp), %xmm0
movsd -0x28(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rsp)
movl -0x1c(%rsp), %eax
incl %eax
movl %eax, %ecx
movq %rcx, -0x38(%rsp)
subl $0x3, %eax
ja 0x9122f
movq -0x38(%rsp), %rax
leaq 0xa4907(%rip), %rcx     # 0x1359c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x40(%rsp), %rax
movsd 0x60(%rax), %xmm0
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm1
movsd -0x18(%rsp), %xmm2
movsd 0xa2107(%rip), %xmm0    # 0x133200
mulsd 0x60(%rax), %xmm0
mulsd -0x28(%rsp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x60(%rax), %xmm0
movsd -0x30(%rsp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rsp)
jmp 0x91238
movq -0x40(%rsp), %rax
movsd 0x60(%rax), %xmm1
movsd 0xa208d(%rip), %xmm0    # 0x1331e0
subsd %xmm0, %xmm1
movsd -0x28(%rsp), %xmm0
mulsd %xmm0, %xmm1
movsd 0xa1e9f(%rip), %xmm0    # 0x133008
addsd %xmm0, %xmm1
movsd 0xa208b(%rip), %xmm0    # 0x133200
subsd 0x60(%rax), %xmm0
movsd -0x30(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rsp)
jmp 0x91238
movq -0x40(%rsp), %rax
movsd 0x60(%rax), %xmm1
movsd -0x18(%rsp), %xmm2
movsd 0x60(%rax), %xmm3
addsd %xmm3, %xmm3
movsd 0xa202c(%rip), %xmm0    # 0x1331e0
subsd %xmm3, %xmm0
mulsd -0x28(%rsp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x60(%rax), %xmm0
movsd 0xa202d(%rip), %xmm2    # 0x133200
subsd %xmm2, %xmm0
movsd -0x30(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rsp)
jmp 0x91238
movq -0x40(%rsp), %rax
movsd 0x60(%rax), %xmm0
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
movsd -0x28(%rsp), %xmm2
movsd 0x60(%rax), %xmm1
mulsd -0x30(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rsp)
jmp 0x91238
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rsp)
movsd -0x8(%rsp), %xmm0
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3CatmullRomSpline.cpp
// Function: gaps::R3CatmullRomSpline::BlendingWeightDerivative(double, int) const
RNScalar R3CatmullRomSpline::
BlendingWeightDerivative(RNScalar t, int k) const
{
  // In interval i through i+1, 
  // k=-1: V(i-1)
  // k=0: V(i)
  // k=1: V(i+1)
  // k=2: V(i+2)
  // t \in [0,1]

  // Compute powers of t
  double t2 = t * t;

  // Compute blending function
  switch (k) {
  case -1: return -tao + 4*tao*t -3*tao*t2;
  case 0: return 2*(tao-3)*t + 3*(2-tao)*t2;
  case 1: return tao + 2*(3-2*tao)*t + 3*(tao-2)*t2;
  case 2: return -2*tao*t + 3*tao*t2;
  }

  // All other vertex_positions
  return 0;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movsd %xmm0, -0x18(%rsp)
movl %esi, -0x1c(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x38(%rsp)
movsd -0x18(%rsp), %xmm0
mulsd %xmm0, %xmm0
movsd %xmm0, -0x28(%rsp)
movl -0x1c(%rsp), %eax
incl %eax
movl %eax, %ecx
movq %rcx, -0x30(%rsp)
subl $0x3, %eax
ja 0x9177e
movq -0x30(%rsp), %rax
leaq 0xa43dd(%rip), %rcx     # 0x1359d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x38(%rsp), %rax
movsd 0x60(%rax), %xmm0
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
movsd 0xa1bc3(%rip), %xmm1    # 0x1331f0
mulsd 0x60(%rax), %xmm1
movsd -0x18(%rsp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0xa1b98(%rip), %xmm0    # 0x1331e0
mulsd 0x60(%rax), %xmm0
movsd -0x28(%rsp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rsp)
jmp 0x91787
movq -0x38(%rsp), %rax
movsd 0x60(%rax), %xmm1
movsd 0xa1b51(%rip), %xmm0    # 0x1331e0
subsd %xmm0, %xmm1
movsd 0xa1b65(%rip), %xmm0    # 0x133200
mulsd %xmm1, %xmm0
movsd -0x18(%rsp), %xmm2
movsd 0xa1b53(%rip), %xmm3    # 0x133200
subsd 0x60(%rax), %xmm3
movsd 0xa1b26(%rip), %xmm1    # 0x1331e0
mulsd %xmm3, %xmm1
mulsd -0x28(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rsp)
jmp 0x91787
movq -0x38(%rsp), %rax
movsd 0x60(%rax), %xmm0
movsd 0x60(%rax), %xmm1
addsd %xmm1, %xmm1
movsd 0xa1aee(%rip), %xmm2    # 0x1331e0
subsd %xmm1, %xmm2
movsd 0xa1b02(%rip), %xmm1    # 0x133200
mulsd %xmm2, %xmm1
movsd -0x18(%rsp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x60(%rax), %xmm2
movsd 0xa1ae3(%rip), %xmm0    # 0x133200
subsd %xmm0, %xmm2
movsd 0xa1ab7(%rip), %xmm0    # 0x1331e0
mulsd %xmm2, %xmm0
movsd -0x28(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rsp)
jmp 0x91787
movq -0x38(%rsp), %rax
movsd 0xa1ab8(%rip), %xmm0    # 0x133208
mulsd 0x60(%rax), %xmm0
movsd -0x18(%rsp), %xmm2
movsd 0xa1a7d(%rip), %xmm1    # 0x1331e0
mulsd 0x60(%rax), %xmm1
mulsd -0x28(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rsp)
jmp 0x91787
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rsp)
movsd -0x8(%rsp), %xmm0
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3CatmullRomSpline.cpp
// Function: gaps::R3CatmullRomSpline::UpdateBBox()
void R3CatmullRomSpline::
UpdateBBox(void) 
{
  // Initialize bounding box
  R3Polyline::UpdateBBox();

  // Union phantom vertex_positions
  for (int i = 0; i < NVertices()-1; i++) {
    bbox.Union(PhantomVertexPosition(i, 0));
    bbox.Union(PhantomVertexPosition(i, 1));
  }
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x93db0
movl $0x0, 0x5c(%rsp)
movq 0x20(%rsp), %rdi
movl 0x5c(%rsp), %eax
movl %eax, 0x1c(%rsp)
callq 0x91990
movl %eax, %ecx
movl 0x1c(%rsp), %eax
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x91842
movq 0x20(%rsp), %rsi
movq %rsi, %rax
addq $0x28, %rax
movq %rax, 0x8(%rsp)
movl 0x5c(%rsp), %edx
leaq 0x40(%rsp), %rdi
xorl %ecx, %ecx
callq 0x90a50
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x444b0
movq 0x20(%rsp), %rsi
movq %rsi, %rax
addq $0x28, %rax
movq %rax, 0x10(%rsp)
movl 0x5c(%rsp), %edx
leaq 0x28(%rsp), %rdi
movl $0x1, %ecx
callq 0x90a50
movq 0x10(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x444b0
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x917b0
addq $0x68, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3CatmullRomSpline.cpp
// Function: gaps::R3CatmullRomSpline::Outline(double) const
void R3CatmullRomSpline::
Outline(RNScalar sample_spacing) const
{
  // Determine sample spacing
  const int default_nsegments = 100;
  if (sample_spacing == 0) sample_spacing =  (EndParameter() - StartParameter()) / default_nsegments;
  if (sample_spacing == 0) return;
  
  // Draw spline
  R3BeginLine();
  for (RNScalar u = StartParameter(); u <= EndParameter(); u += sample_spacing) 
    R3LoadPoint(PointPosition(u));
  R3EndLine();
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movsd %xmm0, 0x48(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movl $0x64, 0x44(%rsp)
movsd 0x48(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x918f3
jp 0x918f3
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *0x220(%rax)
movq 0x18(%rsp), %rdi
movsd %xmm0, 0x10(%rsp)
movq (%rdi), %rax
callq *0x218(%rax)
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd 0xa40d7(%rip), %xmm1    # 0x1359c0
divsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x48(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x91906
jp 0x91906
jmp 0x91981
callq 0x38e70
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *0x218(%rax)
movsd %xmm0, 0x38(%rsp)
movq 0x18(%rsp), %rdi
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq (%rdi), %rax
callq *0x220(%rax)
movsd 0x8(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x9197c
movq 0x18(%rsp), %rsi
movsd 0x38(%rsp), %xmm0
movq (%rsi), %rax
leaq 0x20(%rsp), %rdi
callq *0x238(%rax)
leaq 0x20(%rsp), %rdi
callq 0x38e40
movsd 0x48(%rsp), %xmm0
addsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
jmp 0x9191f
callq 0x38e80
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::R3Polyline(gaps::R3Polyline const&)
R3Polyline::
R3Polyline(const R3Polyline& polyline)
  : vertex_positions(NULL),
    vertex_parameters(NULL),
    vertex_datas(NULL),
    nvertices(polyline.nvertices),
    bbox(polyline.BBox())
{
  // Copy vertex_positions and parameters
  if (nvertices > 0) {
    this->vertex_positions = new R3Point [ nvertices ];
    this->vertex_parameters = new RNScalar [ nvertices ];
    for (int i = 0; i < nvertices; i++) {
      this->vertex_positions[i] = polyline.vertex_positions[i];
      this->vertex_parameters[i] = polyline.vertex_parameters[i];
    }
  }
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x93f00
movq 0x38(%rsp), %rdi
leaq 0xdaa97(%rip), %rax     # 0x16c5a0
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
movq 0x58(%rsp), %rax
movl 0x20(%rax), %eax
movl %eax, 0x20(%rdi)
addq $0x28, %rdi
movq %rdi, 0x40(%rsp)
movq 0x58(%rsp), %rsi
movq (%rsi), %rax
movq 0x88(%rax), %rax
callq *%rax
jmp 0x91b4b
movq 0x38(%rsp), %rax
cmpl $0x0, 0x20(%rax)
jle 0x91cdb
movq 0x38(%rsp), %rax
movslq 0x20(%rax), %rax
movq %rax, 0x20(%rsp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
movq %rdi, 0x28(%rsp)
callq 0xf030
movq %rax, 0x30(%rsp)
jmp 0x91b8f
movq 0x20(%rsp), %rax
cmpq $0x0, %rax
je 0x91be1
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x6eb40
jmp 0x91bc9
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, 0x18(%rsp)
jne 0x91bb8
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x8(%rax)
movslq 0x20(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0xf030
movq %rax, (%rsp)
jmp 0x91c14
movq 0x38(%rsp), %rax
movq (%rsp), %rcx
movq %rcx, 0x10(%rax)
movl $0x0, 0x48(%rsp)
movq 0x38(%rsp), %rcx
movl 0x48(%rsp), %eax
cmpl 0x20(%rcx), %eax
jge 0x91cd9
movq 0x38(%rsp), %rcx
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rsi
movslq 0x48(%rsp), %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rax
addq %rax, %rsi
movq 0x8(%rcx), %rdi
addq %rax, %rdi
callq 0x6f1e0
jmp 0x91c67
movq 0x38(%rsp), %rax
movq 0x58(%rsp), %rcx
movq 0x10(%rcx), %rcx
movslq 0x48(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x10(%rax), %rax
movslq 0x48(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48(%rsp)
jmp 0x91c29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
jmp 0x91cea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
jmp 0x91ce0
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
callq 0xf990
jmp 0x91ce0
jmp 0x91cdb
addq $0x68, %rsp
retq
movq 0x40(%rsp), %rdi
callq 0x36a80
movq 0x38(%rsp), %rdi
callq 0x93f30
movq 0x50(%rsp), %rdi
callq 0xf890
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::R3Polyline(gaps::RNArray<gaps::R3Point*> const&)
R3Polyline::
R3Polyline(const RNArray<R3Point *>& points)
  : vertex_positions(NULL),
    vertex_parameters(NULL),
    vertex_datas(NULL),
    nvertices(points.NEntries()),
    bbox(FLT_MAX, FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX, -FLT_MAX)
{
  // Copy vertex_positions
  if (points.NEntries() > 0) {
    this->vertex_positions = new R3Point [ points.NEntries() ];
    for (int i = 0; i < points.NEntries(); i++) {
      this->vertex_positions[i] = *(points[i]);
    }
  }
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq 0x80(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x93f00
movq 0x50(%rsp), %rax
leaq 0xda86e(%rip), %rcx     # 0x16c5a0
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
addq $0x20, %rax
movq %rax, 0x58(%rsp)
movq 0x78(%rsp), %rdi
callq 0x13600
movl %eax, 0x64(%rsp)
jmp 0x91d66
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rax
movl 0x64(%rsp), %ecx
movl %ecx, (%rax)
addq $0x28, %rdi
movq %rdi, 0x48(%rsp)
movsd 0xa1299(%rip), %xmm2    # 0x133020
movsd 0xa1f31(%rip), %xmm5    # 0x133cc0
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
movaps %xmm5, %xmm3
movaps %xmm5, %xmm4
callq 0x429c0
jmp 0x91da2
movq 0x78(%rsp), %rdi
callq 0x13600
movl %eax, 0x44(%rsp)
jmp 0x91db2
movl 0x44(%rsp), %eax
cmpl $0x0, %eax
jle 0x91f16
movq 0x78(%rsp), %rdi
callq 0x13600
movl %eax, 0x40(%rsp)
jmp 0x91dcf
movl 0x40(%rsp), %eax
cltq
movq %rax, 0x28(%rsp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
movq %rdi, 0x30(%rsp)
callq 0xf030
movq %rax, 0x38(%rsp)
jmp 0x91e01
movq 0x28(%rsp), %rax
cmpq $0x0, %rax
je 0x91e53
movq 0x38(%rsp), %rax
movq 0x28(%rsp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x6eb40
jmp 0x91e3b
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rax
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, 0x20(%rsp)
jne 0x91e2a
movq 0x50(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, 0x8(%rax)
movl $0x0, 0x68(%rsp)
movl 0x68(%rsp), %eax
movl %eax, 0x8(%rsp)
movq 0x78(%rsp), %rdi
callq 0x13600
movl %eax, 0xc(%rsp)
jmp 0x91e81
movl 0x8(%rsp), %eax
movl 0xc(%rsp), %ecx
cmpl %ecx, %eax
jge 0x91f14
movq 0x78(%rsp), %rdi
movl 0x68(%rsp), %esi
callq 0x6d3e0
movq %rax, (%rsp)
jmp 0x91ea5
movq (%rsp), %rsi
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x68(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x6f1e0
jmp 0x91ec6
jmp 0x91ec8
movl 0x68(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x68(%rsp)
jmp 0x91e69
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0x91f28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0x91f1e
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
callq 0xf990
jmp 0x91f1e
jmp 0x91f16
addq $0x88, %rsp
retq
movq 0x48(%rsp), %rdi
callq 0x36a80
movq 0x50(%rsp), %rdi
callq 0x93f30
movq 0x70(%rsp), %rdi
callq 0xf890
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::R3Polyline(gaps::R3Point const*, int)
R3Polyline::
R3Polyline(const R3Point *points, int npoints)
  : vertex_positions(NULL),
    vertex_parameters(NULL),
    vertex_datas(NULL),
    nvertices(npoints),
    bbox(FLT_MAX, FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX, -FLT_MAX)
{
  // Copy vertex_positions
  if (npoints > 0) {
    this->vertex_positions = new R3Point [ npoints ];
    for (int i = 0; i < npoints; i++) {
      this->vertex_positions[i] = points[i];
    }
  }
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movl %edx, 0x54(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x93f00
movq 0x30(%rsp), %rdi
leaq 0xda633(%rip), %rax     # 0x16c5a0
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
movl 0x54(%rsp), %eax
movl %eax, 0x20(%rdi)
addq $0x28, %rdi
movq %rdi, 0x38(%rsp)
movsd 0xa1080(%rip), %xmm2    # 0x133020
movsd 0xa1d18(%rip), %xmm5    # 0x133cc0
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
movaps %xmm5, %xmm3
movaps %xmm5, %xmm4
callq 0x429c0
jmp 0x91fbb
cmpl $0x0, 0x54(%rsp)
jle 0x920df
movslq 0x54(%rsp), %rax
movq %rax, 0x18(%rsp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
movq %rdi, 0x20(%rsp)
callq 0xf030
movq %rax, 0x28(%rsp)
jmp 0x91ff7
movq 0x18(%rsp), %rax
cmpq $0x0, %rax
je 0x92047
movq 0x28(%rsp), %rax
movq 0x18(%rsp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x6eb40
jmp 0x92030
movq 0x8(%rsp), %rcx
movq (%rsp), %rax
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, 0x10(%rsp)
jne 0x92020
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, 0x8(%rax)
movl $0x0, 0x40(%rsp)
movl 0x40(%rsp), %eax
cmpl 0x54(%rsp), %eax
jge 0x920dd
movq 0x30(%rsp), %rcx
movq 0x58(%rsp), %rsi
movslq 0x40(%rsp), %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rax
addq %rax, %rsi
movq 0x8(%rcx), %rdi
addq %rax, %rdi
callq 0x6f1e0
jmp 0x9208f
jmp 0x92091
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40(%rsp)
jmp 0x9205d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
jmp 0x920ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
jmp 0x920e4
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
callq 0xf990
jmp 0x920e4
jmp 0x920df
addq $0x68, %rsp
retq
movq 0x38(%rsp), %rdi
callq 0x36a80
movq 0x30(%rsp), %rdi
callq 0x93f30
movq 0x48(%rsp), %rdi
callq 0xf890
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::R3Polyline(gaps::R3Point const*, double const*, int)
R3Polyline::
R3Polyline(const R3Point *points, const RNScalar *parameters, int npoints)
  : vertex_positions(NULL),
    vertex_parameters(NULL),
    vertex_datas(NULL),
    nvertices(npoints),
    bbox(FLT_MAX, FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX, -FLT_MAX)
{
  // Copy vertex_positions and parameters
  if (npoints > 0) {
    this->vertex_positions = new R3Point [ npoints ];
    this->vertex_parameters = new RNScalar [ npoints ];
    for (int i = 0; i < npoints; i++) {
      this->vertex_positions[i] = points[i];
      this->vertex_parameters[i] = parameters[i];
    }
  }
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movl %ecx, 0x5c(%rsp)
movq 0x70(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x93f00
movq 0x38(%rsp), %rdi
leaq 0xda45e(%rip), %rax     # 0x16c5a0
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
movl 0x5c(%rsp), %eax
movl %eax, 0x20(%rdi)
addq $0x28, %rdi
movq %rdi, 0x40(%rsp)
movsd 0xa0eab(%rip), %xmm2    # 0x133020
movsd 0xa1b43(%rip), %xmm5    # 0x133cc0
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
movaps %xmm5, %xmm3
movaps %xmm5, %xmm4
callq 0x429c0
jmp 0x92190
cmpl $0x0, 0x5c(%rsp)
jle 0x9230d
movslq 0x5c(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
movq %rdi, 0x28(%rsp)
callq 0xf030
movq %rax, 0x30(%rsp)
jmp 0x921cc
movq 0x20(%rsp), %rax
cmpq $0x0, %rax
je 0x9221e
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x6eb40
jmp 0x92206
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, 0x18(%rsp)
jne 0x921f5
movq 0x38(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0x8(%rax)
movslq 0x5c(%rsp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0xf030
movq %rax, (%rsp)
jmp 0x92252
movq 0x38(%rsp), %rax
movq (%rsp), %rcx
movq %rcx, 0x10(%rax)
movl $0x0, 0x48(%rsp)
movl 0x48(%rsp), %eax
cmpl 0x5c(%rsp), %eax
jge 0x9230b
movq 0x38(%rsp), %rcx
movq 0x68(%rsp), %rsi
movslq 0x48(%rsp), %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rax
addq %rax, %rsi
movq 0x8(%rcx), %rdi
addq %rax, %rdi
callq 0x6f1e0
jmp 0x9229d
movq 0x38(%rsp), %rax
movq 0x60(%rsp), %rcx
movslq 0x48(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x10(%rax), %rax
movslq 0x48(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48(%rsp)
jmp 0x92267
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
jmp 0x9231c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
jmp 0x92312
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
callq 0xf990
jmp 0x92312
jmp 0x9230d
addq $0x78, %rsp
retq
movq 0x40(%rsp), %rdi
callq 0x36a80
movq 0x38(%rsp), %rdi
callq 0x93f30
movq 0x50(%rsp), %rdi
callq 0xf890
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::~R3Polyline()
R3Polyline::
~R3Polyline(void)
{
  // Delete stuff
  if (vertex_positions) delete [] vertex_positions;
  if (vertex_parameters) delete [] vertex_parameters;
  if (vertex_datas) delete [] vertex_datas;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0xda246(%rip), %rcx     # 0x16c590
addq $0x10, %rcx
movq %rcx, (%rax)
cmpq $0x0, 0x8(%rax)
je 0x92378
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x92376
movq 0x10(%rsp), %rdi
callq 0xf670
jmp 0x92378
movq 0x18(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x923a4
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x923a2
movq 0x8(%rsp), %rdi
callq 0xf670
jmp 0x923a4
movq 0x18(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x923ce
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x923cc
movq (%rsp), %rdi
callq 0xf670
jmp 0x923ce
movq 0x18(%rsp), %rdi
addq $0x28, %rdi
callq 0x36a80
movq 0x18(%rsp), %rdi
callq 0x93f30
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::EndParameter() const
const RNScalar R3Polyline::
EndParameter(void) const
{
  // Return parameter at end of spline
  if (vertex_parameters) return vertex_parameters[nvertices-1];
  else if (nvertices > 0) return nvertices-1;
  else return 0;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x18(%rsp)
cmpq $0x0, 0x10(%rax)
je 0x92465
movq -0x18(%rsp), %rcx
movq 0x10(%rcx), %rax
movl 0x20(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x8(%rsp)
jmp 0x92490
movq -0x18(%rsp), %rax
cmpl $0x0, 0x20(%rax)
jle 0x92487
movq -0x18(%rsp), %rax
movl 0x20(%rax), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x8(%rsp)
jmp 0x92490
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rsp)
movsd -0x8(%rsp), %xmm0
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::IsPoint() const
const RNBoolean R3Polyline::
IsPoint(void) const
{
  // Return whether spline covers one point
  if (nvertices == 0) return FALSE;
  if (nvertices == 1) return TRUE;

  // Look for vertices at different positions
  for (int i = 1; i < nvertices; i++) {
    if (!R3Contains(vertex_positions[0], vertex_positions[i])) {
      return FALSE;
    }
  }

  // All vertices are at same position
  return TRUE;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x20(%rax)
jne 0x92943
movl $0x0, 0x24(%rsp)
jmp 0x929b2
movq 0x8(%rsp), %rax
cmpl $0x1, 0x20(%rax)
jne 0x92958
movl $0x1, 0x24(%rsp)
jmp 0x929b2
movl $0x1, 0x14(%rsp)
movq 0x8(%rsp), %rcx
movl 0x14(%rsp), %eax
cmpl 0x20(%rcx), %eax
jge 0x929aa
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x8(%rax), %rsi
movslq 0x14(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rsi
callq 0x82180
cmpl $0x0, %eax
jne 0x9299b
movl $0x0, 0x24(%rsp)
jmp 0x929b2
jmp 0x9299d
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x92960
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::IsLinear() const
const RNBoolean R3Polyline::
IsLinear(void) const
{
  // Return whether spline lies on one line
  if (nvertices == 0) return FALSE;
  if (nvertices <= 2) return TRUE;

  // Check if vertices all line on same line
  R3Line line;
  int line_npositions = 0;
  R3Point line_positions[2];
  for (int i = 0; i < nvertices; i++) {
    if (line_npositions == 0) {
      line_positions[line_npositions++] = vertex_positions[i];
    }
    else if ((line_npositions == 1) && !R3Contains(line_positions[0], vertex_positions[i])) {
      line_positions[line_npositions++] = vertex_positions[i];
      line.Reset(line_positions[0], line_positions[1] - line_positions[0]);
    }
    else if (!R3Contains(line, vertex_positions[i])) {
      return FALSE;
    }
  }

  // All vertices are on same line
  return TRUE;
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xb8(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x28(%rsp)
cmpl $0x0, 0x20(%rax)
jne 0x929f2
movl $0x0, 0xc4(%rsp)
jmp 0x92bc5
movq 0x28(%rsp), %rax
cmpl $0x2, 0x20(%rax)
jg 0x92a0d
movl $0x1, 0xc4(%rsp)
jmp 0x92bc5
leaq 0x88(%rsp), %rdi
callq 0x6e6b0
movl $0x0, 0x84(%rsp)
leaq 0x50(%rsp), %rax
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x6eb40
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, 0x20(%rsp)
jne 0x92a3b
movl $0x0, 0x4c(%rsp)
movq 0x28(%rsp), %rcx
movl 0x4c(%rsp), %eax
cmpl 0x20(%rcx), %eax
jge 0x92bba
cmpl $0x0, 0x84(%rsp)
jne 0x92ac6
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rsi
movslq 0x4c(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rsi
movl 0x84(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x84(%rsp)
cltq
leaq 0x50(%rsp), %rdi
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x6f1e0
jmp 0x92ba8
cmpl $0x1, 0x84(%rsp)
jne 0x92b70
movq 0x28(%rsp), %rax
leaq 0x50(%rsp), %rdi
movq 0x8(%rax), %rsi
movslq 0x4c(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rsi
callq 0x82180
cmpl $0x0, %eax
jne 0x92b70
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rsi
movslq 0x4c(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rsi
movl 0x84(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x84(%rsp)
cltq
leaq 0x50(%rsp), %rdi
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x6f1e0
leaq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x50(%rsp), %rsi
addq $0x18, %rsi
leaq 0x50(%rsp), %rdx
leaq 0x30(%rsp), %rdi
callq 0x6eeb0
movq 0x8(%rsp), %rsi
leaq 0x88(%rsp), %rdi
leaq 0x30(%rsp), %rdx
xorl %ecx, %ecx
callq 0x6e280
jmp 0x92ba6
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rsi
movslq 0x4c(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rsi
leaq 0x88(%rsp), %rdi
callq 0x82770
cmpl $0x0, %eax
jne 0x92ba4
movl $0x0, 0xc4(%rsp)
jmp 0x92bc5
jmp 0x92ba6
jmp 0x92ba8
jmp 0x92baa
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x92a6a
movl $0x1, 0xc4(%rsp)
movl 0xc4(%rsp), %eax
addq $0xc8, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::Length() const
const RNLength R3Polyline::
Length(void) const
{
  // For now, return length of control polygon
  RNLength length = 0;
  for (int i = 1; i < nvertices; i++) {
    length += R3Distance(vertex_positions[i-1], vertex_positions[i]);
  }
  return length;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movl $0x1, 0x14(%rsp)
movq 0x8(%rsp), %rcx
movl 0x14(%rsp), %eax
cmpl 0x20(%rcx), %eax
jge 0x92f3a
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movl 0x14(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rdi
movq 0x8(%rax), %rsi
movslq 0x14(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rsi
callq 0x86c40
addsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x92ee4
movsd 0x18(%rsp), %xmm0
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::Centroid() const
const R3Point R3Polyline::
Centroid(void) const
{
  // Compute centroid of vertices weighted by parameters
  RNScalar weight = 0;
  R3Point sum = R3zero_point;
  for (int i = 0; i < nvertices; i++) {
    if (i > 0) weight += VertexParameter(i) - VertexParameter(i-1);
    if (i < nvertices-1) weight += VertexParameter(i+1) - VertexParameter(i);
    sum += weight * vertex_positions[i];
  }

  // Or, if no weight, recompute without weighting
  if (weight == 0) {
    sum = R3zero_point;
    for (int i = 0; i < nvertices; i++) {
      sum += vertex_positions[i];
      weight += 1;
    }
  }
  
  // Return weighted average
  if (weight == 0) return R3zero_point;
  return sum / weight;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x18(%rsp)
movq %rdi, %rax
movq %rax, 0x20(%rsp)
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x28(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x70(%rsp)
leaq 0x58(%rsp), %rdi
leaq 0x4e6520(%rip), %rsi    # 0x5794b0
callq 0x6eb90
movl $0x0, 0x54(%rsp)
movq 0x28(%rsp), %rcx
movl 0x54(%rsp), %eax
cmpl 0x20(%rcx), %eax
jge 0x93089
cmpl $0x0, 0x54(%rsp)
jle 0x92ff4
movq 0x28(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x919f0
movq 0x28(%rsp), %rdi
movsd %xmm0, 0x10(%rsp)
movl 0x54(%rsp), %esi
subl $0x1, %esi
callq 0x919f0
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
subsd %xmm1, %xmm0
addsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0x28(%rsp), %rcx
movl 0x54(%rsp), %eax
movl 0x20(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x93045
movq 0x28(%rsp), %rdi
movl 0x54(%rsp), %esi
addl $0x1, %esi
callq 0x919f0
movq 0x28(%rsp), %rdi
movsd %xmm0, 0x8(%rsp)
movl 0x54(%rsp), %esi
callq 0x919f0
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
subsd %xmm1, %xmm0
addsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0x28(%rsp), %rax
movsd 0x70(%rsp), %xmm0
movq 0x8(%rax), %rsi
movslq 0x54(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rsi
leaq 0x38(%rsp), %rdi
callq 0x36b10
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x6f820
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x92f9d
movsd 0x70(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x93103
jp 0x93103
leaq 0x58(%rsp), %rdi
leaq 0x4e640a(%rip), %rsi    # 0x5794b0
callq 0x6f1e0
movl $0x0, 0x34(%rsp)
movq 0x28(%rsp), %rcx
movl 0x34(%rsp), %eax
cmpl 0x20(%rcx), %eax
jge 0x93101
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rsi
movslq 0x34(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rsi
leaq 0x58(%rsp), %rdi
callq 0x6f820
movsd 0x9ff20(%rip), %xmm0    # 0x133008
addsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x930b3
jmp 0x93103
movsd 0x70(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x93127
jp 0x93127
movq 0x18(%rsp), %rdi
leaq 0x4e6390(%rip), %rsi    # 0x5794b0
callq 0x6eb90
jmp 0x9313c
movq 0x18(%rsp), %rdi
movsd 0x70(%rsp), %xmm0
leaq 0x58(%rsp), %rsi
callq 0x6fc00
movq 0x20(%rsp), %rax
addq $0x88, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::VertexIndex(double) const
int R3Polyline::
VertexIndex(RNScalar u) const
{
  // Return index at start of segment containing u
  if (u < 0) return 0;
  else if (nvertices < 3) return 0;
  else if (u >= VertexParameter(nvertices-2)) return nvertices-2;
  else if (!vertex_parameters) return (int) u;
  else return BinarySearchForVertexIndex(this, 0, nvertices-2, u);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movsd %xmm0, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
ucomisd 0x10(%rsp), %xmm0
jbe 0x93211
movl $0x0, 0x24(%rsp)
jmp 0x93294
movq 0x8(%rsp), %rax
cmpl $0x3, 0x20(%rax)
jge 0x93226
movl $0x0, 0x24(%rsp)
jmp 0x93294
movq 0x8(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsp)
movl 0x20(%rdi), %esi
subl $0x2, %esi
callq 0x919f0
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x93260
movq 0x8(%rsp), %rax
movl 0x20(%rax), %eax
subl $0x2, %eax
movl %eax, 0x24(%rsp)
jmp 0x93294
movq 0x8(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x93278
cvttsd2si 0x10(%rsp), %eax
movl %eax, 0x24(%rsp)
jmp 0x93294
movq 0x8(%rsp), %rdi
movl 0x20(%rdi), %edx
subl $0x2, %edx
movsd 0x10(%rsp), %xmm0
xorl %esi, %esi
callq 0x932a0
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::BinarySearchForVertexIndex(gaps::R3Polyline const*, int, int, double)
static int
BinarySearchForVertexIndex(const R3Polyline *spline, int min_index, int max_index, RNScalar u)
{
  // Binary search for vertex index
  if (min_index == max_index) return min_index;
  if (spline->VertexParameter(min_index+1) > u) return min_index;
  if (spline->VertexParameter(max_index) < u) return max_index;
  int mid_index = (min_index + max_index)/2;
  RNScalar mid_u = spline->VertexParameter(mid_index);
  if (u == mid_u) return mid_index;
  else if (u < mid_u) return BinarySearchForVertexIndex(spline, min_index, mid_index-1, u);
  else return BinarySearchForVertexIndex(spline, mid_index, max_index, u);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movl %edx, 0x20(%rsp)
movsd %xmm0, 0x18(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x20(%rsp), %eax
jne 0x932ce
movl 0x24(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0x933af
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
addl $0x1, %esi
callq 0x919f0
ucomisd 0x18(%rsp), %xmm0
jbe 0x932f4
movl 0x24(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0x933af
movq 0x28(%rsp), %rdi
movl 0x20(%rsp), %esi
callq 0x919f0
movaps %xmm0, %xmm1
movsd 0x18(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x9331e
movl 0x20(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0x933af
movl 0x24(%rsp), %eax
addl 0x20(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x14(%rsp)
movq 0x28(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0x919f0
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
ucomisd 0x8(%rsp), %xmm0
jne 0x93360
jp 0x93360
movl 0x14(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0x933af
movsd 0x18(%rsp), %xmm1
movsd 0x8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x93393
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movl 0x14(%rsp), %edx
subl $0x1, %edx
movsd 0x18(%rsp), %xmm0
callq 0x932a0
movl %eax, 0x34(%rsp)
jmp 0x933af
movq 0x28(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x20(%rsp), %edx
movsd 0x18(%rsp), %xmm0
callq 0x932a0
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::PointPosition(double) const
R3Point R3Polyline::
PointPosition(RNScalar u) const
{
  // Return position at parametric value u

  // Get index variables
  int i = VertexIndex(u);
  double denom = VertexParameter(i+1) - VertexParameter(i);
  if (RNIsZero(denom)) return VertexPosition(i);
  double t = (u - VertexParameter(i)) / denom;

  // Get control vertex_positions
  R3Point P1 = VertexPosition(i);
  R3Point P2 = VertexPosition(i+1);

  // Return interpolated position
  return (1-t)*P1 + t*P2;
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0x8(%rsp)
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movsd %xmm0, 0xa0(%rsp)
movq 0xa8(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movsd 0xa0(%rsp), %xmm0
movq (%rdi), %rax
callq *0x268(%rax)
movq 0x18(%rsp), %rdi
movl %eax, 0x9c(%rsp)
movl 0x9c(%rsp), %esi
addl $0x1, %esi
callq 0x919f0
movq 0x18(%rsp), %rdi
movsd %xmm0, 0x20(%rsp)
movl 0x9c(%rsp), %esi
callq 0x919f0
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x90(%rsp)
movsd 0x90(%rsp), %xmm0
leaq 0xe507c(%rip), %rax     # 0x1784e0
movsd (%rax), %xmm1
callq 0x36b80
cmpl $0x0, %eax
je 0x9348d
movq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdi
movl 0x9c(%rsp), %edx
callq 0x919b0
jmp 0x93545
movq 0x18(%rsp), %rdi
movsd 0xa0(%rsp), %xmm0
movsd %xmm0, (%rsp)
movl 0x9c(%rsp), %esi
callq 0x919f0
movq 0x18(%rsp), %rsi
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
subsd %xmm1, %xmm0
divsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movl 0x9c(%rsp), %edx
leaq 0x70(%rsp), %rdi
callq 0x919b0
movq 0x18(%rsp), %rsi
movl 0x9c(%rsp), %edx
addl $0x1, %edx
leaq 0x58(%rsp), %rdi
callq 0x919b0
movsd 0x9fb07(%rip), %xmm0    # 0x133008
subsd 0x88(%rsp), %xmm0
leaq 0x40(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x36b10
movsd 0x88(%rsp), %xmm0
leaq 0x28(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x36b10
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x6fa40
movq 0x10(%rsp), %rax
addq $0xb8, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::PointDerivative(double) const
R3Vector R3Polyline::
PointDerivative(RNScalar u) const
{
  // Return tangent vector at parametric value u

  // Get index variables
  int i = VertexIndex(u);
  R3Point p1 = VertexPosition(i);
  R3Point p2 = VertexPosition(i+1);
  RNScalar u1 = VertexParameter(i);
  RNScalar u2 = VertexParameter(i+1);
  if (u2 <= u1) return R3zero_vector;
  else return (p2 - p1) / (u2 - u1);
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x8(%rsp)
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movsd %xmm0, 0x80(%rsp)
movq 0x88(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movsd 0x80(%rsp), %xmm0
movq (%rdi), %rax
callq *0x268(%rax)
movq 0x18(%rsp), %rsi
movl %eax, 0x7c(%rsp)
movl 0x7c(%rsp), %edx
leaq 0x60(%rsp), %rdi
callq 0x919b0
movq 0x18(%rsp), %rsi
movl 0x7c(%rsp), %edx
addl $0x1, %edx
leaq 0x48(%rsp), %rdi
callq 0x919b0
movq 0x18(%rsp), %rdi
movl 0x7c(%rsp), %esi
callq 0x919f0
movq 0x18(%rsp), %rdi
movsd %xmm0, 0x40(%rsp)
movl 0x7c(%rsp), %esi
addl $0x1, %esi
callq 0x919f0
movsd %xmm0, 0x38(%rsp)
movsd 0x38(%rsp), %xmm1
movsd 0x40(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x93629
movq 0x8(%rsp), %rdi
leaq 0x4e5f7e(%rip), %rsi    # 0x5795a0
callq 0x6fcf0
jmp 0x93658
leaq 0x20(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0x6eeb0
movq 0x8(%rsp), %rdi
movsd 0x38(%rsp), %xmm0
subsd 0x40(%rsp), %xmm0
leaq 0x20(%rsp), %rsi
callq 0x711f0
movq 0x10(%rsp), %rax
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::Transform(gaps::R3Transformation const&)
void R3Polyline::
Transform(const R3Transformation& transformation)
{
  // Transform vertices
  for (int i = 0; i < nvertices; i++) {
    vertex_positions[i].Transform(transformation);
  }

  // Mark bbox as out of date
  bbox[0][0] = bbox[0][1] = bbox[0][2] = FLT_MAX;
  bbox[1][0] = bbox[1][1] = bbox[1][2] = -FLT_MAX;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x8(%rsp), %rcx
movl 0x14(%rsp), %eax
cmpl 0x20(%rcx), %eax
jge 0x9398a
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movslq 0x14(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x6f7c0
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x93950
movq 0x8(%rsp), %rdi
addq $0x28, %rdi
xorl %esi, %esi
callq 0x44f40
movq %rax, %rdi
movl $0x2, %esi
callq 0x36be0
movq 0x8(%rsp), %rdi
movsd 0x9f66c(%rip), %xmm0    # 0x133020
movsd %xmm0, (%rax)
addq $0x28, %rdi
xorl %esi, %esi
callq 0x44f40
movq %rax, %rdi
movl $0x1, %esi
callq 0x36be0
movq 0x8(%rsp), %rdi
movsd 0x9f643(%rip), %xmm0    # 0x133020
movsd %xmm0, (%rax)
addq $0x28, %rdi
xorl %esi, %esi
callq 0x44f40
movq %rax, %rdi
xorl %esi, %esi
callq 0x36be0
movq 0x8(%rsp), %rdi
movsd 0x9f61d(%rip), %xmm0    # 0x133020
movsd %xmm0, (%rax)
addq $0x28, %rdi
movl $0x1, %esi
callq 0x44f40
movq %rax, %rdi
movl $0x2, %esi
callq 0x36be0
movq 0x8(%rsp), %rdi
movsd 0xa0291(%rip), %xmm0    # 0x133cc0
movsd %xmm0, (%rax)
addq $0x28, %rdi
movl $0x1, %esi
callq 0x44f40
movq %rax, %rdi
movl $0x1, %esi
callq 0x36be0
movq 0x8(%rsp), %rdi
movsd 0xa0265(%rip), %xmm0    # 0x133cc0
movsd %xmm0, (%rax)
addq $0x28, %rdi
movl $0x1, %esi
callq 0x44f40
movq %rax, %rdi
xorl %esi, %esi
callq 0x36be0
movsd 0xa0241(%rip), %xmm0    # 0x133cc0
movsd %xmm0, (%rax)
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::SetVertexParameter(int, double)
void R3Polyline::
SetVertexParameter(int k, RNScalar u)
{
  // Check number of points
  if (nvertices == 0) return;
  
  // Allocate vertex parameters
  if (!vertex_parameters) {
    vertex_parameters = new RNScalar [ nvertices ];
    for (int i = 0; i < k; i++) vertex_parameters[i] = (u*i)/k;
    vertex_parameters[k] = u;
    for (int i = k+1; i < nvertices; i++) vertex_parameters[i] = (i-k)+u;
  }
  else {
    // Set vertex parameter
    vertex_parameters[k] = u;
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movsd %xmm0, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
cmpl $0x0, 0x20(%rax)
jne 0x93bf7
jmp 0x93d00
movq (%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x93ce8
movq (%rsp), %rax
movslq 0x20(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0xf030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jge 0x93c85
movq (%rsp), %rax
movsd 0x10(%rsp), %xmm0
cvtsi2sdl 0xc(%rsp), %xmm1
mulsd %xmm1, %xmm0
cvtsi2sdl 0x1c(%rsp), %xmm1
divsd %xmm1, %xmm0
movq 0x10(%rax), %rax
movslq 0xc(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x93c42
movq (%rsp), %rax
movsd 0x10(%rsp), %xmm0
movq 0x10(%rax), %rax
movslq 0x1c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
movq (%rsp), %rcx
movl 0x8(%rsp), %eax
cmpl 0x20(%rcx), %eax
jge 0x93ce6
movq (%rsp), %rax
movl 0x8(%rsp), %ecx
subl 0x1c(%rsp), %ecx
cvtsi2sd %ecx, %xmm0
addsd 0x10(%rsp), %xmm0
movq 0x10(%rax), %rax
movslq 0x8(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x93ca8
jmp 0x93d00
movq (%rsp), %rax
movsd 0x10(%rsp), %xmm0
movq 0x10(%rax), %rax
movslq 0x1c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::SetVertexData(int, void*)
void R3Polyline::
SetVertexData(int k, void *data)
{
  // Allocate vertex datas
  if (!vertex_datas) {
    vertex_datas = new void * [ NVertices() ];
    if (!vertex_datas) {
      RNFail("Unable to allocate vertex datas\n");
      return;
    }
  }

  // Set vertex data
  vertex_datas[k] = data;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x18(%rax)
jne 0x93d85
movq 0x8(%rsp), %rdi
callq 0x91990
cltq
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0xf030
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
cmpq $0x0, 0x18(%rax)
jne 0x93d83
leaq 0xa1c8a(%rip), %rdi     # 0x135a04
movb $0x0, %al
callq 0xd4f30
jmp 0x93d9c
jmp 0x93d85
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rdx
movq 0x18(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::UpdateBBox()
void R3Polyline::
UpdateBBox(void) 
{
  // Initialize bounding box
  bbox = R3null_box;

  // Union vertex_positions
  for (int i = 0; i < nvertices; i++) {
    bbox.Union(VertexPosition(i));
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0x28, %rdi
leaq 0xe4a1a(%rip), %rsi     # 0x1787e8
callq 0x37500
movl $0x0, 0x2c(%rsp)
movq 0x8(%rsp), %rcx
movl 0x2c(%rsp), %eax
cmpl 0x20(%rcx), %eax
jge 0x93e22
movq 0x8(%rsp), %rsi
movq %rsi, %rax
addq $0x28, %rax
movq %rax, (%rsp)
movl 0x2c(%rsp), %edx
leaq 0x10(%rsp), %rdi
callq 0x919b0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x444b0
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x93ddb
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::Outline(gaps::RNFlags) const
void R3Polyline::
Outline(const R3DrawFlags flags) const
{
  // Draw polyline
  R3BeginLine();
  for (int i = 0; i < nvertices; i++) 
    R3LoadPoint(VertexPosition(i));
  R3EndLine();
}

// Assembly:
subq $0x38, %rsp
movq %rsi, 0x30(%rsp)
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
callq 0x38e70
movl $0x0, 0x24(%rsp)
movq (%rsp), %rcx
movl 0x24(%rsp), %eax
cmpl 0x20(%rcx), %eax
jge 0x93eca
movq (%rsp), %rsi
movl 0x24(%rsp), %edx
leaq 0x8(%rsp), %rdi
callq 0x919b0
leaq 0x8(%rsp), %rdi
callq 0x38e40
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x93e94
callq 0x38e80
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Rectangle.cpp
// Function: gaps::R3Rectangle::ClosestPoint(gaps::R3Point const&) const
const R3Point R3Rectangle::
ClosestPoint(const R3Point& point) const
{
    // Check if rectangle is empty
    if (IsEmpty()) return R3zero_point;

    // Start with original point
    R3Point closest_point = point;

    // Project onto plane
    closest_point.Project(Plane());

    // Iteratively project onto each edge, if outside
    for (int sign = -1; sign <= 1; sign += 2) {
      for (int dim = 0; dim <= 1; dim++) {
        R3Plane plane(Center() + sign * Radius(dim) * Axis(dim), sign * Axis(dim));
        RNScalar d = R3SignedDistance(plane, closest_point);
        if (d > 0) closest_point -= d * plane.Normal();
      }
    }

    // Return closest point
    return closest_point;
}

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x30(%rsp)
movq %rdi, 0x100(%rsp)
movq %rsi, 0xf8(%rsp)
movq %rdx, 0xf0(%rsp)
movq 0xf8(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x78ac0
cmpl $0x0, %eax
je 0x94399
movq 0x28(%rsp), %rdi
leaq 0x4e5121(%rip), %rsi    # 0x5794b0
callq 0x6eb90
jmp 0x9455d
movq 0x28(%rsp), %rdi
movq 0xf0(%rsp), %rsi
callq 0x6eb90
movq 0x38(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0x81db0
movq 0x28(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x6f220
movl $0xffffffff, 0xcc(%rsp) # imm = 0xFFFFFFFF
cmpl $0x1, 0xcc(%rsp)
jg 0x9455b
movl $0x0, 0xc8(%rsp)
cmpl $0x1, 0xc8(%rsp)
jg 0x94543
movq 0x38(%rsp), %rdi
callq 0x78df0
movq 0x38(%rsp), %rdi
movq %rax, 0x18(%rsp)
cvtsi2sdl 0xcc(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movl 0xc8(%rsp), %esi
callq 0x78dd0
movq 0x38(%rsp), %rdi
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0xc8(%rsp), %esi
callq 0x78e10
movsd 0x10(%rsp), %xmm0
movq %rax, %rsi
leaq 0x78(%rsp), %rdi
callq 0x13800
movq 0x18(%rsp), %rsi
leaq 0x90(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x6f110
movq 0x38(%rsp), %rdi
cvtsi2sdl 0xcc(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movl 0xc8(%rsp), %esi
callq 0x78e10
movsd 0x20(%rsp), %xmm0
movq %rax, %rsi
leaq 0x60(%rsp), %rdi
callq 0x13800
leaq 0xa8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0x6c260
movq 0x28(%rsp), %rsi
leaq 0xa8(%rsp), %rdi
callq 0x86f90
movsd %xmm0, 0x58(%rsp)
movsd 0x58(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x9452b
movsd 0x58(%rsp), %xmm0
movsd %xmm0, (%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x13e60
movsd (%rsp), %xmm0
movq %rax, %rsi
leaq 0x40(%rsp), %rdi
callq 0x13800
movq 0x28(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x6f890
jmp 0x9452d
movl 0xc8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc8(%rsp)
jmp 0x943f3
jmp 0x94545
movl 0xcc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0xcc(%rsp)
jmp 0x943da
jmp 0x9455d
movq 0x30(%rsp), %rax
addq $0x108, %rsp            # imm = 0x108
retq
nopw (%rax,%rax)