// File: /workspace/github_cpp_makefile_star2_O3/mitchellsayer[P]FastPointCloudSegmentation/src/main.cc
// Function: main
int main() {

  int n_iters = 3;
  int n_lpr = 20;
  int n_segs = 3;
  double seed_thresh = 0.4; //meters
  double dist_thresh = 0.2; //meters

  double th_run = 0.5;
  double th_merge = 1.0;
  int x_max = 30;
  int y_max = 15;
  int n_scanlines = 50;

  std::vector<Vec3> input_cloud;
  std::vector<Vec3> predicted_ground;
  std::vector<Vec3> predicted_not_ground;
  std::vector<Vec3> predicted_clusters;

  PointCloudSegmenter segmenter(x_max, y_max, n_iters, n_lpr, n_segs, seed_thresh, dist_thresh, n_scanlines, th_run, th_merge);

  parseInput(input_cloud, segmenter);
  std::cout << "Input size: " << input_cloud.size() << std::endl;

  segmenter.GroundPlaneFitting(input_cloud);

  predicted_ground = segmenter.GetGroundPoints();
  predicted_not_ground = segmenter.GetNonGroundPoints();

  predicted_clusters = segmenter.ScanLineRun(segmenter.p_all);
  generateOutput(predicted_clusters, "predicted_clusters.txt");

  return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
xorl %eax, %eax
movq %rax, -0x50(%rbp)
movq %rax, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
leaq -0x190(%rbp), %rsi
movq %rax, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movups %xmm0, 0x88(%rsi)
movups %xmm0, 0x98(%rsi)
movups %xmm0, 0xa8(%rsi)
movups %xmm0, 0xb8(%rsi)
movq %rax, 0xc8(%rsi)
movaps 0x3d43(%rip), %xmm0     # 0x8040
movups %xmm0, 0x58(%rsi)
movabsq $0x3fd999999999999a, %rax # imm = 0x3FD999999999999A
movq %rax, 0x48(%rsi)
movabsq $0x3fc999999999999a, %rax # imm = 0x3FC999999999999A
movq %rax, 0x50(%rsi)
movabsq $0xf0000001e, %rax      # imm = 0xF0000001E
movq %rax, 0x80(%rsi)
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, 0x70(%rsi)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x78(%rsi)
leaq -0x260(%rbp), %rdi
callq 0x4f58
leaq -0x60(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x45fb
leaq -0x260(%rbp), %rdi
callq 0x5098
movq 0x6c4f(%rip), %rdi      # 0xafc8
leaq 0x3d6b(%rip), %rsi      # 0x80eb
movl $0xc, %edx
callq 0x21c0
movq -0x58(%rbp), %rax
subq -0x60(%rbp), %rax
sarq $0x2, %rax
movabsq $0x6db6db6db6db6db7, %rsi # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %rsi
movq 0x6c1d(%rip), %rdi      # 0xafc8
callq 0x2110
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
leaq -0x190(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x25a4
leaq -0x98(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x542a
leaq -0x98(%rbp), %rdi
movq (%rdi), %rax
movq %rax, -0x38(%rbp)
movq 0x10(%rdi), %rax
movq %rax, -0x40(%rbp)
leaq -0x178(%rbp), %rsi
callq 0x542a
leaq -0x98(%rbp), %rdi
movq (%rdi), %r15
movq 0x10(%rdi), %r12
leaq -0x160(%rbp), %rdx
leaq -0x190(%rbp), %rsi
callq 0x3228
movq -0x98(%rbp), %r13
movq -0x90(%rbp), %rax
movq %r13, -0x80(%rbp)
movq %rax, -0x78(%rbp)
movq -0x88(%rbp), %rbx
movq %rbx, -0x70(%rbp)
leaq -0xa8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x3c85(%rip), %rsi      # 0x80f8
leaq 0x3c94(%rip), %rdx      # 0x810e
leaq -0xb8(%rbp), %rdi
callq 0x77e6
leaq -0x80(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x47aa
movq -0xb8(%rbp), %rdi
cmpq %r14, %rdi
je 0x44b1
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq -0x190(%rbp), %rdi
callq 0x5098
testq %r13, %r13
je 0x44d0
subq %r13, %rbx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x21b0
testq %r15, %r15
je 0x44e3
subq %r15, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x21b0
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x44f8
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x450d
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
xorl %eax, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, -0x30(%rbp)
movq -0xb8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4546
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x21b0
jmp 0x4546
movq %rax, -0x30(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x5098
testq %r13, %r13
je 0x45b3
subq %r13, %rbx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x21b0
jmp 0x45b3
movq %rax, -0x30(%rbp)
jmp 0x45a7
movq %rax, -0x30(%rbp)
xorl %r15d, %r15d
xorl %r12d, %r12d
jmp 0x45a7
jmp 0x458d
movq %rax, -0x30(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x5098
jmp 0x4591
movq %rax, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
xorl %r15d, %r15d
xorl %r12d, %r12d
movq $0x0, -0x38(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x5098
testq %r15, %r15
je 0x45c6
subq %r15, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x21b0
cmpq $0x0, -0x38(%rbp)
je 0x45dd
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdi
subq %rdi, %rsi
callq 0x21b0
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x45f2
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq -0x30(%rbp), %rdi
callq 0x22a0