// File: /workspace/github_cpp_makefile_star2_O1/GenisGE[P]evalAdmix/filereader_and_conversions.cpp
// Function: getTestIndividuals(char const*)
std::vector<iArray*> getTestIndividuals(const char *pName){
  iArray *testList = typecast_stringarray_to_iArray(readarray(std::string(pName)));
  
  int numTrues=0;
  for(int i=0;i<testList->x;i++)
    if(testList->array[i])
      numTrues++;
  //printf("numTrues:%d\n",numTrues);
  //testList->print("testlist",NULL);
  std::vector<iArray*> returnVal;
  int pos1 = getNext(testList,0);
  while(pos1!=-1){
    int pos2 = getNext(testList,pos1+1);
    while(pos2!=-1){
      if(pos2!=-1){
	//printf("p1:%d\tp2:%d\n",pos1,pos2);
	iArray *pr = allocIntArray(2);
	pr->array[0]=pos1;pr->array[1]=pos2;
	returnVal.push_back(pr);
      }
      pos2 = getNext(testList,pos2+1);
    }
    pos1 = getNext(testList,pos1+1);
  }
  killArray(testList);
  return returnVal;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x48(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5efe
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x6301(%rip), %rsi      # 0xe218
leaq 0x62ff(%rip), %rdx      # 0xe21d
leaq 0x28(%rsp), %rdi
callq 0x618e
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x6cd3
leaq 0x10(%rsp), %rdi
callq 0x6b2d
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x8f4c
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x7f6a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7f85
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2230
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movslq (%r14), %rax
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testq %rax, %rax
jle 0x7fba
movq 0x8(%r14), %rdx
xorl %ecx, %ecx
cmpl $0x1, (%rdx,%rcx,4)
je 0x7fb7
incq %rcx
cmpq %rcx, %rax
jne 0x7fa7
jmp 0x7fba
movl %ecx, %r12d
cmpl $-0x1, %r12d
je 0x80b2
leaq 0x10(%rsp), %r15
leal 0x1(%r12), %ebp
movl (%r14), %eax
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl %ebp, %eax
jle 0x8000
movq 0x8(%r14), %rcx
movslq %r12d, %rdx
leaq (%rcx,%rdx,4), %rcx
addq $0x4, %rcx
movl %ebp, %edx
cmpl $0x1, (%rcx)
je 0x7ffd
incl %edx
addq $0x4, %rcx
cmpl %edx, %eax
jne 0x7fec
jmp 0x8000
movl %edx, %r13d
cmpl $-0x1, %r13d
je 0x8078
movl $0x2, %edi
callq 0xac62
movq %rax, 0x10(%rsp)
movq 0x8(%rax), %rcx
movl %r12d, (%rcx)
movl %r13d, 0x4(%rcx)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x8034
movq %rax, (%rsi)
addq $0x8, 0x8(%rbx)
jmp 0x803f
movq %rbx, %rdi
movq %r15, %rdx
callq 0x9210
incl %r13d
movl (%r14), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %r13d, %ecx
jle 0x8070
movslq %r13d, %rdx
shlq $0x2, %rdx
addq 0x8(%r14), %rdx
cmpl $0x1, (%rdx)
je 0x806d
incl %r13d
addq $0x4, %rdx
cmpl %r13d, %ecx
jne 0x805a
jmp 0x8070
movl %r13d, %eax
movl %eax, %r13d
cmpl $-0x1, %eax
jne 0x8006
movl (%r14), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ebp, %ecx
jle 0x80a6
movq 0x8(%r14), %rdx
movslq %r12d, %rsi
leaq (%rdx,%rsi,4), %rdx
addq $0x4, %rdx
cmpl $0x1, (%rdx)
je 0x80a4
incl %ebp
addq $0x4, %rdx
cmpl %ebp, %ecx
jne 0x8093
jmp 0x80a6
movl %ebp, %eax
movl %eax, %r12d
cmpl $-0x1, %eax
jne 0x7fc9
movq %r14, %rdi
callq 0xa8c3
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8119
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x8f4c
jmp 0x80e0
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x80fc
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x80fc
movq %rax, %r14
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8130
movq 0x58(%rsp), %rsi
incq %rsi
jmp 0x812b
movq %rax, %r14
jmp 0x8130
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x8130
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2230
movq %r14, %rdi
callq 0x2400