// File: /workspace/github_cpp_makefile_star2_O3/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, 0x2c(%rsp)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq (%rdx), %rax
cmpq %rax, 0x8(%rdx)
je 0x2225b
movq %rax, 0x8(%rbx)
movl $0x1f4, %esi            # imm = 0x1F4
movq %rbx, %rdi
callq 0x2253a
movq (%r15), %rsi
movq 0x8(%r15), %rcx
movq %r14, %rdi
movq $-0x1, %rdx
callq 0x44b0
movq %rax, 0x38(%rsp)
movq (%r15), %rsi
movq 0x8(%r15), %rcx
xorl %ebp, %ebp
movq %r14, %rdi
xorl %edx, %edx
callq 0x4450
cmpq $-0x1, %rax
je 0x223b7
movq %rax, %r13
leaq 0x40(%rsp), %rax
addq $0x80, %rax
movq %rax, 0x30(%rsp)
xorl %ebp, %ebp
movq %r13, %rcx
subq %rbp, %rcx
jne 0x22301
cmpb $0x0, 0x2c(%rsp)
je 0x22392
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x4300
leaq 0x40(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movl $0x18, %edx
callq 0x4490
movq %rbp, %rdi
leaq 0x4(%rsp), %rsi
callq 0x41b0
jmp 0x22336
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x4300
leaq 0x40(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movl $0x18, %edx
callq 0x4490
movq %rbp, %rdi
leaq 0x4(%rsp), %rsi
callq 0x41b0
movq %rbp, %rdi
movq 0x3cdc68(%rip), %rsi    # 0x3effa8
callq 0x4240
movq 0x30(%rsp), %rdi
callq 0x4110
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2236b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x22385
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x22392
movq %rbx, %rdi
leaq 0x4(%rsp), %rdx
callq 0x23072
movq %r13, %rbp
incq %rbp
movq (%r15), %rsi
movq 0x8(%r15), %rcx
movq %r14, %rdi
movq %rbp, %rdx
callq 0x4450
movq %rax, %r13
cmpq $-0x1, %rax
jne 0x222b5
movq 0x38(%rsp), %rax
cmpq $-0x1, %rax
je 0x22403
cmpq %rbp, %rax
jb 0x22403
movq %rbp, %rcx
notq %rcx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x4300
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
movl $0x18, %edx
callq 0x4490
leaq 0x40(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x41b0
jmp 0x22448
cmpb $0x0, 0x2c(%rsp)
je 0x224a8
movq %rbp, %rcx
notq %rcx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x4300
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
movl $0x18, %edx
callq 0x4490
leaq 0x40(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x41b0
movq 0x3cdb59(%rip), %rsi    # 0x3effa8
leaq 0x40(%rsp), %rdi
callq 0x4240
leaq 0xc0(%rsp), %rdi
callq 0x4110
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x22481
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42e0
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2249b
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x224a8
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0x23072
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x224be
jmp 0x224e1
movq %rax, %rbx
movq 0x3cdae0(%rip), %rsi    # 0x3effa8
leaq 0x40(%rsp), %rdi
callq 0x4240
leaq 0xc0(%rsp), %rdi
callq 0x4110
jmp 0x224e4
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x22520
jmp 0x224f3
jmp 0x22513
movq %rax, %rbx
movq 0x3cdaab(%rip), %rsi    # 0x3effa8
leaq 0x40(%rsp), %rdi
callq 0x4240
movq 0x30(%rsp), %rdi
callq 0x4110
jmp 0x22516
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x22532
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42e0
movq %rbx, %rdi
callq 0x4550