LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/extractors.cpp
// Function: extractOK(bArray*, iMatrix*)
iMatrix *extractOK(bArray *okList,iMatrix *matr){
  iMatrix *returnMatrix = allocIntMatrix(matr->x,okList->numTrue);
  int atPos =0;
  for(int i=0;i<matr->y;i++)
    if(okList->array[i]){
      for(int j=0;j<matr->x;j++)
	returnMatrix->matrix[j][atPos] = matr->matrix [j] [i];
      atPos++;
    }
  return returnMatrix;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %edi
movl 0x4(%r14), %esi
callq 0x90f4
xorl %ecx, %ecx
xorl %edx, %edx
movslq 0x4(%rbx), %rsi
cmpq %rsi, %rcx
jge 0x8369
movq 0x8(%r14), %rsi
cmpl $0x0, (%rsi,%rcx,4)
je 0x8364
movslq %edx, %rsi
xorl %edi, %edi
movslq (%rbx), %r8
cmpq %r8, %rdi
jge 0x8362
movq 0x8(%rbx), %r8
movq (%r8,%rdi,8), %r8
movl (%r8,%rcx,4), %r8d
movq 0x8(%rax), %r9
movq (%r9,%rdi,8), %r9
movl %r8d, (%r9,%rsi,4)
incq %rdi
jmp 0x833d
incl %edx
incq %rcx
jmp 0x8325
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/extractors.cpp
// Function: extractOK(bArray*, usiMatrix*)
usiMatrix *extractOK(bArray *okList,usiMatrix *matr){
  usiMatrix *returnMatrix = allocUSIntMatrix(matr->x,okList->numTrue);
  int atPos =0;
  for(int i=0;i<matr->y;i++)
    if(okList->array[i]){
      for(int j=0;j<matr->x;j++)
	returnMatrix->matrix[j][atPos] = matr->matrix [j] [i];
      atPos++;
    }
  return returnMatrix;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %edi
movl 0x4(%r14), %esi
callq 0x9238
movl 0x4(%rbx), %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rcx, %rsi
je 0x83e0
movq 0x8(%r14), %r8
cmpl $0x0, (%r8,%rsi,4)
je 0x83db
movl (%rbx), %r8d
movslq %edi, %r9
testl %r8d, %r8d
cmovlel %edx, %r8d
xorl %r10d, %r10d
cmpq %r10, %r8
je 0x83d9
movq 0x8(%rbx), %r11
movq (%r11,%r10,8), %r11
movzwl (%r11,%rsi,2), %r11d
movq 0x8(%rax), %r15
movq (%r15,%r10,8), %r15
movw %r11w, (%r15,%r9,2)
incq %r10
jmp 0x83b5
incl %edi
incq %rsi
jmp 0x8395
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/extractors.cpp
// Function: extract(dMatrix*, iArray*)
dArray *extract( dMatrix *var,iArray *choose){
  dArray *retVal = allocDoubleArray(choose->x-1);
   for (int i=1;i<var->y;i++){
    retVal->array[i-1]=var->matrix[choose->array[i]][i];
  }
  return retVal;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %edi
decl %edi
callq 0x97cc
movslq 0x4(%r14), %rcx
pushq $0x1
popq %rdx
cmpq %rcx, %rdx
jge 0x8429
movq 0x8(%r14), %rsi
movq 0x8(%rbx), %rdi
movslq (%rdi,%rdx,4), %rdi
movq (%rsi,%rdi,8), %rsi
movsd (%rsi,%rdx,8), %xmm0
movq 0x8(%rax), %rsi
movsd %xmm0, -0x8(%rsi,%rdx,8)
incq %rdx
jmp 0x8400
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/extractors.cpp
// Function: extract(iArray*, iArray*)
iArray *extract(iArray *var,iArray *choose){
  iArray *retVal = allocIntArray(var->x-1);
  for (int i=1;i<var->x;i++)
    retVal->array[i-1]=var->array[i-1-choose->array[i]];
  return retVal;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq (%rdi), %rdi
decq %rdi
callq 0x967f
pushq $0x1
popq %rcx
movslq (%r14), %rdx
cmpq %rdx, %rcx
jge 0x8475
movq 0x8(%r14), %rdx
movq 0x8(%rbx), %rsi
movslq (%rsi,%rcx,4), %rsi
shlq $0x2, %rsi
subq %rsi, %rdx
movl -0x4(%rdx,%rcx,4), %edx
movq 0x8(%rax), %rsi
movl %edx, -0x4(%rsi,%rcx,4)
incq %rcx
jmp 0x8449
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: allocIntMatrix(int, int)
iMatrix *allocIntMatrix(int x, int y){
  try{
    iMatrix *tmp = new iMatrix();
    int **ppi = new int*[x];
    

    // int *curPtr = new int [x * y];
    for( int i = 0; i < x; ++i) {
      *(ppi + i) = new int[y];
      // curPtr += y;
    }
#if _fillup_
    for (int i=0;i<x;i++)
      for(int n=0;n<y;n++)
	ppi[i][n]=0;
#endif
    printf("\t-> Allocated: %.3f gig memory\n",(float)sizeof(int)*x*y/1000000000);
    tmp->matrix=ppi;
    tmp->x=x;
    tmp->y=y;
    return tmp;
  }catch(std::exception & e){
    printf("\t-> Tried to allocate: %.3f gig memory\n",(float)sizeof(int)*x*y/1000000000);
    printf("\t-> Allocation failed, likely cause: need more memory, will exit.\n");
    exit(0);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r13d
movl %edi, %ebp
pushq $0x10
popq %rdi
movl %esi, 0x4(%rsp)
callq 0x2220
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movl %ebp, %edi
shlq $0x3, %rdi
testl %ebp, %ebp
pushq $-0x1
popq %rbx
cmovsq %rbx, %rdi
callq 0x2030
movq %rax, %r15
movl %r13d, %r12d
shlq $0x2, %r12
testl %r13d, %r13d
cmovsq %rbx, %r12
xorl %ebx, %ebx
testl %ebp, %ebp
movl $0x0, %r13d
cmovgl %ebp, %r13d
cmpq %rbx, %r13
je 0x9162
movq %r12, %rdi
callq 0x2030
movq %rax, (%r15,%rbx,8)
incq %rbx
jmp 0x914c
xorl %eax, %eax
movl 0x4(%rsp), %edx
testl %edx, %edx
movl $0x0, %ecx
cmovgl %edx, %ecx
cmpq %r13, %rax
je 0x9190
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x918b
movq (%r15,%rax,8), %rsi
andl $0x0, (%rsi,%rdx,4)
incq %rdx
jmp 0x9179
incq %rax
jmp 0x9172
cvtsi2ss %ebp, %xmm0
mulss 0x3318(%rip), %xmm0     # 0xc4b4
movl 0x4(%rsp), %ebx
cvtsi2ss %ebx, %xmm1
mulss %xmm0, %xmm1
divss 0x3308(%rip), %xmm1     # 0xc4b8
cvtss2sd %xmm1, %xmm0
leaq 0x3305(%rip), %rdi      # 0xc4c0
movb $0x1, %al
callq 0x2040
movq %r15, 0x8(%r14)
movl %ebp, (%r14)
movl %ebx, 0x4(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x91e3
jmp 0x91e3
movq %rax, %rdi
cmpl $0x1, %edx
jne 0x9233
callq 0x20d0
cvtsi2ss %ebp, %xmm0
mulss 0x32b8(%rip), %xmm0     # 0xc4b4
cvtsi2ssl 0x4(%rsp), %xmm1
mulss %xmm0, %xmm1
divss 0x32aa(%rip), %xmm1     # 0xc4b8
cvtss2sd %xmm1, %xmm0
leaq 0x32c7(%rip), %rdi      # 0xc4e0
movb $0x1, %al
callq 0x2040
leaq 0x351e(%rip), %rdi      # 0xc745
callq 0x2380
xorl %edi, %edi
callq 0x2280
callq 0x2410
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: allocUSIntMatrix(int, int)
usiMatrix *allocUSIntMatrix(int x, int y){
  try{
    usiMatrix *tmp = new usiMatrix();
    unsigned short int **ppi = new unsigned short int*[x];
    // int *curPtr = new int [x * y];
    for( int i = 0; i < x; ++i) {
      *(ppi + i) = new unsigned short int[y];
      // curPtr += y;
    }
#if _fillup_
    for (int i=0;i<x;i++)
      for(int n=0;n<y;n++)
	ppi[i][n]=0;
#endif
    printf("\t-> Allocated: %.3f gig memory\n",(float)sizeof(unsigned short int)*x*y/1000000000);
    tmp->matrix=ppi;
    tmp->x=x;
    tmp->y=y;
    return tmp;
  }catch(std::exception & e){
    printf("\t-> Tried to allocate: %.3f gig memory\n",(float)sizeof(int)*x*y/1000000000);
    printf("\t-> Allocation failed, likely cause: need more memory, will exit.\n");
    exit(0);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r13d
movl %edi, %ebp
pushq $0x10
popq %rdi
movl %esi, 0x4(%rsp)
callq 0x2220
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movl %ebp, %edi
shlq $0x3, %rdi
testl %ebp, %ebp
pushq $-0x1
popq %rbx
cmovsq %rbx, %rdi
callq 0x2030
movq %rax, %r15
movl %r13d, %r12d
addq %r12, %r12
testl %r13d, %r13d
cmovsq %rbx, %r12
xorl %ebx, %ebx
testl %ebp, %ebp
movl $0x0, %r13d
cmovgl %ebp, %r13d
cmpq %rbx, %r13
je 0x92a5
movq %r12, %rdi
callq 0x2030
movq %rax, (%r15,%rbx,8)
incq %rbx
jmp 0x928f
xorl %eax, %eax
movl 0x4(%rsp), %edx
testl %edx, %edx
movl $0x0, %ecx
cmovgl %edx, %ecx
cmpq %r13, %rax
je 0x92d4
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x92cf
movq (%r15,%rax,8), %rsi
andw $0x0, (%rsi,%rdx,2)
incq %rdx
jmp 0x92bc
incq %rax
jmp 0x92b5
cvtsi2ss %ebp, %xmm0
addss %xmm0, %xmm0
movl 0x4(%rsp), %ebx
cvtsi2ss %ebx, %xmm1
mulss %xmm0, %xmm1
divss 0x31c8(%rip), %xmm1     # 0xc4b8
cvtss2sd %xmm1, %xmm0
leaq 0x31c5(%rip), %rdi      # 0xc4c0
movb $0x1, %al
callq 0x2040
movq %r15, 0x8(%r14)
movl %ebp, (%r14)
movl %ebx, 0x4(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9323
jmp 0x9323
movq %rax, %rdi
cmpl $0x1, %edx
jne 0x9373
callq 0x20d0
cvtsi2ss %ebp, %xmm0
mulss 0x3178(%rip), %xmm0     # 0xc4b4
cvtsi2ssl 0x4(%rsp), %xmm1
mulss %xmm0, %xmm1
divss 0x316a(%rip), %xmm1     # 0xc4b8
cvtss2sd %xmm1, %xmm0
leaq 0x3187(%rip), %rdi      # 0xc4e0
movb $0x1, %al
callq 0x2040
leaq 0x33de(%rip), %rdi      # 0xc745
callq 0x2380
xorl %edi, %edi
callq 0x2280
callq 0x2410
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: killSnpMatrix(snpMatrix*)
void killSnpMatrix(snpMatrix *mat){
  killMatrix(mat->pba);
  killMatrix(mat->dprime);
  killMatrix(mat->pbA);
  killMatrix(mat->pBa);
  killMatrix(mat->pBA);
  killMatrix(mat->rmisc);
  killMatrix(mat->D);
  killMatrix(mat->lod);
  delete mat;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x9420
movq (%rbx), %rdi
callq 0x9420
movq 0x10(%rbx), %rdi
callq 0x9420
movq 0x18(%rbx), %rdi
callq 0x9420
movq 0x20(%rbx), %rdi
callq 0x9420
movq 0x28(%rbx), %rdi
callq 0x9420
movq 0x30(%rbx), %rdi
callq 0x9420
movq 0x38(%rbx), %rdi
callq 0x9420
pushq $0x40
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x2230
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: killPars(pars*)
void killPars(pars *mat){
  killArray(mat->Sk1);
  killArray(mat->Sk2);
  killArray(mat->Sk3);
  killArray(mat->t);
  killMatrix(mat->S);
  killArray(mat->maf);
  killArray(mat->maf2);
  killArray(mat->ind1);
  killArray(mat->ind2);
  //killArray(mat->pos);
  //killArray(mat->chr);
  delete mat;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x9378
movq 0x8(%rbx), %rdi
callq 0x9378
movq 0x10(%rbx), %rdi
callq 0x9378
movq 0x18(%rbx), %rdi
callq 0x9378
movq 0x20(%rbx), %rdi
callq 0x9420
movq 0x30(%rbx), %rdi
callq 0x9378
movq 0x38(%rbx), %rdi
callq 0x9378
movq 0x40(%rbx), %rdi
callq 0x93b4
movq 0x48(%rbx), %rdi
callq 0x93b4
pushq $0x78
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x2230
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: allocDoubleMatrix(int, int)
dMatrix *allocDoubleMatrix(int x, int y){
  try{
    dMatrix *tmp = new dMatrix();
    double **ppi = new double*[x];
    double *curPtr = new double [x * y];
    
    for( int i = 0; i < x; ++i) {
      *(ppi + i) = curPtr;
      curPtr += y;
    }
#if _fillup_
    for (int i=0;i<x;i++)
      for(int n=0;n<y;n++)
	ppi[i][n]=0;
#endif
    tmp->matrix=ppi;
    tmp->x=x;
    tmp->y=y;
    return tmp;
  }catch(std::exception & e){
        printf("\t-> Tried to allocate: %.3f gig memory\n",(float)sizeof(double)*x*y/1000000000);
    printf("\t-> Allocation failed, likely cause: need more memory, will exit.\n");
    exit(0);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
pushq $0x10
popq %rdi
callq 0x2220
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movl %ebp, %edi
shlq $0x3, %rdi
testl %ebp, %ebp
pushq $-0x1
popq %r12
cmovsq %r12, %rdi
callq 0x2030
movq %rax, %r15
movl %ebx, %eax
imull %ebp, %eax
leaq (,%rax,8), %rdi
testl %eax, %eax
cmovsq %r12, %rdi
callq 0x2030
movslq %ebx, %rdx
xorl %esi, %esi
testl %ebp, %ebp
movl $0x0, %ecx
cmovgl %ebp, %ecx
shlq $0x3, %rdx
cmpq %rsi, %rcx
je 0x9593
movq %rax, (%r15,%rsi,8)
incq %rsi
addq %rdx, %rax
jmp 0x9582
xorl %eax, %eax
testl %ebx, %ebx
movl $0x0, %edx
cmovgl %ebx, %edx
cmpq %rcx, %rax
je 0x95be
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x95b9
movq (%r15,%rax,8), %rdi
andq $0x0, (%rdi,%rsi,8)
incq %rsi
jmp 0x95a6
incq %rax
jmp 0x959f
movq %r15, 0x8(%r14)
movl %ebp, (%r14)
movl %ebx, 0x4(%r14)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x95d9
jmp 0x95d9
movq %rax, %rdi
cmpl $0x1, %edx
jne 0x9627
callq 0x20d0
cvtsi2ss %ebp, %xmm0
mulss 0x2eca(%rip), %xmm0     # 0xc4bc
cvtsi2ss %ebx, %xmm1
mulss %xmm0, %xmm1
divss 0x2eb6(%rip), %xmm1     # 0xc4b8
cvtss2sd %xmm1, %xmm0
leaq 0x2ed3(%rip), %rdi      # 0xc4e0
movb $0x1, %al
callq 0x2040
leaq 0x312a(%rip), %rdi      # 0xc745
callq 0x2380
xorl %edi, %edi
callq 0x2280
callq 0x2410
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: allocDoubleMatrix(int, int, float)
dMatrix *allocDoubleMatrix(int x, int y,float inputVar){
  dMatrix *retVal = allocDoubleMatrix(x,y);
  for (int i=0;i<x;i++)
    for(int n=0;n<y;n++)
      retVal->matrix[i][n]= inputVar;

  return retVal;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movss %xmm0, 0x4(%rsp)
movl %esi, %ebx
movl %edi, %r14d
callq 0x9522
xorl %ecx, %ecx
testl %ebx, %ebx
cmovlel %ecx, %ebx
cvtss2sd 0x4(%rsp), %xmm0
testl %r14d, %r14d
cmovlel %ecx, %r14d
cmpq %r14, %rcx
je 0x9677
xorl %edx, %edx
cmpq %rdx, %rbx
je 0x9672
movq 0x8(%rax), %rsi
movq (%rsi,%rcx,8), %rsi
movsd %xmm0, (%rsi,%rdx,8)
incq %rdx
jmp 0x965b
incq %rcx
jmp 0x9654
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: allocIntArray(unsigned long)
iArray *allocIntArray(size_t  i){
  try{
    int *tmp= new int[i];
    iArray *intArray = new iArray();
#if _fillup_
    for (unsigned int j=0;j<i;j++)
      tmp[j]=0;
#endif
    intArray->x=i;
    intArray->array=tmp;
    return intArray;
  }catch(std::exception & e){
    printf("\t-> Tried to allocate: %.3f gig memory\n",(float)sizeof(size_t)*i/1000000000);
    printf("\t-> Thats an array of length: %lu \n",i);
    printf("\t-> Allocation failed, likely cause: need more memory, will exit.\n");
    exit(0);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdi, %rax
shrq $0x3e, %rax
leaq (,%rdi,4), %rcx
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %rcx, %rdi
callq 0x2030
movq %rax, %r14
pushq $0x10
popq %rdi
callq 0x2220
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
xorl %ecx, %ecx
movl %ecx, %ecx
cmpq %rbx, %rcx
jae 0x96c8
andl $0x0, (%r14,%rcx,4)
incl %ecx
jmp 0x96b8
movl %ebx, (%rax)
movq %r14, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0x96d8
movq %rax, %rdi
cmpl $0x1, %edx
jne 0x96f1
callq 0x20d0
testq %rbx, %rbx
js 0x96f6
cvtsi2ss %rbx, %xmm0
jmp 0x970d
callq 0x2410
movq %rbx, %rax
shrq %rax
movl %ebx, %ecx
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
mulss 0x2da7(%rip), %xmm0     # 0xc4bc
divss 0x2d9b(%rip), %xmm0     # 0xc4b8
cvtss2sd %xmm0, %xmm0
leaq 0x2db8(%rip), %rdi      # 0xc4e0
movb $0x1, %al
callq 0x2040
leaq 0x2dd2(%rip), %rdi      # 0xc508
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2040
leaq 0x2ffe(%rip), %rdi      # 0xc745
callq 0x2380
xorl %edi, %edi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: allocBoolArray(int)
bArray *allocBoolArray(int i){
  try{
    int *tmp= new int[i];
  bArray *boolArray = new bArray();
#if _fillup_
  for (int j=0;j<i;j++)
    tmp[j]=0;
#endif
  boolArray->x=i;
  boolArray->array=tmp;
  boolArray->numTrue = 0;
  return boolArray;
 }catch(std::exception & e){
    printf("\t-> Allocation failed, likely cause: need more memory, will exit.\n");
    exit(0);
  }

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, %eax
shlq $0x2, %rax
testl %edi, %edi
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x2030
movq %rax, %r14
pushq $0x10
popq %rdi
callq 0x2220
xorl %ecx, %ecx
testl %ebx, %ebx
movl $0x0, %edx
cmovgl %ebx, %edx
cmpq %rcx, %rdx
je 0x9793
andl $0x0, (%r14,%rcx,4)
incq %rcx
jmp 0x9784
movl %ebx, (%rax)
movq %r14, 0x8(%rax)
andl $0x0, 0x4(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0x97a7
movq %rax, %rdi
cmpl $0x1, %edx
jne 0x97c7
callq 0x20d0
leaq 0x2f8a(%rip), %rdi      # 0xc745
callq 0x2380
xorl %edi, %edi
callq 0x2280
callq 0x2410
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: allocDoubleArray(int)
dArray *allocDoubleArray(int i){
  try{
    double *tmp= new double[i];
    dArray *darray = new dArray();
#if _fillup_
    for (int j=0;j<i;j++)
      tmp[j]=0.0;
#endif
    darray->x=i;
    darray->array=tmp;
    return darray;
  }catch(std::exception & e){
    printf("\t-> Tried to allocate: %.3f gig memory\n",(float)sizeof(double)*i/1000000000);
    printf("\t-> Allocation failed, likely cause: need more memory, will exit.\n");
    exit(0);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, %eax
shlq $0x3, %rax
testl %edi, %edi
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x2030
movq %rax, %r14
pushq $0x10
popq %rdi
callq 0x2220
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
xorl %ecx, %ecx
testl %ebx, %ebx
movl $0x0, %edx
cmovgl %ebx, %edx
cmpq %rcx, %rdx
je 0x9812
andq $0x0, (%r14,%rcx,8)
incq %rcx
jmp 0x9803
movl %ebx, (%rax)
movq %r14, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0x9822
movq %rax, %rdi
cmpl $0x1, %edx
jne 0x9868
callq 0x20d0
cvtsi2ss %ebx, %xmm0
mulss 0x2c81(%rip), %xmm0     # 0xc4bc
divss 0x2c75(%rip), %xmm0     # 0xc4b8
cvtss2sd %xmm0, %xmm0
leaq 0x2c92(%rip), %rdi      # 0xc4e0
movb $0x1, %al
callq 0x2040
leaq 0x2ee9(%rip), %rdi      # 0xc745
callq 0x2380
xorl %edi, %edi
callq 0x2280
callq 0x2410
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: allocDoubleArray(dArray*)
dArray *allocDoubleArray(dArray *other){
  try{
    dArray *darray = new dArray();
  double *tmp= new double[other->x];
  
  for (int j=0;j<other->x;j++)
    tmp[j]=other->array[j];
  darray->x=other->x;
  darray->array=tmp;
  return darray;
  }catch(std::exception & e){
    printf("\t-> Allocation failed, likely cause: need more memory, will exit.\n");
    exit(0);
  }

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x10
popq %rdi
callq 0x2220
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movslq (%rbx), %r15
leaq (,%r15,8), %rax
testq %r15, %r15
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x2030
xorl %ecx, %ecx
testl %r15d, %r15d
movl $0x0, %edx
cmovgl %r15d, %edx
cmpq %rcx, %rdx
je 0x98c6
movq 0x8(%rbx), %rsi
movsd (%rsi,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
incq %rcx
jmp 0x98ae
movl %r15d, (%r14)
movq %rax, 0x8(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
jmp 0x98d8
movq %rax, %rdi
cmpl $0x1, %edx
jne 0x98f8
callq 0x20d0
leaq 0x2e59(%rip), %rdi      # 0xc745
callq 0x2380
xorl %edi, %edi
callq 0x2280
callq 0x2410
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: killFunctionPars(functionPars*)
void killFunctionPars(functionPars *tmp){

  killMatrix(tmp->data);
  killArray(tmp->pair);
  
  killArray(tmp->position);//this is the pos from the outer run
  killArray(tmp->alim);
  killArray(tmp->par); 
  killArray(tmp->chr);

  delete tmp;

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x9439
movq 0x8(%rbx), %rdi
callq 0x93b4
movq 0x18(%rbx), %rdi
callq 0x9378
movq 0x28(%rbx), %rdi
callq 0x9378
movq 0x20(%rbx), %rdi
callq 0x9378
movq 0x10(%rbx), %rdi
callq 0x93b4
movq %rbx, %rdi
callq 0x9ef6
movl $0x178, %esi            # imm = 0x178
movq %rbx, %rdi
popq %rbx
jmp 0x2230
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: killHapStruct(hapStruct*)
void killHapStruct(hapStruct *tmp){
  killMatrix(tmp->pBA);
  killMatrix(tmp->pBa);
  killMatrix(tmp->pbA);
  killMatrix(tmp->pba);
  killMatrix(tmp->mea);
  delete tmp;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x9420
movq 0x8(%rbx), %rdi
callq 0x9420
movq 0x10(%rbx), %rdi
callq 0x9420
movq 0x18(%rbx), %rdi
callq 0x9420
movq 0x20(%rbx), %rdi
callq 0x9420
pushq $0x28
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x2230
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: killFullResults(fullResults*)
void killFullResults(fullResults *tmp){

  killArray(tmp->kResult);

  if (tmp->S1!=tmp->S)
    killMatrix(tmp->S);
  killMatrix(tmp->S1);

  killArray(tmp->t);

  
  killArray(tmp->position);
  
  //killArray(tmp->alim);
  
  if(tmp->choose!=NULL)
    killArray(tmp->choose);
  if(tmp->back!=0)
    killHapStruct(tmp->hap);
  else
    delete tmp->hap;
  killArray(tmp->maf);
  killArray(tmp->chr); //COKE ROX
  killMatrix(tmp->post);
  if(tmp->convInfo!=NULL)
    killMatrix(tmp->convInfo);
  killArray(tmp->keepList);
  killArray(tmp->path);
  delete tmp;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x9378
movq 0x10(%rbx), %rax
movq 0x88(%rbx), %rdi
cmpq %rax, %rdi
je 0x99b3
movq %rax, %rdi
callq 0x9420
movq 0x88(%rbx), %rdi
callq 0x9420
movq 0x40(%rbx), %rdi
callq 0x9378
movq 0x50(%rbx), %rdi
callq 0x9378
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x99d8
callq 0x93b4
cmpl $0x0, 0x78(%rbx)
movq 0x80(%rbx), %rdi
je 0x99ec
callq 0x994c
jmp 0x99f4
pushq $0x28
popq %rsi
callq 0x2230
movq 0x90(%rbx), %rdi
callq 0x9378
movq 0x98(%rbx), %rdi
callq 0x93b4
movq 0xa0(%rbx), %rdi
callq 0x9420
movq 0xa8(%rbx), %rdi
testq %rdi, %rdi
je 0x9a29
callq 0x9420
movq 0xb8(%rbx), %rdi
callq 0x93b4
movq 0xc0(%rbx), %rdi
callq 0x93b4
movl $0xf0, %esi
movq %rbx, %rdi
popq %rbx
jmp 0x2230
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: allocFloatArray(int)
fArray *allocFloatArray(int i){
  try{
    float *tmp= new float[i];
    fArray *darray = new fArray();
#if _fillup_
    for (int j=0;j<i;j++)
      tmp[j]=0.0;
#endif
    darray->x=i;
    darray->array=tmp;
    return darray;
  }catch(std::exception & e){
printf("\t-> Tried to allocate: %.3f gig memory\n",(float)sizeof(float)*i/1000000000);
    printf("\t-> Allocation failed, likely cause: need more memory, will exit.\n");
    exit(0);
  }

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, %eax
shlq $0x2, %rax
testl %edi, %edi
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x2030
movq %rax, %r14
pushq $0x10
popq %rdi
callq 0x2220
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
xorl %ecx, %ecx
testl %ebx, %ebx
movl $0x0, %edx
cmovgl %ebx, %edx
cmpq %rcx, %rdx
je 0x9cee
andl $0x0, (%r14,%rcx,4)
incq %rcx
jmp 0x9cdf
movl %ebx, (%rax)
movq %r14, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
jmp 0x9cfe
movq %rax, %rdi
cmpl $0x1, %edx
jne 0x9d44
callq 0x20d0
cvtsi2ss %ebx, %xmm0
mulss 0x279d(%rip), %xmm0     # 0xc4b4
divss 0x2799(%rip), %xmm0     # 0xc4b8
cvtss2sd %xmm0, %xmm0
leaq 0x27b6(%rip), %rdi      # 0xc4e0
movb $0x1, %al
callq 0x2040
leaq 0x2a0d(%rip), %rdi      # 0xc745
callq 0x2380
xorl %edi, %edi
callq 0x2280
callq 0x2410
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/alloc.cpp
// Function: allocFloatMatrix(unsigned long, unsigned long)
fMatrix *allocFloatMatrix(size_t x, size_t y){
  try{
    fMatrix *tmp = new fMatrix();
    float **ppi = new float*[x];
    float *curPtr = new float [x * y];
    
    for(unsigned long int i = 0; i < x; ++i) {
      *(ppi + i) = curPtr;
      curPtr += y;
    }
#if _fillup_
    for (unsigned long int i=0;i<x;i++)
      for(unsigned long int n=0;n<y;n++)
	ppi[i][n]=0;
#endif
    
    tmp->matrix=ppi;
    tmp->x=x;
    tmp->y=y;
    return tmp;
  }catch(std::exception & e){
    printf("\t-> Tried to allocate: %.3f gig memory\n",(float)sizeof(float)*x*y/1000000000);
    printf("\t-> Allocation failed, likely cause: need more memory, will exit.\n");
    exit(0);
  }

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x10
popq %rdi
callq 0x2220
movq %rax, %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movq %r14, %rax
shrq $0x3d, %rax
leaq (,%r14,8), %rcx
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %rcx, %rdi
callq 0x2030
movq %rax, %r12
movq %rbx, %rax
imulq %r14, %rax
movq %rax, %rcx
shrq $0x3e, %rcx
shlq $0x2, %rax
xorl %edi, %edi
negq %rcx
sbbq %rdi, %rdi
orq %rax, %rdi
callq 0x2030
leaq (,%rbx,4), %rcx
xorl %edx, %edx
cmpq %rdx, %r14
je 0x9dc7
movq %rax, (%r12,%rdx,8)
incq %rdx
addq %rcx, %rax
jmp 0x9db6
xorl %eax, %eax
cmpq %r14, %rax
je 0x9de7
xorl %ecx, %ecx
cmpq %rcx, %rbx
je 0x9de2
movq (%r12,%rax,8), %rdx
andl $0x0, (%rdx,%rcx,4)
incq %rcx
jmp 0x9dd0
incq %rax
jmp 0x9dc9
movq %r12, 0x8(%r15)
movl %r14d, (%r15)
movl %ebx, 0x4(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x9e05
jmp 0x9e05
movq %rax, %rdi
cmpl $0x1, %edx
jne 0x9e1e
callq 0x20d0
testq %r14, %r14
js 0x9e23
cvtsi2ss %r14, %xmm0
jmp 0x9e39
callq 0x2410
movq %r14, %rax
shrq %rax
andl $0x1, %r14d
orq %rax, %r14
cvtsi2ss %r14, %xmm0
addss %xmm0, %xmm0
mulss 0x2673(%rip), %xmm0     # 0xc4b4
testq %rbx, %rbx
js 0x9e4d
cvtsi2ss %rbx, %xmm1
jmp 0x9e62
movq %rbx, %rax
shrq %rax
andl $0x1, %ebx
orq %rax, %rbx
cvtsi2ss %rbx, %xmm1
addss %xmm1, %xmm1
mulss %xmm1, %xmm0
divss 0x264a(%rip), %xmm0     # 0xc4b8
cvtss2sd %xmm0, %xmm0
leaq 0x2667(%rip), %rdi      # 0xc4e0
movb $0x1, %al
callq 0x2040
leaq 0x28be(%rip), %rdi      # 0xc745
callq 0x2380
xorl %edi, %edi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/evalAdmix.cpp
// Function: allocDouble2(unsigned long, unsigned long)
double **allocDouble2(size_t x,size_t y){
  double **ret= new double*[x];
  for(size_t i=0;i<x;i++)
    ret[i] = new double[y];
  return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r12
movq %rdi, %rbx
movq %rdi, %rax
shrq $0x3d, %rax
leaq (,%rdi,8), %rcx
xorl %r13d, %r13d
negq %rax
movl $0x0, %edi
sbbq %rdi, %rdi
orq %rcx, %rdi
callq 0x2030
movq %rax, %r14
movq %r12, %rax
shrq $0x3d, %rax
shlq $0x3, %r12
negq %rax
movl $0x0, %r15d
sbbq %r15, %r15
orq %r12, %r15
cmpq %r13, %rbx
je 0x9fa7
movq %r15, %rdi
callq 0x2030
movq %rax, (%r14,%r13,8)
incq %r13
jmp 0x9f91
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/evalAdmix.cpp
// Function: calcRes(float**, float*, unsigned short**, double**, double**, int, int, int, int, int**, int*)
void calcRes(float **r, float *mean_r, unsigned short int **G, double **Q, double **F, int K, int nSites, int nInd,int nIndUse,  int **isMissing, int *useInd){

  double sum_r[nIndUse];
  int usedSites[nIndUse];


  for(int i=0; i<nIndUse;i++){
    sum_r[i] = 0;
    usedSites[i] = 0;
  }

  for(int j=0; j<nSites;j++){
    //int u=0;
    for(int i=0; i<nInd;i++){
      if(useInd[i]){
      if(!isMissing[j][i]){
	
	double fpart=0; // individual freq pi
	
	for(int k=0; k<K; k++){
	  fpart += Q[i][k]*F[j][k];

	  
	}

	 
	r[i][j] = G[j][i] - 2 * fpart;
	sum_r[i] += r[i][j];
	usedSites[i]++;
	//	u++;
      }
      //else u++;
      }
      
    }
  }

  for(int i=0; i<nIndUse;i++){
    //fprintf(stderr, "ind %i has %i sites with data\n", i, usedSites[i]); 
    mean_r[i] = sum_r[i]/usedSites[i];

  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x38(%rbp)
movl 0x20(%rbp), %r15d
movq 0x30(%rbp), %r11
movq 0x28(%rbp), %rbx
movl 0x18(%rbp), %r14d
movl 0x10(%rbp), %r12d
movq %rsp, %rax
leaq 0xf(,%r15,8), %rsi
andq $-0x10, %rsi
subq %rsi, %rax
movq %rax, %rsp
movq %rsp, %r10
leaq 0xf(,%r15,4), %rsi
andq $-0x10, %rsi
subq %rsi, %r10
movq %r10, %rsp
xorl %esi, %esi
testl %r15d, %r15d
movl $0x0, %r13d
cmovgl %r15d, %r13d
cmpq %rsi, %r13
je 0xa28d
andq $0x0, (%rax,%rsi,8)
andl $0x0, (%r10,%rsi,4)
incq %rsi
jmp 0xa279
movq %r13, -0x30(%rbp)
xorl %r13d, %r13d
testl %r9d, %r9d
cmovlel %r13d, %r9d
testl %r14d, %r14d
cmovlel %r13d, %r14d
testl %r12d, %r12d
cmovlel %r13d, %r12d
movq %r12, -0x40(%rbp)
cmpq -0x40(%rbp), %r13
je 0xa33d
xorl %r15d, %r15d
cmpq %r14, %r15
je 0xa335
cmpl $0x0, (%r11,%r15,4)
je 0xa330
movq (%rbx,%r13,8), %rsi
cmpl $0x0, (%rsi,%r15,4)
jne 0xa330
xorpd %xmm0, %xmm0
xorl %esi, %esi
cmpq %rsi, %r9
je 0xa2f9
movq (%rcx,%r15,8), %r12
movsd (%r12,%rsi,8), %xmm1
movq (%r8,%r13,8), %r12
mulsd (%r12,%rsi,8), %xmm1
addsd %xmm1, %xmm0
incq %rsi
jmp 0xa2d7
movq (%rdx,%r13,8), %rsi
movzwl (%rsi,%r15,2), %esi
cvtsi2sd %esi, %xmm1
addsd %xmm0, %xmm0
subsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
movq (%rdi,%r15,8), %rsi
movss %xmm0, (%rsi,%r13,4)
cvtss2sd %xmm0, %xmm0
addsd (%rax,%r15,8), %xmm0
movsd %xmm0, (%rax,%r15,8)
incl (%r10,%r15,4)
incq %r15
jmp 0xa2ba
incq %r13
jmp 0xa2ad
xorl %ecx, %ecx
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rsi
cmpq %rcx, %rsi
je 0xa369
movsd (%rax,%rcx,8), %xmm0
cvtsi2sdl (%r10,%rcx,4), %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rdx,%rcx,4)
incq %rcx
jmp 0xa347
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/evalAdmix.cpp
// Function: correlateRes(int, float*, float*, double, double, int**, int, int)
double correlateRes(int nSites, float *r1, float *r2, double mean_r1, double mean_r2, int **isMissing, int ind1, int ind2){

  double cor_num=0;
  double cor_den1=0;
  double cor_den2=0;
  double d_r1=0;
  double d_r2=0;
  

  for(int j=0; j<nSites;j++){
    //if(j==368)
    //continue;
    if(!isMissing[j][ind1]&!isMissing[j][ind2]){
      d_r1 = (r1[j] - mean_r1);
      d_r2 = (r2[j] - mean_r2);
      cor_num += d_r1*d_r2;
      cor_den1 += d_r1*d_r1;
      cor_den2 += d_r2*d_r2;
    }
    
  }
  double cor;
  cor = cor_num/(sqrt(cor_den1)*sqrt(cor_den2));
  return cor;

}

// Assembly:
subq $0x28, %rsp
movslq %r8d, %rax
xorl %r8d, %r8d
testl %edi, %edi
cmovlel %r8d, %edi
movslq %r9d, %r9
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
xorpd %xmm4, %xmm4
xorpd %xmm3, %xmm3
cmpq %r8, %rdi
je 0xa3dd
movq (%rcx,%r8,8), %r10
movl (%r10,%r9,4), %r11d
orl (%r10,%rax,4), %r11d
jne 0xa3d8
movss (%rdx,%r8,4), %xmm1
movss (%rsi,%r8,4), %xmm2
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
cvtps2pd %xmm2, %xmm1
subpd %xmm0, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
mulsd %xmm1, %xmm2
addsd %xmm2, %xmm3
mulpd %xmm1, %xmm1
addpd %xmm1, %xmm4
incq %r8
jmp 0xa397
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm4
movapd %xmm3, 0x10(%rsp)
jb 0xa3f3
sqrtsd %xmm4, %xmm2
jmp 0xa40e
movapd %xmm4, %xmm0
movapd %xmm4, (%rsp)
callq 0x2190
movapd (%rsp), %xmm4
movapd %xmm0, %xmm2
xorpd %xmm0, %xmm0
unpckhpd %xmm4, %xmm4            # xmm4 = xmm4[1,1]
ucomisd %xmm0, %xmm4
jb 0xa41e
sqrtsd %xmm4, %xmm0
jmp 0xa431
movapd %xmm4, %xmm0
movsd %xmm2, (%rsp)
callq 0x2190
movsd (%rsp), %xmm2
movapd 0x10(%rsp), %xmm1
mulsd %xmm0, %xmm2
divsd %xmm2, %xmm1
movapd %xmm1, %xmm0
addq $0x28, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/ngsevalAdmix.cpp
// Function: allocDouble2b(unsigned long, unsigned long)
double **allocDouble2b(size_t x,size_t y){
  double **ret= new double*[x];
  for(size_t i=0;i<x;i++)
    ret[i] = new double[y];
  return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r12
movq %rdi, %rbx
movq %rdi, %rax
shrq $0x3d, %rax
leaq (,%rdi,8), %rcx
xorl %r13d, %r13d
negq %rax
movl $0x0, %edi
sbbq %rdi, %rdi
orq %rcx, %rdi
callq 0x2030
movq %rax, %r14
movq %r12, %rax
shrq $0x3d, %rax
shlq $0x3, %r12
negq %rax
movl $0x0, %r15d
sbbq %r15, %r15
orq %r12, %r15
cmpq %r13, %rbx
je 0xa74f
movq %r15, %rdi
callq 0x2030
movq %rax, (%r14,%r13,8)
incq %r13
jmp 0xa739
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/GenisGE[P]evalAdmix/ngsevalAdmix.cpp
// Function: correlateNGSRes(int, double*, double*, double, double, char**, int, int)
double correlateNGSRes(int nSites, double *r1, double *r2, double mean_r1, double mean_r2, char **keep, int ind1, int ind2){

  double cor_num=0;
  double cor_den1=0;
  double cor_den2=0;
  double d_r1=0;
  double d_r2=0;
  

  for(int j=0; j<nSites;j++){

    if(keep[j][ind1] == 1 & keep[j][ind2] == 1){
      d_r1 = (r1[j] - mean_r1);
      d_r2 = (r2[j] - mean_r2);

      cor_num += d_r1*d_r2;
      cor_den1 += d_r1*d_r1;
      cor_den2 += d_r2*d_r2;
    }
    
  }
  double cor;
  cor = cor_num/(sqrt(cor_den1)*sqrt(cor_den2));
  /*if(isnan(cor)){
    fprintf(stderr, "NaN generated when calculating residuals of individuals %i and %i \n", ind1, ind2);
    fprintf(stderr, "Numerator was %.3f, denominator was square root of %.3f times %.3f mean residual 1 was %.3f and mean residual 2 %.3f\n",cor_num, cor_den1, cor_den2, mean_r1, mean_r2);
    exit(0);
    }*/
  return cor;

}

// Assembly:
subq $0x28, %rsp
movslq %r8d, %rax
xorl %r8d, %r8d
testl %edi, %edi
cmovlel %r8d, %edi
movslq %r9d, %r9
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
xorpd %xmm4, %xmm4
xorpd %xmm3, %xmm3
cmpq %r8, %rdi
je 0xab96
movq (%rcx,%r8,8), %r10
cmpb $0x1, (%r10,%rax)
jne 0xab91
cmpb $0x1, (%r10,%r9)
jne 0xab91
movsd (%rsi,%r8,8), %xmm1
movhpd (%rdx,%r8,8), %xmm1     # xmm1 = xmm1[0],mem[0]
subpd %xmm0, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
mulsd %xmm1, %xmm2
addsd %xmm2, %xmm3
mulpd %xmm1, %xmm1
addpd %xmm1, %xmm4
incq %r8
jmp 0xab52
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm4
movapd %xmm3, 0x10(%rsp)
jb 0xabac
sqrtsd %xmm4, %xmm2
jmp 0xabc7
movapd %xmm4, %xmm0
movapd %xmm4, (%rsp)
callq 0x2190
movapd (%rsp), %xmm4
movapd %xmm0, %xmm2
xorpd %xmm0, %xmm0
unpckhpd %xmm4, %xmm4            # xmm4 = xmm4[1,1]
ucomisd %xmm0, %xmm4
jb 0xabd7
sqrtsd %xmm4, %xmm0
jmp 0xabea
movapd %xmm4, %xmm0
movsd %xmm2, (%rsp)
callq 0x2190
movsd (%rsp), %xmm2
movapd 0x10(%rsp), %xmm1
mulsd %xmm0, %xmm2
divsd %xmm2, %xmm1
movapd %xmm1, %xmm0
addq $0x28, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/test_co_sst.cpp
// Function: test_get_update_2()
void test_get_update_2() {
    // Test edge case with a tree of size 1.
    co_static_search_tree tree(1);
    tree.update(0, 2);
    if (tree.get(2) != 0) {
        cout << "test_get_update_2 failed: expected 2 at index 0." << endl;
        return;
    }
    tree.update(0, 5);
    if (tree.get(5) != 0) {
        cout << "test_get_update_2 failed: expected 5 at index 0." << endl;
        return;
    }
    tree.update(0, 501);
    if (tree.get(501) != 0) {
        cout << "test_get_update_2 failed: expected 501 at index 0." << endl;
        return;
    }
    cout << "test_get_update_2: OK" << endl;
}

// Assembly:
pushq %rbx
subq $0xc0, %rsp
movq %rsp, %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x133c
pushq $0x2
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x154e
movq %rsp, %rdi
pushq $0x2
popq %rsi
callq 0x16ba
testl %eax, %eax
je 0x297e
leaq 0x18d9(%rip), %rsi      # 0x4255
jmp 0x29d3
movq %rsp, %rdi
pushq $0x5
popq %rdx
xorl %esi, %esi
callq 0x154e
movq %rsp, %rdi
pushq $0x5
popq %rsi
callq 0x16ba
testl %eax, %eax
je 0x29a3
leaq 0x18e5(%rip), %rsi      # 0x4286
jmp 0x29d3
movq %rsp, %rdi
xorl %esi, %esi
movl $0x1f5, %edx            # imm = 0x1F5
callq 0x154e
movq %rsp, %rdi
movl $0x1f5, %esi            # imm = 0x1F5
callq 0x16ba
testl %eax, %eax
leaq 0x1922(%rip), %rax      # 0x42ea
leaq 0x18e8(%rip), %rsi      # 0x42b7
cmoveq %rax, %rsi
movq 0x45fe(%rip), %rdi      # 0x6fd8
callq 0x1100
movq %rax, %rdi
callq 0x10a0
movq %rsp, %rdi
callq 0x13b4
addq $0xc0, %rsp
popq %rbx
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x13b4
movq %rbx, %rdi
callq 0x11d0
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/test_co_sst.cpp
// Function: test_range_update_uniform(int)
void test_range_update_uniform(const int n) {
    co_static_search_tree tree(n);
    int arr[n];
    for (int i = 0; i < n; ++i) {
        arr[i] = i * 5;
    }
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < n; ++j){
            arr[j] = j * 5;
        }
        int len = rand() % (n / 2) + 1;
        int R = min(i + len - 1, n - 1);
        tree.range_update(i, R, arr);

        i += (len - 1);
    }
    for (int i = 0; i < (n - 1) * 5; ++i) {
        int result = tree.get(i);
        int expected = ceil(i / 5.0);
        if (result != expected)
        {
            printf("Incorrect index for query value %d, got %d, expected %d\n", i, result, expected);
            exit(-1);
        }
    }
    cout << "Success range update uniform: " << n << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %edi, %ebx
leaq -0x100(%rbp), %rdi
movl %ebx, %esi
callq 0x133c
movq %rsp, -0x40(%rbp)
movl %ebx, %eax
movq %rsp, %r14
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
xorl %eax, %eax
testl %ebx, %ebx
movl $0x0, %ecx
movq %rbx, -0x30(%rbp)
cmovgl %ebx, %ecx
leaq (%rcx,%rcx,4), %rbx
movq %r14, %rcx
cmpq %rax, %rbx
je 0x30a8
movl %eax, (%rcx)
addq $0x5, %rax
addq $0x4, %rcx
jmp 0x3097
pushq $0x2
popq %rcx
movq -0x30(%rbp), %rsi
movl %esi, %eax
cltd
idivl %ecx
movl %eax, -0x34(%rbp)
leal -0x1(%rsi), %r15d
xorl %r13d, %r13d
cmpl -0x30(%rbp), %r13d
jge 0x310d
movq %r14, %rax
xorl %ecx, %ecx
cmpq %rcx, %rbx
je 0x30da
movl %ecx, (%rax)
addq $0x5, %rcx
addq $0x4, %rax
jmp 0x30c9
callq 0x1060
cltd
idivl -0x34(%rbp)
movl %edx, %r12d
addl %r13d, %r12d
cmpl %r12d, %r15d
movl %r12d, %edx
cmovll %r15d, %edx
leaq -0x100(%rbp), %rdi
movl %r13d, %esi
movq %r14, %rcx
callq 0x188e
incl %r12d
movl %r12d, %r13d
jmp 0x30be
movq -0x30(%rbp), %rax
leal (%rax,%rax,4), %ebx
addl $-0x5, %ebx
xorl %r14d, %r14d
testl %ebx, %ebx
cmovlel %r14d, %ebx
leaq -0x100(%rbp), %r15
cmpl %r14d, %ebx
je 0x315a
movq %r15, %rdi
movl %r14d, %esi
callq 0x16ba
movl %eax, %r12d
cvtsi2sd %r14d, %xmm0
divsd 0x1029(%rip), %xmm0     # 0x4170
callq 0x1050
cvttsd2si %xmm0, %ecx
cmpl %ecx, %r12d
jne 0x31a0
incl %r14d
jmp 0x3127
movq 0x3e77(%rip), %rdi      # 0x6fd8
leaq 0x12dc(%rip), %rsi      # 0x4444
callq 0x1100
movq %rax, %rdi
movq -0x30(%rbp), %rsi
callq 0x11c0
movq %rax, %rdi
callq 0x10a0
movq -0x40(%rbp), %rsp
leaq -0x100(%rbp), %rdi
callq 0x13b4
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1247(%rip), %rdi      # 0x43ee
movl %r14d, %esi
movl %r12d, %edx
xorl %eax, %eax
callq 0x1030
pushq $-0x1
popq %rdi
callq 0x1150
jmp 0x31c0
jmp 0x31c0
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x13b4
movq %rbx, %rdi
callq 0x11d0
// File: /workspace/github_cpp_makefile_star2_O2/6851-2021[P]Cache-Oblivious-Data-Structures/static_search_trees/test_co_sst.cpp
// Function: main
int main() {
    srand(10);
    chrono::steady_clock::time_point begin = chrono::steady_clock::now();
    test_get_update_1();
    test_get_update_2();
    test_get_update_3();
    test_get_update_4();
    test_get_update_5();
    test_range_update_small();
    test_range_update_uniform(16);
    test_range_update_uniform(20);
    test_range_update_uniform(100);
    test_range_update_uniform(500);
    test_range_update_uniform(1e6);
    chrono::steady_clock::time_point end = chrono::steady_clock::now();
    cout << "Time difference = " << chrono::duration_cast<chrono::microseconds>(end - begin).count() << "[µs]" << std::endl;

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
pushq $0xa
popq %rdi
callq 0x10f0
callq 0x1160
movq %rax, %rbx
callq 0x27b5
callq 0x2943
callq 0x2a0b
callq 0x2b5c
callq 0x2cde
callq 0x2e36
pushq $0x10
popq %rdi
callq 0x3041
pushq $0x14
popq %rdi
callq 0x3041
pushq $0x64
popq %rdi
callq 0x3041
movl $0x1f4, %edi            # imm = 0x1F4
callq 0x3041
movl $0xf4240, %edi          # imm = 0xF4240
callq 0x3041
callq 0x1160
movq %rax, %r14
movq 0x3d94(%rip), %rdi      # 0x6fd8
leaq 0x1218(%rip), %rsi      # 0x4463
callq 0x1100
movq %rax, %rdi
subq %rbx, %r14
movl $0x3e8, %ecx            # imm = 0x3E8
movq %r14, %rax
cqto
idivq %rcx
movq %rax, %rsi
callq 0x10e0
leaq 0x1204(%rip), %rsi      # 0x4476
movq %rax, %rdi
callq 0x1100
movq %rax, %rdi
callq 0x10a0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/TracyLaiMan[P]GLib_Example/GLibExample.cpp
// Function: glib::GLibExample::init()
bool GLibExample::init(){
    std::cout << "GLibExample::init" << std::endl;

    m_workerContext = g_main_context_new();

    if (nullptr == m_workerContext) {
        return false;
    }

    m_eventLoop = g_main_loop_new(m_workerContext, false);
    if (nullptr == m_eventLoop) {
        return false;
    }

    m_eventThread = std::thread(&GLibExample::mainLoopThread, this);
 
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x3b47(%rip), %rdi      # 0x5fd0
leaq 0xb74(%rip), %rsi       # 0x3004
callq 0x21b0
movq %rax, %rdi
callq 0x20a0
callq 0x21e0
movq %rax, 0x8(%rbx)
xorl %r14d, %r14d
testq %rax, %rax
je 0x2500
movq %rax, %rdi
xorl %esi, %esi
callq 0x2140
movq %rax, (%rbx)
testq %rax, %rax
je 0x2500
leaq 0x45(%rip), %rax        # 0x250c
leaq -0x30(%rbp), %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
leaq -0x18(%rbp), %rdx
movq %rbx, (%rdx)
leaq -0x20(%rbp), %r14
movq %r14, %rdi
callq 0x25c8
addq $0x28, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2646
movq %r14, %rdi
callq 0x2664
movb $0x1, %r14b
movl %r14d, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/TracyLaiMan[P]GLib_Example/GLibExample.cpp
// Function: glib::GLibExample::mainLoopThread()
void GLibExample::mainLoopThread(){
    g_main_context_push_thread_default(m_workerContext);
    do{
        std::cout << "mainLoopThread running" << std::endl;
        g_main_loop_run(m_eventLoop);
    }while(false);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x2030
movq 0x3aab(%rip), %rdi      # 0x5fd0
leaq 0xaea(%rip), %rsi       # 0x3016
callq 0x21b0
movq %rax, %rdi
callq 0x20a0
movq (%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2120
nop
// File: /workspace/github_cpp_makefile_star2_O2/TracyLaiMan[P]GLib_Example/GLibExample.cpp
// Function: glib::GLibExample::SourceEventTest()
void GLibExample::SourceEventTest(){
    
    auto source = g_idle_source_new();
    g_source_set_callback(source, reinterpret_cast<GSourceFunc>(&onEventCallback), this, nullptr);
    g_source_attach(source, m_workerContext);
    g_source_unref(source);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x20d0
movq %rax, %r14
leaq 0x25(%rip), %rsi        # 0x2586
movq %rax, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x2240
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x21a0
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0
// File: /workspace/github_cpp_makefile_star2_O2/TracyLaiMan[P]GLib_Example/main.cpp
// Function: main
int main(int argc, char **argv){

    auto example = glib::GLibExample::create();
    std::cout << "***Hi GLib***" << std::endl;
    while(1)
    {
	example->SourceEventTest();
        sleep(1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
leaq -0x18(%rbp), %rdi
callq 0x240c
movq 0x315f(%rip), %rdi      # 0x5fd0
leaq 0x3aa(%rip), %rsi       # 0x3222
callq 0x21b0
movq %rax, %rdi
callq 0x20a0
pushq $0x1
popq %rbx
movq -0x18(%rbp), %rdi
callq 0x2548
movl %ebx, %edi
callq 0x2110
jmp 0x2e88
jmp 0x2e9c
movq %rax, %rbx
leaq -0x10(%rbp), %rdi
callq 0x2968
movq %rbx, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/RDATDecoder.cc
// Function: RDATDecoder::RDATDecoder(float)
RDATDecoder::RDATDecoder(float sampleRate)
: mSyncWindowCurPos(0), mSyncWindowSyncPos(0),
  mClockDetected(false), mClockRatioThreshold(0.97),
  mClockAlpha(1.0 / 30.0),
  //
  // A track is 196 blocks in duration. Convert that to samples and
  // add padding.
  //
  mTrackDuration((sampleRate / kSymbolRate) * 10 * 36 * 196 * 1.05),
  mTrackInProgress(false)
{
  int i;
  
  //
  // Create a filter bank/window for the clock detector.
  //
  mSyncWindowSize = sampleRate / kSymbolRate;
  mSyncWindow = new float[mSyncWindowSize];
  mSyncWindowEvalPos = mSyncWindowSize / 2;
  mSyncWindowNextEvalPos = mSyncWindowEvalPos;
  
  for (i = 0; i < mSyncWindowSize; i++)
    mSyncWindow[i] = 0.0;

  //
  // Keep a history of the sign of the last sample.
  //
  mLastSign = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xc232(%rip), %rax      # 0xe9e0
movq %rax, (%rdi)
andq $0x0, 0x1c(%rdi)
xorl %r15d, %r15d
movb %r15b, 0x2c(%rdi)
movsd 0x5aeb(%rip), %xmm1     # 0x82b0
movsd %xmm1, 0x30(%rdi)
divss 0x5afe(%rip), %xmm0     # 0x82d0
movss 0x5afa(%rip), %xmm1     # 0x82d4
mulss %xmm0, %xmm1
mulss 0x5af2(%rip), %xmm1     # 0x82d8
mulss 0x5aee(%rip), %xmm1     # 0x82dc
movb %r15b, 0x40(%rdi)
cvtss2sd %xmm1, %xmm1
mulsd 0x5aea(%rip), %xmm1     # 0x82e8
cvttsd2si %xmm1, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x5ade(%rip), %xmm1     # 0x82f0
cvttsd2si %xmm1, %rdx
andq %rcx, %rdx
orq %rax, %rdx
cvttss2si %xmm0, %eax
movq %rdx, 0x48(%rdi)
movl %eax, 0x18(%rdi)
movslq %eax, %r14
leaq (,%r14,4), %rax
testl %r14d, %r14d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
movl $0x0, %r12d
cmovgl %r14d, %r12d
callq 0x2030
movq %rax, %rcx
movq %rax, 0x10(%rbx)
pushq $0x2
popq %rsi
movl %r14d, %eax
cltd
idivl %esi
movl %eax, 0x24(%rbx)
movl %eax, 0x28(%rbx)
cmpq %r15, %r12
je 0x2871
andl $0x0, (%rcx,%r15,4)
incq %r15
jmp 0x2862
movb $0x0, 0x38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ke6jjj[P]r-dat/RDATDecoder.cc
// Function: RDATDecoder::ClockDetect(float)
bool
RDATDecoder::ClockDetect(float sample)
{
  bool syncNow = false;
  
  mSyncWindow[mSyncWindowCurPos] *= (1.0 - mClockAlpha);
  mSyncWindow[mSyncWindowCurPos] += fabs(sample) * mClockAlpha;

  //
  // If we're at the currently suggested sync window position,
  // remember so.
  //
  if (mSyncWindowCurPos == mSyncWindowSyncPos) {
    syncNow = true;
    
    //
    // Do a staggered update of the sync window evaluation
    // position based on the last position calculation.
    //
    mSyncWindowEvalPos = mSyncWindowNextEvalPos;
  }

  if (mSyncWindowCurPos == mSyncWindowEvalPos) {
      //
      // Take this opportunity to rescan the window,
      // looking for the highest energy peak and thus, the
      // best synchronization point.
      //
      EvaluateClock();
  }
  
  //
  // Advance the window, wrapping if necessary.
  //
  if (++mSyncWindowCurPos == mSyncWindowSize)
    //
    // We've reached the end of the window.
    // Wrap around.
    //
    mSyncWindowCurPos = 0;  
  
  return mClockDetected && syncNow;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cvtss2sd 0x34(%rdi), %xmm1
movsd 0x5950(%rip), %xmm2     # 0x82f8
subsd %xmm1, %xmm2
movq 0x10(%rdi), %rax
movslq 0x1c(%rdi), %r14
cvtss2sd (%rax,%r14,4), %xmm1
mulsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm1
movss %xmm1, (%rax,%r14,4)
andps 0x58f1(%rip), %xmm0     # 0x82c0
mulss 0x34(%rdi), %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax,%r14,4)
movl 0x20(%rdi), %ebp
cmpl %ebp, %r14d
jne 0x29ee
movl 0x28(%rbx), %eax
movl %eax, 0x24(%rbx)
jmp 0x29f1
movl 0x24(%rbx), %eax
movl %r14d, %ecx
cmpl %eax, %r14d
jne 0x2a04
movq %rbx, %rdi
callq 0x2a2a
movl 0x1c(%rbx), %ecx
cmpl %ebp, %r14d
sete %al
incl %ecx
xorl %edx, %edx
cmpl 0x18(%rbx), %ecx
cmovnel %ecx, %edx
movl %edx, 0x1c(%rbx)
andb 0x2c(%rbx), %al
popq %rbx
popq %r14
popq %rbp
retq
nop