LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Threshold(double, double, double)
void R2Grid::
Threshold(RNScalar threshold, RNScalar low, RNScalar high) 
{
  // Set grid value to low (high) if less/equal (greater) than threshold
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] != R2_GRID_UNKNOWN_VALUE) {
      if (grid_values[i] <= threshold) {
        if (low != R2_GRID_KEEP_VALUE) grid_values[i] = low;
      }
      else {
        if (high != R2_GRID_KEEP_VALUE) grid_values[i] = high;
      }
    }
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x5c283
movq 0xb8(%rdi), %rcx
xorl %edx, %edx
movsd 0x46d73(%rip), %xmm3    # 0xa2fb8
movsd 0x46d5b(%rip), %xmm4    # 0xa2fa8
movsd (%rcx,%rdx,8), %xmm5
ucomisd %xmm3, %xmm5
jne 0x5c25a
jnp 0x5c27b
ucomisd %xmm5, %xmm0
jae 0x5c26a
ucomisd %xmm4, %xmm2
movapd %xmm2, %xmm5
jmp 0x5c272
ucomisd %xmm4, %xmm1
movapd %xmm1, %xmm5
jne 0x5c276
jnp 0x5c27b
movsd %xmm5, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x5c24d
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Erode(double)
void R2Grid::
Erode(RNLength grid_distance) 
{
  // Make copy so that can restore unknown values
  R2Grid copy(*this);

  // Keep only pixels at least distance from some zero pixel
  Threshold(1.0E-20, 1, 0);
  SquaredDistanceTransform();
  Threshold(grid_distance * grid_distance, 0, 1);

  // Restore unknown values
  for (int i = 0; i < grid_size; i++) {
    if (copy.grid_values[i] == R2_GRID_UNKNOWN_VALUE) {
      grid_values[i] = R2_GRID_UNKNOWN_VALUE;
    }
  }
}

// Assembly:
pushq %rbx
subq $0xe0, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x5a63c
movslq 0xcc(%rbx), %rax
testq %rax, %rax
jle 0x5c2f2
movq 0xb8(%rbx), %rcx
xorl %edx, %edx
movsd 0x46cf9(%rip), %xmm0    # 0xa2fb8
movsd 0x46cd9(%rip), %xmm1    # 0xa2fa0
movsd 0x45d69(%rip), %xmm2    # 0xa2038
movsd (%rcx,%rdx,8), %xmm3
ucomisd %xmm0, %xmm3
jne 0x5c2dc
jnp 0x5c2ea
cmpnlesd %xmm1, %xmm3
andnpd %xmm2, %xmm3
movlpd %xmm3, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x5c2cf
movq %rbx, %rdi
callq 0x5bebe
movslq 0xcc(%rbx), %rax
testq %rax, %rax
jle 0x5c354
movsd 0x8(%rsp), %xmm0
mulsd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0xb8(%rbx), %rcx
xorl %edx, %edx
movsd 0x46c91(%rip), %xmm0    # 0xa2fb8
movsd 0x45d09(%rip), %xmm1    # 0xa2038
movsd (%rcx,%rdx,8), %xmm2
ucomisd %xmm0, %xmm2
jne 0x5c33c
jnp 0x5c34c
cmpnlesd 0x8(%rsp), %xmm2
andpd %xmm1, %xmm2
movlpd %xmm2, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x5c32f
testl %eax, %eax
jle 0x5c394
movq 0xc8(%rsp), %rcx
movq 0xb8(%rbx), %rdx
xorl %esi, %esi
movsd 0x46c47(%rip), %xmm0    # 0xa2fb8
movabsq $-0x3f8bf00000000000, %rdi # imm = 0xC074100000000000
movsd (%rcx,%rsi,8), %xmm1
ucomisd %xmm0, %xmm1
jne 0x5c38c
jp 0x5c38c
movq %rdi, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x5c37b
leaq 0x10(%rsp), %rdi
callq 0x5a814
addq $0xe0, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5a814
movq %rbx, %rdi
callq 0xe7e0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::AddNoise(double)
void R2Grid::
AddNoise(RNScalar sigma_fraction)
{
  // Add noise to every grid entry
  if (sigma_fraction == 0) return;
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] == R2_GRID_UNKNOWN_VALUE) continue;
    RNScalar r = RNRandomScalar();
    RNScalar sign = (RNRandomScalar() < 0.5) ? -1.0 : 1.0;
    RNScalar sigma = sigma_fraction * grid_values[i];
    RNScalar magnitude = sigma * (1.0 - exp(-0.5 * r * r));
    grid_values[i] += sign * magnitude;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorpd %xmm1, %xmm1
movsd %xmm0, (%rsp)
ucomisd %xmm1, %xmm0
jne 0x5cb5c
jnp 0x5cc33
movq %rdi, %rbx
cmpl $0x0, 0xcc(%rdi)
jle 0x5cc33
xorl %r14d, %r14d
movsd 0x46441(%rip), %xmm1    # 0xa2fb8
leaq 0x4c7b2(%rip), %r15     # 0xa9330
movq 0xb8(%rbx), %rax
movsd (%rax,%r14,8), %xmm0
ucomisd %xmm1, %xmm0
jne 0x5cb97
jnp 0x5cc20
callq 0x72630
movsd %xmm0, 0x10(%rsp)
callq 0x72630
xorl %r12d, %r12d
movsd 0x4547e(%rip), %xmm1    # 0xa2030
ucomisd %xmm0, %xmm1
seta %r12b
movq 0xb8(%rbx), %rax
movsd (%rax,%r14,8), %xmm0
mulsd (%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm1
movapd %xmm1, %xmm0
mulsd 0x4567c(%rip), %xmm0    # 0xa2260
mulsd %xmm1, %xmm0
callq 0xe7f0
movsd 0x45443(%rip), %xmm1    # 0xa2038
subsd %xmm0, %xmm1
mulsd 0x8(%rsp), %xmm1
mulsd (%r15,%r12,8), %xmm1
movq 0xb8(%rbx), %rax
addsd (%rax,%r14,8), %xmm1
movsd %xmm1, (%rax,%r14,8)
movsd 0x46398(%rip), %xmm1    # 0xa2fb8
incq %r14
movslq 0xcc(%rbx), %rax
cmpq %rax, %r14
jl 0x5cb7e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Gradient(int)
void R2Grid::
Gradient(RNDimension dim)
{
  // Set up xfilter
  const RNScalar xfilter[3][3] = { 
    { -0.25, 0, 0.25 }, 
    { -0.5,  0, 0.5}, 
    { -0.25, 0, 0.25 } 
  };
  const RNScalar yfilter[3][3] = { 
    { -0.25, -0.5, -0.25 }, 
    {  0,     0,    0 }, 
    {  0.25,  0.5,  0.25 } 
  };

  // Convolve with filter
  if (dim == RN_X) Convolve(xfilter);
  else if (dim == RN_Y) Convolve(yfilter);
  else RNAbort("Invalid dimension");
}

// Assembly:
subq $0x98, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movabsq $-0x4030000000000000, %rax # imm = 0xBFD0000000000000
movq %rax, (%rsp)
movaps 0x4b67d(%rip), %xmm1    # 0xa9340
movaps %xmm1, 0x10(%rsp)
movaps 0x4b681(%rip), %xmm1    # 0xa9350
movups %xmm1, 0x28(%rsp)
movabsq $0x3fd0000000000000, %rcx # imm = 0x3FD0000000000000
movq %rcx, 0x40(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps 0x4b66c(%rip), %xmm0    # 0xa9360
movaps %xmm0, 0x50(%rsp)
movq %rax, 0x60(%rsp)
movaps 0x4b66b(%rip), %xmm0    # 0xa9370
movaps %xmm0, 0x80(%rsp)
movq %rcx, 0x90(%rsp)
cmpl $0x1, %esi
je 0x5dd23
testl %esi, %esi
jne 0x5dd35
movq %rsp, %rsi
jmp 0x5dd28
leaq 0x50(%rsp), %rsi
callq 0x5daa4
addq $0x98, %rsp
retq
leaq 0x49a24(%rip), %rdi     # 0xa7760
xorl %eax, %eax
addq $0x98, %rsp
jmp 0x72942
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::GradientAngle()
void R2Grid::
GradientAngle(void)
{
  // Compute direction of gradient
  R2Grid gx(*this); gx.Gradient(RN_X);
  R2Grid gy(*this); gy.Gradient(RN_Y);
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] == R2_GRID_UNKNOWN_VALUE) {
      continue;
    }
    RNScalar x = gx.GridValue(i);
    if (x == R2_GRID_UNKNOWN_VALUE) {
      grid_values[i] = R2_GRID_UNKNOWN_VALUE;
      continue;
    }
    RNScalar y = gy.GridValue(i);
    if (y == R2_GRID_UNKNOWN_VALUE) {
      grid_values[i] = R2_GRID_UNKNOWN_VALUE;
      continue;
     }
    if (x == 0) {
      grid_values[i] = RN_PI_OVER_TWO;
      continue;
    }
    grid_values[i] = atan(y/x);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, %rbx
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5a63c
movq %r14, %rdi
xorl %esi, %esi
callq 0x5dc96
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x5a63c
leaq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0x5dc96
cmpl $0x0, 0xcc(%rbx)
jle 0x5de79
leaq 0x4c1f2(%rip), %rax     # 0xa9fb8
movsd (%rax), %xmm2
xorl %r14d, %r14d
movsd 0x451e3(%rip), %xmm3    # 0xa2fb8
movabsq $-0x3f8bf00000000000, %r15 # imm = 0xC074100000000000
xorpd %xmm4, %xmm4
movq 0xb8(%rbx), %rax
movsd (%rax,%r14,8), %xmm0
ucomisd %xmm3, %xmm0
jne 0x5ddf8
jnp 0x5de28
movq 0x198(%rsp), %rcx
movsd (%rcx,%r14,8), %xmm1
ucomisd %xmm3, %xmm1
jne 0x5de0e
jnp 0x5de24
movq 0xc8(%rsp), %rcx
movsd (%rcx,%r14,8), %xmm0
ucomisd %xmm3, %xmm0
jne 0x5de39
jp 0x5de39
movq %r15, (%rax,%r14,8)
incq %r14
movslq 0xcc(%rbx), %rax
cmpq %rax, %r14
jl 0x5dde3
jmp 0x5de79
ucomisd %xmm4, %xmm1
jne 0x5de49
jp 0x5de49
movsd %xmm2, (%rax,%r14,8)
jmp 0x5de28
divsd %xmm1, %xmm0
movsd %xmm2, 0x8(%rsp)
callq 0xe380
xorpd %xmm4, %xmm4
movsd 0x45154(%rip), %xmm3    # 0xa2fb8
movsd 0x8(%rsp), %xmm2
movq 0xb8(%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
jmp 0x5de28
leaq 0x10(%rsp), %rdi
callq 0x5a814
leaq 0xe0(%rsp), %rdi
callq 0x5a814
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5a814
jmp 0x5deb1
jmp 0x5deae
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x5a814
movq %rbx, %rdi
callq 0xe7e0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::GradientMagnitude()
void R2Grid::
GradientMagnitude(void)
{
  // Compute magnitude of gradient (Sobel operator)
  R2Grid gx(*this); gx.Gradient(RN_X);
  R2Grid gy(*this); gy.Gradient(RN_Y);
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] == R2_GRID_UNKNOWN_VALUE) {
      continue;
    }
    RNScalar x = gx.GridValue(i);
    if (x == R2_GRID_UNKNOWN_VALUE) {
      grid_values[i] = R2_GRID_UNKNOWN_VALUE;
      continue;
    }
    RNScalar y = gy.GridValue(i);
    if (y == R2_GRID_UNKNOWN_VALUE) {
      grid_values[i] = R2_GRID_UNKNOWN_VALUE;
      continue;
    }
    grid_values[i] = sqrt(x*x + y*y);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, %rbx
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5a63c
movq %r14, %rdi
xorl %esi, %esi
callq 0x5dc96
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x5a63c
movq %rsp, %rdi
movl $0x1, %esi
callq 0x5dc96
cmpl $0x0, 0xcc(%rbx)
jle 0x5dfbe
xorl %r14d, %r14d
movsd 0x45096(%rip), %xmm2    # 0xa2fb8
movabsq $-0x3f8bf00000000000, %r15 # imm = 0xC074100000000000
xorpd %xmm3, %xmm3
movq 0xb8(%rbx), %rax
movsd (%rax,%r14,8), %xmm0
ucomisd %xmm2, %xmm0
jne 0x5df45
jnp 0x5df75
movq 0x188(%rsp), %rcx
movsd (%rcx,%r14,8), %xmm0
ucomisd %xmm2, %xmm0
jne 0x5df5b
jnp 0x5df71
movq 0xb8(%rsp), %rcx
movsd (%rcx,%r14,8), %xmm1
ucomisd %xmm2, %xmm1
jne 0x5df86
jp 0x5df86
movq %r15, (%rax,%r14,8)
incq %r14
movslq 0xcc(%rbx), %rax
cmpq %rax, %r14
jl 0x5df30
jmp 0x5dfbe
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm3, %xmm0
jb 0x5df9e
sqrtsd %xmm0, %xmm0
jmp 0x5dfaf
callq 0xe340
xorpd %xmm3, %xmm3
movsd 0x45009(%rip), %xmm2    # 0xa2fb8
movq 0xb8(%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
jmp 0x5df75
movq %rsp, %rdi
callq 0x5a814
leaq 0xd0(%rsp), %rdi
callq 0x5a814
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5a814
jmp 0x5dff2
jmp 0x5dfef
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x5a814
movq %rbx, %rdi
callq 0xe7e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Substitute(double, double)
void R2Grid::
Substitute(RNScalar old_value, RNScalar new_value) 
{
  // Replace all instances of old_value with new_value
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] == old_value) {
      grid_values[i] = new_value;
    }
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x5e5a5
movq 0xb8(%rdi), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm2
ucomisd %xmm0, %xmm2
jne 0x5e59d
jp 0x5e59d
movsd %xmm1, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x5e58b
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Add(double)
void R2Grid::
Add(RNScalar value) 
{
  // Add value to all grid values 
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] != R2_GRID_UNKNOWN_VALUE) {
      grid_values[i] += value;
    }
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x5e5e1
movq 0xb8(%rdi), %rcx
xorl %edx, %edx
movsd 0x449f5(%rip), %xmm1    # 0xa2fb8
movsd (%rcx,%rdx,8), %xmm2
ucomisd %xmm1, %xmm2
jne 0x5e5d0
jnp 0x5e5d9
addsd %xmm0, %xmm2
movsd %xmm2, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x5e5c3
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Add(gaps::R2Grid const&)
void R2Grid::
Add(const R2Grid& grid) 
{
  // Resolutions must be the same (for now)
  assert(grid_resolution[0] == grid.grid_resolution[0]);
  assert(grid_resolution[1] == grid.grid_resolution[1]);

  // Add passed grid values to corresponding entries of this grid
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] != R2_GRID_UNKNOWN_VALUE) {
      if (grid.grid_values[i] == R2_GRID_UNKNOWN_VALUE) grid_values[i] = R2_GRID_UNKNOWN_VALUE;
      else grid_values[i] += grid.grid_values[i];
    }
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x5e63e
movq 0xb8(%rdi), %rcx
movq 0xb8(%rsi), %rdx
xorl %esi, %esi
movsd 0x449b2(%rip), %xmm0    # 0xa2fb8
movsd (%rcx,%rsi,8), %xmm1
ucomisd %xmm0, %xmm1
jne 0x5e613
jnp 0x5e636
movsd (%rdx,%rsi,8), %xmm2
addsd %xmm2, %xmm1
cmpeqsd %xmm0, %xmm2
movapd %xmm2, %xmm3
andnpd %xmm1, %xmm3
andpd %xmm0, %xmm2
orpd %xmm3, %xmm2
movlpd %xmm2, (%rcx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x5e606
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Subtract(gaps::R2Grid const&)
void R2Grid::
Subtract(const R2Grid& grid) 
{
  // Resolutions must be the same (for now)
  assert(grid_resolution[0] == grid.grid_resolution[0]);
  assert(grid_resolution[1] == grid.grid_resolution[1]);

  // Subtract passed grid values from corresponding entries of this grid
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] != R2_GRID_UNKNOWN_VALUE) {
      if (grid.grid_values[i] == R2_GRID_UNKNOWN_VALUE) grid_values[i] = R2_GRID_UNKNOWN_VALUE;
      else grid_values[i] -= grid.grid_values[i];
    }
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x5e6d8
movq 0xb8(%rdi), %rcx
movq 0xb8(%rsi), %rdx
xorl %esi, %esi
movsd 0x44918(%rip), %xmm0    # 0xa2fb8
movsd (%rcx,%rsi,8), %xmm1
ucomisd %xmm0, %xmm1
jne 0x5e6ad
jnp 0x5e6d0
movsd (%rdx,%rsi,8), %xmm2
subsd %xmm2, %xmm1
cmpeqsd %xmm0, %xmm2
movapd %xmm2, %xmm3
andnpd %xmm1, %xmm3
andpd %xmm0, %xmm2
orpd %xmm3, %xmm2
movlpd %xmm2, (%rcx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x5e6a0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Multiply(double)
void R2Grid::
Multiply(RNScalar value) 
{
  // Multiply grid values by value
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] != R2_GRID_UNKNOWN_VALUE) {
      grid_values[i] *= value;
    }
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x5e715
movq 0xb8(%rdi), %rcx
xorl %edx, %edx
movsd 0x448c1(%rip), %xmm1    # 0xa2fb8
movsd (%rcx,%rdx,8), %xmm2
ucomisd %xmm1, %xmm2
jne 0x5e704
jnp 0x5e70d
mulsd %xmm0, %xmm2
movsd %xmm2, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x5e6f7
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Multiply(gaps::R2Grid const&)
void R2Grid::
Multiply(const R2Grid& grid) 
{
  // Resolutions must be the same (for now)
  assert(grid_resolution[0] == grid.grid_resolution[0]);
  assert(grid_resolution[1] == grid.grid_resolution[1]);

  // Multiply passed grid values by corresponding entries of this grid
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] != R2_GRID_UNKNOWN_VALUE) {
      if (grid.grid_values[i] == R2_GRID_UNKNOWN_VALUE) grid_values[i] = R2_GRID_UNKNOWN_VALUE;
      else grid_values[i] *= grid.grid_values[i];
    }
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x5e772
movq 0xb8(%rdi), %rcx
movq 0xb8(%rsi), %rdx
xorl %esi, %esi
movsd 0x4487e(%rip), %xmm0    # 0xa2fb8
movsd (%rcx,%rsi,8), %xmm1
ucomisd %xmm0, %xmm1
jne 0x5e747
jnp 0x5e76a
movsd (%rdx,%rsi,8), %xmm2
mulsd %xmm2, %xmm1
cmpeqsd %xmm0, %xmm2
movapd %xmm2, %xmm3
andnpd %xmm1, %xmm3
andpd %xmm0, %xmm2
orpd %xmm3, %xmm2
movlpd %xmm2, (%rcx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x5e73a
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Divide(gaps::R2Grid const&)
void R2Grid::
Divide(const R2Grid& grid) 
{
  // Resolutions must be the same (for now)
  assert(grid_resolution[0] == grid.grid_resolution[0]);
  assert(grid_resolution[1] == grid.grid_resolution[1]);

  // Divide entries of this grid by by corresponding entries of passed grid 
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] != R2_GRID_UNKNOWN_VALUE) {
      if (grid.grid_values[i] == R2_GRID_UNKNOWN_VALUE) {
       grid_values[i] = R2_GRID_UNKNOWN_VALUE;
      }
      else if (grid.grid_values[i] == 0) {
        if (grid_values[i] > 0) grid_values[i] = RN_INFINITY;
        else if (grid_values[i] < 0) grid_values[i] = -RN_INFINITY;
      }
      else {
        grid_values[i] /= grid.grid_values[i];
      }
    }
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x5e80a
movq 0xb8(%rdi), %rcx
movq 0xb8(%rsi), %rdx
xorl %esi, %esi
movsd 0x4481c(%rip), %xmm0    # 0xa2fb8
xorpd %xmm1, %xmm1
leaq 0x87401(%rip), %rdi     # 0xe5ba8
movapd 0x43871(%rip), %xmm2    # 0xa2020
movsd (%rcx,%rsi,8), %xmm3
ucomisd %xmm0, %xmm3
jne 0x5e7bc
jnp 0x5e7d2
movsd (%rdx,%rsi,8), %xmm5
ucomisd %xmm0, %xmm5
movapd %xmm0, %xmm4
jne 0x5e7dc
jp 0x5e7dc
movsd %xmm4, (%rcx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x5e7af
jmp 0x5e80a
ucomisd %xmm1, %xmm5
jne 0x5e7f0
jp 0x5e7f0
ucomisd %xmm1, %xmm3
jbe 0x5e7fa
movsd (%rdi), %xmm4
jmp 0x5e7cd
divsd %xmm5, %xmm3
movapd %xmm3, %xmm4
jmp 0x5e7cd
ucomisd %xmm3, %xmm1
jbe 0x5e7d2
movsd (%rdi), %xmm4
xorpd %xmm2, %xmm4
jmp 0x5e7cd
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Pow(double)
void R2Grid::
Pow(RNScalar exponent) 
{
  // Apply exponent to all grid values 
  for (int i = 0; i < grid_size; i++) {
    RNScalar value = grid_values[i];
    if (value != R2_GRID_UNKNOWN_VALUE) {
      grid_values[i] = pow(value, exponent);
    }
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
cmpl $0x0, 0xcc(%rdi)
jle 0x5e863
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0xb8(%rbx), %rax
movsd (%rax,%r14,8), %xmm0
ucomisd 0x4477f(%rip), %xmm0    # 0xa2fb8
jne 0x5e83d
jnp 0x5e854
movsd (%rsp), %xmm1
callq 0xe7d0
movq 0xb8(%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
movslq 0xcc(%rbx), %rax
cmpq %rax, %r14
jl 0x5e824
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Mask(gaps::R2Grid const&)
void R2Grid::
Mask(const R2Grid& grid) 
{
  // Resolutions must be the same (for now)
  assert(grid_resolution[0] == grid.grid_resolution[0]);
  assert(grid_resolution[1] == grid.grid_resolution[1]);

  // Mask entries of grid
  for (int i = 0; i < grid_size; i++) {
    if (grid.grid_values[i] == 0) grid_values[i] = 0;
    else if (grid.grid_values[i] == R2_GRID_UNKNOWN_VALUE) grid_values[i] = R2_GRID_UNKNOWN_VALUE;
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x5e8ba
movq 0xb8(%rsi), %rcx
movq 0xb8(%rdi), %rdx
xorl %esi, %esi
movsd 0x44728(%rip), %xmm0    # 0xa2fb8
movsd (%rcx,%rsi,8), %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm2
jne 0x5e8a1
jnp 0x5e8ad
ucomisd %xmm0, %xmm2
movapd %xmm0, %xmm1
jne 0x5e8b2
jp 0x5e8b2
movsd %xmm1, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x5e890
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Overlay(gaps::R2Grid const&)
void R2Grid::
Overlay(const R2Grid& grid) 
{
  // Resolutions must be the same (for now)
  assert(grid_resolution[0] == grid.grid_resolution[0]);
  assert(grid_resolution[1] == grid.grid_resolution[1]);

  // Assign non-zero entries of grid 
  for (int i = 0; i < grid_size; i++) {
    if (grid.grid_values[i] == 0) continue;
    if (grid.grid_values[i] == R2_GRID_UNKNOWN_VALUE) continue;
    grid_values[i] = grid.grid_values[i];
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x5e906
movq 0xb8(%rsi), %rcx
movq 0xb8(%rdi), %rdx
xorl %esi, %esi
xorpd %xmm0, %xmm0
movsd 0x446d4(%rip), %xmm1    # 0xa2fb8
movsd (%rcx,%rsi,8), %xmm2
ucomisd %xmm0, %xmm2
jne 0x5e8f1
jnp 0x5e8fe
ucomisd %xmm1, %xmm2
jne 0x5e8f9
jnp 0x5e8fe
movsd %xmm2, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x5e8e4
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Threshold(gaps::R2Grid const&, double, double)
void R2Grid::
Threshold(const R2Grid& threshold, RNScalar low, RNScalar high) 
{
  // Set grid value to low (high) if less/equal (greater) than threshold
  for (int i = 0; i < grid_size; i++) {
    if ((grid_values[i] != R2_GRID_UNKNOWN_VALUE) && (threshold.grid_values[i] != R2_GRID_UNKNOWN_VALUE)) {
      if (grid_values[i] <= threshold.grid_values[i]) {
        if (low == R2_GRID_INPUT_VALUE) grid_values [i]= threshold.grid_values[i];
        else if (low != R2_GRID_KEEP_VALUE) grid_values[i] = low;
      }
      else {
        if (high == R2_GRID_INPUT_VALUE) grid_values[i] = threshold.grid_values[i];
        else if (high != R2_GRID_KEEP_VALUE) grid_values[i] = high;
      }
    }
  }
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x5e9e5
movq 0xb8(%rdi), %rcx
movq 0xb8(%rsi), %rdx
movsd 0x4467a(%rip), %xmm2    # 0xa2fa8
movapd %xmm0, %xmm3
cmpneqpd %xmm2, %xmm3
movsd 0x4a9d9(%rip), %xmm4    # 0xa9318
movapd %xmm0, %xmm5
cmpeqpd %xmm4, %xmm5
orpd %xmm3, %xmm5
movd %xmm5, %esi
cmpneqpd %xmm1, %xmm2
cmpeqpd %xmm1, %xmm4
orpd %xmm2, %xmm4
movd %xmm4, %edi
xorl %r8d, %r8d
movsd 0x4464b(%rip), %xmm2    # 0xa2fb8
movsd 0x4a9a3(%rip), %xmm3    # 0xa9318
cmpeqsd %xmm1, %xmm3
movapd %xmm3, %xmm4
andnpd %xmm1, %xmm4
movsd 0x4a98e(%rip), %xmm1    # 0xa9318
cmpeqsd %xmm0, %xmm1
movapd %xmm1, %xmm5
andnpd %xmm0, %xmm5
movsd (%rcx,%r8,8), %xmm6
ucomisd %xmm2, %xmm6
jne 0x5e9a5
jnp 0x5e9dd
movsd (%rdx,%r8,8), %xmm0
ucomisd %xmm2, %xmm0
jne 0x5e9b3
jnp 0x5e9dd
ucomisd %xmm6, %xmm0
jae 0x5e9c9
testb $0x1, %dil
je 0x5e9dd
andpd %xmm3, %xmm0
orpd %xmm4, %xmm0
jmp 0x5e9d7
testb $0x1, %sil
je 0x5e9dd
andpd %xmm1, %xmm0
orpd %xmm5, %xmm0
movsd %xmm0, (%rcx,%r8,8)
incq %r8
cmpq %r8, %rax
jne 0x5e997
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::SignedDistanceTransform()
void R2Grid::
SignedDistanceTransform(void)
{
  // Compute distance from boundary into interior (negative) and into exterior (positive)
  R2Grid copy(*this);
  SquaredDistanceTransform();
  Sqrt();
  copy.Threshold(0, 1, 0);
  copy.Substitute(R2_GRID_UNKNOWN_VALUE, 1);
  copy.SquaredDistanceTransform();
  copy.Sqrt();
  Subtract(copy);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x5a63c
movq %rbx, %rdi
callq 0x5bebe
cmpl $0x0, 0xcc(%rbx)
jle 0x5ea6e
xorl %r14d, %r14d
movsd 0x4459c(%rip), %xmm1    # 0xa2fb8
xorpd %xmm2, %xmm2
movq 0xb8(%rbx), %rax
movsd (%rax,%r14,8), %xmm0
ucomisd %xmm1, %xmm0
jne 0x5ea35
jnp 0x5ea5f
ucomisd %xmm2, %xmm0
jb 0x5ea41
sqrtsd %xmm0, %xmm0
jmp 0x5ea52
callq 0xe340
xorpd %xmm2, %xmm2
movsd 0x44566(%rip), %xmm1    # 0xa2fb8
movq 0xb8(%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
movslq 0xcc(%rbx), %rax
cmpq %rax, %r14
jl 0x5ea20
movslq 0xd4(%rsp), %rax
testq %rax, %rax
jle 0x5eaed
movq 0xc0(%rsp), %rcx
xorl %edx, %edx
movsd 0x4452b(%rip), %xmm0    # 0xa2fb8
xorpd %xmm1, %xmm1
movsd 0x4359f(%rip), %xmm2    # 0xa2038
movsd (%rcx,%rdx,8), %xmm3
ucomisd %xmm0, %xmm3
jne 0x5eaa6
jnp 0x5eab4
cmpnlesd %xmm1, %xmm3
andnpd %xmm2, %xmm3
movlpd %xmm3, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x5ea99
testl %eax, %eax
jle 0x5eaed
movq 0xc0(%rsp), %rcx
xorl %edx, %edx
movabsq $0x3ff0000000000000, %rsi # imm = 0x3FF0000000000000
movsd (%rcx,%rdx,8), %xmm1
ucomisd %xmm0, %xmm1
jne 0x5eae5
jp 0x5eae5
movq %rsi, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x5ead4
leaq 0x8(%rsp), %rdi
callq 0x5bebe
cmpl $0x0, 0xd4(%rsp)
jle 0x5eb61
xorl %r14d, %r14d
movsd 0x444ac(%rip), %xmm1    # 0xa2fb8
xorpd %xmm2, %xmm2
movq 0xc0(%rsp), %rax
movsd (%rax,%r14,8), %xmm0
ucomisd %xmm1, %xmm0
jne 0x5eb26
jnp 0x5eb51
ucomisd %xmm2, %xmm0
jb 0x5eb32
sqrtsd %xmm0, %xmm0
jmp 0x5eb43
callq 0xe340
xorpd %xmm2, %xmm2
movsd 0x44475(%rip), %xmm1    # 0xa2fb8
movq 0xc0(%rsp), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
movslq 0xd4(%rsp), %rax
cmpq %rax, %r14
jl 0x5eb10
movslq 0xcc(%rbx), %rax
testq %rax, %rax
jle 0x5ebbe
movq 0xb8(%rbx), %rcx
movq 0xc0(%rsp), %rdx
xorl %esi, %esi
movsd 0x44432(%rip), %xmm0    # 0xa2fb8
movsd (%rcx,%rsi,8), %xmm1
ucomisd %xmm0, %xmm1
jne 0x5eb93
jnp 0x5ebb6
movsd (%rdx,%rsi,8), %xmm2
subsd %xmm2, %xmm1
cmpeqsd %xmm0, %xmm2
movapd %xmm2, %xmm3
andnpd %xmm1, %xmm3
andpd %xmm0, %xmm2
orpd %xmm3, %xmm2
movlpd %xmm2, (%rcx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x5eb86
leaq 0x8(%rsp), %rdi
callq 0x5a814
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5a814
movq %rbx, %rdi
callq 0xe7e0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Gauss(double, int)
void R2Grid::
Gauss(RNLength sigma, RNBoolean square)
{
  // Check sigma
  if (sigma == 0.0) return;    

  // Replace each grid value with Gaussian of what was there before
  RNScalar fac = 1.0 / (2.0 * sigma * sigma);
  RNScalar denom = -2.0 * sigma * sigma;
  if (RNIsZero(denom, 1.0E-6)) return;
  for (int i = 0; i < grid_size; i++) {
    RNScalar value = grid_values[i];
    if (square) value *= value;
    grid_values[i] = fac * exp( value / denom );
  }
}

// Assembly:
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5f38b
jp 0x5f38b
retq
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movsd 0x42e64(%rip), %xmm2    # 0xa2200
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
movapd 0x42ec4(%rip), %xmm1    # 0xa2270
movapd %xmm2, 0x10(%rsp)
andpd %xmm2, %xmm1
movsd 0x42e22(%rip), %xmm2    # 0xa21e0
ucomisd %xmm1, %xmm2
jae 0x5f435
movq %rdi, %r14
cmpl $0x0, 0xcc(%rdi)
jle 0x5f435
movl %esi, %ebx
movapd %xmm0, %xmm1
addsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movsd 0x42c52(%rip), %xmm0    # 0xa2038
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %r15d, %r15d
movq 0xb8(%r14), %rax
movsd (%rax,%r15,8), %xmm0
testl %ebx, %ebx
je 0x5f408
mulsd %xmm0, %xmm0
divsd 0x10(%rsp), %xmm0
callq 0xe7f0
mulsd 0x8(%rsp), %xmm0
movq 0xb8(%r14), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
movslq 0xcc(%r14), %rax
cmpq %rax, %r15
jl 0x5f3f3
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::PadWithZero(int, int)
void R2Grid::
PadWithZero(int xresolution, int yresolution)
{
  // Add zeros to achieve desired resolution
  if ((XResolution() >= xresolution) && (YResolution() >= yresolution)) return;

  // Copy this grid
  R2Grid copy(*this);

  // Set grid resolution
  grid_resolution[0] = xresolution;
  grid_resolution[1] = yresolution;
  grid_row_size = xresolution;
  grid_size = grid_row_size * yresolution;

  // Allocate grid values
  if (grid_values) delete [] grid_values;
  if (grid_size == 0) grid_values = NULL;
  else grid_values = new RNScalar [ grid_size ];
  assert(!grid_size || grid_values);

  // Set all values to zero
  for (int i = 0; i < grid_size; i++) grid_values[i] = 0;

  // Copy original values
  for (int iy = 0; iy < copy.YResolution(); iy++) {
    for (int ix = 0; ix < copy.XResolution(); ix++) {
      RNScalar value = copy.GridValue(ix, iy);
      SetGridValue(ix, iy, value);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
cmpl %esi, 0xc0(%rdi)
jl 0x5f469
cmpl %ebp, 0xc4(%rbx)
jge 0x5f55a
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x5a63c
movl %r14d, 0xc0(%rbx)
movl %ebp, 0xc4(%rbx)
movl %r14d, 0xc8(%rbx)
imull %r14d, %ebp
movl %ebp, 0xcc(%rbx)
movq 0xb8(%rbx), %rdi
testq %rdi, %rdi
je 0x5f4a5
callq 0xe5b0
movslq 0xcc(%rbx), %r15
testq %r15, %r15
je 0x5f4d1
leaq (,%r15,8), %rax
testl %r15d, %r15d
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0xe030
movq %rax, %r14
jmp 0x5f4d4
xorl %r14d, %r14d
movq %r14, 0xb8(%rbx)
testl %r15d, %r15d
jle 0x5f4f1
shlq $0x3, %r15
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0xe260
movslq 0xcc(%rsp), %rax
testq %rax, %rax
jle 0x5f550
movl 0xc8(%rsp), %ecx
movq 0xc0(%rsp), %rdx
movslq 0xd0(%rsp), %rsi
movslq 0xc8(%rbx), %rdi
shlq $0x3, %rsi
shlq $0x3, %rdi
xorl %r8d, %r8d
testl %ecx, %ecx
jle 0x5f542
xorl %r9d, %r9d
movsd (%rdx,%r9,8), %xmm0
movsd %xmm0, (%r14,%r9,8)
incq %r9
cmpq %r9, %rcx
jne 0x5f52e
incq %r8
addq %rsi, %rdx
addq %rdi, %r14
cmpq %rax, %r8
jne 0x5f527
leaq 0x8(%rsp), %rdi
callq 0x5a814
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5a814
movq %rbx, %rdi
callq 0xe7e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::RasterizeGridValue(int, int, double, int)
void R2Grid::
RasterizeGridValue(int ix, int iy, RNScalar value, int operation)
{
  // Check if within bounds
  if ((ix < 0) || (ix > grid_resolution[0]-1)) return;
  if ((iy < 0) || (iy > grid_resolution[1]-1)) return;

  // Update grid based on operation
  if (operation == R2_GRID_ADD_OPERATION) AddGridValue(ix, iy, value);
  else if (operation == R2_GRID_SUBTRACT_OPERATION) AddGridValue(ix, iy, -value);
  else if (operation == R2_GRID_REPLACE_OPERATION) SetGridValue(ix, iy, value);
  else RNAbort("Unrecognized grid rasterization operation\n");
}

// Assembly:
testl %esi, %esi
js 0x5f98d
testl %edx, %edx
js 0x5f98d
cmpl %esi, 0xc0(%rdi)
jle 0x5f98d
cmpl %edx, 0xc4(%rdi)
jle 0x5f98d
cmpl $0x2, %ecx
je 0x5f98e
cmpl $0x1, %ecx
je 0x5f943
testl %ecx, %ecx
jne 0x5f9a7
movq 0xb8(%rdi), %rax
imull 0xc8(%rdi), %edx
addl %esi, %edx
movslq %edx, %rcx
movsd (%rax,%rcx,8), %xmm1
movapd %xmm1, %xmm2
addsd %xmm0, %xmm2
cmpeqsd 0x4368b(%rip), %xmm1    # 0xa2fb8
movapd %xmm1, %xmm3
andnpd %xmm2, %xmm3
andpd %xmm0, %xmm1
orpd %xmm3, %xmm1
movlpd %xmm1, (%rax,%rcx,8)
retq
movapd 0x426d5(%rip), %xmm1    # 0xa2020
xorpd %xmm0, %xmm1
movq 0xb8(%rdi), %rax
imull 0xc8(%rdi), %edx
addl %esi, %edx
movslq %edx, %rcx
movsd (%rax,%rcx,8), %xmm2
movapd %xmm2, %xmm3
subsd %xmm0, %xmm3
cmpeqsd 0x43640(%rip), %xmm2    # 0xa2fb8
movapd %xmm2, %xmm0
andnpd %xmm3, %xmm0
andpd %xmm1, %xmm2
orpd %xmm0, %xmm2
movlpd %xmm2, (%rax,%rcx,8)
retq
imull 0xc8(%rdi), %edx
movq 0xb8(%rdi), %rax
addl %esi, %edx
movslq %edx, %rcx
movsd %xmm0, (%rax,%rcx,8)
retq
leaq 0x47dc4(%rip), %rdi     # 0xa7772
xorl %eax, %eax
jmp 0x72942
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::RasterizeGridPoint(double, double, double, int)
void R2Grid::
RasterizeGridPoint(RNScalar x, RNScalar y, RNScalar value, int operation)
{
  // Check if within bounds
  if ((x < 0) || (x > grid_resolution[0]-1)) return;
  if ((y < 0) || (y > grid_resolution[1]-1)) return;

  // Bilinear interpolation
  int ix1 = (int) x;
  int iy1 = (int) y;
  int ix2 = ix1 + 1;
  int iy2 = iy1 + 1;
  if (ix2 >= grid_resolution[0]) ix2 = ix1;
  if (iy2 >= grid_resolution[1]) iy2 = iy1;
  RNScalar dx = x - ix1;
  RNScalar dy = y - iy1;
  RasterizeGridValue(ix1, iy1, value * (1.0-dx) * (1.0-dy), operation);
  RasterizeGridValue(ix1, iy2, value * (1.0-dx) * dy, operation);
  RasterizeGridValue(ix2, iy1, value * dx * (1.0-dy), operation);
  RasterizeGridValue(ix2, iy2, value * dx * dy, operation);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
xorpd %xmm3, %xmm3
ucomisd %xmm0, %xmm3
jbe 0x5f9dd
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
ucomisd %xmm1, %xmm3
ja 0x5f9ce
movq %rdi, %r14
movl 0xc0(%rdi), %eax
leal -0x1(%rax), %ecx
xorps %xmm3, %xmm3
cvtsi2sd %ecx, %xmm3
ucomisd %xmm3, %xmm0
ja 0x5f9ce
movl 0xc4(%r14), %ecx
leal -0x1(%rcx), %edx
xorps %xmm3, %xmm3
cvtsi2sd %edx, %xmm3
ucomisd %xmm3, %xmm1
ja 0x5f9ce
movl %esi, %ebx
cvttsd2si %xmm0, %r13d
cvttsd2si %xmm1, %r12d
leal 0x1(%r13), %ebp
leal 0x1(%r12), %r15d
cmpl %eax, %ebp
cmovgel %r13d, %ebp
cmpl %ecx, %r15d
cmovgel %r12d, %r15d
cvttpd2dq %xmm0, %xmm3
cvtdq2pd %xmm3, %xmm3
subsd %xmm3, %xmm0
movapd %xmm0, (%rsp)
cvttpd2dq %xmm1, %xmm3
cvtdq2pd %xmm3, %xmm3
subsd %xmm3, %xmm1
movapd %xmm1, 0x30(%rsp)
movsd 0x425d8(%rip), %xmm4    # 0xa2038
movapd %xmm4, %xmm3
subsd %xmm0, %xmm3
mulsd %xmm2, %xmm3
movsd %xmm3, 0x18(%rsp)
subsd %xmm1, %xmm4
movsd %xmm4, 0x28(%rsp)
movapd %xmm3, %xmm0
mulsd %xmm4, %xmm0
movq %r14, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %ebx, %ecx
movsd %xmm2, 0x20(%rsp)
callq 0x5f8c6
movsd 0x18(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
movq %r14, %rdi
movl %r13d, %esi
movl %r15d, %edx
movl %ebx, %ecx
callq 0x5f8c6
movapd (%rsp), %xmm1
mulsd 0x20(%rsp), %xmm1
movapd %xmm1, (%rsp)
movsd 0x28(%rsp), %xmm0
mulsd %xmm1, %xmm0
movq %r14, %rdi
movl %ebp, %esi
movl %r12d, %edx
movl %ebx, %ecx
callq 0x5f8c6
movapd (%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
movq %r14, %rdi
movl %ebp, %esi
movl %r15d, %edx
movl %ebx, %ecx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5f8c6
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::RasterizeGridSpan(gaps::R2Point const&, gaps::R2Point const&, double, double, int)
void R2Grid::
RasterizeGridSpan(const R2Point& p1, const R2Point& p2, RNScalar value1, RNScalar value2, int operation)
{
  // Splat value everywhere along span
  R2Vector vector = p2 - p1;
  RNLength length = vector.Length();
  int nsteps = length + 1;
  R2Vector dp = vector / nsteps;
  RNLength dv = (value2 - value1) / nsteps;
  for (int i = 0; i <= nsteps; i++) {
    RNScalar v = value1 + i*dv;
    gaps::R2Point p = p1 + i*dp;
    RasterizeGridPoint(p, v);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movsd %xmm1, (%rsp)
movsd %xmm0, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq %rdx, %rsi
movq %rbx, %rdx
callq 0x6906b
movq %r15, %rdi
callq 0x691fe
addsd 0x424ee(%rip), %xmm0    # 0xa2038
cvttsd2si %xmm0, %ebp
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
leaq 0x38(%rsp), %rdi
movq %r15, %rsi
movapd %xmm0, 0x10(%rsp)
callq 0x696f7
testl %ebp, %ebp
js 0x5fc00
movsd (%rsp), %xmm0
subsd 0x8(%rsp), %xmm0
divsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsp)
incl %ebp
xorpd %xmm0, %xmm0
leaq 0x48(%rsp), %r15
leaq 0x38(%rsp), %r12
leaq 0x28(%rsp), %r13
movsd %xmm0, 0x10(%rsp)
mulsd (%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movsd 0x10(%rsp), %xmm0
callq 0x694f6
movq %r13, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x69057
movsd 0x28(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movq %r14, %rdi
movsd 0x20(%rsp), %xmm2
xorl %esi, %esi
callq 0x5f9b6
movsd 0x10(%rsp), %xmm0
addsd 0x4243c(%rip), %xmm0    # 0xa2038
decl %ebp
jne 0x5fb9c
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::RasterizeGridSpan(int const*, int const*, double, double, int)
void R2Grid::
RasterizeGridSpan(const int p1[2], const int p2[2], RNScalar value1, RNScalar value2, int operation)
{
  // Resolve values
  if (value1 == R2_GRID_UNKNOWN_VALUE) return;
  if (value2 == R2_GRID_UNKNOWN_VALUE) return;

  // Get some convenient variables
  int d[2],p[2],dd[2],s[2];
  for (int i = 0; i < 2; i++) {
    d[i]= p2[i] - p1[i];
    if(d[i]<0){
      dd[i] = -d[i];
      s[i] = -1;
    }
    else{
      dd[i] = d[i];
      s[i] = 1;
    }
    p[i] = p1[i];
  }

  // Choose dimensions
  int i1=0;
  if(dd[1]>dd[i1]){i1=1;}
  int i2=(i1+1)%2;

  // Check span extent
  if(dd[i1]==0){
    // Span is a point - rasterize it
    RNScalar value = 0.5 * (value1 + value2);
    RasterizeGridValue(p[0], p[1], value, operation);
  }
  else {
    // Step along span
    int off[2] = { 0, 0 };
    RNScalar value = value1;
    RNScalar dvalue = (value2 - value1) / dd[i1];
    for (int i = 0; i <= dd[i1]; i++) {
      RasterizeGridValue(p[0], p[1], value, operation);
      off[i2]+=dd[i2];
      p[i1]+=s[i1];
      p[i2]+=s[i2]*off[i2]/dd[i1];
      off[i2]%=dd[i1];
      value += dvalue;
    }
  }
}

// Assembly:
ucomisd 0x433a0(%rip), %xmm0    # 0xa2fb8
jne 0x5fc20
jnp 0x5fd58
ucomisd 0x43390(%rip), %xmm1    # 0xa2fb8
jne 0x5fc30
jnp 0x5fd58
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %ebx
movq %rdi, %r14
xorl %eax, %eax
movl (%rdx,%rax,4), %ecx
movl (%rsi,%rax,4), %edi
subl %edi, %ecx
movl %ecx, %r8d
negl %r8d
cmovsl %ecx, %r8d
sarl $0x1f, %ecx
orl $0x1, %ecx
movl %r8d, 0x10(%rsp,%rax,4)
movl %ecx, 0x20(%rsp,%rax,4)
movl %edi, 0x8(%rsp,%rax,4)
incq %rax
cmpq $0x1, %rax
je 0x5fc45
movl 0x14(%rsp), %eax
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpl 0x10(%rsp), %eax
setle %al
setg %r12b
movl 0x10(%rsp,%r12,4), %ebp
testl %ebp, %ebp
je 0x5fd2c
movq $0x0, 0x18(%rsp)
js 0x5fd4a
subsd %xmm0, %xmm1
cvtsi2sd %ebp, %xmm2
divsd %xmm2, %xmm1
movb %al, %r15b
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
shll $0x2, %r15d
shll $0x2, %r12d
movsd %xmm1, 0x28(%rsp)
movsd %xmm0, 0x30(%rsp)
movl 0x8(%rsp), %esi
movl 0xc(%rsp), %edx
movq %r14, %rdi
movl %ebx, %ecx
callq 0x5f8c6
movsd 0x28(%rsp), %xmm1
movsd 0x30(%rsp), %xmm0
movl 0x18(%rsp,%r15), %ecx
movl 0x20(%rsp,%r12), %eax
addl %eax, 0x8(%rsp,%r12)
addl 0x10(%rsp,%r15), %ecx
movl 0x20(%rsp,%r15), %eax
movl %ecx, 0x18(%rsp,%r15)
imull %ecx, %eax
cltd
idivl %ebp
addl %eax, 0x8(%rsp,%r15)
movl %ecx, %eax
cltd
idivl %ebp
movl %edx, 0x18(%rsp,%r15)
addsd %xmm1, %xmm0
incl %r13d
cmpl %r13d, %ebp
jne 0x5fcc7
jmp 0x5fd4a
addsd %xmm1, %xmm0
mulsd 0x422f8(%rip), %xmm0    # 0xa2030
movl 0x8(%rsp), %esi
movl 0xc(%rsp), %edx
movq %r14, %rdi
movl %ebx, %ecx
callq 0x5f8c6
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::RasterizeGridBox(int const*, int const*, double, int)
void R2Grid::
RasterizeGridBox(const int p1[2], const int p2[2], RNScalar value, int operation)
{
  // Check value
  if (value == R2_GRID_UNKNOWN_VALUE) return;

  // Clip box
  int x1 = p1[0];
  if (x1 < 0) x1 = 0;
  if (x1 > XResolution()-1) return;
  int x2 = p2[0];
  if (x2 < 0) return;
  if (x2 > XResolution()-1) x2 = XResolution()-1;
  int y1 = p1[1];
  if (y1 < 0) y1 = 0;
  if (y1 > YResolution()-1) return;
  int y2 = p2[1];
  if (y2 < 0) return;
  if (y2 > YResolution()-1) y2 = YResolution()-1;

  // Rasterize box
  for (int ix = x1; ix <= x2; ix++) {
    for (int iy = y1; iy <= y2; iy++) {
      RasterizeGridValue(ix, iy, value, operation);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
ucomisd 0x43248(%rip), %xmm0    # 0xa2fb8
jne 0x5fd78
jnp 0x5fe26
movq %rdi, %r14
movl (%rsi), %eax
xorl %r15d, %r15d
testl %eax, %eax
cmovgl %eax, %r15d
movl 0xc0(%rdi), %eax
cmpl %eax, %r15d
jge 0x5fe26
movl %ecx, %ebx
movl (%rdx), %ecx
testl %ecx, %ecx
js 0x5fe26
leal -0x1(%rax), %edi
cmpl %eax, %ecx
cmovll %ecx, %edi
movl %edi, 0x4(%rsp)
movl 0x4(%rsi), %eax
xorl %r13d, %r13d
testl %eax, %eax
cmovgl %eax, %r13d
movl 0xc4(%r14), %eax
cmpl %eax, %r13d
jge 0x5fe26
movl 0x4(%rdx), %ecx
testl %ecx, %ecx
sets %dl
cmpl 0x4(%rsp), %r15d
setg %sil
orb %dl, %sil
jne 0x5fe26
leal -0x1(%rax), %edx
cmpl %eax, %ecx
cmovll %ecx, %edx
movq %rdx, 0x8(%rsp)
leal 0x1(%rdx), %r12d
movsd %xmm0, 0x10(%rsp)
movl %r13d, %ebp
cmpl 0x8(%rsp), %r13d
jg 0x5fe18
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
movsd 0x10(%rsp), %xmm0
movl %ebx, %ecx
callq 0x5f8c6
incl %ebp
cmpl %ebp, %r12d
jne 0x5fdfc
leal 0x1(%r15), %eax
cmpl 0x4(%rsp), %r15d
movl %eax, %r15d
jne 0x5fdf2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::CompareScanLineCrossings(void const*, void const*)
static int CompareScanLineCrossings(const void *data1, const void *data2)
{
  ScanLineCrossing *crossing1 = (ScanLineCrossing *) data1;
  ScanLineCrossing *crossing2 = (ScanLineCrossing *) data2;
  if (RNIsLess(crossing1->x, crossing2->x)) return -1;
  else if (RNIsGreater(crossing1->x, crossing2->x)) return 1;
  else if (crossing1->side < crossing2->side) return -1;
  else if (crossing1->side > crossing2->side) return 1;
  else return 0;
}

// Assembly:
movsd (%rdi), %xmm0
leaq 0x85564(%rip), %rax     # 0xe5b98
movsd (%rax), %xmm1
subsd (%rsi), %xmm0
movapd 0x419dc(%rip), %xmm2    # 0xa2020
xorpd %xmm1, %xmm2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
ucomisd %xmm0, %xmm2
ja 0x60671
movl $0x1, %eax
ucomisd %xmm1, %xmm0
ja 0x60671
movl 0x8(%rsi), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, 0x8(%rdi)
jl 0x60671
setg %al
movzbl %al, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::RasterizeWorldPolygon(gaps::R2Polygon const&, double, int)
void R2Grid::
RasterizeWorldPolygon(const R2Polygon& polygon, RNScalar value, int operation) 
{
  // Rasterize polygon into grid coordinates
  R2Polygon transformed_polygon(polygon);
  transformed_polygon.Transform(WorldToGridTransformation());
  RasterizeGridPolygon(transformed_polygon, value, operation);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movl %edx, %ebx
movsd %xmm0, (%rsp)
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x64230
leaq 0x58(%r14), %rsi
movq %r15, %rdi
callq 0x65c58
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
movsd (%rsp), %xmm0
movl %ebx, %edx
callq 0x6029c
leaq 0x8(%rsp), %rdi
callq 0x6451e
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6451e
movq %rbx, %rdi
callq 0xe7e0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Dot(gaps::R2Grid const&) const
RNScalar R2Grid::
Dot(const R2Grid& grid) const
{
  // Resolutions and transforms must be the same (for now)
  assert(grid_resolution[0] == grid.grid_resolution[0]);
  assert(grid_resolution[1] == grid.grid_resolution[1]);

  // Compute dot product between this and grid
  RNScalar dot = 0.0;
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] == R2_GRID_UNKNOWN_VALUE) continue;
    if (grid.grid_values[i] == R2_GRID_UNKNOWN_VALUE) continue;
    dot += grid_values[i] * grid.grid_values[i];
  }
  return dot;
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x6072f
movq 0xb8(%rdi), %rcx
movq 0xb8(%rsi), %rdx
xorpd %xmm0, %xmm0
xorl %esi, %esi
movsd 0x428b4(%rip), %xmm1    # 0xa2fb8
movsd (%rcx,%rsi,8), %xmm2
ucomisd %xmm1, %xmm2
jne 0x60711
jnp 0x60726
movsd (%rdx,%rsi,8), %xmm3
ucomisd %xmm1, %xmm3
jne 0x6071e
jnp 0x60726
mulsd %xmm3, %xmm2
addsd %xmm2, %xmm0
incq %rsi
cmpq %rsi, %rax
jne 0x60704
retq
xorps %xmm0, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::L1Distance(gaps::R2Grid const&) const
RNScalar R2Grid::
L1Distance(const R2Grid& grid) const
{
  // Compute distance between this and grid
  RNScalar distance = 0.0;
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] == R2_GRID_UNKNOWN_VALUE) continue;
    if (grid.grid_values[i] == R2_GRID_UNKNOWN_VALUE) continue;
    distance += fabs(grid_values[i] - grid.grid_values[i]);
  }
  return distance;
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x60d99
movq 0xb8(%rdi), %rcx
movq 0xb8(%rsi), %rdx
xorpd %xmm0, %xmm0
xorl %esi, %esi
movsd 0x42256(%rip), %xmm1    # 0xa2fb8
movapd 0x41506(%rip), %xmm2    # 0xa2270
movsd (%rcx,%rsi,8), %xmm3
ucomisd %xmm1, %xmm3
jne 0x60d77
jnp 0x60d90
movsd (%rdx,%rsi,8), %xmm4
ucomisd %xmm1, %xmm4
jne 0x60d84
jnp 0x60d90
subsd %xmm4, %xmm3
andpd %xmm2, %xmm3
addsd %xmm3, %xmm0
incq %rsi
cmpq %rsi, %rax
jne 0x60d6a
retq
xorps %xmm0, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::L2DistanceSquared(gaps::R2Grid const&) const
RNScalar R2Grid::
L2DistanceSquared(const R2Grid& grid) const
{
  // Compute distance between this and grid
  RNScalar distance_squared = 0.0;
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] == R2_GRID_UNKNOWN_VALUE) continue;
    if (grid.grid_values[i] == R2_GRID_UNKNOWN_VALUE) continue;
    RNScalar delta = (grid_values[i] - grid.grid_values[i]);
    distance_squared += delta * delta;
  }

  // Return result
  return distance_squared;
}

// Assembly:
movslq 0xcc(%rdi), %rax
testq %rax, %rax
jle 0x60df5
movq 0xb8(%rdi), %rcx
movq 0xb8(%rsi), %rdx
xorpd %xmm0, %xmm0
xorl %esi, %esi
movsd 0x421f2(%rip), %xmm1    # 0xa2fb8
movsd (%rcx,%rsi,8), %xmm2
ucomisd %xmm1, %xmm2
jne 0x60dd3
jnp 0x60dec
movsd (%rdx,%rsi,8), %xmm3
ucomisd %xmm1, %xmm3
jne 0x60de0
jnp 0x60dec
subsd %xmm3, %xmm2
mulsd %xmm2, %xmm2
addsd %xmm2, %xmm0
incq %rsi
cmpq %rsi, %rax
jne 0x60dc6
retq
xorps %xmm0, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Capture()
void R2Grid::
Capture(void)
{
  // Check image size
  GLint viewport[4];
  glGetIntegerv(GL_VIEWPORT, viewport);
  assert(grid_resolution[0] >= viewport[2]);
  assert(grid_resolution[1] >= viewport[3]);
  assert(grid_values);

  // Allocate pixels
  float *pixels = new float [ grid_size ];

  // Read pixels from frame buffer 
  glReadPixels(0, 0, grid_resolution[0], grid_resolution[1], GL_LUMINANCE, GL_FLOAT, pixels); 

  // Copy pixels
  for (int i = 0; i < grid_size; i++) grid_values[i] = pixels[i];

  // Delete pixels
  delete [] pixels;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %rsi
movl $0xba2, %edi            # imm = 0xBA2
callq 0xe400
movslq 0xcc(%rbx), %rax
leaq (,%rax,4), %rcx
testq %rax, %rax
movq $-0x1, %rdi
cmovnsq %rcx, %rdi
callq 0xe030
movq %rax, %r14
movl 0xc0(%rbx), %edx
movl 0xc4(%rbx), %ecx
movq %rax, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
movl $0x1909, %r8d           # imm = 0x1909
movl $0x1406, %r9d           # imm = 0x1406
callq 0xe200
movslq 0xcc(%rbx), %rax
testq %rax, %rax
jle 0x610be
movq 0xb8(%rbx), %rcx
xorl %edx, %edx
xorps %xmm0, %xmm0
cvtss2sd (%r14,%rdx,4), %xmm0
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x610a8
movq %r14, %rdi
callq 0xe5b0
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::DrawMesh() const
void R2Grid::
DrawMesh(void) const
{
  // Push transformation
  grid_to_world_transform.Push();

  // Draw triangle strip
  for (int j = 1; j < grid_resolution[1]; j++) {
    RNGrfxBegin(RN_GRFX_TRIANGLE_STRIP);
    for (int i = 0; i < grid_resolution[0]; i++) {
      R3LoadPoint((double) i, (double) j,     GridValue(i, j));
      R3LoadPoint((double) i, (double) (j-1), GridValue(i, j-1));
    }
    RNGrfxEnd();
  }

  // Pop transformation
  grid_to_world_transform.Pop();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x6ccb0
cmpl $0x2, 0xc4(%rbx)
jl 0x611b6
movl $0x1, %r14d
xorl %r15d, %r15d
movl $0x5, %edi
callq 0xe110
cmpl $0x0, 0xc0(%rbx)
jle 0x6119e
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd %xmm0, 0x8(%rsp)
leal -0x1(%r14), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, (%rsp)
movslq %r14d, %r12
movslq %r15d, %r13
xorl %ebp, %ebp
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0xb8(%rbx), %rax
movslq 0xc8(%rbx), %rcx
imulq %r12, %rcx
addq %rbp, %rcx
movsd (%rax,%rcx,8), %xmm2
movsd 0x8(%rsp), %xmm1
callq 0xe6d0
movq 0xb8(%rbx), %rax
movslq 0xc8(%rbx), %rcx
imulq %r13, %rcx
addq %rbp, %rcx
movsd (%rax,%rcx,8), %xmm2
movsd 0x10(%rsp), %xmm0
movsd (%rsp), %xmm1
callq 0xe6d0
incq %rbp
cmpl 0xc0(%rbx), %ebp
jl 0x61137
callq 0xe5d0
incl %r14d
incl %r15d
cmpl 0xc4(%rbx), %r14d
jl 0x610fa
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6ccd8