LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/giometti[P]mastering_UNIX_programming/chapter_02/dsync.c
// Function: main
int main(int argc, char *argv[])
{
	int fd, n;
	char buf[MAX_SIZE];
	int ret;

	ret = open("data.bin", O_WRONLY | O_CREAT | O_DSYNC,
			S_IWUSR);
	if (ret < 0) {
		perror("open");
		return -1;
	}
	fd = ret;

	for (n = 0; n < 128; n++) {
		ret = write(fd, buf, n);
		if (ret < 0) {
			perror("write");
			return -1;
		}
	}

	close(fd);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
leaq 0xe65(%rip), %rdi       # 0x2004
movl $0x1041, %esi           # imm = 0x1041
movl $0x80, %edx
xorl %eax, %eax
callq 0x1070
testl %eax, %eax
js 0x11ef
movl %eax, %ebx
xorl %r14d, %r14d
movq %rsp, %r15
movl %ebx, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1040
testl %eax, %eax
js 0x11f8
incq %r14
cmpq $0x80, %r14
jne 0x11bc
movl %ebx, %edi
callq 0x1050
xorl %eax, %eax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
leaq 0xe17(%rip), %rdi       # 0x200d
jmp 0x11ff
leaq 0xe13(%rip), %rdi       # 0x2012
callq 0x1080
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x11e2
nop
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/bind_sfd.c
// Function: bind_sfd
int bind_sfd(char** arg,int sfd)
{
    struct sockaddr_in server_addr;
    server_addr.sin_addr.s_addr = inet_addr(arg[0]);
    server_addr.sin_family = AF_INET;
    server_addr.sin_port = htons(atoi(arg[1]));
    int ret = bind(sfd,(struct sockaddr*)&server_addr,sizeof(server_addr));
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x21d0
leaq -0x28(%rbp), %r15
movl %eax, 0x4(%r15)
movw $0x2, (%r15)
movq 0x8(%r14), %rdi
callq 0x22f0
rolw $0x8, %ax
movw %ax, 0x2(%r15)
movl %ebx, %edi
movq %r15, %rsi
movl $0x10, %edx
callq 0x2050
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/client_get.c
// Function: client_get
int client_get(int client_fd)
{
    MYSQL* connect;
    connect_mysql(&connect);
    int file_id;
    int ret = recv(client_fd,&file_id,sizeof(int),0);
    DISCON_CHECK(ret,0,client_fd);
    int file_name_len;
    ret = recv(client_fd,&file_name_len,sizeof(int),0);
    DISCON_CHECK(ret,0,client_fd);
    int path_len;
    ret = recv(client_fd,&path_len,sizeof(int),0);
    DISCON_CHECK(ret,0,client_fd);
    char file_name[128] = {0};
    ret = recv_client_all(client_fd,file_name,file_name_len);
    DISCON_CHECK(ret,-1,client_fd);
    char path[4096] = {0};
    ret = recv_client_all(client_fd,path,path_len);
    DISCON_CHECK(ret,-1,client_fd);
    printf("%s\n%s\n",file_name,path);
    send_file_to_client(client_fd,file_id,file_name,path,connect);
    close(client_fd);
    mysql_close(connect);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10a0, %rsp           # imm = 0x10A0
movl %edi, %ebx
leaq -0x38(%rbp), %rdi
callq 0x3530
leaq -0x2c(%rbp), %rsi
movl $0x4, %edx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x20a0
testl %eax, %eax
je 0x27ce
leaq -0x28(%rbp), %rsi
movl $0x4, %edx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x20a0
testl %eax, %eax
je 0x27ce
leaq -0x24(%rbp), %rsi
movl $0x4, %edx
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x20a0
testl %eax, %eax
je 0x27ce
xorps %xmm0, %xmm0
leaq -0xc0(%rbp), %rsi
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl -0x28(%rbp), %edx
movl %ebx, %edi
callq 0x481c
cmpl $-0x1, %eax
je 0x27ce
leaq -0x10c0(%rbp), %r15
xorl %r14d, %r14d
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rdi
xorl %esi, %esi
callq 0x2130
movl -0x24(%rbp), %edx
movl %ebx, %edi
movq %r15, %rsi
callq 0x481c
cmpl $-0x1, %eax
je 0x27ce
leaq 0x28f6(%rip), %rdi      # 0x5083
leaq -0xc0(%rbp), %r15
leaq -0x10c0(%rbp), %r12
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2040
movl -0x2c(%rbp), %esi
movq -0x38(%rbp), %r8
movl %ebx, %edi
movq %r15, %rdx
movq %r12, %rcx
callq 0x4b5c
movl %ebx, %edi
callq 0x2370
movq -0x38(%rbp), %rdi
callq 0x2250
jmp 0x27db
movl %ebx, %edi
callq 0x2370
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x10a0, %rsp           # imm = 0x10A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/compute_file_md5_2.c
// Function: compute_file_md5_2
int compute_file_md5_2(int fd,char* md5_str,int size)
{
    int i;
	int ret;
	unsigned char data[READ_DATA_SIZE];
	unsigned char md5_value[MD5_SIZE];
	MD5_CTX md5;


	// init md5
	MD5Init(&md5);

    int total = 0;
    while(total < size)
	{
        if(size - total > 4096)
		    ret = read(fd, data, 4096);
        else
            ret = read(fd,data,size - total);
		if (-1 == ret)
		{
			perror("read");
			close(fd);
			return -1;
		}
		MD5Update(&md5, data, ret);
        total += ret;
	}


	MD5Final(&md5, md5_value);

	// convert md5 value to md5 string
	for(i = 0; i < MD5_SIZE; i++)
	{
		snprintf(md5_str + i*2, 2+1, "%02x", md5_value[i]);
	}

	return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1078, %rsp           # imm = 0x1078
movl %edx, %r15d
movq %rsi, %rbx
movl %edi, -0x2c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x3c84
testl %r15d, %r15d
jle 0x34bd
xorl %r14d, %r14d
leaq -0x10a0(%rbp), %r12
movl %r15d, %eax
subl %r14d, %eax
movl $0x1000, %ecx           # imm = 0x1000
cmpl %ecx, %eax
cmovgel %ecx, %eax
movslq %eax, %rdx
movl -0x2c(%rbp), %edi
movq %r12, %rsi
callq 0x2290
movq %rax, %r13
cmpl $-0x1, %r13d
je 0x3514
leaq -0x98(%rbp), %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0x3ca2
addl %r13d, %r14d
cmpl %r15d, %r14d
jl 0x347c
leaq -0x98(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x45bb
xorl %r14d, %r14d
leaq 0x1f1c(%rip), %r15      # 0x53f3
xorl %r12d, %r12d
movzbl -0x40(%rbp,%r12), %ecx
movl $0x3, %esi
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2300
incq %r12
addq $0x2, %rbx
cmpq $0x10, %r12
jne 0x34da
movl %r14d, %eax
addq $0x1078, %rsp           # imm = 0x1078
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ed3(%rip), %rdi      # 0x53ee
callq 0x2180
movl -0x2c(%rbp), %edi
callq 0x2370
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x34ff
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/factory_init.c
// Function: factory_init
int factory_init(factory_t *p_fact,int pthread_num,int que_capacity,int epoll_fd)
{
    if(pthread_num < 1 || que_capacity < 1)
    {
        puts("pthread_num or que_capacity error!\n");
        return -1;
    }
    que_init(&p_fact->que,que_capacity);
    pthread_cond_init(&p_fact->cond,NULL);
    pthread_mutex_init(&p_fact->mutex,NULL);
    p_fact->epoll_fd = epoll_fd;
    p_fact->pthread_num = pthread_num;
    p_fact->pthId_arr = (pthread_t*)malloc(sizeof(pthread_t) * pthread_num);
    p_fact->pthread_func = thread_func;
    p_fact->start_flag = 0;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %r12d
testl %esi, %esi
setg %al
testl %edx, %edx
setg %cl
testb %cl, %al
jne 0x35d8
leaq 0x1e91(%rip), %rdi      # 0x545c
callq 0x22e0
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x362b
movl %esi, %r15d
movq %rdi, %rbx
addq $0x20, %rdi
movl %edx, %esi
callq 0x4720
leaq 0x60(%rbx), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x2220
leaq 0x38(%rbx), %rdi
xorl %esi, %esi
callq 0x22b0
movl %r12d, 0x8(%rbx)
movl %r15d, 0x4(%rbx)
movl %r15d, %edi
shlq $0x3, %rdi
callq 0x2240
movq %rax, 0x10(%rbx)
leaq 0x16(%rip), %rax        # 0x3637
movq %rax, 0x18(%rbx)
movl $0x0, (%rbx)
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/factory_start.c
// Function: factory_start
int factory_start(factory_t* p_fact)
{
    if(p_fact->start_flag == 0)
    {
        for(int i = 0; i < p_fact->pthread_num; ++i)
        {
            pthread_create(p_fact->pthId_arr + i,NULL,p_fact->pthread_func,p_fact);
        }
        p_fact->start_flag = 1;
    }
    return 0;
}

// Assembly:
cmpl $0x0, (%rdi)
jne 0x37db
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x4(%rdi)
jle 0x37cb
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rdi
addq %r14, %rdi
movq 0x18(%rbx), %rdx
xorl %esi, %esi
movq %rbx, %rcx
callq 0x2320
incq %r15
movslq 0x4(%rbx), %rax
addq $0x8, %r14
cmpq %rax, %r15
jl 0x37a6
movl $0x1, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/get_file_id.c
// Function: get_file_id
int get_file_id(char* mysql_oper,int user_id,MYSQL* connect)
{
    sprintf(mysql_oper,"select file_id from File where user_id=%d;",user_id);
    int queryResult = mysql_query(connect,mysql_oper);
    if(queryResult)
    {
        printf("%s\n",mysql_error(connect));
        return -1;
    }
    MYSQL_ROW row;
    MYSQL_RES* res;
    res = mysql_use_result(connect);
    row = mysql_fetch_row(res);
    int ret = atoi(row[0]);
    mysql_free_result(res);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %edx
movq %rdi, %r14
leaq 0x1c88(%rip), %rsi      # 0x54a6
xorl %eax, %eax
callq 0x2060
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2140
movq %rbx, %rdi
testl %eax, %eax
je 0x384b
callq 0x20b0
movq %rax, %rdi
callq 0x22e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3871
callq 0x2330
movq %rax, %rbx
movq %rax, %rdi
callq 0x21f0
movq (%rax), %rdi
callq 0x22f0
movl %eax, %r14d
movq %rbx, %rdi
callq 0x21e0
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/get_user_id.c
// Function: get_user_id
int get_user_id(char* mysql_oper,const char* user_name,MYSQL* connect)
{
    sprintf(mysql_oper,"select user_id from User where user_name='%s'",user_name);
    int queryResult = mysql_query(connect,mysql_oper);
    if(queryResult)
    {
        printf("%s\n",mysql_error(connect));
        return -1;
    }
    MYSQL_ROW row;
    MYSQL_RES* res;
    res = mysql_use_result(connect);
    row = mysql_fetch_row(res);
    int ret = atoi(row[0]);
    mysql_free_result(res);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %rdx
movq %rdi, %r14
leaq 0x1bc9(%rip), %rsi      # 0x54e0
xorl %eax, %eax
callq 0x2060
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2140
movq %rbx, %rdi
testl %eax, %eax
je 0x3944
callq 0x20b0
movq %rax, %rdi
callq 0x22e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x396a
callq 0x2330
movq %rax, %rbx
movq %rax, %rdi
callq 0x21f0
movq (%rax), %rdi
callq 0x22f0
movl %eax, %r14d
movq %rbx, %rdi
callq 0x21e0
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/is_match.c
// Function: is_match
int is_match(const char* user_name,const char* user_passwd,MYSQL* connect)
{
    char sha512[256] = {0};
    strcpy(sha512,"$6$");
    char mysql_oper[256];
    sprintf(mysql_oper,"select salt,cryptpasswd from User where user_name='%s'",user_name);
    int queryResult = mysql_query(connect,mysql_oper);
    if(queryResult)
    {
        printf("%s\n",mysql_error(connect));
        return -1;
    }
    MYSQL_ROW row;
    MYSQL_RES* res;
    res = mysql_use_result(connect);
    row = mysql_fetch_row(res);
    sprintf(sha512 + 3,"%s",row[0]);
    void* crypt_add = NULL;
    int crypt_size = 0;
    crypt_ra(user_passwd,sha512,&crypt_add,&crypt_size);
    int len = strlen(sha512) + 1;
    sha512[len - 1] = '$';
    sprintf(sha512 + len,"%s",row[1]);
    mysql_free_result(res);
    int ret = strcmp(sha512,(const char*)crypt_add);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq -0x140(%rbp), %r12
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
xorl %esi, %esi
callq 0x2130
movl $0x243624, (%r12)       # imm = 0x243624
leaq 0x1b24(%rip), %rsi      # 0x550e
leaq -0x240(%rbp), %r12
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2060
movq %r14, %rdi
movq %r12, %rsi
callq 0x2140
movq %r14, %rdi
testl %eax, %eax
je 0x3a27
callq 0x20b0
movq %rax, %rdi
callq 0x22e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3ab1
callq 0x2330
movq %rax, %r14
movq %rax, %rdi
callq 0x21f0
movq %rax, %r12
leaq -0x13d(%rbp), %rdi
movq (%rax), %rsi
callq 0x21b0
leaq -0x38(%rbp), %r15
movq $0x0, (%r15)
leaq -0x2c(%rbp), %rcx
movl $0x0, (%rcx)
leaq -0x140(%rbp), %r13
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x2230
movq %r13, %rdi
callq 0x20c0
cltq
movb $0x24, -0x140(%rbp,%rax)
incl %eax
cltq
leaq (%rax,%rbp), %rdi
addq $-0x140, %rdi           # imm = 0xFEC0
movq 0x8(%r12), %rsi
callq 0x21b0
movq %r14, %rdi
callq 0x21e0
movq (%r15), %rsi
movq %r13, %rdi
callq 0x2280
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/query.c
// Function: query
MYSQL_RES* query(char* mysql_oper,MYSQL* connect)
{
    int queryResult = mysql_query(connect,mysql_oper);
    if(queryResult)
    {
        printf("%s\n",mysql_error(connect));
        return NULL;
    }
    MYSQL_RES* res;
    res = mysql_use_result(connect);
    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rsi
movq %rbx, %rdi
callq 0x2140
movq %rbx, %rdi
testl %eax, %eax
je 0x46d9
callq 0x20b0
movq %rax, %rdi
callq 0x22e0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2330
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/query2.c
// Function: query2
MYSQL_RES* query2(char* mysql_oper,MYSQL* connect)
{
    int queryResult = mysql_query(connect,mysql_oper);
    if(queryResult)
    {
        printf("%s\n",mysql_error(connect));
        return NULL;
    }
    return mysql_store_result(connect);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rsi
movq %rbx, %rdi
callq 0x2140
movq %rbx, %rdi
testl %eax, %eax
je 0x4715
callq 0x20b0
movq %rax, %rdi
callq 0x22e0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2120
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/queue.c
// Function: que_push
int que_push(que_t* p_queue,int client_fd,int ctl_no)
{
    if(p_queue->que_size == p_queue->que_capacity)
        return -1;
    struct Queue_node* new_node = (struct Queue_node*)malloc(sizeof(struct Queue_node));
    memset(new_node,0,sizeof(struct Queue_node));
    new_node->client_fd = client_fd;
    new_node->ctl_no = ctl_no;
    if(p_queue->que_size == 0)
    {
        p_queue->head = new_node;
        p_queue->tail = new_node;
    }
    else
    {
        p_queue->tail->next = new_node;
        p_queue->tail = new_node;
    }
    p_queue->que_size++;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x4(%rdi), %r12d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl (%rdi), %r12d
je 0x478f
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
movl $0x10, %edi
callq 0x2240
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl %r15d, (%rax)
movl %r14d, 0x4(%rax)
testl %r12d, %r12d
je 0x477e
movq 0x10(%rbx), %rcx
movq %rax, 0x8(%rcx)
jmp 0x4782
movq %rax, 0x8(%rbx)
movq %rax, 0x10(%rbx)
incl %r12d
movl %r12d, 0x4(%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/queue.c
// Function: que_pop
int que_pop(que_t* p_queue,struct Queue_node** pop_node)
{
    if(p_queue->que_size == 0)
        return -1;
    *pop_node = p_queue->head;
    p_queue->head = p_queue->head->next;
    p_queue->que_size--;
    return 0;
}

// Assembly:
movl 0x4(%rdi), %eax
testl %eax, %eax
je 0x47bf
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rcx
movq %rcx, (%rsi)
movq 0x8(%rdi), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rdi)
decl %eax
movl %eax, 0x4(%rdi)
xorl %eax, %eax
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/queue.c
// Function: que_free
void que_free(que_t* p_queue)
{
    if(p_queue->que_size == 0)
        return;
    for(int i = 0;i < p_queue->que_size; ++i)
    {
        struct Queue_node* node = p_queue->head;
        p_queue->head = p_queue->head->next;
        free(node);
    }
    p_queue->head = p_queue->tail = NULL;
    p_queue->que_size = 0;
}

// Assembly:
cmpl $0x0, 0x4(%rdi)
je 0x4818
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4(%rdi), %r14
cmpl $0x0, (%r14)
jle 0x47ff
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
movq 0x8(%rdi), %rax
movq %rax, 0x8(%rbx)
callq 0x2210
incl %r15d
cmpl 0x4(%rbx), %r15d
jl 0x47e5
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movl $0x0, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/recv_n_bytes.c
// Function: recv_n_bytes
int recv_n_bytes(int fd,void* buf,int len)
{
    int total = 0;
    int ret;
    while(total < len)
    {
        ret = recv(fd,(char*)buf + total,len - total,MSG_WAITALL);
        if(ret == 0)
        {
            printf("server disconnected!\n");
            return -1;
        }
        total += ret;
    }
    return 0;
}

// Assembly:
testl %edx, %edx
jle 0x48b9
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %r15d
xorl %r12d, %r12d
movslq %r12d, %rax
leaq (%r14,%rax), %rsi
movl %ebx, %ecx
subl %eax, %ecx
movslq %ecx, %rdx
movl %r15d, %edi
movl $0x100, %ecx            # imm = 0x100
callq 0x20a0
testl %eax, %eax
je 0x48bc
addl %eax, %r12d
cmpl %ebx, %r12d
jl 0x488e
xorl %eax, %eax
jmp 0x48cd
xorl %eax, %eax
retq
leaq 0xcbd(%rip), %rdi       # 0x5580
callq 0x22e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/recv_user_file.c
// Function: recv_user_file
int recv_user_file(int client_fd,int file_fd,off_t file_size)
{
    int total = 0;
    int pipefd[2];
    int ret = pipe(pipefd);
    ERROR_CHECK(ret,-1,"pipe");
    while(total < file_size)
    {
        ret = splice(client_fd,NULL,pipefd[1],NULL,4096,SPLICE_F_MOVE|SPLICE_F_MORE);
        ERROR_CHECK(ret,-1,"splice");
        ret = splice(pipefd[0],NULL,file_fd,NULL,ret,SPLICE_F_MOVE|SPLICE_F_MORE);
        ERROR_CHECK(ret,-1,"splice");
        total += ret;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r14d
movl %edi, %r15d
leaq -0x30(%rbp), %rdi
callq 0x2260
cmpl $-0x1, %eax
je 0x4965
testq %rbx, %rbx
jle 0x4954
xorl %r13d, %r13d
leaq 0xc8e(%rip), %r12       # 0x559a
movl -0x2c(%rbp), %edx
movl $0x1000, %r8d           # imm = 0x1000
movl %r15d, %edi
xorl %esi, %esi
xorl %ecx, %ecx
movl $0x5, %r9d
callq 0x20e0
cmpl $-0x1, %eax
je 0x496c
movl -0x30(%rbp), %edi
movslq %eax, %r8
xorl %esi, %esi
movl %r14d, %edx
xorl %ecx, %ecx
movl $0x5, %r9d
callq 0x20e0
cmpl $-0x1, %eax
je 0x496c
addl %eax, %r13d
movslq %r13d, %rax
cmpq %rbx, %rax
jl 0x490c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc29(%rip), %r12       # 0x5595
movq %r12, %rdi
callq 0x2180
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4956
nop
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/update_user_table.c
// Function: update_user_table
int update_user_table(char* mysql_oper,int user_id,int file_id,MYSQL* connect)
{
    sprintf(mysql_oper,"update User set dir_id=%d where user_id=%d;",file_id,user_id);
    int queryResult = mysql_query(connect,mysql_oper);
    if(queryResult)
    {
        printf("%s\n",mysql_error(connect));
        return -1;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %esi, %ecx
movq %rdi, %r15
leaq 0x7fb(%rip), %rsi       # 0x562c
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x2060
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2140
testl %eax, %eax
je 0x4e60
movq %rbx, %rdi
callq 0x20b0
movq %rax, %rdi
callq 0x22e0
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/VeeeectorPan[P]MyNetdisk/SourceFile/user_name_avaialbe.c
// Function: user_name_avaiable
int user_name_avaiable(const char* user_name,MYSQL* connect)
{
    char buf[128];
    sprintf(buf,"select * from User where user_name='%s'",user_name);
    unsigned int queryRet = mysql_query(connect,buf);
    if(queryRet)
    {
        printf("Mysql query error: %s\n",mysql_error(connect));
        return -1;
    }
    MYSQL_RES* res;
    res = mysql_store_result(connect);
    return (mysql_num_rows(res) == 0)? 1: 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %rbx
movq %rdi, %rdx
leaq 0x7cd(%rip), %rsi       # 0x5658
leaq -0x90(%rbp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2060
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2140
movq %rbx, %rdi
testl %eax, %eax
je 0x4ecb
callq 0x20b0
leaq 0x25b(%rip), %rdi       # 0x5115
movq %rax, %rsi
xorl %eax, %eax
callq 0x2040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4ee3
callq 0x2120
movq %rax, %rdi
callq 0x2190
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
sete %al
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/dwelch67[P]lc3/vsim.c
// Function: fetch_mem
unsigned short fetch_mem ( unsigned short add )
{
    unsigned short data;
    fetch_mem_count++;
    data=mem[add];
    printf("fetch_mem[0x%04X]=>0x%04X\n",add,data);
    return(data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %esi
incl 0x3e46(%rip)            # 0x5090
movl %edi, %eax
leaq 0x3e4d(%rip), %rcx      # 0x50a0
movzwl (%rcx,%rax,2), %eax
movzwl %ax, %ebx
leaq 0x1de3(%rip), %rdi      # 0x3044
movl %ebx, %edx
xorl %eax, %eax
callq 0x1060
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/dwelch67[P]lc3/vsim.c
// Function: read_mem
unsigned short read_mem ( unsigned short add )
{
    unsigned short data;
    read_mem_count++;
    data=mem[add];
    printf("read_mem[0x%04X]=>0x%04X\n",add,data);
    return(data);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %esi
incl 0x23e1f(%rip)           # 0x250a0
movl %edi, %eax
leaq 0x3e16(%rip), %rcx      # 0x50a0
movzwl (%rcx,%rax,2), %eax
movzwl %ax, %ebx
leaq 0x1dc7(%rip), %rdi      # 0x305f
movl %ebx, %edx
xorl %eax, %eax
callq 0x1060
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/USArmyResearchLab[P]ARL_OpenSHMEM/test/hello.c
// Function: main
int main(int argc, char* argv[])
{
	int err = 0;
	int major, minor;
	char name[SHMEM_MAX_NAME_LEN];

	// Starts/Initializes SHMEM/OpenSHMEM
	// Some implementations use the deprecated start_pes(0)
	shmem_init();

	// Fetch the number or processes
	// Some implementations use the deprecated num_pes()
	int n_pes = shmem_n_pes();

	// Assign my process ID to me
	int me = shmem_my_pe();

	// Query 
	shmem_info_get_name(name);
	shmem_info_get_version(&major, &minor);

	if (me == 0) {
		printf("# API   : %s (%d.%d)\n", name, major, minor);
		printf("# HEADER: %s (%d.%d)\n", SHMEM_VENDOR_STRING,
			SHMEM_MAJOR_VERSION, SHMEM_MINOR_VERSION);
	}

	// Global barrier
	shmem_barrier_all();

	// Comparing shmem.h header values and API values
	if (strncmp(name, SHMEM_VENDOR_STRING, SHMEM_MAX_NAME_LEN)) {
		printf("# %d: ERROR: vendor name mismatch\n", me);
		err++;
	}
	if (major != SHMEM_MAJOR_VERSION) {
		printf("# %d: ERROR: major version mismatch\n", me);
		err++;
	}
	if (minor != SHMEM_MINOR_VERSION) {
		printf("# %d: ERROR: minor version mismatch\n", me);
		err++;
	}

	printf("Hello, World from %d of %d\n", me, n_pes);

	return(err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
callq 0x1530
leaq 0x3d3f(%rip), %rax      # 0x5144
movl (%rax), %ebx
leaq 0x3d32(%rip), %rax      # 0x5140
movl (%rax), %r14d
leaq -0x60(%rbp), %rdi
callq 0x1500
leaq -0x20(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x1520
testl %r14d, %r14d
jne 0x1463
movl -0x20(%rbp), %edx
movl -0x1c(%rbp), %ecx
leaq 0x1bcb(%rip), %rdi      # 0x3004
leaq -0x60(%rbp), %rsi
xorl %eax, %eax
callq 0x10e0
leaq 0x1bcf(%rip), %rdi      # 0x301a
leaq 0x1bde(%rip), %rsi      # 0x3030
movl $0x1, %edx
movl $0x4, %ecx
xorl %eax, %eax
callq 0x10e0
callq 0x14f4
leaq 0x1bc1(%rip), %rsi      # 0x3030
leaq -0x60(%rbp), %rdi
movl $0x33, %edx
callq 0x11b0
testl %eax, %eax
je 0x149a
leaq 0x1bdb(%rip), %rdi      # 0x3063
movl %r14d, %esi
xorl %eax, %eax
callq 0x10e0
movl $0x1, %r15d
jmp 0x149d
xorl %r15d, %r15d
cmpl $0x1, -0x20(%rbp)
je 0x14b7
leaq 0x1bdc(%rip), %rdi      # 0x3086
movl %r14d, %esi
xorl %eax, %eax
callq 0x10e0
incl %r15d
cmpl $0x4, -0x1c(%rbp)
je 0x14d1
leaq 0x1be7(%rip), %rdi      # 0x30ab
movl %r14d, %esi
xorl %eax, %eax
callq 0x10e0
incl %r15d
leaq 0x1bf8(%rip), %rdi      # 0x30d0
movl %r14d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x10e0
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/main.c
// Function: main
int				main(int argc, char **argv, char **envp)
{
	t_shell shell;
	char	*line;
	char	*tmp;
	char	curr_pwd[1024];

	line = NULL;
	shell.stat_loc = 0;
	shell.instructions = NULL;
	shell.env = ft_strdup_matrix(envp);
	getcwd(curr_pwd, 1024);
	tmp = ft_strjoin("PWD=", curr_pwd);
	ft_export(&shell, tmp);
	free(tmp);
	handle_shlvl(&shell);
	tmp = ft_strdup("_=/bin/bash");
	ft_export(&shell, tmp);
	free(tmp);
	if (argc == 3 && ft_strcmp(argv[1], "-c"))
		exec_argument(ft_strdup(argv[2]), &shell);
	else
		read_input(line, &shell);
	return (shell.stat_loc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x8(%rsp), %r14
movl $0x0, 0x28(%r14)
movq $0x0, (%r14)
movq %rdx, %rdi
callq 0x499e
movq %rax, 0x20(%r14)
leaq 0x40(%rsp), %r15
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdi
callq 0x10a0
leaq 0x4dbb(%rip), %rdi      # 0x60c6
movq %r15, %rsi
callq 0x5254
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x271a
movq %r15, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x4db0
leaq 0x4ccc(%rip), %rdi      # 0x6004
callq 0x5210
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x271a
movq %r15, %rdi
callq 0x1030
cmpl $0x3, %ebp
jne 0x13de
movq 0x8(%rbx), %rdi
leaq 0x4ca9(%rip), %rsi      # 0x6010
callq 0x5478
testq %rax, %rax
je 0x13de
movq 0x10(%rbx), %rdi
callq 0x5210
movq %rax, %r14
movq %rax, %rdi
callq 0x352c
movq %rax, %rbx
movq %r14, %rdi
callq 0x1030
testq %rbx, %rbx
je 0x13a4
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x175d
jmp 0x13ac
movl $0x2, 0x30(%rsp)
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x4874
movq (%rbx), %rdi
callq 0x484c
movq (%rbx), %rdi
callq 0x1030
movl 0x28(%rbx), %eax
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %r14
movq $0x0, (%r14)
movl $0x1, %edi
callq 0x1080
movl %eax, %ebx
leaq 0x33a1(%rip), %r15      # 0x479c
movl $0x3, %edi
movq %r15, %rsi
callq 0x1120
movl $0x2, %edi
movq %r15, %rsi
callq 0x1120
movl %ebx, %edi
movl $0x1, %esi
callq 0x1070
leaq 0x4eef(%rip), %rdi      # 0x6317
movl $0x1, %esi
callq 0x50a0
movq %r14, %rdi
callq 0x46f5
testl %eax, %eax
je 0x14b9
leaq 0x3357(%rip), %r14      # 0x479c
leaq 0x4ecb(%rip), %r15      # 0x6317
movq %rsp, %r12
leaq 0x8(%rsp), %r13
movq (%rsp), %rdi
callq 0x352c
movq %rax, %rbp
movq (%rsp), %rdi
callq 0x1030
testq %rbp, %rbp
je 0x147f
movq %rbp, (%rsp)
movq %rbp, %rdi
movq %r13, %rsi
callq 0x175d
jmp 0x1487
movl $0x2, 0x30(%rsp)
movl $0x2, %edi
movq %r14, %rsi
callq 0x1120
movl %ebx, %edi
movl $0x1, %esi
callq 0x1070
movq %r15, %rdi
movl $0x1, %esi
callq 0x50a0
movq %r12, %rdi
callq 0x46f5
testl %eax, %eax
jne 0x1454
leaq 0x4b53(%rip), %rdi      # 0x6013
movl $0x1, %esi
callq 0x5058
leaq 0x8(%rsp), %rdi
callq 0x4874
movq (%rsp), %rdi
callq 0x1030
xorl %edi, %edi
callq 0x1190
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/shell/shell.c
// Function: get_path
char			*get_path(t_shell *shell)
{
	char *value;
	char *tmp;
	char *path;
	char **paths;

	value = get_env(shell, "PATH");
	if (!value || ft_strlen(value) == 0)
	{
		free(value);
		path = search_binary_in_pwd(shell);
	}
	else
	{
		tmp = append_pwd(value);
		paths = ft_split(tmp, ':');
		path = search_binary(shell, paths);
		free(value);
		free(tmp);
		clean_matrix(paths);
		free(paths);
	}
	return (path);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4b22(%rip), %rsi      # 0x6018
callq 0x1dd3
movq %rax, %r14
testq %rax, %rax
je 0x1568
movq %r14, %rdi
callq 0x541c
testq %rax, %rax
je 0x1568
movq %r14, %rdi
callq 0x18f1
movq %rax, %r15
movq %rax, %rdi
movl $0x3a, %esi
callq 0x50c8
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0x441c
movq %rax, %rbx
movq %r14, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1030
movq %r12, %rdi
callq 0x484c
movq %r12, %rdi
callq 0x1030
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
callq 0x1030
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4368
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/shell/shell.c
// Function: run_command
int				run_command(t_shell *shell)
{
	pid_t	pid;
	char	*path;
	char	*tmp;

	shell->is_binary = 0;
	path = get_path(shell);
	if (path)
	{
		if ((pid = fork()) == 0 && check_permissions(shell, path))
		{
			execve(path, shell->args, shell->env);
			exit(shell->stat_loc);
		}
		signal(SIGINT, signal_handler_waiting);
		waitpid(pid, &shell->stat_loc, 0);
		if (WIFEXITED(shell->stat_loc))
			shell->stat_loc = WEXITSTATUS(shell->stat_loc);
		if (shell->stat_loc == -1)
			ft_putstr_fd("\n", 1);
		tmp = update_last_arg(shell->args);
		ft_export(shell, tmp);
		free(tmp);
	}
	free(path);
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x0, 0x30(%rdi)
callq 0x14e4
movq %rax, %r14
testq %rax, %rax
je 0x161f
callq 0x11b0
movl %eax, %ebp
testl %eax, %eax
jne 0x15bb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d08
testl %eax, %eax
jne 0x1637
leaq 0x3212(%rip), %rsi      # 0x47d4
movl $0x2, %edi
callq 0x1120
leaq 0x28(%rbx), %r15
movl %ebp, %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x1170
movl 0x28(%rbx), %eax
testb $0x7f, %al
jne 0x15e9
movzbl %ah, %eax
movl %eax, (%r15)
cmpl $-0x1, (%r15)
jne 0x1600
leaq 0x4a27(%rip), %rdi      # 0x601d
movl $0x1, %esi
callq 0x50a0
movq 0x18(%rbx), %rdi
callq 0x18de
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x271a
movq %r15, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
movq %r14, %rdi
callq 0x1100
movl 0x28(%rbx), %edi
callq 0x1190
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/shell/shell.c
// Function: check_builtin
int				check_builtin(t_shell *shell)
{
	int		ret;
	char	*tmp;

	ret = 0;
	if (ft_strcmp(shell->args[0], "exit"))
		ft_exit(shell);
	else if (ft_strcmp(shell->args[0], "echo"))
		ret = ft_echo(shell->args + 1);
	else if (ft_strcmp(shell->args[0], "cd"))
		ret = ft_cd(shell);
	else if (ft_strcmp(*shell->args, "pwd"))
		ret = ft_pwd(shell);
	else if (ft_strcmp(*shell->args, "export"))
		ret = exec_export(shell);
	else if (ft_strcmp(*shell->args, "unset"))
		ret = ft_unset(shell);
	else
		return (exec_env(shell));
	tmp = update_last_arg(shell->args);
	ft_export(shell, tmp);
	free(tmp);
	return (ret);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movq (%rax), %rdi
leaq 0x49af(%rip), %rsi      # 0x6013
callq 0x5478
testq %rax, %rax
je 0x167d
movq %rbx, %rdi
callq 0x2b50
xorl %ebp, %ebp
jmp 0x172b
movq 0x18(%rbx), %rax
movq (%rax), %rdi
leaq 0x4994(%rip), %rsi      # 0x601f
callq 0x5478
movq 0x18(%rbx), %rdi
testq %rax, %rax
je 0x16a7
addq $0x8, %rdi
callq 0x237c
jmp 0x1729
movq (%rdi), %rdi
leaq 0x4973(%rip), %rsi      # 0x6024
callq 0x5478
testq %rax, %rax
je 0x16c5
movq %rbx, %rdi
callq 0x1f10
jmp 0x1729
movq 0x18(%rbx), %rax
movq (%rax), %rdi
leaq 0x4954(%rip), %rsi      # 0x6027
callq 0x5478
testq %rax, %rax
je 0x16e7
movq %rbx, %rdi
callq 0x2450
jmp 0x1729
movq 0x18(%rbx), %rax
movq (%rax), %rdi
leaq 0x4936(%rip), %rsi      # 0x602b
callq 0x5478
testq %rax, %rax
je 0x1709
movq %rbx, %rdi
callq 0x19f8
jmp 0x1729
movq 0x18(%rbx), %rax
movq (%rax), %rdi
leaq 0x491b(%rip), %rsi      # 0x6032
callq 0x5478
testq %rax, %rax
je 0x1751
movq %rbx, %rdi
callq 0x24b0
movl %eax, %ebp
movq 0x18(%rbx), %rdi
callq 0x18de
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x271a
movq %r14, %rdi
callq 0x1030
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1a17
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/shell/shell.c
// Function: minishell
void			minishell(char *line, t_shell *shell)
{
	size_t	it;
	size_t	jt;

	it = 0;
	line = safe_allocate(line, inject_spaces);
	if (validate_input(shell, line))
	{
		shell->instructions = ft_split_non_escaped(line, ';');
		while (shell->instructions[it])
		{
			jt = 0;
			shell->stat_loc = 0;
			while (is_space(shell->instructions[it][jt]))
				jt++;
			shell->commands = ft_split_non_escaped(&shell->instructions[it][jt],
					'|');
			handle_commands(shell);
			shell->previous_stat = shell->stat_loc;
			free(shell->commands);
			it++;
		}
	}
	free(line);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x51e(%rip), %rsi       # 0x1c8d
callq 0x19c5
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3cc0
testl %eax, %eax
je 0x18a3
movq %r14, %rdi
movl $0x3b, %esi
callq 0x3a48
movq %rax, (%rbx)
cmpq $0x0, (%rax)
je 0x18a3
xorl %r12d, %r12d
movl $0x0, 0x28(%rbx)
movq $-0x1, %r15
movq (%rbx), %rax
movq (%rax,%r12,8), %rax
movsbl 0x1(%rax,%r15), %edi
callq 0x379e
incq %r15
testw %ax, %ax
jne 0x17b5
movq (%rbx), %rax
addq (%rax,%r12,8), %r15
movq %r15, %rdi
movl $0x7c, %esi
callq 0x3a48
movq %rax, 0x10(%rbx)
cmpq $0x0, 0x8(%rax)
je 0x17fb
movq %rbx, %rdi
callq 0x4b20
jmp 0x1880
movq (%rax), %rsi
testq %rsi, %rsi
je 0x1880
movq %rbx, %rdi
callq 0x3238
movq %rax, %r15
movq %rax, %rdi
callq 0x34c8
movq %rax, 0x18(%rbx)
movq (%rax), %rdi
callq 0x5210
movq %rax, 0x8(%rbx)
movq %rbx, %rdi
callq 0x3fb0
cmpl $-0x1, %eax
je 0x1851
movq 0x18(%rbx), %rax
cmpq $0x0, (%rax)
je 0x1851
movq %rbx, %rdi
callq 0x164f
testl %eax, %eax
jne 0x1851
movq %rbx, %rdi
callq 0x1583
movq 0x18(%rbx), %rdi
callq 0x484c
movq 0x18(%rbx), %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1030
movq 0x10(%rbx), %rax
movq (%rax), %rdi
callq 0x1030
movq 0x8(%rbx), %rdi
callq 0x1030
movl 0x28(%rbx), %eax
movl %eax, 0x2c(%rbx)
movq 0x10(%rbx), %rdi
callq 0x1030
movq (%rbx), %rax
cmpq $0x0, 0x8(%rax,%r12,8)
leaq 0x1(%r12), %r12
jne 0x17a7
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1030
nop
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/shell/shell_utils.c
// Function: append_pwd
char	*append_pwd(char *value)
{
	char	cwd[1024];
	char	*aux;

	aux = value;
	if (getcwd(cwd, sizeof(cwd)))
	{
		if (value[0] == ':')
			return (ft_strjoin(cwd, value));
		if (value[ft_strlen(value) - 1] == ':')
			return (ft_strjoin(value, cwd));
		while (*aux)
		{
			if (!(aux = ft_strchr(aux, ':')))
				break ;
			if (*(aux + 1) == ':')
				return (ft_strjoin(value, cwd));
			aux++;
		}
	}
	return (ft_strdup(value));
}

// Assembly:
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rdi, %rbx
movq %rsp, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x10a0
testq %rax, %rax
je 0x195a
cmpb $0x3a, (%rbx)
jne 0x191b
movq %rsp, %rdi
movq %rbx, %rsi
jmp 0x1953
movq %rbx, %rdi
callq 0x541c
cmpb $0x3a, -0x1(%rbx,%rax)
je 0x194d
movq %rbx, %rdi
cmpb $0x0, (%rdi)
je 0x195a
movl $0x3a, %esi
callq 0x51f0
testq %rax, %rax
je 0x195a
movq %rax, %rdi
incq %rdi
cmpb $0x3a, 0x1(%rax)
jne 0x192d
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x5254
jmp 0x1962
movq %rbx, %rdi
callq 0x5210
addq $0x400, %rsp            # imm = 0x400
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/shell/shell_utils.c
// Function: to_lower
char	*to_lower(char *input)
{
	size_t	it;
	char	*output;
	char	*tmp;

	tmp = ft_strdup(input);
	output = calloc(1, ft_strlen(tmp));
	it = -1;
	while (tmp[++it])
	{
		output[it] = ft_tolower(tmp[it]);
	}
	free(tmp);
	output[it] = '\0';
	return (output);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0x5210
movq %rax, %rbx
movq %rax, %rdi
callq 0x541c
movl $0x1, %edi
movq %rax, %rsi
callq 0x1110
movq %rax, %r14
movb (%rbx), %al
xorl %r15d, %r15d
testb %al, %al
je 0x19af
movsbl %al, %edi
callq 0x5430
movb %al, (%r14,%r15)
movb 0x1(%rbx,%r15), %al
incq %r15
jmp 0x1995
movq %rbx, %rdi
callq 0x1030
movb $0x0, (%r14,%r15)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/shell/shell_utils.c
// Function: safe_allocate
char	*safe_allocate(char *line, char *(*f)(char *))
{
	char	*tmp;
	char	*aux;

	tmp = f(line);
	free(line);
	aux = ft_strdup(tmp);
	free(tmp);
	return (aux);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq *%rsi
movq %rax, %r14
movq %rbx, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x5210
movq %rax, %rbx
movq %r14, %rdi
callq 0x1030
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/shell/shell_utils_2.c
// Function: exec_env
int		exec_env(t_shell *shell)
{
	char	*lower;
	char	*path;
	char	*tmp;

	lower = to_lower(shell->args[0]);
	if (ft_strcmp(lower, "env"))
	{
		path = get_path(shell);
		tmp = ft_strjoin("_=", path);
		free(path);
		ft_export(shell, tmp);
		free(tmp);
		free(lower);
		return (ft_env(shell, shell->env));
	}
	free(lower);
	return (0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movq (%rax), %rdi
callq 0x196b
movq %rax, %r14
leaq 0x461f(%rip), %rsi      # 0x6057
movq %rax, %rdi
callq 0x5478
testq %rax, %rax
je 0x1a9c
movq %rbx, %rdi
callq 0x14e4
movq %rax, %r15
leaq 0x45e1(%rip), %rdi      # 0x6038
movq %rax, %rsi
callq 0x5254
movq %rax, %r12
movq %r15, %rdi
callq 0x1030
movq %rbx, %rdi
movq %r12, %rsi
callq 0x271a
movq %r12, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movq 0x20(%rbx), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1e4f
movq %r14, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/shell/shell_utils_2.c
// Function: get_var_key
char	*get_var_key(char *line, int it)
{
	int		i;
	int		k;
	char	*key;

	i = it;
	k = 0;
	while (i >= 0 && line[i] != '{')
		i--;
	if (!(key = malloc((it - i) * sizeof(char))))
		return (NULL);
	i++;
	while (i < it)
		key[k++] = line[i++];
	key[k] = '\0';
	return (key);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, %r12d
testl %esi, %esi
js 0x1ae5
movl %ebp, %r12d
movl %r12d, %eax
cmpb $0x7b, (%rbx,%rax)
je 0x1ae5
leal -0x1(%r12), %eax
testl %r12d, %r12d
movl %eax, %r12d
jg 0x1ac9
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %ebp, %r15d
subl %r12d, %r15d
movslq %r15d, %rdi
callq 0x1160
testq %rax, %rax
je 0x1b20
movq %rax, %r14
incl %r12d
cmpl %ebp, %r12d
jge 0x1b25
movslq %r12d, %rax
addq %rax, %rbx
leal -0x2(%r15), %edx
incq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1140
decl %r15d
jmp 0x1b28
xorl %r14d, %r14d
jmp 0x1b2d
xorl %r15d, %r15d
movb $0x0, (%r14,%r15)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/shell/shell_utils_3.c
// Function: add_space
char	*add_space(char *line, char *output, size_t *it, char redir)
{
	if (line[*it] == redir)
	{
		ft_strlcat(output, line, ft_strlen(output) + *it + 1);
		if (line[*it - 1] != ' ' && line[*it - 1] != redir)
			ft_strlcat(output, " ", ft_strlen(output) + 2);
		ft_strlcat(output, line + *it, ft_strlen(output) + 2);
		if (line[*it + 1] != ' ' && line[*it + 1] != redir)
			ft_strlcat(output, " ", ft_strlen(output) + 2);
		line = line + *it + 1;
		*it = -1;
	}
	return (line);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdi, %rbx
movq (%rdx), %rax
cmpb %bpl, (%rdi,%rax)
jne 0x1c20
movq %rdx, %r14
movq %rsi, %r15
movq %rsi, %rdi
callq 0x541c
movq (%r14), %rcx
leaq (%rax,%rcx), %rdx
incq %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x534c
movq (%r14), %rax
movb -0x1(%rbx,%rax), %al
cmpb $0x20, %al
sete %cl
cmpb %bpl, %al
sete %al
orb %cl, %al
jne 0x1bc2
movq %r15, %rdi
callq 0x541c
leaq 0x2(%rax), %rdx
leaq 0x45b3(%rip), %rsi      # 0x616d
movq %r15, %rdi
callq 0x534c
movq (%r14), %r12
addq %rbx, %r12
movq %r15, %rdi
callq 0x541c
leaq 0x2(%rax), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x534c
movq (%r14), %rax
movb 0x1(%rbx,%rax), %al
cmpb $0x20, %al
sete %cl
cmpb %bpl, %al
sete %al
orb %cl, %al
jne 0x1c10
movq %r15, %rdi
callq 0x541c
leaq 0x2(%rax), %rdx
leaq 0x4565(%rip), %rsi      # 0x616d
movq %r15, %rdi
callq 0x534c
movq (%r14), %rax
addq %rax, %rbx
incq %rbx
movq $-0x1, (%r14)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/shell/shell_utils_3.c
// Function: additional_spaces
size_t	additional_spaces(char *line)
{
	size_t	cont;
	size_t	it;

	it = -1;
	cont = 0;
	while (line[++it])
	{
		if (line[it] == '>' && line[it - 1] != ' ' && line[it - 1] != '>')
			cont++;
		if (line[it] == '>' && line[it + 1] != ' ')
			cont++;
		if (line[it] == '<' && line[it - 1] != ' ' && line[it - 1] != '<')
			cont++;
		if (line[it] == '<' && line[it + 1] != ' ')
			cont++;
	}
	return (cont);
}

// Assembly:
incq %rdi
xorl %eax, %eax
movzbl -0x1(%rdi), %ecx
cmpl $0x3e, %ecx
je 0x1c40
testl %ecx, %ecx
jne 0x1c51
jmp 0x1c8c
movzbl -0x2(%rdi), %edx
cmpl $0x20, %edx
je 0x1c51
cmpl $0x3e, %edx
je 0x1c51
incq %rax
cmpb $0x3e, %cl
jne 0x1c61
xorl %edx, %edx
cmpb $0x20, (%rdi)
setne %dl
addq %rdx, %rax
cmpb $0x3c, %cl
jne 0x1c77
movzbl -0x2(%rdi), %edx
cmpl $0x20, %edx
je 0x1c77
cmpl $0x3c, %edx
je 0x1c77
incq %rax
cmpb $0x3c, %cl
jne 0x1c87
xorl %ecx, %ecx
cmpb $0x20, (%rdi)
setne %cl
addq %rcx, %rax
incq %rdi
jmp 0x1c31
retq
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/shell/shell_utils_3.c
// Function: inject_spaces
char	*inject_spaces(char *line)
{
	size_t	it;
	size_t	cont;
	char	*output;

	it = -1;
	cont = additional_spaces(line);
	output = calloc(1, ft_strlen(line) + cont + 1);
	while (*line == ' ')
		line++;
	while (line[++it])
	{
		line = add_space(line, output, &it, '>');
		line = add_space(line, output, &it, '<');
	}
	ft_strlcat(output, line, line - output);
	return (output);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movq $-0x1, 0x8(%rsp)
callq 0x1c2c
movq %rax, %rbx
movq %r14, %rdi
callq 0x541c
leaq (%rbx,%rax), %rsi
incq %rsi
movl $0x1, %edi
callq 0x1110
movq %rax, %rbx
decq %r14
cmpb $0x20, 0x1(%r14)
leaq 0x1(%r14), %r14
je 0x1cc9
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsp)
cmpb $0x0, 0x1(%r14,%rax)
je 0x1d2e
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl $0x3e, %ecx
callq 0x1b54
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl $0x3c, %ecx
callq 0x1b54
movq %rax, %r14
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsp)
cmpb $0x0, 0x1(%r14,%rax)
jne 0x1cef
movq %r14, %rdx
subq %rbx, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x534c
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/builtin/ft_env.c
// Function: delete_environment
void			delete_environment(t_shell *shell, char *key, char **env)
{
	size_t	it;
	size_t	len;

	(void)shell;
	len = ft_strlen(key);
	it = 0;
	while (env[it])
	{
		if (ft_strncmp(key, env[it], len) == 0)
			break ;
		it++;
	}
	if (env[it])
	{
		free(env[it]);
		env[it] = NULL;
		it++;
		while (env[it])
		{
			env[it - 1] = env[it];
			it++;
		}
		env[it - 1] = NULL;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rsi, %rdi
callq 0x541c
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x1d8e
movq %rax, %r15
xorl %r12d, %r12d
movq %r14, %rdi
movq %r15, %rdx
callq 0x5440
testl %eax, %eax
je 0x1d91
movq 0x8(%rbx,%r12,8), %rsi
incq %r12
testq %rsi, %rsi
jne 0x1d70
jmp 0x1d91
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rdi
testq %rdi, %rdi
je 0x1dc7
callq 0x1030
movq $0x0, (%rbx,%r12,8)
movq 0x8(%rbx,%r12,8), %rax
testq %rax, %rax
je 0x1dbf
movq %rax, (%rbx,%r12,8)
movq 0x10(%rbx,%r12,8), %rax
incq %r12
jmp 0x1dac
movq $0x0, (%rbx,%r12,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/builtin/ft_env.c
// Function: get_env
char			*get_env(t_shell *shell, char *arg)
{
	size_t it;
	size_t len;

	len = ft_strlen(arg);
	it = 0;
	while (shell->env[it])
	{
		if (!ft_strncmp(shell->env[it], arg, len))
			return (ft_strdup(ft_strchr(shell->env[it], '=') + 1));
		it++;
	}
	return (ft_strdup(""));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rsi, %rdi
callq 0x541c
movq %rax, %r12
movq 0x20(%r14), %rax
movq (%rax), %rdi
leaq 0x4223(%rip), %rbx      # 0x601e
testq %rdi, %rdi
je 0x1e3e
xorl %r13d, %r13d
movq %r15, %rsi
movq %r12, %rdx
callq 0x5440
testl %eax, %eax
je 0x1e26
movq 0x20(%r14), %rax
movq 0x8(%rax,%r13), %rdi
addq $0x8, %r13
testq %rdi, %rdi
jne 0x1e03
jmp 0x1e3e
movq 0x20(%r14), %rax
movq (%rax,%r13), %rdi
movl $0x3d, %esi
callq 0x51f0
movq %rax, %rbx
incq %rbx
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5210
// File: /workspace/github_c_makefile_star2_O1/vdedios[P]minishell/srcs/builtin/ft_env.c
// Function: ft_env
int				ft_env(t_shell *shell, char **args)
{
	size_t	it;
	char	**to_print_env;

	if (shell->args[1])
	{
		ft_putendl_fd("env: too many arguments", 1);
		return (1);
	}
	it = 0;
	to_print_env = args;
	sort_like_bash(to_print_env);
	while (to_print_env[it])
		ft_putendl_fd(to_print_env[it++], 1);
	ft_export(shell, "_=env");
	return (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x18(%rdi), %rax
cmpq $0x0, 0x8(%rax)
je 0x1e79
leaq 0x41d3(%rip), %rdi      # 0x603d
movl $0x1, %esi
callq 0x5058
jmp 0x1eff
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x1ece
xorl %r12d, %r12d
leaq 0x41ca(%rip), %r15      # 0x605b
movq %r14, %r13
movl $0x5, %edx
movq %r15, %rsi
callq 0x5440
testl %eax, %eax
jne 0x1eba
movq (%r13), %rax
movq 0x8(%r14,%r12,8), %rcx
movq %rcx, (%r13)
movq %rax, 0x8(%r14,%r12,8)
incq %r12
leaq (%r14,%r12,8), %r13
addq $0x8, %r13
incq %r12
movq (%r13), %rdi
testq %rdi, %rdi
jne 0x1e94
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1ef0
addq $0x8, %r14
movl $0x1, %esi
callq 0x5058
movq (%r14), %rdi
addq $0x8, %r14
testq %rdi, %rdi
jne 0x1eda
leaq 0x415e(%rip), %rsi      # 0x6055
movq %rbx, %rdi
callq 0x271a
movl $0x1, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop