// File: GenisGE[P]evalAdmix/filereader_and_conversions.cpp
// Function: readarray(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::vector<std::string> readarray(std::string filename,const std::string delims=",;: \t"){
  ///@param filename The name of the file to open.
  ///@param delims A string of delimeters to split by.
  std::vector<std::string> tokens;

  const int SIZE = MAX_ELEMS_PER_LINE;
  char *buffer = new char[SIZE];
  std::ifstream pFile (filename.c_str(),std::ios::in);
  
  if(!pFile){
    fileError(filename);
    exit(0);
  }
  
  std::string tmp_string;
  //we are reading an array, so just keep reading until no more lines
  while(!pFile.eof()){
    pFile.getline(buffer,SIZE);
    tmp_string = std::string(buffer);
    get_lexemes(tmp_string,tokens,delims);
    
  }
  pFile.close();
  delete [] buffer;
  ///now we have a token array of string coerce the types now
  //typecast_stringarray(tokens);
  return tokens;
}

// Assembly:
subq $0x348, %rsp            # imm = 0x348
movq %rdx, 0x38(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdi, 0x48(%rsp)
movq %rdi, %rax
movq %rax, 0x50(%rsp)
movq %rdi, 0x340(%rsp)
movq %rsi, 0x338(%rsp)
movq %rdx, 0x330(%rsp)
movb $0x0, 0x32f(%rsp)
callq 0xdec0
movl $0x4c4b40, 0x328(%rsp) # imm = 0x4C4B40
movl $0x4c4b40, %edi         # imm = 0x4C4B40
callq 0x3030
movq %rax, 0x58(%rsp)
jmp 0xaf9f
movq 0x40(%rsp), %rdi
movq 0x58(%rsp), %rax
movq %rax, 0x320(%rsp)
callq 0x30f0
movq %rax, %rsi
leaq 0x108(%rsp), %rdi
movl $0x8, %edx
callq 0x3540
jmp 0xafcd
movq 0x108(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x108(%rsp,%rax), %rdi
callq 0x3120
movb %al, 0x37(%rsp)
jmp 0xafec
movb 0x37(%rsp), %al
testb $0x1, %al
jne 0xaff9
jmp 0xb088
movq 0x40(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
callq 0x3100
jmp 0xb00d
leaq 0xe8(%rsp), %rdi
callq 0xa100
jmp 0xb01c
leaq 0xe8(%rsp), %rdi
callq 0x3170
xorl %edi, %edi
callq 0x3340
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x318(%rsp)
movl %eax, 0x314(%rsp)
jmp 0xb2b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x318(%rsp)
movl %eax, 0x314(%rsp)
jmp 0xb290
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x318(%rsp)
movl %eax, 0x314(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x3170
jmp 0xb290
leaq 0xc8(%rsp), %rdi
callq 0x33a0
movq 0x108(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x108(%rsp,%rax), %rdi
callq 0x3550
movb %al, 0x36(%rsp)
jmp 0xb0b4
movb 0x36(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xb0c3
jmp 0xb229
movq 0x320(%rsp), %rsi
leaq 0x108(%rsp), %rdi
movl $0x4c4b40, %edx         # imm = 0x4C4B40
callq 0x30c0
jmp 0xb0df
movq 0x320(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0xa7(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x3500
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0xa8(%rsp), %rdi
callq 0x9280
jmp 0xb117
leaq 0xc8(%rsp), %rdi
movq %rdi, 0x18(%rsp)
leaq 0xa8(%rsp), %rsi
movq %rsi, 0x10(%rsp)
callq 0x3350
movq 0x10(%rsp), %rdi
callq 0x3170
leaq 0xa7(%rsp), %rdi
callq 0x32e0
movq 0x18(%rsp), %rsi
leaq 0x80(%rsp), %rdi
callq 0x3100
jmp 0xb161
movq 0x38(%rsp), %rsi
leaq 0x60(%rsp), %rdi
callq 0x3100
jmp 0xb172
movq 0x48(%rsp), %rsi
leaq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0xab60
jmp 0xb18b
leaq 0x60(%rsp), %rdi
callq 0x3170
leaq 0x80(%rsp), %rdi
callq 0x3170
jmp 0xb095
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x318(%rsp)
movl %eax, 0x314(%rsp)
jmp 0xb283
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x318(%rsp)
movl %eax, 0x314(%rsp)
leaq 0xa7(%rsp), %rdi
callq 0x32e0
jmp 0xb283
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x318(%rsp)
movl %eax, 0x314(%rsp)
jmp 0xb21a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x318(%rsp)
movl %eax, 0x314(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x3170
leaq 0x80(%rsp), %rdi
callq 0x3170
jmp 0xb283
leaq 0x108(%rsp), %rdi
callq 0x3070
jmp 0xb238
movq 0x320(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0xb255
movq 0x8(%rsp), %rdi
callq 0x3390
movb $0x1, 0x32f(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x3170
leaq 0x108(%rsp), %rdi
callq 0x3080
testb $0x1, 0x32f(%rsp)
jne 0xb2a9
jmp 0xb29f
leaq 0xc8(%rsp), %rdi
callq 0x3170
leaq 0x108(%rsp), %rdi
callq 0x3080
jmp 0xb2b6
movq 0x48(%rsp), %rdi
callq 0xded0
movq 0x50(%rsp), %rax
addq $0x348, %rsp            # imm = 0x348
retq
movq 0x48(%rsp), %rdi
callq 0xded0
movq 0x318(%rsp), %rdi
callq 0x34f0
nopl (%rax)