LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: http_resqonse_free(http_resqonse_t*)
int http_resqonse_free(struct http_resqonse_t *resqonse)
{
    if(resqonse == NULL)
        return -1;
    if(resqonse->resqonse_data != NULL)
        free(resqonse->resqonse_data);
    if(resqonse->HeadParameter != NULL)
        delete resqonse->HeadParameter;
    memset(resqonse, 0, sizeof(http_resqonse_t));
    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x6303
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x3520
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x62ef
movq %r14, %rdi
callq 0x74d4
pushq $0x30
popq %rsi
movq %r14, %rdi
callq 0x3470
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: http_supervise_thread(void*)
void *http_supervise_thread(void * arg)
{
    httpServer_t *httpServer=(httpServer_t *)arg;
    pthread_mutex_lock(&httpServer->lock);
    while(!httpServer->shutdown)
    {
        pthread_mutex_unlock(&httpServer->lock);
        usleep(1000*HTTPSERVER_SUPERVISE_TIME);
        pthread_mutex_lock(&httpServer->lock);
        pthread_mutex_lock(&httpServer->clientMap_lock);
        for(BufferevMap::iterator i = httpServer->clientMap->begin();
            i != httpServer->clientMap->end();)
        {
            struct timeval date;
            gettimeofday(&date, NULL);
            pthread_mutex_lock(&i->second->lock);
            if(((i->second->stat == HTTP_CONNECTED) 
              ||(i->second->stat == HTTP_IDLE)
              ||(i->second->stat == HTTP_DISCONNECTED))
              &&(date.tv_sec - (i->second)->final_optime.tv_sec) > HTTPSERVER_IDLE_TIMEROUT)
            {
                pthread_mutex_unlock(&i->second->lock);
                httpChilent_Close_nolock((i++)->second);
            }
            else
            {
                pthread_mutex_unlock(&i->second->lock);
                i++;
            }
        }
        pthread_mutex_unlock(&httpServer->clientMap_lock);
    }
    pthread_mutex_unlock(&httpServer->lock);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x3650
leaq 0x28(%rbx), %r14
leaq 0x8(%rsp), %r15
leaq 0x9f3c(%rip), %rbp      # 0x10464
movl 0x84(%rbx), %r12d
movq %rbx, %rdi
callq 0x3320
testl %r12d, %r12d
jne 0x65e9
leaq 0x9f19(%rip), %rax      # 0x10460
imull $0x3e8, (%rax), %edi    # imm = 0x3E8
callq 0x3600
movq %rbx, %rdi
callq 0x3650
movq %r14, %rdi
callq 0x3650
movq 0x50(%rbx), %rax
movq 0x18(%rax), %r12
addq $0x8, %rax
cmpq %rax, %r12
je 0x65dc
movq %r15, %rdi
xorl %esi, %esi
callq 0x36c0
movq 0x28(%r12), %rdi
callq 0x3650
movq 0x28(%r12), %rdi
cmpl $0x2, 0x38(%rdi)
ja 0x65c6
movq 0x8(%rsp), %rax
subq 0xb8(%rdi), %rax
movslq (%rbp), %rcx
cmpq %rcx, %rax
jle 0x65c6
callq 0x3320
movq %r12, %rdi
callq 0x32d0
movq %rax, %r13
movq 0x28(%r12), %rdi
callq 0x65fa
movq %r13, %r12
jmp 0x65d6
callq 0x3320
movq %r12, %rdi
callq 0x32d0
movq %rax, %r12
movq 0x50(%rbx), %rax
jmp 0x656a
movq %r14, %rdi
callq 0x3320
jmp 0x6528
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: httpChilent_free(httpChilent_t*)
int httpChilent_free(struct httpChilent_t* client)
{
    if(client == NULL)
        return-1;
    pthread_mutex_lock(&client->lock);
    if(client->receive_evbuff != NULL)
    {
        evbuffer_lock(client->receive_evbuff);
        evbuffer_free(client->receive_evbuff);
    }
    http_request_free(&client->request);
    http_resqonse_free(&client->resqonse);
    pthread_mutex_destroy(&client->lock);
    free(client);
    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x6796
pushq %rbx
movq %rdi, %rbx
callq 0x3650
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x6770
callq 0x32e0
movq 0x98(%rbx), %rdi
callq 0x31a0
leaq 0x40(%rbx), %rdi
callq 0x5e5d
leaq 0x78(%rbx), %rdi
callq 0x62be
movq %rbx, %rdi
callq 0x3500
movq %rbx, %rdi
callq 0x3520
xorl %eax, %eax
popq %rbx
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: httpServer_setHttpHandler(httpServer_t*, void (*)(httpChilent_t*))
int httpServer_setHttpHandler(httpServer_t *httpServer, httpd_handler_t handler)
{
    if(httpServer == NULL)
        return -1;
    pthread_mutex_lock(&httpServer->lock);
    httpServer->handler = handler;
    pthread_mutex_unlock(&httpServer->lock);
    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x6a0b
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3650
movq %r14, 0x88(%rbx)
movq %rbx, %rdi
callq 0x3320
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: httpServer_setWebSocket_cb(httpServer_t*, void (*)(httpChilent_t*), void (*)(httpChilent_t*), void (*)(httpChilent_t*))
int httpServer_setWebSocket_cb(httpServer_t * httpServer, webSocket_cb_t ws_write_cb, webSocket_cb_t ws_connect_cb, webSocket_cb_t ws_disConnect_cb)
{
    if(httpServer == NULL)
        return -1;
    pthread_mutex_lock(&httpServer->lock);
    httpServer->ws_weite_cb = ws_write_cb;
    httpServer->ws_connect_cb = ws_connect_cb;
    httpServer->ws_disconnect_cb = ws_disConnect_cb;
    pthread_mutex_unlock(&httpServer->lock);
    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x6a94
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
callq 0x3650
movq %r12, 0x98(%r14)
movq %r15, 0xa0(%r14)
movq %rbx, 0xa8(%r14)
movq %r14, %rdi
callq 0x3320
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: httpServer_setWebSocket_read_cb(httpServer_t*, void (*)(httpChilent_t*), char const*)
int httpServer_setWebSocket_read_cb(httpServer_t * httpServer, webSocket_cb_t ws_read_cb,const char * url)
{
    if(httpServer == NULL)
        return -1;
    pthread_mutex_lock(&httpServer->lock);
    httpServer->webSocket_url = (char *)malloc(strlen(url)); 
    if(httpServer->webSocket_url == NULL)
    {
        return -1;
    }
    httpServer->ws_read_cb = ws_read_cb;
    strcpy(httpServer->webSocket_url, url);
    pthread_mutex_unlock(&httpServer->lock);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $-0x1
popq %rbp
testq %rdi, %rdi
je 0x6aed
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x3650
movq %r14, %rdi
callq 0x31f0
movq %rax, %rdi
callq 0x35d0
movq %rax, 0xb0(%rbx)
testq %rax, %rax
je 0x6aed
movq %r15, 0x90(%rbx)
movq %rax, %rdi
movq %r14, %rsi
callq 0x33f0
movq %rbx, %rdi
callq 0x3320
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: httpServer_free(httpServer_t*)
int httpServer_free(httpServer_t * httpServer)
{
    if(httpServer == NULL)
        return -1;
    httpServer->shutdown = true;
    if(httpServer->http_supervise_thread != 0)
        pthread_join(httpServer->http_supervise_thread, NULL);
    if(httpServer->http_listeber)
    {
        evconnlistener_free(httpServer->http_listeber);
    }
    if(httpServer->evb_thpool)
    {
        evbase_threadpool_destroy(httpServer->evb_thpool);
    }
    pthread_mutex_lock(&httpServer->clientMap_lock);
    if(httpServer->clientMap)
    {
        BufferevMap:: iterator i;
        for(i=httpServer->clientMap->begin();i != httpServer->clientMap->end(); i++)
        {
            httpChilent_free(i->second);
        }
        delete httpServer->clientMap;

    }
    pthread_mutex_destroy(&httpServer->lock);
    pthread_mutex_destroy(&httpServer->clientMap_lock);
    if(httpServer)
    {
        free(httpServer);
    }
    return 0;

}

// Assembly:
testq %rdi, %rdi
je 0x6bbf
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, 0x84(%rdi)
movq 0x78(%rdi), %rdi
testq %rdi, %rdi
je 0x6b28
xorl %esi, %esi
callq 0x33c0
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x6b36
callq 0x30e0
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x6b44
callq 0x7e8a
leaq 0x28(%rbx), %r14
movq %r14, %rdi
callq 0x3650
movq 0x50(%rbx), %r15
testq %r15, %r15
je 0x6b99
movq 0x18(%r15), %r12
leaq 0x8(%r15), %rax
cmpq %rax, %r12
je 0x6b81
movq 0x28(%r12), %rdi
callq 0x6745
movq %r12, %rdi
callq 0x32d0
movq %rax, %r12
movq 0x50(%rbx), %r15
jmp 0x6b5d
testq %r15, %r15
je 0x6b8e
movq %r15, %rdi
callq 0x754e
pushq $0x30
popq %rsi
movq %r15, %rdi
callq 0x3470
movq %rbx, %rdi
callq 0x3500
movq %r14, %rdi
callq 0x3500
movq %rbx, %rdi
callq 0x3520
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: httpServer_getArg(httpServer_t*)
void* httpServer_getArg(httpServer_t *httpServer)
{
    pthread_mutex_lock(&httpServer->lock);
    void * arg = httpServer->arg;
    pthread_mutex_unlock(&httpServer->lock);
    return arg;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3650
movq 0xb8(%rbx), %r14
movq %rbx, %rdi
callq 0x3320
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: accpt_error_cb(evconnlistener*, void*)
static void accpt_error_cb(struct evconnlistener *listener, void *ctx)
{
    struct event_base *base = evconnlistener_get_base(listener);
    int err = EVUTIL_SOCKET_ERROR();
    ctx =(void *)ctx;//(消除警告)
    fprintf(stderr, "Got an error %d (%s) the listener."
            "Shuttinf sown.\r\n",err, evutil_socket_error_to_string(err));
    event_base_loopexit(base, NULL);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
callq 0x3210
movq %rax, %rbx
callq 0x3070
movl (%rax), %ebp
movq 0x8cdd(%rip), %rax      # 0xffd8
movq (%rax), %r14
movl %ebp, %edi
callq 0x3170
leaq 0x4a07(%rip), %rsi      # 0xbd13
movq %r14, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x3610
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x3340
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: bufferev_read_cb(bufferevent*, void*)
static void bufferev_read_cb(struct bufferevent *bev,void *ctx)
{
    bev = (struct bufferevent *)bev;
    struct httpChilent_t *client = (struct httpChilent_t *)ctx;
    pthread_mutex_lock(&client->lock);
    if(client->stat == HTTP_WS_DATA )
    {
        if(client->httpServer->ws_read_cb != NULL)
            threadpool_add(client->httpServer->pool, ws_read_cb_thread, client);
        pthread_mutex_unlock(&client->lock);
    }
    else
    {
        client->stat = HTTP_REQUEST;
        if(client->httpServer->handler != NULL)
            threadpool_add(client->httpServer->pool, httpd_handler_thread, client);
        pthread_mutex_unlock(&client->lock);
    }
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x3650
cmpl $0x5, 0x38(%rbx)
jne 0x7352
movq 0x28(%rbx), %rax
cmpq $0x0, 0x90(%rax)
je 0x737a
leaq -0x1049(%rip), %rsi     # 0x6307
jmp 0x736e
movl $0x3, 0x38(%rbx)
movq 0x28(%rbx), %rax
cmpq $0x0, 0x88(%rax)
je 0x737a
leaq -0x14a5(%rip), %rsi     # 0x5ec9
movq 0x70(%rax), %rdi
movq %rbx, %rdx
callq 0x8979
movq %rbx, %rdi
popq %rbx
jmp 0x3320
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: bufferev_write_cb(bufferevent*, void*)
static void bufferev_write_cb(struct bufferevent *bev,void *ctx)
{
    bev = (struct bufferevent *)bev;
    httpChilent_t *client = (httpChilent_t *)ctx;
    pthread_mutex_lock(&client->lock);
    gettimeofday(&client->final_optime,NULL);
    if( client->stat != HTTP_WS_DATA)
        client->stat = HTTP_IDLE;
    if(client->stat == HTTP_WS_DATA)
    {
        WebddSocket_Thread_Cb_arg_t * cb_arg = (WebddSocket_Thread_Cb_arg_t *)malloc(sizeof(WebddSocket_Thread_Cb_arg_t));
        cb_arg->client = client;
        cb_arg->type = Ws_Cb_Type_write;
        threadpool_add(evbase_threadpool_get_threadpool(client->httpServer->evb_thpool), webSocke_thread_cb, cb_arg);
    }
    pthread_mutex_unlock(&client->lock);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x3650
leaq 0xb8(%rbx), %rdi
xorl %esi, %esi
callq 0x36c0
cmpl $0x5, 0x38(%rbx)
jne 0x73dc
pushq $0x10
popq %rdi
callq 0x35d0
movq %rax, %r14
movq %rbx, (%rax)
movl $0x1, 0x8(%rax)
movq 0x28(%rbx), %rax
movq 0x60(%rax), %rdi
callq 0x7c78
leaq -0x1b19(%rip), %rsi     # 0x58b6
movq %rax, %rdi
movq %r14, %rdx
callq 0x8979
jmp 0x73e3
movl $0x2, 0x38(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3320
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/evbase_threadpool.cpp
// Function: manager_thread(void*)
void *manager_thread(void *evbase_threadpool)
{
    evbase_threadpool_t *evb_thpool = (evbase_threadpool_t*)evbase_threadpool; 
    while(!evb_thpool->shutdown)
    {
        usleep(BASE_MANAGER_TIMER*1000);        
        pthread_mutex_lock(&evb_thpool->evbase_thread_list.lock);
        for(evbase_thread_vector::iterator i = evb_thpool->evbase_thread_list.list->begin();
            i != evb_thpool->evbase_thread_list.list->end(); )
        {
            pthread_mutex_lock(&(*i)->monitor_num_locl);    
            if((*i)->monitor_num == 0 && evb_thpool->evbase_thread_list.list->size() > 1){
                if(!event_base_loopbreak((*i)->base))
                {
                    event_base_dispatch((*i)->base);
                    pthread_mutex_destroy(&(*i)->monitor_num_locl);
                    evb_thpool->evbase_thread_list.list->erase(i);
                    free(*i);
                }
                else
                {
                    pthread_mutex_unlock(&(*i)->monitor_num_locl);    
                    i++;
                }
            }
            else
            {
                pthread_mutex_unlock(&(*i)->monitor_num_locl);    
                i++;
            }
        }
        pthread_mutex_unlock(&evb_thpool->evbase_thread_list.lock);
    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
leaq 0x8693(%rip), %r12      # 0x10444
cmpl $0x0, 0x40(%rbx)
jne 0x7e52
imull $0x3e8, (%r12), %edi    # imm = 0x3E8
callq 0x3600
movq %r14, %rdi
callq 0x3650
movq 0x30(%rbx), %rax
movq (%rax), %r15
cmpq 0x8(%rax), %r15
je 0x7e45
movq (%r15), %rdi
callq 0x3650
movq (%r15), %rdi
cmpl $0x0, 0x30(%rdi)
jne 0x7e0f
movq 0x30(%rbx), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq $0x9, %rcx
jb 0x7e0f
movq 0x28(%rdi), %rdi
callq 0x35c0
movq (%r15), %rdi
testl %eax, %eax
je 0x7e1e
callq 0x3320
addq $0x8, %r15
movq 0x30(%rbx), %rax
jmp 0x7dd7
movq 0x28(%rdi), %rdi
callq 0x3670
movq (%r15), %rdi
callq 0x3500
movq 0x30(%rbx), %rdi
movq %r15, %rsi
callq 0x8162
movq (%r15), %rdi
callq 0x3520
jmp 0x7e18
movq %r14, %rdi
callq 0x3320
jmp 0x7db1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/evbase_threadpool.cpp
// Function: evbase_thread(void*)
void *evbase_thread(void *arg)
{
    struct evbase_thread_arg * evb_th_arg = (struct evbase_thread_arg *)arg;    
    //evbase_threadpool_t *evb_thpool = evb_th_arg->evb_thpool;
    struct event_base *base = evb_th_arg->base;
    //回收内存
    free(arg);
    
    event_reinit(base);

    while(event_base_dispatch(base)==1);
    event_base_free(base);
    return NULL;
}

// Assembly:
pushq %rbx
movq (%rdi), %rbx
callq 0x3520
movq %rbx, %rdi
callq 0x3750
movq %rbx, %rdi
callq 0x3670
cmpl $0x1, %eax
je 0x7e71
movq %rbx, %rdi
callq 0x35e0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/evbase_threadpool.cpp
// Function: evbase_threadpool_destroy(evbase_threadpool_t*)
void evbase_threadpool_destroy(evbase_threadpool_t * evb_thpool)
{
    if(evb_thpool == NULL)
        return;
    pthread_mutex_lock(&evb_thpool->evbase_thread_list.lock);
    pthread_mutex_destroy(&evb_thpool->evbase_thread_list.lock);
    evb_thpool->shutdown = true;
    if(evb_thpool->manager != 0)
    {
        pthread_join(evb_thpool->manager, NULL);
    }
    if(evb_thpool->pool != NULL)
    {
        threadpool_destroy(evb_thpool->pool);
    }
    evbase_threadpool_free(evb_thpool);
}

// Assembly:
testq %rdi, %rdi
je 0x7edd
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x3650
movq %r14, %rdi
callq 0x3500
movl $0x1, 0x40(%rbx)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x7ec1
xorl %esi, %esi
callq 0x33c0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x7ece
callq 0x88ec
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x7ede
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/evbase_threadpool.cpp
// Function: evbase_threadpool_free(evbase_threadpool_t*)
void evbase_threadpool_free(evbase_threadpool_t * evb_thpool)
{
    if(evb_thpool == NULL)
        return;
    if(evb_thpool->evbase_thread_list.list != NULL)
    {
        for(evbase_thread_vector::iterator i = evb_thpool->evbase_thread_list.list->begin();
            i != evb_thpool->evbase_thread_list.list->end();i++ )
        {
            if((*i)->base != NULL)
                event_base_free((*i)->base);

            pthread_mutex_lock(&(*i)->monitor_num_locl);    
            pthread_mutex_destroy(&(*i)->monitor_num_locl);    
            free(*i);
        }
        delete evb_thpool->evbase_thread_list.list;
    }
    free(evb_thpool);
}

// Assembly:
testq %rdi, %rdi
je 0x7f53
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %r14
testq %r14, %r14
je 0x7f46
movq (%r14), %r15
cmpq 0x8(%r14), %r15
je 0x7f33
movq (%r15), %rdi
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x7f14
movq %rax, %rdi
callq 0x35e0
movq (%r15), %rdi
callq 0x3650
movq (%r15), %rdi
callq 0x3500
movq (%r15), %rdi
callq 0x3520
addq $0x8, %r15
movq 0x30(%rbx), %r14
jmp 0x7ef7
movq %r14, %rdi
callq 0x82f6
pushq $0x18
popq %rsi
movq %r14, %rdi
callq 0x3470
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3520
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/evbase_threadpool.cpp
// Function: evbase_threadpool_close_event(evbase_threadpool_t*, event_base*)
void evbase_threadpool_close_event(evbase_threadpool_t *evb_thpool ,event_base * base)
{

    for(evbase_thread_vector::iterator i = evb_thpool->evbase_thread_list.list->begin();
        i != evb_thpool->evbase_thread_list.list->end(); i++)
    {
        if((*i)->base == base)
        {
            if((*i)->monitor_num >0)
                (*i)->monitor_num--;
            else
                De_fprintf(stderr, "base监听数为0时发生了 coles_event\r\n");
        }
    }           

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x30(%rdi), %rax
movq (%rax), %r15
leaq 0x2104(%rip), %rbp      # 0xa1ab
leaq 0x3cd4(%rip), %r12      # 0xbd82
leaq 0x3ceb(%rip), %r13      # 0xbda0
cmpq 0x8(%rax), %r15
je 0x8134
movq (%r15), %rdi
cmpq %rbx, 0x28(%rdi)
jne 0x80d0
movl 0x30(%rdi), %esi
testl %esi, %esi
je 0x80d6
decl %esi
movl %esi, 0x30(%rdi)
addq $0x8, %r15
jmp 0x80b5
movq 0x7efb(%rip), %rax      # 0xffd8
movq (%rax), %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl $0x111, %r8d            # imm = 0x111
xorl %eax, %eax
callq 0x3610
movq 0x7edb(%rip), %rax      # 0xffd8
movq (%rax), %rcx
leaq 0x3caf(%rip), %rdi      # 0xbdb6
pushq $0x2b
popq %rsi
pushq $0x1
popq %rdx
callq 0x3800
movq 0x7ebf(%rip), %rax      # 0xffd8
movq (%rax), %rcx
leaq 0x3b81(%rip), %rdi      # 0xbca4
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
callq 0x3800
movq 0x30(%r14), %rax
jmp 0x80d0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/Threadpool.cpp
// Function: threadpool_destroy(threadpool_t*)
int threadpool_destroy(threadpool_t *pool)
{
    int i;
    if (pool == NULL) {
        return -1;

    }
    pool->shutdown = true;

    /*先销毁管理线程*/
    pthread_join(pool->adjust_tid, NULL);
    int pive_thr_num = pool->threads->size();
    for (i = 0; i < pive_thr_num; i++) {
        /*通知所有的空闲线程*/
        pthread_cond_broadcast(&(pool->queue_not_empty));

    }
    for(pthread_list_t::iterator i=pool->threads->begin(); i != pool->threads->end(); i++)
    {
        pthread_join(*(i), NULL);
    }
    threadpool_free(pool);


    return 0;

}

// Assembly:
testq %rdi, %rdi
je 0x8975
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, 0xd4(%rdi)
movq 0xb0(%rdi), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x33c0
movq 0xb8(%rbx), %rax
movl 0x10(%rax), %eax
leaq 0x80(%rbx), %r14
testl %eax, %eax
cmovgl %eax, %r15d
subl $0x1, %r15d
jb 0x893f
movq %r14, %rdi
callq 0x3180
jmp 0x892f
movq 0xb8(%rbx), %rax
movq %rax, %r14
movq (%r14), %r14
cmpq %rax, %r14
je 0x8965
movq 0x10(%r14), %rdi
xorl %esi, %esi
callq 0x33c0
movq 0xb8(%rbx), %rax
jmp 0x8949
movq %rbx, %rdi
callq 0x8a10
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/Threadpool.cpp
// Function: threadpool_add(threadpool_t*, void* (*)(void*), void*)
int threadpool_add(threadpool_t *pool, void*(*function)(void *arg), void *arg)
{
    pthread_mutex_lock(&(pool->lock));

    /* ==为真，队列已经满， 调wait阻塞 */
    while ((pool->threadpool_task_queue->max_size() == pool->threadpool_task_queue->size()) && (!pool->shutdown)) {
        pthread_cond_wait(&(pool->queue_not_full), &(pool->lock));

    }
    if (pool->shutdown) {
        pthread_mutex_unlock(&(pool->lock));

    }


    /*添加任务到任务队列里*/
    threadpool_task_t task;
    task.function = function;
    task.arg = arg;
    pool->threadpool_task_queue->push_back(task);
    /*添加完任务后，队列不为空，唤醒线程池中 等待处理任务的线程*/
    pthread_cond_signal(&(pool->queue_not_empty));
    pthread_mutex_unlock(&(pool->lock));

    return 0;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x3650
leaq 0x50(%rbx), %r12
movabsq $0x7ffffffffffffff, %r13 # imm = 0x7FFFFFFFFFFFFFF
movq 0xc0(%rbx), %rdi
callq 0x8b62
movl 0xd4(%rbx), %ecx
cmpq %r13, %rax
jne 0x89ca
testl %ecx, %ecx
jne 0x89ce
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3690
jmp 0x89a2
testl %ecx, %ecx
je 0x89d6
movq %rbx, %rdi
callq 0x3320
movq %rsp, %rsi
movq %r15, (%rsi)
movq %r14, 0x8(%rsi)
movq 0xc0(%rbx), %rdi
callq 0x8b72
leaq 0x80(%rbx), %rdi
callq 0x3040
movq %rbx, %rdi
callq 0x3320
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/Threadpool.cpp
// Function: threadpool_free(threadpool_t*)
int threadpool_free(threadpool_t *pool)
{
    if (pool == NULL) {
        return -1;

    }

    if (pool->threadpool_task_queue) {
        for(thread_pool_task_queue_t::iterator i=pool->threadpool_task_queue->begin();
            i != pool->threadpool_task_queue->end();i++)
        {
            if((*i).arg != NULL)
            {
                free((*i).arg);
            }
        }
        delete pool->threadpool_task_queue;
    }
    if (pool->threads) {
        delete pool->threads;
        pthread_mutex_lock(&(pool->lock));
        pthread_mutex_destroy(&(pool->lock));
        pthread_mutex_lock(&(pool->thread_counter));
        pthread_mutex_destroy(&(pool->thread_counter));
        pthread_cond_destroy(&(pool->queue_not_empty));
        pthread_cond_destroy(&(pool->queue_not_full));

    }
    free(pool);
    pool = NULL;

    return 0;

}

// Assembly:
testq %rdi, %rdi
je 0x8b01
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0xc0(%rdi), %r14
testq %r14, %r14
je 0x8a93
movq 0x10(%r14), %rax
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movups 0x18(%r14), %xmm0
movups %xmm0, 0x8(%r15)
movq 0x28(%r14), %rcx
movq %rcx, 0x18(%r15)
leaq 0x28(%rsp), %r12
cmpq 0x30(%r14), %rax
je 0x8a80
movq 0x8(%rax), %rdi
callq 0x3520
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x8c10
movq 0xc0(%rbx), %r14
movq 0x8(%rsp), %rax
jmp 0x8a56
movq %r14, %rdi
callq 0x91d0
pushq $0x50
popq %rsi
movq %r14, %rdi
callq 0x3470
movq 0xb8(%rbx), %r14
testq %r14, %r14
je 0x8aeb
movq %r14, %rdi
callq 0x8e3c
pushq $0x18
popq %rsi
movq %r14, %rdi
callq 0x3470
movq %rbx, %rdi
callq 0x3650
movq %rbx, %rdi
callq 0x3500
leaq 0x28(%rbx), %r14
movq %r14, %rdi
callq 0x3650
movq %r14, %rdi
callq 0x3500
leaq 0x80(%rbx), %rdi
callq 0x37f0
leaq 0x50(%rbx), %rdi
callq 0x37f0
movq %rbx, %rdi
callq 0x3520
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/Threadpool.cpp
// Function: threadpool_all_threadnum(threadpool_t*)
int threadpool_all_threadnum(threadpool_t *pool)
{
    int all_threadnum = -1;
    pthread_mutex_lock(&(pool->lock));
    all_threadnum = pool->threads->size();
    pthread_mutex_unlock(&(pool->lock));
    return all_threadnum;

}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3650
movq 0xb8(%rbx), %rax
movl 0x10(%rax), %ebp
movq %rbx, %rdi
callq 0x3320
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/Threadpool.cpp
// Function: threadpool_busy_threadnum(threadpool_t*)
int threadpool_busy_threadnum(threadpool_t *pool)
{
    int busy_threadnum = -1;
    pthread_mutex_lock(&(pool->thread_counter));
    busy_threadnum = pool->busy_thr_num;
    pthread_mutex_unlock(&(pool->thread_counter));
    return busy_threadnum;

}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
movq %r14, %rdi
callq 0x3650
movl 0xcc(%rbx), %ebx
movq %r14, %rdi
callq 0x3320
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd_test.c
// Function: getFileSize(char const*)
int getFileSize(const char * filename)
{
    int fileSize = 0;
    FILE *fp = NULL;
    if (filename == NULL)
        return 0;
    //以二进制的形式读取
    fp = fopen(filename, "rb");
    if (fp == NULL)
        return 0;
    fseek(fp, 0, SEEK_END);
    fileSize = ftell(fp);
    rewind(fp);
    fclose(fp);
    return fileSize;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x9513
leaq 0x2ae8(%rip), %rsi      # 0xbfc6
callq 0x3510
testq %rax, %rax
je 0x9513
movq %rax, %r14
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x34e0
movq %r14, %rdi
callq 0x3030
movq %rax, %rbx
movq %r14, %rdi
callq 0x30b0
movq %r14, %rdi
callq 0x3440
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd_test.c
// Function: ws_read_cb(httpChilent_t*)
void ws_read_cb(struct httpChilent_t * httpChilent)
{
    char buff[1024];
    char ip[INET_ADDRSTRLEN];
    struct sockaddr_in *address = (struct sockaddr_in *)&(httpChilent->addr);
    inet_ntop(AF_INET, &address->sin_addr,ip, INET_ADDRSTRLEN);
    evbuffer_remove(httpChilent->receive_evbuff, buff, evbuffer_get_length(httpChilent->receive_evbuff));
    printf("%s:%d ] %s\r\n",ip, ntohs(address->sin_port) ,  buff);
    ev_webSocket_send(httpChilent->bev, (unsigned char *)"hello!", (unsigned)6,false,WCT_TXTDATA);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x410, %rsp            # imm = 0x410
movq %rdi, %rbx
leaq 0xa8(%rdi), %rsi
pushq $0x2
popq %rdi
leaq -0x30(%rbp), %r14
pushq $0x10
popq %rcx
movq %r14, %rdx
callq 0x34a0
movq 0x98(%rbx), %r15
movq %r15, %rdi
callq 0x34b0
leaq -0x430(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x3560
movzwl 0xa6(%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %edx
leaq 0x278b(%rip), %rdi      # 0xc02e
movq %r14, %rsi
movq %r12, %rcx
xorl %eax, %eax
callq 0x3080
movq 0x30(%rbx), %rdi
leaq 0x2780(%rip), %rsi      # 0xc03b
pushq $0x6
popq %rdx
pushq $-0x13
popq %r8
xorl %ecx, %ecx
callq 0x4924
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd_test.c
// Function: close_signal_cb(int, short, void*)
void close_signal_cb(evutil_socket_t sig,short events, void *user_data)
{
    struct event_base *base = (struct event_base *)user_data;
    struct timeval delay = {2, 0};
    if(sig == SIGINT)
    {
        De_printf("2s后程序关闭\r\n");
        event_base_loopexit(base, &delay);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movups 0x27b7(%rip), %xmm0     # 0xc0a0
movaps %xmm0, -0x20(%rbp)
cmpl $0x2, %edi
jne 0x993a
movq %rdx, %rbx
leaq 0x8af(%rip), %rdi       # 0xa1ab
leaq 0x273f(%rip), %rsi      # 0xc042
leaq 0x2748(%rip), %rdx      # 0xc052
movl $0xef, %ecx
xorl %eax, %eax
callq 0x3080
leaq 0x2770(%rip), %rdi      # 0xc08d
callq 0x36b0
leaq 0xbb5(%rip), %rdi       # 0xa4de
callq 0x36b0
leaq -0x20(%rbp), %rsi
movq %rbx, %rdi
callq 0x3340
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd_test.c
// Function: main
int main(void)
{
    u_short port = 8088;
    struct event_base *base;
    struct event * close_signal; 
    httpServer_t * httpServer;
    base = event_base_new();
    set_SERVER_STRING(NULL);
    httpServer = startHttpServe(base ,&port);
    httpServer_setHttpHandler(httpServer, httpd_handler);
    httpServer_setWebSocket_read_cb(httpServer, ws_read_cb, "/");
    close_signal =  evsignal_new(base,SIGINT,close_signal_cb, base); 
    if(!close_signal || event_add(close_signal, NULL) < 0)
    {
        De_fprintf(stderr, "Could not create/add a signal event!\n");
        exit(1);
    }
    event_base_dispatch(base);
    httpServer_free(httpServer);

    event_base_free(base);

    return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq -0x12(%rbp), %r14
movw $0x1f98, (%r14)         # imm = 0x1F98
callq 0x3720
movq %rax, %rbx
xorl %edi, %edi
callq 0x9ad4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6c0e
movq %rax, %r14
leaq -0x2bc(%rip), %rsi      # 0x96be
movq %rax, %rdi
callq 0x69de
leaq -0x14d(%rip), %rsi      # 0x983c
leaq 0x2659(%rip), %rdx      # 0xbfe9
movq %r14, %rdi
callq 0x6a98
leaq -0xc6(%rip), %rcx       # 0x98d9
pushq $0x2
popq %rsi
pushq $0x18
popq %rdx
movq %rbx, %rdi
movq %rbx, %r8
callq 0x3390
testq %rax, %rax
je 0x99e6
movq %rax, %rdi
xorl %esi, %esi
callq 0x31e0
testl %eax, %eax
js 0x99e6
movq %rbx, %rdi
callq 0x3670
movq %r14, %rdi
callq 0x6afa
movq %rbx, %rdi
callq 0x35e0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x65eb(%rip), %r14      # 0xffd8
movq (%r14), %rdi
leaq 0x7b4(%rip), %rsi       # 0xa1ab
leaq 0x2664(%rip), %rdx      # 0xc062
leaq 0x264d(%rip), %rcx      # 0xc052
movl $0x101, %r8d            # imm = 0x101
xorl %eax, %eax
callq 0x3610
movq (%r14), %rcx
leaq 0x264b(%rip), %rdi      # 0xc067
pushq $0x25
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x3800
movq (%r14), %rcx
leaq 0x2270(%rip), %rdi      # 0xbca4
pushq $0x2
popq %rsi
movq %rbx, %rdx
callq 0x3800
pushq $0x1
popq %rdi
callq 0x3540
nop
// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/config.c
// Function: set_SERVER_STRING(char*)
void set_SERVER_STRING(char * name)
{
    if(SERVER_STRING_VARIALE == NULL)
    {
        if(name == NULL)
            SERVER_STRING_VARIALE = (char *)malloc(strlen("WebSocket-HttpServer/1.0.0"));
        else
            SERVER_STRING_VARIALE = (char *)malloc(strlen(name));

    }
    else
    {
        SERVER_STRING_VARIALE = (char *) realloc(SERVER_STRING_VARIALE, strlen(name));
    }
    if(name == NULL)
        strcpy(SERVER_STRING_VARIALE,"WebSocket-HttpServer/1.0.0");
    else
        strcpy(SERVER_STRING_VARIALE, name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x6993(%rip), %r14      # 0x10478
testq %r14, %r14
je 0x9b0b
movq %rbx, %rdi
callq 0x31f0
movq %r14, %rdi
movq %rax, %rsi
callq 0x36f0
movq %rax, 0x6974(%rip)      # 0x10478
testq %rbx, %rbx
jne 0x9b27
jmp 0x9b45
testq %rbx, %rbx
je 0x9b36
movq %rbx, %rdi
callq 0x31f0
movq %rax, %rdi
callq 0x35d0
movq %rax, 0x6951(%rip)      # 0x10478
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x33f0
pushq $0x1a
popq %rdi
callq 0x35d0
movq %rax, 0x6933(%rip)      # 0x10478
movups 0x256f(%rip), %xmm0     # 0xc0bb
movups %xmm0, 0xb(%rax)
movups 0x2559(%rip), %xmm0     # 0xc0b0
movups %xmm0, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/antonblanchard[P]will-it-scale/tests/pwrite3.c
// Function: testcase
void testcase(unsigned long long *iterations, unsigned long nr)
{
	char buf[BUFLEN];
	int fd = open(tmpfile, O_RDWR);
	unsigned long offset = getpagesize() * nr;

	assert(fd >= 0);

	while (1) {
		assert(pwrite(fd, buf, BUFLEN, offset) == BUFLEN);

		(*iterations)++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x24dc(%rip), %rdi      # 0x5180
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x2230
movl %eax, %ebp
callq 0x2280
testl %ebp, %ebp
js 0x2cfb
movslq %eax, %r15
imulq %r14, %r15
movq %rsp, %r14
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rcx
callq 0x2200
cmpq $0x1000, %rax           # imm = 0x1000
jne 0x2ce2
incq (%rbx)
jmp 0x2cc3
leaq 0x60b(%rip), %rdi       # 0x32f4
leaq 0x596(%rip), %rsi       # 0x3286
leaq 0x5ca(%rip), %rcx       # 0x32c1
pushq $0x28
jmp 0x2d12
leaq 0x57c(%rip), %rdi       # 0x327e
leaq 0x57d(%rip), %rsi       # 0x3286
leaq 0x5b1(%rip), %rcx       # 0x32c1
pushq $0x25
popq %rdx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O2/giometti[P]mastering_UNIX_programming/chapter_02/iospeed.c
// Function: main
int main(int argc, char *argv[])
{
	int n, size;
	char buf[MAX_SIZE];

	if (argc < 2) {
		err("invalid command line\n");
		return -1;
	}
	size = atoi(argv[1]);

	while ((n = read(STDIN_FILENO, buf, size)) > 0)
		if (write(STDOUT_FILENO, buf, n) != n)
			err("write error\n");
	if (n < 0)
		err("read error\n");

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x100008, %rsp         # imm = 0x100008
cmpl $0x1, %edi
jg 0x1186
leaq 0xe8b(%rip), %rdi       # 0x2004
pushq $0x16
popq %rsi
callq 0x1208
pushq $-0x1
popq %rbx
jmp 0x11f4
movq 0x8(%rsi), %rdi
callq 0x1050
movslq %eax, %rbx
movq %rsp, %r14
pushq $0x1
popq %rbp
leaq 0xe7b(%rip), %r15       # 0x201a
pushq $0xd
popq %r12
xorl %edi, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1040
movq %rax, %r13
testl %r13d, %r13d
jle 0x11de
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movl %ebp, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x1030
cmpq %r13, %rax
je 0x11a3
movq %r15, %rdi
movq %r12, %rsi
callq 0x1208
jmp 0x11a3
xorl %ebx, %ebx
testl %r13d, %r13d
jns 0x11f4
leaq 0xe3b(%rip), %rdi       # 0x2027
pushq $0xc
popq %rsi
callq 0x1208
movl %ebx, %eax
addq $0x100008, %rsp         # imm = 0x100008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/spgbld/func.cxx
// Function: parse_arg(int, char**, char const*, int)
int parse_arg(int argc, char* argv[], const char* arg, int n)
{
	for (int i=1; i<argc; i++)
		if (!wcscmp(argv[i], arg) && (argc-1) >= (i+n))
			return i + 1;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movslq %edi, %r12
movslq %ecx, %rax
movq %r12, %r13
subq %rax, %r13
pushq $0x1
popq %rbx
cmpq %r12, %rbx
jge 0x23f7
movq (%r15,%rbx,8), %rdi
movq %r14, %rsi
callq 0x21d0
testl %eax, %eax
jne 0x23f2
cmpq %r13, %rbx
jl 0x23fb
incq %rbx
jmp 0x23d8
xorl %ebx, %ebx
jmp 0x23fd
incl %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/spgbld/func.cxx
// Function: parse_args(int, char**)
void parse_args(int argc, char* argv[])
{
	int i;
	conf.packer = PM_AUTO;

	if (i = parse_arg(argc, argv, "-b", 2)) {
		conf.mode = M_BLD;
		conf.in_fname = argv[i];
		conf.out_fname = argv[i+1];

		if (i = parse_arg(argc, argv, "-c", 1))
			if( !strcmp("auto",argv[i]) ){
				conf.packer = PM_AUTO;
			}
			else if( !strcmp("none",argv[i]) ){
				conf.packer = PM_NONE;
			}
			else if( !strcmp("mlz",argv[i]) ){
				conf.packer = PM_MLZ;
			}
			else if( !strcmp("hst",argv[i]) ){
				conf.packer = PM_HST;
			}
			else {
				conf.packer = (C_PACK)_wtoi(argv[i]);
			}

		return;
	}

	if (i = parse_arg(argc, argv, "-u", 1)) {
		conf.mode = M_UNP;
		conf.in_fname = argv[i];
		return;
	}

	print_help();
	error(ARG);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x444967(%rip), %r14    # 0x446d80
orl $-0x1, (%r14)
leaq 0x1c11(%rip), %rdx      # 0x4035
pushq $0x2
popq %rcx
callq 0x23ba
testl %eax, %eax
je 0x24ca
movl $0x1, 0x4(%r14)
cltq
movq (%rbx,%rax,8), %rcx
movq %rcx, 0x8(%r14)
movq 0x8(%rbx,%rax,8), %rax
movq %rax, 0x10(%r14)
leaq 0x1be2(%rip), %rdx      # 0x4038
pushq $0x1
popq %rcx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x23ba
testl %eax, %eax
je 0x2512
cltq
movq (%rbx,%rax,8), %rbx
leaq 0x1bc3(%rip), %rdi      # 0x403b
movq %rbx, %rsi
callq 0x21d0
testl %eax, %eax
je 0x24f6
leaq 0x1bb5(%rip), %rdi      # 0x4040
movq %rbx, %rsi
callq 0x21d0
testl %eax, %eax
je 0x24fc
leaq 0x1ba7(%rip), %rdi      # 0x4045
movq %rbx, %rsi
callq 0x21d0
testl %eax, %eax
je 0x2502
leaq 0x1b98(%rip), %rdi      # 0x4049
movq %rbx, %rsi
callq 0x21d0
testl %eax, %eax
je 0x250b
movq %rbx, %rdi
callq 0x2230
movl %eax, (%r14)
jmp 0x2512
leaq 0x1b7c(%rip), %rdx      # 0x404d
pushq $0x1
popq %rcx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x23ba
testl %eax, %eax
je 0x2517
movl $0x3, 0x4(%r14)
cltq
movq (%rbx,%rax,8), %rax
movq %rax, 0x8(%r14)
jmp 0x2512
orl $-0x1, (%r14)
jmp 0x2512
andl $0x0, (%r14)
jmp 0x2512
movl $0x1, (%r14)
jmp 0x2512
movl $0x2, (%r14)
popq %rbx
popq %r14
popq %rbp
retq
callq 0x3954
leaq 0x1b2d(%rip), %rdi      # 0x4050
xorl %eax, %eax
callq 0x2030
leaq 0x1d9f(%rip), %rdi      # 0x42d0
callq 0x2210
pushq $0x1
popq %rdi
callq 0x2170
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/spgbld/func.cxx
// Function: init_hdr()
void init_hdr()
{
	memset(&hdr, 0, sizeof(hdr));
	strncpy(hdr.magic, STR(SPG_MAGIC), sizeof(hdr.magic));
	strncpy(hdr.creator, STR(SB_CRT), sizeof(hdr.creator));
	hdr.ver = SPG_VER;
	hdr.subver = SPG_SUBVER;
	hdr.sp = SPG_SP;
	hdr.page3 = SPG_PAGE3;
	hdr.clk = SPG_CLK;
	hdr.ei = SPG_INT;
	hdr.pager = SPG_PGR;
	hdr.resid = SPG_RES;
	time_t t1 = time(NULL);
	tm* t2 = localtime(&t1);
	hdr.day = t2->tm_mday;
	hdr.month = t2->tm_mon + 1;
	hdr.year = t2->tm_year - 100;
	hdr.second = t2->tm_sec;
	hdr.minute = t2->tm_min;
	hdr.hour = t2->tm_hour;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x3c36(%rip), %rbx      # 0x6180
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2090
movabsq $0x6d75727463657053, %rax # imm = 0x6D75727463657053
movq %rax, 0x20(%rbx)
movl $0x676f7250, 0x28(%rbx) # imm = 0x676F7250
movups 0x1a9f(%rip), %xmm0     # 0x4014
movups %xmm0, 0x50(%rbx)
movups 0x1aa4(%rip), %xmm0     # 0x4024
movups %xmm0, 0x60(%rbx)
movb $0x10, 0x2c(%rbx)
movw $0x5c00, 0x32(%rbx)     # imm = 0x5C00
movb $0x0, 0x35(%rbx)
movw $0x5b00, 0x38(%rbx)     # imm = 0x5B00
xorl %edi, %edi
callq 0x20f0
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
callq 0x20b0
movb 0xc(%rax), %cl
movb %cl, 0x2d(%rbx)
movb 0x10(%rax), %cl
incb %cl
movb %cl, 0x2e(%rbx)
movb 0x14(%rax), %cl
addb $-0x64, %cl
movb %cl, 0x2f(%rbx)
movb (%rax), %cl
movb %cl, 0x3c(%rbx)
movb 0x4(%rax), %cl
movb %cl, 0x3d(%rbx)
movb 0x8(%rax), %al
movb %al, 0x3e(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/spgbld/func.cxx
// Function: num(char*)
u32 num(char *ns)
{
	int n;

	if ((ns[0] == '0') && ns[1] == 'x') {
		sscanf(ns, "%x", &n);
		return n;
	}

	if ((ns[0] == '#') || (ns[0] == '$')) {
		sscanf(ns + 1, "%x", &n);
		return n;

	} else {
		sscanf(ns, "%d", &n);
		return n;
	}
}

// Assembly:
pushq %rax
movb (%rdi), %al
cmpb $0x30, %al
jne 0x25e9
cmpb $0x78, 0x1(%rdi)
je 0x25f2
jmp 0x25fb
addb $-0x23, %al
cmpb $0x1, %al
ja 0x25fb
incq %rdi
leaq 0x1a74(%rip), %rsi      # 0x406d
jmp 0x2602
leaq 0x1a6e(%rip), %rsi      # 0x4070
leaq 0x4(%rsp), %rdx
xorl %eax, %eax
callq 0x2110
movslq 0x4(%rsp), %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/spgbld/func.cxx
// Function: store_block(int, char*, int)
void store_block(int i, char* fn, int s)
{
	memset(blk[i].data, 0, sizeof(blk[i].data));
	blk[i].size = s;
	hdr.blk[i].size = sz(blk[i].size);
	FILE* f = fopen(fn, "r");
	fread(blk[i].data, 1, s, f);
	fclose(f);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movslq %edi, %r12
imulq $0x4408, %r12, %rax     # imm = 0x4408
leaq 0x38be(%rip), %rcx      # 0x6580
leaq (%rcx,%rax), %r14
addq $0x408, %r14            # imm = 0x408
movl $0x4000, %edx           # imm = 0x4000
movq %r14, %rdi
xorl %esi, %esi
callq 0x2090
movl %ebx, -0x4(%r14)
leal -0x1(%rbx), %eax
leaq (%r12,%r12,2), %rcx
leaq 0x3492(%rip), %rdx      # 0x6180
movzwl 0x100(%rdx,%rcx), %esi
shrl %eax
andl $0x1f00, %eax           # imm = 0x1F00
andl $0xffffe0ff, %esi       # imm = 0xFFFFE0FF
orl %eax, %esi
movw %si, 0x100(%rdx,%rcx)
leaq 0x13d3(%rip), %rsi      # 0x40e7
movq %r15, %rdi
callq 0x2150
movq %rax, %r15
movslq %ebx, %rdx
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %rax, %rcx
callq 0x2200
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2120
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/spgbld/func.cxx
// Function: save_spg(char*)
void save_spg(char* name)
{
	FILE* f = fopen(name, "w+");
	// save header
	fwrite(&hdr, 1, sizeof(hdr), f);

	// save blocks
	for (int i = 0; i < conf.n_blocks; i++) {
		fwrite(&blk[i].data, 1, (hdr.blk[i].size + 1) << 9, f);
	}

	fclose(f);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x112b(%rip), %rsi      # 0x423b
callq 0x2150
movq %rax, %rbx
leaq 0x3061(%rip), %r14      # 0x6180
pushq $0x1
popq %r15
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rcx
callq 0x2290
addq $0x100, %r14            # imm = 0x100
movl $0x408, %r12d           # imm = 0x408
addq 0x2e96(%rip), %r12      # 0x5fe0
xorl %r13d, %r13d
leaq 0x443c2c(%rip), %rbp    # 0x446d80
movslq 0x18(%rbp), %rax
cmpq %rax, %r13
jge 0x318c
movzwl (%r14), %eax
andl $0x1f00, %eax           # imm = 0x1F00
leaq 0x200(,%rax,2), %rdx
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x2290
incq %r13
addq $0x3, %r14
addq $0x4408, %r12           # imm = 0x4408
jmp 0x3154
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2120
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/spgbld/func.cxx
// Function: load_files()
void load_files()
{
	for (int i = 0; i < conf.n_blocks; i++) {
		FILE* f = fopen(blk[i].fname, "r");

		if (!f) error(FNFD);

		hdr.blk[i].size = sz(blk[i].size);
		fseek(f, blk[i].offset, SEEK_SET);
		fread(blk[i].data, 1, blk[i].size, f);
		fclose(f);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x100, %r13d           # imm = 0x100
addq 0x2e16(%rip), %r13      # 0x5fd0
movl $0x408, %ebx            # imm = 0x408
addq 0x2e1a(%rip), %rbx      # 0x5fe0
xorl %ebp, %ebp
leaq 0x443bb1(%rip), %r14    # 0x446d80
pushq $0x1
popq %r15
movslq 0x18(%r14), %rax
cmpq %rax, %rbp
jge 0x324d
leaq -0x408(%rbx), %rdi
leaq 0xefd(%rip), %rsi       # 0x40e7
callq 0x2150
testq %rax, %rax
je 0x325c
movq %rax, %r12
movl -0x4(%rbx), %eax
decl %eax
movzwl (%r13), %ecx
shrl %eax
andl $0x1f00, %eax           # imm = 0x1F00
andl $0xffffe0ff, %ecx       # imm = 0xFFFFE0FF
orl %eax, %ecx
movw %cx, (%r13)
movslq -0x8(%rbx), %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0x2140
movslq -0x4(%rbx), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rcx
callq 0x2200
movq %r12, %rdi
callq 0x2120
incq %rbp
addq $0x3, %r13
addq $0x4408, %rbx           # imm = 0x4408
jmp 0x31d3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf92(%rip), %rdi       # 0x41f5
xorl %eax, %eax
callq 0x2030
leaq 0x105f(%rip), %rdi      # 0x42d0
callq 0x2210
pushq $0x5
popq %rdi
callq 0x2170
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/spgbld/main.cxx
// Function: main
int main(int argc, char* argv[])
{
	init_hdr();
	parse_args(argc, argv);

	switch (conf.mode) {
	case M_BLD:
		load_ini(conf.in_fname);
		load_files();

		if (conf.packer != PM_NONE)
			pack_blocks();

		save_spg(conf.out_fname);
		break;

	case M_UNP:
		unpack_spg(conf.in_fname);
		break;
	}

	error(OK);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
callq 0x253e
movl %ebp, %edi
movq %rbx, %rsi
callq 0x2409
movl 0x443497(%rip), %eax    # 0x446d84
cmpl $0x3, %eax
je 0x3924
cmpl $0x1, %eax
jne 0x3930
movq 0x44348a(%rip), %rdi    # 0x446d88
callq 0x2615
callq 0x31a2
cmpl $0x0, 0x443471(%rip)    # 0x446d80
je 0x3916
callq 0x2d43
movq 0x443473(%rip), %rdi    # 0x446d90
callq 0x30fe
jmp 0x3930
movq 0x44345d(%rip), %rdi    # 0x446d88
callq 0x327e
leaq 0xa66(%rip), %rdi       # 0x439d
xorl %eax, %eax
callq 0x2030
leaq 0x98b(%rip), %rdi       # 0x42d0
callq 0x2210
xorl %edi, %edi
callq 0x2170
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/spgbld/msg.cxx
// Function: print_help()
void print_help()
{
	printf(STR(SB_VER));
	printf("\n\n");
	printf("Build:	  spgbld -b <input.ini> <output.spg> [-c <pack method>]\n");
	printf("Unpack:	  spgbld -u <input.spg>\n");
	printf("Pack method is:	 auto/-1(default) none/0 mlz/1 hst/2\n");
	printf("\n\n");
}

// Assembly:
pushq %rbx
leaq 0xa47(%rip), %rdi       # 0x43a3
xorl %eax, %eax
callq 0x2030
leaq 0x966(%rip), %rbx       # 0x42d0
movq %rbx, %rdi
callq 0x2210
leaq 0xa49(%rip), %rdi       # 0x43c2
callq 0x2210
leaq 0xa7c(%rip), %rdi       # 0x4401
callq 0x2210
leaq 0xa90(%rip), %rdi       # 0x4421
callq 0x2210
movq %rbx, %rdi
popq %rbx
jmp 0x2210
// File: /workspace/github_c_makefile_star2_O2/tylerneylon[P]APIsWithLua/ch6/limit_memory.c
// Function: alloc
void *alloc(void *ud,
            void *ptr,
            size_t osize,
            size_t nsize) {

  // Compute the byte change requested. May be negative.
  long num_bytes_to_add = nsize - (ptr ? osize : 0);

  // Reject the change if it would exceed our limit.
  if (bytes_alloced + num_bytes_to_add > max_bytes) {
    errno = ENOMEM;
    return NULL;
  }

  // Otherwise, free or allocate memory as requested.
  bytes_alloced += num_bytes_to_add;
  if (nsize) return realloc(ptr, nsize);
  free(ptr);
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rsi, %rsi
cmoveq %rsi, %rdx
movq %rcx, %rax
subq %rdx, %rax
addq 0x29c9c(%rip), %rax     # 0x2e2c0
cmpq 0x29c6d(%rip), %rax     # 0x2e298
jle 0x463a
callq 0x40a0
movl $0xc, (%rax)
jmp 0x4657
movq %rax, 0x29c7f(%rip)     # 0x2e2c0
movq %rsi, %rdi
testq %rcx, %rcx
je 0x4652
movq %rcx, %rsi
popq %rbp
jmp 0x43b0
callq 0x4050
xorl %eax, %eax
popq %rbp
retq