LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/gluethread/glthread.c
// Function: remove_glthread
void
remove_glthread(glthread_t *curr_glthread){
    
    if(!curr_glthread->left){
        if(curr_glthread->right){
            curr_glthread->right->left = NULL;
            curr_glthread->right = 0;
            return;
        }
        return;
    }
    if(!curr_glthread->right){
        curr_glthread->left->right = NULL;
        curr_glthread->left = NULL;
        return;
    }

    curr_glthread->left->right = curr_glthread->right;
    curr_glthread->right->left = curr_glthread->left;
    curr_glthread->left = 0;
    curr_glthread->right = 0;
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
testq %rcx, %rcx
je 0x701d
testq %rax, %rax
je 0x702c
movq %rax, 0x8(%rcx)
movq 0x8(%rdi), %rax
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
retq
testq %rax, %rax
je 0x701c
xorl %ecx, %ecx
movq %rcx, (%rax)
movq %rcx, 0x8(%rdi)
retq
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rax, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/gluethread/glthread.c
// Function: glthread_add_last
void
glthread_add_last(glthread_t *glthread_head, glthread_t *new_glthread){

    glthread_t *glthreadptr = NULL,
               *prevglthreadptr = NULL;
    
    ITERATE_GLTHREAD_BEGIN(glthread_head, glthreadptr){
        prevglthreadptr = glthreadptr;
    } ITERATE_GLTHREAD_END(glthread_head, glthreadptr);
  
    if(prevglthreadptr) 
        glthread_add_next(prevglthreadptr, new_glthread); 
    else
        glthread_add_next(glthread_head, new_glthread);
}

// Assembly:
xorl %edx, %edx
movq %rdi, %rax
movq %rdx, %rcx
movq 0x8(%rax), %rax
movq %rax, %rdx
testq %rax, %rax
jne 0x7058
testq %rcx, %rcx
je 0x7079
movq 0x8(%rcx), %rax
movq %rsi, 0x8(%rcx)
movq %rcx, (%rsi)
jmp 0x7084
movq 0x8(%rdi), %rax
movq %rsi, 0x8(%rdi)
movq %rdi, (%rsi)
testq %rax, %rax
je 0x7090
movq %rax, 0x8(%rsi)
movq %rsi, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/gluethread/glthread.c
// Function: glthread_priority_insert
void
glthread_priority_insert(glthread_t *glthread_head, 
                         glthread_t *glthread,
                         int (*comp_fn)(void *, void *),
                         int offset){


    glthread_t *curr = NULL,
               *prev = NULL;

    init_glthread(glthread);

    if(IS_GLTHREAD_LIST_EMPTY(glthread_head)){
        glthread_add_next(glthread_head, glthread);
        return;
    }

    /* Only one node*/
    if(glthread_head->right && !glthread_head->right->right){
        if(comp_fn(GLTHREAD_GET_USER_DATA_FROM_OFFSET(glthread, offset),
            GLTHREAD_GET_USER_DATA_FROM_OFFSET(glthread_head->right, offset)) == -1){
            glthread_add_next(glthread_head, glthread);
        }
        else{
            glthread_add_next(glthread_head->right, glthread);
        }
        return;
    }

    ITERATE_GLTHREAD_BEGIN(glthread_head, curr){

        if(comp_fn(GLTHREAD_GET_USER_DATA_FROM_OFFSET(glthread, offset), 
                GLTHREAD_GET_USER_DATA_FROM_OFFSET(curr, offset)) != -1){
            prev = curr;
            continue;
        }

		if(!prev)
			glthread_add_next(glthread_head, glthread);
		else
			glthread_add_next(prev, glthread);

		return;

    }ITERATE_GLTHREAD_END(glthread_head, curr);

    /*Add in the end*/
    glthread_add_next(prev, glthread);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x712a
cmpq $0x0, 0x8(%rbx)
je 0x7137
movq %r14, 0x10(%rsp)
movslq %ecx, %r14
movq %r13, 0x8(%rsp)
subq %r14, %r13
negq %r14
xorl %r12d, %r12d
movq %r12, %rbp
testq %rbx, %rbx
je 0x710c
movq %rbx, %r12
movq 0x8(%rbx), %rbx
leaq (%r12,%r14), %rsi
movq %r13, %rdi
callq *%r15
cmpl $-0x1, %eax
jne 0x70e5
testq %rbp, %rbp
je 0x7199
movq 0x8(%rbp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rbp)
movq %rbp, (%rcx)
testq %rax, %rax
je 0x718a
movq %rax, 0x8(%rcx)
movq %rcx, (%rax)
jmp 0x718a
cmpq $0x0, (%r14)
je 0x716c
testq %rbx, %rbx
jne 0x70c8
jmp 0x70cf
movslq %ecx, %rax
movq %r13, %rdi
subq %rax, %rdi
subq %rax, %rbx
movq %rbx, %rsi
callq *%r15
movq 0x8(%r14), %rcx
cmpl $-0x1, %eax
je 0x7176
movq 0x8(%rcx), %rax
movq %r13, 0x8(%rcx)
movq %rcx, (%r13)
testq %rax, %rax
je 0x718a
movq %rax, 0x8(%r13)
movq %r13, (%rax)
jmp 0x718a
movq %r13, 0x8(%r14)
movq %r14, (%r13)
jmp 0x718a
movq %r13, 0x8(%r14)
movq %r14, (%r13)
testq %rcx, %rcx
je 0x718a
movq %rcx, 0x8(%r13)
movq %r13, (%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rdx
movq 0x8(%rdx), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rdx)
movq %rdx, (%rcx)
jmp 0x711c
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]libcperciva/tests/sock_util/main.c
// Function: main
int
main(int argc, char * argv[])
{

	WARNP_INIT;
	(void)argc; /* UNUSED */

	if (check_ensure_port())
		goto err0;

	/* Success! */
	exit(0);

err0:
	/* Failure! */
	exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x24d4
callq 0x292c
movl $0x8, %r13d
leaq 0x387f(%rip), %rbp      # 0x5d60
movq -0x8(%r13,%rbp), %r15
movq (%r13,%rbp), %r12
movq %r15, %rdi
callq 0x2834
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
callq 0x2170
movl %eax, %ebx
testl %eax, %eax
jne 0x251e
movq %r14, %rdi
callq 0x2040
addq $0x10, %r13
cmpq $0x98, %r13
jne 0x24e1
jmp 0x2548
leaq 0x1adf(%rip), %rdi      # 0x4004
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2acb
callq 0x2080
movl $0x0, (%rax)
movq %r14, %rdi
callq 0x2040
testl %ebx, %ebx
jne 0x2553
xorl %edi, %edi
callq 0x2220
movl $0x1, %edi
callq 0x2220
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/vusec[P]fpvi-scsb/leakers/mo/leak.c
// Function: segfault_handler
static void segfault_handler(int signum) {
    (void)signum;
    unblock_signal(SIGSEGV);
    sigsegvs++;
    longjmp(buf, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x401632
incl 0x2fc7(%rip)            # 0x4045e8
leaq 0x2ef8(%rip), %rdi      # 0x404520
movl $0x1, %esi
callq 0x401130
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/functions.c
// Function: analyze_url
int analyze_url(char* url,char* host,int port,char** page){
	//url should be like 'http://host:port/page'
	//only page need to be returned
	int hostsize=strlen(host);
	if(strlen(url) < 12+hostsize) return -1;

	url[6]='\0';
	url[7+hostsize]='\0';
	url[12+hostsize]='\0';
	//now url should be like 'http:/\0host\0port\0page'
	if(strcmp(url,"http:/")) return -1;
	//if(strcmp(url+7,host)) return -1;
	char *cport=myitoa(port);
	if(strcmp(url+8+hostsize,cport)) {free(cport);return -1;}
	(*page) = malloc((strlen(url+13+hostsize)+2)*sizeof(char));
	strcpy((*page),"/");
	strcat((*page),url+13+hostsize);
	//printf("%s\n",(*page));
	free(cport);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %r12d
movq %rdi, %r14
movq %rsi, %rdi
callq 0x20f0
movq %rax, %r15
movq %r14, %rdi
callq 0x20f0
shlq $0x20, %r15
movabsq $0xc00000000, %rcx      # imm = 0xC00000000
addq %r15, %rcx
sarq $0x20, %rcx
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpq %rcx, %rax
jb 0x2798
xorl %eax, %eax
movb %al, 0x6(%r14)
movabsq $0x700000000, %rdx      # imm = 0x700000000
addq %r15, %rdx
sarq $0x20, %rdx
movb %al, (%r14,%rdx)
movb %al, (%r14,%rcx)
leaq 0x28d1(%rip), %rsi      # 0x5004
movq %r14, %rdi
callq 0x2180
testl %eax, %eax
jne 0x2798
movl %r12d, %edi
callq 0x262b
movq %rax, %r12
sarq $0x20, %r15
leaq (%r14,%r15), %rdi
addq $0x8, %rdi
movq %rax, %rsi
callq 0x2180
testl %eax, %eax
jne 0x2790
addq %r15, %r14
addq $0xd, %r14
movq %r14, %rdi
callq 0x20f0
leaq 0x2(%rax), %rdi
callq 0x2220
movq %rax, (%rbx)
movw $0x2f, (%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2310
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x2030
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_O1/stefpant[P]TCPserver/webcrawler/functions.c
// Function: create_request
char* create_request(char* page, char* hostname, int port){
	char *req;
	char* chport=myitoa(port);
	int size=47+strlen(page)+strlen(hostname)+strlen(chport);
	req = malloc(size*sizeof(char));
	strcpy(req,"GET ");
	strcat(req,page);
	strcat(req," HTTP/1.1\r\nHost: ");
	strcat(req,hostname);
	strcat(req,":");
	strcat(req,chport);
	strcat(req,"\r\nConnection: Closed\r\n\r\n");
	free(chport);
	return req;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r12
movl %edx, %edi
callq 0x262b
movq %rax, %rbx
movq %r12, %rdi
callq 0x20f0
movq %rax, %r15
movq %r14, %rdi
callq 0x20f0
movq %rax, %r13
addl %r15d, %r13d
movq %rbx, %rdi
callq 0x20f0
addl %r13d, %eax
addl $0x2f, %eax
movslq %eax, %rdi
callq 0x2220
movq %rax, %r15
movl $0x20544547, (%rax)     # imm = 0x20544547
movb $0x0, 0x4(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x2310
movq %r15, %rdi
callq 0x20f0
movups 0x27f2(%rip), %xmm0     # 0x5010
movups %xmm0, (%r15,%rax)
movw $0x20, 0x10(%r15,%rax)
movq %r15, %rdi
movq %r14, %rsi
callq 0x2310
movq %r15, %rdi
callq 0x20f0
movw $0x3a, (%r15,%rax)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2310
movq %r15, %rdi
callq 0x20f0
movups 0x27c3(%rip), %xmm0     # 0x5022
movups %xmm0, (%r15,%rax)
movups 0x27c0(%rip), %xmm0     # 0x502b
movups %xmm0, 0x9(%r15,%rax)
movq %rbx, %rdi
callq 0x2030
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/functions.c
// Function: read_request
char* read_request(int fd,int size){
	int n;
	int counter=1;
	int flag;
	char *tempbuf=NULL;
	char *buf=NULL;
	while(1){
		flag=0;
		tempbuf=calloc((size+1),sizeof(char));
		if((n=read(fd,tempbuf,size)) <= 0) break;
		if(counter == 1) flag=1;
		counter+=n;
		if(flag){
			buf = malloc((counter+1)*sizeof(char));
			strcpy(buf,tempbuf);//first time copy
		}
		else{
			buf = realloc(buf,(counter+1)*sizeof(char));
			strcat(buf,tempbuf);//then cat
		}
		free(tempbuf);
	}
	free(tempbuf);
	return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebx
leal 0x1(%rsi), %eax
movslq %eax, %rdi
movslq %esi, %r14
movl $0x1, %esi
movq %rdi, -0x40(%rbp)
callq 0x2170
movq %rax, %r12
movl %ebx, -0x2c(%rbp)
movl %ebx, %edi
movq %rax, %rsi
movq %r14, -0x38(%rbp)
movq %r14, %rdx
callq 0x2150
movq %rax, %rbx
testl %ebx, %ebx
jle 0x2950
movl $0x1, %r14d
xorl %r13d, %r13d
leal (%rbx,%r14), %esi
incl %esi
cmpl $0x1, %r14d
jne 0x2900
movq %rsi, %rdi
callq 0x2220
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
callq 0x2070
jmp 0x2916
movq %r13, %rdi
callq 0x2240
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
callq 0x2310
movl %ebx, %r15d
addl %r14d, %r15d
movq %r12, %rdi
callq 0x2030
movl $0x1, %esi
movq -0x40(%rbp), %rdi
callq 0x2170
movq %rax, %r12
movl -0x2c(%rbp), %edi
movq %rax, %rsi
movq -0x38(%rbp), %rdx
callq 0x2150
movq %rax, %rbx
movl %r15d, %r14d
testl %ebx, %ebx
jg 0x28dc
jmp 0x2953
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x2030
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/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)
			break;
		if(counter == size){//then realloc 
			size *=2;
			(*buf) = realloc((*buf),size*sizeof(char));
		}
		if(c == '\0' || c == EOF || c == '\n' || c == 13){//13 is the carriege return
			read(fd,&c,1);//read the '\n'
			(*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, %r15d
movq %rsi, %rbx
movl %edi, %r14d
leaq -0x29(%rbp), %rsi
movl $0x1, %edx
callq 0x2150
testl %eax, %eax
js 0x2a15
xorl %r13d, %r13d
leaq -0x29(%rbp), %r12
testl %eax, %eax
je 0x2a0f
movl %r15d, %eax
cmpq %rax, %r13
jne 0x29ba
addl %r15d, %r15d
movq (%rbx), %rdi
movslq %r15d, %rsi
callq 0x2240
movq %rax, (%rbx)
movzbl -0x29(%rbp), %eax
cmpl $0xd, %eax
ja 0x29cd
movl $0x2401, %ecx           # imm = 0x2401
btl %eax, %ecx
jb 0x29f4
cmpl $0xff, %eax
je 0x29f4
movq (%rbx), %rcx
movb %al, (%rcx,%r13)
incq %r13
movl $0x1, %edx
movl %r14d, %edi
movq %r12, %rsi
callq 0x2150
testl %eax, %eax
jns 0x299d
jmp 0x2a15
leaq -0x29(%rbp), %rsi
movl $0x1, %edx
movl %r14d, %edi
callq 0x2150
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_O1/stefpant[P]TCPserver/webcrawler/functions.c
// Function: getDir
char* getDir(char* page,char* d){
	int i=1;
	while(1){
		if(page[i++] == '/'){
			page[i-1]='\0';
			break;
		}
	}
	char* dir=malloc((strlen(page)+strlen(d)+1)*sizeof(char));
	strcpy(dir,d);
	strcat(dir,page);
	return dir;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1(%rdi), %rax
cmpb $0x2f, (%rax)
leaq 0x1(%rax), %rax
jne 0x2b55
movb $0x0, -0x1(%rax)
movq %rbx, %rdi
callq 0x20f0
movq %rax, %r15
movq %r14, %rdi
callq 0x20f0
leaq (%r15,%rax), %rdi
incq %rdi
callq 0x2220
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x2070
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2310
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/functions.c
// Function: save_page
int save_page(char* page,char* dir,char* content){

	if(content[9]!='2' || content[10]!='0' || content[11]!='0') return -1;//wrong file

	char *fname=malloc((strlen(page)+strlen(dir)+2)*sizeof(char));
	strcpy(fname,dir);
	strcat(fname,"/");
	strcat(fname,page);
	char* pagedir = getDir(page,dir);
	DIR* d = opendir(pagedir);
	if(d){//dir exists
		closedir(d);
	}
	else if(errno == ENOENT){//dir doesn't exists
		mkdir(pagedir,0700);
	}
	free(pagedir);
	FILE* fp=fopen(fname,"w");
	if(!fp) {free(fname);free(pagedir);return -1;}//couldn't create file
	int start=skip_header(content);//return a pointer after a header to copy the file

	fprintf(fp,"%s",content+start);

	free(fname);
	fclose(fp);
	return start;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x32, 0x9(%rdx)
jne 0x2cec
movq %rdx, %r14
cmpb $0x30, 0xa(%rdx)
jne 0x2cec
cmpb $0x30, 0xb(%r14)
jne 0x2cec
movq %rsi, %r12
movq %rdi, %r13
callq 0x20f0
movq %rax, %r15
movq %r12, %rdi
callq 0x20f0
leaq (%r15,%rax), %rdi
addq $0x2, %rdi
callq 0x2220
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0x2070
movq %r15, %rdi
callq 0x20f0
movw $0x2f, (%r15,%rax)
movq %r15, %rdi
movq %r13, %rsi
callq 0x2310
movq %r13, %rdi
movq %r12, %rsi
callq 0x2b41
movq %rax, %r12
movq %rax, %rdi
callq 0x20e0
testq %rax, %rax
je 0x2c68
movq %rax, %rdi
callq 0x2140
jmp 0x2c7f
callq 0x2040
cmpl $0x2, (%rax)
jne 0x2c7f
movq %r12, %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x2080
movq %r12, %rdi
callq 0x2030
leaq 0x26a7(%rip), %rsi      # 0x5335
movq %r15, %rdi
callq 0x22d0
testq %rax, %rax
je 0x2cdc
movq %rax, %r13
movl $0x2, %ebx
cmpb $0xa, -0x2(%r14,%rbx)
jne 0x2cb2
cmpb $0xa, (%r14,%rbx)
je 0x2cb7
incq %rbx
jmp 0x2ca3
incl %ebx
movslq %ebx, %rax
addq %rax, %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x2120
movq %r15, %rdi
callq 0x2030
movq %r13, %rdi
callq 0x20d0
jmp 0x2cec
movq %r15, %rdi
callq 0x2030
movq %r12, %rdi
callq 0x2030
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_O1/stefpant[P]TCPserver/webcrawler/functions.c
// Function: getURL
char* getURL(char* x){
	if(strlen(x)<5) return NULL;
	x[4]='\0';//should be '=' in x[4]
	if(strcmp(x,"href")) return NULL;
	int c=5;
	while(1){
		if('>' == x[c]){x[c]='\0';break;}
		else if('\0' == x[c++]) return NULL;
	}
	char* ret=malloc((strlen(x+5)+1)*sizeof(char));
	strcpy(ret,x+5);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x20f0
cmpq $0x5, %rax
jb 0x2d3a
movb $0x0, 0x4(%rbx)
leaq 0x231f(%rip), %rsi      # 0x503b
movq %rbx, %rdi
callq 0x2180
testl %eax, %eax
jne 0x2d3a
leaq 0x5(%rbx), %rax
movb (%rax), %cl
cmpb $0x3e, %cl
je 0x2d43
incq %rax
testb %cl, %cl
jne 0x2d2c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movb $0x0, (%rax)
addq $0x5, %rbx
movq %rbx, %rdi
callq 0x20f0
leaq 0x1(%rax), %rdi
callq 0x2220
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2070
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/functions.c
// Function: search_new_pages
char** search_new_pages(char* text,int start,int* finalcounter){
	char **res=malloc(sizeof(char*));
	int counter=0;
	char* word;
	char* suburl=NULL;
	while(start!=-1){
		word = NULL;
		start = nextWord(text,&word,start);//save word
		if(start<-1) break;
		if(!strcmp(word,"<a")){//maybe a first step to find new url
			free(word);
			word=NULL;
			start = nextWord(text,&word,start);
			if(start<-1) break;
			suburl=getURL(word);
			if(suburl == NULL){free(word);continue;}//not url here :-(
			if(counter++)
				res=realloc(res,(counter+1)*sizeof(char*));
			res[counter-1]=suburl;
			suburl=NULL;
		}
		free(word);
	}
	*finalcounter=counter;
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, -0x48(%rbp)
movl %esi, %r12d
movq %rdi, %r15
movl $0x8, %edi
callq 0x2220
movq %rax, -0x40(%rbp)
cmpl $-0x1, %r12d
je 0x2e62
movl $0x0, -0x2c(%rbp)
leaq -0x38(%rbp), %r13
movq $0x0, -0x38(%rbp)
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x2a24
cmpl $-0x1, %eax
jl 0x2e69
movl %eax, %r12d
movq -0x38(%rbp), %r14
movq %r14, %rdi
leaq 0x2266(%rip), %rsi      # 0x5040
callq 0x2180
testl %eax, %eax
jne 0x2e5c
movq %r14, %rdi
callq 0x2030
movq $0x0, -0x38(%rbp)
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x2a24
cmpl $-0x1, %eax
jl 0x2e69
movl %eax, %r12d
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x2cfd
testq %rax, %rax
jne 0x2e2a
movq %rbx, %rdi
callq 0x2030
cmpl $-0x1, %r12d
jne 0x2daa
jmp 0x2e69
movq %rax, %r14
movl -0x2c(%rbp), %eax
movslq %eax, %rbx
testl %eax, %eax
je 0x2e4a
leaq 0x10(,%rbx,8), %rsi
movq -0x40(%rbp), %rdi
callq 0x2240
jmp 0x2e4e
movq -0x40(%rbp), %rax
leal 0x1(%rbx), %ecx
movl %ecx, -0x2c(%rbp)
movq %rax, -0x40(%rbp)
movq %r14, (%rax,%rbx,8)
movq -0x38(%rbp), %rdi
jmp 0x2e1d
movl $0x0, -0x2c(%rbp)
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/functions.c
// Function: createDocfile
void createDocfile(char* root,char* name){
	FILE* fp=fopen(name,"w");
	struct dirent *d;
	DIR *dir = opendir(root);
	char* founddir=NULL;
	if(dir == NULL)//gdir not a directory
		return;
	while((d = readdir(dir)) != NULL){
		if(d->d_type != DT_DIR) continue;//d not a directory
		if(!strcmp(d->d_name,".") || !strcmp(d->d_name,"..")) continue;//ignore '.','..'
		founddir = malloc((strlen(root)+strlen(d->d_name)+2)*sizeof(char));
		strcpy(founddir,root);
		strcat(founddir,"/");
		strcat(founddir,d->d_name);
		fprintf(fp,"%s\n",founddir);
		free(founddir);
		founddir=NULL;
	}
	closedir(dir);
	fclose(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x2495(%rip), %rsi      # 0x5335
movq %rax, %rdi
callq 0x22d0
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0x20e0
testq %rax, %rax
je 0x2fa4
movq %rax, %r15
movq %rax, %rdi
callq 0x2200
testq %rax, %rax
je 0x2f85
movq %rax, %r13
leaq 0x22d7(%rip), %r12      # 0x51b2
cmpb $0x4, 0x12(%r13)
jne 0x2f71
addq $0x13, %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x2180
testl %eax, %eax
je 0x2f71
movq %r13, %rdi
leaq 0x22ae(%rip), %rsi      # 0x51b1
callq 0x2180
testl %eax, %eax
je 0x2f71
movq %rbx, %rdi
callq 0x20f0
movq %rax, %r14
movq %r13, %rdi
callq 0x20f0
leaq (%r14,%rax), %rdi
addq $0x2, %rdi
callq 0x2220
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2070
movq %r14, %rdi
callq 0x20f0
movw $0x2f, (%r14,%rax)
movq %r14, %rdi
movq %r13, %rsi
callq 0x2310
movq -0x30(%rbp), %rdi
leaq 0x2290(%rip), %rsi      # 0x51ef
movq %r14, %rdx
xorl %eax, %eax
callq 0x21a0
movq %r14, %rdi
callq 0x2030
movq %r15, %rdi
callq 0x2200
movq %rax, %r13
testq %rax, %rax
jne 0x2edb
movq %r15, %rdi
callq 0x2140
movq -0x30(%rbp), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20d0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/functions.c
// Function: isIP
int isIP(char *name){//ip4: xxx.xxx.xxx.xxx(maxlen=15)
	if(name==NULL) return 0;
	char c;
	int i=0;
	int dots=0,digs=0;
	while( (c=name[i++]) != '\0' ){
		if(c == '.') dots++;
		else if( (c>='0') && (c<='9')) digs++;
		else return 0;//not ip

		if((dots > 3) || (digs > 12)) return 0;
	}
	if( (dots != 3) || (digs<4) ) return 0;
	return 1;
}

// Assembly:
testq %rdi, %rdi
je 0x2fe9
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
xorl %edx, %edx
movzbl (%rdi), %eax
cmpl $0x2e, %eax
je 0x2fd6
testl %eax, %eax
je 0x2fec
addb $-0x30, %al
cmpb $0x9, %al
ja 0x2fff
incl %edx
jmp 0x2fd8
incl %ecx
xorl %eax, %eax
cmpl $0x3, %ecx
jg 0x3001
incq %rdi
cmpl $0xc, %edx
jle 0x2fc0
jmp 0x3001
xorl %eax, %eax
retq
cmpl $0x3, %ecx
sete %al
cmpl $0x4, %edx
setge %cl
andb %al, %cl
movzbl %cl, %eax
jmp 0x3001
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/input_parse.c
// Function: isDirEmpty
int isDirEmpty(char* gdir){
	int n=0;
	struct dirent *d;
	DIR *dir = opendir(gdir);
	if(dir == NULL)//gdir not a directory
		return -1;
	while((d = readdir(dir)) != NULL){
		if(++n > 2) {closedir(dir);return -2;}//not empty gdir
	}
	closedir(dir);
	return 0;//empty dir
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x20e0
testq %rax, %rax
je 0x3038
movq %rax, %rbx
movl $0x3, %r14d
movq %rbx, %rdi
callq 0x2200
testq %rax, %rax
je 0x3040
decl %r14d
jne 0x301e
movl $0xfffffffe, %r14d      # imm = 0xFFFFFFFE
jmp 0x3043
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x304b
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x2140
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/webcrawler.c
// Function: checkinPU
int checkinPU(char** url){
	int counter=0;
	int flag=0;
	while(1){
		pthread_mutex_lock(&pumtx);
		if(counter==pucounter) break;//url not found
		if(!strcmp(placedurls[counter++],*url)) flag=1;
		pthread_mutex_unlock(&pumtx);
		if(flag) return 1;//found
	}
	//still mutex locked
	pucounter++;
	placedurls = realloc(placedurls,pucounter*sizeof(char*));
	placedurls[pucounter-1]=*url;
	pthread_mutex_unlock(&pumtx);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r12d, %r12d
leaq 0x3e48(%rip), %r14      # 0x7210
movq %r14, %rdi
callq 0x2390
movl 0x3e32(%rip), %eax      # 0x7208
cmpq %rax, %r12
je 0x3408
movq 0x3e1e(%rip), %rax      # 0x7200
movq (%rax,%r12,8), %rdi
incq %r12
movq (%rbx), %rsi
callq 0x2180
movl %eax, %r15d
movq %r14, %rdi
callq 0x2210
testl %r15d, %r15d
jne 0x33c8
movl $0x1, %eax
jmp 0x344c
cltq
leaq 0x1(%rax), %rcx
movl %ecx, 0x3df4(%rip)      # 0x7208
movq 0x3de5(%rip), %rdi      # 0x7200
leaq 0x8(,%rax,8), %rsi
callq 0x2240
movq %rax, 0x3dd1(%rip)      # 0x7200
movq (%rbx), %rcx
movslq 0x3dcf(%rip), %rdx      # 0x7208
movq %rcx, -0x8(%rax,%rdx,8)
leaq 0x3dcb(%rip), %rdi      # 0x7210
callq 0x2210
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/webcrawler.c
// Function: destroyPU
void destroyPU(void){
	//no need to lock just free memory
	for(int i=0;i<pucounter;i++)
		free(placedurls[i]);
	free(placedurls);
}

// Assembly:
cmpl $0x0, 0x3dac(%rip)      # 0x7208
jle 0x348b
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
xorl %ebx, %ebx
movq 0x3d93(%rip), %rax      # 0x7200
movq (%rax,%rbx,8), %rdi
callq 0x2030
incq %rbx
movslq 0x3d88(%rip), %rax      # 0x7208
cmpq %rax, %rbx
jl 0x3466
addq $0x8, %rsp
popq %rbx
popq %rbp
movq 0x3d6e(%rip), %rdi      # 0x7200
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/webcrawler.c
// Function: urlpool_init
void urlpool_init(urlpool** up){
	(*up) = malloc(sizeof(urlpool));
	(*up)->urls = malloc(MAXR*sizeof(char*));
	(*up)->size = MAXR;
	//(*up)->start = 0;2
	(*up)->end = -1;
	(*up)->count = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x18, %edi
callq 0x2220
movq %rax, %r14
movq %rax, (%rbx)
movl $0x50, %edi
callq 0x2220
movq %rax, (%r14)
movq $0xa, 0x8(%r14)
movl $0xffffffff, 0x10(%r14) # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/webcrawler.c
// Function: urlpool_clear
void urlpool_clear(urlpool** up){//clearing pool
	while(1){
		pthread_mutex_lock(&mtx);
		if( (*up)->count == 0 ){
			pthread_mutex_unlock(&mtx);
			return;
		}
		free( (*up)->urls[(*up)->end] );
		(*up)->end--;
		(*up)->count--;
		pthread_mutex_unlock(&mtx);
	}
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x3d54(%rip), %rdi      # 0x7238
callq 0x2390
movq (%rbx), %rax
cmpl $0x0, 0xc(%rax)
je 0x352b
leaq 0x3d3f(%rip), %r14      # 0x7238
movq (%rax), %rcx
movslq 0x10(%rax), %rax
movq (%rcx,%rax,8), %rdi
callq 0x2030
movq (%rbx), %rax
decl 0x10(%rax)
decl 0xc(%rax)
movq %r14, %rdi
callq 0x2210
movq %r14, %rdi
callq 0x2390
movq (%rbx), %rax
cmpl $0x0, 0xc(%rax)
jne 0x34f9
leaq 0x3d06(%rip), %rdi      # 0x7238
popq %rbx
popq %r14
popq %rbp
jmp 0x2210
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/webcrawler.c
// Function: place
void place(urlpool** up,char* url){// place url in buffer
	pthread_mutex_lock(&mtx);
	//while((*up)->count>=MAXR){3
	if((*up)->count>=(*up)->size){//full pool->realloc
		(*up)->size*=2;
		(*up)->urls=realloc((*up)->urls,(*up)->size*sizeof(char*));
		//printf("Pool found full\n");
		//pthread_cond_wait(&cv_notfull,&mtx);4
	}
	(*up)->end = ((*up)->end+1);//%MAXR;
	(*up)->urls[(*up)->end] = malloc((strlen(url)+1)*sizeof(char));
	strcpy((*up)->urls[(*up)->end],url);
	//printf("placed: %d\n",(*ra)->fds[(*ra)->end]);
	(*up)->count++;
	pthread_mutex_unlock(&mtx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x3cc3(%rip), %rdi      # 0x7238
callq 0x2390
movq (%rbx), %rax
movslq 0x8(%rax), %rsi
cmpl %esi, 0xc(%rax)
jl 0x359e
leal (%rsi,%rsi), %ecx
movl %ecx, 0x8(%rax)
movq (%rax), %rdi
shlq $0x4, %rsi
callq 0x2240
movq (%rbx), %rcx
movq %rax, (%rcx)
movq (%rbx), %r15
movslq 0x10(%r15), %r12
leaq 0x1(%r12), %rax
movl %eax, 0x10(%r15)
movq %r14, %rdi
callq 0x20f0
leaq 0x1(%rax), %rdi
callq 0x2220
movq (%r15), %rcx
movq %rax, 0x8(%rcx,%r12,8)
movq (%rbx), %rax
movq (%rax), %rcx
movslq 0x10(%rax), %rax
movq (%rcx,%rax,8), %rdi
movq %r14, %rsi
callq 0x2070
movq (%rbx), %rax
incl 0xc(%rax)
leaq 0x3c4e(%rip), %rdi      # 0x7238
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2210
// File: /workspace/github_c_makefile_star2_O1/stefpant[P]TCPserver/webcrawler/webcrawler.c
// Function: obtain
char* obtain(urlpool** up){//get request from buffer
	char* data;
	pthread_mutex_lock(&mtx);
	while( (*up)->count <= 0 ){
		//printf("Pool found empty\n");
		pthread_cond_wait(&cv_notempty,&mtx);
	}
	//data = malloc((strlen((*up)->urls[(*up)->start]) + 1)*sizeof(char));
	data = malloc((strlen((*up)->urls[(*up)->end]) + 1)*sizeof(char));
	//strcpy(data,(*up)->urls[(*up)->start]);
	strcpy(data,(*up)->urls[(*up)->end]);
	//free( (*up)->urls[(*up)->start] );
	free( (*up)->urls[(*up)->end] );
	//(*up)->start = ( (*up)->start + 1 ) % MAXR;
	(*up)->end--;
	(*up)->count--;
	pthread_mutex_unlock(&mtx);
	return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x3c2c(%rip), %rdi      # 0x7238
callq 0x2390
movq (%rbx), %r12
cmpl $0x0, 0xc(%r12)
jg 0x3640
leaq 0x3c3d(%rip), %r14      # 0x7260
leaq 0x3c0e(%rip), %r15      # 0x7238
movq %r14, %rdi
movq %r15, %rsi
callq 0x20c0
movq (%rbx), %r12
cmpl $0x0, 0xc(%r12)
jle 0x362a
movq (%r12), %rax
movslq 0x10(%r12), %rcx
movq (%rax,%rcx,8), %r14
movq %r14, %rdi
callq 0x20f0
leaq 0x1(%rax), %rdi
callq 0x2220
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x2070
movq (%r12), %rax
movslq 0x10(%r12), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2030
movq (%rbx), %rax
decl 0x10(%rax)
decl 0xc(%rax)
leaq 0x3baa(%rip), %rdi      # 0x7238
callq 0x2210
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/generot[P]VM-0/src/disasm.c
// Function: display_instr
void display_instr(instr *prog, size_t prog_sz, size_t entry) {
    for(size_t i = 0; i < prog_sz; i++) {
        const char *instr_to_display = prog[i].op == OPC_SYSCALL
            ? syscalls[prog[i].scall]
            : opcodes[prog[i].op - 0x10];

        if(i == entry)
            puts("----ENTRY POINT----");

        printf("0x%.2X: [ %s", (unsigned)i, instr_to_display);

        switch(prog[i].content_type) {
        case INST_ADDR:
            printf(" <0x%.2X>", (unsigned)prog[i].addr);
            break;
        case INST_VAL:
            printf(" %.3lf", prog[i].val);
            break;
        case INST_NOARGS:
            break;
        }
        
        puts(" ]");
    }
}

// Assembly:
testq %rsi, %rsi
je 0x12ac
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
addq $0x10, %r15
leaq 0xec7(%rip), %rbp       # 0x20cb
xorl %r12d, %r12d
movl -0xc(%r15), %eax
cmpl $0x25, %eax
jne 0x121d
movl -0x8(%r15), %eax
leaq 0x2f15(%rip), %rcx      # 0x4130
jmp 0x1227
addl $-0x10, %eax
leaq 0x2e49(%rip), %rcx      # 0x4070
leaq (%rcx,%rax,8), %rax
movq (%rax), %r13
cmpq %r12, %rbx
jne 0x123f
leaq 0xe5f(%rip), %rdi       # 0x2099
callq 0x1030
leaq 0xe67(%rip), %rdi       # 0x20ad
movl %r12d, %esi
movq %r13, %rdx
xorl %eax, %eax
callq 0x1060
movl -0x10(%r15), %eax
testl %eax, %eax
je 0x1273
cmpl $0x1, %eax
jne 0x1286
movl (%r15), %esi
leaq 0xe50(%rip), %rdi       # 0x20ba
xorl %eax, %eax
callq 0x1060
jmp 0x1286
movsd (%r15), %xmm0
leaq 0xe45(%rip), %rdi       # 0x20c4
movb $0x1, %al
callq 0x1060
movq %rbp, %rdi
callq 0x1030
incq %r12
addq $0x18, %r15
cmpq %r12, %r14
jne 0x1207
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/generot[P]VM-0/src/disasm.c
// Function: main
int main(int argc, char **argv) {
    if(argc < 2)
        ISSUE_ERROR("Usage: ./dasm <bytecode_src>");

    bcode_file fl = read_bytecode(argv[1]);

    bool stack_size_provided = fl.metadata.stack_size_spec == STACK_SIZE_SPECIFIED;

    size_t code_seg_sz = !stack_size_provided ? CODE_SEG_SZ : fl.metadata.code_seg_sz;
    size_t data_seg_sz = !stack_size_provided ? DATA_SEG_SZ : fl.metadata.data_seg_sz;

    printf(
        "Program size: %I64u instructions\n"
        "Stack size%s: [Code segment: %I64u, Data segment: %I64u]\n"
        "Entry point address: 0x%.2X\n\n",
        fl.metadata.program_size,
        !stack_size_provided ? "(default)" : "",
        code_seg_sz, data_seg_sz,
        (unsigned)fl.metadata.entry_point_addr
    );

    display_instr(fl.prog, fl.metadata.program_size, 
        fl.metadata.entry_point_addr);

    return 0;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
cmpl $0x1, %edi
jle 0x131f
movq 0x8(%rsi), %rsi
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x13a4
cmpl $0x0, 0x18(%rbx)
movl $0x200, %ecx            # imm = 0x200
cmoveq 0x20(%rbx), %rcx
movl $0x600, %r8d            # imm = 0x600
cmoveq 0x28(%rbx), %r8
movq 0x8(%rbx), %rsi
leaq 0xe79(%rip), %rax       # 0x2163
leaq 0xe73(%rip), %rdx       # 0x2164
cmoveq %rax, %rdx
movl 0x10(%rbx), %r9d
leaq 0xdec(%rip), %rdi       # 0x20ec
xorl %eax, %eax
callq 0x1060
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
callq 0x11dc
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
retq
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O1/generot[P]VM-0/src/vm/bytecode.c
// Function: dump_bytecode
void dump_bytecode(const char *filename, instr *program, size_t prog_sz, size_t entry_addr) {
    FILE *f = fopen(filename, "wb");

    bcode_header prog_metadata = {
        .program_size = prog_sz,
        .entry_point_addr = entry_addr,
        .stack_size_spec = STACK_SIZE_DEFAULT
    };

    fwrite(&prog_metadata, sizeof(bcode_header), 1, f);
    fwrite(program, sizeof(instr), prog_metadata.program_size, f);

    fclose(f);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
leaq 0xe2d(%rip), %rsi       # 0x216e
callq 0x1080
movq %rax, %r12
leaq 0x8(%rsp), %r13
movq %r14, (%r13)
movq %rbx, 0x8(%r13)
movl $0x1, 0x10(%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r13)
movl $0x28, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rax, %rcx
callq 0x10a0
movq (%r13), %rdx
movl $0x18, %esi
movq %r15, %rdi
movq %r12, %rcx
callq 0x10a0
movq %r12, %rdi
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1050
// File: /workspace/github_c_makefile_star2_O1/generot[P]VM-0/src/vm/bytecode.c
// Function: read_bytecode
bcode_file read_bytecode(const char *filename) {
    FILE *f = fopen(filename, "rb");

    bcode_file new_file = {0};
    fread(&new_file.metadata, sizeof(bcode_header), 1, f);

    new_file.prog = calloc(new_file.metadata.program_size, sizeof(instr));
    fread(new_file.prog, sizeof(instr), new_file.metadata.program_size, f);

    fclose(f);

    return new_file;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
leaq 0xdbb(%rip), %rsi       # 0x2171
movq %rax, %rdi
callq 0x1080
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, 0x20(%rbx)
leaq 0x8(%rbx), %rdi
movl $0x28, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x1040
movq 0x8(%rbx), %r15
movl $0x18, %esi
movq %r15, %rdi
callq 0x1070
movq %rax, (%rbx)
movl $0x18, %esi
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x1040
movq %r14, %rdi
callq 0x1050
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/evilwombat[P]gopro-fw-tools/fwunpacker.c
// Function: read_word
static unsigned int read_word(void)
{
	unsigned int r = 0;
	r |= fgetc(fd) <<  0;
	r |= fgetc(fd) <<  8;
	r |= fgetc(fd) << 16;
	r |= fgetc(fd) << 24;
	return r;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq 0x2c38(%rip), %rdi      # 0x4090
callq 0x1080
movl %eax, %ebx
movq 0x2c2a(%rip), %rdi      # 0x4090
callq 0x1080
movl %eax, %ebp
shll $0x8, %ebp
orl %ebx, %ebp
movq 0x2c17(%rip), %rdi      # 0x4090
callq 0x1080
movl %eax, %ebx
shll $0x10, %ebx
movq 0x2c06(%rip), %rdi      # 0x4090
callq 0x1080
shll $0x18, %eax
orl %ebx, %eax
orl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_index.c
// Function: usage
void HTS_NORETURN usage(FILE *fp) {
    fprintf(fp, "Usage: test_index [opts] in.{sam.gz,bam,cram}|in.{vcf.gz,bcf}\n\n");
    fprintf(fp, "  -b       Use BAI index (BAM, SAM)\n");
    fprintf(fp, "  -c       Use CSI index (BAM, SAM, VCF, BCF)\n");
    fprintf(fp, "  -t       Use TBI index (VCF) \n");
    fprintf(fp, "  -m bits  Adjust min_shift; implies CSI\n");
    fprintf(fp, "\nThe default index format is CSI for sam/bam/vcf/bcf and CRAI for crams\n");
    exit(fp == stderr ? 1 : 0);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xa30ad(%rip), %rdi     # 0xa9004
movl $0x3f, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x49c0
leaq 0xa30d4(%rip), %rdi     # 0xa9044
movl $0x24, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x49c0
leaq 0xa30e0(%rip), %rdi     # 0xa9069
movl $0x2e, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x49c0
leaq 0xa30f6(%rip), %rdi     # 0xa9098
movl $0x20, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x49c0
leaq 0xa30fe(%rip), %rdi     # 0xa90b9
movl $0x29, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x49c0
leaq 0xa310f(%rip), %rdi     # 0xa90e3
movl $0x48, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x49c0
movq 0xc7feb(%rip), %rax     # 0xcdfd8
xorl %edi, %edi
cmpq %rbx, (%rax)
sete %dil
callq 0x4600
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_index.c
// Function: main
int main(int argc, char **argv) {
    int c, min_shift = 14;

    while ((c = getopt(argc, argv, "bctm:")) >= 0) {
        switch (c) {
        case 't': case 'b': min_shift = 0; break;
        case 'c': min_shift = 14; break;
        case 'm': min_shift = atoi(optarg); break;
        case 'h': usage(stdout);
        default:  usage(stderr);
        }
    }

    if (optind >= argc) usage(stderr);

    htsFile *in = hts_open(argv[optind], "r");
    if (!in) {
        fprintf(stderr, "Error opening \"%s\"\n", argv[optind]);
        exit(1);
    }

    int ret;
    if (in->format.format == sam ||
        in->format.format == bam ||
        in->format.format == cram) {
        ret = sam_index_build(argv[optind], min_shift);
    } else {
        ret = bcf_index_build(argv[optind], min_shift);
    }

    if (ret < 0) {
        fprintf(stderr, "Failed to build index for \"%s\"\n", argv[optind]);
        exit(1);
    }

    if (hts_close(in) < 0) {
        fprintf(stderr, "Error closing \"%s\"\n", argv[optind]);
        exit(1);
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %r14d
leaq 0xa311c(%rip), %rdx     # 0xa912c
callq 0x40e0
testl %eax, %eax
js 0x6071
leaq 0xa310c(%rip), %r15     # 0xa912c
movq 0xc7f99(%rip), %r12     # 0xcdfc0
xorl %ebp, %ebp
cmpl $0x67, %eax
jle 0x603d
cmpl $0x6d, %eax
je 0x6052
cmpl $0x74, %eax
je 0x605d
jmp 0x60e8
cmpl $0x62, %eax
je 0x605d
cmpl $0x63, %eax
jne 0x60f6
movl $0xe, %ebp
jmp 0x605d
movq (%r12), %rdi
callq 0x4810
movl %eax, %ebp
movl %r14d, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x40e0
testl %eax, %eax
jns 0x6027
jmp 0x6076
movl $0xe, %ebp
movq 0xc7f63(%rip), %r15     # 0xcdfe0
movslq (%r15), %rax
cmpl %r14d, %eax
jge 0x60f6
movq (%rbx,%rax,8), %rdi
leaq 0xa5f9f(%rip), %rsi     # 0xac02f
callq 0x959f
testq %rax, %rax
je 0x6105
movq %rax, %r14
movl 0x4c(%rax), %eax
cmpl $0x6, %eax
ja 0x60bf
movl $0x58, %ecx
btl %eax, %ecx
jae 0x60bf
movslq (%r15), %rax
movq (%rbx,%rax,8), %rdi
movl %ebp, %esi
callq 0x17ca5
jmp 0x60cd
movslq (%r15), %rax
movq (%rbx,%rax,8), %rdi
movl %ebp, %esi
callq 0x3bfd5
testl %eax, %eax
js 0x610d
movq %r14, %rdi
callq 0xa809
testl %eax, %eax
js 0x6115
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x68, %eax
jne 0x60f6
movq 0xc7ebc(%rip), %rax     # 0xcdfb0
jmp 0x60fd
movq 0xc7edb(%rip), %rax     # 0xcdfd8
movq (%rax), %rdi
callq 0x5f4c
movq %rbx, %rdi
callq 0x4a64
movq %rbx, %rdi
callq 0x4a32
movq %rbx, %rdi
callq 0x4a00
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/gadget114514[P]fatfs-example/cf2.c
// Function: main
void main()
{
  FIL f;
  int w;
  FATFS fs;
  FCHK(f_mount(&fs, "", 1)); 
  if (f_open(&f, "0:a.txt", FA_CREATE_ALWAYS|FA_READ|FA_WRITE) == FR_OK) {
    FCHK(f_write(&f, "abc\ndef\n", 9, &w));
    printf("open & write %d\n", w);
    FCHK(f_sync(&f));
    FCHK(f_close(&f));
  } else {
    printf("open error\n");
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x4b0, %rsp            # imm = 0x4B0
leaq 0x42f3(%rip), %rsi      # 0x54a8
leaq -0x4d0(%rbp), %rdi
movl $0x1, %edx
callq 0x145c
movl %eax, %ebx
movl %eax, %edi
callq 0x12d1
leaq 0x3e2e(%rip), %rdi      # 0x5004
leaq 0x3e3a(%rip), %rsi      # 0x5017
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1050
leaq 0x3e3b(%rip), %rsi      # 0x502b
leaq -0x278(%rbp), %rdi
movl $0xb, %edx
callq 0x1856
testl %eax, %eax
je 0x1216
leaq 0x4200(%rip), %rdi      # 0x540c
callq 0x1030
jmp 0x12c1
leaq 0x3e16(%rip), %rsi      # 0x5033
leaq -0x278(%rbp), %rbx
leaq -0x24(%rbp), %r15
movq %rbx, %rdi
movl $0x9, %edx
movq %r15, %rcx
callq 0x249c
movl %eax, %r12d
movl %eax, %edi
callq 0x12d1
leaq 0x3dbb(%rip), %r14      # 0x5004
leaq 0x3dec(%rip), %rsi      # 0x503c
movq %r14, %rdi
movl %r12d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1050
movl (%r15), %esi
leaq 0x3df3(%rip), %rdi      # 0x505d
xorl %eax, %eax
callq 0x1050
movq %rbx, %rdi
callq 0x2906
movl %eax, %r15d
movl %eax, %edi
callq 0x12d1
leaq 0x3de4(%rip), %rsi      # 0x506e
movq %r14, %rdi
movl %r15d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1050
movq %rbx, %rdi
callq 0x2a97
movl %eax, %ebx
movl %eax, %edi
callq 0x12d1
leaq 0x3dc7(%rip), %rsi      # 0x5079
movq %r14, %rdi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1050
addq $0x4b0, %rsp            # imm = 0x4B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/aezv3/ref/aez_ref.c
// Function: AEZprf
static void AEZprf(byte *K, unsigned kbytes, byte delta[16], unsigned bytes, byte *result) {

    byte buf[16], ctr[16];
    memset(ctr,0,16);
    for ( ; bytes >= 16; bytes-=16, result+=16) {
        unsigned i=15;
        xor_bytes(delta, ctr, 16, buf);
        E(K,kbytes,-1,3,buf,result);
        do { ctr[i]++; i--; } while (ctr[i+1]==0);   /* ctr+=1 */
    }
    if (bytes) {
        xor_bytes(delta, ctr, 16, buf);
        E(K,kbytes,-1,3,buf,buf);
        memcpy(result, buf, bytes);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r12
movl %esi, %r14d
movq %rdi, %r15
vxorps %xmm0, %xmm0, %xmm0
vmovaps %xmm0, (%rsp)
cmpl $0x10, %ecx
jb 0x176e
leaq 0x10(%rsp), %r13
vmovaps (%rsp), %xmm0
vxorps (%r12), %xmm0, %xmm0
vmovaps %xmm0, 0x10(%rsp)
movq %r15, %rdi
movl %r14d, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x3, %ecx
movq %r13, %r8
movq %rbx, %r9
callq 0x19a2
movl $0xf, %eax
movl %eax, %ecx
decl %eax
incb (%rsp,%rcx)
je 0x1759
addl $-0x10, %ebp
addq $0x10, %rbx
cmpl $0xf, %ebp
ja 0x1728
testl %ebp, %ebp
je 0x17b0
vmovaps (%rsp), %xmm0
vxorps (%r12), %xmm0, %xmm0
leaq 0x10(%rsp), %r12
vmovaps %xmm0, (%r12)
movq %r15, %rdi
movl %r14d, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x3, %ecx
movq %r12, %r8
movq %r12, %r9
callq 0x19a2
movl %ebp, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x10d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/aezv3/ref/aez_ref.c
// Function: Encrypt
void Encrypt(byte *K, unsigned kbytes,
             byte *N, unsigned nbytes,
             byte *AD[], unsigned adbytes[],
             unsigned veclen, unsigned abytes,
             byte *M, unsigned mbytes, byte *C) {
    byte delta[16], *X;
    AEZhash(K, kbytes, N, nbytes, AD, adbytes, veclen, abytes*8, delta);
    if (mbytes==0) {
        AEZprf(K, kbytes, delta, abytes, C);
    } else {
        X = (byte *)malloc(mbytes+abytes);
        memcpy(X, M, mbytes); memset(X+mbytes,0,abytes);
        Encipher(K, kbytes, delta, X, mbytes+abytes, X);
        memcpy(C, X, mbytes+abytes);
        free(X);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %r12d
movq %rdi, %r14
movq 0x90(%rsp), %r15
movl 0x88(%rsp), %ebp
movq 0x80(%rsp), %rbx
movl 0x78(%rsp), %r13d
movl 0x70(%rsp), %eax
leal (,%r13,8), %esi
leaq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movl %esi, 0x8(%rsp)
movl %eax, (%rsp)
movq %r14, %rdi
movl %r12d, %esi
callq 0x142e
testl %ebp, %ebp
je 0x1880
movl %r12d, 0x1c(%rsp)
movq %r15, 0x30(%rsp)
leal (%rbp,%r13), %r15d
movq %r15, %rdi
callq 0x1050
movq %rax, %r12
movl %ebp, %ebp
movq %rax, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x10d0
movq %r12, %rdi
addq %rbp, %rdi
movl %r13d, %edx
xorl %esi, %esi
callq 0x1040
testl %r15d, %r15d
je 0x18c3
cmpl $0x1f, %r15d
ja 0x18a5
movq %r12, (%rsp)
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
movl 0x1c(%rsp), %esi
movq %r12, %rcx
movl %r15d, %r8d
xorl %r9d, %r9d
callq 0x1fbc
jmp 0x18c3
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %ecx
movq %r15, %r8
callq 0x16f9
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, (%rsp)
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
movl 0x1c(%rsp), %esi
movq %r12, %rcx
movl %r15d, %r8d
xorl %r9d, %r9d
callq 0x250a
movq 0x30(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x10d0
movq %r12, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1070
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/aezv3/ref/aez_ref.c
// Function: crypto_aead_encrypt
int crypto_aead_encrypt(
    unsigned char *c,unsigned long long *clen,
    const unsigned char *m,unsigned long long mlen,
    const unsigned char *ad,unsigned long long adlen,
    const unsigned char *nsec,
    const unsigned char *npub,
    const unsigned char *k
)
{
    byte *AD[] = {(byte*)ad};
    unsigned adbytes[] = {(unsigned)adlen};
    (void)nsec;
    if (clen) *clen = mlen+16;
    Encrypt((byte*)k, CRYPTO_KEYBYTES, (byte*)npub, CRYPTO_NPUBBYTES,
            AD, adbytes, 1, CRYPTO_ABYTES, (byte*)m, mlen, (byte*)c);
    return 0;
}

// Assembly:
subq $0x18, %rsp
movq %rcx, %r10
movq %rdx, %rax
movq %rdi, %r11
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rdx
movq %r8, 0x10(%rsp)
movl %r9d, 0xc(%rsp)
testq %rsi, %rsi
je 0x1916
leaq 0x10(%r10), %rcx
movq %rcx, (%rsi)
subq $0x8, %rsp
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movl $0x10, %esi
movl $0xc, %ecx
pushq %r11
pushq %r10
pushq %rax
pushq $0x10
pushq $0x1
callq 0x10a0
addq $0x30, %rsp
xorl %eax, %eax
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/aezv3/ref/aez_ref.c
// Function: crypto_aead_decrypt
int crypto_aead_decrypt(
    unsigned char *m,unsigned long long *mlen,
    unsigned char *nsec,
    const unsigned char *c,unsigned long long clen,
    const unsigned char *ad,unsigned long long adlen,
    const unsigned char *npub,
    const unsigned char *k
)
{
    byte *AD[] = {(byte*)ad};
    unsigned adbytes[] = {(unsigned)adlen};
    (void)nsec;
    if (mlen) *mlen = clen-16;
    return Decrypt((byte*)k, CRYPTO_KEYBYTES, (byte*)npub, CRYPTO_NPUBBYTES,
                    AD, adbytes, 1, CRYPTO_ABYTES, (byte*)c, clen, (byte*)m);
}

// Assembly:
subq $0x18, %rsp
movq %r8, %r10
movq %rcx, %rax
movq %rdi, %r11
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rdx
movl 0x20(%rsp), %ecx
movq %r9, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
testq %rsi, %rsi
je 0x1977
leaq -0x10(%r10), %rcx
movq %rcx, (%rsi)
subq $0x8, %rsp
leaq 0x18(%rsp), %r8
leaq 0x14(%rsp), %r9
movl $0x10, %esi
movl $0xc, %ecx
pushq %r11
pushq %r10
pushq %rax
pushq $0x10
pushq $0x1
callq 0x1030
addq $0x48, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/aezv3/ref/aez_ref.c
// Function: mult_block
static void mult_block(unsigned x, byte *src, byte *dst) {
    byte t[16], r[16];
    memcpy(t,src,16); memset(r,0,16);
    for ( ; x; x>>=1) {
        if (x&1) xor_bytes(r,t,16,r);
        double_block(t);
    }
    memcpy(dst,r,16);
}

// Assembly:
vmovdqu (%rsi), %xmm0
vmovdqa %xmm0, -0x18(%rsp)
vpxor %xmm0, %xmm0, %xmm0
testl %edi, %edi
je 0x1fb7
leaq -0x17(%rsp), %rax
movw $0x7fff, %cx            # imm = 0x7FFF
kmovd %ecx, %k1
vpbroadcastd 0x31be(%rip), %xmm1 # 0x5120
vmovdqa -0x18(%rsp), %xmm2
testb $0x1, %dil
je 0x1f72
vpxor %xmm0, %xmm2, %xmm0
movb -0x18(%rsp), %cl
vmovdqu8 (%rax), %xmm3 {%k1} {z}
vpsrlw $0x7, %xmm3, %xmm3
vpaddw %xmm2, %xmm2, %xmm2
vpternlogd $0xe4, %xmm1, %xmm3, %xmm2
vmovdqu8 %xmm2, -0x18(%rsp) {%k1}
movb -0x9(%rsp), %sil
addb %sil, %sil
sarb $0x7, %cl
andb $-0x79, %cl
xorb %sil, %cl
movb %cl, -0x9(%rsp)
movl %edi, %ecx
shrl %ecx
cmpl $0x1, %edi
movl %ecx, %edi
ja 0x1f62
vmovdqu %xmm0, (%rdx)
retq