// File: 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:
subq $0xe8, %rsp
movq %rdi, 0x20(%rsp)
movq %rdi, %rax
movq %rax, 0x28(%rsp)
movq %rdi, 0xe0(%rsp)
movq %rsi, 0xd8(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x97(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x3500
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x98(%rsp), %rdi
callq 0x9280
jmp 0xc4bc
leaq 0x5f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x3500
movq 0x18(%rsp), %rdx
leaq 0xcd51(%rip), %rsi      # 0x19228
leaq 0x60(%rsp), %rdi
callq 0x9280
jmp 0xc4e3
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0xaf40
jmp 0xc4ff
leaq 0xb8(%rsp), %rdi
callq 0xad80
movq %rax, 0x10(%rsp)
jmp 0xc513
leaq 0xb8(%rsp), %rdi
callq 0xded0
leaq 0x60(%rsp), %rdi
callq 0x3170
leaq 0x5f(%rsp), %rdi
callq 0x32e0
leaq 0x98(%rsp), %rdi
callq 0x3170
leaq 0x97(%rsp), %rdi
callq 0x32e0
movq 0x10(%rsp), %rax
movq %rax, 0xd0(%rsp)
movl $0x0, 0x58(%rsp)
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
movq 0xd0(%rsp), %rcx
cmpl (%rcx), %eax
jge 0xc652
movq 0xd0(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x54(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0xc640
movl 0x58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58(%rsp)
jmp 0xc640
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
jmp 0xc62e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
jmp 0xc617
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
jmp 0xc60d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0xded0
leaq 0x60(%rsp), %rdi
callq 0x3170
leaq 0x5f(%rsp), %rdi
callq 0x32e0
leaq 0x98(%rsp), %rdi
callq 0x3170
leaq 0x97(%rsp), %rdi
callq 0x32e0
jmp 0xc782
jmp 0xc642
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0xc56b
movq 0x20(%rsp), %rdi
movb $0x0, 0x53(%rsp)
callq 0xdf50
movq 0xd0(%rsp), %rdi
xorl %esi, %esi
callq 0xc3f0
movl %eax, 0x4c(%rsp)
cmpl $-0x1, 0x4c(%rsp)
je 0xc750
movq 0xd0(%rsp), %rdi
movl 0x4c(%rsp), %esi
addl $0x1, %esi
callq 0xc3f0
movl %eax, 0x48(%rsp)
cmpl $-0x1, 0x48(%rsp)
je 0xc733
cmpl $-0x1, 0x48(%rsp)
je 0xc716
movl $0x2, %edi
callq 0x14740
movq %rax, 0x8(%rsp)
jmp 0xc6ba
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rax
movq %rax, 0x40(%rsp)
movl 0x4c(%rsp), %ecx
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movl %ecx, (%rax)
movl 0x48(%rsp), %ecx
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movl %ecx, 0x4(%rax)
leaq 0x40(%rsp), %rsi
callq 0xdf60
jmp 0xc6f4
jmp 0xc716
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
callq 0xdfd0
jmp 0xc782
movq 0xd0(%rsp), %rdi
movl 0x48(%rsp), %esi
addl $0x1, %esi
callq 0xc3f0
movl %eax, 0x48(%rsp)
jmp 0xc697
movq 0xd0(%rsp), %rdi
movl 0x4c(%rsp), %esi
addl $0x1, %esi
callq 0xc3f0
movl %eax, 0x4c(%rsp)
jmp 0xc674
movq 0xd0(%rsp), %rdi
callq 0x14130
jmp 0xc75f
movb $0x1, 0x53(%rsp)
testb $0x1, 0x53(%rsp)
jne 0xc775
movq 0x20(%rsp), %rdi
callq 0xdfd0
movq 0x28(%rsp), %rax
addq $0xe8, %rsp
retq
movq 0x88(%rsp), %rdi
callq 0x34f0
nop