LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x179bb(%rip), %rsi     # 0x21917
callq 0x34f0
testq %rax, %rax
je 0xa029
movq %rax, %rbx
movl $0xa8, %edi
callq 0x3420
testq %rax, %rax
je 0xa03a
movq %rax, %r14
pushq $0x1
popq %r12
pushq $0x70
popq %rsi
movq %r12, %rdi
callq 0x3310
movq %rax, %r15
pushq $0x20
popq %rsi
movq %r12, %rdi
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 0x9403
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 0xa002
movq (%r12), %rdi
callq 0x3070
movq %r12, %rdi
callq 0x3070
movq %r15, %rdi
callq 0x3070
movq %r14, %rdi
callq 0x9e55
movq %rbx, %rdi
callq 0x3060
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x16075(%rip), %rdi     # 0x200a5
movq %r14, %rsi
xorl %eax, %eax
callq 0x3210
pushq $0x1
popq %rdi
callq 0x35c0
// File: /workspace/github_c_makefile_star2_O2/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 0xa0ef
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0xa0(%rdi)
je 0xa0e0
xorl %r14d, %r14d
movslq (%rbx), %rax
movq 0xa0(%rbx), %rdi
cmpq %rax, %r14
jge 0xa0db
movq (%rdi,%r14,8), %rdi
callq 0xa042
incq %r14
jmp 0xa0be
callq 0x3070
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3070
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x15fd3(%rip), %rsi     # 0x200ce
xorl %edx, %edx
callq 0x10e5d
testq %rax, %rax
je 0xa10e
cmpq $0x0, 0x10(%rax)
jne 0xa13c
leaq 0x15fbc(%rip), %rdi     # 0x200d1
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3210
leaq 0x177f1(%rip), %rsi     # 0x21917
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10e5d
testq %rax, %rax
je 0xa13e
cmpq $0x0, 0x10(%rax)
je 0xa13e
popq %rbx
retq
leaq 0x15fc4(%rip), %rdi     # 0x20109
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3210
pushq $0x1
popq %rdi
callq 0x35c0
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x3310
movq %rax, %r12
testb $-0x3, %r13b
jne 0xb040
movl %ebx, %eax
imull %eax, %eax
xorl %edx, %edx
xorl %ecx, %ecx
cmpq %rdx, %rax
je 0xb01d
movsbl (%r14,%rdx), %esi
cmpl %esi, %ecx
cmovgel %esi, %ecx
incq %rdx
jmp 0xb009
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
movb %al, 0x28(%r12)
movzbl %al, %r8d
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
callq 0xb083
movq %rax, (%r12)
decb %r13b
cmpb $0x1, %r13b
ja 0xb05d
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
callq 0xb142
movq %rax, 0x8(%r12)
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
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ssw.c
// Function: qP_byte
static __m128i* qP_byte (const int8_t* read_num,
				  const int8_t* mat,
				  const int32_t readLen,
				  const int32_t n,	/* the edge length of the squre matrix mat */
				  uint8_t bias) {

	int32_t segLen = (readLen + 15) / 16; /* Split the 128 bit register into 16 pieces.
								     Each piece is 8 bit. Split the read into 16 segments.
								     Calculat 16 segments in parallel.
								   */
	__m128i* vProfile = (__m128i*)malloc(n * segLen * sizeof(__m128i));
	int8_t* t = (int8_t*)vProfile;
	int32_t nt, i, j, segNum;

	/* Generate query profile rearrange query sequence & calculate the weight of match/mismatch */
	for (nt = 0; LIKELY(nt < n); nt ++) {
		for (i = 0; i < segLen; i ++) {
			j = i;
			for (segNum = 0; LIKELY(segNum < 16) ; segNum ++) {
				*t++ = j>= readLen ? bias : mat[nt * n + read_num[j]] + bias;
				j += segLen;
			}
		}
	}
	return vProfile;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %ecx, %ebp
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %r15
leal 0xf(%r12), %eax
pushq $0x10
popq %rcx
cltd
idivl %ecx
movl %eax, %r13d
imull %ebp, %eax
movslq %eax, %rdi
shlq $0x4, %rdi
callq 0x3420
movq %rax, %r9
movslq %r13d, %rcx
movslq %r12d, %rdx
xorl %esi, %esi
testl %ecx, %ecx
movl $0x0, %edi
cmovgl %ecx, %edi
testl %ebp, %ebp
movl $0x0, %eax
movl %ebp, %r8d
cmovgl %ebp, %eax
movq %r9, (%rsp)
cmpl %eax, %esi
je 0xb12f
movl %esi, %r10d
imull %r8d, %r10d
movslq %r10d, %r10
xorl %r11d, %r11d
cmpq %rdi, %r11
je 0xb12b
xorl %r12d, %r12d
movq %r11, %r13
cmpl $0x10, %r12d
je 0xb123
movl %ebx, %ebp
cmpq %rdx, %r13
jge 0xb117
movsbq (%r15,%r13), %rbp
addq %r10, %rbp
movb (%r14,%rbp), %bpl
addb %bl, %bpl
movb %bpl, (%r9,%r12)
addq %rcx, %r13
incq %r12
jmp 0xb0fb
incq %r11
addq %r12, %r9
jmp 0xb0f0
incl %esi
jmp 0xb0df
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ssw.c
// Function: qP_word
static __m128i* qP_word (const int8_t* read_num,
				  const int8_t* mat,
				  const int32_t readLen,
				  const int32_t n) {

	int32_t segLen = (readLen + 7) / 8;
	__m128i* vProfile = (__m128i*)malloc(n * segLen * sizeof(__m128i));
	int16_t* t = (int16_t*)vProfile;
	int32_t nt, i, j;
	int32_t segNum;

	/* Generate query profile rearrange query sequence & calculate the weight of match/mismatch */
	for (nt = 0; LIKELY(nt < n); nt ++) {
		for (i = 0; i < segLen; i ++) {
			j = i;
			for (segNum = 0; LIKELY(segNum < 8) ; segNum ++) {
				*t++ = j>= readLen ? 0 : mat[nt * n + read_num[j]];
				j += segLen;
			}
		}
	}
	return vProfile;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %r15
leal 0x7(%r12), %eax
pushq $0x8
popq %rcx
cltd
idivl %ecx
movl %eax, %ebp
imull %ebx, %eax
movslq %eax, %rdi
shlq $0x4, %rdi
callq 0x3420
movslq %ebp, %rcx
movslq %r12d, %rdx
xorl %esi, %esi
testl %ecx, %ecx
movl $0x0, %edi
cmovgl %ecx, %edi
testl %ebx, %ebx
movl $0x0, %r8d
cmovgl %ebx, %r8d
movq %rax, %r9
cmpl %r8d, %esi
je 0xb1e8
movl %esi, %r10d
imull %ebx, %r10d
movslq %r10d, %r10
xorl %r11d, %r11d
cmpq %rdi, %r11
je 0xb1e4
xorl %r12d, %r12d
movq %r11, %r13
cmpl $0x10, %r12d
je 0xb1dc
cmpq %rdx, %r13
jge 0xb1cc
movsbq (%r15,%r13), %rbp
addq %r10, %rbp
movsbl (%r14,%rbp), %ebp
jmp 0xb1ce
xorl %ebp, %ebp
movw %bp, (%r9,%r12)
addq %rcx, %r13
addq $0x2, %r12
jmp 0xb1b2
incq %r11
addq %r12, %r9
jmp 0xb1a7
incl %esi
jmp 0xb195
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 (%rsi), %ecx
movl (%rdx), %esi
cmpl %esi, %ecx
jl 0xc5e6
movl %esi, %ecx
sarl %ecx
orl %esi, %ecx
movl %ecx, %esi
sarl $0x2, %esi
orl %ecx, %esi
movl %esi, %ecx
sarl $0x4, %ecx
orl %esi, %ecx
movl %ecx, %esi
sarl $0x8, %esi
orl %ecx, %esi
movl %esi, %ecx
sarl $0x10, %ecx
orl %esi, %ecx
leal 0x1(%rcx), %esi
movl %esi, (%rdx)
movslq %ecx, %rcx
leaq 0x4(,%rcx,4), %rsi
movq %rax, %rdi
callq 0x3480
movl (%rbx), %ecx
shll $0x4, %ebp
movsbq %r14b, %rdx
leaq 0x13dcc(%rip), %rsi     # 0x203c0
movzbl (%rdx,%rsi), %edx
orl %ebp, %edx
leal 0x1(%rcx), %esi
movl %esi, (%rbx)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xc647
pushq $0x3d
popq %r10
movq %rax, %rdi
movq %rcx, %rsi
movq %r8, %rdx
movl %r9d, %ecx
movl %r10d, %r8d
callq 0xc593
jmp 0xc678
movl (%rbx), %r9d
testl %r9d, %r9d
sete %dl
cmpb $0x2, %dil
setae %sil
orb %dl, %sil
jne 0xc67c
pushq $0x58
popq %r10
movq %rax, %rdi
movq %rcx, %rsi
movq %r8, %rdx
movl %r9d, %ecx
movl %r10d, %r8d
callq 0xc593
movq %rbx, %r14
andl $0x0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/samtools-0.1.19/./kstring.h
// Function: kputw
static inline int kputw(int c, kstring_t *s)
{
	char buf[16];
	int l, x;
	if (c == 0) return kputc('0', s);
        if(c < 0) for (l = 0, x = c; x < 0; x /= 10) buf[l++] = '0' - (x%10);
        else for (l = 0, x = c; x > 0; x /= 10) buf[l++] = x%10 + '0';
	if (c < 0) buf[l++] = '-';
	if (s->l + l + 1 >= s->m) {
		s->m = s->l + l + 2;
		kroundup32(s->m);
		s->s = (char*)realloc(s->s, s->m);
	}
	for (x = l - 1; x >= 0; --x) s->s[s->l++] = buf[x];
	s->s[s->l] = 0;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
testl %edi, %edi
je 0xebb0
js 0xebc2
xorl %r14d, %r14d
pushq $0xa
popq %rcx
movl %edi, %eax
testl %eax, %eax
je 0xebe2
xorl %edx, %edx
divl %ecx
orb $0x30, %dl
movb %dl, (%rsp,%r14)
incq %r14
jmp 0xeb9c
pushq $0x30
popq %rdi
movq %rbx, %rsi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0xeb01
xorl %r14d, %r14d
pushq $0xa
popq %rcx
movl %edi, %eax
testl %eax, %eax
jns 0xebe2
negl %eax
xorl %edx, %edx
divl %ecx
orb $0x30, %dl
movb %dl, (%rsp,%r14)
incq %r14
negl %eax
jmp 0xebca
testl %edi, %edi
jns 0xebf4
movl %r14d, %eax
leal 0x1(%r14), %ecx
movb $0x2d, (%rsp,%rax)
movl %ecx, %r14d
movq (%rbx), %rax
movslq %r14d, %rcx
addq %rcx, %rax
incq %rax
cmpq 0x8(%rbx), %rax
jb 0xec4b
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x3480
movq %rax, 0x10(%rbx)
movl %r14d, %eax
testl %eax, %eax
jle 0xec6c
movb -0x1(%rsp,%rax), %cl
decq %rax
movq (%rbx), %rdx
movq 0x10(%rbx), %rsi
leaq 0x1(%rdx), %rdi
movq %rdi, (%rbx)
movb %cl, (%rsi,%rdx)
jmp 0xec4e
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/samtools-0.1.19/faidx.c
// Function: download_and_open
FILE *download_and_open(const char *fn)
{
    const int buf_size = 1 * 1024 * 1024;
    uint8_t *buf;
    FILE *fp;
    knetFile *fp_remote;
    const char *url = fn;
    const char *p;
    int l = strlen(fn);
    for (p = fn + l - 1; p >= fn; --p)
        if (*p == '/') break;
    fn = p + 1;

    // First try to open a local copy
    fp = fopen(fn, "r");
    if (fp)
        return fp;

    // If failed, download from remote and open
    fp_remote = knet_open(url, "rb");
    if (fp_remote == 0) {
        fprintf(stderr, "[download_from_remote] fail to open remote file %s\n",url);
        return NULL;
    }
    if ((fp = fopen(fn, "wb")) == 0) {
        fprintf(stderr, "[download_from_remote] fail to create file in the working directory %s\n",fn);
        knet_close(fp_remote);
        return NULL;
    }
    buf = (uint8_t*)calloc(buf_size, 1);
    while ((l = knet_read(fp_remote, buf, buf_size)) != 0)
        fwrite(buf, 1, l, fp);
    free(buf);
    fclose(fp);
    knet_close(fp_remote);

    return fopen(fn, "r");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r15
callq 0x31e0
cltq
addq %r15, %rax
decq %rax
movq %rax, %rbx
cmpq %r15, %rax
jb 0x12e0b
leaq -0x1(%rbx), %rax
cmpb $0x2f, (%rbx)
jne 0x12dfa
incq %rbx
leaq 0xeb02(%rip), %rsi      # 0x21917
movq %rbx, %rdi
callq 0x3380
movq %rax, %r12
testq %rax, %rax
je 0x12e32
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0xd295(%rip), %rsi      # 0x200ce
movq %r15, %rdi
callq 0x1402f
testq %rax, %rax
je 0x12ed3
movq %rax, %r14
leaq 0xe133(%rip), %rsi      # 0x20f87
movq %rbx, %rdi
callq 0x3380
testq %rax, %rax
je 0x12ef6
movq %rax, %r15
pushq $0x1
popq %r12
movl $0x100000, %edi         # imm = 0x100000
movq %r12, %rsi
callq 0x3310
movq %rax, %r13
movl $0x100000, %edx         # imm = 0x100000
movq %r14, %rdi
movq %r13, %rsi
callq 0x141a4
testl %eax, %eax
je 0x12ea3
movslq %eax, %rdx
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rcx
callq 0x35e0
jmp 0x12e7c
movq %r13, %rdi
callq 0x3070
movq %r15, %rdi
callq 0x31c0
movq %r14, %rdi
callq 0x14124
leaq 0xea55(%rip), %rsi      # 0x21917
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3380
movq 0x1611e(%rip), %rax     # 0x28ff8
movq (%rax), %rdi
leaq 0xe0d0(%rip), %rsi      # 0x20fb4
xorl %r12d, %r12d
movq %r15, %rdx
xorl %eax, %eax
callq 0x3350
jmp 0x12e25
movq 0x160fb(%rip), %rax     # 0x28ff8
movq (%rax), %rdi
leaq 0xe0e1(%rip), %rsi      # 0x20fe8
xorl %r12d, %r12d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3350
movq %r14, %rdi
callq 0x14124
jmp 0x12e25
// File: /workspace/github_c_makefile_star2_O2/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 0x2d5c(%rip), %rbx      # 0x3fe0
movq (%rbx), %rsi
leaq 0xd76(%rip), %rdi       # 0x2004
callq 0x10e0
movq (%rbx), %rsi
leaq 0xd96(%rip), %rdi       # 0x2033
callq 0x10e0
movq (%rbx), %rsi
leaq 0xda6(%rip), %rdi       # 0x2052
callq 0x10e0
movq (%rbx), %rsi
leaq 0xdb9(%rip), %rdi       # 0x2074
callq 0x10e0
movq (%rbx), %rsi
leaq 0xdcb(%rip), %rdi       # 0x2095
popq %rbx
jmp 0x10e0
// File: /workspace/github_c_makefile_star2_O2/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 0x1525
movq %rsi, %rbx
leaq 0x4(%rsp), %rdi
callq 0x1110
testl %eax, %eax
js 0x150d
leaq 0x18(%rsp), %rdi
callq 0x1110
testl %eax, %eax
js 0x150d
leaq 0x10(%rsp), %rdi
callq 0x1110
testl %eax, %eax
js 0x150d
callq 0x1050
testl %eax, %eax
jne 0x152c
pushq $0x2
popq %rbp
movl %ebp, %edi
callq 0x1170
movl 0x1c(%rsp), %edi
movl %ebp, %esi
callq 0x10d0
movl 0x1c(%rsp), %edi
callq 0x1170
movl 0x8(%rsp), %edi
callq 0x12d0
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x1170
movl 0x14(%rsp), %edi
movl %ebp, %esi
callq 0x10d0
movl 0x14(%rsp), %edi
callq 0x12d0
movq 0x8(%rbx), %rdi
addq $0x8, %rbx
movq %rbx, %rsi
callq 0x10a0
negl %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x2acc(%rip), %rax      # 0x3fe0
movq (%rax), %rsi
leaq 0xbc2(%rip), %rdi       # 0x20e0
callq 0x10e0
jmp 0x157a
callq 0x127c
jmp 0x157a
movl %eax, %ebp
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x12d0
movl 0x8(%rsp), %edi
callq 0x12d0
movl 0x4(%rsp), %edi
xorl %esi, %esi
callq 0x10d0
cmpl $-0x1, %eax
jne 0x1582
movq 0x2a89(%rip), %rax      # 0x3fe0
movq (%rax), %rbx
callq 0x1030
movl (%rax), %edi
callq 0x1060
leaq 0xb52(%rip), %rsi       # 0x20bf
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1120
pushq $0x1
popq %rdi
callq 0x1100
movl 0x4(%rsp), %edi
callq 0x12d0
leaq -0x290(%rip), %r14      # 0x1302
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 0x10b0
testl %eax, %eax
jle 0x15d7
movl 0xc(%rsp), %eax
testb $0x7f, %al
jne 0x15d7
movzbl %ah, %ebx
movl %ebx, %edi
callq 0x1100
// File: /workspace/github_c_makefile_star2_O2/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, %r14d
leaq -0x2c(%rbp), %r15
pushq $0x4
popq %r12
movl %r14d, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1090
testq %rax, %rax
je 0x126f
movslq -0x2c(%rbp), %rbx
movq %rbx, %rdi
callq 0x10b0
movq %rax, %r13
movl %r14d, %edi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x1090
movq %r13, %rdi
callq 0x1060
movq %r13, %rdi
leaq 0xdad(%rip), %rsi       # 0x2004
callq 0x10a0
movl %eax, %ebx
movq %r13, %rdi
callq 0x1030
testl %ebx, %ebx
jne 0x1215
pushq $0x1
popq %rax
jmp 0x1271
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
movl %edi, %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
pushq $0x5
popq %rsi
movl %r14d, %edi
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 0x12f4
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_O2/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:
pushq $0x1d
popq %rsi
pushq $0x64
popq %r10
leaq 0xe887(%rip), %r8       # 0x14630
leaq 0x14cd0(%rip), %rcx     # 0x1aa80
leal 0x1(%rsi), %r9d
cmpl $0x64, %edi
jb 0x5de7
movl %edi, %eax
xorl %edx, %edx
divl %r10d
imull $0x7fffff9c, %eax, %edx # imm = 0x7FFFFF9C
addl %edi, %edx
addl %edx, %edx
movb (%rdx,%r8), %dil
movb 0x1(%rdx,%r8), %dl
movl %r9d, %r9d
movb %dl, (%r9,%rcx)
movl %esi, %edx
movb %dil, (%rdx,%rcx)
addl $-0x2, %esi
movl %eax, %edi
jmp 0x5db0
cmpl $0x9, %edi
ja 0x5df2
orb $0x30, %dil
jmp 0x5e0c
movl %edi, %eax
leaq (%rax,%rax), %rdx
movl %edx, %edx
movb 0x1(%rdx,%r8), %dl
movl %r9d, %edi
movb %dl, (%rdi,%rcx)
movb (%r8,%rax,2), %dil
movl %esi, %r9d
movl %r9d, %edx
leaq (%rcx,%rdx), %rax
movb %dil, (%rdx,%rcx)
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: xstrsncpy
static size_t xstrsncpy(char *restrict dst, const char *restrict src, size_t n)
{
	char *end = memccpy(dst, src, '\0', n);

	if (!end) {
		if (n)
			dst[n - 1] = '\0';
		end = dst + n; /* If we return n here, binary size increases due to auto-inlining */
	}

	return end - dst;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
xorl %edx, %edx
movq %r14, %rcx
callq 0x4860
testq %rax, %rax
jne 0x6040
testq %r14, %r14
je 0x603a
movb $0x0, -0x1(%rbx,%r14)
addq %rbx, %r14
movq %r14, %rax
subq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
testb $0x4, 0x13448(%rip)     # 0x194cb
je 0x60ab
testb $0x10, 0x13499(%rip)    # 0x19525
jne 0x60ab
leaq 0xdd35(%rip), %rdi      # 0x13dca
xorl %eax, %eax
callq 0x4320
movq 0x12ecd(%rip), %rax     # 0x18f70
movq (%rax), %rdi
callq 0x45d0
movq 0x13476(%rip), %rdi     # 0x19528
callq 0x4090
movq 0x149e2(%rip), %rdi     # 0x1aaa0
callq 0x4090
movq 0x1489e(%rip), %rdi     # 0x1a968
callq 0x4090
movq 0x13562(%rip), %rdi     # 0x19638
callq 0x4090
movq 0x1357e(%rip), %rdi     # 0x19660
callq 0x4090
movq 0x1358a(%rip), %rdi     # 0x19678
callq 0x4090
movq 0x149ae(%rip), %rdi     # 0x1aaa8
callq 0x4090
movq 0x149aa(%rip), %rdi     # 0x1aab0
callq 0x4090
movq 0x13546(%rip), %rdi     # 0x19658
callq 0x4090
movq 0x13552(%rip), %rdi     # 0x19670
callq 0x4090
movb 0x133af(%rip), %bl      # 0x194d8
cmpb $-0x1, %bl
je 0x614e
xorl %ebp, %ebp
leaq 0x14989(%rip), %r14     # 0x1aac0
cmpb %bl, %bpl
ja 0x614e
movzbl %bpl, %eax
movq (%r14,%rax,8), %rdi
callq 0x4090
incb %bpl
jmp 0x6137
movl 0x133d0(%rip), %eax     # 0x19524
testb $0x1, %al
je 0x616a
movq 0x147f1(%rip), %rdi     # 0x1a950
callq 0x40d0
movl 0x133ba(%rip), %eax     # 0x19524
btl $0xd, %eax
jb 0x6175
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x149c4(%rip), %rdi     # 0x1ab40
popq %rbx
popq %r14
popq %rbp
jmp 0x40d0
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rax
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %eax
leaq 0x12316(%rip), %rcx     # 0x18aa0
movq (%rcx,%rax,8), %rdi
callq 0x4050
movb $0x1, %cl
testq %rax, %rax
je 0x6889
cmpb $0x0, (%rax)
je 0x6889
movq %rax, %rdi
callq 0x6915
movq %rax, (%r14)
testq %rax, %rax
je 0x6875
movq %rax, %r12
xorl %r13d, %r13d
movb $0x1, %dl
xorl %eax, %eax
movb (%r12), %cl
testb %cl, %cl
je 0x686a
cmpl $0x63, %r13d
ja 0x686a
testb $0x1, %dl
je 0x6855
movl %r13d, %ebp
testb $0x7, %r13b
jne 0x681f
leal 0x40(,%r13,8), %esi
movq %rax, %rdi
callq 0xd572
movq %rax, (%r15)
testq %rax, %rax
je 0x689a
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax,%rbp,8)
movups %xmm0, 0x20(%rax,%rbp,8)
movups %xmm0, 0x10(%rax,%rbp,8)
movups %xmm0, (%rax,%rbp,8)
movb (%r12), %cl
movzbl %cl, %ecx
movl %ecx, (%rax,%rbp,8)
cmpb $0x3a, 0x1(%r12)
jne 0x6887
movzbl 0x2(%r12), %edx
xorl %ecx, %ecx
testl %edx, %edx
je 0x6889
cmpl $0x3b, %edx
je 0x6889
addq $0x2, %r12
movl (%r14), %ecx
movl %r12d, %edx
subl %ecx, %edx
movl %edx, 0x4(%rax,%rbp,8)
incl %r13d
movb (%r12), %cl
cmpb $0x3b, %cl
sete %dl
jne 0x6862
movb $0x0, (%r12)
incq %r12
jmp 0x67c5
movb %r13b, (%rbx)
testl %r13d, %r13d
setne %cl
jmp 0x6889
movl $0xfad, %edi            # imm = 0xFAD
callq 0x5d9b
movq %rax, %rdi
callq 0x4740
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xfb9, %edi            # imm = 0xFB9
jmp 0x687a
// File: /workspace/github_c_makefile_star2_O2/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
testq %rdi, %rdi
je 0x68db
movq %rsi, %r14
movzbl %cl, %eax
xorl %ebx, %ebx
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x68dd
movl (%rdi,%rcx,8), %esi
testl %esi, %esi
je 0x68dd
incq %rcx
cmpl %edx, %esi
jne 0x68b4
movslq -0x4(%rdi,%rcx,8), %rbx
cmpb $0x2, %r8b
jne 0x68e8
addq 0x12d9f(%rip), %rbx     # 0x19678
jmp 0x68dd
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq 0x12d71(%rip), %rbx     # 0x19660
movq %rbx, %rdi
callq 0xd66f
leaq 0x12e52(%rip), %rdi     # 0x19750
testb %al, %al
cmoveq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5e18
// File: /workspace/github_c_makefile_star2_O2/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
callq 0x5d70
pushq $0x2f
popq %rsi
movq %rbx, %rdi
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_O2/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 0x69c7
movq %rbx, %rdi
callq 0x4400
jmp 0x69db
callq 0x40c0
movl (%rax), %edi
callq 0x4870
movq %rax, %rdi
callq 0xd5b9
testq %rbx, %rbx
setne %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdx, %rbx
movq %rsi, %r14
movzbl (%rsi), %eax
cmpl $0x2f, %eax
je 0x6b09
movq %rdi, %rsi
cmpl $0x7e, %eax
jne 0x6ae0
cmpb $0x2f, 0x1(%r14)
jne 0x6ae0
incq %r14
movq 0x12b75(%rip), %rsi     # 0x19640
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rdi
callq 0x6016
movq %rax, %r15
decq %r15
jmp 0x6b0c
cmpb $0x0, 0x1(%rsi)
jne 0x6af1
cmpb $0x2f, (%rsi)
jne 0x6af1
pushq $0x1
popq %r15
jmp 0x6b01
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rdi
callq 0x6016
movq %rax, %r15
movb $0x2f, -0x1(%rbx,%r15)
jmp 0x6b0c
xorl %r15d, %r15d
addq %r15, %rbx
movl $0x1000, %edx           # imm = 0x1000
subq %r15, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6016
addq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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)
movl %edi, 0xc(%rsp)
movq 0xd7ba(%rip), %r15      # 0x1aa78
testq %rsi, %rsi
je 0xd2c6
andl $0x0, (%rsi)
movl 0xd7a4(%rip), %ebp      # 0x1aa70
testl %ebp, %ebp
je 0xd303
movq %rsi, 0x20(%rsp)
decl %ebp
movq 0xd8a2(%rip), %r14      # 0x1ab80
testq %r14, %r14
je 0xd30b
movq 0xd7be(%rip), %rdi      # 0x1aaa8
callq 0x5d70
movq %rax, 0x18(%rsp)
movq %r14, %rdi
callq 0x5d70
movq %rax, 0x10(%rsp)
jmp 0xd31d
xorl %r12d, %r12d
jmp 0xd3ed
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movl %ebp, %ebx
xorl %r12d, %r12d
xorl %ebp, %ebp
cmpq %rbx, %r12
ja 0xd3e1
movq %r15, %rdi
callq 0x5d70
movq %rax, %r14
movq 0xd841(%rip), %rsi      # 0x1ab80
testq %rsi, %rsi
je 0xd39e
movq %r15, %rdi
movq 0x10(%rsp), %rdx
callq 0x6951
testb %al, %al
je 0xd39e
movq 0xd74c(%rip), %rsi      # 0x1aaa8
movl 0xc(%rsp), %edi
movq 0x18(%rsp), %r13
movq %r13, %rdx
callq 0x4210
cmpq %r13, %rax
jne 0xd3ed
movq 0x10(%rsp), %rax
leaq (%r15,%rax), %rsi
movq %rbp, 0x28(%rsp)
movq %r14, %r13
subq %rax, %r13
movl 0xc(%rsp), %edi
movq %r13, %rdx
callq 0x4210
cmpq %r13, %rax
movq 0x28(%rsp), %rbp
je 0xd3b2
jmp 0xd3ed
movl 0xc(%rsp), %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4210
cmpq %r14, %rax
jne 0xd3ed
addq %r14, %r12
cmpq %rbx, %r12
ja 0xd3d7
movl 0xc(%rsp), %edi
movq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x4210
cmpq $0x1, %rax
jne 0xd3ed
addq %r14, %r15
incq %r15
incq %r12
incl %ebp
jmp 0xd324
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0xd3ed
movl %ebp, (%rax)
movq %r12, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: rmlistpath
static void rmlistpath(void)
{
	if (listpath) {
		DPRINTF_S(__func__);
		DPRINTF_S(listpath);
		spawn(utils[UTIL_RM_RF], listpath, NULL, NULL, F_NOTRACE | F_MULTI);
		/* Do not free if program was started in list mode */
		if (listpath != initpath)
			free(listpath);
		listpath = NULL;
	}
}

// Assembly:
movq 0xd77a(%rip), %rsi      # 0x1ab80
testq %rsi, %rsi
je 0xd441
pushq %rax
leaq 0x6a89(%rip), %rdi      # 0x13e9c
pushq $0x5
popq %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xdcb4
movq 0xd759(%rip), %rdi      # 0x1ab80
cmpq 0xc20a(%rip), %rdi      # 0x19638
je 0xd435
callq 0x4090
andq $0x0, 0xd743(%rip)      # 0x1ab80
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: notify_fifo
static void notify_fifo(bool force)
{
	if (!fifopath)
		return;

	if (fifofd == -1) {
		fifofd = open(fifopath, O_WRONLY|O_NONBLOCK|O_CLOEXEC);
		if (fifofd == -1) {
			if (errno != ENXIO)
				/* Unexpected error, the FIFO file might have been removed */
				/* We give up FIFO notification */
				fifopath = NULL;
			return;
		}
	}

	static struct entry lastentry;

	if (!force && !memcmp(&lastentry, &pdents[cur], sizeof(struct entry))) // NOLINT
		return;

	lastentry = pdents[cur];

	char path[PATH_MAX];
	size_t len = mkpath(g_ctx[cfg.curctx].c_path, ndents ? pdents[cur].name : "", path);

	path[len - 1] = '\n';

	ssize_t ret = write(fifofd, path, len);

	if (ret != (ssize_t)len && !(ret == -1 && (errno == EAGAIN || errno == EPIPE))) {
		DPRINTF_S(strerror(errno));
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movl %edi, %ebx
movq 0xd4f9(%rip), %rdi      # 0x1a950
testq %rdi, %rdi
je 0xd534
cmpl $-0x1, 0xc05d(%rip)     # 0x194c4
jne 0xd484
movl $0x80801, %esi          # imm = 0x80801
xorl %eax, %eax
callq 0x46b0
movl %eax, 0xc049(%rip)      # 0x194c4
cmpl $-0x1, %eax
je 0xd541
movq 0x15be5(%rip), %r14     # 0x23070
movslq 0x15be6(%rip), %r15     # 0x23078
testb %bl, %bl
jne 0xd4b4
imulq $0x30, %r15, %rsi
addq %r14, %rsi
leaq 0x16ef4(%rip), %rdi     # 0x24398
pushq $0x30
popq %rdx
callq 0x4620
testl %eax, %eax
je 0xd534
imulq $0x30, %r15, %rax
movups (%r14,%rax), %xmm0
movups 0x10(%r14,%rax), %xmm1
movups 0x20(%r14,%rax), %xmm2
movups %xmm2, 0x16ee8(%rip)    # 0x243b8
movups %xmm1, 0x16ed1(%rip)    # 0x243a8
movups %xmm0, 0x16eba(%rip)    # 0x24398
movl 0xbfe4(%rip), %ecx      # 0x194c8
shrl $0xd, %ecx
andl $0x7, %ecx
imulq $0x2138, %rcx, %rcx     # imm = 0x2138
leaq 0xd698(%rip), %rdi      # 0x1ab90
addq %rcx, %rdi
cmpl $0x0, 0xd68a(%rip)      # 0x1ab8c
je 0xd50c
addq %rax, %r14
movq (%r14), %rsi
jmp 0xd513
leaq 0x6e17(%rip), %rsi      # 0x1432a
movq %rsp, %rbx
movq %rbx, %rdx
callq 0x6a9f
movb $0xa, -0x1(%rax,%rbx)
movl 0xbf9b(%rip), %edi      # 0x194c4
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4210
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
callq 0x40c0
cmpl $0x6, (%rax)
je 0xd534
andq $0x0, 0xd3fd(%rip)      # 0x1a950
jmp 0xd534
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: xrealloc
static void *xrealloc(void *pcur, size_t len)
{
	void *pmem = realloc(pcur, len);

	if (!pmem)
		free(pcur);

	return pmem;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4640
movq %rax, %r14
testq %rax, %rax
jne 0xd58e
movq %rbx, %rdi
callq 0x4090
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: convert_tilde
static bool convert_tilde(const char *path, char *buf)
{
	if (tilde_is_home(path)) {
		ssize_t len = xstrlen(home);
		ssize_t loclen = xstrlen(path);

		xstrsncpy(buf, home, len + 1);
		xstrsncpy(buf + len, path + 1, loclen);
		return true;
	}
	return false;
}

// Assembly:
cmpb $0x7e, (%rdi)
jne 0xd6da
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movzbl 0x1(%rdi), %eax
cmpl $0x2f, %eax
je 0xd68d
testl %eax, %eax
jne 0xd6dd
leaq 0x1(%rbx), %r14
movq 0xbfa8(%rip), %r15      # 0x19640
movq %r15, %rdi
callq 0x5d70
movq %rax, %r12
movq %rbx, %rdi
callq 0x5d70
movq %rax, %rbx
leaq 0x1(%r12), %rdx
leaq 0xc096(%rip), %r13      # 0x19750
movq %r13, %rdi
movq %r15, %rsi
callq 0x6016
addq %r13, %r12
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x6016
movb $0x1, %al
jmp 0xd6df
xorl %eax, %eax
retq
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: printwait
static void printwait(const char *msg, int *presel)
{
	printmsg(msg);
	if (presel) {
		*presel = MSGWAIT;
		if (ndents)
			xstrsncpy(g_ctx[cfg.curctx].c_name, pdents[cur].name, NAME_MAX + 1);
	}
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0xd5b9
testq %rbx, %rbx
je 0xd74c
movl $0x24, (%rbx)
cmpl $0x0, 0xd488(%rip)      # 0x1ab8c
je 0xd74c
movl 0xbdbc(%rip), %eax      # 0x194c8
shrl $0xd, %eax
andl $0x7, %eax
imulq $0x2138, %rax, %rax     # imm = 0x2138
leaq 0xd470(%rip), %rcx      # 0x1ab90
leaq (%rax,%rcx), %rdi
addq $0x2000, %rdi           # imm = 0x2000
movq 0x1593e(%rip), %rax     # 0x23070
movslq 0x1593f(%rip), %rcx     # 0x23078
imulq $0x30, %rcx, %rcx
movq (%rax,%rcx), %rsi
movl $0x100, %edx            # imm = 0x100
popq %rbx
jmp 0x6016
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: xchartohex
static uchar_t xchartohex(uchar_t c)
{
	if (xisdigit(c))
		return c - '0';

	if (c >= 'a' && c <= 'f')
		return c - 'a' + 10;

	if (c >= 'A' && c <= 'F')
		return c - 'A' + 10;

	return c;
}

// Assembly:
leal -0x30(%rdi), %eax
cmpl $0x9, %eax
jbe 0xd763
leal -0x61(%rdi), %eax
cmpb $0x5, %al
ja 0xd764
addb $-0x57, %dil
movl %edi, %eax
retq
leal -0x41(%rdi), %eax
leal -0x37(%rdi), %ecx
cmpb $0x6, %al
movzbl %dil, %edx
movzbl %cl, %eax
cmovael %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: reventrycmp
static int reventrycmp(const void *va, const void *vb)
{
	if ((((pEntry)vb)->flags & DIR_OR_DIRLNK)
	    != (((pEntry)va)->flags & DIR_OR_DIRLNK)) {
		if (((pEntry)vb)->flags & DIR_OR_DIRLNK)
			return 1;
		return -1;
	}

	return -entrycmp(va, vb);
}

// Assembly:
movzbl 0x27(%rsi), %ecx
andl $0x1, %ecx
movzbl 0x27(%rdi), %eax
andl $0x1, %eax
cmpl %eax, %ecx
jne 0xd796
pushq %rax
callq 0xd7a1
negl %eax
addq $0x8, %rsp
retq
xorl %eax, %eax
cmpl $0x1, %ecx
sbbl %eax, %eax
orl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jarun[P]nnn/src/nnn.c
// Function: entrycmp
static int entrycmp(const void *va, const void *vb)
{
	const struct entry *pa = (pEntry)va;
	const struct entry *pb = (pEntry)vb;

	if ((pb->flags & DIR_OR_DIRLNK) != (pa->flags & DIR_OR_DIRLNK)) {
		if (pb->flags & DIR_OR_DIRLNK)
			return 1;
		return -1;
	}

	/* Sort based on specified order */
	if (cfg.timeorder) {
		if (pb->sec > pa->sec)
			return 1;
		if (pb->sec < pa->sec)
			return -1;
		/* If sec matches, comare nsec */
		if (pb->nsec > pa->nsec)
			return 1;
		if (pb->nsec < pa->nsec)
			return -1;
	} else if (cfg.sizeorder) {
		if (pb->size > pa->size)
			return 1;
		if (pb->size < pa->size)
			return -1;
	} else if (cfg.blkorder) {
		if (pb->blocks > pa->blocks)
			return 1;
		if (pb->blocks < pa->blocks)
			return -1;
	} else if (cfg.extnorder && !(pb->flags & DIR_OR_DIRLNK)) {
		char *extna = xextension(pa->name, pa->nlen - 1);
		char *extnb = xextension(pb->name, pb->nlen - 1);

		if (extna || extnb) {
			if (!extna)
				return -1;

			if (!extnb)
				return 1;

			int ret = strcasecmp(extna, extnb);

			if (ret)
				return ret;
		}
	}

	return namecmpfn(pa->name, pb->name);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq 0x20(%rsi), %r15
movq %r15, %rcx
shrq $0x38, %rcx
andl $0x1, %ecx
movq 0x20(%rdi), %rsi
btq $0x38, %rsi
movl %ecx, %eax
sbbl $0x0, %eax
jne 0xd840
movq %rdi, %r14
movl 0xbcf4(%rip), %eax      # 0x194c8
testb $0x2, %al
jne 0xd84c
testb $0x4, %al
jne 0xd862
testb $0x10, %al
jne 0xd870
testb $0x20, %al
sete %al
orb %al, %cl
jne 0xd8b4
movq (%r14), %rdi
shrq $0x28, %rsi
movl $0xffff, %r13d          # imm = 0xFFFF
andq %r13, %rsi
decq %rsi
callq 0xdc7a
movq %rax, %r12
movq (%rbx), %rdi
shrq $0x28, %r15
andq %r13, %r15
decq %r15
movq %r15, %rsi
callq 0xdc7a
movq %rax, %rsi
testq %r12, %r12
je 0xd8a7
testq %rsi, %rsi
je 0xd8a7
movq %r12, %rdi
callq 0x40b0
testl %eax, %eax
jne 0xd89d
jmp 0xd8b4
xorl %eax, %eax
cmpl $0x1, %ecx
sbbl %eax, %eax
orl $0x1, %eax
jmp 0xd89d
movq 0x8(%r14), %rcx
pushq $0x1
popq %rax
cmpq %rcx, 0x8(%rbx)
jg 0xd89d
pushq $-0x1
popq %rcx
jge 0xd889
movl %ecx, %eax
jmp 0xd89d
movq 0x18(%r14), %rax
cmpq %rax, 0x18(%rbx)
jg 0xd885
jl 0xd89a
jmp 0xd8b4
movabsq $0xffffffffff, %rax     # imm = 0xFFFFFFFFFF
andq %rax, %r15
andq %rax, %rsi
cmpq %rsi, %r15
jbe 0xd898
pushq $0x1
jmp 0xd89c
movl 0x10(%r14), %edx
cmpl %edx, 0x10(%rbx)
ja 0xd89d
movl %ecx, %eax
jb 0xd89d
jmp 0xd8b4
jae 0xd8b4
pushq $-0x1
popq %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
xorl %eax, %eax
cmpq $0x1, %r12
sbbl %eax, %eax
orq %r12, %rsi
jne 0xd847
movq 0xbc2d(%rip), %rax      # 0x194e8
movq (%r14), %rdi
movq (%rbx), %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmpq *%rax