// File: /workspace/github_cpp_makefile_star2_O1/atfrank[P]PCASA/lib/Misc.cpp
// Function: Misc::splitStr(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<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, bool)
void Misc::splitStr (const std::string &str, const std::string &delim, std::vector<std::string> &out, const bool repeat){
  size_t p0=0;
  size_t p1=std::string::npos;
  size_t plast=std::string::npos;
  out.clear();

  //"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){
      out.push_back(str.substr(p0,p1-p0));
    }
    else{
      if (repeat){
        out.push_back(str.substr(p0,p1-p0));
      }
    }
    p0=p1+1;
    p1=str.find_first_of(delim, p0);
  }
  //After last delimiter
  if (plast != std::string::npos && plast >= p0 ){
    out.push_back(str.substr(p0,p1-p0));
  }
  else{
    if (repeat){
      out.push_back(str.substr(p0,p1-p0));
    }
  }
  //std::cerr << out.size() << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, 0xc(%rsp)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq (%rdx), %rsi
movq %rdx, %rdi
callq 0x12974
movq (%r15), %rsi
movq 0x8(%r15), %rcx
movq %r14, %rdi
movq $-0x1, %rdx
callq 0x44b0
movq %rax, 0x30(%rsp)
movq (%r15), %rsi
movq 0x8(%r15), %rcx
xorl %r12d, %r12d
movq %r14, %rdi
xorl %edx, %edx
callq 0x4450
cmpq $-0x1, %rax
je 0x21c24
movq %rax, %rbp
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
movq %rbp, %rcx
subq %r12, %rcx
jne 0x21bca
cmpb $0x0, 0xc(%rsp)
je 0x21bff
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x4300
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1fe72
jmp 0x21be3
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x4300
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1fe72
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x21bff
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42e0
movq %rbp, %r12
incq %r12
movq (%r15), %rsi
movq 0x8(%r15), %rcx
movq %r14, %rdi
movq %r12, %rdx
callq 0x4450
movq %rax, %rbp
cmpq $-0x1, %rax
jne 0x21b9e
movq 0x30(%rsp), %rax
cmpq $-0x1, %rax
je 0x21c5a
cmpq %r12, %rax
jb 0x21c5a
movq %r12, %rcx
notq %rcx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x4300
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1fe72
jmp 0x21c85
cmpb $0x0, 0xc(%rsp)
je 0x21ca0
movq %r12, %rcx
notq %rcx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x4300
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1fe72
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21ca0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42e0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x21cb1
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x21cce
jmp 0x21cc1
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x21ce0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42e0
movq %rbx, %rdi
callq 0x4550