LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/trie/postingList.c
// Function: getMaxCounter
void getMaxCounter(ePostingList *self,char **name,int *counter){
	postingList1 *temp = self->pl;
	*name = temp->name;
	*counter = temp->counter;
	while((temp = temp->next) != NULL){
		if(temp->counter>*counter || (temp->counter==*counter && strcmp(temp->name,*name)<0)){
			*name = temp->name;
			*counter = temp->counter;
		}
	}
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x8(%rdi), %rax
movq 0x8(%rax), %r15
movq %r15, (%rsi)
movl (%rax), %r14d
movl %r14d, (%rdx)
movq 0x18(%rax), %r13
testq %r13, %r13
je 0x2a25
movq %rsi, -0x38(%rbp)
movq %rdx, -0x30(%rbp)
movl (%r13), %ebx
cmpl %r14d, %ebx
jle 0x29ff
movq 0x8(%r13), %r12
movq %r12, (%rsi)
movl %ebx, (%rdx)
movq %r12, %r15
movl %ebx, %r14d
jmp 0x2a1c
jne 0x2a1c
movq 0x8(%r13), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2190
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
testl %eax, %eax
js 0x29f2
movq 0x18(%r13), %r13
testq %r13, %r13
jne 0x29e5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/trie/postingList.c
// Function: updatePL
void updatePL(ePostingList **self,int line,char *name,int id){
	if((*self)->pl==NULL){
		(*self)->pl=insertInPL(line,name,id);
		(*self)->last = (*self)->pl;
		(*self)->counter++;//new PL node
		return;
	}
	postingList1 *temp = (*self)->last;
	if(!strcmp(temp->name,name) && (temp->last)->line>line){//that will never happen :-)
		printf("You shouldn't come here,leave me alone ~_~'\n");
		return ;
	}
	//checking name or id is the same in PL
	if(!strcmp(temp->name,name)){//now lets check pl2
		temp->counter++;//increase counter for the file
		if((temp->last)->line == line){}//do nothing
			//(temp->last)->freq++;//freq deleted
		else{//new line,create next pl2
			temp->linecounter++;
			(temp->last)->next = insertInPL2(line);
			((*self)->last)->last = (temp->last)->next;
		}
		return;
	}
	temp->next = insertInPL(line,name,id);
	(*self)->last = temp->next;
	(*self)->counter++;//new PL node
	return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r15d
movq %rdx, %r12
movl %esi, %r13d
movq %rdi, %rbx
movq (%rdi), %r14
cmpq $0x0, 0x8(%r14)
je 0x2b50
movq 0x10(%r14), %r14
movq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0x2190
testl %eax, %eax
je 0x2bbc
movl $0x30, %edi
callq 0x2210
movl %r13d, -0x2c(%rbp)
movq %rax, %r13
movq %r12, 0x8(%rax)
movl %r15d, 0x10(%rax)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, (%r13)
xorl %r15d, %r15d
movq %r15, 0x18(%r13)
movl $0x10, %edi
callq 0x2210
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
movq %r15, 0x8(%rax)
movq %rax, 0x20(%r13)
movq %rax, 0x28(%r13)
movq %r13, 0x18(%r14)
movq (%rbx), %rax
movq %r13, 0x10(%rax)
jmp 0x2ba8
movl $0x30, %edi
callq 0x2210
movl %r13d, -0x2c(%rbp)
movq %rax, %r13
movq %r12, 0x8(%rax)
movl %r15d, 0x10(%rax)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, (%r13)
xorl %r15d, %r15d
movq %r15, 0x18(%r13)
movl $0x10, %edi
callq 0x2210
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
movq %r15, 0x8(%rax)
movq %rax, 0x20(%r13)
movq %rax, 0x28(%r13)
movq %r13, 0x8(%r14)
movq (%rbx), %rax
movq 0x8(%rax), %rcx
movq %rcx, 0x10(%rax)
movq (%rbx), %rax
incl (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%r14), %r15
movl (%r15), %eax
cmpl %r13d, %eax
jle 0x2be2
leaq 0x4533(%rip), %rdi      # 0x7102
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20a0
incl (%r14)
cmpl %r13d, %eax
je 0x2bad
incl 0x4(%r14)
movl $0x10, %edi
callq 0x2210
movl %r13d, (%rax)
movq $0x0, 0x8(%rax)
movq %rax, 0x8(%r15)
movq (%rbx), %rcx
movq 0x10(%rcx), %rcx
movq %rax, 0x28(%rcx)
jmp 0x2bad
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/trie/postingList.c
// Function: replaceSpaces
void replaceSpaces(char** str){
	if(str == NULL) return;
	int len;
	if((len = strlen(*str)) == 0) return;
	for(int i=0;i<len;i++)
		if((*str)[i] == ' ') (*str)[i]='_';
	return;
}

// Assembly:
testq %rdi, %rdi
je 0x2c50
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2120
testl %eax, %eax
jle 0x2c4a
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movq (%rbx), %rdx
cmpb $0x20, (%rdx,%rcx)
jne 0x2c42
movb $0x5f, (%rdx,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x2c35
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/trie/postingList.c
// Function: getNamesAsStringPL
char* getNamesAsStringPL(ePostingList *self){//self != NULL here
	if(self->pl==NULL) return NULL;
	postingList1 *temp = self->pl;
	char *name = temp->name;
	replaceSpaces(&name);
	int rescount=strlen(name)+4;
	char *tmp=" : ";
	char *res = malloc(rescount*sizeof(char));
	strcpy(res,tmp);
	strcat(res,name);
	while((temp=temp->next) != NULL){
		name = temp->name;
		replaceSpaces(&name);
		rescount+=strlen(name)+3;
		res = realloc(res,rescount*sizeof(char));
		strcat(res,tmp);
		strcat(res,name);
	}
	res[rescount-1] = '\0';
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %r12
testq %r12, %r12
je 0x2d13
movq 0x8(%r12), %r15
leaq -0x30(%rbp), %rdi
movq %r15, (%rdi)
callq 0x2c14
movq %r15, %rdi
callq 0x2120
movq %rax, %rbx
addl $0x4, %ebx
movslq %ebx, %rdi
callq 0x2210
movq %rax, %r14
movl $0x203a20, (%rax)       # imm = 0x203A20
movq %rax, %rdi
movq %r15, %rsi
callq 0x22b0
movq 0x18(%r12), %r13
testq %r13, %r13
je 0x2d08
leaq -0x30(%rbp), %r15
movq 0x8(%r13), %rax
movq %rax, -0x30(%rbp)
movq %r15, %rdi
callq 0x2c14
movq -0x30(%rbp), %r12
movq %r12, %rdi
callq 0x2120
addl %eax, %ebx
addl $0x3, %ebx
movslq %ebx, %rsi
movq %r14, %rdi
callq 0x2230
movq %rax, %r14
movq %rax, %rdi
callq 0x2120
movl $0x203a20, (%r14,%rax)  # imm = 0x203A20
movq %r14, %rdi
movq %r12, %rsi
callq 0x22b0
movq 0x18(%r13), %r13
testq %r13, %r13
jne 0x2cb5
movslq %ebx, %rax
movb $0x0, -0x1(%rax,%r14)
jmp 0x2d16
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/trie/postingList.c
// Function: getNodeDataPL
void getNodeDataPL(ePostingList *self, int*** info, int* infoc){
	if(self->pl==NULL) return;
	int fcounter = self->counter;
	int flcounter = 0;
	postingList1 *temp = self->pl;
	for(int i=0;i<fcounter;i++){
		flcounter += temp->linecounter;
		temp = temp->next;
	}
	if(flcounter == 0) return;
	(*info) = malloc(flcounter*sizeof(int*));
	*infoc = flcounter;
	flcounter = 0;
	temp = self->pl;
	for(int i=0;i<fcounter;i++){
		postingList2 *pl2temp = temp->pl;
		for(int j=0;j<temp->linecounter;j++){
			(*info)[flcounter + j] = malloc(2*sizeof(int));//[fileid,line]
			(*info)[flcounter + j][0] = temp->id;
			(*info)[flcounter + j][1] = pl2temp->line;
			pl2temp = pl2temp->next;
		}
		flcounter += temp->linecounter;
		temp = temp->next;
	}
	return;
}

// Assembly:
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x2e1f
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movl (%rdi), %ebx
testl %ebx, %ebx
jle 0x2e11
movq %rdx, %r12
addq $0x8, %r14
xorl %r13d, %r13d
movl %ebx, %ecx
movslq 0x4(%rax), %rdx
movslq %r13d, %r13
addq %rdx, %r13
movq 0x18(%rax), %rax
decl %ecx
jne 0x2d5f
testl %r13d, %r13d
je 0x2e11
movq %r13, %rdi
shlq $0x3, %rdi
movq %rsi, -0x38(%rbp)
callq 0x2210
movq %rax, %r15
movq -0x38(%rbp), %rax
movq %r15, (%rax)
movl %r13d, (%r12)
testl %ebx, %ebx
jle 0x2e11
xorl %ecx, %ecx
xorl %edx, %edx
movl %ebx, -0x2c(%rbp)
movq (%r14), %r14
movl 0x4(%r14), %eax
testl %eax, %eax
jle 0x2e05
movq %rcx, -0x40(%rbp)
leaq 0x20(%r14), %r13
movl %edx, -0x30(%rbp)
movslq %edx, %r12
xorl %ebx, %ebx
movq (%r13), %r13
movl $0x8, %edi
callq 0x2210
movq %rax, (%r15,%r12,8)
movl 0x10(%r14), %eax
movq -0x38(%rbp), %rcx
movq (%rcx), %r15
movq (%r15,%r12,8), %rcx
movl %eax, (%rcx)
movl (%r13), %eax
movl %eax, 0x4(%rcx)
addq $0x8, %r13
incq %rbx
movslq 0x4(%r14), %rax
incq %r12
cmpq %rax, %rbx
jl 0x2dbe
movl -0x2c(%rbp), %ebx
movq -0x40(%rbp), %rcx
movl -0x30(%rbp), %edx
addl %eax, %edx
addq $0x18, %r14
incl %ecx
cmpl %ebx, %ecx
jne 0x2da3
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/trie/trie.c
// Function: nodeDestruct
void nodeDestruct(node* self){
	if(self==NULL) return;
	ePostingListDestruct(self->myPL);
	nodeDestruct(self->next);
	nodeDestruct(self->child);
	free(self);
	self=NULL;
	return;
}

// Assembly:
testq %rdi, %rdi
je 0x2e81
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x28b1
movq 0x8(%rbx), %rdi
callq 0x2e4a
movq 0x10(%rbx), %rdi
callq 0x2e4a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2030
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/trie/trieInsertion.c
// Function: nextWord
int nextWord(char* text,char** word,int start){
	if(text==NULL) return -2;//error
	if(start>strlen(text) || start<=-1) return -2;//error or END
	while(text[start]==' ' || text[start]=='\t') start++;//skip ws
	//now in text[start] starts the word which we return
	if(text[start]=='\0') return -2;//or maybe we reached '\0'
	int temp=start;//if not return the word
	while(text[temp]!=' ' && text[temp]!='\t' && text[temp]!='\0') temp++;
	if((*word = malloc((temp-start+1)*sizeof(char)))==NULL){
		printf("Allocation Error!\n");
		return -3;
	}
	strncpy(*word,text+start,temp-start);
	(*word)[temp-start] = '\0';
	while(text[temp]==' ' || text[temp]=='\t') temp++;//again skip ws
	if(text[temp]=='\0')//if after this word we reached the end
		return -1;
	return temp;//first char to check next time
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
testq %rdi, %rdi
je 0x306e
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %r14
callq 0x2120
testl %r12d, %r12d
js 0x306e
movslq %r12d, %rcx
cmpq %rcx, %rax
jb 0x306e
movl %r12d, %r13d
addq %r13, %r14
movzbl (%r14), %eax
cmpl $0x9, %eax
je 0x2fd7
cmpl $0x20, %eax
jne 0x2fdf
incq %r13
incq %r14
jmp 0x2fc9
testl %eax, %eax
je 0x306e
xorl %ebx, %ebx
movabsq $0x100000201, %rcx      # imm = 0x100000201
cmpb $0x20, %al
ja 0x3000
movzbl %al, %eax
btq %rax, %rcx
jb 0x300a
movb 0x1(%r14,%rbx), %al
incq %rbx
jmp 0x2ff3
leal 0x1(%rbx), %eax
movslq %eax, %rdi
callq 0x2210
movq %rax, (%r15)
testq %rax, %rax
je 0x305d
movq %rax, %r12
leaq (%r14,%rbx), %r15
movslq %ebx, %rbx
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2070
movb $0x0, (%r12,%rbx)
addl %r13d, %ebx
movzbl (%r15), %eax
cmpl $0x9, %eax
je 0x304b
cmpl $0x20, %eax
jne 0x3052
incl %ebx
incq %r15
jmp 0x303d
testl %eax, %eax
jne 0x306e
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x306e
leaq 0x40ca(%rip), %rdi      # 0x712e
callq 0x20a0
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/trie/trieInsertion.c
// Function: createTrie
int createTrie(char** Doc,int lines,char* name,int id,node** trie,int sorted){
	char* word=NULL;
	int start;
	int counter = 0;
	for(int f=0;f<lines;f++){
		start=0;
		while((start = nextWord(Doc[f],&word,start))!=-2){
			insertInTrie(trie,word,f,name,id,sorted);//f=line
			counter++;
			free(word);
		}
	}
	return counter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq $0x0, -0x30(%rbp)
testl %esi, %esi
jle 0x3308
movq %rdi, %r12
movq %rdx, -0x50(%rbp)
movl %ecx, -0x34(%rbp)
movq %r8, -0x58(%rbp)
movl %r9d, -0x38(%rbp)
movl %esi, %eax
movq %rax, -0x48(%rbp)
xorl %eax, %eax
leaq -0x30(%rbp), %r13
xorl %ebx, %ebx
movq %rax, %r14
movq (%r12,%rax,8), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2f84
cmpl $-0x2, %eax
movq %r14, -0x40(%rbp)
je 0x32f9
movl %eax, %r15d
movq %r12, %r13
movq -0x30(%rbp), %r12
movq -0x58(%rbp), %rdi
movq %r12, %rsi
movq -0x40(%rbp), %r14
movl %r14d, %edx
movq -0x50(%rbp), %rcx
movl -0x34(%rbp), %r8d
movl -0x38(%rbp), %r9d
callq 0x307f
incl %ebx
movq %r12, %rdi
movq %r13, %r12
leaq -0x30(%rbp), %r13
callq 0x2030
movq (%r12,%r14,8), %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x2f84
movl %eax, %r15d
cmpl $-0x2, %eax
jne 0x32ab
movq -0x40(%rbp), %rax
incq %rax
cmpq -0x48(%rbp), %rax
jne 0x328e
jmp 0x330a
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/jobExec/fifo_fcts.c
// Function: initNames
void initNames(fifo_info **fifo,int n){
	if(fifo==NULL) return ;
	char *f1="../PantoulasStefanosProject2/jobExec/tmp/fifo1_w";
	char *f2="../PantoulasStefanosProject2/jobExec/tmp/fifo2_w";
	char *buf;
	for(int i=0;i<n;i++){
		buf = myitoa(i+1);
		(*fifo)[2*i].name = malloc((49 + itol(i+1))*sizeof(char));
		strcpy((*fifo)[2*i].name,f1);
		strcat((*fifo)[2*i].name,buf);
		(*fifo)[2*i+1].name = malloc((49 + itol(i+1))*sizeof(char));
		strcpy((*fifo)[2*i+1].name,f2);
		strcat((*fifo)[2*i+1].name,buf);
		free(buf);
	}
}

// Assembly:
testq %rdi, %rdi
sete %al
testl %esi, %esi
setle %cl
orb %al, %cl
jne 0x45bb
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %eax
shlq $0x5, %rax
movq %rax, -0x30(%rbp)
movl $0x1, %r14d
xorl %r13d, %r13d
movl %r14d, %edi
callq 0x46c9
movq %rax, %r15
movl %r14d, %edi
callq 0x469a
addl $0x31, %eax
movslq %eax, %rdi
callq 0x2210
movq (%rbx), %rcx
movq %rax, (%rcx,%r13)
movq (%rbx), %rax
movq (%rax,%r13), %rax
movups 0x2e2c(%rip), %xmm0     # 0x733a
movups %xmm0, (%rax)
xorl %r12d, %r12d
movb %r12b, 0x30(%rax)
movups 0x2e3b(%rip), %xmm0     # 0x735a
movups %xmm0, 0x20(%rax)
movups 0x2e20(%rip), %xmm0     # 0x734a
movups %xmm0, 0x10(%rax)
movq (%rbx), %rax
movq (%rax,%r13), %rdi
movq %r15, %rsi
callq 0x22b0
movl %r14d, %edi
callq 0x469a
addl $0x31, %eax
movslq %eax, %rdi
callq 0x2210
movq (%rbx), %rcx
movq %rax, 0x10(%rcx,%r13)
movq (%rbx), %rax
movq 0x10(%rax,%r13), %rax
movups 0x2e04(%rip), %xmm0     # 0x736b
movups %xmm0, (%rax)
movb %r12b, 0x30(%rax)
movups 0x2e16(%rip), %xmm0     # 0x738b
movups %xmm0, 0x20(%rax)
movups 0x2dfb(%rip), %xmm0     # 0x737b
movups %xmm0, 0x10(%rax)
movq (%rbx), %rax
movq 0x10(%rax,%r13), %rdi
movq %r15, %rsi
callq 0x22b0
movq %r15, %rdi
callq 0x2030
addq $0x20, %r13
incl %r14d
cmpq %r13, -0x30(%rbp)
jne 0x44db
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/jobExec/functions.c
// Function: read_command
int read_command(int fd,char **buf,int size){
	char c;
	int n;
	int counter=0;
	while(1){
		if((n=read(fd,&c,1)) < 0) return n;
		if(!n){
			strcpy((*buf),"_BROKEN_FIFO_");
			counter = 13;
			break;
		}
		if(counter == size){//then realloc 
			size *=2;
			(*buf) = realloc((*buf),size*sizeof(char));
		}
		if(c == '\0' || c == EOF){
			(*buf)[counter] = '\0';
			break;
		}
		else (*buf)[counter++] = c;
	}
	return counter+1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %r15d
leaq -0x29(%rbp), %rsi
movl $0x1, %edx
callq 0x2180
testl %eax, %eax
js 0x468b
xorl %r13d, %r13d
leaq -0x29(%rbp), %r12
testl %eax, %eax
je 0x4656
movl %r14d, %eax
cmpq %rax, %r13
jne 0x462b
addl %r14d, %r14d
movq (%rbx), %rdi
movslq %r14d, %rsi
callq 0x2230
movq %rax, (%rbx)
movb -0x29(%rbp), %al
leal 0x1(%rax), %ecx
cmpb $0x1, %cl
jbe 0x467b
movq (%rbx), %rcx
movb %al, (%rcx,%r13)
incq %r13
movl $0x1, %edx
movl %r15d, %edi
movq %r12, %rsi
callq 0x2180
testl %eax, %eax
jns 0x460e
jmp 0x468b
movq (%rbx), %rax
movabsq $0x5f4f4649465f4e, %rcx # imm = 0x5F4F4649465F4E
movq %rcx, 0x6(%rax)
movabsq $0x5f4e454b4f52425f, %rcx # imm = 0x5F4E454B4F52425F
movq %rcx, (%rax)
movl $0xe, %eax
jmp 0x468b
movq (%rbx), %rax
movl %r13d, %ecx
movb $0x0, (%rax,%rcx)
incl %r13d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/jobExec/functions.c
// Function: itol
int itol(int value){
	int counter=1;
	if(value<0) value*=-1;
	while((value/=10)>0) counter++;
	return counter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, %ecx
negl %ecx
cmovsl %edi, %ecx
movl $0x1, %eax
cmpl $0xa, %ecx
jb 0x46c7
movl $0xcccccccd, %edx       # imm = 0xCCCCCCCD
movl %ecx, %esi
imulq %rdx, %rsi
shrq $0x23, %rsi
incl %eax
cmpl $0x63, %ecx
movl %esi, %ecx
ja 0x46b4
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/jobExec/functions.c
// Function: myitoa
char* myitoa(int value){
	int c=itol(value);
	char *ptr = malloc((c+1)*sizeof(char));
	ptr[c--] = '\0';
	if(value == 0) ptr[0] = '0';
	while(value){
		ptr[c--] = value%10 + '0';
		value/=10;
	}
	return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
movl %edi, %eax
negl %eax
cmovsl %edi, %eax
movl $0x1, %r14d
cmpl $0xa, %eax
jb 0x4703
movl $0x1, %r14d
movl $0xcccccccd, %ecx       # imm = 0xCCCCCCCD
movl %eax, %edx
imulq %rcx, %rdx
shrq $0x23, %rdx
incl %r14d
cmpl $0x63, %eax
movl %edx, %eax
ja 0x46ef
leal 0x1(%r14), %eax
movslq %eax, %rdi
callq 0x2210
movslq %r14d, %rcx
movb $0x0, (%rax,%rcx)
testl %ebx, %ebx
je 0x4755
addq %rax, %rcx
decq %rcx
movslq %ebx, %rdx
imulq $0x66666667, %rdx, %rbx # imm = 0x66666667
movq %rbx, %rsi
shrq $0x3f, %rsi
sarq $0x22, %rbx
addl %esi, %ebx
leal (%rbx,%rbx), %esi
leal (%rsi,%rsi,4), %esi
movl %edx, %edi
subl %esi, %edi
addb $0x30, %dil
movb %dil, (%rcx)
addl $0x9, %edx
decq %rcx
cmpl $0x12, %edx
ja 0x4720
jmp 0x4758
movb $0x30, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/jobExec/functions.c
// Function: findChildPos
int findChildPos(pid_t chid,pid_t *pids,int w){
	int pos = 0;
	for(int i=0;i<w;i++)
		if(pids[i]==chid){
			pos=i;
			break;
		}
	return pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %edx, %edx
jle 0x4791
movl %edx, %ecx
xorl %eax, %eax
cmpl %edi, (%rsi,%rax,4)
je 0x4793
incq %rax
cmpq %rax, %rcx
jne 0x4784
xorl %eax, %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/jobExec/parent.c
// Function: Psighandler
void Psighandler(int sig, siginfo_t* info, void *secret){
	if(sig == SIGINT || sig == SIGTERM || sig == SIGQUIT){
		flagINT=1;
	}
	else if(sig == SIGCHLD){
		while(1){
			pid_t pid = waitpid(-1,NULL,WNOHANG);//wait for any child or ret 0
			if(pid <= 0) break;
			deadCHILD[deadChildCounter++] = pid;//save what you find
		}
	}
	else if(sig == SIGPIPE){}//ignore it
}

// Assembly:
leal -0x2(%rdi), %eax
cmpl $0x2, %eax
jb 0x4c17
cmpl $0xf, %edi
je 0x4c17
cmpl $0x11, %edi
jne 0x4c21
pushq %rbp
movq %rsp, %rbp
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl $0x1, %edx
callq 0x2260
testl %eax, %eax
jle 0x4c22
movq 0x55ce(%rip), %rcx      # 0xa1d0
movslq 0x55c3(%rip), %rdx      # 0xa1cc
leal 0x1(%rdx), %esi
movl %esi, 0x55ba(%rip)      # 0xa1cc
movl %eax, (%rcx,%rdx,4)
jmp 0x4be6
movl $0x1, 0x55a7(%rip)      # 0xa1c8
retq
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/jobExec/PCOptions.c
// Function: decode_plus
void decode_plus(char* buffer,int *bytes,int *words,int *lines){//for WC
	if(buffer==NULL) return;
	int start;
	char* word = NULL;
	start = nextWord(buffer,&word,0);//read bytes
	*bytes += atoi(word);
	free(word);
	word = NULL;
	start = nextWord(buffer,&word,start);
	*words += atoi(word);
	free(word);
	word = NULL;
	start = nextWord(buffer,&word,start);
	*lines += atoi(word);
	free(word);
	word = NULL;
	if(start != -1) printf("Unexpected result!(%s)\n",buffer);
	return;
}

// Assembly:
testq %rdi, %rdi
je 0x626f
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r13
movq %rdi, %rbx
xorl %eax, %eax
leaq -0x40(%rbp), %r15
movq %rax, (%r15)
movq %r15, %rsi
movq %rdx, -0x30(%rbp)
xorl %edx, %edx
movq %rcx, -0x38(%rbp)
callq 0x2f84
movl %eax, %r14d
movq (%r15), %r12
movq %r12, %rdi
callq 0x22a0
addl %eax, (%r13)
movq %r12, %rdi
callq 0x2030
xorl %r13d, %r13d
movq %r13, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x2f84
movl %eax, %r14d
movq (%r15), %r12
movq %r12, %rdi
callq 0x22a0
movq -0x30(%rbp), %rcx
addl %eax, (%rcx)
movq %r12, %rdi
callq 0x2030
movq %r13, (%r15)
xorl %r13d, %r13d
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x2f84
movl %eax, %r14d
movq (%r15), %r12
movq %r12, %rdi
callq 0x22a0
movq -0x38(%rbp), %rcx
addl %eax, (%rcx)
movq %r12, %rdi
callq 0x2030
movq %r13, (%r15)
cmpl $-0x1, %r14d
je 0x6261
leaq 0x1453(%rip), %rdi      # 0x76aa
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2130
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/jobExec/PCOptions.c
// Function: decode_MAX
void decode_MAX(char* buffer,char** myname,int *maxcounter){//for MAXCOUNT
	if(!strcmp(buffer,"-")) return;//no result from child
	char* name;
	char* word;
	int counter;
	int start = nextWord(buffer,&word,0);
	int name_len = strlen(word) + 1;
	name = malloc(name_len*sizeof(char));
	strcpy(name,word);
	free(word);
	while((start = nextWord(buffer,&word,start)) != -1){//name maybe has spaces
		name_len += strlen(word) + 2;
		name = realloc(name,name_len*sizeof(char));
		strcat(name," ");
		strcat(name,word);
		free(word);
	}
	counter = atoi(word);
	free(word);
	if(counter>*maxcounter || (counter==*maxcounter && strcmp(name,*myname)<0)){
		*maxcounter = counter;
		if(*myname != NULL) free(*myname);
		*myname = name;
	}
	else free(name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r12
cmpb $0x2d, (%rdi)
jne 0x6295
cmpb $0x0, 0x1(%r12)
je 0x63ae
movq %rdx, -0x40(%rbp)
movq %rsi, -0x38(%rbp)
leaq -0x30(%rbp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2f84
movl %eax, %r14d
movq (%rbx), %rbx
movq %rbx, %rdi
callq 0x2120
movq %rax, %r13
incl %r13d
movslq %r13d, %rdi
callq 0x2210
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2080
movq %rbx, %rdi
callq 0x2030
movq %r12, %rdi
leaq -0x30(%rbp), %rsi
movl %r14d, %edx
callq 0x2f84
cmpl $-0x1, %eax
je 0x634e
movl %eax, %ebx
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x2120
addl %eax, %r13d
addl $0x2, %r13d
movslq %r13d, %rsi
movq %r15, %rdi
callq 0x2230
movq %rax, %r15
movq %rax, %rdi
callq 0x2120
movw $0x20, (%r15,%rax)
movq %r15, %rdi
movq %r14, %rsi
callq 0x22b0
movq %r14, %rdi
callq 0x2030
movq %r12, %rdi
leaq -0x30(%rbp), %rsi
movl %ebx, %edx
callq 0x2f84
movl %eax, %ebx
cmpl $-0x1, %eax
jne 0x62f6
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x22a0
movl %eax, %ebx
movq %r14, %rdi
callq 0x2030
movq -0x40(%rbp), %r13
cmpl (%r13), %ebx
jle 0x638d
movq -0x38(%rbp), %r12
movq (%r12), %r14
movl %ebx, (%r13)
testq %r14, %r14
je 0x6387
movq %r14, %rdi
callq 0x2030
movq %r15, (%r12)
jmp 0x63ae
movq -0x38(%rbp), %r12
jne 0x63a6
movq (%r12), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x2190
testl %eax, %eax
js 0x6376
movq %r15, %rdi
callq 0x2030
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/jobExec/PCOptions.c
// Function: decode_MIN
void decode_MIN(char* buffer,char** myname,int *mincounter){//for MINCOUNT
	if(!strcmp(buffer,"-")) return;//no result from child
	char *name;
	char* word;
	int counter;	
	int start = nextWord(buffer,&word,0);
	int name_len = strlen(word) + 1;
	name = malloc(name_len*sizeof(char));
	strcpy(name,word);
	free(word);
	while((start = nextWord(buffer,&word,start)) != -1){//name maybe has spaces
		name_len += strlen(word) + 2;
		name = realloc(name,name_len*sizeof(char));
		strcat(name," ");
		strcat(name,word);
		free(word);
	}
	counter = atoi(word);
	free(word);
	if(counter<*mincounter || *mincounter==-1 || (counter==*mincounter && strcmp(name,*myname)<0)){
		*mincounter = counter;
		if(*myname != NULL) free(*myname);
		*myname = name;
	}
	else free(name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r12
cmpb $0x2d, (%rdi)
jne 0x63e2
cmpb $0x0, 0x1(%r12)
je 0x650a
movq %rdx, -0x40(%rbp)
movq %rsi, -0x38(%rbp)
leaq -0x30(%rbp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2f84
movl %eax, %r14d
movq (%rbx), %rbx
movq %rbx, %rdi
callq 0x2120
movq %rax, %r13
incl %r13d
movslq %r13d, %rdi
callq 0x2210
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2080
movq %rbx, %rdi
callq 0x2030
movq %r12, %rdi
leaq -0x30(%rbp), %rsi
movl %r14d, %edx
callq 0x2f84
cmpl $-0x1, %eax
je 0x649b
movl %eax, %ebx
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x2120
addl %eax, %r13d
addl $0x2, %r13d
movslq %r13d, %rsi
movq %r15, %rdi
callq 0x2230
movq %rax, %r15
movq %rax, %rdi
callq 0x2120
movw $0x20, (%r15,%rax)
movq %r15, %rdi
movq %r14, %rsi
callq 0x22b0
movq %r14, %rdi
callq 0x2030
movq %r12, %rdi
leaq -0x30(%rbp), %rsi
movl %ebx, %edx
callq 0x2f84
movl %eax, %ebx
cmpl $-0x1, %eax
jne 0x6443
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x22a0
movl %eax, %ebx
movq %r14, %rdi
callq 0x2030
movq -0x40(%rbp), %r13
movl (%r13), %eax
cmpl %eax, %ebx
setl %cl
cmpl $-0x1, %eax
sete %dl
orb %cl, %dl
je 0x64e7
movq -0x38(%rbp), %r12
movq (%r12), %r14
movl %ebx, (%r13)
testq %r14, %r14
je 0x64e1
movq %r14, %rdi
callq 0x2030
movq %r15, (%r12)
jmp 0x650a
cmpl %eax, %ebx
movq -0x38(%rbp), %r12
jne 0x6502
movq (%r12), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x2190
testl %eax, %eax
js 0x64d0
movq %r15, %rdi
callq 0x2030
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/jobExec/PCOptions.c
// Function: searchWordInTrie
nc_pair* searchWordInTrie(node* trie,char* word,int sorted,int max){//for min/maxcount
	int i=0;//character's index
	char c = word[i];
	node* temp=trie;
	int flag=1;
	//flag:if temp->next==NULL then create new next

	nc_pair* p = malloc(sizeof(nc_pair));
	p->name = NULL;//means word not exists
	p->counter = -1;

	while(1){//for all word's chars(has at least 1 char)
		while(1){//for all childs in temp's list(temp -> next -> next -> ...)
			if(c==getValue(temp)){
				flag=0;
				break;//check next char
			}
			else if((c<getValue(temp))&&sorted) break;
			if(getNext(temp)==NULL) return p;//word doesn't exists in trie :(
			temp = getNext(temp);//search until c found in trie
		}//or we reached the end of temp's list
		if(flag)//c not found in trie...exiting
			return p;

		//now temp has the 'c' value so we check its child
		if((c=word[++i])=='\0'){
			if(max)
				getMaxCounterEPL(temp,&(p->name),&(p->counter));
			else
				getMinCounterEPL(temp,&(p->name),&(p->counter));
			return p;
		}
		if(getChild(temp)==NULL) return p;//word not found
		temp=getChild(temp);//else continue with child
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, -0x34(%rbp)
movl %edx, %r13d
movq %rdi, %r12
movq %rsi, -0x48(%rbp)
movb (%rsi), %r15b
movl $0x10, %edi
callq 0x2210
movq $0x0, (%rax)
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq %rax, -0x30(%rbp)
addq $0x8, %rax
movq %rax, -0x40(%rbp)
xorl %ebx, %ebx
xorl %r14d, %r14d
movq %r12, %rdi
callq 0x2e8b
cmpb %al, %r15b
je 0x65a5
movq %r12, %rdi
callq 0x2e8b
testl %r13d, %r13d
je 0x6582
cmpb %al, %r15b
jl 0x659f
movq %r12, %rdi
callq 0x2e9d
testq %rax, %rax
je 0x65fb
movq %r12, %rdi
callq 0x2e9d
movq %rax, %r12
movq %rax, %rdi
jmp 0x6566
testb $0x1, %r14b
je 0x65fb
movq -0x48(%rbp), %rax
movb 0x1(%rax,%rbx), %r15b
testb %r15b, %r15b
je 0x65d3
movq %r12, %rdi
callq 0x2eb1
testq %rax, %rax
je 0x65fb
incq %rbx
movq %r12, %rdi
callq 0x2eb1
movq %rax, %r12
movb $0x1, %r14b
jmp 0x6563
cmpl $0x0, -0x34(%rbp)
je 0x65eb
movq %r12, %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x2ebb
jmp 0x65fb
movq %r12, %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x2ed5
movq -0x30(%rbp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/PantoulasStefanosProject2/jobExec/PCOptions.c
// Function: getWordLastNode
node* getWordLastNode(node* trie,char* word,int sorted){//for search - child
	int i=0;//character's index
	char c = word[i];
	node* temp=trie;
	int flag=1;
	//flag:if temp->next==NULL then create new next

	while(1){//for all word's chars(has at least 1 char)
		while(1){//for all childs in temp's list(temp -> next -> next -> ...)
			if(c==getValue(temp)){
				flag=0;
				break;//check next char
			}
			else if((c<getValue(temp))&&sorted) break;
			if(getNext(temp)==NULL) return NULL;//word doesn't exists in trie :(
			temp = getNext(temp);//search until c found in trie
		}//or we reached the end of temp's list
		if(flag)//c not found in trie...exiting
			return NULL;
		//now temp has the 'c' value so we check its child
		if((c=word[++i])=='\0'){
			if(getCounterEPL(temp)==0) return NULL;//word found but is subword in trie
			return temp;
		}
		if(getChild(temp)==NULL) return NULL;//word not found
		temp=getChild(temp);//else continue with child
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rdi, %r14
movq %rsi, -0x30(%rbp)
movb (%rsi), %bl
xorl %r13d, %r13d
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x2e8b
cmpb %al, %bl
je 0x666e
movq %r14, %rdi
callq 0x2e8b
testl %r15d, %r15d
je 0x664b
cmpb %al, %bl
jl 0x6668
movq %r14, %rdi
callq 0x2e9d
testq %rax, %rax
je 0x669b
movq %r14, %rdi
callq 0x2e9d
movq %rax, %r14
movq %rax, %rdi
jmp 0x6631
testb $0x1, %r12b
je 0x669b
movq -0x30(%rbp), %rax
movb 0x1(%rax,%r13), %bl
movq %r14, %rdi
testb %bl, %bl
je 0x66af
callq 0x2eb1
testq %rax, %rax
je 0x669b
incq %r13
movq %r14, %rdi
callq 0x2eb1
movq %rax, %r14
movb $0x1, %r12b
jmp 0x662e
xorl %ecx, %ecx
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2eef
xorl %ecx, %ecx
testl %eax, %eax
cmovneq %r14, %rcx
jmp 0x669d
// File: /workspace/github_c_makefile_star2_O3/chrispanag[P]operating-systems-scheduler/shell.c
// Function: issue_request
void issue_request(int wfd, int rfd, struct request_struct *rq)
{
	int ret;

	/* Issue the request */
	fprintf(stderr, "Shell: issuing request...\n");
	if (write(wfd, rq, sizeof(*rq)) != sizeof(*rq)) {
		perror("Shell: write request struct");
		exit(1);
	}

	/* Block until a reply has been received */
	fprintf(stderr, "Shell: receiving request return value...\n");

	if (read(rfd, &ret, sizeof(ret)) != sizeof(ret)) {
		perror("Shell: read request return value");
		exit(1);
	}

	if(ret < 0){
		fprintf(stderr, "Shell: request return value ret = %d\n", ret);
		fprintf(stderr, "       %s\n", strerror(-ret));
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebx
movl %edi, %ebp
movq 0x2e43(%rip), %r15      # 0x3ff8
movq (%r15), %rcx
leaq 0xed5(%rip), %rdi       # 0x2094
pushq $0x1a
popq %rsi
pushq $0x1
popq %rdx
callq 0x1160
pushq $0x44
popq %rdx
movl %ebp, %edi
movq %r14, %rsi
callq 0x1050
cmpq $0x44, %rax
jne 0x1257
movq (%r15), %rcx
leaq 0xee4(%rip), %rdi       # 0x20cb
pushq $0x29
popq %rsi
pushq $0x1
popq %rdx
callq 0x1160
leaq 0x4(%rsp), %rsi
pushq $0x4
popq %rdx
movl %ebx, %edi
callq 0x10c0
cmpq $0x4, %rax
jne 0x126b
movl 0x4(%rsp), %ebx
testl %ebx, %ebx
js 0x121a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rdi
leaq 0xef2(%rip), %rsi       # 0x2116
movl %ebx, %edx
xorl %eax, %eax
callq 0x10e0
movq (%r15), %r14
negl %ebx
movl %ebx, %edi
callq 0x1170
leaq 0xefc(%rip), %rsi       # 0x213c
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x10e0
leaq 0xe51(%rip), %rdi       # 0x20af
callq 0x1120
pushq $0x1
popq %rdi
callq 0x1150
leaq 0xe83(%rip), %rdi       # 0x20f5
jmp 0x125e
// File: /workspace/github_c_makefile_star2_O3/chrispanag[P]operating-systems-scheduler/shell.c
// Function: get_cmdline
void get_cmdline(FILE *fp, char *buf, int bufsz)
{
	if (fgets(buf, bufsz, fp) == NULL) {
		fprintf(stderr, "Shell: could not read command line, exiting.\n");
		exit(1);
	}
	if (buf[strlen(buf) - 1] == '\n')
		buf[strlen(buf) - 1] = '\0';
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movq %rdi, %rax
movq %rsi, %rdi
movl %edx, %esi
movq %rax, %rdx
callq 0x10d0
testq %rax, %rax
je 0x14db
movq %rbx, %rdi
callq 0x1070
cmpb $0xa, -0x1(%rbx,%rax)
jne 0x14d9
movb $0x0, -0x1(%rbx,%rax)
popq %rbx
retq
callq 0x1274
// File: /workspace/github_c_makefile_star2_O3/chrispanag[P]operating-systems-scheduler/shell.c
// Function: main
int main(int argc, char *argv[])
{
	int rfd, wfd;
	char cmdline[SHELL_CMDLINE_SZ];

	/*
	 * Communication with the scheduler happens over two UNIX pipes.
	 *
	 * The scheduler first creates the pipes, then execve()s the shell
	 * program. It passes two file descriptors as command-line arguments:
	 *
	 * argument 1: wfd: the file descriptor to write request structures into.
	 * argument 2: rfd: the file descriptor to read request return values from.
	 */

	if (argc != 3) {
		fprintf(stderr, "Shell: must be called with exactly two arguments.\n");
		exit(1);
	}

	wfd = atoi(argv[1]);
	rfd = atoi(argv[2]);
	if (!wfd || !rfd) {
		fprintf(stderr, "Shell: descriptors must be non-zero: wfd = %d, rfd = %d\n",
			wfd, rfd);
		exit(1);
	}

	/*
	 * Forever: show the prompt, read a command line, then process it.
	 */
	printf("\nThis is the Shell. Welcome.\n\n");

	for (;;) {
		printf("Shell> ");
		fflush(stdout);
		get_cmdline(stdin, cmdline, SHELL_CMDLINE_SZ);
		process_cmdline(cmdline, wfd, rfd);
	}

	/* Unreachable */
	fprintf(stderr, "Shell: reached unreachable point.\n");
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
cmpl $0x3, %edi
jne 0x16f4
movq %rsi, %r14
movq 0x8(%rsi), %rdi
callq 0x1140
movl %eax, %ebx
movq 0x10(%r14), %rdi
callq 0x1140
movl %eax, %ebp
testl %ebx, %ebx
je 0x1716
testl %ebp, %ebp
je 0x1716
leaq 0xc78(%rip), %rdi       # 0x231d
callq 0x1040
leaq 0xb66(%rip), %r14       # 0x2217
movq 0x2918(%rip), %r12      # 0x3fd0
movq 0x2919(%rip), %r13      # 0x3fd8
movq %rsp, %r15
movq %r14, %rdi
xorl %eax, %eax
callq 0x10a0
movq (%r12), %rdi
callq 0x1100
movq (%r13), %rdi
movq %r15, %rsi
movl $0x64, %edx
callq 0x14ac
movq %r15, %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x14ec
jmp 0x16c2
movq 0x28fd(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xaa6(%rip), %rdi       # 0x21ab
movl $0x32, %esi
movl $0x1, %edx
callq 0x1160
jmp 0x1732
movq 0x28db(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xab7(%rip), %rsi       # 0x21de
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x10e0
movl $0x1, %edi
callq 0x1150
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/kvlds-dump/main.c
// Function: callback_pair
static int
callback_pair(void * cookie,
    const struct kvldskey * key, const struct kvldskey * value)
{
	struct dumpstate * C = cookie;
	char kvnum[17];

	/* Filesystem or stdout? */
	if (C->tofs) {
		sprintf(kvnum, "%016" PRIx64, C->N);
		if (mkdir(kvnum, 0700)) {
			warnp("mkdir(%s)", kvnum);
			goto err0;
		}
		if (writefile(kvnum, "k", key))
			goto err0;
		if (writefile(kvnum, "v", value))
			goto err0;
	} else {
		if (fwrite(&key->len, 1, 1, stdout) != 1)
			goto err0;
		if (fwrite(key->buf, key->len, 1, stdout) != 1)
			goto err0;
		if (fwrite(&value->len, 1, 1, stdout) != 1)
			goto err0;
		if (fwrite(value->buf, value->len, 1, stdout) != 1)
			goto err0;
	}

	/* Done another key-value pair. */
	C->N++;

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
cmpl $0x0, (%rdi)
je 0x2f5b
movq 0x8(%rbx), %rdx
leaq 0xa341(%rip), %rsi      # 0xd24d
movq %rsp, %r12
movq %r12, %rdi
xorl %eax, %eax
callq 0x2300
movq %r12, %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x20d0
testl %eax, %eax
je 0x2fe5
callq 0x20a0
cmpl $0x0, (%rax)
je 0x301e
movq %rax, %rbx
leaq 0x929c(%rip), %rdi      # 0xc1e2
movq %rsp, %rsi
xorl %eax, %eax
callq 0x3c3c
movl $0x0, (%rbx)
jmp 0x302f
movq 0xf076(%rip), %r12      # 0x11fd8
movq (%r12), %rcx
movl $0x1, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2330
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq $0x1, %rax
jne 0x3034
movzbl (%r15), %esi
incq %r15
movq (%r12), %rcx
movl $0x1, %edx
movq %r15, %rdi
callq 0x2330
cmpq $0x1, %rax
jne 0x3034
movq (%r12), %rcx
movl $0x1, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x2330
cmpq $0x1, %rax
jne 0x3034
movzbl (%r14), %esi
incq %r14
movq (%r12), %rcx
movl $0x1, %edx
movq %r14, %rdi
callq 0x2330
cmpq $0x1, %rax
je 0x3016
jmp 0x3034
leaq 0x9200(%rip), %rsi      # 0xc1ec
movq %rsp, %rdi
movq %r15, %rdx
callq 0x3043
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x3034
leaq 0x9085(%rip), %rsi      # 0xc08c
movq %rsp, %rdi
movq %r14, %rdx
callq 0x3043
testl %eax, %eax
jne 0x3034
incq 0x8(%rbx)
xorl %ebp, %ebp
jmp 0x3034
leaq 0x91bd(%rip), %rdi      # 0xc1e2
movq %rsp, %rsi
xorl %eax, %eax
callq 0x3d5b
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/kvlds-dump/main.c
// Function: writefile
static int
writefile(const char * dir, const char * fname, const struct kvldskey * v)
{
	char * s;
	FILE * f;

	/* Construct file name. */
	if (asprintf(&s, "%s/%s", dir, fname) == -1) {
		warnp("asprintf");
		goto err0;
	}

	/* Open file. */
	if ((f = fopen(s, "wb")) == NULL) {
		warnp("fopen(%s)", s);
		goto err1;
	}

	/* Write value. */
	if (fwrite(v->buf, v->len, 1, f) != 1) {
		warnp("fwrite(%s)", s);
		goto err2;
	}

	/* Close file and free file name. */
	if (fclose(f))
		warnp("fclose");
	free(s);

	/* Success! */
	return (0);

err2:
	if (fclose(f))
		warnp("fclose");
err1:
	free(s);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rcx
movq %rdi, %rdx
leaq 0x9197(%rip), %rsi      # 0xc1ee
movq %rsp, %rdi
xorl %eax, %eax
callq 0x31e4
cmpl $-0x1, %eax
je 0x30dd
movq (%rsp), %rdi
leaq 0x918c(%rip), %rsi      # 0xc1fd
callq 0x22d0
testq %rax, %rax
je 0x3103
movq %rax, %rbx
movzbl (%r14), %esi
incq %r14
movl $0x1, %edx
movq %r14, %rdi
movq %rax, %rcx
callq 0x2330
cmpq $0x1, %rax
jne 0x312d
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x31b3
callq 0x20a0
cmpl $0x0, (%rax)
je 0x31a5
movq %rax, %rbx
leaq 0x914a(%rip), %rdi      # 0xc215
xorl %eax, %eax
callq 0x3c3c
movl $0x0, (%rbx)
jmp 0x31b3
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3155
movq %rax, %rbx
leaq 0x9103(%rip), %rdi      # 0xc1f4
xorl %eax, %eax
callq 0x3c3c
movl $0x0, (%rbx)
jmp 0x31d7
callq 0x20a0
cmpl $0x0, (%rax)
movq (%rsp), %rsi
je 0x3165
movq %rax, %rbx
leaq 0x90e5(%rip), %rdi      # 0xc200
xorl %eax, %eax
callq 0x3c3c
movl $0x0, (%rbx)
jmp 0x31ce
callq 0x20a0
movq %rax, %r14
cmpl $0x0, (%rax)
movq (%rsp), %rsi
leaq 0x90c7(%rip), %rdi      # 0xc20a
je 0x3175
xorl %eax, %eax
callq 0x3c3c
movl $0x0, (%r14)
jmp 0x317c
leaq 0x9098(%rip), %rdi      # 0xc1f4
xorl %eax, %eax
callq 0x3d5b
jmp 0x31d7
leaq 0x9094(%rip), %rdi      # 0xc200
xorl %eax, %eax
callq 0x3d5b
jmp 0x31ce
xorl %eax, %eax
callq 0x3d5b
movq %rbx, %rdi
callq 0x2120
testl %eax, %eax
je 0x31ce
cmpl $0x0, (%r14)
je 0x31c0
leaq 0x9080(%rip), %rdi      # 0xc215
xorl %eax, %eax
callq 0x3c3c
movl $0x0, (%r14)
jmp 0x31ce
leaq 0x9069(%rip), %rdi      # 0xc215
xorl %eax, %eax
callq 0x3d5b
movq (%rsp), %rdi
callq 0x2040
xorl %eax, %eax
jmp 0x31dc
leaq 0x904e(%rip), %rdi      # 0xc215
xorl %eax, %eax
callq 0x3d5b
movq (%rsp), %rdi
callq 0x2040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/util/kivaloo.c
// Function: kivaloo_open
void *
kivaloo_open(const char * addr, struct wire_requestqueue ** Q)
{
	struct kivaloo_cookie * K;

	/* Allocate a cookie. */
	if ((K = malloc(sizeof(struct kivaloo_cookie))) == NULL)
		goto err0;

	/* Resolve the target address. */
	if ((K->sas = sock_resolve(addr)) == NULL) {
		warnp("Error resolving socket address: %s", addr);
		goto err1;
	}
	if (K->sas[0] == NULL) {
		warn0("No addresses found for %s", addr);
		goto err2;
	}

	/* Open a connection to it. */
	if ((K->s = sock_connect(K->sas)) == -1)
		goto err2;

	/* Create a request queue. */
	if ((K->Q = wire_requestqueue_init(K->s)) == NULL) {
		warnp("Cannot create request queue");
		goto err3;
	}

	/* Return the request queue and cookie. */
	*Q = K->Q;
	return (K);

err3:
	if (close(K->s))
		warnp("close");
err2:
	sock_addr_freelist(K->sas);
err1:
	free(K);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r12
movq %rdi, %r15
movl $0x18, %edi
callq 0x2240
testq %rax, %rax
je 0x4087
movq %rax, %rbx
movq %r15, %rdi
callq 0x5a24
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x4021
movq %rax, %r14
cmpq $0x0, (%rax)
je 0x4048
movq %r14, %rdi
callq 0x633c
movl %eax, 0x8(%rbx)
cmpl $-0x1, %eax
je 0x4064
movl %eax, %ebp
movl %eax, %edi
callq 0x7ee8
movq %rax, (%rbx)
testq %rax, %rax
je 0x4095
movq %rax, (%r12)
jmp 0x4089
callq 0x20a0
cmpl $0x0, (%rax)
je 0x406e
movq %rax, %r14
leaq 0x85b5(%rip), %rdi      # 0xc5ea
movq %r15, %rsi
xorl %eax, %eax
callq 0x3c3c
movl $0x0, (%r14)
jmp 0x407f
leaq 0x85be(%rip), %rdi      # 0xc60d
movq %r15, %rsi
xorl %eax, %eax
callq 0x3d5b
callq 0x20a0
movl $0x0, (%rax)
movq %r14, %rdi
callq 0x6136
jmp 0x407f
leaq 0x8575(%rip), %rdi      # 0xc5ea
movq %r15, %rsi
xorl %eax, %eax
callq 0x3d5b
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x20a0
movq %rax, %r15
cmpl $0x0, (%rax)
je 0x40b9
leaq 0x857e(%rip), %rdi      # 0xc627
xorl %eax, %eax
callq 0x3c3c
movl $0x0, (%r15)
jmp 0x40c7
leaq 0x8567(%rip), %rdi      # 0xc627
xorl %eax, %eax
callq 0x3d5b
movl %ebp, %edi
callq 0x21c0
testl %eax, %eax
je 0x4064
cmpl $0x0, (%r15)
je 0x40f2
leaq 0x8137(%rip), %rdi      # 0xc216
xorl %eax, %eax
callq 0x3c3c
movl $0x0, (%r15)
jmp 0x4064
leaq 0x811d(%rip), %rdi      # 0xc216
xorl %eax, %eax
callq 0x3d5b
jmp 0x4064
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/util/kivaloo.c
// Function: kivaloo_close
void
kivaloo_close(void * cookie)
{
	struct kivaloo_cookie * K = cookie;

	/* Shut down the request queue. */
	wire_requestqueue_destroy(K->Q);
	wire_requestqueue_free(K->Q);

	/* Close the socket. */
	if (close(K->s))
		warnp("close");

	/* Free socket addresses. */
	sock_addr_freelist(K->sas);

	/* Free our cookie. */
	free(K);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x85d9
movq (%rbx), %rdi
callq 0x85ed
movl 0x8(%rbx), %edi
callq 0x21c0
testl %eax, %eax
je 0x415a
callq 0x20a0
cmpl $0x0, (%rax)
je 0x414c
movq %rax, %r14
leaq 0x80da(%rip), %rdi      # 0xc216
xorl %eax, %eax
callq 0x3c3c
movl $0x0, (%r14)
jmp 0x415a
leaq 0x80c3(%rip), %rdi      # 0xc216
xorl %eax, %eax
callq 0x3d5b
movq 0x10(%rbx), %rdi
callq 0x6136
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2040
nop
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/util/kvlds.c
// Function: kvlds_multiset
int
kvlds_multiset(struct wire_requestqueue * Q,
    int (* callback_pair)(void *, struct kvldskey **, struct kvldskey **),
    void * cookie)
{
	struct multisetcookie C = {
		.Q = Q,
		.callback = callback_pair,
		.cookie = cookie,
		.inflight = 0,
		.eof = 0,
		.failed = 0,
		.done = 0
	};

	/* Start sending requests. */
	if (multiset_send(&C))
		goto err0;

	/* Wait until we've finished. */
	if (events_spin(&C.done)) {
		warnp("Error running event loop");
		goto err0;
	}

	/* Did we succeed? */
	return (C.failed);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
leaq 0x8(%rsp), %rax
movq %rdi, (%rax)
movq %rsi, 0x8(%rax)
movq %rdx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movl $0x0, 0x28(%rax)
movq %rax, %rdi
callq 0x41fc
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x41b4
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
leaq 0x30(%rsp), %rdi
callq 0x4879
testl %eax, %eax
je 0x41e6
callq 0x20a0
cmpl $0x0, (%rax)
je 0x41ec
movq %rax, %r14
leaq 0x846d(%rip), %rdi      # 0xc643
xorl %eax, %eax
callq 0x3c3c
movl $0x0, (%r14)
jmp 0x41aa
movl 0x2c(%rsp), %ebx
jmp 0x41aa
leaq 0x8450(%rip), %rdi      # 0xc643
xorl %eax, %eax
callq 0x3d5b
jmp 0x41aa
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/util/kvlds.c
// Function: multiset_send
static int
multiset_send(struct multisetcookie * C)
{
	struct kvldskey * key;
	struct kvldskey * value;

	/* If we've hit EOF, there's nothing to do. */
	if (C->eof)
		goto done;

	/* If requests are failing, there's nothing to do. */
	if (C->failed)
		goto done;

	/* Send requests as long as we don't have too many in flight. */
	while (C->inflight < 4096) {
		if ((C->callback)(C->cookie, &key, &value)) {
			/* Failing to get more key-value pairs. */
			C->failed = 1;
			goto done;
		}

		/* Are we at EOF? */
		if (key == NULL) {
			C->eof = 1;
			goto done;
		}

		/* Store this key-value pair. */
		if (proto_kvlds_request_set(C->Q, key, value,
		    callback_multiset, C)) {
			warnp("proto_kvlds_request_set");
			C->failed = 1;
			goto err0;
		}

		/* Another request is in flight. */
		C->inflight += 1;

		/* Free the key and value. */
		kvldskey_free(key);
		kvldskey_free(value);
	}

done:
	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
xorl %ebp, %ebp
cmpl $0x0, 0x20(%rdi)
jne 0x42e2
movq %rdi, %rbx
cmpl $0x0, 0x24(%rdi)
jne 0x42e2
cmpq $0xfff, 0x18(%rbx)      # imm = 0xFFF
ja 0x42e2
leaq 0x8(%rsp), %r14
movq %rsp, %r15
leaq 0x34f(%rip), %r12       # 0x458d
movq 0x10(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *0x8(%rbx)
testl %eax, %eax
jne 0x4292
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
je 0x429b
movq (%rbx), %rdi
movq (%rsp), %rdx
movq %r12, %rcx
movq %rbx, %r8
callq 0x6b19
testl %eax, %eax
jne 0x42a4
incq 0x18(%rbx)
movq 0x8(%rsp), %rdi
callq 0x2040
movq (%rsp), %rdi
callq 0x2040
cmpq $0x1000, 0x18(%rbx)     # imm = 0x1000
jb 0x423e
jmp 0x42e2
movl $0x1, 0x24(%rbx)
jmp 0x42e2
movl $0x1, 0x20(%rbx)
jmp 0x42e2
callq 0x20a0
cmpl $0x0, (%rax)
je 0x42c8
movq %rax, %r14
leaq 0x83bf(%rip), %rdi      # 0xc677
xorl %eax, %eax
callq 0x3c3c
movl $0x0, (%r14)
jmp 0x42d6
leaq 0x83a8(%rip), %rdi      # 0xc677
xorl %eax, %eax
callq 0x3d5b
movl $0x1, 0x24(%rbx)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq