LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::Centroid() const
R3Point R3PointSet::
Centroid(void) const
{
  // Check if no points
  if (positions.size() == 0) return R3zero_point;

  // Return centroid of point set
  R3Point centroid = R3zero_point;
  for (unsigned int i = 0; i < positions.size(); i++) 
    centroid += positions[i];
  centroid /= positions.size();
  return centroid;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x8(%rsp)
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x32410
cmpq $0x0, %rax
jne 0xdcc36
movq 0x8(%rsp), %rdi
leaq 0x15c4d4(%rip), %rsi    # 0x239100
callq 0xd9f80
jmp 0xdccd2
movq 0x8(%rsp), %rdi
leaq 0x15c4be(%rip), %rsi    # 0x239100
callq 0xd9f80
movl $0x0, 0x24(%rsp)
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %eax
movq %rax, (%rsp)
callq 0x32410
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
jae 0xdcc97
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %eax
movl %eax, %esi
callq 0x35a10
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xdac10
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0xdcc4f
movq 0x18(%rsp), %rdi
callq 0x32410
movq 0x8(%rsp), %rdi
movq %rax, %xmm0
movaps 0xe139e(%rip), %xmm1    # 0x1be050
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xe13a2(%rip), %xmm1    # 0x1be060
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
callq 0xdad50
movq 0x10(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::FindPointIndex(gaps::R3Point const&, double) const
int R3PointSet::
FindPointIndex(const R3Point& point, double tolerance) const
{
  // Return first point within tolerance
  double squared_tolerance = tolerance * tolerance;
  for (unsigned int i = 0; i < positions.size(); i++) {
    if (R3SquaredDistance(positions[i], point) <= squared_tolerance) {
      return i;
    }
  }

  // No point found
  return -1;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movsd %xmm0, 0x28(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movsd 0x28(%rsp), %xmm0
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %eax
movq %rax, 0x8(%rsp)
callq 0x32410
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0xdcd7d
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, %esi
callq 0x35a10
movq %rax, %rdi
movq 0x30(%rsp), %rsi
callq 0x81720
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xdcd6e
movl 0x1c(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xdcd85
jmp 0xdcd70
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xdcd18
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::SetPointPosition(int, gaps::R3Point const&)
void R3PointSet::
SetPointPosition(int index, const R3Point& position)
{
  // Set position for point with given index
  while (index >= (int) positions.size())
    positions.push_back(R3zero_point);
  positions[index] = position;
  bbox.Union(position);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0x14(%rsp)
callq 0x32410
movq %rax, %rcx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jl 0xdd2ec
movq 0x18(%rsp), %rdi
leaq 0x15be1b(%rip), %rsi    # 0x239100
callq 0xb0bc0
jmp 0xdd2bc
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movslq 0x2c(%rsp), %rsi
callq 0xb0c30
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0xda5d0
movq 0x18(%rsp), %rdi
addq $0x118, %rdi            # imm = 0x118
movq 0x20(%rsp), %rsi
callq 0xc6600
addq $0x38, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::SetPointNormal(int, gaps::R3Vector const&)
void R3PointSet::
SetPointNormal(int index, const R3Vector& normal)
{
  // Set normal for point with given index
  while (index >= (int) normals.size())
    normals.push_back(R3zero_vector);
  normals[index] = normal;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0x14(%rsp)
addq $0x18, %rdi
callq 0xdfb90
movq %rax, %rcx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jl 0xdd384
movq 0x18(%rsp), %rdi
addq $0x18, %rdi
leaq 0x15be73(%rip), %rsi    # 0x2391f0
callq 0xe0040
jmp 0xdd34c
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x18, %rdi
movslq 0x2c(%rsp), %rsi
callq 0xe00b0
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0xdbd60
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::SetPointTangent(int, gaps::R3Vector const&)
void R3PointSet::
SetPointTangent(int index, const R3Vector& tangent)
{
  // Set tangent for point with given index
  while (index >= (int) tangents.size())
    tangents.push_back(R3zero_vector);
  tangents[index] = tangent;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0x14(%rsp)
addq $0x30, %rdi
callq 0xdfb90
movq %rax, %rcx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jl 0xdd414
movq 0x18(%rsp), %rdi
addq $0x30, %rdi
leaq 0x15bde3(%rip), %rsi    # 0x2391f0
callq 0xe0040
jmp 0xdd3dc
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x30, %rdi
movslq 0x2c(%rsp), %rsi
callq 0xe00b0
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0xdbd60
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::SetPointRadius(int, int, double)
void R3PointSet::
SetPointRadius(int index, int axis, RNLength radius)
{
  // Set radius for point with given index
  while (index >= (int) radii[axis].size())
    radii[axis].push_back(0);
  radii[axis][index] = radius;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movl %edx, 0x28(%rsp)
movsd %xmm0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%rsp)
addq $0x48, %rdi
movslq 0x28(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0xdfe10
movq %rax, %rcx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jl 0xdd4c8
movq 0x10(%rsp), %rdi
addq $0x48, %rdi
movslq 0x28(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x18(%rsp), %rsi
callq 0xe00d0
jmp 0xdd471
movq 0x10(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rsp)
addq $0x48, %rdi
movslq 0x28(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movslq 0x2c(%rsp), %rsi
callq 0xe0100
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x38, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::SetPointColor(int, gaps::RNRgb const&)
void R3PointSet::
SetPointColor(int index, const RNRgb& color)
{
  // Set color for point with given index
  while (index >= (int) colors.size())
    colors.push_back(RNblack_rgb);
  colors[index] = color;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0x14(%rsp)
addq $0x78, %rdi
callq 0xdfcd0
movq %rax, %rcx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jl 0xdd554
movq 0x18(%rsp), %rdi
addq $0x78, %rdi
leaq 0x15c773(%rip), %rsi    # 0x239cc0
callq 0xe0120
jmp 0xdd51c
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x78, %rdi
movslq 0x2c(%rsp), %rsi
callq 0xe0190
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x11c410
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::SetPointTimestamp(int, double)
void R3PointSet::
SetPointTimestamp(int index, RNScalar timestamp)
{
  // Set timestamp for point with given index
  while (index >= (int) timestamps.size())
    timestamps.push_back(-1);
  timestamps[index] = timestamp;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movsd %xmm0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%rsp)
addq $0x90, %rdi
callq 0xdfe10
movq %rax, %rcx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jl 0xdd5f7
movq 0x10(%rsp), %rdi
addq $0x90, %rdi
movsd 0xdda8b(%rip), %xmm0    # 0x1bb070
movsd %xmm0, 0x18(%rsp)
leaq 0x18(%rsp), %rsi
callq 0xe00d0
jmp 0xdd5ad
movq 0x10(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rsp)
addq $0x90, %rdi
movslq 0x2c(%rsp), %rsi
callq 0xe0100
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::SetPointCategoryIdentifier(int, int)
void R3PointSet::
SetPointCategoryIdentifier(int index, int identifier)
{
  // Set category identifier for point with given index
  while (index >= (int) category_identifiers.size())
    category_identifiers.push_back(-1);
  category_identifiers[index] = identifier;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
addq $0xa8, %rdi
callq 0xb09b0
movq %rax, %rcx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jl 0xdd68f
movq 0x8(%rsp), %rdi
addq $0xa8, %rdi
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
leaq 0x14(%rsp), %rsi
callq 0xe01b0
jmp 0xdd64b
movq 0x8(%rsp), %rdi
movl 0x18(%rsp), %eax
movl %eax, (%rsp)
addq $0xa8, %rdi
movslq 0x1c(%rsp), %rsi
callq 0xb09d0
movl (%rsp), %ecx
movl %ecx, (%rax)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::SetPointInstanceIdentifier(int, int)
void R3PointSet::
SetPointInstanceIdentifier(int index, int identifier)
{
  // Set instance identifier for point with given index
  while (index >= (int) instance_identifiers.size())
    instance_identifiers.push_back(-1);
  instance_identifiers[index] = identifier;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
addq $0xc0, %rdi
callq 0xb09b0
movq %rax, %rcx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jl 0xdd71f
movq 0x8(%rsp), %rdi
addq $0xc0, %rdi
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
leaq 0x14(%rsp), %rsi
callq 0xe01b0
jmp 0xdd6db
movq 0x8(%rsp), %rdi
movl 0x18(%rsp), %eax
movl %eax, (%rsp)
addq $0xc0, %rdi
movslq 0x1c(%rsp), %rsi
callq 0xb09d0
movl (%rsp), %ecx
movl %ecx, (%rax)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::SetPointWeight(int, double)
void R3PointSet::
SetPointWeight(int index, RNScalar weight)
{
  // Set weight for point with given index
  while (index >= (int) weights.size())
    weights.push_back(0);
  weights[index] = weight;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movsd %xmm0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%rsp)
addq $0xd8, %rdi
callq 0xdfe10
movq %rax, %rcx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jl 0xdd7b2
movq 0x10(%rsp), %rdi
addq $0xd8, %rdi
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x18(%rsp), %rsi
callq 0xe00d0
jmp 0xdd76d
movq 0x10(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rsp)
addq $0xd8, %rdi
movslq 0x2c(%rsp), %rsi
callq 0xe0100
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::SetPointValue(int, double)
void R3PointSet::
SetPointValue(int index, RNScalar value)
{
  // Set value for point with given index
  while (index >= (int) values.size())
    values.push_back(-1);
  values[index] = value;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movsd %xmm0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%rsp)
addq $0xf0, %rdi
callq 0xdfe10
movq %rax, %rcx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jl 0xdd857
movq 0x10(%rsp), %rdi
addq $0xf0, %rdi
movsd 0xdd82b(%rip), %xmm0    # 0x1bb070
movsd %xmm0, 0x18(%rsp)
leaq 0x18(%rsp), %rsi
callq 0xe00d0
jmp 0xdd80d
movq 0x10(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rsp)
addq $0xf0, %rdi
movslq 0x2c(%rsp), %rsi
callq 0xe0100
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadFile(char const*)
int R3PointSet::
ReadFile(const char *filename)
{
  // Parse input filename extension
  const char *extension;
  if (!(extension = strrchr(filename, '.'))) {
    printf("Filename %s has no extension (e.g., .mm)\n", filename);
    return 0;
  }

  // Read file of appropriate type
  if (!strcmp(extension, ".xyz")) return ReadXYZFile(filename);
  else if (!strcmp(extension, ".xyzn")) return ReadXYZNFile(filename);
  else if (!strcmp(extension, ".pset")) return ReadBinaryFile(filename);
  else if (!strcmp(extension, ".pts")) return ReadPTSFile(filename);
  else if (!strcmp(extension, ".sdf")) return ReadSDFFile(filename);
  else if (!strcmp(extension, ".vts")) return ReadVTSFile(filename);
  else return ReadMeshFile(filename);

  // Should not get here
  RNFail("Unrecognized file extension in %s\n", filename);
  return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movl $0x2e, %esi
callq 0x23ae0
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
jne 0xde431
movq 0x10(%rsp), %rsi
leaq 0xdfc53(%rip), %rdi     # 0x1be070
movb $0x0, %al
callq 0x23090
movl $0x0, 0x24(%rsp)
jmp 0xde548
movq 0x8(%rsp), %rdi
leaq 0xdfc5d(%rip), %rsi     # 0x1be09a
callq 0x23e90
cmpl $0x0, %eax
jne 0xde45e
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xde560
movl %eax, 0x24(%rsp)
jmp 0xde548
movq 0x8(%rsp), %rdi
leaq 0xdfc35(%rip), %rsi     # 0x1be09f
callq 0x23e90
cmpl $0x0, %eax
jne 0xde48b
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xde630
movl %eax, 0x24(%rsp)
jmp 0xde548
movq 0x8(%rsp), %rdi
leaq 0xdfc0e(%rip), %rsi     # 0x1be0a5
callq 0x23e90
cmpl $0x0, %eax
jne 0xde4b8
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xde780
movl %eax, 0x24(%rsp)
jmp 0xde548
movq 0x8(%rsp), %rdi
leaq 0xdfbe7(%rip), %rsi     # 0x1be0ab
callq 0x23e90
cmpl $0x0, %eax
jne 0xde4e2
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xde9c0
movl %eax, 0x24(%rsp)
jmp 0xde548
movq 0x8(%rsp), %rdi
leaq 0xdfbc2(%rip), %rsi     # 0x1be0b0
callq 0x23e90
cmpl $0x0, %eax
jne 0xde50c
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xdeae0
movl %eax, 0x24(%rsp)
jmp 0xde548
movq 0x8(%rsp), %rdi
leaq 0xdfb9d(%rip), %rsi     # 0x1be0b5
callq 0x23e90
cmpl $0x0, %eax
jne 0xde536
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xdebd0
movl %eax, 0x24(%rsp)
jmp 0xde548
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xdeca0
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadXYZFile(char const*)
int R3PointSet::
ReadXYZFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "r");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Read points
  double px, py, pz;
  while (fscanf(fp, "%lf%lf%lf", &px, &py, &pz) == (unsigned int) 3) {
    R3Point position(px,py,pz);
    InsertPoint(position);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq 0x48(%rsp), %rax
movq %rax, (%rsp)
movq 0x40(%rsp), %rdi
leaq 0xe46c0(%rip), %rsi     # 0x1c2c43
callq 0x23bd0
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0xde5b2
movq 0x40(%rsp), %rsi
leaq 0xdfb19(%rip), %rdi     # 0x1be0ba
movb $0x0, %al
callq 0x120a50
movl $0x0, 0x54(%rsp)
jmp 0xde619
jmp 0xde5b4
movq 0x38(%rsp), %rdi
leaq 0xdf215(%rip), %rsi     # 0x1bd7d5
leaq 0x30(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x20(%rsp), %r8
movb $0x0, %al
callq 0x24320
cmpl $0x3, %eax
jne 0xde607
movsd 0x30(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
leaq 0x8(%rsp), %rdi
callq 0xd9f40
movq (%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xdd260
jmp 0xde5b4
movq 0x38(%rsp), %rdi
callq 0x239a0
movl $0x1, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadXYZNFile(char const*)
int R3PointSet::
ReadXYZNFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "r");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Read points
  double px, py, pz, nx, ny, nz;
  while (fscanf(fp, "%lf%lf%lf%lf%lf%lf", &px, &py, &pz, &nx, &ny, &nz) == (unsigned int) 6) {
    R3Point position(px,py,pz);
    R3Vector normal(nx,ny,nz);
    normal.Normalize();
    int index = InsertPoint(position);
    SetPointNormal(index, normal);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x90(%rsp), %rdi
leaq 0xe45e0(%rip), %rsi     # 0x1c2c43
callq 0x23bd0
movq %rax, 0x88(%rsp)
cmpq $0x0, 0x88(%rsp)
jne 0xde6a1
movq 0x90(%rsp), %rsi
leaq 0xdfa30(%rip), %rdi     # 0x1be0ba
movb $0x0, %al
callq 0x120a50
movl $0x0, 0xa4(%rsp)
jmp 0xde770
jmp 0xde6a3
movq 0x88(%rsp), %rdi
leaq 0xdd6dd(%rip), %rsi     # 0x1bbd8f
leaq 0x80(%rsp), %rdx
leaq 0x78(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x68(%rsp), %r9
leaq 0x60(%rsp), %r10
leaq 0x58(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x24320
cmpl $0x6, %eax
jne 0xde758
movsd 0x80(%rsp), %xmm0
movsd 0x78(%rsp), %xmm1
movsd 0x70(%rsp), %xmm2
leaq 0x40(%rsp), %rdi
callq 0xd9f40
movsd 0x68(%rsp), %xmm0
movsd 0x60(%rsp), %xmm1
movsd 0x58(%rsp), %xmm2
leaq 0x28(%rsp), %rdi
callq 0xdb0a0
leaq 0x28(%rsp), %rdi
callq 0xdb800
movq 0x18(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xdd260
movq 0x18(%rsp), %rdi
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %esi
leaq 0x28(%rsp), %rdx
callq 0xdd330
jmp 0xde6a3
movq 0x88(%rsp), %rdi
callq 0x239a0
movl $0x1, 0xa4(%rsp)
movl 0xa4(%rsp), %eax
addq $0xa8, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadPTSFile(char const*)
int R3PointSet::
ReadPTSFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "rb");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Read points
  float buf[6];
  while (fread(buf, sizeof(float), 6, fp) == (unsigned int) 6) {
    R3Point position(buf[0], buf[1], buf[2]);
    R3Vector normal(buf[3], buf[4], buf[5]);
    normal.Normalize();
    int index = InsertPoint(position);
    SetPointNormal(index, normal);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq 0x60(%rsp), %rdi
leaq 0xddc60(%rip), %rsi     # 0x1bc643
callq 0x23bd0
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
jne 0xdea15
movq 0x60(%rsp), %rsi
leaq 0xdf6b9(%rip), %rdi     # 0x1be0ba
movb $0x0, %al
callq 0x120a50
movl $0x0, 0x74(%rsp)
jmp 0xdeacf
jmp 0xdea17
leaq 0x40(%rsp), %rdi
movq 0x58(%rsp), %rcx
movl $0x4, %esi
movl $0x6, %edx
callq 0x23fc0
cmpq $0x6, %rax
jne 0xdeabd
movss 0x40(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x44(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
movss 0x48(%rsp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x28(%rsp), %rdi
callq 0xd9f40
movss 0x4c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x50(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
movss 0x54(%rsp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x10(%rsp), %rdi
callq 0xdb0a0
leaq 0x10(%rsp), %rdi
callq 0xdb800
movq (%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xdd260
movq (%rsp), %rdi
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %esi
leaq 0x10(%rsp), %rdx
callq 0xdd330
jmp 0xdea17
movq 0x58(%rsp), %rdi
callq 0x239a0
movl $0x1, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadSDFFile(char const*)
int R3PointSet::
ReadSDFFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "rb");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Read points
  float buf[4];
  while (fread(buf, sizeof(float), 4, fp) == (unsigned int) 4) {
    R3Point position(buf[0], buf[1], buf[2]);
    int index = InsertPoint(position);
    SetPointValue(index, buf[3]);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rdi
leaq 0xddb3f(%rip), %rsi     # 0x1bc643
callq 0x23bd0
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0xdeb36
movq 0x50(%rsp), %rsi
leaq 0xdf598(%rip), %rdi     # 0x1be0ba
movb $0x0, %al
callq 0x120a50
movl $0x0, 0x64(%rsp)
jmp 0xdebbc
jmp 0xdeb38
leaq 0x30(%rsp), %rdi
movq 0x48(%rsp), %rcx
movl $0x4, %edx
movq %rdx, %rsi
callq 0x23fc0
cmpq $0x4, %rax
jne 0xdebaa
movss 0x30(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x34(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
movss 0x38(%rsp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x18(%rsp), %rdi
callq 0xd9f40
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xdd260
movq 0x8(%rsp), %rdi
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %esi
movss 0x3c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0xdd7f0
jmp 0xdeb38
movq 0x48(%rsp), %rdi
callq 0x239a0
movl $0x1, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadVTSFile(char const*)
int R3PointSet::
ReadVTSFile(const char *filename)
{
  // Open file
  FILE *fp = fopen(filename, "r");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Read points
  int vertex_index;
  double px, py, pz;
  while (fscanf(fp, "%d%lf%lf%lf", &vertex_index, &px, &py, &pz) == (unsigned int) 4) {
    R3Point position(px,py,pz);
    InsertPoint(position);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rdi
leaq 0xe404f(%rip), %rsi     # 0x1c2c43
callq 0x23bd0
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0xdec23
movq 0x50(%rsp), %rsi
leaq 0xdf4a8(%rip), %rdi     # 0x1be0ba
movb $0x0, %al
callq 0x120a50
movl $0x0, 0x64(%rsp)
jmp 0xdec90
jmp 0xdec25
movq 0x48(%rsp), %rdi
leaq 0xdeba2(%rip), %rsi     # 0x1bd7d3
leaq 0x44(%rsp), %rdx
leaq 0x38(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x28(%rsp), %r9
movb $0x0, %al
callq 0x24320
cmpl $0x4, %eax
jne 0xdec7e
movsd 0x38(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
leaq 0x10(%rsp), %rdi
callq 0xd9f40
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xdd260
jmp 0xdec25
movq 0x48(%rsp), %rdi
callq 0x239a0
movl $0x1, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::ReadMeshFile(char const*)
int R3PointSet::
ReadMeshFile(const char *filename)
{
  // Read mesh file
  R3Mesh mesh;
  if (!mesh.ReadFile(filename)) {
    RNFail("Unable to read %s\n", filename);
    return 0;
  }

  // Create point for each vertex
  for (int i = 0; i < mesh.NVertices(); i++) {
    R3MeshVertex *vertex = mesh.Vertex(i);
    int index = InsertPoint(mesh.VertexPosition(vertex));
    SetPointNormal(index, mesh.VertexNormal(vertex));
    SetPointColor(index, mesh.VertexColor(vertex));
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, 0x1b8(%rsp)
movq %rsi, 0x1b0(%rsp)
movq 0x1b8(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x78(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x8b260
movq 0x48(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
callq 0xa32c0
movl %eax, 0x50(%rsp)
jmp 0xdeceb
movl 0x50(%rsp), %eax
cmpl $0x0, %eax
jne 0xded41
movq 0x1b0(%rsp), %rsi
leaq 0xdd961(%rip), %rdi     # 0x1bc664
xorl %eax, %eax
callq 0x120a50
jmp 0xded0c
movl $0x0, 0x1c4(%rsp)
movl $0x1, 0x68(%rsp)
jmp 0xdee4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x8c160
jmp 0xdee67
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
movl %eax, 0x38(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x53870
movl %eax, 0x3c(%rsp)
jmp 0xded61
movl 0x38(%rsp), %eax
movl 0x3c(%rsp), %ecx
cmpl %ecx, %eax
jge 0xdee3b
movl 0x64(%rsp), %esi
leaq 0x78(%rsp), %rdi
callq 0x53890
movq %rax, 0x30(%rsp)
jmp 0xded86
movq 0x30(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rsi
leaq 0x78(%rsp), %rdi
callq 0x538c0
movq %rax, 0x28(%rsp)
jmp 0xdeda6
movq 0x28(%rsp), %rsi
movq 0x40(%rsp), %rdi
callq 0xdd260
movl %eax, 0x24(%rsp)
jmp 0xdedbb
movl 0x24(%rsp), %eax
movl %eax, 0x54(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x58(%rsp), %rsi
leaq 0x78(%rsp), %rdi
callq 0xadc50
movq %rax, 0x18(%rsp)
jmp 0xdede1
movq 0x18(%rsp), %rdx
movl 0x14(%rsp), %esi
movq 0x40(%rsp), %rdi
callq 0xdd330
jmp 0xdedf6
movl 0x54(%rsp), %eax
movl %eax, 0x4(%rsp)
movq 0x58(%rsp), %rsi
leaq 0x78(%rsp), %rdi
callq 0x538e0
movq %rax, 0x8(%rsp)
jmp 0xdee14
movq 0x8(%rsp), %rdx
movl 0x4(%rsp), %esi
movq 0x40(%rsp), %rdi
callq 0xdd500
jmp 0xdee29
jmp 0xdee2b
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0xded49
movl $0x1, 0x1c4(%rsp)
movl $0x1, 0x68(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x8c160
movl 0x1c4(%rsp), %eax
addq $0x1c8, %rsp            # imm = 0x1C8
retq
movq 0x70(%rsp), %rdi
callq 0x24250
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::WriteFile(char const*) const
int R3PointSet::
WriteFile(const char *filename) const
{
  // Parse input filename extension
  const char *extension;
  if (!(extension = strrchr(filename, '.'))) {
    printf("Filename %s has no extension (e.g., .mm)\n", filename);
    return 0;
  }

  // Write file of appropriate type
  if (!strcmp(extension, ".xyz")) return WriteXYZFile(filename);
  else if (!strcmp(extension, ".xyzn")) return WriteXYZNFile(filename);
  else if (!strcmp(extension, ".pset")) return WriteBinaryFile(filename);
  else if (!strcmp(extension, ".pts")) return WritePTSFile(filename);
  else if (!strcmp(extension, ".sdf")) return WriteSDFFile(filename);
  else return WriteMeshFile(filename);

  // Should not get here
  RNFail("Unrecognized file extension in %s\n", filename);
  return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movl $0x2e, %esi
callq 0x23ae0
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
jne 0xdeed1
movq 0x10(%rsp), %rsi
leaq 0xdf1b3(%rip), %rdi     # 0x1be070
movb $0x0, %al
callq 0x23090
movl $0x0, 0x24(%rsp)
jmp 0xdefbb
movq 0x8(%rsp), %rdi
leaq 0xdf1bd(%rip), %rsi     # 0x1be09a
callq 0x23e90
cmpl $0x0, %eax
jne 0xdeefe
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xdefd0
movl %eax, 0x24(%rsp)
jmp 0xdefbb
movq 0x8(%rsp), %rdi
leaq 0xdf195(%rip), %rsi     # 0x1be09f
callq 0x23e90
cmpl $0x0, %eax
jne 0xdef2b
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xdf0f0
movl %eax, 0x24(%rsp)
jmp 0xdefbb
movq 0x8(%rsp), %rdi
leaq 0xdf16e(%rip), %rsi     # 0x1be0a5
callq 0x23e90
cmpl $0x0, %eax
jne 0xdef55
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xdf270
movl %eax, 0x24(%rsp)
jmp 0xdefbb
movq 0x8(%rsp), %rdi
leaq 0xdf14a(%rip), %rsi     # 0x1be0ab
callq 0x23e90
cmpl $0x0, %eax
jne 0xdef7f
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xdf510
movl %eax, 0x24(%rsp)
jmp 0xdefbb
movq 0x8(%rsp), %rdi
leaq 0xdf125(%rip), %rsi     # 0x1be0b0
callq 0x23e90
cmpl $0x0, %eax
jne 0xdefa9
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xdf6c0
movl %eax, 0x24(%rsp)
jmp 0xdefbb
movq (%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xdf820
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::WriteXYZFile(char const*) const
int R3PointSet::
WriteXYZFile(const char *filename) const
{
 // Open file
  FILE *fp = fopen(filename, "w");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Write points
  for (int i = 0; i < NPoints(); i++) {
    const R3Point& p = PointPosition(i);
    fprintf(fp, "%g %g %g\n", p[0], p[1], p[2]);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rdi
leaq 0xdf986(%rip), %rsi     # 0x1be97a
callq 0x23bd0
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0xdf026
movq 0x40(%rsp), %rsi
leaq 0xdf0a8(%rip), %rdi     # 0x1be0ba
movb $0x0, %al
callq 0x120a50
movl $0x0, 0x54(%rsp)
jmp 0xdf0e3
movl $0x0, 0x34(%rsp)
movq 0x20(%rsp), %rdi
movl 0x34(%rsp), %eax
movl %eax, 0x1c(%rsp)
callq 0x32400
movl %eax, %ecx
movl 0x1c(%rsp), %eax
cmpl %ecx, %eax
jge 0xdf0d1
movq 0x20(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x359b0
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
movq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0x33470
movsd %xmm0, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0x33470
movsd %xmm0, 0x8(%rsp)
movq 0x28(%rsp), %rdi
movl $0x2, %esi
callq 0x33470
movq (%rsp), %rdi
movsd 0x8(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x10(%rsp), %xmm0
leaq 0xddc50(%rip), %rsi     # 0x1bcd0a
movb $0x3, %al
callq 0x23f00
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0xdf02e
movq 0x38(%rsp), %rdi
callq 0x239a0
movl $0x1, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::WriteXYZNFile(char const*) const
int R3PointSet::
WriteXYZNFile(const char *filename) const
{
 // Open file
  FILE *fp = fopen(filename, "w");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Write points
  for (int i = 0; i < NPoints(); i++) {
    const R3Point& p = PointPosition(i);
    const R3Vector& n = PointNormal(i);
    fprintf(fp, "%g %g %g %g %g %g\n", p[0], p[1], p[2], n[0], n[1], n[2]);
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x60(%rsp), %rdi
leaq 0xdf866(%rip), %rsi     # 0x1be97a
callq 0x23bd0
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
jne 0xdf146
movq 0x60(%rsp), %rsi
leaq 0xdef88(%rip), %rdi     # 0x1be0ba
movb $0x0, %al
callq 0x120a50
movl $0x0, 0x74(%rsp)
jmp 0xdf264
movl $0x0, 0x54(%rsp)
movq 0x38(%rsp), %rdi
movl 0x54(%rsp), %eax
movl %eax, 0x34(%rsp)
callq 0x32400
movl %eax, %ecx
movl 0x34(%rsp), %eax
cmpl %ecx, %eax
jge 0xdf252
movq 0x38(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x359b0
movq 0x38(%rsp), %rdi
movq %rax, 0x48(%rsp)
movl 0x54(%rsp), %esi
callq 0xe01e0
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
movq 0x48(%rsp), %rdi
xorl %esi, %esi
callq 0x33470
movsd %xmm0, 0x28(%rsp)
movq 0x48(%rsp), %rdi
movl $0x1, %esi
callq 0x33470
movsd %xmm0, 0x8(%rsp)
movq 0x48(%rsp), %rdi
movl $0x2, %esi
callq 0x33470
movsd %xmm0, 0x10(%rsp)
movq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x7c4f0
movsd %xmm0, 0x18(%rsp)
movq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x7c4f0
movsd %xmm0, 0x20(%rsp)
movq 0x40(%rsp), %rdi
movl $0x2, %esi
callq 0x7c4f0
movq (%rsp), %rdi
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movsd 0x18(%rsp), %xmm3
movsd 0x20(%rsp), %xmm4
movaps %xmm0, %xmm5
movsd 0x28(%rsp), %xmm0
leaq 0xdee92(%rip), %rsi     # 0x1be0cd
movb $0x6, %al
callq 0x23f00
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0xdf14e
movq 0x58(%rsp), %rdi
callq 0x239a0
movl $0x1, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::WritePTSFile(char const*) const
int R3PointSet::
WritePTSFile(const char *filename) const
{
 // Open file
  FILE *fp = fopen(filename, "wb");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Write points
  float buf[6];
  for (int i = 0; i < NPoints(); i++) {
    const R3Point& p = PointPosition(i);
    const R3Vector& n = PointNormal(i);
    buf[0] = p[0]; buf[1] = p[1]; buf[2] = p[2];
    buf[3] = n[0]; buf[4] = n[1]; buf[5] = n[2];
    if (fwrite(buf, sizeof(float), 6, fp) != (unsigned int) 6) {
      RNFail("Unable to write point %d to %s\n", i, filename);
      return 0;
    }
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rdi
leaq 0xde634(%rip), %rsi     # 0x1bdb68
callq 0x23bd0
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0xdf566
movq 0x50(%rsp), %rsi
leaq 0xdeb68(%rip), %rdi     # 0x1be0ba
movb $0x0, %al
callq 0x120a50
movl $0x0, 0x64(%rsp)
jmp 0xdf6a8
movl $0x0, 0x2c(%rsp)
movq 0x10(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x32400
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0xdf696
movq 0x10(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x359b0
movq 0x10(%rsp), %rdi
movq %rax, 0x20(%rsp)
movl 0x2c(%rsp), %esi
callq 0xe01e0
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x33470
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x30(%rsp)
movq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x33470
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x34(%rsp)
movq 0x20(%rsp), %rdi
movl $0x2, %esi
callq 0x33470
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x38(%rsp)
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x7c4f0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x3c(%rsp)
movq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x7c4f0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x40(%rsp)
movq 0x18(%rsp), %rdi
movl $0x2, %esi
callq 0x7c4f0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x44(%rsp)
leaq 0x30(%rsp), %rdi
movq 0x48(%rsp), %rcx
movl $0x4, %esi
movl $0x6, %edx
callq 0x24420
cmpq $0x6, %rax
je 0xdf684
movl 0x2c(%rsp), %esi
movq 0x50(%rsp), %rdx
leaq 0xdea6d(%rip), %rdi     # 0x1be0e0
movb $0x0, %al
callq 0x120a50
movl $0x0, 0x64(%rsp)
jmp 0xdf6a8
jmp 0xdf686
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0xdf56e
movq 0x48(%rsp), %rdi
callq 0x239a0
movl $0x1, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::WriteSDFFile(char const*) const
int R3PointSet::
WriteSDFFile(const char *filename) const
{
 // Open file
  FILE *fp = fopen(filename, "wb");
  if (!fp) {
    RNFail("Unable to open %s\n", filename);
    return 0;
  }

  // Write points
  float buf[4];
  for (int i = 0; i < NPoints(); i++) {
    const R3Point& p = PointPosition(i);
    buf[0] = p[0]; buf[1] = p[1]; buf[2] = p[2];
    buf[3] = PointValue(i);
    if (fwrite(buf, sizeof(float), 4, fp) != (unsigned int) 4) {
      RNFail("Unable to write point %d to %s\n", i, filename);
      return 0;
    }
  }

  // Close file
  fclose(fp);

  // Return success
  return 1;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
leaq 0xde484(%rip), %rsi     # 0x1bdb68
callq 0x23bd0
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0xdf716
movq 0x40(%rsp), %rsi
leaq 0xde9b8(%rip), %rdi     # 0x1be0ba
movb $0x0, %al
callq 0x120a50
movl $0x0, 0x54(%rsp)
jmp 0xdf813
movl $0x0, 0x1c(%rsp)
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
callq 0x32400
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0xdf801
movq 0x8(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x359b0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x33470
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rsp)
movq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0x33470
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x24(%rsp)
movq 0x10(%rsp), %rdi
movl $0x2, %esi
callq 0x33470
movq 0x8(%rsp), %rdi
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x28(%rsp)
movl 0x1c(%rsp), %esi
callq 0xe0440
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x2c(%rsp)
leaq 0x20(%rsp), %rdi
movq 0x38(%rsp), %rcx
movl $0x4, %edx
movq %rdx, %rsi
callq 0x24420
cmpq $0x4, %rax
je 0xdf7ef
movl 0x1c(%rsp), %esi
movq 0x40(%rsp), %rdx
leaq 0xde902(%rip), %rdi     # 0x1be0e0
movb $0x0, %al
callq 0x120a50
movl $0x0, 0x54(%rsp)
jmp 0xdf813
jmp 0xdf7f1
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xdf71e
movq 0x38(%rsp), %rdi
callq 0x239a0
movl $0x1, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3PointSet.cpp
// Function: gaps::R3PointSet::WriteMeshFile(char const*) const
int R3PointSet::
WriteMeshFile(const char *filename) const
{
  // Create mesh
  R3Mesh mesh;
  for (int i = 0; i < NPoints(); i++) {
    mesh.CreateVertex(PointPosition(i), PointNormal(i), PointColor(i));
  }

  // Write mesh
  return mesh.WriteFile(filename);
}

// Assembly:
subq $0x198, %rsp            # imm = 0x198
movq %rdi, 0x190(%rsp)
movq %rsi, 0x188(%rsp)
movq 0x190(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x8b260
movl $0x0, 0x4c(%rsp)
movq 0x30(%rsp), %rdi
movl 0x4c(%rsp), %eax
movl %eax, 0x28(%rsp)
callq 0x32400
movl %eax, 0x2c(%rsp)
jmp 0xdf86e
movl 0x28(%rsp), %eax
movl 0x2c(%rsp), %ecx
cmpl %ecx, %eax
jge 0xdf909
movq 0x30(%rsp), %rdi
movl 0x4c(%rsp), %esi
callq 0x359b0
movq %rax, 0x20(%rsp)
jmp 0xdf893
movq 0x30(%rsp), %rdi
movl 0x4c(%rsp), %esi
callq 0xe01e0
movq %rax, 0x18(%rsp)
jmp 0xdf8a8
movq 0x30(%rsp), %rdi
movl 0x4c(%rsp), %esi
callq 0xe0250
movq %rax, 0x10(%rsp)
jmp 0xdf8bd
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rsi
xorl %eax, %eax
movl %eax, %r8d
leaq 0x50(%rsp), %rdi
callq 0x91a60
jmp 0xdf8dd
jmp 0xdf8df
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0xdf856
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x8c160
jmp 0xdf937
movq 0x188(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0xaaf40
movl %eax, 0xc(%rsp)
jmp 0xdf921
leaq 0x50(%rsp), %rdi
callq 0x8c160
movl 0xc(%rsp), %eax
addq $0x198, %rsp            # imm = 0x198
retq
movq 0x40(%rsp), %rdi
callq 0x24250
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: kusumi[P]procstat/main.cc
// Function: (anonymous namespace)::atexit_handler()
void atexit_handler(void)
{
	cleanup_screen();
	cleanup_watch();
	cleanup_log();
	cleanup_lock();
	if (_what)
		std::cerr << _what << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0xcdd0
callq 0xd370
callq 0xc950
cmpq $0x0, 0x120bd(%rip)     # 0x174d8
je 0x543f
movq 0x120b4(%rip), %rsi     # 0x174d8
movq 0x11bc5(%rip), %rdi     # 0x16ff0
callq 0x4400
movq %rax, %rdi
movq 0x11b4e(%rip), %rsi     # 0x16f88
callq 0x4470
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: kusumi[P]procstat/container.cc
// Function: Container::~Container()
Container::~Container(void)
{
	for (_map_t::iterator it = _map.begin(); it != _map.end(); it++)
		delete_watch(it->first);
	while (!_v.empty()) {
		Window *p = _v.back();
		_v.pop_back();
		delete p;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x111cd(%rip), %rdi     # 0x17538
callq 0x71a0
movq %rax, -0x10(%rbp)
leaq 0x111bd(%rip), %rdi     # 0x17538
callq 0x7200
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x71d0
testb $0x1, %al
jne 0x6397
jmp 0x63bc
leaq -0x10(%rbp), %rdi
callq 0x7230
movl (%rax), %edi
callq 0xd410
jmp 0x63a9
jmp 0x63ab
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x7250
movq %rax, -0x20(%rbp)
jmp 0x6374
jmp 0x63be
movq -0x30(%rbp), %rdi
callq 0x7290
xorb $-0x1, %al
testb $0x1, %al
jne 0x63cf
jmp 0x640f
movq -0x30(%rbp), %rdi
callq 0x72d0
movq -0x30(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x28(%rbp)
callq 0x7310
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x640d
movq -0x38(%rbp), %rdi
callq 0xa0e0
movq -0x38(%rbp), %rdi
movl $0x80, %esi
callq 0x4430
jmp 0x63be
movq -0x30(%rbp), %rdi
callq 0x7140
addq $0x40, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x56a0
nopw %cs:(%rax,%rax)
// File: kusumi[P]procstat/container.cc
// Function: Container::_goto_next_window()
void Container::_goto_next_window(void)
{
	std::vector<Window*>::iterator it = _it;
	(*_it)->focus(false);
	do {
		_it++;
		if (_it == _v.end())
			_it = _v.begin();
	} while ((*_it)->is_dead() && _it != it);
	(*_it)->focus(true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movq 0x18(%rdi), %rax
movq %rax, -0x10(%rbp)
addq $0x18, %rdi
callq 0x7120
movq (%rax), %rdi
xorl %esi, %esi
callq 0xa410
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
xorl %esi, %esi
callq 0x7340
movq -0x30(%rbp), %rdi
movq %rax, -0x18(%rbp)
movq %rdi, %rax
addq $0x18, %rax
movq %rax, -0x38(%rbp)
callq 0x73c0
movq -0x38(%rbp), %rdi
movq %rax, -0x20(%rbp)
leaq -0x20(%rbp), %rsi
callq 0x7380
testb $0x1, %al
jne 0x649d
jmp 0x64b9
movq -0x30(%rbp), %rdi
callq 0x70f0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq %rcx, 0x18(%rax)
jmp 0x64bb
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
callq 0x7120
movq (%rax), %rdi
callq 0xa160
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x39(%rbp)
jne 0x64de
jmp 0x64f2
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
leaq -0x10(%rbp), %rsi
callq 0x73f0
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x645f
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
callq 0x7120
movq (%rax), %rdi
movl $0x1, %esi
callq 0xa410
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: kusumi[P]procstat/container.cc
// Function: Container::_goto_prev_window()
void Container::_goto_prev_window(void)
{
	std::vector<Window*>::iterator it = _it;
	(*_it)->focus(false);
	do {
		if (_it == _v.begin())
			_it = _v.end();
		_it--;
	} while ((*_it)->is_dead() && _it != it);
	(*_it)->focus(true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movq 0x18(%rdi), %rax
movq %rax, -0x10(%rbp)
addq $0x18, %rdi
callq 0x7120
movq (%rax), %rdi
xorl %esi, %esi
callq 0xa410
movq -0x30(%rbp), %rdi
movq %rdi, %rax
addq $0x18, %rax
movq %rax, -0x38(%rbp)
callq 0x70f0
movq -0x38(%rbp), %rdi
movq %rax, -0x18(%rbp)
leaq -0x18(%rbp), %rsi
callq 0x7380
testb $0x1, %al
jne 0x657a
jmp 0x6596
movq -0x30(%rbp), %rdi
callq 0x73c0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
xorl %esi, %esi
callq 0x7430
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
callq 0x7120
movq (%rax), %rdi
callq 0xa160
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x39(%rbp)
jne 0x65cc
jmp 0x65e0
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
leaq -0x10(%rbp), %rsi
callq 0x73f0
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x654f
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
callq 0x7120
movq (%rax), %rdi
movl $0x1, %esi
callq 0xa410
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: kusumi[P]procstat/container.cc
// Function: Container::_build_window_xy()
void Container::_build_window_xy(void)
{
	int seq = 0;
	int xx = get_terminal_cols();
	int yy = get_terminal_lines();
	int x = static_cast<int>(layout.size());
	int xq = xx / x;
	int xr = xx % x;

	for (int i = 0; i < x; i++) {
		int xpos = xq * i;
		int xlen = xq;
		if (i == x - 1)
			xlen += xr;
		int y = layout[i];
		if (y == -1)
			y = 1; // ignore invalid
		int yq = yy / y;
		int yr = yy % y;

		for (int j = 0; j < y; j++) {
			int ypos = yq * j;
			int ylen = yq;
			if (j == y - 1)
				ylen += yr;
			_alloc_window(seq++, ylen, xlen, ypos, xpos);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0xc(%rbp)
callq 0xce70
movl %eax, -0x10(%rbp)
callq 0xce30
movl %eax, -0x14(%rbp)
leaq 0x10e3e(%rip), %rdi     # 0x17480
callq 0x5d00
movl %eax, -0x18(%rbp)
movl -0x10(%rbp), %eax
cltd
idivl -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl -0x10(%rbp), %eax
cltd
idivl -0x18(%rbp)
movl %edx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x673f
movl -0x1c(%rbp), %eax
imull -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x24(%rbp), %eax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x6697
movl -0x20(%rbp), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movslq -0x24(%rbp), %rsi
leaq 0x10dde(%rip), %rdi     # 0x17480
callq 0x7470
movl (%rax), %eax
movl %eax, -0x30(%rbp)
cmpl $-0x1, -0x30(%rbp)
jne 0x66b9
movl $0x1, -0x30(%rbp)
movl -0x14(%rbp), %eax
cltd
idivl -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x14(%rbp), %eax
cltd
idivl -0x30(%rbp)
movl %edx, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x672f
movl -0x34(%rbp), %eax
imull -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x3c(%rbp), %eax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x6702
movl -0x38(%rbp), %eax
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x50(%rbp), %rdi
movl -0xc(%rbp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0x44(%rbp), %edx
movl -0x2c(%rbp), %ecx
movl -0x40(%rbp), %r8d
movl -0x28(%rbp), %r9d
callq 0x6890
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x66d4
jmp 0x6731
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x6665
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: kusumi[P]procstat/container.cc
// Function: Container::_build_window_yx()
void Container::_build_window_yx(void)
{
	int seq = 0;
	int yy = get_terminal_lines();
	int xx = get_terminal_cols();
	int y = static_cast<int>(layout.size());
	int yq = yy / y;
	int yr = yy % y;

	for (int i = 0; i < y; i++) {
		int ypos = yq * i;
		int ylen = yq;
		if (i == y - 1)
			ylen += yr;
		int x = layout[i];
		if (x == -1)
			x = 1; // ignore invalid
		int xq = xx / x;
		int xr = xx % x;

		for (int j = 0; j < x; j++) {
			int xpos = xq * j;
			int xlen = xq;
			if (j == x - 1)
				xlen += xr;
			_alloc_window(seq++, ylen, xlen, ypos, xpos);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0xc(%rbp)
callq 0xce30
movl %eax, -0x10(%rbp)
callq 0xce70
movl %eax, -0x14(%rbp)
leaq 0x10cfe(%rip), %rdi     # 0x17480
callq 0x5d00
movl %eax, -0x18(%rbp)
movl -0x10(%rbp), %eax
cltd
idivl -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl -0x10(%rbp), %eax
cltd
idivl -0x18(%rbp)
movl %edx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x687f
movl -0x1c(%rbp), %eax
imull -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x24(%rbp), %eax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x67d7
movl -0x20(%rbp), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movslq -0x24(%rbp), %rsi
leaq 0x10c9e(%rip), %rdi     # 0x17480
callq 0x7470
movl (%rax), %eax
movl %eax, -0x30(%rbp)
cmpl $-0x1, -0x30(%rbp)
jne 0x67f9
movl $0x1, -0x30(%rbp)
movl -0x14(%rbp), %eax
cltd
idivl -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl -0x14(%rbp), %eax
cltd
idivl -0x30(%rbp)
movl %edx, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x686f
movl -0x34(%rbp), %eax
imull -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x3c(%rbp), %eax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x6842
movl -0x38(%rbp), %eax
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x50(%rbp), %rdi
movl -0xc(%rbp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0x2c(%rbp), %edx
movl -0x44(%rbp), %ecx
movl -0x28(%rbp), %r8d
movl -0x40(%rbp), %r9d
callq 0x6890
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x6814
jmp 0x6871
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x67a5
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)