// File: 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:
subq $0x108, %rsp            # imm = 0x108
movb %cl, %al
movq %rdi, 0x100(%rsp)
movq %rsi, 0xf8(%rsp)
movq %rdx, 0xf0(%rsp)
andb $0x1, %al
movb %al, 0xef(%rsp)
movq $0x0, 0xe0(%rsp)
movq $-0x1, 0xd8(%rsp)
movq $-0x1, 0xd0(%rsp)
movq 0xf0(%rsp), %rdi
callq 0x7800
movq 0x100(%rsp), %rdi
movq 0xf8(%rsp), %rsi
movq $-0x1, %rdx
callq 0x5770
movq %rax, 0xd0(%rsp)
movq 0x100(%rsp), %rdi
movq 0xf8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
callq 0x53a0
movq %rax, 0xd8(%rsp)
cmpq $-0x1, 0xd8(%rsp)
je 0x3da5e
movq 0xd8(%rsp), %rax
subq 0xe0(%rsp), %rax
cmpq $0x0, %rax
jbe 0x3d990
movq 0xf0(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x100(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movq 0xd8(%rsp), %rcx
subq %rdx, %rcx
leaq 0xb0(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x5440
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x38550
jmp 0x3d958
leaq 0xb0(%rsp), %rdi
callq 0x5250
jmp 0x3da20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x5250
jmp 0x3db7f
testb $0x1, 0xef(%rsp)
je 0x3da1e
movq 0xf0(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x100(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movq 0xd8(%rsp), %rcx
subq %rdx, %rcx
leaq 0x80(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x5440
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x38550
jmp 0x3d9e9
leaq 0x80(%rsp), %rdi
callq 0x5250
jmp 0x3da1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x5250
jmp 0x3db7f
jmp 0x3da20
movq 0xd8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xe0(%rsp)
movq 0x100(%rsp), %rdi
movq 0xf8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
callq 0x53a0
movq %rax, 0xd8(%rsp)
jmp 0x3d8e4
cmpq $-0x1, 0xd0(%rsp)
je 0x3daf9
movq 0xd0(%rsp), %rax
cmpq 0xe0(%rsp), %rax
jb 0x3daf9
movq 0xf0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x100(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movq 0xd8(%rsp), %rcx
subq %rdx, %rcx
leaq 0x60(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x5440
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x38550
jmp 0x3dac7
leaq 0x60(%rsp), %rdi
callq 0x5250
jmp 0x3db77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x5250
jmp 0x3db7f
testb $0x1, 0xef(%rsp)
je 0x3db75
movq 0xf0(%rsp), %rax
movq %rax, (%rsp)
movq 0x100(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movq 0xd8(%rsp), %rcx
subq %rdx, %rcx
leaq 0x40(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x5440
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x38550
jmp 0x3db49
leaq 0x40(%rsp), %rdi
callq 0x5250
jmp 0x3db75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x5250
jmp 0x3db7f
jmp 0x3db77
addq $0x108, %rsp            # imm = 0x108
retq
movq 0xa8(%rsp), %rdi
callq 0x5720
nopl (%rax)