// File: /workspace/github_cpp_makefile_star2_O1/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 $0x228, %rsp            # imm = 0x228
xorps %xmm0, %xmm0
movaps %xmm0, -0x90(%rbp)
xorl %eax, %eax
movq %rax, -0x80(%rbp)
movq %rax, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
leaq -0x180(%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 0x3c4c(%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 -0x250(%rbp), %rdi
callq 0x5068
leaq -0x90(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x471a
leaq -0x250(%rbp), %rdi
callq 0x51a8
movq 0x6b55(%rip), %rdi      # 0xafc8
leaq 0x3c71(%rip), %rsi      # 0x80eb
movl $0xc, %edx
callq 0x21d0
movq -0x88(%rbp), %rax
subq -0x90(%rbp), %rax
sarq $0x2, %rax
movabsq $0x6db6db6db6db6db7, %rsi # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %rsi
movq 0x6b1d(%rip), %rdi      # 0xafc8
callq 0x2110
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
leaq -0x180(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x25c4
leaq -0x50(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x554e
leaq -0x50(%rbp), %rdi
movq (%rdi), %r14
movq 0x10(%rdi), %rax
movq %rax, -0x38(%rbp)
leaq -0x168(%rbp), %rsi
movq %r14, -0x30(%rbp)
callq 0x554e
leaq -0x50(%rbp), %rdi
movq (%rdi), %r15
movq 0x10(%rdi), %r12
leaq -0x150(%rbp), %rdx
leaq -0x180(%rbp), %rsi
callq 0x32d0
movq -0x70(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x50(%rbp), %r13
movq -0x48(%rbp), %rax
movq %r13, -0x70(%rbp)
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rbx
movq %rbx, -0x60(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
testq %rdi, %rdi
je 0x4576
subq %rdi, %rsi
callq 0x21c0
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x458b
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x21c0
leaq -0xa0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x3b5b(%rip), %rsi      # 0x80f8
leaq 0x3b6a(%rip), %rdx      # 0x810e
leaq -0xb0(%rbp), %rdi
callq 0x79fc
leaq -0x70(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x48c9
movq -0xb0(%rbp), %rdi
cmpq %r14, %rdi
je 0x45db
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x21c0
leaq -0x180(%rbp), %rdi
callq 0x51a8
testq %r13, %r13
movq -0x30(%rbp), %r14
je 0x45fe
subq %r13, %rbx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x21c0
testq %r15, %r15
je 0x4611
subq %r15, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x21c0
testq %r14, %r14
je 0x4625
movq -0x38(%rbp), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x21c0
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x463d
movq -0x80(%rbp), %rsi
subq %rdi, %rsi
callq 0x21c0
xorl %eax, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r13
movq -0xb0(%rbp), %rdi
cmpq %r14, %rdi
je 0x46af
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x46af
jmp 0x4673
movq %rax, %r13
jmp 0x46af
movq %rax, %r13
xorl %r15d, %r15d
xorl %r12d, %r12d
jmp 0x46af
jmp 0x4696
movq %rax, %r13
leaq -0x250(%rbp), %rdi
callq 0x51a8
jmp 0x4699
movq %rax, %r13
movq $0x0, -0x38(%rbp)
xorl %r15d, %r15d
xorl %r12d, %r12d
movq $0x0, -0x30(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x51a8
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x46d0
movq -0x60(%rbp), %rsi
subq %rdi, %rsi
callq 0x21c0
testq %r15, %r15
je 0x46e3
subq %r15, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x21c0
cmpq $0x0, -0x30(%rbp)
je 0x46fa
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdi
subq %rdi, %rsi
callq 0x21c0
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x4712
movq -0x80(%rbp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %r13, %rdi
callq 0x22b0