LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/mishun[P]plantri/plantri.c
// Function: update_nft_four
static void
update_nft_four(triangle nft[], int numnft, EDGE *ref,
                triangle newnft[], int *newnumnft)

/* Make new list of non-facial triangles after a four-extension. */
{
    EDGE *refmin,*e,*elast;
    int i,k,w;

    refmin = ref->min;

  /* Remove triangles that include ref */
    k = 0;
    for (i = 0; i < numnft; ++i)
        if (nft[i].e1 != refmin && nft[i].e2 != refmin && nft[i].e3 != refmin)
            newnft[k++] = nft[i];

  /* Add a shortcut if there is one (only possible if there are >= 2 others) */
    if (k >= 2)
    {
        w = ref->next->end;
        elast = ref->invers->next->invers;
        for (e = elast->next->next->next; e != elast; e = e->next)
            if (e->end == w) break;
        if (e != elast)
        {
            newnft[k].e1 = e->min;
            newnft[k].e2 = ref->prev->min;
            newnft[k].e3 = ref->next->min;
            ++k;
        }
    }
    *newnumnft = k;
}

// Assembly:
pushq %r14
pushq %rbx
testl %esi, %esi
jle 0x1f639
movq 0x28(%rdx), %r9
movl %esi, %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
xorl %r10d, %r10d
xorl %eax, %eax
cmpq %r9, (%rdi,%r10)
je 0x1f62e
cmpq %r9, 0x8(%rdi,%r10)
je 0x1f62e
cmpq %r9, 0x10(%rdi,%r10)
je 0x1f62e
leaq (%rdi,%r10), %r11
movslq %eax, %rbx
incl %eax
leaq (%rbx,%rbx,2), %rbx
movq 0x10(%r11), %r14
movq %r14, 0x10(%rcx,%rbx,8)
movups (%r11), %xmm0
movups %xmm0, (%rcx,%rbx,8)
addq $0x18, %r10
cmpq %r10, %rsi
jne 0x1f5fc
jmp 0x1f63b
xorl %eax, %eax
cmpl $0x2, %eax
jl 0x1f691
movq 0x18(%rdx), %rsi
movq 0x20(%rdx), %r9
movl 0x4(%rsi), %edi
movq 0x18(%r9), %r9
movq 0x20(%r9), %r9
movq 0x18(%r9), %r10
movq 0x18(%r10), %r10
movq 0x18(%r10), %r10
cmpq %r9, %r10
je 0x1f691
cmpl %edi, 0x4(%r10)
jne 0x1f65b
movq 0x28(%r10), %rdi
movl %eax, %r9d
leaq (%r9,%r9,2), %r9
movq %rdi, (%rcx,%r9,8)
movq 0x10(%rdx), %rdx
movq 0x28(%rdx), %rdx
movq %rdx, 0x8(%rcx,%r9,8)
movq 0x28(%rsi), %rdx
movq %rdx, 0x10(%rcx,%r9,8)
incl %eax
movl %eax, (%r8)
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/soso7885[P]OPCUA_example/demo_src/server_repeated_job.c
// Function: main
int main(int argc, char** argv) {
    signal(SIGINT, stopHandler); /* catches ctrl-c */

    UA_ServerConfig config = UA_ServerConfig_standard;
    UA_ServerNetworkLayer nl = UA_ServerNetworkLayerTCP(UA_ConnectionConfig_standard, 16664);
    config.networkLayers = &nl;
    config.networkLayersSize = 1;
    UA_Server *server = UA_Server_new(config);

    /* add a repeated job to the server */
    UA_Job job = {.type = UA_JOBTYPE_METHODCALL,
                  .job.methodCall = {.method = testCallback, .data = NULL} };
    UA_Server_addRepeatedJob(server, job, 2000, NULL); // call every 2 sec

    UA_StatusCode retval = UA_Server_run(server, &running);
    UA_Server_delete(server);
    nl.deleteMembers(&nl);
    return (int)retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
leaq 0xd8(%rip), %rsi        # 0x128b
movl $0x2, %edi
callq 0x1070
movq 0x2e1c(%rip), %rsi      # 0x3fe0
leaq -0x1c8(%rbp), %r14
movl $0x160, %edx            # imm = 0x160
movq %r14, %rdi
callq 0x1060
movq 0x2e11(%rip), %rax      # 0x3ff0
movl 0x10(%rax), %ecx
movl %ecx, -0x20(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x30(%rbp)
movl -0x20(%rbp), %eax
movl %eax, 0x10(%rsp)
movaps -0x30(%rbp), %xmm0
movups %xmm0, (%rsp)
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
movl $0x4118, %esi           # imm = 0x4118
callq 0x1040
movq %rbx, 0xf8(%r14)
movq $0x1, 0xf0(%r14)
movl $0x2c, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x1030
movq %rax, %r14
movups 0x2b8d(%rip), %xmm0     # 0x3dc8
movups %xmm0, 0x10(%rsp)
movups 0x2b71(%rip), %xmm0     # 0x3db8
movups %xmm0, (%rsp)
movq %rax, %rdi
movl $0x7d0, %esi            # imm = 0x7D0
xorl %edx, %edx
callq 0x1050
leaq 0x2dff(%rip), %rsi      # 0x4060
movq %r14, %rdi
callq 0x1080
movl %eax, %r15d
movq %r14, %rdi
callq 0x1090
movq %rbx, %rdi
callq *0x30(%rbx)
movl %r15d, %eax
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/main.c
// Function: hash_fun
unsigned int hash_fun(void* key,int hashtable_size)
{
    unsigned int hash = 0;
    char* str = key;
    while(*str)
    {
        hash += (hash << 5) + (*str++);
    }

    return ( hash & 0x7fffffff ) % hashtable_size;
}

// Assembly:
movb (%rdi), %cl
testb %cl, %cl
je 0x3c92
incq %rdi
xorl %eax, %eax
movsbl %cl, %ecx
movl %eax, %edx
shll $0x5, %edx
addl %edx, %eax
addl %ecx, %eax
movb (%rdi), %cl
incq %rdi
testb %cl, %cl
jne 0x3c76
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
jmp 0x3c94
xorl %eax, %eax
xorl %edx, %edx
divl %esi
movl %edx, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/sysutil.c
// Function: tcp_srv
int tcp_srv(const char* host,const unsigned short port)
{
    int fd = socket(AF_INET,SOCK_STREAM,0);
    if (-1 == fd)
        ERR_EXIT("socket error");

    int on = 1;
    if (-1 == setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(const char*)&on,sizeof(on)))
        ERR_EXIT("setsockopt error");

    struct sockaddr_in srvaddr;
    memset(&srvaddr,0,sizeof(srvaddr));
    srvaddr.sin_family = AF_INET;
    srvaddr.sin_port = htons(port);
    if (NULL != host)
    {
        if (0 == inet_aton(host,&srvaddr.sin_addr))
            ERR_EXIT("inet_aton");
    }
    else
        srvaddr.sin_addr.s_addr = htonl(INADDR_ANY);

    if (-1 == bind(fd,(struct sockaddr*)&srvaddr,sizeof(srvaddr)))
        ERR_EXIT("bind error");

    if (-1 == listen(fd,10))
        ERR_EXIT("listen error");

    return fd;

}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebp
movq %rdi, %r14
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x3540
cmpl $-0x1, %eax
je 0x3e2f
movl %eax, %ebx
leaq 0x1c(%rsp), %rcx
movl $0x1, (%rcx)
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x30d0
cmpl $-0x1, %eax
je 0x3e34
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movw $0x2, (%rsp)
rolw $0x8, %bp
movw %bp, 0x2(%rsp)
testq %r14, %r14
je 0x3df7
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
jne 0x3dff
callq 0x35d4
movl $0x0, 0x4(%rsp)
movq %rsp, %rsi
movl %ebx, %edi
movl $0x10, %edx
callq 0x3400
cmpl $-0x1, %eax
je 0x3e39
movl %ebx, %edi
movl $0xa, %esi
callq 0x33b0
cmpl $-0x1, %eax
je 0x3e3e
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x3628
callq 0x3613
callq 0x35fe
callq 0x35e9
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/sysutil.c
// Function: tcp_clnt
int tcp_clnt(const char* host,const unsigned short port)
{
    int fd = socket(PF_INET,SOCK_STREAM,0);
    if (-1 == fd)
        ERR_EXIT("socket error");

    int on = 1;
    if (-1 == setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(const char*)&on,sizeof(on)))
        ERR_EXIT("setsockopt error");
    
    if ( port > 0 )
    {
        struct sockaddr_in srvaddr;
        memset(&srvaddr,0,sizeof(srvaddr));
        srvaddr.sin_family = AF_INET;
        srvaddr.sin_port = htons(port);
        if (0 == inet_aton(host,&srvaddr.sin_addr))
            ERR_EXIT("inet_aton");
        if (-1 == bind(fd,(struct sockaddr*)&srvaddr,sizeof(srvaddr)))
            ERR_EXIT("bind error");
    }

    return fd;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebp
movq %rdi, %r14
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x3540
cmpl $-0x1, %eax
je 0x3edb
movl %eax, %ebx
leaq 0xc(%rsp), %rcx
movl $0x1, (%rcx)
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x30d0
cmpl $-0x1, %eax
je 0x3ee0
testw %bp, %bp
je 0x3ed0
xorps %xmm0, %xmm0
leaq 0x14(%rsp), %rsi
movaps %xmm0, -0x4(%rsi)
movw $0x2, -0x4(%rsi)
rolw $0x8, %bp
movw %bp, -0x2(%rsi)
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
je 0x3ee5
leaq 0x10(%rsp), %rsi
movl %ebx, %edi
movl $0x10, %edx
callq 0x3400
cmpl $-0x1, %eax
je 0x3eea
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x367c
callq 0x3667
callq 0x3652
callq 0x363d
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/sysutil.c
// Function: getlocalip
int getlocalip(char *ip)
{
    int sockfd; 
    if(-1 == (sockfd = socket(PF_INET, SOCK_STREAM, 0)))
    {
        perror( "socket" );
        return -1;
    }
    struct ifreq req;
    struct sockaddr_in *host;
    bzero(&req, sizeof(struct ifreq));
    strcpy(req.ifr_name, "eth0"); 
    ioctl(sockfd, SIOCGIFADDR, &req);
    host = (struct sockaddr_in*)&req.ifr_addr;
    strcpy(ip, inet_ntoa(host->sin_addr));
    close(sockfd);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movl $0x1, %ebx
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x3540
cmpl $-0x1, %eax
je 0x3f76
movl %eax, %ebp
xorps %xmm0, %xmm0
movq %rsp, %r15
movups %xmm0, 0x15(%r15)
movups %xmm0, 0x5(%r15)
movl $0x0, 0x24(%r15)
movl $0x30687465, (%r15)     # imm = 0x30687465
movb $0x0, 0x4(%r15)
movl $0x8915, %esi           # imm = 0x8915
movl %eax, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3230
movl 0x14(%r15), %edi
callq 0x3120
movq %r14, %rdi
movq %rax, %rsi
callq 0x3090
movl %ebp, %edi
callq 0x3260
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x41a8(%rip), %rdi      # 0x8125
callq 0x3460
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x3f69
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/sysutil.c
// Function: activate_nonblock
void activate_nonblock(int fd)
{
    int ret;
    int flags = fcntl(fd, F_GETFL);
    if (flags == -1)
        ERR_EXIT("fcntl");

    flags |= O_NONBLOCK;
    ret = fcntl(fd, F_SETFL, flags);
    if (ret == -1)
        ERR_EXIT("fcntl");
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl $0x3, %esi
xorl %eax, %eax
callq 0x30f0
cmpl $-0x1, %eax
je 0x3fb9
orl $0x800, %eax            # imm = 0x800
movl %ebx, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x30f0
cmpl $-0x1, %eax
je 0x3fbe
popq %rbx
retq
callq 0x36a6
callq 0x3691
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/sysutil.c
// Function: read_timeout
int read_timeout(int fd, unsigned int wait_seconds)
{
    int ret = 0;
    if (wait_seconds > 0)
    {
        fd_set read_fdset;
        struct timeval timeout;

        FD_ZERO(&read_fdset);
        FD_SET(fd, &read_fdset);

        timeout.tv_sec = wait_seconds;
        timeout.tv_usec = 0;
        do
        {
            ret = select(fd + 1, &read_fdset, NULL, NULL, &timeout);
        } while (ret < 0 && errno == EINTR);

        if (ret == 0)
        {
            ret = -1;
            errno = ETIMEDOUT;
        }
        else if (ret == 1)
            ret = 0;
    }

    return ret;
}

// Assembly:
testl %esi, %esi
je 0x40a7
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl %edi, %ebx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x30(%r14)
movaps %xmm0, 0x40(%r14)
movaps %xmm0, 0x50(%r14)
leal 0x3f(%rbx), %eax
testl %edi, %edi
cmovnsl %edi, %eax
movl %eax, %edx
andl $-0x40, %edx
movl %edi, %ecx
subl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movaps %xmm0, 0x60(%r14)
movaps %xmm0, 0x70(%r14)
sarl $0x6, %eax
cltq
orq %rdx, 0x10(%rsp,%rax,8)
movl %esi, %eax
movq %rsp, %r15
movq %rax, (%r15)
movq $0x0, 0x8(%r15)
incl %ebx
movl %ebx, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x3360
movl %eax, %ebp
testl %eax, %eax
jns 0x4099
callq 0x3060
cmpl $0x4, (%rax)
je 0x4078
testl %ebp, %ebp
je 0x40aa
xorl %eax, %eax
cmpl $0x1, %ebp
cmovnel %ebp, %eax
jmp 0x40ba
xorl %eax, %eax
retq
callq 0x3060
movl $0x6e, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/sysutil.c
// Function: write_timeout
int write_timeout(int fd, unsigned int wait_seconds)
{
    int ret = 0;
    if (wait_seconds > 0)
    {
        fd_set write_fdset;
        struct timeval timeout;

        FD_ZERO(&write_fdset);
        FD_SET(fd, &write_fdset);

        timeout.tv_sec = wait_seconds;
        timeout.tv_usec = 0;
        do
        {
            ret = select(fd + 1, NULL, NULL, &write_fdset, &timeout);
        } while (ret < 0 && errno == EINTR);

        if (ret == 0)
        {
            ret = -1;
            errno = ETIMEDOUT;
        }
        else if (ret == 1)
            ret = 0;
    }

    return ret;
}

// Assembly:
testl %esi, %esi
je 0x4172
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl %edi, %ebx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x30(%r14)
movaps %xmm0, 0x40(%r14)
movaps %xmm0, 0x50(%r14)
leal 0x3f(%rbx), %eax
testl %edi, %edi
cmovnsl %edi, %eax
movl %eax, %edx
andl $-0x40, %edx
movl %edi, %ecx
subl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movaps %xmm0, 0x60(%r14)
movaps %xmm0, 0x70(%r14)
sarl $0x6, %eax
cltq
orq %rdx, 0x10(%rsp,%rax,8)
movl %esi, %eax
movq %rsp, %r15
movq %rax, (%r15)
movq $0x0, 0x8(%r15)
incl %ebx
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
movq %r15, %r8
callq 0x3360
movl %eax, %ebp
testl %eax, %eax
jns 0x4164
callq 0x3060
cmpl $0x4, (%rax)
je 0x4143
testl %ebp, %ebp
je 0x4175
xorl %eax, %eax
cmpl $0x1, %ebp
cmovnel %ebp, %eax
jmp 0x4185
xorl %eax, %eax
retq
callq 0x3060
movl $0x6e, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/sysutil.c
// Function: accept_timeout
int accept_timeout(int fd, struct sockaddr_in *addr, unsigned int wait_seconds)
{
    int ret;
    socklen_t addrlen = sizeof(struct sockaddr_in);

    if (wait_seconds > 0)
    {
        fd_set accept_fdset;
        struct timeval timeout;
        FD_ZERO(&accept_fdset);
        FD_SET(fd, &accept_fdset);
        timeout.tv_sec = wait_seconds;
        timeout.tv_usec = 0;
        do
        {
            ret = select(fd + 1, &accept_fdset, NULL, NULL, &timeout);
        } while (ret < 0 && errno == EINTR);
        if (ret == -1)
            return -1;
        else if (ret == 0)
        {
            errno = ETIMEDOUT;
            return -1;
        }
    }

    if (addr != NULL)
        ret = accept(fd, (struct sockaddr*)addr, &addrlen);
    else
        ret = accept(fd, NULL, NULL);
/*  if (ret == -1)
        ERR_EXIT("accept");
        */

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r14
movl %edi, %ebx
movl $0x10, 0xc(%rsp)
testl %edx, %edx
je 0x4261
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r15
movaps %xmm0, (%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x40(%r15)
movaps %xmm0, 0x50(%r15)
leal 0x3f(%rbx), %eax
testl %ebx, %ebx
cmovnsl %ebx, %eax
movl %eax, %esi
andl $-0x40, %esi
movl %ebx, %ecx
subl %esi, %ecx
movl $0x1, %esi
shlq %cl, %rsi
movaps %xmm0, 0x60(%r15)
movaps %xmm0, 0x70(%r15)
sarl $0x6, %eax
cltq
orq %rsi, 0x20(%rsp,%rax,8)
movl %edx, %eax
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
movq $0x0, 0x8(%r12)
leal 0x1(%rbx), %ebp
movl %ebp, %edi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r12, %r8
callq 0x3360
movl %eax, %r13d
testl %eax, %eax
jns 0x4244
callq 0x3060
cmpl $0x4, (%rax)
je 0x4222
cmpl $-0x1, %r13d
je 0x425a
testl %r13d, %r13d
jne 0x4261
callq 0x3060
movl $0x6e, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x427d
testq %r14, %r14
je 0x4272
leaq 0xc(%rsp), %rdx
movl %ebx, %edi
movq %r14, %rsi
jmp 0x4278
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3490
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/sysutil.c
// Function: readn
ssize_t readn(int fd, void *buf, size_t count)
{
    size_t nleft = count;
    ssize_t nread;
    char *bufp = (char*)buf;

    while (nleft > 0)
    {
        if ((nread = read(fd, bufp, nleft)) < 0)
        {
            if (errno == EINTR)
                continue;
            return -1;
        }
        else if (nread == 0)
            return count - nleft;

        bufp += nread;
        nleft -= nread;
    }

    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
testq %rdx, %rdx
je 0x4452
movq %rsi, %r14
movl %edi, %ebp
movq %rbx, %r15
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3280
testq %rax, %rax
jns 0x443f
callq 0x3060
cmpl $0x4, (%rax)
je 0x4421
jmp 0x444b
je 0x4460
addq %rax, %r14
subq %rax, %r15
jne 0x4421
jmp 0x4452
movq $-0x1, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
subq %r15, %rbx
jmp 0x4452
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/sysutil.c
// Function: writen
ssize_t writen(int fd, const void *buf, size_t count)
{
    size_t nleft = count;
    ssize_t nwritten;
    char *bufp = (char*)buf;

    while (nleft > 0)
    {
        if ((nwritten = write(fd, bufp, nleft)) < 0)
        {
            if (errno == EINTR)
                continue;
            return -1;
        }
        else if (nwritten == 0)
            continue;

        bufp += nwritten;
        nleft -= nwritten;
    }

    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
testq %rdx, %rdx
sete %r12b
je 0x44d0
movq %rsi, %r14
movl %edi, %ebp
movq %rbx, %r15
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3100
testq %rax, %rax
js 0x449d
jne 0x44b4
testb $0x1, %r12b
je 0x4481
jmp 0x44d0
callq 0x3060
movl (%rax), %eax
cmpl $0x4, %eax
setne %cl
orb %r12b, %cl
testb $0x1, %cl
je 0x4481
jmp 0x44c2
addq %rax, %r14
subq %rax, %r15
sete %r12b
jne 0x4481
jmp 0x44d0
cmpl $0x4, %eax
movq $-0x1, %rax
cmovneq %rax, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/sysutil.c
// Function: recv_peek
ssize_t recv_peek(int sockfd, void *buf, size_t len)
{
    while (1)
    {
        int ret = recv(sockfd, buf, len, MSG_PEEK);
        if (ret == -1 && errno == EINTR)
            continue;
        return ret;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
movl $0x2, %ecx
callq 0x3050
movq %rax, %r12
cmpl $-0x1, %r12d
jne 0x4513
callq 0x3060
movb $0x1, %cl
cmpl $0x4, (%rax)
je 0x4518
movslq %r12d, %r15
xorl %ecx, %ecx
testb %cl, %cl
jne 0x44ec
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/sysutil.c
// Function: readline
ssize_t readline(int sockfd, void *buf, size_t maxline)
{
    int ret;
    int nread;
    char *bufp = buf;
    int nleft = maxline;
    while (1)
    {
        ret = recv_peek(sockfd, bufp, nleft);
        if (ret < 0)
            return ret;
        else if (ret == 0)
            return ret;

        nread = ret;
        int i;
        for (i=0; i<nread; i++)
        {
            if (bufp[i] == '\n')
            {
                ret = readn(sockfd, bufp, i+1);
                if (ret != i+1)
                    exit(EXIT_FAILURE);

                return ret;
            }
        }

        if (nread > nleft)
            exit(EXIT_FAILURE);

        nleft -= nread;
        ret = readn(sockfd, bufp, nread);
        if (ret != nread)
            exit(EXIT_FAILURE);

        bufp += nread;
    }

    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
movslq %ebx, %rdx
movl %ebp, %edi
movq %r14, %rsi
callq 0x44dc
movq %rax, %r12
testl %r12d, %r12d
js 0x45e8
je 0x45ed
cmpb $0xa, (%r14)
jne 0x456b
movb $0x1, %r15b
movl $0x1, %r13d
jmp 0x459a
movq %r13, (%rsp)
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x1, %ecx
cmpq %rcx, %rax
je 0x45b1
leaq 0x1(%rcx), %r13
cmpb $0xa, (%r14,%rcx)
movq %r13, %rcx
jne 0x457c
leaq -0x1(%r13), %rcx
cmpq %rax, %rcx
setb %r15b
movl %r13d, %edx
movl %ebp, %edi
movq %r14, %rsi
callq 0x440a
cmpl %eax, %r13d
jne 0x4602
movslq %eax, %r13
jmp 0x45dd
seta %r15b
subl %r12d, %ebx
jl 0x4602
movl %r12d, %r13d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movl %ebp, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x440a
cmpl %r12d, %eax
jne 0x4602
addq %r13, %r14
movq (%rsp), %r13
testb %r15b, %r15b
je 0x453b
jmp 0x45f0
movslq %r12d, %r13
jmp 0x45f0
xorl %r13d, %r13d
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x34d0
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/sysutil.c
// Function: send_fd
void send_fd(int sock_fd, int fd)
{
    int ret;
    struct msghdr msg;
    struct cmsghdr *p_cmsg;
    struct iovec vec;
    char cmsgbuf[CMSG_SPACE(sizeof(fd))];
    int *p_fds;
    char sendchar = 0;
    msg.msg_control = cmsgbuf;
    msg.msg_controllen = sizeof(cmsgbuf);
    p_cmsg = CMSG_FIRSTHDR(&msg);
    p_cmsg->cmsg_level = SOL_SOCKET;
    p_cmsg->cmsg_type = SCM_RIGHTS;
    p_cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
    p_fds = (int*)CMSG_DATA(p_cmsg);
    *p_fds = fd;

    msg.msg_name = NULL;
    msg.msg_namelen = 0;
    msg.msg_iov = &vec;
    msg.msg_iovlen = 1;
    msg.msg_flags = 0;

    vec.iov_base = &sendchar;
    vec.iov_len = sizeof(sendchar);
    ret = sendmsg(sock_fd, &msg, 0);
    if (ret != 1)
        ERR_EXIT("sendmsg");
}

// Assembly:
subq $0x78, %rsp
leaq 0xf(%rsp), %rcx
movb $0x0, (%rcx)
leaq 0x20(%rsp), %rdx
leaq 0x40(%rsp), %rax
movq %rdx, 0x20(%rax)
movq $0x18, 0x28(%rax)
movabsq $0x100000001, %r8       # imm = 0x100000001
movq %r8, 0x8(%rdx)
movq $0x14, (%rdx)
movl %esi, 0x10(%rdx)
movq $0x0, (%rax)
xorl %edx, %edx
movl %edx, 0x8(%rax)
leaq 0x10(%rsp), %rsi
movq %rsi, 0x10(%rax)
movl $0x1, %r8d
movq %r8, 0x18(%rax)
movl %edx, 0x30(%rax)
movq %rcx, (%rsi)
movq %r8, 0x8(%rsi)
movq %rax, %rsi
xorl %edx, %edx
callq 0x30b0
cmpl $0x1, %eax
jne 0x4683
addq $0x78, %rsp
retq
callq 0x36e5
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/session.c
// Function: init_session
void init_session(session_t* ssinf,int conn)
{
    memset(ssinf,0,sizeof(session_t));
    ssinf->ctrlfd = conn;
    ssinf->protofd = ssinf->nobodyfd = -1;

    ssinf->bASCII = 0;

    ssinf->rn_filepath = NULL;
    ssinf->pasv_lsfd = -1;

    ssinf->burg = 0;

    ssinf->ip = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
movl $0xc48, %edx            # imm = 0xC48
xorl %esi, %esi
callq 0x3220
movl %ebx, 0x8(%r14)
movq $-0x1, (%r14)
movl $0x0, 0x10(%r14)
movq %r15, 0xc28(%r14)
movl $0xffffffff, 0xc20(%r14) # imm = 0xFFFFFFFF
movq %r15, 0xc40(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/session.c
// Function: begin_session
int begin_session(session_t* sessioninf)
{

    ftpipc_init(sessioninf);

    pid_t pid = fork();
    if (-1 == pid)
        ERR_EXIT("fork error");

    if (pid > 0)
    {
        //nobody process
        //set the process nobody
        ftpipc_setnobody(sessioninf);
        handle_pri(sessioninf);
    }
    if (0 == pid)
    {
        //ftp proto
        ftpipc_setproto(sessioninf);
        handle_ftp(sessioninf);
    }
    
    return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x6a10
callq 0x3530
cmpl $-0x1, %eax
je 0x47a3
movl %eax, %ebp
testl %eax, %eax
jle 0x4786
movq %rbx, %rdi
callq 0x6a6d
movq %rbx, %rdi
callq 0x6876
testl %ebp, %ebp
jne 0x479a
movq %rbx, %rdi
callq 0x6a7a
movq %rbx, %rdi
callq 0x544e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x3739
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/session.c
// Function: clear_session
void clear_session(session_t* ssinf)
{
    clear_transfer(ssinf);

    if ( -1 != ssinf->nobodyfd )
        close(ssinf->nobodyfd); 
    if ( -1 != ssinf->protofd )
        close(ssinf->protofd); 
    if ( -1 != ssinf->ctrlfd )
        close(ssinf->ctrlfd); 
    if ( -1 != ssinf->datafd )
        close(ssinf->datafd); 
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x47e7
movl (%rbx), %edi
cmpl $-0x1, %edi
je 0x47bd
callq 0x3260
movl 0x4(%rbx), %edi
cmpl $-0x1, %edi
je 0x47ca
callq 0x3260
movl 0x8(%rbx), %edi
cmpl $-0x1, %edi
je 0x47d7
callq 0x3260
movl 0xc(%rbx), %edi
cmpl $-0x1, %edi
je 0x47e5
popq %rbx
jmp 0x3260
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/session.c
// Function: clear_transfer
void clear_transfer(session_t* ssinf)
{
    shutdown(ssinf->datafd,SHUT_RDWR);
    ssinf->datafd = -1;
    if ( has_port(ssinf) )
    {
        free(ssinf->port_addr);
        ssinf->port_addr = NULL;
    }
    if ( has_pasv(ssinf) )
    {
        close(ssinf->pasv_lsfd);
        ssinf->pasv_lsfd = -1;
    }
    if ( NULL != ssinf->rn_filepath )
        free(ssinf->rn_filepath);
    ssinf->rest_pos = 0;
    ssinf->bappe = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0xc(%rdi), %edi
movl $0x2, %esi
callq 0x3150
movl $0xffffffff, 0xc(%rbx)  # imm = 0xFFFFFFFF
movq 0xc18(%rbx), %rdi
testq %rdi, %rdi
je 0x481b
callq 0x3040
movq $0x0, 0xc18(%rbx)
movl 0xc20(%rbx), %edi
cmpl $-0x1, %edi
je 0x4835
callq 0x3260
movl $0xffffffff, 0xc20(%rbx) # imm = 0xFFFFFFFF
movq 0xc28(%rbx), %rdi
testq %rdi, %rdi
je 0x4846
callq 0x3040
movq $0x0, 0xc30(%rbx)
movl $0x0, 0x14(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/session.c
// Function: ratelim_do
int ratelim_do(session_t* sess,unsigned int maxrate,int nbytes)
{
    if ( 0 == maxrate )
        return 0;
    struct timeval tv;
    if ( -1 == gettimeofday(&tv,NULL) ) 
        return -1;

    double elapsed = (double)(tv.tv_sec - sess->ts_sec) + 0.000001 * (double)(tv.tv_usec - sess->ts_usec);
    if ( elapsed <= 0 )
        elapsed = 0.01;

    double currate = (double)nbytes / elapsed;
    if ( (int)currate < maxrate )
        return 0;
    double timetosleep = ( currate / (double)maxrate - 1 ) * elapsed;


    struct timespec ts;
    ts.tv_sec = (int)timetosleep;
    ts.tv_nsec = (timetosleep - ts.tv_sec) * 1000000000;

    int ret;
    do 
    {
        ret = nanosleep(&ts,&ts);
    } while ( -1 == ret && EINTR == errno); 

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
testl %esi, %esi
je 0x49b4
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %r15
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x3200
cmpl $-0x1, %eax
je 0x49b8
movl 0xc38(%r15), %eax
movl 0xc3c(%r15), %ecx
movq 0x8(%rsp), %rdx
subq %rax, %rdx
cvtsi2sd %rdx, %xmm0
movq 0x10(%rsp), %rax
subq %rcx, %rax
cvtsi2sd %rax, %xmm2
mulsd 0x383e(%rip), %xmm2     # 0x8158
addsd %xmm0, %xmm2
xorpd %xmm0, %xmm0
movapd %xmm2, %xmm1
cmpnlesd %xmm0, %xmm1
andpd %xmm1, %xmm2
movsd 0x3829(%rip), %xmm0     # 0x8160
andnpd %xmm0, %xmm1
orpd %xmm2, %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
cmpl %ebp, %eax
jb 0x49bd
movl %ebp, %eax
xorps %xmm2, %xmm2
cvtsi2sd %rax, %xmm2
divsd %xmm2, %xmm0
addsd 0x37ff(%rip), %xmm0     # 0x8168
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
cltq
cvttpd2dq %xmm0, %xmm1
cvtdq2pd %xmm1, %xmm1
leaq 0x18(%rsp), %r14
subsd %xmm1, %xmm0
mulsd 0x37e4(%rip), %xmm0     # 0x8170
movq %rax, (%r14)
cvttsd2si %xmm0, %rax
movq %rax, 0x8(%r14)
movq %r14, %rdi
movq %r14, %rsi
callq 0x31d0
cmpl $-0x1, %eax
jne 0x49bd
callq 0x3060
cmpl $0x4, (%rax)
je 0x4998
jmp 0x49bd
xorl %ebx, %ebx
jmp 0x49bd
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/str.c
// Function: str_split
int str_split(char* str,char *cmd,char* arg,char delim)
{
    char* pos = strchr(str,delim);
    if (NULL == pos)
    {
        strncpy(cmd,str,strlen(str));
        return 1;
    }
    else
    {
        *pos = '\0';
        strncpy(cmd,str,strlen(str));
        strncpy(arg,pos + 1,strlen(pos + 1));
        return 2;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl %ecx, %esi
callq 0x31b0
testq %rax, %rax
je 0x4a4b
movq %rax, %r12
movb $0x0, (%rax)
movq %r14, %rdi
callq 0x3180
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3080
incq %r12
movq %r12, %rdi
callq 0x3180
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x3080
movl $0x2, %eax
jmp 0x4a66
movq %r14, %rdi
callq 0x3180
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3080
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/str.c
// Function: str_octal_to_uint
unsigned int str_octal_to_uint(char* str)
{
    unsigned int ret = 0;
    while (*str) 
    {
        if (*str >= '0' && *str <= '7') 
        {
            ret = ret * 8 + *str - '0';
        }
        else
            return 0;
        str++;
    }
    return ret;
}

// Assembly:
movb (%rdi), %cl
testb %cl, %cl
je 0x4acf
incq %rdi
xorl %eax, %eax
movl %ecx, %edx
andb $-0x8, %dl
cmpb $0x30, %dl
jne 0x4acf
movzbl %cl, %ecx
leal (%rcx,%rax,8), %eax
addl $-0x30, %eax
movb (%rdi), %cl
incq %rdi
testb %cl, %cl
jne 0x4ab2
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/parseconf.c
// Function: parseconf_load_file
int parseconf_load_file(const char* file)
{
    FILE* pfile = fopen(file,"r");
    if (NULL == pfile)
    {
        fprintf(stderr, "config file open error\n");
        return -1;
    }

    char line[1024];
    while (NULL != fgets(line,1024,pfile))
    {
        if (-1 == parseconf_load_setting(line)) 
        {
            fprintf(stderr, "config file parse error");
        }
    }
    fclose(pfile);
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
leaq 0x35c8(%rip), %rsi      # 0x80c1
callq 0x3450
testq %rax, %rax
je 0x4b5e
movq %rax, %rbx
movq %rsp, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rax, %rdx
callq 0x32a0
testq %rax, %rax
je 0x4b49
movq %rsp, %r14
movq %r14, %rdi
callq 0x4b6a
cmpl $-0x1, %eax
je 0x4b42
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdx
callq 0x32a0
testq %rax, %rax
jne 0x4b1e
jmp 0x4b49
callq 0x374e
jmp 0x4b2b
movq %rbx, %rdi
callq 0x3130
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
callq 0x3770
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4b53
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/ftpproto.c
// Function: ftp_reply
int ftp_reply(session_t* ssinf,int status,const char* text)
{
    char buf[1024] = {0};
    sprintf(buf,"%d %s\r\n",status,text);
    if ( -1 == writen(ssinf->ctrlfd,buf,strlen(buf)))
        ERR_EXIT("written error");
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq %rsp, %r15
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
xorl %esi, %esi
callq 0x3220
leaq 0x351a(%rip), %rsi      # 0x8294
movq %r15, %rdi
movl %ebp, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x34c0
movl 0x8(%r14), %ebx
movq %r15, %rdi
callq 0x3180
movl %ebx, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x4465
cmpq $-0x1, %rax
je 0x4db8
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x378c
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/ftpproto.c
// Function: get_tcpsocket
int get_tcpsocket(session_t* sess,const char* ip,int nport)
{
    ftpipc_send_cmd(sess->protofd,FTPIPC_GET_DATA_FD);
    
    ftpipc_send_data(sess->protofd,ip,strlen(ip));
    ftpipc_send_data(sess->protofd,&nport,sizeof(int));

    ftpipc_send_data(sess->protofd,sess->port_addr,sizeof(struct sockaddr_in));

    int ret = ftpipc_recv_ret(sess->protofd);
    if ( FTPIPC_RET_OK == ret )
    {
        return ftpipc_recv_fd(sess->protofd);
    }
    else
        return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4(%rsp), %r15
movl %edx, (%r15)
movl 0x4(%rdi), %edi
movl $0x1, %esi
callq 0x6a86
movl 0x4(%rbx), %ebp
movq %r14, %rdi
callq 0x3180
movl %ebp, %edi
movq %r14, %rsi
movl %eax, %edx
callq 0x6aff
movl 0x4(%rbx), %edi
movq %r15, %rsi
movl $0x4, %edx
callq 0x6aff
movl 0x4(%rbx), %edi
movq 0xc18(%rbx), %rsi
movl $0x10, %edx
callq 0x6aff
movl 0x4(%rbx), %edi
callq 0x6adb
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x1, %ecx
jne 0x4ea7
movl 0x4(%rbx), %edi
callq 0x6bf7
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/ftpproto.c
// Function: getfileper
void getfileper(struct stat* fbuf,char* per)
{
    switch ( fbuf->st_mode & S_IFMT )
    {
    case S_IFSOCK:
        per[0] = 's';
        break;     
    case S_IFLNK:
        per[0] = 'l';
        break;     
    case S_IFREG:
        per[0] = '-';
        break;     
    case S_IFBLK:
        per[0] = 'b';
        break;     
    case S_IFDIR:
        per[0] = 'd';
        break;     
    case S_IFCHR:
        per[0] = 'c';
        break;     
    case S_IFIFO:
        per[0] = 'p';
        break;     
    }
    
    if ( fbuf->st_mode & S_IRUSR )
        per[1] = 'r';
    if ( fbuf->st_mode & S_IRUSR )
        per[2] = 'w';
    if ( fbuf->st_mode & S_IXUSR )
        per[3] = 'x';
    if ( fbuf->st_mode & S_IRGRP )
        per[4] = 'r';
    if ( fbuf->st_mode & S_IRGRP )
        per[5] = 'w';
    if ( fbuf->st_mode & S_IXGRP )
        per[6] = 'x';
    if ( fbuf->st_mode & S_IROTH )
        per[7] = 'r';
    if ( fbuf->st_mode & S_IROTH )
        per[8] = 'w';
    if ( fbuf->st_mode & S_IXOTH )
        per[9] = 'x';

    if ( fbuf->st_mode & S_ISUID)
        per[3] = (per[3] == 'x') ? 's' : 'S';
    if ( fbuf->st_mode & S_ISGID)
        per[6] = (per[6] == 'x') ? 's' : 'S';
    if ( fbuf->st_mode & S_ISVTX)
        per[9] = (per[9] == 'x') ? 't' : 'T';
}

// Assembly:
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rdi), %eax
addl $0xfffff000, %eax       # imm = 0xFFFFF000
cmpl $0xbfff, %eax           # imm = 0xBFFF
ja 0x4edf
shrl $0xc, %eax
movl $0xaab, %ecx            # imm = 0xAAB
btl %eax, %ecx
jae 0x4edf
leaq 0x3c2f(%rip), %rcx      # 0x8b09
movb (%rax,%rcx), %al
movb %al, (%rsi)
testb $0x1, 0x19(%rdi)
je 0x4ee9
movb $0x72, 0x1(%rsi)
testb $0x1, 0x19(%rdi)
je 0x4ef3
movb $0x77, 0x2(%rsi)
testb $0x40, 0x18(%rdi)
je 0x4efd
movb $0x78, 0x3(%rsi)
testb $0x20, 0x18(%rdi)
je 0x4f07
movb $0x72, 0x4(%rsi)
testb $0x20, 0x18(%rdi)
je 0x4f11
movb $0x77, 0x5(%rsi)
testb $0x8, 0x18(%rdi)
je 0x4f1b
movb $0x78, 0x6(%rsi)
testb $0x4, 0x18(%rdi)
je 0x4f25
movb $0x72, 0x7(%rsi)
testb $0x4, 0x18(%rdi)
je 0x4f2f
movb $0x77, 0x8(%rsi)
testb $0x1, 0x18(%rdi)
je 0x4f39
movb $0x78, 0x9(%rsi)
testb $0x8, 0x19(%rdi)
je 0x4f4e
cmpb $0x78, 0x3(%rsi)
sete %al
shlb $0x5, %al
orb $0x53, %al
movb %al, 0x3(%rsi)
testb $0x4, 0x19(%rdi)
je 0x4f63
cmpb $0x78, 0x6(%rsi)
sete %al
shlb $0x5, %al
orb $0x53, %al
movb %al, 0x6(%rsi)
testb $0x2, 0x19(%rdi)
je 0x4f78
cmpb $0x78, 0x9(%rsi)
sete %al
shlb $0x5, %al
orb $0x54, %al
movb %al, 0x9(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/ftpproto.c
// Function: cmd_disconn_start
int cmd_disconn_start()
{
    signal(SIGALRM,signal_cmdalarm);
    if ( 0 != tunable_idle_session_timeout) 
    {
        alarm(tunable_idle_session_timeout);
        //printf("alarm time:%u\n",tunable_idle_session_timeout);
    }
    return 0;
}

// Assembly:
pushq %rax
leaq 0x20(%rip), %rsi        # 0x526b
movl $0xe, %edi
callq 0x32e0
leaq 0x707c(%rip), %rax      # 0xc2d8
movl (%rax), %edi
testl %edi, %edi
je 0x5267
callq 0x3250
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/ftpproto.c
// Function: signal_cmdalarm
void signal_cmdalarm(int sigal)
{
    shutdown(pssinf->ctrlfd,SHUT_RD);
    ftp_reply(pssinf,FTP_IDLE_TIMEOUT,"Time out");
    shutdown(pssinf->ctrlfd,SHUT_WR);
    exit(EXIT_SUCCESS);
}

// Assembly:
pushq %rax
movq 0x70a5(%rip), %rax      # 0xc318
movl 0x8(%rax), %edi
xorl %esi, %esi
callq 0x3150
movq 0x7094(%rip), %rdi      # 0xc318
leaq 0x3063(%rip), %rdx      # 0x82ee
movl $0x1a5, %esi            # imm = 0x1A5
callq 0x4d4c
movq 0x707c(%rip), %rax      # 0xc318
movl 0x8(%rax), %edi
movl $0x1, %esi
callq 0x3150
xorl %edi, %edi
callq 0x34d0
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/ftpproto.c
// Function: data_disconn_start
int data_disconn_start()
{
    b_dataconn = 0;
    signal(SIGALRM,signal_dataalarm);
    if ( 0 != tunable_data_connection_timeout) 
    {
        alarm(tunable_data_connection_timeout);
    }
    return 0;
}

// Assembly:
pushq %rax
movl $0x0, 0x7055(%rip)      # 0xc310
leaq 0x20(%rip), %rsi        # 0x52e2
movl $0xe, %edi
callq 0x32e0
leaq 0x7009(%rip), %rax      # 0xc2dc
movl (%rax), %edi
testl %edi, %edi
je 0x52de
callq 0x3250
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/ftpproto.c
// Function: handle_sigurg
void handle_sigurg(int signal)
{        
    memset(pssinf->cmdline,0,sizeof(char) * MAXCMDLINE);
    memset(pssinf->cmd,0,sizeof(char) * MAXCMDLINE);
    memset(pssinf->arg,0,sizeof(char) * MAXCMDLINE);
    
    int ret = readline(pssinf->ctrlfd,pssinf->cmdline,MAXCMDLINE);
    if (-1 == ret )
        ERR_EXIT("read error");
    if (0 == ret)
        exit(EXIT_SUCCESS);

    str_trim_crlf(pssinf->cmdline);
    str_split(pssinf->cmdline,pssinf->cmd,pssinf->arg,' ');
    str_upper(pssinf->cmd);
    printf("[%s]\t[%s]\n",pssinf->cmd,pssinf->arg);

    if ( 0 == strcmp("ABOR",pssinf->cmd) || 0 == strcmp(pssinf->cmd,"\377\364\377\362ABOR"))
    {
        clear_transfer(pssinf);
        pssinf->burg = 1;        
    }
    else 
    {
        ftp_reply(pssinf,FTP_BADCMD,"Unkown command");
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x6ffe(%rip), %r14      # 0xc318
leaq 0x18(%r14), %rbx
movl $0xc00, %edx            # imm = 0xC00
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3220
movl 0x8(%r14), %edi
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rsi
callq 0x4528
testl %eax, %eax
je 0x541d
cmpl $-0x1, %eax
je 0x5424
movq 0x6fc2(%rip), %rdi      # 0xc318
addq $0x18, %rdi
callq 0x49cc
movq 0x6fb2(%rip), %rdx      # 0xc318
leaq 0x18(%rdx), %rdi
movl $0x418, %ebx            # imm = 0x418
leaq (%rdx,%rbx), %rsi
movl $0x818, %r14d           # imm = 0x818
addq %r14, %rdx
movl $0x20, %ecx
callq 0x49f2
movq 0x6f8b(%rip), %rdi      # 0xc318
addq %rbx, %rdi
callq 0x4a72
movq 0x6f7c(%rip), %rdx      # 0xc318
leaq (%rdx,%rbx), %rsi
addq %r14, %rdx
leaq 0x2f58(%rip), %rdi      # 0x8302
xorl %eax, %eax
callq 0x31c0
movq 0x6f60(%rip), %r14      # 0xc318
addq %r14, %rbx
leaq 0x2f4f(%rip), %rdi      # 0x8311
movq %rbx, %rsi
callq 0x32d0
testl %eax, %eax
je 0x53fc
leaq 0x2f38(%rip), %rsi      # 0x830d
movq %rbx, %rdi
callq 0x32d0
testl %eax, %eax
je 0x53fc
leaq 0x2f2e(%rip), %rdx      # 0x8316
movq %r14, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4d4c
movq %r14, %rdi
callq 0x47e7
movq 0x6f0d(%rip), %rax      # 0xc318
movl $0x1, 0xc40(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %edi, %edi
callq 0x34d0
callq 0x37e0
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/ftpproto.c
// Function: do_pass
static void do_pass(session_t* ssinf)
{
    struct spwd* spw = getspnam(username);
    struct passwd* pw = getpwnam(username);
    if (NULL == spw || NULL == pw) 
    {
        ftp_reply(ssinf,530,"Login incorrect");
    }

    char* encriedpw = crypt(ssinf->arg,spw->sp_pwdp);
    if ( 0 == strcmp(encriedpw,spw->sp_pwdp))
    {
        printf("login success\tusername:%s\n",username);    
        ftp_reply(ssinf,230,"Login successful");
        setegid(pw->pw_gid);
        seteuid(pw->pw_uid);
        chdir(pw->pw_dir);
    }
    else
    {
        ftp_reply(ssinf,530,"Login incorrect");
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x6c6e(%rip), %rbx      # 0xc320
movq %rbx, %rdi
callq 0x3430
movq %rax, %r15
movq %rbx, %rdi
callq 0x32f0
movq %rax, %rbx
testq %r15, %r15
setne %al
testq %rbx, %rbx
setne %cl
testb %cl, %al
jne 0x56ec
leaq 0x2d86(%rip), %rdx      # 0x8465
movq %r14, %rdi
movl $0x212, %esi            # imm = 0x212
callq 0x4d4c
leaq 0x818(%r14), %rdi
movq 0x8(%r15), %rsi
callq 0x3510
movq 0x8(%r15), %rsi
movq %rax, %rdi
callq 0x32d0
testl %eax, %eax
je 0x5725
leaq 0x2d52(%rip), %rdx      # 0x8465
movq %r14, %rdi
movl $0x212, %esi            # imm = 0x212
popq %rbx
popq %r14
popq %r15
jmp 0x4d4c
leaq 0x2d49(%rip), %rdi      # 0x8475
leaq 0x6bed(%rip), %rsi      # 0xc320
xorl %eax, %eax
callq 0x31c0
leaq 0x2d4f(%rip), %rdx      # 0x8490
movq %r14, %rdi
movl $0xe6, %esi
callq 0x4d4c
movl 0x14(%rbx), %edi
callq 0x3520
movl 0x10(%rbx), %edi
callq 0x3550
movq 0x20(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3190
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/ftpproto.c
// Function: do_port
void do_port(session_t *sess)
{
    clear_transfer(sess);

    int naddr[6];  
    sscanf(sess->arg,"%d,%d,%d,%d,%d,%d",&naddr[0],&naddr[1],&naddr[2],&naddr[3],&naddr[4],&naddr[5]);
    char ip[12] = {0};
    sprintf(ip,"%d.%d.%d.%d",naddr[0],naddr[1],naddr[2],naddr[3]);

    unsigned short nport = naddr[4];
    nport = (nport << 8) + naddr[5];


    //printf("addr:\tip:%s\tport:%d\n",ip,nport); 
    sess->port_addr = (struct sockaddr_in*)malloc(sizeof(struct sockaddr_in));

    sess->port_addr->sin_family = AF_INET;
    sess->port_addr->sin_port = htons(nport);
    sess->port_addr->sin_addr.s_addr = (inet_addr(ip));;


    ftp_reply(sess,FTP_PORTOK,"Port commande successful.");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
callq 0x47e7
leaq 0x818(%rbx), %rdi
leaq 0x4(%rsp), %rcx
leaq 0x8(%rsp), %r8
leaq 0xc(%rsp), %r9
leaq 0x10(%rsp), %r10
leaq 0x14(%rsp), %r11
leaq 0x2cae(%rip), %rsi      # 0x84ea
movq %rsp, %r14
movq %r14, %rdx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x33a0
addq $0x10, %rsp
leaq 0x18(%rsp), %r15
movl $0x0, 0x8(%r15)
movq $0x0, (%r15)
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x8(%r14), %r8d
movl 0xc(%r14), %r9d
leaq 0x2c81(%rip), %rsi      # 0x84fc
movq %r15, %rdi
xorl %eax, %eax
callq 0x34c0
movl 0x10(%r14), %ebp
shll $0x8, %ebp
addl 0x14(%r14), %ebp
movl $0x10, %edi
callq 0x3390
movq %rax, 0xc18(%rbx)
movw $0x2, (%rax)
rolw $0x8, %bp
movw %bp, 0x2(%rax)
movq %r15, %rdi
callq 0x32c0
movq 0xc18(%rbx), %rcx
movl %eax, 0x4(%rcx)
leaq 0x2c41(%rip), %rdx      # 0x8508
movq %rbx, %rdi
movl $0xc8, %esi
callq 0x4d4c
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/ftpproto.c
// Function: do_pasv
void do_pasv(session_t *sess)
{
    clear_transfer(sess);

    sess->pasv_lsfd = tcp_srv(listenip,0);
    
    struct sockaddr_in srvaddr;
    socklen_t socklen = sizeof(srvaddr);
    if ( -1 == getsockname(sess->pasv_lsfd,(struct sockaddr*)&srvaddr,&socklen))
        ERR_EXIT("getsockname error");
    

    char buf[1024];
    unsigned int port = ntohs(srvaddr.sin_port);
    unsigned int naddr[4];
    sscanf(inet_ntoa(srvaddr.sin_addr),"%u.%u.%u.%d",&naddr[0],&naddr[1],&naddr[2],
            &naddr[3]);

    sprintf(buf,"Entering Passive Mode (%u,%u,%u,%u,%u,%u).",naddr[0],naddr[1],naddr[2],naddr[3],
                port >> 8 , port & 0xFF);

    //printf("port :%u\n",port);
    
    ftp_reply(sess,FTP_PASVOK,buf);


}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x430, %rsp            # imm = 0x430
movq %rdi, %rbx
callq 0x47e7
leaq 0x69ff(%rip), %rax      # 0xc2f8
movq (%rax), %rdi
xorl %esi, %esi
callq 0x3d76
movl %eax, 0xc20(%rbx)
leaq 0x1c(%rsp), %rdx
movl $0x10, (%rdx)
leaq 0x20(%rsp), %rsi
movl %eax, %edi
callq 0x34a0
cmpl $-0x1, %eax
je 0x59b8
movzwl 0x22(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %ebp
movl 0x24(%rsp), %edi
callq 0x3120
leaq 0x4(%rsp), %rcx
leaq 0x8(%rsp), %r8
leaq 0xc(%rsp), %r9
leaq 0x2be0(%rip), %rsi      # 0x8534
movq %rsp, %r14
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x33a0
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x8(%r14), %r8d
movl 0xc(%r14), %r9d
movl %ebp, %r10d
shrl $0x8, %r10d
movzbl %bpl, %r11d
leaq 0x2bbb(%rip), %rsi      # 0x8540
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x34c0
addq $0x10, %rsp
movq %rbx, %rdi
movl $0xe3, %esi
movq %r14, %rdx
callq 0x4d4c
addq $0x430, %rsp            # imm = 0x430
popq %rbx
popq %r14
popq %rbp
retq
callq 0x37f5
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/ftpproto.c
// Function: do_type
void do_type(session_t *sess)
{
    //printf("%s\n",sess->arg);
    if ( 0 == strcmp("A",sess->arg))
    {
        //sess->bASCII = 1;
        //ftp_reply(sess,FTP_TYPEOK,"Switching to ASCII mode.");
        ftp_reply(sess,504,"ASCII mode unimplement");
    }
    else if ( 0 == strcmp("I",sess->arg))
    {
        sess->bASCII = 0;
        ftp_reply(sess,FTP_TYPEOK,"Switching to Binary mode.");
    }
    else
    {
        ftp_reply(sess,FTP_BADCMD,"Unrecognised TYPE command.");
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x818(%rdi), %r14
leaq 0x2b99(%rip), %rdi      # 0x856b
movq %r14, %rsi
callq 0x32d0
testl %eax, %eax
je 0x5a02
leaq 0x2b9f(%rip), %rdi      # 0x8584
movq %r14, %rsi
callq 0x32d0
testl %eax, %eax
je 0x5a13
leaq 0x2ba8(%rip), %rdx      # 0x85a0
movq %rbx, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
jmp 0x5a29
leaq 0x2b64(%rip), %rdx      # 0x856d
movq %rbx, %rdi
movl $0x1f8, %esi            # imm = 0x1F8
jmp 0x5a29
movl $0x0, 0x10(%rbx)
leaq 0x2b65(%rip), %rdx      # 0x8586
movq %rbx, %rdi
movl $0xc8, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4d4c
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/ftpproto.c
// Function: do_list
void do_list(session_t *sess)
{
    int data_fd = get_datafd(sess);
    if ( -1 == data_fd )
    {
        ftp_reply(sess,FTP_BADSENDCONN,"Use port or pasv first");
        return;
    }

    char buf[1024];
    getcwd(buf,1024); 
    ftp_reply(sess,FTP_DATACONN,"Here comes the dictionary listing.");
    transfer_list(data_fd,buf);
    close(data_fd);
    ftp_reply(sess,FTP_TRANSFEROK,"Directory send OK.");
    clear_transfer(sess);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rdi, %rbx
callq 0x55ed
cmpl $-0x1, %eax
je 0x5f46
movl %eax, %ebp
movq %rsp, %r14
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
callq 0x3240
leaq 0x27a1(%rip), %rdx      # 0x86a1
movq %rbx, %rdi
movl $0x96, %esi
callq 0x4d4c
movl %ebp, %edi
movq %r14, %rsi
callq 0x4f79
movl %ebp, %edi
callq 0x3260
leaq 0x279f(%rip), %rdx      # 0x86c4
movq %rbx, %rdi
movl $0xe2, %esi
callq 0x4d4c
movq %rbx, %rdi
callq 0x47e7
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x266e(%rip), %rdx      # 0x85bb
movq %rbx, %rdi
movl $0x1a9, %esi            # imm = 0x1A9
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %rbp
jmp 0x4d4c
// File: /workspace/github_c_makefile_star2_O1/icysunlight[P]miniftpd/ftpproto.c
// Function: do_mkd
void do_mkd(session_t *sess)
{
    if ( -1 == mkdir(sess->arg,0777) )
    {
        ftp_reply(sess,FTP_FILEFAIL,"Create dictionary operation filed");
    }
    else 
    {
        char buf[1024] = {0};
        sprintf(buf,"\"%s\" created.",sess->arg);
        ftp_reply(sess,FTP_MKDIROK,buf);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rdi, %rbx
leaq 0x818(%rdi), %r14
movq %r14, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0x30a0
cmpl $-0x1, %eax
je 0x6099
movq %rsp, %r15
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
xorl %esi, %esi
callq 0x3220
leaq 0x26ca(%rip), %rsi      # 0x8739
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x34c0
movq %rbx, %rdi
movl $0x101, %esi            # imm = 0x101
movq %r15, %rdx
callq 0x4d4c
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2677(%rip), %rdx      # 0x8717
movq %rbx, %rdi
movl $0x226, %esi            # imm = 0x226
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
jmp 0x4d4c