LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit.c
// Function: shoit_init_synch
void shoit_init_synch(shoit_core_t *shoit)
{
    sem_init(&shoit->progSem,0,0);
    sem_init(&shoit->dataSem,0,0);
    if(pipe(shoit->pipe)==-1) perror("pipe");
    pthread_mutex_init(&shoit->sendBlockLock, NULL);
    pthread_cond_init(&shoit->sendBlockCond, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
xorl %edx, %edx
movl %edx, %esi
callq 0x2320
movq -0x8(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
xorl %edx, %edx
movl %edx, %esi
callq 0x2320
movq -0x8(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
callq 0x21d0
cmpl $-0x1, %eax
jne 0x2b75
leaq 0x7297(%rip), %rdi      # 0x9e07
callq 0x2390
movq -0x8(%rbp), %rdi
addq $0x178, %rdi            # imm = 0x178
xorl %eax, %eax
movl %eax, %esi
callq 0x2460
movq -0x8(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
xorl %eax, %eax
movl %eax, %esi
callq 0x22b0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit.c
// Function: shoit_destory_synch
void shoit_destory_synch(shoit_core_t *shoit)
{
    sem_destroy(&shoit->progSem);
    sem_destroy(&shoit->dataSem);
    close(shoit->pipe[0]);
    close(shoit->pipe[1]); 
    pthread_mutex_destroy(&shoit->sendBlockLock);
    pthread_cond_destroy(&shoit->sendBlockCond);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x2470
movq -0x8(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0x2470
movq -0x8(%rbp), %rax
movl 0x140(%rax), %edi
callq 0x21c0
movq -0x8(%rbp), %rax
movl 0x144(%rax), %edi
callq 0x21c0
movq -0x8(%rbp), %rdi
addq $0x178, %rdi            # imm = 0x178
callq 0x2130
movq -0x8(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
callq 0x2360
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit.c
// Function: shoit_init_error_bitmap
void shoit_init_error_bitmap(shoit_core_t *shoit)
{
    uint64_t i;
    char *errorBitmap = (char*)(shoit->errorBitmap + sizeof(shoit_control_t));

    memset(shoit->errorBitmap,0,sizeof(shoit_control_t));
    // the first byte is 0 if there is error.  1 if all done.
    uint64_t startOfLastByte = shoit->totalNumberOfPackets - (shoit->sizeofErrorBitmap-2)*8;
    char bits[8] = {0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080};

    /* The first byte is for judging all_done */
    for (i=0;i<shoit->sizeofErrorBitmap;i++)
        errorBitmap[i] = 0;

    /* Preset those bits unused */
    for (i=startOfLastByte;i<8;i++)
        errorBitmap[shoit->sizeofErrorBitmap-1] |= bits[i];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0xd0(%rax), %rax
addq $0x1e, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0xd0(%rax), %rdi
xorl %esi, %esi
movl $0x1e, %edx
callq 0x21a0
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0xd8(%rcx), %rcx
subq $0x2, %rcx
shlq $0x3, %rcx
subq %rcx, %rax
movq %rax, -0x20(%rbp)
movq 0x67b5(%rip), %rax      # 0x9434
movq %rax, -0x28(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0xd8(%rcx), %rax
jae 0x2cb6
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x2c8b
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x8, -0x10(%rbp)
jae 0x2cf8
movq -0x10(%rbp), %rax
movsbl -0x28(%rbp,%rax), %esi
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0xd8(%rcx), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x2cbe
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit.c
// Function: shoit_update_error_bitmap
bool shoit_update_error_bitmap(shoit_core_t *shoit,uint64_t seq)
{
    char *errorBitmap = (char*)(shoit->errorBitmap + sizeof(shoit_control_t));
    uint64_t index_in_list, offset_in_index;

    char bits[8] = {0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080};
    if(seq < 0 || (seq >> 3) >= shoit->sizeofErrorBitmap-1) {
        if(shoit->verbose) {
            fprintf(stderr, "seqno <%ld> wrong,out of range:0 ... %ld\n",seq,shoit->sizeofErrorBitmap);
            exit(0);
        }
        return false;
    }
    // seq starts with 0
    index_in_list = seq >> 3; /*8bit*/
    index_in_list ++;
    offset_in_index = seq%8;
    errorBitmap[index_in_list] |= bits[offset_in_index];

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0xd0(%rax), %rax
addq $0x1e, %rax
movq %rax, -0x20(%rbp)
movq 0x670a(%rip), %rax      # 0x9434
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x18(%rbp)
jb 0x2d51
movq -0x18(%rbp), %rax
shrq $0x3, %rax
movq -0x10(%rbp), %rcx
movq 0xd8(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jb 0x2d92
movq -0x10(%rbp), %rax
cmpl $0x0, 0x5c(%rax)
je 0x2d89
movq 0x9296(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0xd8(%rax), %rcx
leaq 0x668f(%rip), %rsi      # 0x940a
movb $0x0, %al
callq 0x2250
xorl %edi, %edi
callq 0x23f0
movl $0x0, -0x4(%rbp)
jmp 0x2dd7
movq -0x18(%rbp), %rax
shrq $0x3, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
andq $0x7, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movsbl -0x38(%rbp,%rax), %esi
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit.c
// Function: shoit_update_hash_table
uint64_t shoit_update_hash_table(shoit_core_t *shoit,bool update)
{
    uint64_t count = 0;
    uint64_t i,j;
    char bits[8] = {0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080};
    char *errorBitmap = (char*)(shoit->errorBitmap + sizeof(shoit_control_t));

    for (i=1;i<shoit->sizeofErrorBitmap; i++)
    {
        for (j=0;j<8;j++)
        {
            if ((errorBitmap[i] & bits[j]) == 0)
            {
                if(update)
                    shoit->hashTable[count] = (i-1)*8+j;
                count ++;
            }
        }
    }
    // set the first byte to let the sender know "all done"
    if (count == 0 && update)
        errorBitmap[0] = 1;

    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
movq 0x663a(%rip), %rax      # 0x9434
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0xd0(%rax), %rax
addq $0x1e, %rax
movq %rax, -0x38(%rbp)
movq $0x1, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0xd8(%rcx), %rax
jae 0x2eb1
movq $0x0, -0x28(%rbp)
cmpq $0x8, -0x28(%rbp)
jae 0x2e9e
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
movsbl -0x30(%rbp,%rcx), %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x2e8e
cmpl $0x0, -0xc(%rbp)
je 0x2e82
movq -0x20(%rbp), %rdx
subq $0x1, %rdx
shlq $0x3, %rdx
addq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2e90
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x2e36
jmp 0x2ea0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x2e19
cmpq $0x0, -0x18(%rbp)
jne 0x2ec5
cmpl $0x0, -0xc(%rbp)
je 0x2ec5
movq -0x38(%rbp), %rax
movb $0x1, (%rax)
movq -0x18(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_network.c
// Function: shoit_network_resolve_address
int shoit_network_resolve_address(struct sockaddr *sa, socklen_t *salen, const char *host, const int port, int family, int type,int proto)
{
    struct addrinfo hints, *res;
    int err;
    char sport[8]={0};

    memset(sport,0,8);
    snprintf(sport,7,"%d",port);

    memset(&hints, 0, sizeof(hints));
    hints.ai_family = family;
    hints.ai_socktype = type;
    hints.ai_protocol = proto;
    hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICSERV | AI_PASSIVE;
    if ((err = getaddrinfo(host, sport, &hints, &res)) != 0 || res == NULL) {
        fprintf(stderr, "failed to resolve address:%s:%s:%s\n", host, sport,
                err != 0 ? gai_strerror(err) : "getaddrinfo returned NULL");
        return -1;
    }
    memcpy(sa, res->ai_addr, res->ai_addrlen);
    *salen = res->ai_addrlen;                                                                                                        
    freeaddrinfo(res);                                                                                                               
    return 0;                                                                                                                        
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
leaq -0x74(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x21a0
leaq -0x74(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x21a0
leaq -0x74(%rbp), %rdi
movl -0x24(%rbp), %ecx
movl $0x7, %esi
leaq 0x701c(%rip), %rdx      # 0x9f64
movb $0x0, %al
callq 0x2140
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x21a0
movl -0x28(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x58(%rbp)
movl 0x10(%rbp), %eax
movl %eax, -0x54(%rbp)
movl $0x421, -0x60(%rbp)     # imm = 0x421
movq -0x20(%rbp), %rdi
leaq -0x74(%rbp), %rsi
leaq -0x60(%rbp), %rdx
leaq -0x68(%rbp), %rcx
callq 0x2410
movl %eax, -0x6c(%rbp)
cmpl $0x0, %eax
jne 0x2f9c
cmpq $0x0, -0x68(%rbp)
jne 0x3017
movq 0x9055(%rip), %rax      # 0xbff8
movq (%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x74(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpl $0x0, -0x6c(%rbp)
je 0x2fd7
movl -0x6c(%rbp), %edi
callq 0x2150
movq %rax, -0x98(%rbp)
jmp 0x2fe7
leaq 0x6482(%rip), %rax      # 0x9460
movq %rax, -0x98(%rbp)
jmp 0x2fe7
movq -0x80(%rbp), %rcx
movq -0x88(%rbp), %rdx
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %r8
leaq 0x6435(%rip), %rsi      # 0x943c
movb $0x0, %al
callq 0x2250
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x304e
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x68(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %edx
callq 0x2280
movq -0x68(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x68(%rbp), %rdi
callq 0x24b0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_network.c
// Function: shoit_network_set_noblocking
int shoit_network_set_noblocking(int fd,int noblocking) 
{                                                                                                                                    
    int flags = fcntl(fd, F_GETFL, 0);                                                                                               
    if(flags==-1) return -1;                                                                                                         

    if(noblocking) //set noblock
        return fcntl(fd, F_SETFL, flags|O_NONBLOCK);                                                                                     
    else
        return fcntl(fd, F_SETFL, flags&~O_NONBLOCK); 
                                                                                                                                     
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0x8(%rbp), %edi
movl $0x3, %esi
xorl %edx, %edx
movb $0x0, %al
callq 0x20a0
movl %eax, -0x10(%rbp)
cmpl $-0x1, -0x10(%rbp)
jne 0x3091
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x30cf
cmpl $0x0, -0xc(%rbp)
je 0x30b4
movl -0x8(%rbp), %edi
movl -0x10(%rbp), %edx
orl $0x800, %edx            # imm = 0x800
movl $0x4, %esi
movb $0x0, %al
callq 0x20a0
movl %eax, -0x4(%rbp)
jmp 0x30cf
movl -0x8(%rbp), %edi
movl -0x10(%rbp), %edx
andl $0xfffff7ff, %edx       # imm = 0xFFFFF7FF
movl $0x4, %esi
movb $0x0, %al
callq 0x20a0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_network.c
// Function: shoit_network_set_socket_buffer
void shoit_network_set_socket_buffer(int udpSockfd, int sockbufsize, int verbose )
{
    int oldsend = -1, oldrecv = -1;
    int newsend = -1, newrecv = -1;
    socklen_t olen = sizeof(int);

    if(getsockopt(udpSockfd,SOL_SOCKET,SO_SNDBUF,&oldsend,&olen) < 0)
        perror("getsockopt: SO_SNDBUF");

    if(getsockopt(udpSockfd,SOL_SOCKET,SO_RCVBUF,&oldrecv,&olen) < 0)
        perror("getsockopt: SO_RCVBUF");

    if(sockbufsize > 0) {
        if(setsockopt(udpSockfd,SOL_SOCKET,SO_SNDBUF,&sockbufsize,sizeof(sockbufsize)) < 0)
            perror("setsockopt: SO_SNDBUF");
        if(setsockopt(udpSockfd,SOL_SOCKET,SO_RCVBUF,&sockbufsize,sizeof(sockbufsize)) < 0)
            perror("setsockopt: SO_RCVBUF");
        if(getsockopt(udpSockfd,SOL_SOCKET,SO_SNDBUF,&newsend,&olen) < 0)
            perror("getsockopt: SO_SNDBUF");
        if(getsockopt(udpSockfd,SOL_SOCKET,SO_RCVBUF,&newrecv,&olen) < 0)
            perror("getsockopt: SO_RCVBUF");
    }
    if(verbose>1) 
        fprintf(stderr, "UDP sockbufsize was %d/%d now %d/%d (send/recv)\n",oldsend, oldrecv, newsend, newrecv);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl $0xffffffff, -0x10(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
movl $0x4, -0x20(%rbp)
movl -0x4(%rbp), %edi
movl $0x1, %esi
movl $0x7, %edx
leaq -0x10(%rbp), %rcx
leaq -0x20(%rbp), %r8
callq 0x2210
cmpl $0x0, %eax
jge 0x313f
leaq 0x6340(%rip), %rdi      # 0x947a
callq 0x2390
movl -0x4(%rbp), %edi
movl $0x1, %esi
movl $0x8, %edx
leaq -0x14(%rbp), %rcx
leaq -0x20(%rbp), %r8
callq 0x2210
cmpl $0x0, %eax
jge 0x316a
leaq 0x632b(%rip), %rdi      # 0x9490
callq 0x2390
cmpl $0x0, -0x8(%rbp)
jle 0x3226
movl -0x4(%rbp), %edi
movl $0x1, %esi
movl $0x7, %edx
leaq -0x8(%rbp), %rcx
movl $0x4, %r8d
callq 0x2090
cmpl $0x0, %eax
jge 0x31a1
leaq 0x630a(%rip), %rdi      # 0x94a6
callq 0x2390
movl -0x4(%rbp), %edi
movl $0x1, %esi
movl $0x8, %edx
leaq -0x8(%rbp), %rcx
movl $0x4, %r8d
callq 0x2090
cmpl $0x0, %eax
jge 0x31ce
leaq 0x62f3(%rip), %rdi      # 0x94bc
callq 0x2390
movl -0x4(%rbp), %edi
movl $0x1, %esi
movl $0x7, %edx
leaq -0x18(%rbp), %rcx
leaq -0x20(%rbp), %r8
callq 0x2210
cmpl $0x0, %eax
jge 0x31f9
leaq 0x6286(%rip), %rdi      # 0x947a
callq 0x2390
movl -0x4(%rbp), %edi
movl $0x1, %esi
movl $0x8, %edx
leaq -0x1c(%rbp), %rcx
leaq -0x20(%rbp), %r8
callq 0x2210
cmpl $0x0, %eax
jge 0x3224
leaq 0x6271(%rip), %rdi      # 0x9490
callq 0x2390
jmp 0x3226
cmpl $0x1, -0xc(%rbp)
jle 0x3252
movq 0x8dc5(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
movl -0x1c(%rbp), %r9d
leaq 0x6287(%rip), %rsi      # 0x94d2
movb $0x0, %al
callq 0x2250
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_network.c
// Function: shoit_network_readn
ssize_t shoit_network_readn(int fd, void *vptr,ssize_t nbytes)
{
    ssize_t nleft, nread;
    char *ptr;

    ptr =(char*)vptr;
    nleft = nbytes;

    while(nleft > 0)
    {
        if ( (nread = read(fd, ptr, nleft)) < 0) {
            if (errno == EINTR)
                nread = 0;      /* and call read() again */
            else
                return (-1);
        } else if (nread == 0)
            break;              /* EOF */

        nleft -= nread;
        ptr += nread;
    }
    return (nbytes - nleft);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jle 0x39cc
movl -0xc(%rbp), %edi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x2200
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jge 0x39a4
callq 0x2060
cmpl $0x4, (%rax)
jne 0x3998
movq $0x0, -0x30(%rbp)
jmp 0x39a2
movq $-0x1, -0x8(%rbp)
jmp 0x39d8
jmp 0x39af
cmpq $0x0, -0x30(%rbp)
jne 0x39ad
jmp 0x39cc
jmp 0x39af
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x3963
movq -0x20(%rbp), %rax
subq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_network.c
// Function: shoit_network_writen
ssize_t shoit_network_writen(int fd,void *vptr,ssize_t nbytes)
{
    ssize_t nleft, nwritten;
    char *ptr;

    ptr = (char*)vptr;
    nleft = nbytes;
    while(nleft > 0)
    {
        if ( (nwritten = write(fd, ptr, nleft)) <= 0) {
            if (nwritten < 0 && errno == EINTR)
                nwritten = 0;   /* and call write() again */
            else
                return (-1);    /* error */
        }

        nleft -= nwritten;
        ptr += nwritten;
    }
    return (nbytes -nleft);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jle 0x3a78
movl -0xc(%rbp), %edi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x20b0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jg 0x3a5b
cmpq $0x0, -0x30(%rbp)
jge 0x3a4f
callq 0x2060
cmpl $0x4, (%rax)
jne 0x3a4f
movq $0x0, -0x30(%rbp)
jmp 0x3a59
movq $-0x1, -0x8(%rbp)
jmp 0x3a84
jmp 0x3a5b
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x3a13
movq -0x20(%rbp), %rax
subq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_misc.c
// Function: shoit_misc_nocr
char *shoit_misc_nocr(char *s)
{
    if(s==NULL) return s;
    char *pos = s;

    while(*pos){
        if(*pos==' ' || *pos == '\n' || *pos=='\r') break;
        pos++;
    }
    *pos='\0';

    return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x3aa9
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3afd
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x3aee
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
je 0x3ade
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
je 0x3ade
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
jne 0x3ae0
jmp 0x3aee
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3ab1
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_misc.c
// Function: shoit_misc_sleepto
void shoit_misc_sleepto(uint64_t nexttime, pthread_mutex_t *tickLock,pthread_cond_t *tickCond)
{
    uint64_t schedTime = nexttime;
    uint64_t t = shoit_misc_get_timer();

    while (t < schedTime)
    {
        struct timeval now;
        struct timespec timeout;
        gettimeofday(&now, 0);

        if (now.tv_usec < 990000){
            timeout.tv_sec = now.tv_sec;
            timeout.tv_nsec = (now.tv_usec + 10000) * 1000;
        } else {
            timeout.tv_sec = now.tv_sec + 1;
            timeout.tv_nsec = (now.tv_usec + 10000 - 1000000) * 1000;
        }

        pthread_mutex_lock(tickLock);
        pthread_cond_timedwait(tickCond, tickLock,&timeout);
        pthread_mutex_unlock(tickLock);
        t = shoit_misc_get_timer();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
callq 0x3b10
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x3c01
leaq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2180
cmpq $0xf1b30, -0x30(%rbp)   # imm = 0xF1B30
jge 0x3ba9
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
addq $0x2710, %rax           # imm = 0x2710
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
movq %rax, -0x40(%rbp)
jmp 0x3bd0
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
addq $0x2710, %rax           # imm = 0x2710
subq $0xf4240, %rax          # imm = 0xF4240
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2490
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x2350
movq -0x10(%rbp), %rdi
callq 0x22c0
callq 0x3b10
movq %rax, -0x28(%rbp)
jmp 0x3b65
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_misc.c
// Function: shoit_misc_resolve_line
int shoit_misc_resolve_line(char *line,char *host,int *port)
{
    char *pos;
    if(line==NULL || strlen(line)==0) return -1;
    if( (pos =strchr(line,':'))==NULL) return -1;
    
    memcpy(host,line,(int)(pos-line));
    pos ++; //del ':'
    if(pos==NULL) return -1; /*port error*/

    char *endptr;
    errno = 0;    /* To distinguish success/failure after call */
    long val = strtol(pos, &endptr,10);
    if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN))
                   || (errno != 0 && val == 0)) {
        return -1;
    }
    if (endptr == pos) {
        fprintf(stderr, "No digits were found\n");
        return -1;
    }
   
    *port = (int)val; 

    return 0;
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x3c3a
movq -0x10(%rbp), %rdi
callq 0x20d0
cmpq $0x0, %rax
jne 0x3c46
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3d47
movq -0x10(%rbp), %rdi
movl $0x3a, %esi
callq 0x2110
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x3c6a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3d47
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movslq %eax, %rdx
callq 0x2280
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x3ca4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3d47
callq 0x2060
movl $0x0, (%rax)
movq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0xa, %edx
callq 0x2270
movq %rax, -0x38(%rbp)
callq 0x2060
cmpl $0x22, (%rax)
jne 0x3cef
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, -0x38(%rbp)
je 0x3d00
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq %rax, -0x38(%rbp)
je 0x3d00
callq 0x2060
cmpl $0x0, (%rax)
je 0x3d09
cmpq $0x0, -0x38(%rbp)
jne 0x3d09
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3d47
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0x3d34
movq 0x82de(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x5893(%rip), %rsi      # 0x95b7
movb $0x0, %al
callq 0x2250
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3d47
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_misc.c
// Function: shoit_misc_log
void shoit_misc_log(FILE *fp,char *format, ...)
{

    if(!fp) return;

    va_list arglist;
    va_start( arglist, format);
    vfprintf(fp, format, arglist);
    fprintf(fp, "\n");
    va_end(arglist);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0x3e28
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %rdx, -0xd0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x3e55
jmp 0x3ea0
leaq -0x30(%rbp), %rax
leaq -0xe0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x23c0
movq -0x8(%rbp), %rdi
leaq 0x5427(%rip), %rsi      # 0x92bc
movb $0x0, %al
callq 0x2250
leaq -0x30(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_misc.c
// Function: shoit_misc_htonll
uint64_t shoit_misc_htonll(uint64_t lll)
{
    uint64_t nll = 0;
    unsigned char *cp = (unsigned char *)&nll;

    cp[0] = (lll >> 56) & 0xFF;
    cp[1] = (lll >> 48) & 0xFF;
    cp[2] = (lll >> 40) & 0xFF;
    cp[3] = (lll >> 32) & 0xFF;
    cp[4] = (lll >> 24) & 0xFF;
    cp[5] = (lll >> 16) & 0xFF;
    cp[6] = (lll >>  8) & 0xFF;
    cp[7] = (lll >>  0) & 0xFF;
    return nll;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
leaq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
shrq $0x38, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
shrq $0x30, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0x8(%rbp), %rax
shrq $0x28, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x2(%rax)
movq -0x8(%rbp), %rax
shrq $0x20, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x8(%rbp), %rax
shrq $0x18, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x4(%rax)
movq -0x8(%rbp), %rax
shrq $0x10, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x5(%rax)
movq -0x8(%rbp), %rax
shrq $0x8, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x6(%rax)
movq -0x8(%rbp), %rax
shrq $0x0, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x7(%rax)
movq -0x10(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_misc.c
// Function: shoit_misc_ntohll
uint64_t shoit_misc_ntohll(uint64_t nll )
{
    unsigned char *cp = (unsigned char *)&nll;

    return ((long long)cp[0] << 56) |
        ((long long)cp[1] << 48) |
        ((long long)cp[2] << 40) |
        ((long long)cp[3] << 32) |
        ((long long)cp[4] << 24) |
        ((long long)cp[5] << 16) |
        ((long long)cp[6] <<  8) |
        ((long long)cp[7] <<  0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
leaq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
shlq $0x38, %rax
movq -0x10(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
shlq $0x30, %rcx
orq %rcx, %rax
movq -0x10(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
shlq $0x28, %rcx
orq %rcx, %rax
movq -0x10(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
shlq $0x20, %rcx
orq %rcx, %rax
movq -0x10(%rbp), %rcx
movzbl 0x4(%rcx), %ecx
shlq $0x18, %rcx
orq %rcx, %rax
movq -0x10(%rbp), %rcx
movzbl 0x5(%rcx), %ecx
shlq $0x10, %rcx
orq %rcx, %rax
movq -0x10(%rbp), %rcx
movzbl 0x6(%rcx), %ecx
shlq $0x8, %rcx
orq %rcx, %rax
movq -0x10(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
shlq $0x0, %rcx
orq %rcx, %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_misc.c
// Function: shoit_misc_report_time
int shoit_misc_report_time(struct timeval *start)
{
    struct timeval end;
    int usecs;

    gettimeofday(&end, NULL);
    usecs = 1000000 * (end.tv_sec - start->tv_sec) + (end.tv_usec - start->tv_usec);
    start->tv_sec = end.tv_sec;
    start->tv_usec = end.tv_usec;

    return usecs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2180
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
subq (%rcx), %rax
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rdx
subq 0x8(%rdx), %rcx
addq %rcx, %rax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x1c(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_progress.c
// Function: shoit_progress_init
void shoit_progress_init(progress_t *progress, char *title, int max, int style)
{

    //fprintf(stderr,"call func:%s\n",__func__);
    progress->chr = '#';
    progress->title = title;
    progress->style = style;
    progress->max = max;
    progress->offset = 100 / (float)max;
    progress->pro = (char *) malloc(max+1);

    if ( style == PROGRESS_BGC_STYLE ){
        memset(progress->pro,0, max+1);
    }else {
        memset(progress->pro, 32, max);
        memset(progress->pro+max, 0, 1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movb $0x23, (%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x18(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x14(%rax)
cvtsi2ssl -0x14(%rbp), %xmm1
movss 0x53ca(%rip), %xmm0     # 0x95e4
divss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x18(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x22e0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
cmpl $0x2, -0x18(%rbp)
jne 0x4260
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movl -0x14(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0x21a0
jmp 0x4291
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movslq -0x14(%rbp), %rdx
movl $0x20, %esi
callq 0x21a0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movslq -0x14(%rbp), %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x21a0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_progress.c
// Function: shoit_progress_for_stream
void shoit_progress_for_stream(FILE *fp,progress_t *progress, float bit)
{
    char buffer[512]={0};

    memset(buffer,0,512);
    
    float mbps = 1e-6 * 8*progress->total / (progress->utime == 0 ? .01 : progress->utime);

    snprintf(buffer,sizeof(buffer)-1,"%gMbps    %ldK    %.2fs    ",mbps,progress->total>>10,progress->utime);

    fprintf(fp,"\033[?25l\033[31m\033[1m%s%%\033[?25h\033[0m\r", buffer);
    fflush(fp); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movss %xmm0, -0x14(%rbp)
leaq -0x220(%rbp), %rdi
movq %rdi, -0x248(%rbp)
xorl %esi, %esi
movl %esi, -0x23c(%rbp)
movl $0x200, %edx            # imm = 0x200
movq %rdx, -0x238(%rbp)
callq 0x21a0
movq -0x248(%rbp), %rdi
movl -0x23c(%rbp), %esi
movq -0x238(%rbp), %rdx
callq 0x21a0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %xmm1
movaps 0x4fe8(%rip), %xmm0     # 0x9600
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x4fec(%rip), %xmm0     # 0x9610
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd 0x4fad(%rip), %xmm0     # 0x95e8
mulsd %xmm1, %xmm0
movsd %xmm0, -0x230(%rbp)
movq -0x10(%rbp), %rax
movss 0x30(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x466c
jp 0x466c
movsd 0x4f8e(%rip), %xmm0     # 0x95f0
movsd %xmm0, -0x250(%rbp)
jmp 0x4681
movq -0x10(%rbp), %rax
movss 0x30(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x250(%rbp)
movsd -0x230(%rbp), %xmm0
movsd -0x250(%rbp), %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x224(%rbp)
leaq -0x220(%rbp), %rdi
movss -0x224(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
shrq $0xa, %rcx
movq -0x10(%rbp), %rax
movss 0x30(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movl $0x1ff, %esi            # imm = 0x1FF
leaq 0x4fda(%rip), %rdx      # 0x96b3
movb $0x2, %al
callq 0x2140
movq -0x8(%rbp), %rdi
leaq -0x220(%rbp), %rdx
leaq 0x4fdd(%rip), %rsi      # 0x96cf
movb $0x0, %al
callq 0x2250
movq -0x8(%rbp), %rdi
callq 0x22f0
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_sender.c
// Function: sender_free
static void sender_free(shoit_core_t *sender)
{
    if(sender->bucket !=NULL){
        if(sender->useMmap){
            ;//munmap(sender->bucket, sender->mapSize); 
        }else{
            free(sender->bucket);
        }
        sender->bucket=NULL;
    } 
    sender->callbacks->on_close_data(sender);
    /*
    if(sender->fromFd !=-1) {
        close(sender->fromFd);
        sender->fromFd = -1;
    }
    */
    if(sender->toFd !=-1){
        close(sender->toFd);
        sender->toFd =-1;
    }
    

    if(sender->bindHost) {
        free(sender->bindHost);
        sender->bindHost=NULL;
    }

    if(sender->errorBitmap){    
        free(sender->errorBitmap);
        sender->errorBitmap =NULL;
    }
    if(sender->hashTable){
        free(sender->hashTable);
        sender->hashTable =NULL;
    }

    //free syn
    shoit_destory_synch(sender);

    //last free log
    if(sender->verbose>0) SHOIT_LOG("free sender complete.\n");
    shoit_misc_close_log(sender->log);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x4d4c
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1a0(%rax)
je 0x4d35
jmp 0x4d41
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x2040
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movq 0x1b0(%rax), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
movq -0x8(%rbp), %rax
cmpl $-0x1, 0xfc(%rax)
je 0x4d8b
movq -0x8(%rbp), %rax
movl 0xfc(%rax), %edi
callq 0x21c0
movq -0x8(%rbp), %rax
movl $0xffffffff, 0xfc(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x4daf
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x2040
movq -0x8(%rbp), %rax
movq $0x0, 0x70(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xd0(%rax)
je 0x4ddc
movq -0x8(%rbp), %rax
movq 0xd0(%rax), %rdi
callq 0x2040
movq -0x8(%rbp), %rax
movq $0x0, 0xd0(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xc8(%rax)
je 0x4e09
movq -0x8(%rbp), %rax
movq 0xc8(%rax), %rdi
callq 0x2040
movq -0x8(%rbp), %rax
movq $0x0, 0xc8(%rax)
movq -0x8(%rbp), %rdi
callq 0x2bb0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x5c(%rax)
jle 0x4e39
jmp 0x4e1e
movq -0x8(%rbp), %rax
movq 0xe8(%rax), %rdi
leaq 0x4e13(%rip), %rsi      # 0x9c43
movb $0x0, %al
callq 0x3df0
jmp 0x4e39
movq -0x8(%rbp), %rax
movq 0xe8(%rax), %rdi
callq 0x3eb0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_sender.c
// Function: tcpserver_init
static bool tcpserver_init(shoit_core_t *sender)
{

    if(sender->verbose>1)
        SHOIT_LOG("call %s, bindhost[%s:%d]\n",__func__,sender->bindHost,sender->tcpPort);
    /*return connefd ,error return -1*/
    sender->tcpSockfd = shoit_network_tcp_server_init(sender->bindHost,sender->tcpPort,&sender->tcpClientAddr);
    SHOIT_LOG("Have client connect.....\n");
    return (sender->tcpSockfd ==-1)?false:true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x5c(%rax)
jle 0x4e9d
jmp 0x4e68
movq -0x8(%rbp), %rax
movq 0xe8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rcx
movq -0x8(%rbp), %rax
movl 0x9c(%rax), %r8d
leaq 0x4947(%rip), %rsi      # 0x97d4
leaq 0x495a(%rip), %rdx      # 0x97ee
movb $0x0, %al
callq 0x3df0
jmp 0x4e9d
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x9c(%rax), %esi
movq -0x8(%rbp), %rdx
addq $0xb4, %rdx
callq 0x3710
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x6c(%rax)
movq -0x8(%rbp), %rax
movq 0xe8(%rax), %rdi
leaq 0x4923(%rip), %rsi      # 0x97fd
movb $0x0, %al
callq 0x3df0
movq -0x8(%rbp), %rax
movl 0x6c(%rax), %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $-0x1, %edx
cmovel %ecx, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_sender.c
// Function: transfer_thread_run
static void transfer_thread_run(void *argv)
{
    shoit_core_t *sender = (shoit_core_t *)argv; 
    int done = 0;

    if(sender->runing){
        if(!connect_udp_server(sender)){
            SHOIT_LOG("connect udp server failed.\n");
            return;
        }
    }
    sem_wait(&sender->dataSem); /*be wakeup:CONNECT signal*/

    /*
    *here,you can send many bucket data in many round
    *if sendfile and mmap ,only one bucket
    */
    while(!done && sender->runing){
        if(transfer_data_round_circle(sender) == false) break; /*no more*/
    }


    /*send notice to remote:i will close*/
    echo_to_receiver_on_tcp(sender,CLOSE);
    sender->runing=false;

    pthread_exit(0);
   
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1a8(%rax)
je 0x4f59
movq -0x10(%rbp), %rdi
callq 0x59d0
cmpl $0x0, %eax
jne 0x4f57
jmp 0x4f38
movq -0x10(%rbp), %rax
movq 0xe8(%rax), %rdi
leaq 0x48cd(%rip), %rsi      # 0x9817
movb $0x0, %al
callq 0x3df0
addq $0x20, %rsp
popq %rbp
retq
jmp 0x4f59
movq -0x10(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0x2080
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x15(%rbp)
jne 0x4f85
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1a8(%rax)
setne %al
movb %al, -0x15(%rbp)
movb -0x15(%rbp), %al
testb $0x1, %al
jne 0x4f8e
jmp 0x4fa0
movq -0x10(%rbp), %rdi
callq 0x5a80
cmpl $0x0, %eax
jne 0x4f9e
jmp 0x4fa0
jmp 0x4f69
movq -0x10(%rbp), %rdi
movl $0x7, %esi
callq 0x5d80
movq -0x10(%rbp), %rax
movl $0x0, 0x1a8(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0x22d0
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_sender.c
// Function: connect_udp_server
static bool connect_udp_server(shoit_core_t *sender)
{
    /**as udp client,connect udp server*/
    if(sender->verbose>1)
        SHOIT_LOG("call %s udpLocalPort:%d,remoteudp :%s:%d\n",__func__,sender->udpLocalPort,sender->remoteHost, sender->udpRemotePort);
    sender->udpSockfd = shoit_network_connect_udp(&sender->udpServerAddr,sender->udpLocalPort,
                            sender->remoteHost, sender->udpRemotePort);

    return (sender->udpSockfd==-1)?false:true;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x5c(%rax)
jle 0x5a27
jmp 0x59e8
movq -0x8(%rbp), %rax
movq 0xe8(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0xa0(%rax), %ecx
movq -0x8(%rbp), %r8
addq $0x78, %r8
movq -0x8(%rbp), %rax
movl 0x98(%rax), %r9d
leaq 0x3e1c(%rip), %rsi      # 0x9833
leaq 0x3e3f(%rip), %rdx      # 0x985d
movb $0x0, %al
callq 0x3df0
jmp 0x5a27
movq -0x8(%rbp), %rdi
addq $0xa4, %rdi
movq -0x8(%rbp), %rax
movl 0xa0(%rax), %esi
movq -0x8(%rbp), %rdx
addq $0x78, %rdx
movq -0x8(%rbp), %rax
movl 0x98(%rax), %ecx
callq 0x3260
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x68(%rax)
movq -0x8(%rbp), %rax
movl 0x68(%rax), %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $-0x1, %edx
cmovel %ecx, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_sender.c
// Function: each_round_transfer_init
static bool each_round_transfer_init(void *arg)
{
    shoit_core_t *sender = (shoit_core_t*)arg;
    bool iMore=false;

    /*                                                                                                                               
    *from fromFd fetch data to sender->bucket again.                                                                                 
    *if send file and use mmap,don't need.                                                                                           
    */                                                                                                                               
    iMore = each_round_fetch_bucket(sender);   
    if(iMore){ 
        //reboot bucketSize change
        update_sender_bucket_infomation(sender);
    }
    return iMore;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6320
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x6076
movq -0x10(%rbp), %rdi
callq 0x4730
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_receiver.c
// Function: receiver_run_loop
void receiver_run_loop(shoit_core_t *receiver,char *recvFile,int toFd)
{
    do{
        /*init for thread syn*/
        shoit_init_synch(receiver);
        receiver->runing = false;
        receiver->bucket=NULL;
        memset(&progress,0,sizeof(progress));

        if(receiver->iStream) receiver->toFd = toFd;
    
        
        /*connect sender's tcp server*/
        receiver->tcpSockfd =shoit_network_connect_tcp(receiver->remoteHost,receiver->tcpPort);
        if(receiver->tcpSockfd==-1){
            SHOIT_LOG("connect remote tcp server failed.\n");        
            break;
        }


        receiver->runing = true; 
        /*create pthread*/
        //create data transfer thread base on udp
        pthread_t transfer_thid;
        pthread_create(&transfer_thid,NULL,(void*)transfer_thread_run,(void*)receiver);
        
        //create progress thread
        pthread_t prog_thid;
        pthread_create(&prog_thid,NULL,(void*)progress_thread_run,(void*)receiver);




        /*run tcp control loop*/
        _receiver_run_loop(receiver,recvFile);



        /*wait thread exit*/
        sem_post(&receiver->dataSem);
        sem_post(&receiver->progSem); 
        pthread_join(transfer_thid,NULL); 
        pthread_join(prog_thid,NULL); 

    }while(0);

    receiver_free(receiver);

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2b20
movq -0x8(%rbp), %rax
movl $0x0, 0x1a8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
leaq 0x5cbc(%rip), %rdi      # 0xc2d8
xorl %esi, %esi
movl $0x38, %edx
callq 0x21a0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1a4(%rax)
je 0x6642
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xfc(%rax)
movq -0x8(%rbp), %rdi
addq $0x78, %rdi
movq -0x8(%rbp), %rax
movl 0x9c(%rax), %esi
callq 0x3590
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x6c(%rax)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x6c(%rax)
jne 0x668c
jmp 0x666e
movq -0x8(%rbp), %rax
movq 0xe8(%rax), %rdi
leaq 0x3604(%rip), %rsi      # 0x9c84
movb $0x0, %al
callq 0x3df0
jmp 0x6711
movq -0x8(%rbp), %rax
movl $0x1, 0x1a8(%rax)
movq -0x8(%rbp), %rcx
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x73(%rip), %rdx        # 0x6720
callq 0x2340
movq -0x8(%rbp), %rcx
leaq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x17b(%rip), %rdx       # 0x6840
callq 0x2340
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6c80
movq -0x8(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0x21f0
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x21f0
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2420
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2420
movq -0x8(%rbp), %rdi
callq 0x7180
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/pencode-lab[P]Shoit/shoit_receiver.c
// Function: transfer_thread_run
static void transfer_thread_run(void *argv)
{
    shoit_core_t *receiver = (shoit_core_t *)argv;

    if(receiver->runing){
        //create udpserver
        receiver->udpRemotePort = receiver->udpLocalPort + 1;
        receiver->udpSockfd=shoit_network_udp_server_init(&receiver->udpServerAddr,
                                                            receiver->udpLocalPort,
                                                            receiver->remoteHost,
                                                            receiver->udpRemotePort);
        if(receiver->verbose>1) SHOIT_LOG("start udpserver 0.0.0.0:%d <-> %s:%d",
                            receiver->udpLocalPort,receiver->remoteHost,receiver->udpRemotePort);

        if(receiver->udpSockfd==-1){
            receiver->runing=false;
            SHOIT_LOG("start udp server failed.\n");
        }
    }

    while(receiver->runing){
        transfer_data_round_circle(receiver);
    }
    receiver->runing=false; 
    pthread_exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1a8(%rax)
je 0x680a
movq -0x10(%rbp), %rax
movl 0xa0(%rax), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x98(%rax)
movq -0x10(%rbp), %rdi
addq $0xa4, %rdi
movq -0x10(%rbp), %rax
movl 0xa0(%rax), %esi
movq -0x10(%rbp), %rdx
addq $0x78, %rdx
movq -0x10(%rbp), %rax
movl 0x98(%rax), %ecx
callq 0x3400
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x68(%rax)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x5c(%rax)
jle 0x67d5
jmp 0x679d
movq -0x10(%rbp), %rax
movq 0xe8(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0xa0(%rax), %edx
movq -0x10(%rbp), %rcx
addq $0x78, %rcx
movq -0x10(%rbp), %rax
movl 0x98(%rax), %r8d
leaq 0x3534(%rip), %rsi      # 0x9d00
movb $0x0, %al
callq 0x3df0
jmp 0x67d5
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x68(%rax)
jne 0x6808
movq -0x10(%rbp), %rax
movl $0x0, 0x1a8(%rax)
movq -0x10(%rbp), %rax
movq 0xe8(%rax), %rdi
leaq 0x3526(%rip), %rsi      # 0x9d25
movb $0x0, %al
callq 0x3df0
jmp 0x6808
jmp 0x680a
jmp 0x680c
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1a8(%rax)
je 0x6824
movq -0x10(%rbp), %rdi
callq 0x72d0
jmp 0x680c
movq -0x10(%rbp), %rax
movl $0x0, 0x1a8(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0x22d0
nopl (%rax,%rax)