LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/sachinites[P]CommandParser/ut/utinfra/ut_parser.c
// Function: ut_test_handler
int
ut_test_handler (param_t *param, 
                            ser_buff_t *tlv_buf, 
                            op_mode enable_or_disable) {

    tlv_struct_t *tlv = NULL;
    char *ut_file_name = NULL;
    char *ut_enable_flag = NULL;
    int tc_no = 0;
    int cmdcode = EXTRACT_CMD_CODE(tlv_buf);

    TLV_LOOP_BEGIN(tlv_buf, tlv){

        if (strncmp(tlv->leaf_id, "ut-file-name", strlen("ut-file-name")) == 0)
            ut_file_name =  tlv->value;
        else if (strncmp(tlv->leaf_id, "tc-no", strlen("tc-no")) == 0)
            tc_no = atoi(tlv->value);
        else if (strncmp(tlv->leaf_id, "ut-enable", strlen("ut-enable")) == 0)
            ut_enable_flag = tlv->value;
    } TLV_LOOP_END;

    switch(cmdcode) {
        case  CMDCODE_RUN_UT_TC:
            run_test_case (ut_file_name, tc_no);
            break;
        case CMDCODE_DEBUG_UT:
            set_ut_debug_flag(ut_enable_flag);
            break;
        default : ;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq (%rsi), %r14
movq %rsi, %rdi
callq 0x3fde
cltq
xorl %ebx, %ebx
pushq $0x64
popq %r12
xorl %edx, %edx
divq %r12
imulq $0x64, %rax, %rax
leaq (%r14,%rax), %rdi
addq $-0x40, %rdi
callq 0x1220
movl %eax, 0xc(%rsp)
movq (%r15), %r14
movq %r15, %rdi
callq 0x3fde
cltq
xorl %edx, %edx
divq %r12
movq %rax, %r15
decl %r15d
addq $0x24, %r14
leaq 0xf68(%rip), %r12       # 0x75d5
pushq $0xc
popq %rbp
movl $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
subl $0x1, %r15d
jb 0x66e6
leaq -0x20(%r14), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x1070
testl %eax, %eax
je 0x66cd
movq %r13, %rdi
leaq 0xf48(%rip), %rsi       # 0x75ef
pushq $0x5
popq %rdx
callq 0x1070
testl %eax, %eax
je 0x66d4
movq %r13, %rdi
leaq 0xe0a(%rip), %rsi       # 0x74c7
pushq $0x9
popq %rdx
callq 0x1070
testl %eax, %eax
cmoveq %r14, %rbx
jmp 0x66e0
movq %r14, 0x10(%rsp)
jmp 0x66e0
movq %r14, %rdi
callq 0x1220
movl %eax, 0x8(%rsp)
addq $0x64, %r14
jmp 0x6681
movl 0xc(%rsp), %eax
cmpl $0xa, %eax
je 0x6705
cmpl $0x9, %eax
jne 0x6720
movzwl 0x8(%rsp), %esi
movq 0x10(%rsp), %rdi
callq 0x54c4
jmp 0x6720
leaq 0xdbe(%rip), %rsi       # 0x74ca
pushq $0x6
popq %rdx
movq %rbx, %rdi
callq 0x1070
testl %eax, %eax
sete 0xbd09(%rip)            # 0x12429
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sachinites[P]CommandParser/ut/utinfra/ut_parser.c
// Function: cli_out
void
cli_out(unsigned char *buff, size_t buff_size) {

    if (!TC_RUNNING) {
        printf("%s", buff);
    }
    else {
        assert(buff_size < UT_PARSER_BUFF_MAX_SIZE);
         if (mq_send(UT_PARSER_MSG_Q_FD, (char *)buff , (buff_size + 1), 0) == -1 ) {
            printf ("mq_send failed on FD %d, errno = %d\n", UT_PARSER_MSG_Q_FD, errno);
         }
    }
}

// Assembly:
pushq %rbx
movq %rsi, %rdx
movq %rdi, %rsi
cmpb $0x0, 0xbce9(%rip)      # 0x12428
je 0x6761
cmpq $0x800, %rdx            # imm = 0x800
jae 0x678e
movl 0xbca8(%rip), %edi      # 0x123f8
incq %rdx
xorl %ecx, %ecx
callq 0x1110
cmpl $-0x1, %eax
je 0x6770
popq %rbx
retq
leaq 0x1989(%rip), %rdi      # 0x80f1
xorl %eax, %eax
popq %rbx
jmp 0x10e0
movl 0xbc82(%rip), %ebx      # 0x123f8
callq 0x1050
movl (%rax), %edx
leaq 0x232c(%rip), %rdi      # 0x8ab0
movl %ebx, %esi
xorl %eax, %eax
popq %rbx
jmp 0x10e0
leaq 0x22d1(%rip), %rdi      # 0x8a66
leaq 0x1f39(%rip), %rsi      # 0x86d5
leaq 0x22e7(%rip), %rcx      # 0x8a8a
movl $0x227, %edx            # imm = 0x227
callq 0x10f0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/sachinites[P]CommandParser/gluethread/glthread.c
// Function: delete_glthread_list
void
delete_glthread_list(glthread_t *glthread_head){

    glthread_t *glthreadptr = NULL;
               
    ITERATE_GLTHREAD_BEGIN(glthread_head, glthreadptr){
        remove_glthread(glthreadptr);
    } ITERATE_GLTHREAD_END(glthread_head, glthreadptr);
}

// Assembly:
pushq %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x683a
movq 0x8(%rdi), %rbx
callq 0x67e6
movq %rbx, %rdi
jmp 0x6827
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x6841
testq %rcx, %rcx
je 0x6862
movq 0x8(%rcx), %rax
movq %rsi, 0x8(%rcx)
movq %rcx, (%rsi)
jmp 0x686d
movq 0x8(%rdi), %rax
movq %rsi, 0x8(%rdi)
movq %rdi, (%rsi)
testq %rax, %rax
je 0x6879
movq %rax, 0x8(%rsi)
movq %rsi, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x68f6
cmpq $0x0, 0x8(%rbx)
jne 0x68fc
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 0x6974
movq 0x8(%rcx), %rax
movq %r13, 0x8(%rcx)
movq %rcx, (%r13)
testq %rax, %rax
je 0x6988
movq %rax, 0x8(%r13)
movq %r13, (%rax)
jmp 0x6988
cmpq $0x0, (%r14)
je 0x6953
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 0x6935
movq %rbx, %r12
movq 0x8(%rbx), %rbx
leaq (%r12,%r14), %rsi
movq %r13, %rdi
callq *%r15
cmpl $-0x1, %eax
jne 0x6912
testq %rbp, %rbp
je 0x695d
movq 0x8(%rbp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rbp)
movq %rbp, (%rcx)
testq %rax, %rax
je 0x6988
movq %rax, 0x8(%rcx)
movq %rcx, (%rax)
jmp 0x6988
movq %r13, 0x8(%r14)
movq %r14, (%r13)
jmp 0x6988
movq 0x10(%rsp), %rdx
movq 0x8(%rdx), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rdx)
movq %rdx, (%rcx)
jmp 0x6945
movq %r13, 0x8(%r14)
movq %r14, (%r13)
testq %rcx, %rcx
je 0x6988
movq %rcx, 0x8(%r13)
movq %r13, (%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x23b2
callq 0x27d0
pushq $0x8
popq %r12
leaq 0x39a3(%rip), %r13      # 0x5d60
cmpq $0x98, %r12
je 0x23f7
movq -0x8(%r12,%r13), %r14
movq (%r12,%r13), %r15
movq %r14, %rdi
callq 0x26df
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2170
testl %eax, %eax
jne 0x23fe
movq %rbx, %rdi
callq 0x2040
addq $0x10, %r12
jmp 0x23bd
xorl %edi, %edi
callq 0x2220
leaq 0x1bff(%rip), %rdi      # 0x4004
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x29dc
callq 0x2080
andl $0x0, (%rax)
movq %rbx, %rdi
callq 0x2040
pushq $0x1
popq %rdi
callq 0x2220
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x4015a1
incl 0x3056(%rip)            # 0x4045e8
leaq 0x2f87(%rip), %rdi      # 0x404520
pushq $0x1
popq %rsi
callq 0x401130
// File: /workspace/github_c_makefile_star2_O2/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
pushq $-0x1
popq %r13
cmpq %rcx, %rax
jb 0x25fe
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 0x2a6b(%rip), %rsi      # 0x5004
movq %r14, %rdi
callq 0x2180
testl %eax, %eax
jne 0x25fe
movl %r12d, %edi
callq 0x24d2
movq %rax, %r12
sarq $0x20, %r15
leaq (%r14,%r15), %rdi
addq $0x8, %rdi
movq %rax, %rsi
callq 0x2180
testl %eax, %eax
jne 0x25f6
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_O2/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 0x24d2
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 0x298c(%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 0x295d(%rip), %xmm0     # 0x5022
movups %xmm0, (%r15,%rax)
movups 0x295a(%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_O2/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, -0x2c(%rbp)
leal 0x1(%rsi), %eax
cltq
movq %rax, -0x38(%rbp)
movslq %esi, %r15
pushq $0x1
popq %r14
xorl %r13d, %r13d
movq -0x38(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x2170
movq %rax, %r12
movl -0x2c(%rbp), %edi
movq %rax, %rsi
movq %r15, %rdx
callq 0x2150
movq %rax, %rbx
testl %ebx, %ebx
jle 0x2783
leal (%r14,%rbx), %esi
incl %esi
cmpl $0x1, %r14d
jne 0x2760
movq %rsi, %rdi
callq 0x2220
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
callq 0x2070
jmp 0x2776
movq %r13, %rdi
callq 0x2240
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
callq 0x2310
addl %ebx, %r14d
movq %r12, %rdi
callq 0x2030
jmp 0x2718
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_O2/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
xorl %r12d, %r12d
pushq $0x1
popq %r13
movl %r14d, %edi
leaq -0x29(%rbp), %rsi
movq %r13, %rdx
callq 0x2150
testl %eax, %eax
js 0x282e
je 0x2828
movl %r15d, %eax
cmpq %rax, %r12
jne 0x27e9
addl %r15d, %r15d
movq (%rbx), %rdi
movslq %r15d, %rsi
callq 0x2240
movq %rax, (%rbx)
movzbl -0x29(%rbp), %eax
cmpl $0xd, %eax
ja 0x27fc
movl $0x2401, %ecx           # imm = 0x2401
btl %eax, %ecx
jb 0x280f
cmpl $0xff, %eax
je 0x280f
movq (%rbx), %rcx
movb %al, (%rcx,%r12)
incq %r12
jmp 0x27bb
leaq -0x29(%rbp), %rsi
pushq $0x1
popq %rdx
movl %r14d, %edi
callq 0x2150
movq (%rbx), %rax
movl %r12d, %ecx
movb $0x0, (%rax,%rcx)
incl %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2968
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_O2/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
pushq $-0x1
popq %rbx
cmpb $0x32, 0x9(%rdx)
jne 0x2aee
movq %rdx, %r14
cmpb $0x30, 0xa(%rdx)
jne 0x2aee
cmpb $0x30, 0xb(%r14)
jne 0x2aee
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 0x2954
movq %rax, %r12
movq %rax, %rdi
callq 0x20e0
testq %rax, %rax
je 0x2a7e
movq %rax, %rdi
callq 0x2140
jmp 0x2a95
callq 0x2040
cmpl $0x2, (%rax)
jne 0x2a95
movq %r12, %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x2080
movq %r12, %rdi
callq 0x2030
leaq 0x2882(%rip), %rsi      # 0x5326
movq %r15, %rdi
callq 0x22d0
testq %rax, %rax
je 0x2ade
movq %rax, %r13
movq %r14, %rdi
callq 0x29b7
movl %eax, %ebx
movslq %eax, %rdi
addq %r14, %rdi
movq %r13, %rsi
callq 0x2120
movq %r15, %rdi
callq 0x2030
movq %r13, %rdi
callq 0x20d0
jmp 0x2aee
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_O2/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 0x2b3c
movb $0x0, 0x4(%rbx)
leaq 0x251d(%rip), %rsi      # 0x503b
movq %rbx, %rdi
callq 0x2180
testl %eax, %eax
jne 0x2b3c
leaq 0x5(%rbx), %rax
movb (%rax), %cl
cmpb $0x3e, %cl
je 0x2b45
incq %rax
testb %cl, %cl
jne 0x2b2e
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_O2/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, %r15d
movq %rdi, %r14
pushq $0x8
popq %rdi
callq 0x2220
movq %rax, -0x40(%rbp)
movl $0x0, -0x2c(%rbp)
leaq -0x38(%rbp), %r13
cmpl $-0x1, %r15d
je 0x2c53
andq $0x0, -0x38(%rbp)
movq %r14, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x283d
cmpl $-0x1, %eax
jl 0x2c53
movl %eax, %r15d
movq -0x38(%rbp), %rdi
cmpb $0x3c, (%rdi)
jne 0x2c12
cmpb $0x61, 0x1(%rdi)
jne 0x2c12
cmpb $0x0, 0x2(%rdi)
jne 0x2c12
callq 0x2030
andq $0x0, -0x38(%rbp)
movq %r14, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x283d
cmpl $-0x1, %eax
jl 0x2c53
movl %eax, %r15d
movq -0x38(%rbp), %r12
movq %r12, %rdi
callq 0x2aff
testq %rax, %rax
jne 0x2c19
movq %r12, %rdi
callq 0x2030
jmp 0x2ba0
movq %rax, %rbx
movl -0x2c(%rbp), %eax
movslq %eax, %r12
testl %eax, %eax
je 0x2c39
leaq 0x10(,%r12,8), %rsi
movq -0x40(%rbp), %rdi
callq 0x2240
jmp 0x2c3d
movq -0x40(%rbp), %rax
leal 0x1(%r12), %ecx
movl %ecx, -0x2c(%rbp)
movq %rax, -0x40(%rbp)
movq %rbx, (%rax,%r12,8)
movq -0x38(%rbp), %rdi
jmp 0x2c12
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_O2/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 0x269c(%rip), %rsi      # 0x5326
movq %rax, %rdi
callq 0x22d0
movq %rax, %r14
movq %rbx, %rdi
callq 0x20e0
testq %rax, %rax
je 0x2d6a
movq %rax, %r15
movq %r15, %rdi
callq 0x2200
testq %rax, %rax
je 0x2d4c
movq %rax, %r13
cmpb $0x4, 0x12(%rax)
jne 0x2ca9
cmpb $0x2e, 0x13(%r13)
jne 0x2cdf
cmpb $0x0, 0x14(%r13)
je 0x2ca9
cmpb $0x2e, 0x14(%r13)
jne 0x2cdf
cmpb $0x0, 0x15(%r13)
je 0x2ca9
addq $0x13, %r13
movq %rbx, %rdi
callq 0x20f0
movq %rax, %r12
movq %r13, %rdi
callq 0x20f0
leaq (%r12,%rax), %rdi
addq $0x2, %rdi
callq 0x2220
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2070
movq %r12, %rdi
callq 0x20f0
movw $0x2f, (%r12,%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0x2310
movq %r14, %rdi
leaq 0x24a8(%rip), %rsi      # 0x51dd
movq %r12, %rdx
xorl %eax, %eax
callq 0x21a0
movq %r12, %rdi
callq 0x2030
jmp 0x2ca9
movq %r15, %rdi
callq 0x2140
movq %r14, %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_O2/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 0x2daf
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
xorl %edx, %edx
movzbl (%rdi), %eax
cmpl $0x2e, %eax
je 0x2d9c
testl %eax, %eax
je 0x2db2
addb $-0x30, %al
cmpb $0x9, %al
ja 0x2dc5
incl %edx
jmp 0x2d9e
incl %ecx
xorl %eax, %eax
cmpl $0x3, %ecx
jg 0x2dc7
incq %rdi
cmpl $0xc, %edx
jle 0x2d86
jmp 0x2dc7
xorl %eax, %eax
retq
cmpl $0x3, %ecx
sete %al
cmpl $0x4, %edx
setge %cl
andb %al, %cl
movzbl %cl, %eax
jmp 0x2dc7
xorl %eax, %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
callq 0x20e0
testq %rax, %rax
je 0x2dfe
movq %rax, %r14
pushq $0x3
popq %r15
pushq $-0x2
popq %rbx
movq %r14, %rdi
callq 0x2200
testq %rax, %rax
je 0x2e03
decl %r15d
jne 0x2dea
jmp 0x2e05
pushq $-0x1
popq %rbx
jmp 0x2e0d
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x2140
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r13d, %r13d
leaq 0x40e5(%rip), %r15      # 0x7210
pushq $0x1
popq %r14
movq %r15, %rdi
callq 0x2390
movl 0x40cb(%rip), %eax      # 0x7208
cmpq %rax, %r13
je 0x316a
movq 0x40b7(%rip), %rax      # 0x7200
movq (%rax,%r13,8), %rdi
incq %r13
movq (%rbx), %rsi
callq 0x2180
movl %eax, %r12d
movq %r15, %rdi
callq 0x2210
testl %r12d, %r12d
jne 0x312f
jmp 0x31af
cltq
leaq 0x1(%rax), %rcx
movl %ecx, 0x4092(%rip)      # 0x7208
movq 0x4083(%rip), %rdi      # 0x7200
leaq 0x8(,%rax,8), %rsi
callq 0x2240
movq %rax, 0x406f(%rip)      # 0x7200
movq (%rbx), %rcx
movslq 0x406d(%rip), %rdx      # 0x7208
movq %rcx, -0x8(%rax,%rdx,8)
leaq 0x4069(%rip), %rdi      # 0x7210
callq 0x2210
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
xorl %ebx, %ebx
movslq 0x4038(%rip), %rax      # 0x7208
movq 0x4029(%rip), %rdi      # 0x7200
cmpq %rax, %rbx
jge 0x31ea
movq (%rdi,%rbx,8), %rdi
callq 0x2030
incq %rbx
jmp 0x31c9
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x18
popq %rdi
callq 0x2220
movq %rax, %r14
movq %rax, (%rbx)
pushq $0x50
popq %rdi
callq 0x2220
movq %rax, (%r14)
movq $0xa, 0x8(%r14)
orl $-0x1, 0x10(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3ffd(%rip), %r14      # 0x7238
movq %r14, %rdi
callq 0x2390
movq (%rbx), %rax
cmpl $0x0, 0xc(%rax)
je 0x326f
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
jmp 0x323b
leaq 0x3fc2(%rip), %rdi      # 0x7238
popq %rbx
popq %r14
popq %rbp
jmp 0x2210
// File: /workspace/github_c_makefile_star2_O2/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 0x3f7f(%rip), %rdi      # 0x7238
callq 0x2390
movq (%rbx), %r15
movslq 0x8(%r15), %rsi
cmpl %esi, 0xc(%r15)
jl 0x32e7
leal (%rsi,%rsi), %eax
movl %eax, 0x8(%r15)
movq (%r15), %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 0x3f08(%rip), %rdi      # 0x7238
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2210
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3ee7(%rip), %r14      # 0x7238
movq %r14, %rdi
callq 0x2390
leaq 0x3f00(%rip), %r15      # 0x7260
movq (%rbx), %rax
cmpl $0x0, 0xc(%rax)
jg 0x3376
movq %r15, %rdi
movq %r14, %rsi
callq 0x20c0
jmp 0x3360
movq (%rax), %rcx
movslq 0x10(%rax), %rax
movq (%rcx,%rax,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 %r14, %rdi
callq 0x2030
movq (%rbx), %rax
decl 0x10(%rax)
decl 0xc(%rax)
leaq 0x3e80(%rip), %rdi      # 0x7238
callq 0x2210
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
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 0xf00(%rip), %rbp       # 0x20cb
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x126a
movl -0xc(%r15), %eax
cmpl $0x25, %eax
jne 0x11ed
movl -0x8(%r15), %eax
leaq 0x2f45(%rip), %rcx      # 0x4130
jmp 0x11f7
addl $-0x10, %eax
leaq 0x2e79(%rip), %rcx      # 0x4070
leaq (%rcx,%rax,8), %rax
movq (%rax), %r13
cmpq %r12, %rbx
jne 0x120f
leaq 0xe8f(%rip), %rdi       # 0x2099
callq 0x1030
leaq 0xe97(%rip), %rdi       # 0x20ad
movl %r12d, %esi
movq %r13, %rdx
xorl %eax, %eax
callq 0x1060
movl -0x10(%r15), %eax
testl %eax, %eax
je 0x1243
cmpl $0x1, %eax
jne 0x1256
movl (%r15), %esi
leaq 0xe80(%rip), %rdi       # 0x20ba
xorl %eax, %eax
callq 0x1060
jmp 0x1256
movsd (%r15), %xmm0
leaq 0xe75(%rip), %rdi       # 0x20c4
movb $0x1, %al
callq 0x1060
movq %rbp, %rdi
callq 0x1030
incq %r12
addq $0x18, %r15
jmp 0x11ce
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x12eb
movq 0x8(%rsi), %rsi
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x138a
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 0xead(%rip), %rax       # 0x2163
leaq 0xea7(%rip), %rdx       # 0x2164
cmoveq %rax, %rdx
movl 0x10(%rbx), %r9d
leaq 0xe20(%rip), %rdi       # 0x20ec
xorl %eax, %eax
callq 0x1060
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
callq 0x11ac
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
retq
movq 0x2d06(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xdd2(%rip), %rdi       # 0x20ce
pushq $0x1d
popq %rsi
pushq $0x1
popq %rdx
callq 0x10a0
pushq $-0x1
popq %rdi
callq 0x1090
nop
// File: /workspace/github_c_makefile_star2_O2/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 0xe41(%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)
pushq $0x28
popq %rsi
pushq $0x1
popq %rdx
movq %r13, %rdi
movq %rax, %rcx
callq 0x10a0
movq (%r13), %rdx
pushq $0x18
popq %rsi
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_O2/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 %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
leaq 0xdd2(%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
pushq $0x28
popq %rsi
pushq $0x1
popq %rdx
movq %rax, %rcx
callq 0x1040
movq 0x8(%rbx), %r15
pushq $0x18
popq %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1070
movq %rax, (%rbx)
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x1040
movq %r14, %rdi
callq 0x1050
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2c81(%rip), %rdi      # 0x4088
callq 0x1080
movl %eax, %ebx
movq 0x2c73(%rip), %rdi      # 0x4088
callq 0x1080
movl %eax, %ebp
shll $0x8, %ebp
orl %ebx, %ebp
movq 0x2c60(%rip), %rdi      # 0x4088
callq 0x1080
movl %eax, %ebx
shll $0x10, %ebx
movq 0x2c4f(%rip), %rdi      # 0x4088
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_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x7b51a(%rip), %rdi     # 0x81004
pushq $0x3f
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
movq %rbx, %rcx
callq 0x49c0
leaq 0x7b541(%rip), %rdi     # 0x81044
pushq $0x24
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x49c0
leaq 0x7b551(%rip), %rdi     # 0x81069
pushq $0x2e
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x49c0
leaq 0x7b56b(%rip), %rdi     # 0x81098
pushq $0x20
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x49c0
leaq 0x7b577(%rip), %rdi     # 0x810b9
pushq $0x29
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x49c0
leaq 0x7b58c(%rip), %rdi     # 0x810e3
pushq $0x48
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x49c0
movq 0xa746c(%rip), %rax     # 0xacfd8
xorl %edi, %edi
cmpq %rbx, (%rax)
sete %dil
callq 0x4600
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
pushq $0xe
popq %r12
leaq 0x7b596(%rip), %r15     # 0x8112c
movq 0xa7423(%rip), %r13     # 0xacfc0
movl %r12d, %ebp
movl %r14d, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x40e0
testl %eax, %eax
js 0x5bda
xorl %ebp, %ebp
cmpl $0x62, %eax
je 0x5ba0
cmpl $0x63, %eax
je 0x5b9d
cmpl $0x6d, %eax
je 0x5bcd
cmpl $0x74, %eax
je 0x5ba0
jmp 0x5c50
movq (%r13), %rdi
callq 0x4810
movl %eax, %ebp
jmp 0x5ba0
movq 0xa73ff(%rip), %r15     # 0xacfe0
movslq (%r15), %rax
cmpl %r14d, %eax
jge 0x5c5e
movq (%rbx,%rax,8), %rdi
leaq 0x7e3b1(%rip), %rsi     # 0x83fa5
callq 0x7f0f
testq %rax, %rax
je 0x5c6d
movq %rax, %r14
movl 0x4c(%rax), %eax
cmpl $0x6, %eax
ja 0x5c21
pushq $0x58
popq %rcx
btl %eax, %ecx
jae 0x5c21
movslq (%r15), %rax
movq (%rbx,%rax,8), %rdi
movl %ebp, %esi
callq 0x145d2
jmp 0x5c2f
movslq (%r15), %rax
movq (%rbx,%rax,8), %rdi
movl %ebp, %esi
callq 0x2c5b6
testl %eax, %eax
js 0x5c87
movq %r14, %rdi
callq 0x90e5
testl %eax, %eax
js 0x5ca1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x68, %eax
jne 0x5c5e
movq 0xa7354(%rip), %rax     # 0xacfb0
jmp 0x5c65
movq 0xa7373(%rip), %rax     # 0xacfd8
movq (%rax), %rdi
callq 0x5adc
movq 0xa7364(%rip), %rax     # 0xacfd8
movq (%rax), %rdi
movslq (%r15), %rax
movq (%rbx,%rax,8), %rdx
leaq 0x7b4ad(%rip), %rsi     # 0x81132
jmp 0x5cb9
movq 0xa734a(%rip), %rax     # 0xacfd8
movq (%rax), %rdi
movslq (%r15), %rax
movq (%rbx,%rax,8), %rdx
leaq 0x7b4a7(%rip), %rsi     # 0x81146
jmp 0x5cb9
movq 0xa7330(%rip), %rax     # 0xacfd8
movq (%rax), %rdi
movslq (%r15), %rax
movq (%rbx,%rax,8), %rdx
leaq 0x7b4ad(%rip), %rsi     # 0x81166
xorl %eax, %eax
callq 0x4730
pushq $0x1
popq %rdi
callq 0x4600
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdx
callq 0x1450
movl %eax, %ebx
movl %eax, %edi
callq 0x12cb
leaq 0x3e30(%rip), %rdi      # 0x5004
leaq 0x3e3c(%rip), %rsi      # 0x5017
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1050
leaq 0x3e3d(%rip), %rsi      # 0x502b
leaq -0x278(%rbp), %rdi
pushq $0xb
popq %rdx
callq 0x17ff
testl %eax, %eax
je 0x1212
leaq 0x4204(%rip), %rdi      # 0x540c
callq 0x1030
jmp 0x12bb
leaq 0x3e1a(%rip), %rsi      # 0x5033
leaq -0x278(%rbp), %rbx
pushq $0x9
popq %rdx
leaq -0x24(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rcx
callq 0x237d
movl %eax, %r12d
movl %eax, %edi
callq 0x12cb
leaq 0x3dc1(%rip), %r14      # 0x5004
leaq 0x3df2(%rip), %rsi      # 0x503c
movq %r14, %rdi
movl %r12d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1050
movl (%r15), %esi
leaq 0x3df9(%rip), %rdi      # 0x505d
xorl %eax, %eax
callq 0x1050
movq %rbx, %rdi
callq 0x27bb
movl %eax, %r15d
movl %eax, %edi
callq 0x12cb
leaq 0x3dea(%rip), %rsi      # 0x506e
movq %r14, %rdi
movl %r15d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1050
movq %rbx, %rdi
callq 0x2937
movl %eax, %ebx
movl %eax, %edi
callq 0x12cb
leaq 0x3dcd(%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_O2/mjosaarinen[P]brutus/crypto_aead/aezv3/ref/aez_ref.c
// Function: Decrypt
int Decrypt(byte *K, unsigned kbytes,
            byte *N, unsigned nbytes,
            byte *AD[], unsigned adbytes[],
            unsigned veclen, unsigned abytes,
            byte *C, unsigned cbytes, byte *M) {
    byte delta[16], *X, sum=0;
    unsigned i;
    if (cbytes < abytes) return -1;
    AEZhash(K, kbytes, N, nbytes, AD, adbytes, veclen, abytes*8, delta);
    X = (byte *)malloc(cbytes);
    if (cbytes==abytes) {
        AEZprf(K, kbytes, delta, abytes, X);
        for (i=0; i<abytes; i++) sum |= (X[i] ^ C[i]);
    } else {
        Decipher(K, kbytes, delta, C, cbytes, X);
        for (i=0; i<abytes; i++) sum |= X[cbytes-abytes+i];
        if (sum==0) memcpy(M,X,cbytes-abytes);
    }
    free(X);
    return (sum == 0 ? 0 : -1);  /* return 0 if valid, -1 if invalid */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl 0x88(%rsp), %ebp
movl 0x78(%rsp), %ebx
cmpl %ebx, %ebp
jae 0x11e1
pushq $-0x1
popq %rbp
jmp 0x12f0
movl %esi, %r15d
movq %rdi, %r12
movq 0x80(%rsp), %r14
movl 0x70(%rsp), %eax
leal (,%rbx,8), %esi
leaq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movl %esi, 0x8(%rsp)
movl %eax, (%rsp)
movq %r12, %rdi
movl %r15d, %esi
callq 0x1301
movl %ebp, %r13d
movq %r13, %rdi
callq 0x1050
movq %rbx, %rcx
movq %rax, %rbx
movl %ebp, %r8d
subl %ecx, %r8d
jne 0x125b
leaq 0x20(%rsp), %rdx
movq %r12, %rdi
movl %r15d, %esi
movl %ebp, %ecx
movq %rbx, %r8
callq 0x1516
xorl %eax, %eax
xorl %ecx, %ecx
cmpq %rax, %r13
je 0x1287
movb (%r14,%rax), %dl
xorb (%rbx,%rax), %dl
orb %dl, %cl
incq %rax
jmp 0x1248
testl %ebp, %ebp
je 0x12b0
movl %r8d, %r13d
cmpl $0x1f, %ebp
ja 0x128f
movq %rbx, (%rsp)
leaq 0x20(%rsp), %rdx
pushq $0x1
popq %r9
movq %r12, %rdi
movl %r15d, %esi
movq %r14, %rcx
movl %ebp, %r8d
callq 0x1df6
jmp 0x12ad
xorl %ebp, %ebp
negb %cl
sbbl %ebp, %ebp
jmp 0x12e8
movq %rbx, (%rsp)
leaq 0x20(%rsp), %rdx
pushq $0x1
popq %r9
movq %r12, %rdi
movl %r15d, %esi
movq %r14, %rcx
movl %ebp, %r8d
callq 0x21df
movl %r13d, %r8d
movq 0x90(%rsp), %rdi
movl 0x78(%rsp), %eax
movl %eax, %eax
xorl %ecx, %ecx
movl %r8d, %edx
subq $0x1, %rax
jb 0x12d2
movl %edx, %esi
orb (%rbx,%rsi), %cl
incl %edx
jmp 0x12c3
testb %cl, %cl
je 0x12db
pushq $-0x1
popq %rbp
jmp 0x12e8
movl %r8d, %edx
movq %rbx, %rsi
callq 0x10d0
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x1070
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
vxorps %xmm0, %xmm0, %xmm0
movq %rsp, %rax
vmovaps %xmm0, (%rax)
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r12
movl %esi, %r14d
movq %rdi, %r15
leaq 0x10(%rsp), %r13
cmpl $0x10, %ebp
jb 0x1584
movq %r12, %rdi
movq %rsp, %rsi
pushq $0x10
popq %rdx
movq %r13, %rcx
callq 0x1d24
movq %r15, %rdi
movl %r14d, %esi
pushq $-0x1
popq %rdx
pushq $0x3
popq %rcx
movq %r13, %r8
movq %rbx, %r9
callq 0x17ac
pushq $0xf
popq %rax
movl %eax, %ecx
decl %eax
incb (%rsp,%rcx)
je 0x1572
addl $-0x10, %ebp
addq $0x10, %rbx
jmp 0x1542
testl %ebp, %ebp
je 0x15c2
movq %rsp, %rsi
pushq $0x10
popq %rdx
leaq 0x10(%rsp), %r13
movq %r12, %rdi
movq %r13, %rcx
callq 0x1d24
pushq $-0x1
popq %rdx
pushq $0x3
popq %rcx
movq %r15, %rdi
movl %r14d, %esi
movq %r13, %r8
movq %r13, %r9
callq 0x17ac
movl %ebp, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x10d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq