// File: ChristalC[P]Online-Outlier-Detection/p2_helper.cpp
// Function: splitCsv(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<double> splitCsv(string ip) {
  vector<double> out;
  // Split the string by comma
  string buf;
  stringstream ss(ip);

  vector<double> empty_vector;
  
  while (getline(ss, buf, ',')) {
    size_t idx = 0;
    double d = stod(buf, &idx);
    if (idx < buf.size()) {
      cout << "Detect invalid number. " << endl;
      return empty_vector;
    }
    if (d < 0) {
      cout << "Detect negative point, invalid. " << endl;
      return empty_vector;
    }
    out.push_back(d);
  }
  return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rsi, -0x228(%rbp)
movq %rdi, -0x220(%rbp)
movq %rdi, %rax
movq %rax, -0x218(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x3cd0
leaq -0x48(%rbp), %rdi
callq 0x3370
movl $0x10, %edi
movl $0x8, %esi
callq 0x98c0
movl %eax, -0x210(%rbp)
jmp 0x9184
movl -0x210(%rbp), %edx
movq -0x228(%rbp), %rsi
leaq -0x1d0(%rbp), %rdi
callq 0x33f0
jmp 0x919f
leaq -0x1f8(%rbp), %rdi
callq 0x3cd0
leaq -0x1d0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movl $0x2c, %edx
callq 0x3480
movq %rax, -0x230(%rbp)
jmp 0x91c9
movq -0x230(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3330
movb %al, -0x231(%rbp)
jmp 0x91e7
movb -0x231(%rbp), %al
testb $0x1, %al
jne 0x91f6
jmp 0x9362
movq $0x0, -0x200(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x9a10
movsd %xmm0, -0x240(%rbp)
jmp 0x921b
movsd -0x240(%rbp), %xmm0
movsd %xmm0, -0x208(%rbp)
movq -0x200(%rbp), %rax
movq %rax, -0x248(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x31b0
movq %rax, %rcx
movq -0x248(%rbp), %rax
cmpq %rcx, %rax
jae 0x92ee
movq 0xad6c(%rip), %rdi      # 0x13fc8
leaq 0x3e26(%rip), %rsi      # 0xd089
callq 0x3280
movq %rax, -0x250(%rbp)
jmp 0x9271
movq -0x250(%rbp), %rdi
movq 0xad31(%rip), %rsi      # 0x13fb0
callq 0x32d0
jmp 0x9286
movq -0x220(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x9a50
movl $0x1, -0x20c(%rbp)
jmp 0x937c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d8(%rbp)
movl %eax, -0x1dc(%rbp)
jmp 0x93b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d8(%rbp)
movl %eax, -0x1dc(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x3fa0
leaq -0x1d0(%rbp), %rdi
callq 0x31d0
jmp 0x93b6
xorps %xmm0, %xmm0
ucomisd -0x208(%rbp), %xmm0
jbe 0x934b
movq 0xacc6(%rip), %rdi      # 0x13fc8
leaq 0x3d98(%rip), %rsi      # 0xd0a1
callq 0x3280
movq %rax, -0x258(%rbp)
jmp 0x9317
movq -0x258(%rbp), %rdi
movq 0xac8b(%rip), %rsi      # 0x13fb0
callq 0x32d0
jmp 0x932c
movq -0x220(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x9a50
movl $0x1, -0x20c(%rbp)
jmp 0x937c
leaq -0x28(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x9a80
jmp 0x935d
jmp 0x91ab
movq -0x220(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x9a50
movl $0x1, -0x20c(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x3fa0
leaq -0x1d0(%rbp), %rdi
callq 0x31d0
leaq -0x48(%rbp), %rdi
callq 0x31a0
leaq -0x28(%rbp), %rdi
callq 0x3fa0
movq -0x218(%rbp), %rax
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x31a0
leaq -0x28(%rbp), %rdi
callq 0x3fa0
movq -0x1d8(%rbp), %rdi
callq 0x3450
nopw %cs:(%rax,%rax)