LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/neguse[P]no/lang.cc
// Function: Lang::Parse(Input&)
Node::Ref Parse(Input &input) {
    auto n = ParseNode(input);
    auto e = ParseNode(input);
    assert(e == nullptr);
    return n;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorl %ecx, %ecx
callq 0x500a
movq %rsp, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x500a
cmpq $0x0, (%rsp)
jne 0x4172
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x4165
callq 0x53ac
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3f4c(%rip), %rdi      # 0x80c5
leaq 0x3f52(%rip), %rsi      # 0x80d2
leaq 0x3f53(%rip), %rcx      # 0x80da
movl $0x115, %edx            # imm = 0x115
callq 0x20a0
movq %rax, %r14
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x41a2
callq 0x53ac
movq %r14, %rdi
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O1/neguse[P]no/lang.cc
// Function: Input::Get()
char Get() {
    char c = fgetc(fp_);
    if (c == '\n') {
      pos_.line++;
      pos_.col = 0;
    } else if (c == '\t') {
      pos_.col += 4;
    } else if (c == EOF) {
    } else {
      pos_.col++;
    }
    return c;
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2180
cmpb $0x9, %al
je 0x52f0
movzbl %al, %ecx
cmpl $0xff, %ecx
je 0x52f9
cmpl $0xa, %ecx
jne 0x52f6
incl 0x8(%rbx)
movl $0x0, 0xc(%rbx)
jmp 0x52f9
addl $0x4, 0xc(%rbx)
jmp 0x52f9
incl 0xc(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/neguse[P]no/lang.cc
// Function: LangInterpreter::ReadI()
Value::Ref ReadI() {
    int i = 0;
    std::cin >> i;
    Value::Ref v = std::make_shared<Value>();
    v->SetInteger(i);
    return v;
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorl %ebp, %ebp
leaq 0xc(%rsp), %r14
movl %ebp, (%r14)
movq 0x3b54(%rip), %rdi      # 0xafe0
movq %r14, %rsi
callq 0x2090
movq $0x0, (%rbx)
movl $0x40, %edi
callq 0x20f0
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
leaq 0x3816(%rip), %rcx      # 0xacd0
movq %rcx, (%rax)
leaq 0x10(%rax), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movq %rax, 0x8(%rbx)
movq %rcx, (%rbx)
movl (%r14), %ecx
movl %ebp, 0x10(%rax)
movl %ecx, 0x18(%rax)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/neguse[P]no/lang.cc
// Function: LangInterpreter::ReadS()
Value::Ref ReadS() {
    std::string s;
    std::cin >> s;
    Value::Ref v = StringToList(s.c_str());
    return v;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movq 0x3ac9(%rip), %rdi      # 0xafe0
movq %rsp, %rsi
callq 0x2120
movq (%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x769c
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x753c
callq 0x20e0
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x755a
callq 0x20e0
movq %rbx, %rdi
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O1/neguse[P]no/lang.cc
// Function: LangInterpreter::Value::True()
bool True() {
      switch (kind) {
      case ValueKind::Integer:
        return v.i != 0;
      case ValueKind::List:
        return v.c != nullptr;
      case ValueKind::Closure:
        return v.l != nullptr;
      }
      assert(0);
      return false;
    }

// Assembly:
movl (%rdi), %eax
cmpl $0x2, %eax
je 0x75f5
cmpl $0x1, %eax
je 0x75ee
testl %eax, %eax
jne 0x75fe
cmpl $0x0, 0x8(%rdi)
jmp 0x75fa
cmpq $0x0, 0x20(%rdi)
jmp 0x75fa
cmpq $0x0, 0x10(%rdi)
setne %al
retq
pushq %rax
leaq 0xbfa(%rip), %rdi       # 0x8200
leaq 0xac5(%rip), %rsi       # 0x80d2
leaq 0xccf(%rip), %rcx       # 0x82e3
movl $0x1d2, %edx            # imm = 0x1D2
callq 0x20a0
// File: /workspace/github_cpp_makefile_star2_O1/neguse[P]no/lang.cc
// Function: LangInterpreter::Frame::Get(char) const
std::shared_ptr<Value> Get(char c) const {
      auto it = m.find(c);
      if (it != m.end()) {
        return it->second;
      } else if (parent != nullptr) {
        return parent->Get(c);
      } else {
        return nullptr;
      }
    }

// Assembly:
movq %rdi, %rax
movq 0x20(%rsi), %r8
leaq 0x18(%rsi), %rcx
movq %rcx, %rdi
testq %r8, %r8
je 0x764d
movq %rcx, %rdi
xorl %r9d, %r9d
cmpb %dl, 0x20(%r8)
setl %r9b
cmovgeq %r8, %rdi
movq 0x10(%r8,%r9,8), %r8
testq %r8, %r8
jne 0x7634
movq %rcx, %r8
cmpq %rcx, %rdi
je 0x765f
cmpb %dl, 0x20(%rdi)
cmovgq %rcx, %rdi
movq %rdi, %r8
cmpq %rcx, %r8
jne 0x7673
movq (%rsi), %rsi
testq %rsi, %rsi
jne 0x7621
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
retq
movq 0x28(%r8), %rcx
movq %rcx, (%rax)
movq 0x30(%r8), %rcx
movq %rcx, 0x8(%rax)
testq %rcx, %rcx
je 0x7672
movq 0x3942(%rip), %rdx      # 0xafd0
cmpb $0x0, (%rdx)
je 0x7697
incl 0x8(%rcx)
retq
lock
incl 0x8(%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/superblocks[P]superblocks/set-dmd.cpp
// Function: Superblocks::init()
void Superblocks::init() {

	coin = "DMD"; 
	coin_name = "Diamondcoin";

	hash_length = 64;

	// normal (step 0)
	reward[0] = 1;

	// superblocks

	seed_type[1] = SEED_WITH_PREVIOUS_BLOCK_HASH;
	cutout_start[1] = 6;
	cutout_length[1] = 7;
	rnd_range_low[1] = 1;
	rnd_range_high[1] = 14400;
	luck_type[1] = LUCK_WITH_MORE_THAN_X_AND_LESS_THAN_Y;
	luck_x[1] = 10000;
	luck_y[1] = 10011;
	reward[1] = 30;

	luck_type[2] = LUCK_WITH_MORE_THAN_X_AND_LESS_THAN_Y;
	luck_x[2] = 2000;
	luck_y[2] = 2031;
	reward[2] = 8;

	luck_type[3] = LUCK_WITH_MORE_THAN_X_AND_LESS_THAN_Y;
	luck_x[3] = 8000;
	luck_y[3] = 8101;
	reward[3] = 2;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x18, %rdi
movq 0x20(%rbx), %rdx
leaq 0x134c(%rip), %rcx      # 0x3e80
movl $0x3, %r8d
xorl %esi, %esi
callq 0x1120
leaq 0x38(%rbx), %rdi
movq 0x40(%rbx), %rdx
leaq 0x1334(%rip), %rcx      # 0x3e84
movl $0xb, %r8d
xorl %esi, %esi
callq 0x1120
movl $0x40, 0x58(%rbx)
movabsq $0x1e00000001, %rax     # imm = 0x1E00000001
movq %rax, 0x14c(%rbx)
movl $0x2, 0x60(%rbx)
movl $0x6, 0x70(%rbx)
movl $0x7, 0x80(%rbx)
movl $0x1, 0x90(%rbx)
movl $0x3840, 0xa0(%rbx)     # imm = 0x3840
movl $0x3, 0x120(%rbx)
movl $0x2710, 0x130(%rbx)    # imm = 0x2710
movl $0x271b, 0x140(%rbx)    # imm = 0x271B
movabsq $0x300000003, %rax      # imm = 0x300000003
movq %rax, 0x124(%rbx)
movabsq $0x1f40000007d0, %rax   # imm = 0x1F40000007D0
movq %rax, 0x134(%rbx)
movabsq $0x1fa5000007ef, %rax   # imm = 0x1FA5000007EF
movq %rax, 0x144(%rbx)
movabsq $0x200000008, %rax      # imm = 0x200000008
movq %rax, 0x154(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPrimitive::Distance(gaps::R3Point const&) const
RNLength R3SegmentationPrimitive::
Distance(const R3Point& position) const
{
  // Return distance from primitive to point
  if (primitive_type == R3_SEGMENTATION_POINT_PRIMITIVE_TYPE) return R3Distance(centroid, position);
  else if (primitive_type == R3_SEGMENTATION_LINE_PRIMITIVE_TYPE) return R3Distance(line, position);
  else if (primitive_type == R3_SEGMENTATION_PLANE_PRIMITIVE_TYPE) return R3Distance(plane, position);
#if 0
  else if (primitive_type == R3_SEGMENTATION_PLANAR_GRID_PRIMITIVE_TYPE) {
    R2R3SegmentationPoint grid_position = planar_grid.GridPosition(position);
    int ix = (int) (grid_position.X() + 0.5);
    if ((ix < 0) || (ix >= planar_grid.XResolution())) return RN_INFINITY;
    int iy = (int) (grid_position.Y() + 0.5);
    if ((iy < 0) || (iy >= planar_grid.YResolution())) return RN_INFINITY;
    RNScalar value = planar_grid.GridValue(ix, iy);
    if (value <= 0) return RN_INFINITY;
    return R3Distance(planar_grid.Plane(), position);
  }
#endif
  else {
    RNAbort("Unrecognized primitive type");
    return RN_INFINITY;
  }

// Assembly:
movq %rdi, %rax
movl (%rdi), %ecx
cmpl $0x3, %ecx
je 0x298df
cmpl $0x2, %ecx
je 0x298d0
cmpl $0x1, %ecx
jne 0x298f0
addq $0x40, %rax
movq %rax, %rdi
jmp 0x6a618
addq $0x58, %rax
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x6a63e
addq $0x88, %rax
movq %rsi, %rdi
movq %rax, %rsi
jmp 0x6a7d2
pushq %rax
leaq 0xe29a8(%rip), %rdi     # 0x10c2a0
xorl %eax, %eax
callq 0xc78f2
leaq 0x147462(%rip), %rax    # 0x170d68
movsd (%rax), %xmm0
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPrimitive::Update(gaps::R3Point const&)
void R3SegmentationPrimitive::
Update(const R3Point& point)
{
  // Set everything
  primitive_type = R3_SEGMENTATION_POINT_PRIMITIVE_TYPE;
  this->centroid = point;
  line = R3null_line;
  plane = R3null_plane;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, (%rdi)
addq $0x40, %rdi
callq 0x9f83c
leaq 0x58(%rbx), %rdi
leaq 0x548ea3(%rip), %r14    # 0x5727d0
movq %r14, %rsi
callq 0x9f83c
leaq 0x70(%rbx), %rdi
addq $0x18, %r14
movq %r14, %rsi
callq 0xa0712
leaq 0x88(%rbx), %rdi
leaq 0x548bfd(%rip), %r14    # 0x572550
movq %r14, %rsi
callq 0xa0712
movsd 0x18(%r14), %xmm0
movsd %xmm0, 0xa0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPrimitive::Update(gaps::R3Line const&)
void R3SegmentationPrimitive::
Update(const R3Line& line)
{
  // Set everything
  primitive_type = R3_SEGMENTATION_LINE_PRIMITIVE_TYPE;
  centroid = R3zero_point;
  centroid.Project(line);
  this->line = line;
  plane = R3null_plane;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x2, (%rdi)
leaq 0x40(%rdi), %r15
leaq 0x548f92(%rip), %rsi    # 0x572920
movq %r15, %rdi
callq 0x9f83c
movq %r15, %rdi
movq %r14, %rsi
callq 0x9f75a
leaq 0x58(%rbx), %rdi
movq %r14, %rsi
callq 0x9f83c
leaq 0x70(%rbx), %rdi
addq $0x18, %r14
movq %r14, %rsi
callq 0xa0712
leaq 0x88(%rbx), %rdi
leaq 0x548b85(%rip), %r14    # 0x572550
movq %r14, %rsi
callq 0xa0712
movsd 0x18(%r14), %xmm0
movsd %xmm0, 0xa0(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPrimitive::Update(gaps::R3Plane const&)
void R3SegmentationPrimitive::
Update(const R3Plane& plane)
{
  // Set everything
  primitive_type = R3_SEGMENTATION_PLANE_PRIMITIVE_TYPE;
  centroid = R3zero_point;
  centroid.Project(plane);
  line = R3null_line;
  this->plane = plane;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x3, (%rdi)
leaq 0x40(%rdi), %r15
leaq 0x548f1c(%rip), %rsi    # 0x572920
movq %r15, %rdi
callq 0x9f83c
movq %r15, %rdi
movq %r14, %rsi
callq 0x9f85c
leaq 0x58(%rbx), %rdi
leaq 0x548dae(%rip), %r15    # 0x5727d0
movq %r15, %rsi
callq 0x9f83c
leaq 0x70(%rbx), %rdi
addq $0x18, %r15
movq %r15, %rsi
callq 0xa0712
leaq 0x88(%rbx), %rdi
movq %r14, %rsi
callq 0xa0712
movsd 0x18(%r14), %xmm0
movsd %xmm0, 0xa0(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::R3SegmentationCluster(gaps::R3SegmentationPoint*, int)
R3SegmentationCluster::
R3SegmentationCluster(R3SegmentationPoint *seed_point, int primitive_type)
  : seed_point(seed_point),
    points(),
    parent(NULL),
    children(),
    pairs(),
    primitive(primitive_type),
    area(0),
    color(0,0,0),
    timestamp(0),
    category_identifier(-1),
    category_confidence(0),
    possible_affinity(0),
    total_affinity(0),
    segmentation(NULL),
    segmentation_index(-1)
{
  // Update primitive and color and area
  if (seed_point) primitive.Update(seed_point);
  if (seed_point) color = seed_point->color;
  if (seed_point) timestamp = seed_point->timestamp;
  if (seed_point) area = seed_point->area;
  if (seed_point) category_identifier = seed_point->category_identifier;
  if (seed_point) category_confidence = seed_point->category_confidence;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, (%rdi)
addq $0x8, %rdi
movq %rdi, (%rsp)
callq 0xc4b50
movq $0x0, 0x18(%r15)
leaq 0x20(%r15), %r14
movq %r14, %rdi
callq 0xc4b50
leaq 0x30(%r15), %r13
movq %r13, %rdi
callq 0xc4b50
leaq 0x40(%r15), %rbp
movq %rbp, %rdi
movl %ebx, %esi
callq 0x291d0
movq $0x0, 0xe8(%r15)
leaq 0xf0(%r15), %rbx
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rbx, %rdi
callq 0xc49c4
movq $0x0, 0x108(%r15)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x110(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x118(%r15)
movups %xmm0, 0x128(%r15)
movl %eax, 0x138(%r15)
testq %r12, %r12
je 0x29f70
movq %rbp, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x29334
leaq 0x78(%r12), %rsi
movq %rbx, %rdi
callq 0xc4a56
movsd 0x68(%r12), %xmm0
movsd %xmm0, 0x108(%r15)
movsd 0x70(%r12), %xmm0
movsd %xmm0, 0xe8(%r15)
movl 0x90(%r12), %eax
movl %eax, 0x110(%r15)
movsd 0x98(%r12), %xmm0
movsd %xmm0, 0x118(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
jmp 0x29f9d
movq %rax, %r12
jmp 0x29fa5
movq %rax, %r12
jmp 0x29fad
movq %rax, %r12
addq $0x48, %r15
movq %r15, %rdi
callq 0x89530
movq %r13, %rdi
callq 0xc4bba
movq %r14, %rdi
callq 0xc4bba
movq (%rsp), %rdi
callq 0xc4bba
movq %r12, %rdi
callq 0x15ae0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::R3SegmentationCluster(gaps::R3SegmentationPoint*, gaps::R3SegmentationPrimitive const&)
R3SegmentationCluster::
R3SegmentationCluster(R3SegmentationPoint *seed_point, const R3SegmentationPrimitive& primitive)
  : seed_point(seed_point),
    points(),
    parent(NULL),
    children(),
    pairs(),
    primitive(primitive),
    area(0),
    color(0,0,0),
    timestamp(0),
    category_identifier(-1),
    category_confidence(0),
    possible_affinity(0),
    total_affinity(0),
    segmentation(NULL),
    segmentation_index(-1)
{
  // Update color and area
  if (seed_point) color = seed_point->color;
  if (seed_point) timestamp = seed_point->timestamp;
  if (seed_point) area = seed_point->area;
  if (seed_point) category_identifier = seed_point->category_identifier;
  if (seed_point) category_confidence = seed_point->category_confidence;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, (%rdi)
leaq 0x8(%rdi), %rbx
movq %rbx, %rdi
callq 0xc4b50
movq $0x0, 0x18(%r15)
leaq 0x20(%r15), %r14
movq %r14, %rdi
callq 0xc4b50
leaq 0x30(%r15), %r13
movq %r13, %rdi
callq 0xc4b50
leaq 0x40(%r15), %rdi
movq %rbp, %rsi
callq 0x2923e
movq $0x0, 0xe8(%r15)
leaq 0xf0(%r15), %rbp
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rbp, %rdi
callq 0xc49c4
movq $0x0, 0x108(%r15)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x110(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x118(%r15)
movups %xmm0, 0x128(%r15)
movl %eax, 0x138(%r15)
testq %r12, %r12
je 0x2a0b5
leaq 0x78(%r12), %rsi
movq %rbp, %rdi
callq 0xc4a56
movsd 0x68(%r12), %xmm0
movsd %xmm0, 0x108(%r15)
movsd 0x70(%r12), %xmm0
movsd %xmm0, 0xe8(%r15)
movl 0x90(%r12), %eax
movl %eax, 0x110(%r15)
movsd 0x98(%r12), %xmm0
movsd %xmm0, 0x118(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
jmp 0x2a0e2
movq %rax, %r12
jmp 0x2a0ea
movq %rax, %r12
jmp 0x2a0f2
movq %rax, %r12
addq $0x48, %r15
movq %r15, %rdi
callq 0x89530
movq %r13, %rdi
callq 0xc4bba
movq %r14, %rdi
callq 0xc4bba
movq %rbx, %rdi
callq 0xc4bba
movq %r12, %rdi
callq 0x15ae0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::RemovePoint(gaps::R3SegmentationPoint*)
void R3SegmentationCluster::
RemovePoint(R3SegmentationPoint *point)
{
  // Just checking
  assert(point->cluster == this);
  assert(point->cluster_index >= 0);

  // Update cluster
  total_affinity -= point->cluster_affinity;
  color = (points.NEntries() > 1) ? (points.NEntries()*color - point->color) / (points.NEntries()-1) : RNblack_rgb;
  timestamp = (points.NEntries() > 1) ? (points.NEntries()*timestamp - point->timestamp) / (points.NEntries()-1) : 0;
  area -= point->area;

  // Remove point
  RNArrayEntry *entry = points.KthEntry(point->cluster_index);
  R3SegmentationPoint *tail = points.Tail();
  tail->cluster_index = point->cluster_index;
  points.EntryContents(entry) = tail;
  points.RemoveTail();

  // Update point
  point->cluster = NULL;
  point->cluster_index = -1;
  point->cluster_affinity = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movsd 0x128(%rdi), %xmm0
subsd 0xc8(%rsi), %xmm0
movsd %xmm0, 0x128(%rdi)
movl 0x14(%rdi), %eax
cmpl $0x2, %eax
jl 0x2a5fb
cvtsi2sd %eax, %xmm2
movsd 0xf0(%r14), %xmm0
mulsd %xmm2, %xmm0
movsd 0xf8(%r14), %xmm1
mulsd %xmm2, %xmm1
mulsd 0x100(%r14), %xmm2
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0xc49c4
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
subsd 0x78(%rbx), %xmm0
subsd 0x80(%rbx), %xmm1
movsd 0x10(%r15), %xmm2
subsd 0x88(%rbx), %xmm2
leaq 0x38(%rsp), %r15
movq %r15, %rdi
callq 0xc49c4
movl 0x14(%r14), %eax
decl %eax
cvtsi2sd %eax, %xmm3
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
divsd %xmm3, %xmm0
divsd %xmm3, %xmm1
movsd 0x10(%r15), %xmm2
divsd %xmm3, %xmm2
leaq 0x8(%rsp), %rdi
callq 0xc49c4
jmp 0x2a60c
leaq 0x54935e(%rip), %rsi    # 0x573960
leaq 0x8(%rsp), %rdi
callq 0xc49a6
leaq 0xf0(%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc4a56
movslq 0x14(%r14), %rax
xorpd %xmm0, %xmm0
cmpq $0x2, %rax
jl 0x2a64e
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x108(%r14), %xmm0
subsd 0x68(%rbx), %xmm0
leal -0x1(%rax), %ecx
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x108(%r14)
movsd 0xe8(%r14), %xmm0
subsd 0x70(%rbx), %xmm0
leaq 0x8(%r14), %rdi
movsd %xmm0, 0xe8(%r14)
movslq 0xd0(%rbx), %rcx
movq 0x8(%r14), %rdx
movq -0x8(%rdx,%rax,8), %rsi
movl %ecx, 0xd0(%rsi)
movq %rsi, (%rdx,%rcx,8)
leal -0x1(%rax), %esi
callq 0xc4d5a
xorpd %xmm0, %xmm0
movupd %xmm0, 0xc0(%rbx)
movl $0xffffffff, 0xd0(%rbx) # imm = 0xFFFFFFFF
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::InsertPoint(gaps::R3SegmentationPoint*, double)
void R3SegmentationCluster::
InsertPoint(R3SegmentationPoint *point, RNScalar affinity)
{
  // Remove from previous cluster
  if (point->cluster ) {
    if (point->cluster == this) return;
    else point->cluster->RemovePoint(point);
  }

  // Update cluster
  total_affinity += affinity; // point->cluster_affinity;
  color = (point->color + points.NEntries()*color) / (points.NEntries()+1);
  timestamp = (point->timestamp + points.NEntries()*timestamp) / (points.NEntries()+1);
  area += point->area;

  // Update category
  if ((category_identifier < 0) && (point->category_identifier >= 0)) {
    category_identifier = point->category_identifier;
    category_confidence = point->category_confidence;
  }

  // Update point
  point->cluster = this;
  point->cluster_index = points.NEntries();
  point->cluster_affinity = affinity;

  // Insert point
  points.Insert(point);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0xc0(%rsi), %rdi
testq %rdi, %rdi
movsd %xmm0, (%rsp)
je 0x2aaaa
cmpq %r14, %rdi
je 0x2ac0d
movq %rbx, %rsi
callq 0x2a52e
movsd (%rsp), %xmm0
movsd 0x128(%r14), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x128(%r14)
cvtsi2sdl 0x14(%r14), %xmm2
leaq 0x8(%r14), %r15
leaq 0xf0(%r14), %r12
movsd 0xf0(%r14), %xmm0
mulsd %xmm2, %xmm0
movsd 0xf8(%r14), %xmm1
mulsd %xmm2, %xmm1
mulsd 0x100(%r14), %xmm2
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0xc49c4
movsd 0x78(%rbx), %xmm0
movsd 0x80(%rbx), %xmm1
addsd (%r13), %xmm0
addsd 0x8(%r13), %xmm1
movsd 0x88(%rbx), %xmm2
addsd 0x10(%r13), %xmm2
leaq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0xc49c4
movl 0x14(%r14), %eax
incl %eax
cvtsi2sd %eax, %xmm3
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
divsd %xmm3, %xmm0
divsd %xmm3, %xmm1
movsd 0x10(%r13), %xmm2
divsd %xmm3, %xmm2
leaq 0x38(%rsp), %r13
movq %r13, %rdi
callq 0xc49c4
movq %r12, %rdi
movq %r13, %rsi
callq 0xc4a56
movl 0x14(%r14), %edx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
mulsd 0x108(%r14), %xmm0
addsd 0x68(%rbx), %xmm0
leal 0x1(%rdx), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x108(%r14)
movsd 0x70(%rbx), %xmm0
addsd 0xe8(%r14), %xmm0
movsd %xmm0, 0xe8(%r14)
cmpl $0x0, 0x110(%r14)
jns 0x2abe8
movl 0x90(%rbx), %eax
testl %eax, %eax
js 0x2abe8
movl %eax, 0x110(%r14)
movsd 0x98(%rbx), %xmm0
movsd %xmm0, 0x118(%r14)
movq %r14, 0xc0(%rbx)
movl %edx, 0xd0(%rbx)
movsd (%rsp), %xmm0
movsd %xmm0, 0xc8(%rbx)
movq %r15, %rdi
movq %rbx, %rsi
callq 0xc4be6
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::~R3SegmentationCluster()
R3SegmentationCluster::
~R3SegmentationCluster(void)
{
  // Delete children
  // for (int i = 0; i < children.NEntries(); i++) {
  //   delete children.Kth(i);
  // }

  // Remove from parent
  if (parent) parent->children.Remove(this);

  // Empty points
  EmptyPoints();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %r14
testq %r14, %r14
je 0x2ac4c
addq $0x20, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc4bc8
subq (%r14), %rax
shrq $0x3, %rax
movq %r14, %rdi
movl %eax, %esi
callq 0xc4d5a
movq %rbx, %rdi
callq 0x2ac8a
leaq 0x48(%rbx), %rdi
callq 0x89530
leaq 0x30(%rbx), %rdi
callq 0xc4bba
leaq 0x20(%rbx), %rdi
callq 0xc4bba
addq $0x8, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc4bba
movq %rax, %rdi
callq 0x1f40d
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::EmptyPoints()
void R3SegmentationCluster::
EmptyPoints(void)
{
  // Update points
  for (int i = 0; i < points.NEntries(); i++) {
    R3SegmentationPoint *point = points.Kth(i);
    point->cluster = NULL;
    point->cluster_affinity = 0;
    point->cluster_index = -1;
  }

  // Empty points
  points.Empty();

  // Update color and area
  color = RNblack_rgb;
  timestamp = 0;
  area = 0;

  // Update affinity
  total_affinity = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x8, %rdi
movslq 0x14(%rbx), %rax
testq %rax, %rax
jle 0x2acc3
movq (%rdi), %rcx
xorl %edx, %edx
xorps %xmm0, %xmm0
movq (%rcx,%rdx,8), %rsi
movups %xmm0, 0xc0(%rsi)
movl $0xffffffff, 0xd0(%rsi) # imm = 0xFFFFFFFF
incq %rdx
cmpq %rdx, %rax
jne 0x2aca6
xorl %r14d, %r14d
xorl %esi, %esi
callq 0xc4d90
leaq 0xf0(%rbx), %rdi
leaq 0x548c85(%rip), %rsi    # 0x573960
callq 0xc4a56
movq %r14, 0x108(%rbx)
movq %r14, 0xe8(%rbx)
movq %r14, 0x128(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::AxisExtents()
R3Box R3SegmentationCluster::
AxisExtents(void)
{
  // Get centroid and axes
  R3Point center;
  R3Triad triad = PrincipleAxes(&center);
  
  // Find extent
  R3Box extent = R3null_box;
  for (int i = 0; i < points.NEntries(); i++) {
    R3Point position = points[i]->position;
    R3Vector vector = position - center;
    RNScalar x = triad.Axis(0).Dot(vector);
    RNScalar y = triad.Axis(1).Dot(vector);
    RNScalar z = triad.Axis(2).Dot(vector);
    extent.Union(R3Point(x, y, z));
  }

  // Return extent
  return extent;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x9f4cc
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x2ad20
leaq 0x146d63(%rip), %rsi    # 0x171c78
movq %rbx, %rdi
callq 0x886d8
cmpl $0x0, 0x14(%r14)
jle 0x2afc7
xorl %r12d, %r12d
leaq 0xa0(%rsp), %r13
leaq 0x88(%rsp), %rbp
leaq 0x70(%rsp), %r15
movq 0x8(%r14), %rax
movq (%rax,%r12,8), %rsi
addq $0x8, %rsi
movq %r13, %rdi
callq 0x9f4de
movq %rbp, %rdi
movq %r13, %rsi
leaq 0x10(%rsp), %rdx
callq 0x9f730
leaq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0xa01fe
movsd %xmm0, 0x8(%rsp)
leaq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0xa01fe
movsd %xmm0, (%rsp)
leaq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0xa01fe
movaps %xmm0, %xmm2
movq %r15, %rdi
movsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
callq 0x9f4ce
movq %rbx, %rdi
movq %r15, %rsi
callq 0x890f6
incq %r12
movslq 0x14(%r14), %rax
cmpq %rax, %r12
jl 0x2af40
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2afe6
jmp 0x2afe6
jmp 0x2afe6
jmp 0x2afe6
jmp 0x2afe6
movq %rax, %r14
movq %rbx, %rdi
callq 0x89530
movq %r14, %rdi
callq 0x15ae0
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::RemoveChild(gaps::R3SegmentationCluster*)
void R3SegmentationCluster::
RemoveChild(R3SegmentationCluster *child)
{
  // Update area
  area -= child->area;

  // Update color
  int n = points.NEntries() - child->points.NEntries();
  color *= points.NEntries();
  color -= child->points.NEntries() * child->color;
  color = (n > 0) ? color / n : RNblack_rgb;

  // Update timestamp
  timestamp *= points.NEntries();
  timestamp -= child->points.NEntries() * child->timestamp;
  timestamp = (n > 0) ? timestamp / n : 0;

  // Remove child
  this->children.Remove(child);
  child->parent = NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movsd 0xe8(%rdi), %xmm0
subsd 0xe8(%rsi), %xmm0
movsd %xmm0, 0xe8(%rdi)
movl 0x14(%rdi), %ebp
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
leaq 0xf0(%rdi), %r15
movl 0x14(%rsi), %r13d
movq %r15, %rdi
callq 0xc4b00
cvtsi2sdl 0x14(%rbx), %xmm2
movsd 0xf0(%rbx), %xmm0
mulsd %xmm2, %xmm0
movsd 0xf8(%rbx), %xmm1
mulsd %xmm2, %xmm1
mulsd 0x100(%rbx), %xmm2
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0xc49c4
movq %r15, %rdi
movq %r12, %rsi
callq 0xc4aa4
subl %r13d, %ebp
cvtsi2sd %ebp, %xmm3
movsd %xmm3, 0x8(%rsp)
jle 0x2b43a
movsd 0xf0(%r14), %xmm0
movsd 0xf8(%r14), %xmm1
divsd %xmm3, %xmm0
divsd %xmm3, %xmm1
movsd 0x100(%r14), %xmm2
divsd %xmm3, %xmm2
leaq 0x10(%rsp), %rdi
callq 0xc49c4
jmp 0x2b44b
leaq 0x54851f(%rip), %rsi    # 0x573960
leaq 0x10(%rsp), %rdi
callq 0xc49a6
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0xc4a56
xorps %xmm0, %xmm0
cvtsi2sdl 0x14(%r14), %xmm0
mulsd 0x108(%r14), %xmm0
movsd %xmm0, 0x108(%r14)
testl %ebp, %ebp
jg 0x2b47d
xorpd %xmm0, %xmm0
jmp 0x2b497
xorps %xmm1, %xmm1
cvtsi2sdl 0x14(%rbx), %xmm1
mulsd 0x108(%rbx), %xmm1
subsd %xmm1, %xmm0
divsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x108(%r14)
leaq 0x20(%r14), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xc4bc8
subq 0x20(%r14), %rax
shrq $0x3, %rax
movq %r15, %rdi
movl %eax, %esi
callq 0xc4d5a
movq $0x0, 0x18(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/../../pkgs/RNBasics/RNRgb.h
// Function: gaps::R3SegmentationCluster::UpdateColor()
inline void RNRgb::
Reset (RNScalar red, RNScalar green, RNScalar blue)
{
    // Set all components
    c[0] = red;
    c[1] = green;
    c[2] = blue;
}

// Assembly:
xorpd %xmm0, %xmm0
movupd %xmm0, 0xf0(%rdi)
movq $0x0, 0x100(%rdi)
cmpl $0x0, 0x14(%rdi)
je 0x2b8ac
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0xf0(%rdi), %rbx
movl 0x14(%rdi), %eax
testl %eax, %eax
jle 0x2b898
xorl %r15d, %r15d
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rsi
addq $0x78, %rsi
movq %rbx, %rdi
callq 0xc4a76
incq %r15
movslq 0x14(%r14), %rax
cmpq %rax, %r15
jl 0x2b878
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq %rbx, %rdi
callq 0xc4b22
popq %rbx
popq %r14
popq %r15
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::UpdateTimestamp()
int R3SegmentationCluster::
UpdateTimestamp(void)
{
  // Update timestamp
  timestamp = 0;
  if (points.NEntries() == 0) return 1;
  for (int i = 0; i < points.NEntries(); i++)
    timestamp += points[i]->timestamp;
  timestamp /= points.NEntries();
  return 1;
}

// Assembly:
movq $0x0, 0x108(%rdi)
movl 0x14(%rdi), %eax
testq %rax, %rax
je 0x2b90b
testl %eax, %eax
jle 0x2b8f0
movsd 0x108(%rdi), %xmm0
movq 0x8(%rdi), %rcx
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
addsd 0x68(%rsi), %xmm0
incq %rdx
cmpq %rdx, %rax
jne 0x2b8d7
movsd %xmm0, 0x108(%rdi)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x108(%rdi), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x108(%rdi)
movl $0x1, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationCluster::UpdateArea()
int R3SegmentationCluster::
UpdateArea(void)
{
  // Update area
  area = 0;
  for (int i = 0; i < points.NEntries(); i++)
    area += points[i]->area;
  return 1;
}

// Assembly:
movq $0x0, 0xe8(%rdi)
movslq 0x14(%rdi), %rax
testq %rax, %rax
jle 0x2b94d
movsd 0xe8(%rdi), %xmm0
movq 0x8(%rdi), %rcx
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
addsd 0x70(%rsi), %xmm0
incq %rdx
cmpq %rdx, %rax
jne 0x2b934
movsd %xmm0, 0xe8(%rdi)
movl $0x1, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPair::R3SegmentationPair(gaps::R3SegmentationCluster*, gaps::R3SegmentationCluster*, double)
R3SegmentationPair::
R3SegmentationPair(R3SegmentationCluster *cluster1, R3SegmentationCluster *cluster2, RNScalar affinity)
  : affinity(affinity),
    heapentry(NULL)
{
  // Insert pair into clusters
  if (cluster1 && cluster2) {
    // Remember clusters
    clusters[0] = cluster1;
    clusters[1] = cluster2;

    // Remember position of pair in clusters
    cluster_index[0] = cluster1->pairs.NEntries();
    cluster_index[1] = cluster2->pairs.NEntries();

    // Update clusters
    cluster1->pairs.Insert(this);
    cluster2->pairs.Insert(this);
  }
  else {
    // Initialize clusters
    clusters[0] = NULL;
    clusters[1] = NULL;

    // Initialize cluster index
    cluster_index[0] = -1;
    cluster_index[1] = -1;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movsd %xmm0, 0x18(%rdi)
movq $0x0, 0x20(%rdi)
testq %rsi, %rsi
sete %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x2c1ca
movq %rdx, %r14
movq %rsi, (%rbx)
movq %rdx, 0x8(%rbx)
leaq 0x30(%rsi), %rdi
movl 0x3c(%rsi), %eax
movl %eax, 0x10(%rbx)
leaq 0x30(%rdx), %r15
movl 0x3c(%rdx), %eax
movl %eax, 0x14(%rbx)
movl 0x3c(%rsi), %edx
movq %rbx, %rsi
callq 0xc4be6
movl 0x3c(%r14), %edx
movq %r15, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xc4be6
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $-0x1, 0x10(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3SegmentationPair::~R3SegmentationPair()
R3SegmentationPair::
~R3SegmentationPair(void)
{
  // Remove this pair from first cluster
  if (clusters[0]) {
    assert(cluster_index[0] >= 0);
    RNArrayEntry *entry = clusters[0]->pairs.KthEntry(cluster_index[0]);
    R3SegmentationPair *tail = clusters[0]->pairs.Tail();
    if (tail->clusters[0] == clusters[0]) tail->cluster_index[0] = cluster_index[0];
    else if (tail->clusters[1] == clusters[0]) tail->cluster_index[1] = cluster_index[0];
    clusters[0]->pairs.EntryContents(entry) = tail;
    clusters[0]->pairs.RemoveTail();
  }

  // Remove this pair from second cluster
  if (clusters[1]) {
    assert(cluster_index[1] >= 0);
    RNArrayEntry *entry = clusters[1]->pairs.KthEntry(cluster_index[1]);
    R3SegmentationPair *tail = clusters[1]->pairs.Tail();
    if (tail->clusters[0] == clusters[1]) tail->cluster_index[0] = cluster_index[1];
    else if (tail->clusters[1] == clusters[1]) tail->cluster_index[1] = cluster_index[1];
    clusters[1]->pairs.EntryContents(entry) = tail;
    clusters[1]->pairs.RemoveTail();
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rsi
testq %rsi, %rsi
je 0x2c225
movl 0x10(%rbx), %edx
movq 0x30(%rsi), %rax
movslq %edx, %rcx
movslq 0x3c(%rsi), %rdi
movq -0x8(%rax,%rdi,8), %rdi
cmpq %rsi, (%rdi)
je 0x2c20d
cmpq %rsi, 0x8(%rdi)
jne 0x2c210
movl %edx, 0x14(%rdi)
jmp 0x2c210
movl %edx, 0x10(%rdi)
movq %rdi, (%rax,%rcx,8)
movq (%rbx), %rdi
movl 0x3c(%rdi), %esi
addq $0x30, %rdi
decl %esi
callq 0xc4d5a
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x2c26a
movl 0x14(%rbx), %edx
movq 0x30(%rsi), %rax
movslq %edx, %rcx
movslq 0x3c(%rsi), %rdi
movq -0x8(%rax,%rdi,8), %rdi
cmpq %rsi, (%rdi)
je 0x2c251
cmpq %rsi, 0x8(%rdi)
jne 0x2c254
movl %edx, 0x14(%rdi)
jmp 0x2c254
movl %edx, 0x10(%rdi)
movq %rdi, (%rax,%rcx,8)
movq 0x8(%rbx), %rdi
movl 0x3c(%rdi), %esi
addq $0x30, %rdi
decl %esi
callq 0xc4d5a
popq %rbx
retq
movq %rax, %rdi
callq 0x1f40d
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3Segmentation::~R3Segmentation()
R3Segmentation::
~R3Segmentation(void)
{
  // Delete clusters
  for (int i = 0; i < clusters.NEntries(); i++) delete clusters[i];
  
  // Delete kdtree
  if (kdtree) delete kdtree;

  // Delete points
  if (point_buffer) delete [] point_buffer;
  else { for (int i = 0; i < points.NEntries(); i++) delete points[i]; }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
cmpl $0x0, 0x24(%rdi)
jle 0x2c472
xorl %r12d, %r12d
movq (%r14), %rax
movq (%rax,%r12,8), %r15
testq %r15, %r15
je 0x2c466
movq %r15, %rdi
callq 0x2ac1c
movl $0x140, %esi            # imm = 0x140
movq %r15, %rdi
callq 0x15620
incq %r12
movslq 0x24(%rbx), %rax
cmpq %rax, %r12
jl 0x2c445
movq 0x10(%rbx), %r15
testq %r15, %r15
je 0x2c490
movq %r15, %rdi
callq 0x2eae6
movl $0x60, %esi
movq %r15, %rdi
callq 0x15620
movq 0x28(%rbx), %r12
testq %r12, %r12
je 0x2c4da
leaq -0x8(%r12), %r15
movq -0x8(%r12), %r13
testq %r13, %r13
je 0x2c4c5
addq $-0x30, %r12
imulq $0xe0, %r13, %rbp
leaq (%r12,%rbp), %rdi
callq 0xc4bba
addq $-0xe0, %rbp
jne 0x2c4b3
imulq $0xe0, %r13, %rsi
orq $0x8, %rsi
movq %r15, %rdi
callq 0x15c30
jmp 0x2c514
cmpl $0x0, 0xc(%rbx)
jle 0x2c514
xorl %r12d, %r12d
movq (%rbx), %rax
movq (%rax,%r12,8), %r15
testq %r15, %r15
je 0x2c508
leaq 0xb0(%r15), %rdi
callq 0xc4bba
movl $0xe0, %esi
movq %r15, %rdi
callq 0x15620
incq %r12
movslq 0xc(%rbx), %rax
cmpq %rax, %r12
jl 0x2c4e3
movq %r14, %rdi
callq 0xc4bba
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc4bba
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3Segmentation::Affinity() const
RNScalar R3Segmentation::
Affinity(void) const
{
  RNScalar sum = 0;
  for (int i = 0; i < clusters.NEntries(); i++) {
    sum += clusters[i]->total_affinity;
  }
  return sum;
}

// Assembly:
movslq 0x24(%rdi), %rax
testq %rax, %rax
jle 0x2c55a
movq 0x18(%rdi), %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
addsd 0x128(%rsi), %xmm0
incq %rdx
cmpq %rdx, %rax
jne 0x2c545
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3Segmentation::NUnclusteredPoints() const
int R3Segmentation::
NUnclusteredPoints(void) const
{
  // Count unclustered points
  int count = 0;
  for (int i = 0; i < points.NEntries(); i++) {
    R3SegmentationPoint *point = points.Kth(i);
    if (!point->cluster) count++;
  }

  // Return number of unclustered points
  return count;
}

// Assembly:
movslq 0xc(%rdi), %rcx
testq %rcx, %rcx
jle 0x2c586
movq (%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %rdi
cmpq $0x1, 0xc0(%rdi)
adcl $0x0, %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x2c56e
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3Segmentation::CreateSingletonClusters(int)
int R3Segmentation::
CreateSingletonClusters(int primitive_type)
{
  // Create cluster for every point
  for (int i = 0; i < points.NEntries(); i++) {
    R3SegmentationPoint *point = points.Kth(i);

    // Create primitive
    R3SegmentationPrimitive primitive(primitive_type);
    primitive.Update(point);
    
    // Create cluster
    R3SegmentationCluster *cluster = new R3SegmentationCluster(point, primitive);

    // Insert point
    cluster->InsertPoint(point, 1.0);

    // Insert cluster
    cluster->segmentation = this;
    cluster->segmentation_index = clusters.NEntries();    
    clusters.Insert(cluster);
  }

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %esi, 0xc(%rsp)
cmpl $0x0, 0xc(%rdi)
jle 0x2cfda
movq %rdi, %r14
leaq 0x18(%rdi), %r15
xorl %ebx, %ebx
leaq 0x10(%rsp), %r13
movq (%r14), %rax
movq (%rax,%rbx,8), %rbp
movq %r13, %rdi
movl 0xc(%rsp), %esi
callq 0x291d0
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x29334
movl $0x140, %edi            # imm = 0x140
callq 0x15610
movq %rax, %r12
movq %rax, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x29fbe
movq %r12, %rdi
movq %rbp, %rsi
movsd 0xde0b4(%rip), %xmm0    # 0x10b050
callq 0x2aa70
movq %r14, 0x130(%r12)
movl 0x24(%r14), %edx
movl %edx, 0x138(%r12)
movq %r15, %rdi
movq %r12, %rsi
callq 0xc4be6
leaq 0x18(%rsp), %rdi
callq 0x89530
incq %rbx
movslq 0xc(%r14), %rax
cmpq %rax, %rbx
jl 0x2cf53
movl $0x1, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2d005
movq %rax, %rbx
movl $0x140, %esi            # imm = 0x140
movq %r12, %rdi
callq 0x15620
jmp 0x2d008
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x89530
movq %rbx, %rdi
callq 0x15ae0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3Segmentation::ReassignClusters()
int R3Segmentation::
ReassignClusters(void)
{
  // Iteratively update everything
  for (int iter = 0; iter < max_reassignment_iterations; iter++) {
    // Copy list of clusters
    RNArray<R3SegmentationCluster *> tmp = clusters;
    tmp.Sort(CompareClusters);

    // Will rebuild list of clusters
    clusters.Empty();

    // Update each cluster
    RNBoolean converged = TRUE;
    for (int i = 0; i < tmp.NEntries(); i++) {
      R3SegmentationCluster *cluster = tmp.Kth(i);
      int prev_npoints = cluster->points.NEntries();

      // Update cluster (including reassigning points)
      RNBoolean error = FALSE;
      if (!error && !cluster->UpdatePrimitive()) error = TRUE;
      if (!error && !cluster->UpdatePoints(kdtree)) error = TRUE; 
      if (!error && !cluster->UpdateColor()) error = TRUE; 
      if (!error && !cluster->UpdateTimestamp()) error = TRUE; 

      // Insert cluster
      cluster->segmentation = this;
      cluster->segmentation_index = clusters.NEntries();    
      if (!error) clusters.Insert(cluster);
      else delete cluster;

      // Check for convergence
      if (error || (prev_npoints != cluster->points.NEntries())) {
        converged = FALSE;
      }
    }

    // Check if converged
    if (converged) break;
  }

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x0, 0xbc(%rdi)
jle 0x2d316
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
xorl %r15d, %r15d
leaq 0x8(%rsp), %r12
movq %r14, 0x18(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0xc4b58
movq %r12, %rdi
leaq 0x143(%rip), %rsi       # 0x2d341
callq 0xc4ec4
movq %r14, %rdi
xorl %esi, %esi
callq 0xc4d90
cmpl $0x0, 0x14(%rsp)
jle 0x2d30c
movq %r15, 0x20(%rsp)
movl $0x1, %r15d
xorl %r12d, %r12d
movq 0x8(%rsp), %rax
movq (%rax,%r12,8), %r13
leaq 0x8(%r13), %rdx
movl 0x14(%r13), %r14d
leaq 0x40(%r13), %rbp
movq (%r13), %rsi
movq %rbp, %rdi
callq 0x29334
cmpl $0x0, (%rbp)
je 0x2d25d
movq 0x10(%rbx), %rsi
movq %r13, %rdi
callq 0x2b4d8
movl %eax, %ebp
jmp 0x2d25f
xorl %ebp, %ebp
testb %bpl, %bpl
je 0x2d299
movq %r13, %rdi
callq 0x2b842
testb %bpl, %bpl
je 0x2d299
movq %r13, %rdi
callq 0x2b8b2
movq %rbx, 0x130(%r13)
movl 0x24(%rbx), %edx
movl %edx, 0x138(%r13)
movq 0x18(%rsp), %rdi
movq %r13, %rsi
callq 0xc4be6
jmp 0x2d2bf
movq %rbx, 0x130(%r13)
movl 0x24(%rbx), %eax
movl %eax, 0x138(%r13)
movq %r13, %rdi
callq 0x2ac1c
movl $0x140, %esi            # imm = 0x140
movq %r13, %rdi
callq 0x15620
testb %bpl, %bpl
je 0x2d2ca
cmpl 0x14(%r13), %r14d
je 0x2d2cd
xorl %r15d, %r15d
incq %r12
movslq 0x14(%rsp), %rax
cmpq %rax, %r12
jl 0x2d226
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0xc4bba
testl %r15d, %r15d
movq 0x18(%rsp), %r14
movq 0x20(%rsp), %r15
jne 0x2d316
incl %r15d
cmpl 0xbc(%rbx), %r15d
jl 0x2d1e9
jmp 0x2d316
leaq 0x8(%rsp), %rdi
callq 0xc4bba
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2d32c
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xc4bba
movq %rbx, %rdi
callq 0x15ae0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/R3Segmentation.cpp
// Function: gaps::R3Segmentation::RefineBoundaries()
int R3Segmentation::
RefineBoundaries(void)
{
  // Check if should refine boundaries
  if (!refine_boundaries) return 1;

  // Iteratively refine boundaries
  for (int iter = 0; iter < 1000; iter++) {
    RNBoolean done = TRUE;
    for (int i0 = 0; i0 < points.NEntries(); i0++) {
      R3SegmentationPoint *point0 = points.Kth(i0);
      if (point0->neighbors.NEntries() < 3) continue;
      R3SegmentationCluster *cluster0 = point0->cluster;
      if (!cluster0) continue;
      int i1 = RNRandomScalar() * point0->neighbors.NEntries();
      R3SegmentationPoint *point1 = point0->neighbors.Kth(i1);
      R3SegmentationCluster *cluster1 = point1->cluster;
      if (!cluster1) continue;
      if (cluster0 == cluster1) continue;
      int count = 0;
      for (int i2 = 0; i2 < point0->neighbors.NEntries(); i2++) {
        R3SegmentationPoint *point2 = point0->neighbors.Kth(i2);
        R3SegmentationCluster *cluster2 = point2->cluster;
        if (!cluster2) continue;
        if (cluster2 == cluster1) count++;
      }
      if (count > point0->neighbors.NEntries()/2) {
        cluster0->RemovePoint(point0);
        cluster1->InsertPoint(point0, point0->cluster_affinity);
        done = FALSE;
      }
    }
    if (done) break;
  }

  // Return success
  return 1;
}

// Assembly:
cmpl $0x0, 0xd8(%rdi)
je 0x2de9d
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r13d, %r13d
cmpl $0x0, 0xc(%rbx)
jle 0x2de79
movl $0x1, 0x4(%rsp)
xorl %ebp, %ebp
movq (%rbx), %rax
movq (%rax,%rbp,8), %r14
cmpl $0x3, 0xbc(%r14)
jl 0x2de5f
movq 0xc0(%r14), %r15
testq %r15, %r15
je 0x2de5f
callq 0xc6b94
movl 0xbc(%r14), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movq 0xb0(%r14), %rcx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rdx
movq 0xc0(%rdx), %r12
testq %r12, %r12
je 0x2de5f
cmpq %r12, %r15
je 0x2de5f
testl %eax, %eax
jle 0x2de29
xorl %esi, %esi
xorl %edx, %edx
movq (%rcx,%rsi,8), %rdi
movq 0xc0(%rdi), %rdi
testq %rdi, %rdi
setne %r8b
cmpq %r12, %rdi
sete %dil
andb %r8b, %dil
movzbl %dil, %edi
addl %edi, %edx
incq %rsi
cmpq %rsi, %rax
jne 0x2ddfd
jmp 0x2de2b
xorl %edx, %edx
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
cmpl %ecx, %edx
jle 0x2de5f
movq %r15, %rdi
movq %r14, %rsi
callq 0x2a52e
movsd 0xc8(%r14), %xmm0
movq %r12, %rdi
movq %r14, %rsi
callq 0x2aa70
movl $0x0, 0x4(%rsp)
incq %rbp
movslq 0xc(%rbx), %rax
cmpq %rax, %rbp
jl 0x2dd96
cmpl $0x0, 0x4(%rsp)
setne %al
jmp 0x2de7b
movb $0x1, %al
testb %al, %al
jne 0x2de8f
incl %r13d
cmpl $0x3e8, %r13d           # imm = 0x3E8
jne 0x2dd82
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movl $0x1, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Utils/../../pkgs/R3Shapes/R3Kdtree.cpp
// Function: gaps::R3Kdtree<gaps::R3SegmentationPoint*>::FindAll(gaps::R3Point const&, double, double, gaps::RNArray<gaps::R3SegmentationPoint*>&) const
int R3Kdtree<PtrType>::
FindAll(const R3Point& query_position, RNScalar min_distance, RNScalar max_distance, RNArray<PtrType>& points) const
{
  // Check root
  if (!root) return 0;

  // Use squared distances for efficiency
  if (max_distance < 0) return 0;
  if (min_distance < 0) min_distance = 0;
  RNLength min_distance_squared = min_distance * min_distance;
  RNLength max_distance_squared = max_distance * max_distance;

  // Search nodes recursively
  FindAll(root, bbox, 
    NULL, query_position, 
    min_distance_squared, max_distance_squared, 
    NULL, NULL, 
    points);

  // Return number of points
  return points.NEntries();
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movapd %xmm0, %xmm2
movq %rsi, %r8
movq 0x50(%rdi), %rsi
testq %rsi, %rsi
sete %cl
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
seta %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x2eae3
maxsd %xmm2, %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
movq %rdi, %rdx
xorl %ecx, %ecx
xorl %r9d, %r9d
pushq %rbx
pushq $0x0
callq 0x2ed34
addq $0x10, %rsp
movl 0xc(%rbx), %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/RipcordSoftware[P]lazyflatset/test/lazyflatset/main.cpp
// Function: test(std::function<void (__gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int, std::allocator<unsigned int>>>, __gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int, std::allocator<unsigned int>>>)>, __gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int, std::allocator<unsigned int>>>, __gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int, std::allocator<unsigned int>>>, bool)
void test(TestFunction func, SourceIterator begin, SourceIterator end, bool eol = false) {
    auto start = std::chrono::steady_clock::now();
    func(begin, end);
    auto duration = std::chrono::steady_clock::now() - start;
    auto durationMS = std::chrono::duration_cast<std::chrono::milliseconds>(duration);
    
    std::cout << durationMS.count();
    
    if (eol) {
        std::cout << std::endl;
    } else {
        std::cout << ", ";
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebx
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
callq 0x2190
movq %r13, 0x8(%rsp)
movq %r12, (%rsp)
cmpq $0x0, 0x10(%r15)
je 0x28f2
movq %rax, %r14
leaq 0x8(%rsp), %rsi
movq %rsp, %rdx
movq %r15, %rdi
callq *0x18(%r15)
callq 0x2190
subq %r14, %rax
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
imulq %rcx
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x12, %rdx
addq %rdx, %rsi
movq 0x6741(%rip), %r14      # 0x8fd8
movq %r14, %rdi
callq 0x2130
testb %bl, %bl
je 0x28cc
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
jmp 0x28e4
movq 0x6705(%rip), %rdi      # 0x8fd8
leaq 0x3813(%rip), %rsi      # 0x60ed
movl $0x2, %edx
callq 0x2170
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x2090