LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::GridCentroid() const
R2Point R2Grid::
GridCentroid(void) const
{
  // Compute weighted sum
  RNScalar total_value = 0;
  R2Point centroid(0,0);
  RNScalar *grid_valuesp = grid_values;
  for (int j = 0; j < grid_resolution[1]; j++) {
    for (int i = 0; i < grid_resolution[0]; i++) {
      R2Vector position(i, j);
      RNScalar value = *(grid_valuesp++);
      centroid += value * position;
      total_value += value;
    }
  }

  // Divide by total value
  if (total_value > 0) centroid /= total_value;

  // Return centroid
  return centroid;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, (%rsp)
movq %rdi, %rax
movq %rax, 0x8(%rsp)
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xc3140
movq 0x10(%rsp), %rax
movq 0xb8(%rax), %rax
movq %rax, 0x48(%rsp)
movl $0x0, 0x44(%rsp)
movq 0x10(%rsp), %rcx
movl 0x44(%rsp), %eax
cmpl 0xc4(%rcx), %eax
jge 0xa7d57
movl $0x0, 0x40(%rsp)
movq 0x10(%rsp), %rcx
movl 0x40(%rsp), %eax
cmpl 0xc0(%rcx), %eax
jge 0xa7d45
cvtsi2sdl 0x40(%rsp), %xmm0
cvtsi2sdl 0x44(%rsp), %xmm1
leaq 0x30(%rsp), %rdi
callq 0xc3c30
movq 0x48(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x48(%rsp)
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x28(%rsp), %xmm0
leaq 0x18(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xa5c30
movq (%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xc32f0
movsd 0x28(%rsp), %xmm0
addsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40(%rsp)
jmp 0xa7cbe
jmp 0xa7d47
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0xa7ca1
movsd 0x50(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xa7d75
movq (%rsp), %rdi
movsd 0x50(%rsp), %xmm0
callq 0xc3660
movq 0x8(%rsp), %rax
addq $0x68, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Abs()
void R2Grid::
Abs(void) 
{
  // Take absolute value of every grid value
  for (int i = 0; i < grid_size; i++) {
    RNScalar value = grid_values[i];
    if (value != R2_GRID_UNKNOWN_VALUE) grid_values[i] = fabs(value);
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0xc(%rsp)
movq -0x20(%rsp), %rcx
movl -0xc(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xa8802
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0xc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x18(%rsp)
movsd -0x18(%rsp), %xmm0
movsd 0x8b6ee(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xa87cc
jp 0xa87cc
jmp 0xa87f3
movq -0x20(%rsp), %rax
movsd -0x18(%rsp), %xmm0
movaps 0x8aa92(%rip), %xmm1    # 0x133270
pand %xmm1, %xmm0
movq 0xb8(%rax), %rax
movslq -0xc(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xa87f5
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0xa8787
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Sqrt()
void R2Grid::
Sqrt(void) 
{
  // Take sqrt of every grid value
  for (int i = 0; i < grid_size; i++) {
    RNScalar value = grid_values[i];
    if (value != R2_GRID_UNKNOWN_VALUE) grid_values[i] = sqrt(value);
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rcx
movl 0x1c(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xa88a0
movq 0x8(%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x1c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
movsd 0x8b64a(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xa8870
jp 0xa8870
jmp 0xa8891
movsd 0x10(%rsp), %xmm0
callq 0xf390
movq 0x8(%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x1c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xa8893
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xa882b
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Square()
void R2Grid::
Square(void) 
{
  // Square every grid value
  for (int i = 0; i < grid_size; i++) {
    RNScalar value = grid_values[i];
    if (value != R2_GRID_UNKNOWN_VALUE) grid_values[i] *= value;
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0xc(%rsp)
movq -0x20(%rsp), %rcx
movl -0xc(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xa893c
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0xc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x18(%rsp)
movsd -0x18(%rsp), %xmm0
movsd 0x8b5ae(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xa890c
jp 0xa890c
jmp 0xa892d
movq -0x20(%rsp), %rax
movsd -0x18(%rsp), %xmm0
movq 0xb8(%rax), %rax
movslq -0xc(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xa892f
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0xa88c7
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Negate()
void R2Grid::
Negate(void) 
{
  // Square every grid value
  for (int i = 0; i < grid_size; i++) {
    RNScalar value = grid_values[i];
    if (value != R2_GRID_UNKNOWN_VALUE) grid_values[i] = -value;
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0xc(%rsp)
movq -0x20(%rsp), %rcx
movl -0xc(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xa89e1
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0xc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x18(%rsp)
movsd -0x18(%rsp), %xmm0
movsd 0x8b51e(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xa899c
jp 0xa899c
jmp 0xa89cf
movq -0x20(%rsp), %rax
movsd -0x18(%rsp), %xmm0
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
movq 0xb8(%rax), %rax
movslq -0xc(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xa89d1
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0xa8957
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Invert()
void R2Grid::
Invert(void) 
{
  // Invert every grid value
  for (int i = 0; i < grid_size; i++) {
    RNScalar value = grid_values[i];
    if ((value != R2_GRID_UNKNOWN_VALUE) && (value != 0)) {
      grid_values[i] = 1.0 / value;
    }
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0xc(%rsp)
movq -0x20(%rsp), %rcx
movl -0xc(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xa8a95
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0xc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x18(%rsp)
movsd -0x18(%rsp), %xmm0
movsd 0x8b46e(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xa8a4c
jp 0xa8a4c
jmp 0xa8a83
movsd -0x18(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xa8a5f
jp 0xa8a5f
jmp 0xa8a83
movq -0x20(%rsp), %rax
movsd 0x8a59c(%rip), %xmm0    # 0x133008
divsd -0x18(%rsp), %xmm0
movq 0xb8(%rax), %rax
movslq -0xc(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xa8a85
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0xa8a07
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Transpose()
void R2Grid::
Transpose(void)
{
  // Transpose values
  R2Grid copy(*this);
  int xres = XResolution();
  int yres = YResolution();
  for (int iy = 0; iy < yres; iy++) {
    for (int ix = 0; ix < xres; ix++) {
      RNScalar value = copy.GridValue(xres-1 - ix, yres-1 - iy);
      SetGridValue(ix, iy, value);
    }
  }
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %rdi, 0x120(%rsp)
movq 0x120(%rsp), %rsi
movq %rsi, 0x18(%rsp)
leaq 0x50(%rsp), %rdi
callq 0xa73a0
movq 0x18(%rsp), %rdi
callq 0xb9260
movl %eax, 0x24(%rsp)
jmp 0xa8ad6
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %eax
movl %eax, 0x4c(%rsp)
callq 0xb9280
movl %eax, 0x14(%rsp)
jmp 0xa8aee
movl 0x14(%rsp), %eax
movl %eax, 0x38(%rsp)
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x38(%rsp), %eax
jge 0xa8ba9
movl $0x0, 0x30(%rsp)
movl 0x30(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jge 0xa8b97
movl 0x4c(%rsp), %eax
movl 0x30(%rsp), %esi
notl %esi
addl %eax, %esi
movl 0x38(%rsp), %eax
movl 0x34(%rsp), %edx
notl %edx
addl %eax, %edx
leaq 0x50(%rsp), %rdi
callq 0xb92a0
movsd %xmm0, 0x8(%rsp)
jmp 0xa8b48
movq 0x18(%rsp), %rdi
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movl 0x30(%rsp), %esi
movl 0x34(%rsp), %edx
movsd 0x28(%rsp), %xmm0
callq 0x6bc00
jmp 0xa8b6e
jmp 0xa8b70
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0xa8b14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
leaq 0x50(%rsp), %rdi
callq 0xa7690
jmp 0xa8bbb
jmp 0xa8b99
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0xa8afe
leaq 0x50(%rsp), %rdi
callq 0xa7690
addq $0x128, %rsp            # imm = 0x128
retq
movq 0x40(%rsp), %rdi
callq 0xf890
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Clear(double)
void R2Grid::
Clear(RNScalar value) 
{
  // Set all grid values to value
  for (int i = 0; i < grid_size; i++) {
    if (grid_values[i] == R2_GRID_UNKNOWN_VALUE) continue;
    grid_values[i] = value;
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movsd %xmm0, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x20(%rsp), %rcx
movl -0x14(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xa9d9f
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x8a144(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xa9d76
jp 0xa9d76
jmp 0xa9d92
movq -0x20(%rsp), %rax
movsd -0x10(%rsp), %xmm0
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0xa9d3d
retq
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::R2Grid::Dilate(double)
void R2Grid::
Dilate(RNLength grid_distance) 
{
  // Make copy so that can restore unknown values
  R2Grid copy(*this);

  // Set pixels (to one) within grid_distance from some non-zero pixel
  SquaredDistanceTransform();
  Threshold(grid_distance * grid_distance, 1, 0);

  // 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:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movsd %xmm0, 0xe8(%rsp)
movq 0xf0(%rsp), %rsi
movq %rsi, (%rsp)
leaq 0x18(%rsp), %rdi
callq 0xa73a0
movq (%rsp), %rdi
callq 0xa9ea0
jmp 0xa9dd9
movq (%rsp), %rdi
movsd 0xe8(%rsp), %xmm0
mulsd %xmm0, %xmm0
movsd 0x89216(%rip), %xmm1    # 0x133008
xorps %xmm2, %xmm2
callq 0xaa580
jmp 0xa9dfc
movl $0x0, 0x8(%rsp)
movq (%rsp), %rcx
movl 0x8(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xa9e7e
movq 0xd0(%rsp), %rax
movslq 0x8(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x8a082(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xa9e6f
jp 0xa9e6f
movq (%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x8(%rsp), %rcx
movsd 0x8a062(%rip), %xmm0    # 0x133eb0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xa9e6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x10(%rsp)
movl %eax, 0xc(%rsp)
leaq 0x18(%rsp), %rdi
callq 0xa7690
jmp 0xa9e90
jmp 0xa9e71
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xa9e04
leaq 0x18(%rsp), %rdi
callq 0xa7690
addq $0xf8, %rsp
retq
movq 0x10(%rsp), %rdi
callq 0xf890
nopw (%rax,%rax)
// File: 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:
movq %rdi, -0x8(%rsp)
movsd %xmm0, -0x10(%rsp)
movsd %xmm1, -0x18(%rsp)
movsd %xmm2, -0x20(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x30(%rsp)
movl $0x0, -0x24(%rsp)
movq -0x30(%rsp), %rcx
movl -0x24(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xaa68b
movq -0x30(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x24(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x898d4(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xaa5e9
jp 0xaa5e9
jmp 0xaa679
movq -0x30(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x24(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0x10(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xaa641
movsd -0x18(%rsp), %xmm0
movsd 0x8986f(%rip), %xmm1    # 0x133e88
ucomisd %xmm1, %xmm0
jne 0xaa623
jp 0xaa623
jmp 0xaa63f
movq -0x30(%rsp), %rax
movsd -0x18(%rsp), %xmm0
movq 0xb8(%rax), %rax
movslq -0x24(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaa677
movsd -0x20(%rsp), %xmm0
movsd 0x89839(%rip), %xmm1    # 0x133e88
ucomisd %xmm1, %xmm0
jne 0xaa659
jp 0xaa659
jmp 0xaa675
movq -0x30(%rsp), %rax
movsd -0x20(%rsp), %xmm0
movq 0xb8(%rax), %rax
movslq -0x24(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaa677
jmp 0xaa679
jmp 0xaa67b
movl -0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rsp)
jmp 0xaa5a9
retq
nopl (%rax)
// File: 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:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movsd %xmm0, 0xe8(%rsp)
movq 0xf0(%rsp), %rsi
movq %rsi, (%rsp)
leaq 0x18(%rsp), %rdi
callq 0xa73a0
movq (%rsp), %rdi
movsd 0x897b6(%rip), %xmm0    # 0x133e80
movsd 0x88936(%rip), %xmm1    # 0x133008
xorps %xmm2, %xmm2
callq 0xaa580
jmp 0xaa6dc
movq (%rsp), %rdi
callq 0xa9ea0
jmp 0xaa6e7
movq (%rsp), %rdi
movsd 0xe8(%rsp), %xmm0
mulsd %xmm0, %xmm0
xorps %xmm1, %xmm1
movsd 0x88905(%rip), %xmm2    # 0x133008
callq 0xaa580
jmp 0xaa70a
movl $0x0, 0x8(%rsp)
movq (%rsp), %rcx
movl 0x8(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xaa78c
movq 0xd0(%rsp), %rax
movslq 0x8(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x89774(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xaa77d
jp 0xaa77d
movq (%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x8(%rsp), %rcx
movsd 0x89754(%rip), %xmm0    # 0x133eb0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaa77d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x10(%rsp)
movl %eax, 0xc(%rsp)
leaq 0x18(%rsp), %rdi
callq 0xa7690
jmp 0xaa79e
jmp 0xaa77f
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xaa712
leaq 0x18(%rsp), %rdi
callq 0xa7690
addq $0xf8, %rsp
retq
movq 0x10(%rsp), %rdi
callq 0xf890
nopl (%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movsd %xmm0, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
movsd 0x38(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xab7af
jp 0xab7af
jmp 0xab8dc
movl $0x0, 0x34(%rsp)
movq 0x8(%rsp), %rcx
movl 0x34(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xab8dc
movq 0x8(%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x34(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x886c6(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xab7f7
jp 0xab7f7
jmp 0xab8cc
callq 0xd4710
movsd %xmm0, 0x28(%rsp)
callq 0xd4710
movq 0x8(%rsp), %rax
movsd 0x87804(%rip), %xmm3    # 0x133018
movsd 0x877ec(%rip), %xmm2    # 0x133008
movsd 0x877ec(%rip), %xmm1    # 0x133010
cmpltsd %xmm1, %xmm0
movaps %xmm0, %xmm1
andpd %xmm3, %xmm1
andnpd %xmm2, %xmm0
orpd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x38(%rsp), %xmm0
movq 0xb8(%rax), %rax
movslq 0x34(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x879f2(%rip), %xmm0    # 0x133260
mulsd 0x28(%rsp), %xmm0
mulsd 0x28(%rsp), %xmm0
callq 0xf8c0
movq 0x8(%rsp), %rax
movaps %xmm0, %xmm2
movsd (%rsp), %xmm0
movsd 0x87774(%rip), %xmm1    # 0x133008
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x20(%rsp), %xmm0
movsd 0x10(%rsp), %xmm2
movq 0xb8(%rax), %rax
movslq 0x34(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0xab7b7
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::RNCompareScalarPtrs(void const*, void const*)
static int 
RNCompareScalarPtrs(const void *value1, const void *value2)
{
  const RNScalar **scalar1pp = (const RNScalar **) value1;
  const RNScalar **scalar2pp = (const RNScalar **) value2;
  const RNScalar *scalar1p = *scalar1pp;
  const RNScalar *scalar2p = *scalar2pp;
  if (*scalar1p < *scalar2p) return -1;
  else if (*scalar1p > *scalar2p) return 1;
  else return 0;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x20(%rsp)
movq -0x18(%rsp), %rax
movq %rax, -0x28(%rsp)
movq -0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rsp)
movq -0x28(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rsp)
movq -0x30(%rsp), %rax
movsd (%rax), %xmm1
movq -0x38(%rsp), %rax
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xac86a
movl $0xffffffff, -0x4(%rsp) # imm = 0xFFFFFFFF
jmp 0xac890
movq -0x30(%rsp), %rax
movsd (%rax), %xmm0
movq -0x38(%rsp), %rax
ucomisd (%rax), %xmm0
jbe 0xac888
movl $0x1, -0x4(%rsp)
jmp 0xac890
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R2Shapes/R2Grid.cpp
// Function: gaps::IsLocalExtremum(gaps::R2Grid const&, int, int, int)
static RNBoolean
IsLocalExtremum(const R2Grid& grid, int ix, int iy, RNBoolean maximum)
{
  // Check if local minimum
  RNScalar value = grid.GridValue(ix, iy);
  for (int s = -1; s <= 1; s++) {
    int i = ix + s;
    if ((i < 0) || (i >= grid.XResolution())) continue;
    for (int t = -1; t <= 1; t++) {
      if ((s == 0) && (t == 0)) continue;
      int j = iy + t;
      if ((j < 0) || (j >= grid.YResolution())) continue;
      RNScalar neighbor_value = grid.GridValue(i, j);
      if (!maximum && (neighbor_value < value)) return FALSE;
      if (maximum && (neighbor_value > value)) return FALSE;
    }
  }

  // Passed all tests
  return TRUE;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movl %esi, 0x34(%rsp)
movl %edx, 0x30(%rsp)
movl %ecx, 0x2c(%rsp)
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %esi
movl 0x30(%rsp), %edx
callq 0xb92a0
movsd %xmm0, 0x20(%rsp)
movl $0xffffffff, 0x1c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x1, 0x1c(%rsp)
jg 0xac9e7
movl 0x34(%rsp), %eax
addl 0x1c(%rsp), %eax
movl %eax, 0x18(%rsp)
cmpl $0x0, 0x18(%rsp)
jl 0xac90f
movl 0x18(%rsp), %eax
movl %eax, 0x4(%rsp)
movq 0x38(%rsp), %rdi
callq 0xb9260
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jl 0xac914
jmp 0xac9d7
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
cmpl $0x1, 0x14(%rsp)
jg 0xac9d5
cmpl $0x0, 0x1c(%rsp)
jne 0xac93a
cmpl $0x0, 0x14(%rsp)
jne 0xac93a
jmp 0xac9c5
movl 0x30(%rsp), %eax
addl 0x14(%rsp), %eax
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x10(%rsp)
jl 0xac967
movl 0x10(%rsp), %eax
movl %eax, (%rsp)
movq 0x38(%rsp), %rdi
callq 0xb9280
movl %eax, %ecx
movl (%rsp), %eax
cmpl %ecx, %eax
jl 0xac969
jmp 0xac9c5
movq 0x38(%rsp), %rdi
movl 0x18(%rsp), %esi
movl 0x10(%rsp), %edx
callq 0xb92a0
movsd %xmm0, 0x8(%rsp)
cmpl $0x0, 0x2c(%rsp)
jne 0xac9a4
movsd 0x8(%rsp), %xmm1
movsd 0x20(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xac9a4
movl $0x0, 0x44(%rsp)
jmp 0xac9ef
cmpl $0x0, 0x2c(%rsp)
je 0xac9c3
movsd 0x8(%rsp), %xmm0
ucomisd 0x20(%rsp), %xmm0
jbe 0xac9c3
movl $0x0, 0x44(%rsp)
jmp 0xac9ef
jmp 0xac9c5
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0xac91c
jmp 0xac9d7
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xac8d5
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: 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 $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movl %esi, 0xac(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x60(%rsp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0xf280
movsd 0x88434(%rip), %xmm0    # 0x135950
movsd %xmm0, 0x60(%rsp)
movsd 0x8841e(%rip), %xmm0    # 0x135948
movsd %xmm0, 0x70(%rsp)
movsd 0x85d28(%rip), %xmm0    # 0x133260
movsd %xmm0, 0x78(%rsp)
movsd 0x85aca(%rip), %xmm0    # 0x133010
movsd %xmm0, 0x88(%rsp)
movsd 0x883f9(%rip), %xmm0    # 0x135950
movsd %xmm0, 0x90(%rsp)
movsd 0x883e0(%rip), %xmm0    # 0x135948
movsd %xmm0, 0xa0(%rsp)
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0xf280
movsd 0x883c6(%rip), %xmm0    # 0x135950
movsd %xmm0, 0x10(%rsp)
movsd 0x85cc8(%rip), %xmm0    # 0x133260
movsd %xmm0, 0x18(%rsp)
movsd 0x883aa(%rip), %xmm0    # 0x135950
movsd %xmm0, 0x20(%rsp)
movsd 0x88394(%rip), %xmm0    # 0x135948
movsd %xmm0, 0x40(%rsp)
movsd 0x85a4e(%rip), %xmm0    # 0x133010
movsd %xmm0, 0x48(%rsp)
movsd 0x88378(%rip), %xmm0    # 0x135948
movsd %xmm0, 0x50(%rsp)
cmpl $0x0, 0xac(%rsp)
jne 0xad5f1
movq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xad130
jmp 0xad61c
cmpl $0x1, 0xac(%rsp)
jne 0xad60c
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xad130
jmp 0xad61a
leaq 0x86c83(%rip), %rdi     # 0x134296
movb $0x0, %al
callq 0xd4e20
jmp 0xad61c
addq $0xb8, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, 0x1f0(%rsp)
movq 0x1f0(%rsp), %rsi
movq %rsi, 0x18(%rsp)
leaq 0x120(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xa73a0
movq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0xad4e0
jmp 0xad6ac
movq 0x18(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0xa73a0
jmp 0xad6bd
leaq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0xad4e0
jmp 0xad6ce
movl $0x0, 0x3c(%rsp)
movq 0x18(%rsp), %rcx
movl 0x3c(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xad873
movq 0x18(%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x3c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x867a7(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xad752
jp 0xad752
jmp 0xad863
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
jmp 0xad892
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xa7690
jmp 0xad892
movl 0x3c(%rsp), %esi
leaq 0x120(%rsp), %rdi
callq 0xb94c0
movsd %xmm0, 0x10(%rsp)
jmp 0xad76b
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x30(%rsp), %xmm0
movsd 0x8672b(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xad7b0
jp 0xad7b0
movq 0x18(%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x3c(%rsp), %rcx
movsd 0x8670a(%rip), %xmm0    # 0x133eb0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xad863
movl 0x3c(%rsp), %esi
leaq 0x40(%rsp), %rdi
callq 0xb94c0
movsd %xmm0, 0x8(%rsp)
jmp 0xad7c6
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x28(%rsp), %xmm0
movsd 0x866d0(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xad808
jp 0xad808
movq 0x18(%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x3c(%rsp), %rcx
movsd 0x866af(%rip), %xmm0    # 0x133eb0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xad863
movsd 0x30(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xad83c
jp 0xad83c
movq 0x18(%rsp), %rax
leaq 0x890c3(%rip), %rcx     # 0x1368e8
movsd (%rcx), %xmm0
movq 0xb8(%rax), %rax
movslq 0x3c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xad863
movsd 0x28(%rsp), %xmm0
divsd 0x30(%rsp), %xmm0
callq 0xf3e0
movq 0x18(%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x3c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0xad6d6
leaq 0x40(%rsp), %rdi
callq 0xa7690
leaq 0x120(%rsp), %rdi
callq 0xa7690
addq $0x1f8, %rsp            # imm = 0x1F8
retq
leaq 0x120(%rsp), %rdi
callq 0xa7690
movq 0x118(%rsp), %rdi
callq 0xf890
nopl (%rax)
// File: 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:
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, 0x1f0(%rsp)
movq 0x1f0(%rsp), %rsi
movq %rsi, 0x18(%rsp)
leaq 0x120(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xa73a0
movq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0xad4e0
jmp 0xad8ec
movq 0x18(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0xa73a0
jmp 0xad8fd
leaq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0xad4e0
jmp 0xad90e
movl $0x0, 0x3c(%rsp)
movq 0x18(%rsp), %rcx
movl 0x3c(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xada93
movq 0x18(%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x3c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x86567(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xad992
jp 0xad992
jmp 0xada83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
jmp 0xadab2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xa7690
jmp 0xadab2
movl 0x3c(%rsp), %esi
leaq 0x120(%rsp), %rdi
callq 0xb94c0
movsd %xmm0, 0x10(%rsp)
jmp 0xad9ab
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x30(%rsp), %xmm0
movsd 0x864eb(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xad9f0
jp 0xad9f0
movq 0x18(%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x3c(%rsp), %rcx
movsd 0x864ca(%rip), %xmm0    # 0x133eb0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xada83
movl 0x3c(%rsp), %esi
leaq 0x40(%rsp), %rdi
callq 0xb94c0
movsd %xmm0, 0x8(%rsp)
jmp 0xada06
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x28(%rsp), %xmm0
movsd 0x86490(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xada48
jp 0xada48
movq 0x18(%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x3c(%rsp), %rcx
movsd 0x8646f(%rip), %xmm0    # 0x133eb0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xada83
movsd 0x30(%rsp), %xmm0
movsd 0x30(%rsp), %xmm2
movsd 0x28(%rsp), %xmm1
mulsd 0x28(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0xf390
movq 0x18(%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x3c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0xad916
leaq 0x40(%rsp), %rdi
callq 0xa7690
leaq 0x120(%rsp), %rdi
callq 0xa7690
addq $0x1f8, %rsp            # imm = 0x1F8
retq
leaq 0x120(%rsp), %rdi
callq 0xa7690
movq 0x118(%rsp), %rdi
callq 0xf890
nopl (%rax)
// File: 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:
movq %rdi, -0x8(%rsp)
movsd %xmm0, -0x10(%rsp)
movsd %xmm1, -0x18(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x28(%rsp)
movl $0x0, -0x1c(%rsp)
movq -0x28(%rsp), %rcx
movl -0x1c(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xae4cf
movq -0x28(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x1c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd -0x10(%rsp), %xmm0
jne 0xae4c0
jp 0xae4c0
movq -0x28(%rsp), %rax
movsd -0x18(%rsp), %xmm0
movq 0xb8(%rax), %rax
movslq -0x1c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xae4c2
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0xae473
retq
// File: 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:
movq %rdi, -0x8(%rsp)
movsd %xmm0, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x20(%rsp), %rcx
movl -0x14(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xae556
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x85994(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xae526
jp 0xae526
jmp 0xae547
movq -0x20(%rsp), %rax
movsd -0x10(%rsp), %xmm0
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xae549
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0xae4ed
retq
nopw (%rax,%rax)
// File: 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:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x20(%rsp), %rcx
movl -0x14(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xae644
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x85901(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xae5b9
jp 0xae5b9
jmp 0xae632
movq -0x10(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x858d9(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xae5ff
jp 0xae5ff
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd 0x858b8(%rip), %xmm0    # 0x133eb0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xae630
movq -0x20(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0xb8(%rcx), %rcx
movslq -0x14(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xae632
jmp 0xae634
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0xae57c
retq
nopw %cs:(%rax,%rax)
// File: 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:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x20(%rsp), %rcx
movl -0x14(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xae778
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x857d1(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xae6e9
jp 0xae6e9
jmp 0xae766
movq -0x10(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x857a9(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xae72f
jp 0xae72f
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd 0x85788(%rip), %xmm0    # 0x133eb0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xae764
movq -0x20(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0xb8(%rcx), %rcx
movslq -0x14(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm1
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xae766
jmp 0xae768
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0xae6ac
retq
nopl (%rax)
// File: 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:
movq %rdi, -0x8(%rsp)
movsd %xmm0, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x20(%rsp), %rcx
movl -0x14(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xae806
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x856e4(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xae7d6
jp 0xae7d6
jmp 0xae7f7
movq -0x20(%rsp), %rax
movsd -0x10(%rsp), %xmm0
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xae7f9
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0xae79d
retq
nopw (%rax,%rax)
// File: 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:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x20(%rsp), %rcx
movl -0x14(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xae8f4
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x85651(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xae869
jp 0xae869
jmp 0xae8e2
movq -0x10(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x85629(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xae8af
jp 0xae8af
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd 0x85608(%rip), %xmm0    # 0x133eb0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xae8e0
movq -0x20(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0xb8(%rcx), %rcx
movslq -0x14(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xae8e2
jmp 0xae8e4
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0xae82c
retq
nopw %cs:(%rax,%rax)
// File: 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:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x20(%rsp), %rcx
movl -0x14(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xaeab2
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x85561(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xae95c
jp 0xae95c
jmp 0xaeaa0
movq -0x10(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x85536(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xae9a5
jp 0xae9a5
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd 0x85515(%rip), %xmm0    # 0x133eb0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaea9e
movq -0x10(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xaea67
jp 0xaea67
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xaea10
movq -0x20(%rsp), %rax
leaq 0xc9af7(%rip), %rcx     # 0x1784f0
movsd (%rcx), %xmm0
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaea65
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
xorps %xmm0, %xmm0
ucomisd (%rax,%rcx,8), %xmm0
jbe 0xaea63
movq -0x20(%rsp), %rax
leaq 0xc9ab9(%rip), %rcx     # 0x1784f0
movsd (%rcx), %xmm0
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaea65
jmp 0xaea9c
movq -0x20(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0xb8(%rcx), %rcx
movslq -0x14(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm1
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaea9e
jmp 0xaeaa0
jmp 0xaeaa2
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0xae91c
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movsd %xmm0, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movl $0x0, 0x14(%rsp)
movq (%rsp), %rcx
movl 0x14(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xaeb58
movq (%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
movsd 0x85397(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xaeb23
jp 0xaeb23
jmp 0xaeb49
movsd 0x8(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0xf880
movq (%rsp), %rax
movq 0xb8(%rax), %rax
movslq 0x14(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaeb4b
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0xaeae0
addq $0x28, %rsp
retq
nopl (%rax)
// File: 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:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x20(%rsp), %rcx
movl -0x14(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xaec25
movq -0x10(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xaebcd
jp 0xaebcd
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaec13
movq -0x10(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x852c5(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xaec11
jp 0xaec11
movq -0x20(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd 0x852a4(%rip), %xmm0    # 0x133eb0
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaec13
jmp 0xaec15
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0xaeb7c
retq
nopw %cs:(%rax,%rax)
// File: 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:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x20(%rsp), %rcx
movl -0x14(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xaece8
movq -0x10(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xaec84
jp 0xaec84
jmp 0xaecd8
movq -0x10(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x8520e(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xaecac
jp 0xaecac
jmp 0xaecd8
movq -0x20(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0xb8(%rcx), %rcx
movslq -0x14(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0xb8(%rax), %rax
movslq -0x14(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0xaec4c
retq
nopl (%rax)
// File: 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:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movsd %xmm0, -0x18(%rsp)
movsd %xmm1, -0x20(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x30(%rsp)
movl $0x0, -0x24(%rsp)
movq -0x30(%rsp), %rcx
movl -0x24(%rsp), %eax
cmpl 0xcc(%rcx), %eax
jge 0xaeec1
movq -0x30(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x24(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x85165(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xaed58
jp 0xaed58
jmp 0xaeeaf
movq -0x10(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x24(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x8513a(%rip), %xmm1    # 0x133eb0
ucomisd %xmm1, %xmm0
jne 0xaed83
jp 0xaed83
jmp 0xaeeaf
movq -0x30(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x24(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x10(%rsp), %rax
movq 0xb8(%rax), %rax
movslq -0x24(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jb 0xaee31
movsd -0x18(%rsp), %xmm0
movsd 0x86ead(%rip), %xmm1    # 0x135c70
ucomisd %xmm1, %xmm0
jne 0xaedf9
jp 0xaedf9
movq -0x30(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0xb8(%rcx), %rcx
movslq -0x24(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0xb8(%rax), %rax
movslq -0x24(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaee2f
movsd -0x18(%rsp), %xmm0
movsd 0x85081(%rip), %xmm1    # 0x133e88
ucomisd %xmm1, %xmm0
jne 0xaee11
jp 0xaee11
jmp 0xaee2d
movq -0x30(%rsp), %rax
movsd -0x18(%rsp), %xmm0
movq 0xb8(%rax), %rax
movslq -0x24(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaee2f
jmp 0xaeead
movsd -0x20(%rsp), %xmm0
movsd 0x86e31(%rip), %xmm1    # 0x135c70
ucomisd %xmm1, %xmm0
jne 0xaee75
jp 0xaee75
movq -0x30(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0xb8(%rcx), %rcx
movslq -0x24(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0xb8(%rax), %rax
movslq -0x24(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaeeab
movsd -0x20(%rsp), %xmm0
movsd 0x85005(%rip), %xmm1    # 0x133e88
ucomisd %xmm1, %xmm0
jne 0xaee8d
jp 0xaee8d
jmp 0xaeea9
movq -0x30(%rsp), %rax
movsd -0x20(%rsp), %xmm0
movq 0xb8(%rax), %rax
movslq -0x24(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xaeeab
jmp 0xaeead
jmp 0xaeeaf
jmp 0xaeeb1
movl -0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rsp)
jmp 0xaed18
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0x100(%rsp)
movq 0x100(%rsp), %rsi
movq %rsi, 0x18(%rsp)
leaq 0x30(%rsp), %rdi
callq 0xa73a0
movq 0x18(%rsp), %rdi
callq 0xa9ea0
jmp 0xaef02
movq 0x18(%rsp), %rdi
callq 0xa8810
leaq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movsd 0x840ea(%rip), %xmm1    # 0x133008
movsd %xmm1, 0x8(%rsp)
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
callq 0xaa580
movsd 0x8(%rsp), %xmm1
movq 0x10(%rsp), %rdi
movsd 0x84f6e(%rip), %xmm0    # 0x133eb0
callq 0xae450
movq 0x10(%rsp), %rdi
callq 0xa9ea0
jmp 0xaef53
leaq 0x30(%rsp), %rdi
callq 0xa8810
movq 0x18(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xae690
leaq 0x30(%rsp), %rdi
callq 0xa7690
addq $0x108, %rsp            # imm = 0x108
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x30(%rsp), %rdi
callq 0xa7690
movq 0x28(%rsp), %rdi
callq 0xf890