LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: poissonInt
double poissonInt(int k, double lambda){
  int i;
  double answer = 1.0;
  for(i = 1; i < k+1; i++){
    answer = answer*lambda*exp(-lambda/(float)k)/(float)i;
  }
  return answer;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movaps %xmm0, 0x10(%rsp)
testl %edi, %edi
jle 0xaabd
movl %edi, %ebx
movapd 0x130a4(%rip), %xmm1    # 0x1daf0
xorpd 0x10(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsi2ss %edi, %xmm0
cvtss2sd %xmm0, %xmm0
divsd %xmm0, %xmm1
movapd %xmm1, 0x20(%rsp)
negl %ebx
movl $0x1, %r14d
movsd 0x12fc1(%rip), %xmm1    # 0x1da38
mulsd 0x10(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
movapd 0x20(%rsp), %xmm0
callq 0x3680
mulsd 0x8(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %r14d, %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
leal (%rbx,%r14), %eax
incl %eax
movl %r14d, %ecx
incl %ecx
movapd %xmm0, %xmm1
movl %ecx, %r14d
cmpl $0x1, %eax
jne 0xaa77
jmp 0xaac5
movsd 0x12f73(%rip), %xmm0    # 0x1da38
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: seqToChar
unsigned char seqToChar(const char pos1, const char pos2, const char pos3, const char pos4){
    unsigned char seqChar = 0;
    seqChar += (pos1 == 'A' || pos1 == 'G');
    seqChar += (pos1 == 'A' || pos1 == 'C')*2;
    seqChar += (pos2 == 'A' || pos2 == 'G')*4;
    seqChar += (pos2 == 'A' || pos2 == 'C')*8;
    seqChar += (pos3 == 'A' || pos3 == 'G')*16;
    seqChar += (pos3 == 'A' || pos3 == 'C')*32;
    seqChar += (pos4 == 'A' || pos4 == 'G')*64;
    seqChar += (pos4 == 'A' || pos4 == 'C')*128;
    return seqChar;
}

// Assembly:
cmpb $0x41, %dil
sete %al
cmpb $0x47, %dil
sete %r8b
orb %al, %r8b
cmpb $0x43, %dil
sete %dil
orb %al, %dil
addb %dil, %dil
orb %r8b, %dil
cmpb $0x41, %sil
sete %al
cmpb $0x47, %sil
sete %r8b
orb %al, %r8b
shlb $0x2, %r8b
cmpb $0x43, %sil
sete %sil
orb %al, %sil
shlb $0x3, %sil
cmpb $0x41, %dl
sete %al
cmpb $0x47, %dl
sete %r9b
orb %al, %r9b
shlb $0x4, %r9b
cmpb $0x43, %dl
sete %dl
orb %al, %dl
shlb $0x5, %dl
cmpb $0x41, %cl
sete %r10b
cmpb $0x47, %cl
sete %al
orb %r10b, %al
shlb $0x6, %al
cmpb $0x43, %cl
sete %cl
orb %r10b, %cl
shlb $0x7, %cl
orb %dil, %r8b
orb %sil, %r8b
orb %r9b, %r8b
orb %dl, %al
orb %r8b, %al
addb %cl, %al
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: makeQual
void makeQual(const char qual[], const unsigned int seqLen, char quality[], int qualityHistogram[]){
  int i;
  for(i = 0; i < seqLen; i++){
    quality[i] = qual[i];
    qualityHistogram[qual[i] - 64]++;
  }
}

// Assembly:
testl %esi, %esi
je 0xac2b
movl %esi, %eax
xorl %esi, %esi
movb (%rdi,%rsi), %r8b
movb %r8b, (%rdx,%rsi)
movsbq (%rdi,%rsi), %r8
incl -0x100(%rcx,%r8,4)
incq %rsi
cmpq %rsi, %rax
jne 0xac0e
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: makeSeq
void makeSeq(const char seq[], const unsigned int seqLen, unsigned char sequence[]){
    int i;
    // make all multiples of 4 possible
    for(i = 0; i < seqLen/4; i++){
        sequence[i] = seqToChar(seq[i*4], seq[i*4 + 1], seq[i*4 + 2], seq[i*4 + 3]);
    }
    if(seqLen%4 == 3){
        sequence[seqLen/4] = seqToChar(seq[i*4], seq[i*4 + 1], seq[i*4 + 2], 'T');
    }else if(seqLen%4 == 2){
        sequence[seqLen/4] = seqToChar(seq[i*4], seq[i*4 + 1], 'T', 'T');
    }else if(seqLen%4 == 1){
        sequence[seqLen/4] = seqToChar(seq[i*4], 'T', 'T', 'T');
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r14
movl %esi, %r12d
shrl $0x2, %r12d
xorl %r13d, %r13d
cmpl $0x4, %esi
jb 0xacd6
leal (,%r12,4), %ebp
xorl %r13d, %r13d
movq %rbx, (%rsp)
movsbl (%r14,%r13), %edi
movsbl 0x1(%r14,%r13), %esi
movsbl 0x2(%r14,%r13), %edx
movsbl 0x3(%r14,%r13), %ecx
callq 0xab6f
movb %al, (%rbx)
incq %rbx
addq $0x4, %r13
cmpq %r13, %rbp
jne 0xaca8
movq (%rsp), %rbx
andl $0x3, %r15d
leaq 0x184af(%rip), %rax     # 0x23190
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl %r13d, %eax
movb (%r14,%rax), %al
cmpb $0x41, %al
sete %cl
cmpb $0x47, %al
sete %dl
orb %cl, %dl
cmpb $0x43, %al
sete %al
orb %cl, %al
addb %al, %al
jmp 0xad52
movl %r13d, %eax
movb (%r14,%rax), %cl
movb 0x1(%r14,%rax), %dl
cmpb $0x41, %cl
sete %al
cmpb $0x47, %cl
sete %sil
orb %al, %sil
cmpb $0x43, %cl
sete %cl
orb %al, %cl
addb %cl, %cl
orb %sil, %cl
cmpb $0x41, %dl
sete %sil
cmpb $0x47, %dl
sete %al
orb %sil, %al
shlb $0x2, %al
cmpb $0x43, %dl
sete %dl
orb %sil, %dl
shlb $0x3, %dl
orb %cl, %al
orb %dl, %al
jmp 0xad74
movl %r13d, %eax
movsbl (%r14,%rax), %edi
movsbl 0x1(%r14,%rax), %esi
movsbl 0x2(%r14,%rax), %edx
movl $0x54, %ecx
callq 0xab6f
movb %al, (%rbx,%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: charToSeq
void charToSeq(unsigned char num, char seq[], const int len){
    int i;
    for(i = 0; i < len; i++){
        if(num%2){ // A or G
            num = num >> 1;
            if(num%2){ // A or C match?
                seq[i] = 'A';
            }else{
                seq[i] = 'G';
            }
        }else{
            num = num >> 1;
            if(num%2){ // A or C match?
                seq[i] = 'C';
            }else{
                seq[i] = 'T';
            }
        }
        num = num >> 1;
    }
    for(i = len; i < 4; i++){ // fill in the rest with spaces
        seq[i] = ' ';
    }
}

// Assembly:
testl %edx, %edx
jle 0xadf9
movl %edx, %eax
xorl %ecx, %ecx
movl $0x47, %r8d
movl $0x54, %r9d
testb $0x2, %dil
movl $0x41, %r10d
cmovel %r8d, %r10d
movl $0x43, %r11d
cmovel %r9d, %r11d
testb $0x1, %dil
cmovnel %r10d, %r11d
movb %r11b, (%rsi,%rcx)
shrb $0x2, %dil
incq %rcx
cmpq %rcx, %rax
jne 0xadc9
cmpl $0x3, %edx
jg 0xae1e
movslq %edx, %rax
addq %rax, %rsi
movl $0x3, %eax
subl %edx, %eax
incq %rax
movq %rsi, %rdi
movl $0x20, %esi
movq %rax, %rdx
jmp 0x3260
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: PrintSequence
void PrintSequence(const unsigned char sequence[], const unsigned int seqLen){
    char seqer[4];
    int j;
    for(j = 0; j < seqLen/4; j++){
        charToSeq(sequence[j], seqer, 4);
        //printf("%.4s", seqer);
    }
    if(seqLen%4 != 0){
        charToSeq(sequence[seqLen/4], seqer, seqLen%4);
        //printf("%.4s", seqer);
    }
    //printf("\n");
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %edx
movl %esi, %eax
shrl $0x2, %eax
cmpl $0x4, %esi
jb 0xae7e
movl %eax, %ecx
xorl %esi, %esi
movl $0x47, %r8d
movl $0x54, %r9d
movb (%rdi,%rsi), %r10b
xorl %r11d, %r11d
testb $0x2, %r10b
movl $0x41, %ebx
cmovel %r8d, %ebx
movl $0x43, %ebp
cmovel %r9d, %ebp
testb $0x1, %r10b
cmovnel %ebx, %ebp
movb %bpl, 0x4(%rsp,%r11)
shrb $0x2, %r10b
incq %r11
cmpq $0x4, %r11
jne 0xae47
incq %rsi
cmpq %rcx, %rsi
jne 0xae40
andl $0x3, %edx
je 0xae91
movzbl (%rdi,%rax), %edi
leaq 0x4(%rsp), %rsi
callq 0xadb5
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: copyAlignment
void copyAlignment(alignSet_t *dst, const alignSet_t *src) {
    assert(dst != NULL);
    assert(src != NULL);
    destroyAlignment(dst);

    dst->likelihood = src->likelihood;
    dst->likelihoodInsert = src->likelihoodInsert;
    dst->start1 = src->start1;
    dst->start2 = src->start2;
    dst->end1 = src->end1;
    dst->end2 = src->end2;
    dst->contigId1 = src->contigId1;
    dst->contigId2 = src->contigId2;
    if (src->name != NULL)
        dst->name = strdup(src->name);
    else
        dst->name = NULL;
    dst->orientation = src->orientation;
    dst->nextAlignment = src->nextAlignment;
    dst->bamOfAlignment1 = src->bamOfAlignment1;
    dst->bamOfAlignment2 = src->bamOfAlignment2;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xafe1
movq %rsi, %r14
testq %rsi, %rsi
je 0xb000
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0xaf66
callq 0x3070
movsd (%r14), %xmm0
movsd %xmm0, (%rbx)
movsd 0x8(%r14), %xmm0
movsd %xmm0, 0x8(%rbx)
movl 0x10(%r14), %eax
movl %eax, 0x10(%rbx)
movl 0x14(%r14), %eax
movl %eax, 0x14(%rbx)
movl 0x18(%r14), %eax
movl %eax, 0x18(%rbx)
movl 0x1c(%r14), %eax
movl %eax, 0x1c(%rbx)
movl 0x20(%r14), %eax
movl %eax, 0x20(%rbx)
movl 0x24(%r14), %eax
movl %eax, 0x24(%rbx)
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0xafb4
callq 0x3630
jmp 0xafb6
xorl %eax, %eax
movq %rax, 0x28(%rbx)
movl 0x40(%r14), %eax
movl %eax, 0x40(%rbx)
movq 0x48(%r14), %rax
movq %rax, 0x48(%rbx)
movq 0x30(%r14), %rax
movq %rax, 0x30(%rbx)
movq 0x38(%r14), %rax
movq %rax, 0x38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x18c52(%rip), %rdi     # 0x23c3a
leaq 0x18c57(%rip), %rsi     # 0x23c46
leaq 0x18c81(%rip), %rcx     # 0x23c77
movl $0x162, %edx            # imm = 0x162
callq 0x3230
leaq 0x18ca5(%rip), %rdi     # 0x23cac
leaq 0x18c38(%rip), %rsi     # 0x23c46
leaq 0x18c62(%rip), %rcx     # 0x23c77
movl $0x163, %edx            # imm = 0x163
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: getGCtotal
int getGCtotal(char seq1[], int seq1len){
    int GCtot = 0, i;
    for(i = 0; i < seq1len; i++){
        if(isGC(seq1[i])){
            GCtot++;
        }
    }
    return GCtot;
}

// Assembly:
testl %esi, %esi
jle 0xb09a
movl %esi, %ecx
xorl %edx, %edx
movabsq $0x1000000011, %rsi     # imm = 0x1000000011
xorl %eax, %eax
movzbl (%rdi,%rdx), %r8d
leal -0x43(%r8), %r10d
cmpl $0x24, %r10d
ja 0xb083
movl $0x1, %r9d
btq %r10, %rsi
jb 0xb08e
xorl %r9d, %r9d
cmpb $0x63, %r8b
sete %r9b
addl %r9d, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0xb068
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: validateAssemblyIsSameAsAlignment
int validateAssemblyIsSameAsAlignment(bam_header_t *header, assemblyT *theAssembly) {
    int i;
    //printf("Validating assembly and alignment files consisting of %d contigs\n", header->n_targets);
    if (header->n_targets != theAssembly->numContigs) {
        //printf("Different number of contigs in assembly (%d) and alignmentfile (%d)\n", theAssembly->numContigs, header->n_targets);
        return 0;
    }
    for (i = 0; i < header->n_targets; i++) {
        if (header->target_len[i] != theAssembly->contigs[i]->seqLen) {
        	//printf("Different contig length in contig %d: %d vs %d\n", i, header->target_len[i], theAssembly->contigs[i]->seqLen);
        	return 0;
        }
        if (strcmp(header->target_name[i], theAssembly->contigs[i]->name) != 0) {
        	//printf("Warning assembly and alignment files disagree on the name of contig %d: %s vs %s\n", i, header->target_name[i], theAssembly->contigs[i]->name);
        }
    }
    return 1;
}

// Assembly:
movl (%rdi), %ecx
xorl %eax, %eax
cmpl (%rsi), %ecx
jne 0xb617
movl $0x1, %eax
testl %ecx, %ecx
jle 0xb617
movq 0x10(%rdi), %rdx
movq 0xa0(%rsi), %rsi
xorl %edi, %edi
movl (%rdx,%rdi,4), %r8d
movq (%rsi,%rdi,8), %r9
cmpl 0x8(%r9), %r8d
jne 0xb618
incq %rdi
cmpq %rdi, %rcx
jne 0xb601
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: getContigAvgDepth
double getContigAvgDepth(contig_t *contig) {
	double depth = 0.0;
	int j;
	for(j=0; j < contig->seqLen; j++)
		depth += contig->depth[j];
	return depth / contig->seqLen;
}

// Assembly:
movslq 0x8(%rdi), %rax
testq %rax, %rax
jle 0xba3f
movq 0x30(%rdi), %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
xorps %xmm1, %xmm1
cvtss2sd (%rcx,%rdx,4), %xmm1
addsd %xmm1, %xmm0
incq %rdx
cmpq %rdx, %rax
jne 0xba29
jmp 0xba43
xorpd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: getFragmentMapLenBAM
int getFragmentMapLenBAM(bam1_t *read1) {
    assert(read1 != NULL);

    int left = read1->core.pos < read1->core.mpos ? read1->core.pos : read1->core.mpos;
    int readLength = getSeqMapLenBAM(read1);
    int right1 = read1->core.pos + readLength;
    int right2 = read1->core.mpos + readLength;
    int right = right1 > right2 ? right1 : right2;
    assert(right >= left);
    return right - left;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xbabc
movq %rdi, %rbx
movl 0x4(%rdi), %eax
movl 0x18(%rdi), %ebp
cmpl %ebp, %eax
cmovll %eax, %ebp
movzbl 0xb(%rdi), %esi
addq 0x30(%rdi), %rsi
callq 0xf3c6
movl 0x4(%rbx), %ecx
addl %eax, %ecx
addl 0x18(%rbx), %eax
cmpl %eax, %ecx
cmovgl %ecx, %eax
subl %ebp, %eax
jl 0xbadb
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x16234(%rip), %rdi     # 0x21cf7
leaq 0x1817c(%rip), %rsi     # 0x23c46
leaq 0x1829d(%rip), %rcx     # 0x23d6e
movl $0x240, %edx            # imm = 0x240
callq 0x3230
leaq 0x182af(%rip), %rdi     # 0x23d91
leaq 0x1815d(%rip), %rsi     # 0x23c46
leaq 0x1827e(%rip), %rcx     # 0x23d6e
movl $0x247, %edx            # imm = 0x247
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: readNextBAM
enum MATE_ORIENTATION readNextBAM(samfile_t *ins, bam1_t *read1) {
    assert(ins != NULL);
    assert(read1 != NULL);

    while (1) {
      int bytesRead = samread(ins, read1);
      if (bytesRead <= 0) {
        return NO_READS;
      } else if ( ( read1->core.flag & ( BAM_FSECONDARY | BAM_FQCFAIL | BAM_FDUP | BAM_FSUPPLEMENTARY)) == 0) { // only consider the read if it is primary, passedqc and not duplicated
        enum MATE_ORIENTATION o = getPairedMateOrientation(read1);
        //printf("readNextBam: %s %d %d %s\n", bam1_qname(read1), read1->core.flag, o, MATE_ORIENTATION_LABELS[o]);
        return o;
      }
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0xbca2
movq %rsi, %rbx
testq %rsi, %rsi
je 0xbcc1
movq %rdi, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x14317
testl %eax, %eax
jle 0xbc90
movb $0x1, %al
testb $0xf, 0xd(%rbx)
jne 0xbc97
movq %rbx, %rdi
callq 0xbafa
movl %eax, %ebp
jmp 0xbc95
movl $0xd, %ebp
xorl %eax, %eax
testb %al, %al
jne 0xbc6d
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1815d(%rip), %rdi     # 0x23e06
leaq 0x17f96(%rip), %rsi     # 0x23c46
leaq 0x1815b(%rip), %rcx     # 0x23e12
movl $0x296, %edx            # imm = 0x296
callq 0x3230
leaq 0x1602f(%rip), %rdi     # 0x21cf7
leaq 0x17f77(%rip), %rsi     # 0x23c46
leaq 0x1813c(%rip), %rcx     # 0x23e12
movl $0x297, %edx            # imm = 0x297
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: assemblySanityCheck
int assemblySanityCheck(assemblyT *theAssembly){
    int i, j, num = theAssembly->numContigs;
    int error = 1;
    int countAmbiguous = 0;
    for(j=0; j < num ; j++){
        contig_t *contig = theAssembly->contigs[j];
        for(i = 0; i < contig->seqLen; i++){
            if(contig->seq[i] != 'A' && contig->seq[i] != 'T' && contig->seq[i] != 'C' && contig->seq[i] != 'G' && contig->seq[i] != 'N'){
                //printf("Found an ambiguous base in the assembly, contig %d, position %d = %c\n", j, i, contig->seq[i]);
                //contig->seq[i] = 'N';
                error = 0;
                countAmbiguous++;
                int c = contig->ambiguousBaseCount;
                contig->ambiguousBasePositions = (int32_t*) realloc(contig->ambiguousBasePositions, sizeof(*contig->ambiguousBasePositions) * kroundup32(c));
                contig->ambiguousBasePositions[ contig->ambiguousBaseCount++ ] = i;
            }
        }
    }
    if(error == 0){
      printf("Found %d ambiguous bases (excluding N) in the assembly.\n", countAmbiguous);
    }
    return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movslq (%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jle 0xc059
movl $0x1, %ebp
xorl %r12d, %r12d
movl $0x82045, %r13d         # imm = 0x82045
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
movq 0xa0(%rax), %rax
movq (%rax,%r12,8), %r15
cmpl $0x0, 0x8(%r15)
jle 0xc049
xorl %r14d, %r14d
movq 0x10(%r15), %rax
movzbl (%rax,%r14), %eax
addl $-0x41, %eax
cmpl $0x13, %eax
ja 0xbff4
btl %eax, %r13d
jae 0xbff4
incq %r14
movslq 0x8(%r15), %rax
cmpq %rax, %r14
jl 0xbfcf
jmp 0xc049
incl %ebx
movl 0x20(%r15), %eax
movq 0x28(%r15), %rdi
decl %eax
movl %eax, %ecx
sarl %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x8, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x10, %ecx
orl %eax, %ecx
movslq %ecx, %rax
leaq 0x4(,%rax,4), %rsi
callq 0x3480
movq %rax, 0x28(%r15)
movslq 0x20(%r15), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x20(%r15)
movl %r14d, (%rax,%rcx,4)
xorl %ebp, %ebp
jmp 0xbfe6
incq %r12
cmpq 0x8(%rsp), %r12
jne 0xbfb5
jmp 0xc060
xorl %ebx, %ebx
movl $0x1, %ebp
testl %ebp, %ebp
jne 0xc074
leaq 0x17fa1(%rip), %rdi     # 0x2400c
movl %ebx, %esi
xorl %eax, %eax
callq 0x3210
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: loadAssembly
assemblyT *loadAssembly(char *filename) {

    // attempt to open the input file
    gzFile assemblyFile = gzopen(filename, "r");
    kseq_t *Aseq;
    if(assemblyFile == NULL){
        printf("Error! Could not open assembly file: %s\n", filename);
        exit(1);
    }

    assemblyT *theAssembly = malloc(sizeof(assemblyT));
    if (theAssembly == NULL)
        exit(1);

    Aseq = kseq_init(assemblyFile);

    readAssembly(Aseq, theAssembly);

    kseq_destroy(Aseq);

    //printf("Done reading in assembly.\n");

    //printAssembly(theAssembly);
    assemblySanityCheck(theAssembly);
    gzclose(assemblyFile);

    return theAssembly;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x19850(%rip), %rsi     # 0x258e7
callq 0x34f0
testq %rax, %rax
je 0xc16d
movq %rax, %rbx
movl $0xa8, %edi
callq 0x3420
testq %rax, %rax
je 0xc17e
movq %rax, %r14
movl $0x1, %edi
movl $0x70, %esi
callq 0x3310
movq %rax, %r15
movl $0x1, %edi
movl $0x20, %esi
callq 0x3310
movq %rax, %r12
movq %rbx, 0x18(%rax)
movl $0x4000, %edi           # imm = 0x4000
callq 0x3420
movq %rax, (%r12)
movq %r12, 0x68(%r15)
movq %r15, %rdi
movq %r14, %rsi
callq 0xb3ec
testq %r15, %r15
je 0xc14e
movq 0x10(%r15), %rdi
callq 0x3070
movq 0x28(%r15), %rdi
callq 0x3070
movq 0x40(%r15), %rdi
callq 0x3070
movq 0x58(%r15), %rdi
callq 0x3070
movq 0x68(%r15), %r12
testq %r12, %r12
je 0xc146
movq (%r12), %rdi
callq 0x3070
movq %r12, %rdi
callq 0x3070
movq %r15, %rdi
callq 0x3070
movq %r14, %rdi
callq 0xbf81
movq %rbx, %rdi
callq 0x3060
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x17ed1(%rip), %rdi     # 0x24045
movq %r14, %rsi
xorl %eax, %eax
callq 0x3210
movl $0x1, %edi
callq 0x35c0
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: freeContig
void freeContig(contig_t *contig) {
    if (contig == NULL)
        return;
    free(contig->name);
    free(contig->seq);
    free(contig->depth);
    free(contig->seqNum);
    free(contig->ambiguousBasePositions);
    free(contig->matchLogLikelihood);
    free(contig->insertLogLikelihood);
    free(contig->kmerLogLikelihood);
    free(contig->depthLogLikelihood);
    free(contig);
}

// Assembly:
testq %rdi, %rdi
je 0xc1ea
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x3070
movq 0x10(%rbx), %rdi
callq 0x3070
movq 0x30(%rbx), %rdi
callq 0x3070
movq 0x18(%rbx), %rdi
callq 0x3070
movq 0x28(%rbx), %rdi
callq 0x3070
movq 0x38(%rbx), %rdi
callq 0x3070
movq 0x40(%rbx), %rdi
callq 0x3070
movq 0x50(%rbx), %rdi
callq 0x3070
movq 0x48(%rbx), %rdi
callq 0x3070
movq %rbx, %rdi
popq %rbx
jmp 0x3070
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: freeAssembly
void freeAssembly(assemblyT *theAssembly) {
    if (theAssembly != NULL) {
        if (theAssembly->contigs != NULL) {
        	int i;
        	for (i = 0; i < theAssembly->numContigs; i++)
        		freeContig(theAssembly->contigs[i]);
        	free(theAssembly->contigs);
        }
        free(theAssembly);
    }
}

// Assembly:
testq %rdi, %rdi
je 0xc23f
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0xa0(%rdi)
je 0xc230
cmpl $0x0, (%rbx)
jle 0xc224
xorl %r14d, %r14d
movq 0xa0(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0xc188
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0xc209
movq 0xa0(%rbx), %rdi
callq 0x3070
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3070
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALEhelpers.c
// Function: openSamOrBam
samfile_t *openSamOrBam(const char *fileName) {
    samfile_t *in = samopen(fileName, "rb", 0);
    if (in == NULL || in->header == NULL) {
        printf("Checking if %s is a SAM formatted file, instead of BAM\n", fileName);
        in = samopen(fileName, "r", 0);
        if (in == NULL || in->header == NULL) {
            printf("Error! Failed to open BAM/SAM file %s\n", fileName);
            exit(1);
        }
    }
    return in;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x17e23(%rip), %rsi     # 0x2406e
xorl %edx, %edx
callq 0x13e7b
testq %rax, %rax
je 0xc25e
cmpq $0x0, 0x10(%rax)
jne 0xc28c
leaq 0x17e0c(%rip), %rdi     # 0x24071
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3210
leaq 0x19671(%rip), %rsi     # 0x258e7
movq %rbx, %rdi
xorl %edx, %edx
callq 0x13e7b
testq %rax, %rax
je 0xc28e
cmpq $0x0, 0x10(%rax)
je 0xc28e
popq %rbx
retq
leaq 0x17e14(%rip), %rdi     # 0x240a9
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3210
movl $0x1, %edi
callq 0x35c0
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ssw.c
// Function: ssw_init
s_profile* ssw_init (const int8_t* read, const int32_t readLen, const int8_t* mat, const int32_t n, const int8_t score_size) {
	s_profile* p = (s_profile*)calloc(1, sizeof(struct _profile));
	p->profile_byte = 0;
	p->profile_word = 0;
	p->bias = 0;

	if (score_size == 0 || score_size == 2) {
		/* Find the bias to use in the substitution matrix */
		int32_t bias = 0, i;
		for (i = 0; i < n*n; i++) if (mat[i] < bias) bias = mat[i];
		bias = abs(bias);

		p->bias = bias;
		p->profile_byte = qP_byte (read, mat, readLen, n, bias);
	}
	if (score_size == 1 || score_size == 2) p->profile_word = qP_word (read, mat, readLen, n);
	p->read = read;
	p->mat = mat;
	p->readLen = readLen;
	p->n = n;
	return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r13d
movl %ecx, %ebx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
movl $0x1, %edi
movl $0x30, %esi
callq 0x3310
movq %rax, %r12
movb $0x0, 0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
testb $-0x3, %r13b
je 0xd13d
decb %r13b
cmpb $0x1, %r13b
jbe 0xd189
movq %r15, 0x10(%r12)
movq %r14, 0x18(%r12)
movl %ebp, 0x20(%r12)
movl %ebx, 0x24(%r12)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
testl %ebx, %ebx
je 0xd164
movl %ebx, %ecx
imull %ecx, %ecx
cmpl $0x1, %ecx
adcl $0x0, %ecx
xorl %edx, %edx
xorl %eax, %eax
movsbl (%r14,%rdx), %esi
cmpl %esi, %eax
cmovgel %esi, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0xd152
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
movb %cl, 0x28(%r12)
movzbl %cl, %r8d
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x393f
movq %rax, (%r12)
jmp 0xd10e
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x39f2
movq %rax, 0x8(%r12)
jmp 0xd117
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ssw.c
// Function: add_cigar
uint32_t* add_cigar (uint32_t* new_cigar, int32_t* p, int32_t* s, uint32_t length, char op) {
	if ((*p) >= (*s)) {
		++(*s);
		kroundup32(*s);
		new_cigar = (uint32_t*)realloc(new_cigar, (*s)*sizeof(uint32_t));
	}
	new_cigar[(*p) ++] = to_cigar_int(length, op);
	return new_cigar;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %r8d, %r14d
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %rax
movl (%rdx), %ecx
cmpl %ecx, (%rsi)
jl 0xde48
movl %ecx, %esi
sarl %esi
orl %ecx, %esi
movl %esi, %ecx
sarl $0x2, %ecx
orl %esi, %ecx
movl %ecx, %esi
sarl $0x4, %esi
orl %ecx, %esi
movl %esi, %ecx
sarl $0x8, %ecx
orl %esi, %ecx
movl %ecx, %esi
sarl $0x10, %esi
orl %ecx, %esi
leal 0x1(%rsi), %ecx
movl %ecx, (%rdx)
movslq %esi, %rcx
leaq 0x4(,%rcx,4), %rsi
movq %rax, %rdi
callq 0x3480
shll $0x4, %ebp
movsbq %r14b, %rcx
leaq 0x1650a(%rip), %rdx     # 0x24360
movzbl (%rcx,%rdx), %ecx
orl %ebp, %ecx
movslq (%rbx), %rdx
leal 0x1(%rdx), %esi
movl %esi, (%rbx)
movl %ecx, (%rax,%rdx,4)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ssw.c
// Function: store_previous_m
uint32_t* store_previous_m (int8_t choice,	// 0: current not M, 1: current match, 2: current mismatch
					   uint32_t* length_m,
					   uint32_t* length_x,
					   int32_t* p,
					   int32_t* s,
					   uint32_t* new_cigar) {

	if ((*length_m) && (choice == 2 || !choice)) {
		new_cigar = add_cigar (new_cigar, p, s, (*length_m), '='); 
		(*length_m) = 0;
	} else if ((*length_x) && (choice == 1 || !choice)) { 
		new_cigar = add_cigar (new_cigar, p, s, (*length_x), 'X'); 
		(*length_x) = 0;
	}
	return new_cigar;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %r9, %rax
movq %rdx, %rbx
movq %rsi, %r14
movl (%rsi), %r9d
testl %r9d, %r9d
sete %dl
testb $-0x3, %dil
setne %sil
orb %dl, %sil
jne 0xdea8
movq %rax, %rdi
movq %rcx, %rsi
movq %r8, %rdx
movl %r9d, %ecx
movl $0x3d, %r8d
callq 0xddf9
jmp 0xded8
movl (%rbx), %r9d
testl %r9d, %r9d
sete %dl
cmpb $0x2, %dil
setae %sil
orb %dl, %sil
jne 0xdedf
movq %rax, %rdi
movq %rcx, %rsi
movq %r8, %rdx
movl %r9d, %ecx
movl $0x58, %r8d
callq 0xddf9
movq %rbx, %r14
movl $0x0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/ryuichiueda[P]glueutils/src_con12/con12safe.cpp
// Function: usage()
void usage(void){
	fputs("con12: output stderr to stdout with buffering\n", stderr);
	fputs("usage: con12 <command> [args]\n", stderr);
	fputs("\nCopyright (C) 2021 Ryuichi Ueda\n", stderr);
	fputs("Released under the MIT License.\n", stderr);
	fputs("https://github.com/ryuichiueda/glueutils\n", stderr);
}

// Assembly:
pushq %rbx
movq 0x2e48(%rip), %rbx      # 0x3fe0
movq (%rbx), %rsi
leaq 0xe62(%rip), %rdi       # 0x2004
callq 0x10e0
movq (%rbx), %rsi
leaq 0xe82(%rip), %rdi       # 0x2033
callq 0x10e0
movq (%rbx), %rsi
leaq 0xe92(%rip), %rdi       # 0x2052
callq 0x10e0
movq (%rbx), %rsi
leaq 0xea5(%rip), %rdi       # 0x2074
callq 0x10e0
movq (%rbx), %rsi
leaq 0xeb7(%rip), %rdi       # 0x2095
popq %rbx
jmp 0x10e0
// File: /workspace/github_c_makefile_star2_O1/ryuichiueda[P]glueutils/src_con12/con12safe.cpp
// Function: thread_read(void*)
void *thread_read(void *arg)
{
	int *fd = (int *)arg;
	char buf[1024];
	string line;
	int ret = 1;
	while (ret > 0){
		ret = read(*fd, &buf, 1024);
		for(int i=0;i<ret;i++){
			line += buf[i];
			if(buf[i] == '\n'){
				mtx.lock();
				fputs(line.c_str(), stdout);
				fflush(stdout);
				mtx.unlock();
				line.clear();
			}
		}
	}
	mtx.lock();
	fputs(line.c_str(), stdout);
	fflush(stdout);
	mtx.unlock();

	if(ret == -1){
		fputs("Error: reading error\n", stderr);
		exit(1);
	}
	try_close(*fd);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movq %rdi, 0x20(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rsp, %r12
leaq 0x2cdc(%rip), %r13      # 0x40e0
movq 0x2bbd(%rip), %rbp      # 0x3fc8
movq 0x20(%rsp), %rax
movl (%rax), %edi
movl $0x400, %edx            # imm = 0x400
leaq 0x30(%rsp), %rsi
callq 0x1130
movq %rax, 0x28(%rsp)
testl %eax, %eax
jle 0x1495
movq 0x28(%rsp), %r14
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %ebx, %ebx
movb 0x30(%rsp,%rbx), %r15b
movsbl %r15b, %esi
movq %r12, %rdi
callq 0x10b0
cmpb $0xa, %r15b
jne 0x148d
movq %r13, %rdi
callq 0x1140
testl %eax, %eax
jne 0x1514
movq (%rsp), %rdi
movq (%rbp), %rsi
callq 0x10e0
movq (%rbp), %rdi
callq 0x10f0
movq %r13, %rdi
callq 0x1080
movq $0x0, 0x8(%rsp)
movq (%rsp), %rax
movb $0x0, (%rax)
incq %rbx
cmpq %rbx, %r14
jne 0x1438
movq 0x28(%rsp), %rbx
testl %ebx, %ebx
jg 0x140b
leaq 0x2c37(%rip), %rdi      # 0x40e0
callq 0x1140
testl %eax, %eax
jne 0x151b
movq (%rsp), %rdi
movq (%rbp), %rsi
callq 0x10e0
movq (%rbp), %rdi
callq 0x10f0
leaq 0x2c11(%rip), %rdi      # 0x40e0
callq 0x1080
cmpl $-0x1, %ebx
je 0x1527
movq 0x20(%rsp), %rax
movl (%rax), %edi
leaq 0x10(%rsp), %r14
callq 0x139c
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1500
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x10d0
xorl %eax, %eax
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x1070
movl %eax, %edi
leaq 0x10(%rsp), %r14
callq 0x1070
callq 0x11e4
movq %rax, %rbx
jmp 0x153d
jmp 0x1535
jmp 0x1535
movq %rax, %rbx
leaq 0x10(%rsp), %r14
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x1553
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x10d0
movq %rbx, %rdi
callq 0x1150
// File: /workspace/github_c_makefile_star2_O1/ryuichiueda[P]glueutils/src_con12/con12safe.cpp
// Function: main
int main(int argc, char * argv[])
{
	if(argc < 2){
		usage();
		exit(1);
	}

	int pips[2];
	if(pipe(pips) < 0){
		fputs("Error: pipe open error", stderr);
		exit(1);
	}

	int epips[2];
	if(pipe(epips) < 0){
		fputs("Error: pipe open error", stderr);
		exit(1);
	}

	int opips[2];
	if(pipe(opips) < 0){
		fputs("Error: pipe open error", stderr);
		exit(1);
	}

	int pid = fork();
	if(pid != 0){//parent proc
		try_close(0);
		try_close(pips[1]);
		if(dup2(pips[0], 0) == -1){
			fprintf(stderr, "Error: %s\n", strerror(errno));
			exit(1);
		}
		try_close(pips[0]);

	}else{//child proc
		close(2);
		dup2(epips[1], 2);
		close(epips[1]);
		try_close(pips[1]);

		close(1);
		dup2(opips[1], 1);
	//	close(opips[1]);
		try_close(opips[1]);

		return -execvp(argv[1], &argv[1]);
	}

	pthread_t pthread;
	pthread_create(&pthread, NULL, thread_read, &epips[0]);

	pthread_t pthread2;
	pthread_create(&pthread2, NULL, thread_read, &opips[0]);

	/*
	pthread_join(pthread2,NULL);
	*/

	int wstatus;
	int wpid;
	int lasterror = 0;
	if((wpid = waitpid(pid, &wstatus, 0)) > 0){
		if(WIFEXITED(wstatus) && WEXITSTATUS(wstatus)){
			lasterror = WEXITSTATUS(wstatus);
		}
	}


	exit(lasterror);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
cmpl $0x1, %edi
jle 0x1610
movq %rsi, %rbx
leaq 0x4(%rsp), %rdi
callq 0x1110
testl %eax, %eax
js 0x1615
leaq 0x18(%rsp), %rdi
callq 0x1110
testl %eax, %eax
js 0x161a
leaq 0x10(%rsp), %rdi
callq 0x1110
testl %eax, %eax
js 0x161f
callq 0x1050
testl %eax, %eax
jne 0x1624
movl $0x2, %edi
callq 0x1170
movl 0x1c(%rsp), %edi
movl $0x2, %esi
callq 0x10c0
movl 0x1c(%rsp), %edi
callq 0x1170
movl 0x8(%rsp), %edi
callq 0x139c
movl $0x1, %edi
callq 0x1170
movl 0x14(%rsp), %edi
movl $0x1, %esi
callq 0x10c0
movl 0x14(%rsp), %edi
callq 0x139c
movq 0x8(%rbx), %rdi
addq $0x8, %rbx
movq %rbx, %rsi
callq 0x1090
negl %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x1293
callq 0x1274
callq 0x1255
callq 0x1236
movl %eax, %ebp
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x139c
movl 0x8(%rsp), %edi
callq 0x139c
movl 0x4(%rsp), %edi
xorl %esi, %esi
callq 0x10c0
cmpl $-0x1, %eax
jne 0x164d
callq 0x1203
movl 0x4(%rsp), %edi
callq 0x139c
leaq -0x28d(%rip), %r14      # 0x13d0
leaq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rcx
xorl %esi, %esi
movq %r14, %rdx
callq 0x1160
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rcx
xorl %esi, %esi
movq %r14, %rdx
callq 0x1160
leaq 0xc(%rsp), %rsi
movl %ebp, %edi
xorl %edx, %edx
callq 0x10a0
testl %eax, %eax
jle 0x16a2
movl 0xc(%rsp), %eax
testb $0x7f, %al
jne 0x16a2
movzbl %ah, %ebx
movl %ebx, %edi
callq 0x1100
// File: /workspace/github_c_makefile_star2_O1/ramirezsebas[P]TP-LISTINGS/./src/capitulo_5/5.10/socket-server.c
// Function: server
int server(int client_socket)
{
    while (1)
    {
        int length;
        char *text;
        /* First, read the length of the text message from the socket. If read returns zero, the client closed the connection. */
        if (read(client_socket, &length, sizeof(length)) == 0)
            return 0;
        /* Allocate a buffer to hold the text. */
        text = (char *)malloc(length);
        /* Read the text itself, and print it. */

        read(client_socket, text, length);
        printf("%s\n", text);

        /* If the client sent the message "quit," we’re all done. */
        if (!strcmp(text, "quit"))
        {
            free(text);
            return 1;
        }
        /* Free the buffer. */
        free(text);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq -0x2c(%rbp), %r14
movl $0x4, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x1090
testq %rax, %rax
je 0x1273
movslq -0x2c(%rbp), %r13
movq %r13, %rdi
callq 0x10b0
movq %rax, %r15
movl %ebx, %edi
movq %rax, %rsi
movq %r13, %rdx
callq 0x1090
movq %r15, %rdi
callq 0x1060
movq %r15, %rdi
leaq 0xdb2(%rip), %rsi       # 0x2004
callq 0x10a0
movl %eax, %r13d
movq %r15, %rdi
callq 0x1030
testl %r13d, %r13d
setne %al
movl $0x1, %ecx
cmovel %ecx, %r12d
jmp 0x1278
xorl %r12d, %r12d
xorl %eax, %eax
testb %al, %al
jne 0x1210
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ramirezsebas[P]TP-LISTINGS/./src/capitulo_5/5.10/socket-server.c
// Function: main
int main(int argc, char *const argv[])
{
    const char *const socket_name = argv[1];
    int socket_fd;
    struct sockaddr_un name;
    int client_sent_quit_message;

    /* Create the socket. */
    socket_fd = socket(PF_LOCAL, SOCK_STREAM, 0);

    /*Indicate that this is a server.*/
    name.sun_family = AF_LOCAL;
    strcpy(name.sun_path, socket_name);
    bind(socket_fd, (struct sockaddr *)&name, SUN_LEN(&name));
    /* Listen for connections. */
    listen(socket_fd, 5);

    /*Repeatedly accept connections, spinning off one server() to deal
  with each client. Continue until a client sends a "quit" message.*/

    do
    {
        struct sockaddr_un client_name;
        socklen_t client_name_len;
        int client_socket_fd;

        /*Accept a connection.*/
        client_socket_fd = accept(socket_fd, (struct sockaddr *restrict)&client_name, &client_name_len);
        /* Handle the connection. */
        client_sent_quit_message = server(client_socket_fd);
        /* Close our end of the connection. */
        close(client_socket_fd);
    } while (!client_sent_quit_message);
    /* Remove the socket file. */
    close(socket_fd);
    unlink(socket_name);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq 0x8(%rsi), %rbx
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x10f0
movl %eax, %r14d
leaq -0xa0(%rbp), %r15
movw $0x1, -0x2(%r15)
movq %r15, %rdi
movq %rbx, -0x30(%rbp)
movq %rbx, %rsi
callq 0x1050
movq %r15, %rdi
callq 0x1070
leal 0x2(%rax), %edx
leaq -0xa2(%rbp), %rsi
movl %r14d, %edi
callq 0x10d0
movl %r14d, %edi
movl $0x5, %esi
callq 0x10c0
leaq -0x110(%rbp), %r15
leaq -0x34(%rbp), %r12
movl %r14d, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x10e0
movl %eax, %r13d
movl %eax, %edi
callq 0x11fc
movl %eax, %ebx
movl %r13d, %edi
callq 0x1080
testl %ebx, %ebx
je 0x1309
movl %r14d, %edi
callq 0x1080
movq -0x30(%rbp), %rdi
callq 0x1040
xorl %eax, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jarun[P]nnn/src/nnn.c
// Function: xitoa
static char *xitoa(uint_t val)
{
	static char dst[32] = {'\0'};
	static const char digits[201] =
		"0001020304050607080910111213141516171819"
		"2021222324252627282930313233343536373839"
		"4041424344454647484950515253545556575859"
		"6061626364656667686970717273747576777879"
		"8081828384858687888990919293949596979899";
	uint_t next = 30, quo, i;

	while (val >= 100) {
		quo = val / 100;
		i = (val - (quo * 100)) * 2;
		val = quo;
		dst[next] = digits[i + 1];
		dst[--next] = digits[i];
		--next;
	}

	/* Handle last 1-2 digits */
	if (val < 10)
		dst[next] = '0' + val;
	else {
		i = val * 2;
		dst[next] = digits[i + 1];
		dst[--next] = digits[i];
	}

	return &dst[next];
}

// Assembly:
movl $0x1e, %eax
leaq 0x1067c(%rip), %rdx     # 0x16630
leaq 0x15ac5(%rip), %rcx     # 0x1ba80
cmpl $0x64, %edi
jb 0x6006
movl $0x1e, %eax
movl %edi, %esi
imulq $0x51eb851f, %rsi, %rsi # imm = 0x51EB851F
shrq $0x25, %rsi
imull $0x7fffff9c, %esi, %r8d # imm = 0x7FFFFF9C
addl %edi, %r8d
addl %r8d, %r8d
movb (%r8,%rdx), %r9b
movb 0x1(%r8,%rdx), %r8b
movl %eax, %r10d
movb %r8b, (%r10,%rcx)
leal -0x1(%rax), %r8d
movb %r9b, (%r8,%rcx)
addl $-0x2, %eax
cmpl $0x270f, %edi           # imm = 0x270F
movl %esi, %edi
ja 0x5fc5
jmp 0x6008
movl %edi, %esi
cmpl $0x9, %esi
ja 0x6013
orb $0x30, %sil
jmp 0x602d
movl %esi, %esi
leaq (%rsi,%rsi), %rdi
movl %edi, %edi
movb 0x1(%rdi,%rdx), %dil
movl %eax, %r8d
movb %dil, (%r8,%rcx)
movb (%rdx,%rsi,2), %sil
decl %eax
movl %eax, %edx
leaq (%rcx,%rdx), %rax
movb %sil, (%rdx,%rcx)
retq
// File: /workspace/github_c_makefile_star2_O1/jarun[P]nnn/src/nnn.c
// Function: cleanup
static void cleanup(void)
{
#ifndef NOX11
	if (cfg.x11 && !g_state.picker) {
		printf("\033[23;0t"); /* reset terminal window title */
		fflush(stdout);
	}
#endif
	free(selpath);
	free(plgpath);
	free(cfgpath);
	free(initpath);
	free(bmstr);
	free(pluginstr);
	free(listroot);
	free(ihashbmp);
	free(bookmark);
	free(plug);
	if (lastcmdpos != INVALID_POS)
		for (uchar_t pos = 0; pos <= lastcmdpos; ++pos)
			free(cmd_hist[pos]);
#ifndef NOFIFO
	if (g_state.autofifo)
		unlink(fifopath);
#endif
	if (g_state.pluginit)
		unlink(g_pipepath);
#ifdef DEBUG
	disabledbg();
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testb $0x4, 0x1423a(%rip)     # 0x1a4cb
je 0x62b9
testb $0x10, 0x1428b(%rip)    # 0x1a525
jne 0x62b9
leaq 0xfb29(%rip), %rdi      # 0x15dcc
xorl %eax, %eax
callq 0x4320
movq 0x13cbf(%rip), %rax     # 0x19f70
movq (%rax), %rdi
callq 0x45d0
movq 0x14268(%rip), %rdi     # 0x1a528
callq 0x4090
movq 0x157d4(%rip), %rdi     # 0x1baa0
callq 0x4090
movq 0x15690(%rip), %rdi     # 0x1b968
callq 0x4090
movq 0x14354(%rip), %rdi     # 0x1a638
callq 0x4090
movq 0x14370(%rip), %rdi     # 0x1a660
callq 0x4090
movq 0x1437c(%rip), %rdi     # 0x1a678
callq 0x4090
movq 0x157a0(%rip), %rdi     # 0x1baa8
callq 0x4090
movq 0x1579c(%rip), %rdi     # 0x1bab0
callq 0x4090
movq 0x14338(%rip), %rdi     # 0x1a658
callq 0x4090
movq 0x14344(%rip), %rdi     # 0x1a670
callq 0x4090
movb 0x141a1(%rip), %bl      # 0x1a4d8
cmpb $-0x1, %bl
je 0x635b
xorl %r14d, %r14d
leaq 0x1577a(%rip), %r15     # 0x1bac0
movzbl %r14b, %r14d
movq (%r15,%r14,8), %rdi
callq 0x4090
incb %r14b
cmpb %bl, %r14b
jbe 0x6346
testb $0x1, 0x141c2(%rip)     # 0x1a524
je 0x6370
movq 0x155e5(%rip), %rdi     # 0x1b950
callq 0x40d0
testb $0x20, 0x141ae(%rip)    # 0x1a525
jne 0x637f
popq %rbx
popq %r14
popq %r15
retq
leaq 0x157ba(%rip), %rdi     # 0x1bb40
popq %rbx
popq %r14
popq %r15
jmp 0x40d0
// File: /workspace/github_c_makefile_star2_O1/jarun[P]nnn/src/nnn.c
// Function: parsekvpair
static bool parsekvpair(kv **arr, char **envcpy, const uchar_t id, uchar_t *items)
{
	bool new = TRUE;
	const uchar_t INCR = 8;
	uint_t i = 0;
	kv *kvarr = NULL;
	char *ptr = getenv(env_cfg[id]);

	if (!ptr || !*ptr)
		return TRUE;

	*envcpy = xstrdup(ptr);
	if (!*envcpy) {
		xerror();
		return FALSE;
	}

	ptr = *envcpy;

	while (*ptr && i < 100) {
		if (new) {
			if (!(i & (INCR - 1))) {
				kvarr = xrealloc(kvarr, sizeof(kv) * (i + INCR));
				*arr = kvarr;
				if (!kvarr) {
					xerror();
					return FALSE;
				}
				memset(kvarr + i, 0, sizeof(kv) * INCR);
			}
			kvarr[i].key = (uchar_t)*ptr;
			if (*++ptr != ':' || *++ptr == '\0' || *ptr == ';')
				return FALSE;
			kvarr[i].off = ptr - *envcpy;
			++i;

			new = FALSE;
		}

		if (*ptr == ';') {
			*ptr = '\0';
			new = TRUE;
		}

		++ptr;
	}

	*items = i;
	return (i != 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rsi, %r15
movq %rdi, 0x8(%rsp)
movl %edx, %eax
leaq 0x1301b(%rip), %rcx     # 0x19aa0
movq (%rcx,%rax,8), %rdi
callq 0x4050
movq %rax, %rdi
movb $0x1, %al
testq %rdi, %rdi
je 0x6b97
movq %rbx, 0x10(%rsp)
cmpb $0x0, (%rdi)
je 0x6b97
callq 0x6c4e
movq %rax, (%r15)
testq %rax, %rax
je 0x6b90
movq %rax, %r12
cmpb $0x0, (%rax)
je 0x6b80
movb $0x1, %al
xorl %r13d, %r13d
xorl %ebx, %ebx
testb $0x1, %al
je 0x6b5c
movl %ebx, %r14d
testb $0x7, %bl
je 0x6ae3
movq %r13, %rbp
jmp 0x6b21
leal 0x40(,%rbx,8), %esi
movq %r13, %rdi
callq 0x4640
movq %rax, %rbp
testq %rax, %rax
je 0x6ba6
movq 0x8(%rsp), %rax
movq %rbp, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbp,%r14,8)
movups %xmm0, 0x20(%rbp,%r14,8)
movups %xmm0, 0x10(%rbp,%r14,8)
movups %xmm0, (%rbp,%r14,8)
movzbl (%r12), %eax
movl %eax, (%rbp,%r14,8)
cmpb $0x3a, 0x1(%r12)
jne 0x6b95
movzbl 0x2(%r12), %ecx
xorl %eax, %eax
testl %ecx, %ecx
je 0x6b97
cmpl $0x3b, %ecx
je 0x6b97
addq $0x2, %r12
movl (%r15), %eax
movl %r12d, %ecx
subl %eax, %ecx
movl %ecx, 0x4(%rbp,%r14,8)
incl %ebx
xorl %eax, %eax
movq %rbp, %r13
cmpb $0x3b, (%r12)
jne 0x6b6a
movb $0x0, (%r12)
movb $0x1, %al
cmpb $0x0, 0x1(%r12)
je 0x6b82
incq %r12
cmpl $0x64, %ebx
jb 0x6ace
jmp 0x6b82
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
movb %bl, (%rax)
testl %ebx, %ebx
setne %al
jmp 0x6b97
callq 0x4b6e
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x4090
movq 0x8(%rsp), %rax
movq %rbp, (%rax)
movl $0xfb9, %edi            # imm = 0xFB9
callq 0x5fa8
movq %rax, %rdi
callq 0x4740
jmp 0x6b95
// File: /workspace/github_c_makefile_star2_O1/jarun[P]nnn/src/nnn.c
// Function: get_kv_val
static char *get_kv_val(kv *kvarr, char *buf, int key, uchar_t max, uchar_t id)
{
	char *val;

	if (!kvarr)
		return NULL;

	for (int r = 0; r < max && kvarr[r].key; ++r) {
		if (kvarr[r].key == key) {
			/* Do not allocate new memory for plugin */
			if (id == NNN_PLUG)
				return pluginstr + kvarr[r].off;

			val = bmstr + kvarr[r].off;
			bool tilde = convert_tilde(val, g_buf);
			return abspath((tilde ? g_buf : val), NULL, buf);
		}
	}

	DPRINTF_S("Invalid key");
	return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rdi, %rdi
sete %al
testl %ecx, %ecx
sete %sil
orb %al, %sil
je 0x6be7
xorl %r14d, %r14d
jmp 0x6c16
movzbl %cl, %eax
xorl %r14d, %r14d
xorl %ecx, %ecx
movl (%rdi,%rcx,8), %esi
testl %esi, %esi
je 0x6c16
cmpl %edx, %esi
je 0x6c04
incq %rcx
cmpq %rcx, %rax
jne 0x6bef
jmp 0x6c16
movslq 0x4(%rdi,%rcx,8), %r14
cmpb $0x2, %r8b
jne 0x6c21
addq 0x13a62(%rip), %r14     # 0x1a678
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq 0x13a38(%rip), %r14     # 0x1a660
movq %r14, %rdi
callq 0xeef0
leaq 0x13b19(%rip), %rdi     # 0x1a750
testb %al, %al
cmoveq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6038
// File: /workspace/github_c_makefile_star2_O1/jarun[P]nnn/src/nnn.c
// Function: xdirname
static char *xdirname(char *path)
{
	char *base = xmemrchr((uchar_t *)path, '/', xstrlen(path));

	if (base == path)
		path[1] = '\0';
	else
		*base = '\0';

	return path;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0x4490
subq %rbx, %rax
movq %rbx, %rdi
movl $0x2f, %esi
movq %rax, %rdx
callq 0x46f0
leaq 0x1(%rbx), %rcx
cmpq %rbx, %rax
cmovneq %rax, %rcx
movb $0x0, (%rcx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jarun[P]nnn/src/nnn.c
// Function: xdiraccess
static bool xdiraccess(const char *path)
{
	DIR *dirp = opendir(path);

	if (!dirp) {
		printwarn(NULL);
		return FALSE;
	}

	closedir(dirp);
	return TRUE;
}

// Assembly:
pushq %rbx
callq 0x4270
movq %rax, %rbx
testq %rax, %rax
je 0x6d08
movq %rbx, %rdi
callq 0x4400
jmp 0x6d1c
callq 0x40c0
movl (%rax), %edi
callq 0x4870
movq %rax, %rdi
callq 0xee6f
testq %rbx, %rbx
setne %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/jarun[P]nnn/src/nnn.c
// Function: mkpath
static size_t mkpath(const char *dir, const char *name, char *out)
{
	size_t len = 0;

	/* same rational for being strict as abspath() */
	if (tilde_is_home_strict(name)) { //NOLINT
		len = xstrsncpy(out, home, PATH_MAX);
		--len;
		++name;
	} else if (name[0] != '/') { // NOLINT
		/* Handle root case */
		len = istopdir(dir) ? 1 : xstrsncpy(out, dir, PATH_MAX);
		out[len - 1] = '/'; // NOLINT
	}
	return (xstrsncpy(out + len, name, PATH_MAX - len) + len);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movzbl (%rsi), %eax
cmpl $0x2f, %eax
je 0x6e35
movq %rdi, %rsi
cmpl $0x7e, %eax
jne 0x6e3a
cmpb $0x2f, 0x1(%r14)
jne 0x6e31
movq 0x1383f(%rip), %rsi     # 0x1a640
movl $0x1000, %ecx           # imm = 0x1000
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4860
testq %rax, %rax
jne 0x6e23
leaq 0x1000(%rbx), %rax
movb $0x0, 0xfff(%rbx)
movq %rbx, %r15
notq %r15
addq %rax, %r15
incq %r14
jmp 0x6e79
cmpb $0x2f, %al
jne 0x6e3a
xorl %r15d, %r15d
jmp 0x6e79
cmpb $0x0, 0x1(%rsi)
jne 0x6e4b
movl $0x1, %r15d
cmpb $0x2f, (%rsi)
je 0x6e73
movl $0x1000, %ecx           # imm = 0x1000
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4860
movq %rax, %r15
testq %rax, %rax
jne 0x6e70
leaq 0x1000(%rbx), %r15
movb $0x0, 0xfff(%rbx)
subq %rbx, %r15
movb $0x2f, -0x1(%rbx,%r15)
leaq (%rbx,%r15), %r12
movl $0x1000, %ecx           # imm = 0x1000
subq %r15, %rcx
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4860
testq %rax, %rax
jne 0x6eb1
cmpq $0x1000, %r15           # imm = 0x1000
je 0x6ea7
movb $0x0, 0xfff(%rbx)
addq $0x1000, %rbx           # imm = 0x1000
movq %rbx, %rax
subq %r12, %r15
addq %rax, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jarun[P]nnn/src/nnn.c
// Function: seltofile
static size_t seltofile(int fd, uint_t *pcount, const char *separator)
{
	uint_t lastpos, count = 0;
	char *pbuf = pselbuf;
	size_t pos = 0;
	ssize_t len, prefixlen = 0, initlen = 0;

	if (pcount)
		*pcount = 0;

	if (!selbufpos)
		return 0;

	lastpos = selbufpos - 1;

	if (listpath) {
		prefixlen = (ssize_t)xstrlen(listroot);
		initlen = (ssize_t)xstrlen(listpath);
	}

	while (pos <= lastpos) {
		DPRINTF_S(pbuf);
		len = (ssize_t)xstrlen(pbuf);

		if (!listpath || !is_prefix(pbuf, listpath, initlen)) {
			if (write(fd, pbuf, len) != len)
				return pos;
		} else {
			if (write(fd, listroot, prefixlen) != prefixlen)
				return pos;
			if (write(fd, pbuf + initlen, len - initlen) != (len - initlen))
				return pos;
		}

		pos += len;
		if (pos <= lastpos) {
			if (write(fd, separator, 1) != 1)
				return pos;
			pbuf += len + 1;
		}
		++pos;
		++count;
	}

	if (pcount)
		*pcount = count;

	return pos;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x30(%rsp)
movq 0xcee6(%rip), %r15      # 0x1ba78
testq %rsi, %rsi
je 0xeb9d
movl $0x0, (%rsi)
movl 0xcecd(%rip), %ebp      # 0x1ba70
testl %ebp, %ebp
je 0xebed
movl %edi, 0xc(%rsp)
movq %rsi, 0x20(%rsp)
decl %ebp
movq 0xcfc7(%rip), %r14      # 0x1bb80
xorl %ebx, %ebx
testq %r14, %r14
je 0xebf5
movq 0xcee1(%rip), %r12      # 0x1baa8
movq %r12, %rdi
xorl %esi, %esi
callq 0x4490
subq %r12, %rax
movq %rax, 0x18(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x4490
subq %r14, %rax
movq %rax, 0x10(%rsp)
jmp 0xec07
xorl %r12d, %r12d
jmp 0xecd8
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movl %ebp, %r13d
xorl %r12d, %r12d
movq %r13, 0x28(%rsp)
movl 0xc(%rsp), %ebp
movq %r15, %rdi
xorl %esi, %esi
callq 0x4490
movq %rax, %r14
subq %r15, %r14
movq 0xcf53(%rip), %rsi      # 0x1bb80
testq %rsi, %rsi
je 0xec43
movq %r15, %rdi
movq 0x10(%rsp), %rdx
callq 0x40f0
testl %eax, %eax
je 0xec59
movl 0xc(%rsp), %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4210
cmpq %r14, %rax
je 0xec97
jmp 0xecd8
movq 0xce48(%rip), %rsi      # 0x1baa8
movl %ebp, %edi
movq 0x18(%rsp), %r13
movq %r13, %rdx
callq 0x4210
cmpq %r13, %rax
jne 0xecd8
movq 0x10(%rsp), %rax
leaq (%r15,%rax), %rsi
movq %r14, %r13
subq %rax, %r13
movl %ebp, %edi
movq %r13, %rdx
callq 0x4210
cmpq %r13, %rax
movq 0x28(%rsp), %r13
jne 0xecd8
addq %r14, %r12
cmpq %r13, %r12
ja 0xecbe
movl $0x1, %edx
movl 0xc(%rsp), %edi
movq 0x30(%rsp), %rsi
callq 0x4210
cmpq $0x1, %rax
jne 0xecd8
addq %r14, %r15
incq %r15
incq %r12
incl %ebx
cmpq %r13, %r12
jbe 0xec16
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0xecd8
movl %ebx, (%rax)
movq %r12, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq