// File: /workspace/github_cpp_makefile_star2_O2/atfrank[P]PCASA/lib/Misc.cpp
// Function: void Misc::splitNum<int>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<int, std::allocator<int>>&, bool)
void Misc::splitNum (const std::string &str, const std::string &delim, std::vector<SplitVec> &out, const bool repeat){
  out.clear();
  out.reserve(500); //Still need resizing but reduces moving of data in memory
  size_t p0=0;
  size_t p1=std::string::npos;
  size_t plast=std::string::npos;
  SplitVec tmp;

  //Only use this if all columns are needed as a number!

  //"repeat" = true means that a blank string is added when there are
  //back-to-back delimiters. Otherwise, repeat=false ignores back-to-back delimiters.

  plast=str.find_last_not_of(delim);
  p1=str.find_first_of(delim,p0);

  while (p1 != std::string::npos){
    if (p1-p0 > 0){
      std::stringstream(str.substr(p0,p1-p0)) >> tmp;
      out.push_back(tmp);
    }
    else{
      if (repeat){
        std::stringstream(str.substr(p0,p1-p0)) >> tmp;
        out.push_back(tmp);
      }
    }
    p0=p1+1;
    p1=str.find_first_of(delim, p0);
  }
  //After last delimiter
  if (plast != std::string::npos && plast >= p0){
    std::stringstream(str.substr(p0,p1-p0)) >> tmp;
    out.push_back(tmp);
  }
  else{
    if (repeat){
      std::stringstream(str.substr(p0,p1-p0)) >> tmp;
      out.push_back(tmp);
    }
  }
  //std::cerr << out.size() << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movl %ecx, 0xc(%rsp)
movq %rsi, %r15
movq %rdi, %r14
movq (%rdx), %rax
cmpq %rax, 0x8(%rdx)
je 0x18ff6
movq %rax, 0x8(%rdx)
movl $0x1f4, %esi            # imm = 0x1F4
movq %rdx, 0x10(%rsp)
movq %rdx, %rdi
callq 0x191da
pushq $-0x1
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x45a0
movq %rax, 0x38(%rsp)
xorl %ebx, %ebx
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x42d0
movq %rax, %r13
leaq 0x18(%rsp), %r12
leaq 0x40(%rsp), %rbp
cmpq $-0x1, %r13
je 0x190e1
movq %r13, %rcx
subq %rbx, %rcx
jne 0x1907d
cmpb $0x0, 0xc(%rsp)
je 0x190c5
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x4340
movq %rbp, %rdi
movq %r12, %rsi
pushq $0x18
popq %rdx
callq 0x44b0
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x41d0
jmp 0x190a6
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4340
movq %rbp, %rdi
movq %r12, %rsi
pushq $0x18
popq %rdx
callq 0x44b0
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x41d0
movq %rbp, %rdi
callq 0x4260
movq %r12, %rdi
callq 0x4170
movq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x19270
incq %r13
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x42d0
movq %r13, %rbx
movq %rax, %r13
jmp 0x19037
movq 0x38(%rsp), %rcx
cmpq $-0x1, %rcx
sete %al
cmpq %rbx, %rcx
setb %cl
orb %al, %cl
je 0x1913c
cmpb $0x0, 0xc(%rsp)
je 0x19197
movq %rbx, %rcx
notq %rcx
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4340
leaq 0x40(%rsp), %rdi
pushq $0x18
popq %rdx
movq %r15, %rsi
callq 0x44b0
leaq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x41d0
jmp 0x19174
movq %rbx, %rcx
notq %rcx
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4340
leaq 0x40(%rsp), %rdi
pushq $0x18
popq %rdx
movq %r15, %rsi
callq 0x44b0
leaq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x41d0
leaq 0x40(%rsp), %rdi
callq 0x4260
leaq 0x18(%rsp), %rdi
callq 0x4170
leaq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x19270
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x191b5
jmp 0x191c4
jmp 0x191b5
jmp 0x191c4
jmp 0x191b5
jmp 0x191c4
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4260
jmp 0x191c7
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x4170
movq %rbx, %rdi
callq 0x4560
nop