// File: /workspace/github_c_makefile_star2_O0/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: accept_request(httpChilent_t*)
int accept_request(struct httpChilent_t * client)
{
    size_t numchars;
    char * buf;
    size_t i, j;
    struct evbuffer * evbuff = NULL;
    if(client == NULL)
        return REQUEST_ERROR;
    pthread_mutex_lock(&client->lock);
    gettimeofday(&client->final_optime, NULL);
    evbuff = client->receive_evbuff; 
    evbuffer_lock(client->receive_evbuff);
    buf = evbuffer_readln(evbuff, &numchars, EVBUFFER_EOL_CRLF);
    evbuffer_unlock(client->receive_evbuff);
    if(buf == NULL)
    {
        pthread_mutex_unlock(&client->lock);
        return REQUEST_NOCONTENT;
    }
    client->request.method = (char *)malloc(METHOD_MAX_LEN + 1);
    client->request.url = (char *)malloc(URL_MAX_LEN + 1);
    client->request.http_version = (char *)malloc(HTTPVERSION_MAX_LEN + 1);
    if(client->request.method == NULL || client->request.url == NULL || client->request.http_version == NULL)
    {
        pthread_mutex_unlock(&client->lock);
        return REQUEST_INTERNAL;
    }


    i = 0; j = 0;
    while (!ISspace(buf[j]) && (i < METHOD_MAX_LEN) && (j < numchars))
    {
        client->request.method[i] = buf[j];
        i++; j++;
    }
    if(j == numchars)
    {
        http_request_free(&client->request);
        pthread_mutex_unlock(&client->lock);
        return REQUEST_BADREQUEST;        
    }


    client->request.method[i] = '\0';

    if (strcasecmp(client->request.method, "GET") && strcasecmp(client->request.method, "POST"))
    {
        http_request_free(&client->request);
        pthread_mutex_unlock(&client->lock);
        return REQUEST_NOTIMPLEMENTED;
    }




    i = 0;
    while (ISspace(buf[j]) && (j < numchars) )
        j++;
    if(j == numchars)
    {
        http_request_free(&client->request);
        pthread_mutex_unlock(&client->lock);
        return REQUEST_BADREQUEST;        
    }
    while (!ISspace(buf[j]) && (i < URL_MAX_LEN) && (j < numchars))
    {
        client->request.url[i] = buf[j];
        i++; j++;
    }
    if(j == numchars)
    {
        http_request_free(&client->request);
        pthread_mutex_unlock(&client->lock);
        return REQUEST_BADREQUEST;        
    }


    client->request.url[i] = '\0';

    if (strcasecmp(client->request.method, "GET") == 0)
    {
        client->request.query_string = client->request.url;
        while ((*client->request.query_string != '?') && (*client->request.query_string != '\0'))
            client->request.query_string++;
        if (*client->request.query_string == '?')
        {
            *client->request.query_string = '\0';
            client->request.query_string++;
        }
    }
    else
    {
        if(strstr(client->request.url, "?"))
        {
            http_request_free(&client->request);
            pthread_mutex_unlock(&client->lock);
            return REQUEST_BADREQUEST;        
        }
    }



    i = 0;
    while (ISspace(buf[j]) && (j < numchars) )
        j++;
    if(j == numchars)
    {
        http_request_free(&client->request);
        pthread_mutex_unlock(&client->lock);
        return REQUEST_BADREQUEST;        
    }
    while (!ISspace(buf[j]) && (i < HTTPVERSION_MAX_LEN) && (j < numchars))
    {
        client->request.http_version[i] = buf[j];
        i++; j++;
    }
    if(strlen(client->request.http_version) < 8)
    {
        http_request_free(&client->request);
        pthread_mutex_unlock(&client->lock);
        return REQUEST_BADREQUEST;        
    }
    free(buf);
    while(1)
    {
        evbuffer_lock(client->receive_evbuff);
        buf = evbuffer_readln(evbuff, &numchars, EVBUFFER_EOL_CRLF);
        evbuffer_unlock(client->receive_evbuff);
        if(buf == NULL)
            break;
        else if(strcasecmp(client->request.method, "POST") == 0 &&  numchars == 0)
        {
            client->request.request_data_len = evbuffer_get_length(evbuff);
            client->request.request_data = (char *)malloc(client->request.request_data_len);
            if(client->request.request_data == NULL)
            {
                http_request_free(&client->request);
                pthread_mutex_unlock(&client->lock);
                return REQUEST_INTERNAL;        
            }
            evbuffer_lock(client->receive_evbuff);
            evbuffer_remove(evbuff, client->request.request_data, client->request.request_data_len);
            evbuffer_unlock(client->receive_evbuff);
            break;
        }
        else if(numchars == 0)
        {
            break;
        }
        if( client->request.HeadParameter == NULL)
            client->request.HeadParameter = new HeadParameterMap();
        char * key = buf;
        char * v = strchr(buf,':');
        if(v == NULL)
        {
            http_request_free(&client->request);
            pthread_mutex_unlock(&client->lock);
            return REQUEST_BADREQUEST;        
        }
        *v = '\0';
        v++;
        i = 0;j = 0;
        while (ISspace(*key) && (j < numchars) )
        {
            j++;
            key++;
        }
        while (!ISspace(key[i]) && (i < strlen(key)))
        {
            i++; j++;
        }
        key[i] = '\0';
        i = 0;j = 0;
        numchars = v - buf;
        while (ISspace(*v) && (j < numchars) )
        {
            j++;
            v++;
        }
        while (!ISspace(v[i]) && (i < strlen(v)))
        {
            i++; j++;
        }
        v[i] = '\0';

        client->request.HeadParameter->insert(std::pair<STRING, STRING>(key, v));    
    }

    if(strcasecmp(client->request.method, "POST") == 0 && client->request.request_data == NULL)
    {
        http_request_free(&client->request);
        pthread_mutex_unlock(&client->lock);
        return REQUEST_BADREQUEST;        
    }
    pthread_mutex_unlock(&client->lock);

    return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x7dba
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8794
movq -0x10(%rbp), %rdi
callq 0x4720
movq -0x10(%rbp), %rdi
addq $0xb8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4780
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rdi
callq 0x4350
movq -0x38(%rbp), %rdi
leaq -0x18(%rbp), %rsi
movl $0x1, %edx
callq 0x4590
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rdi
callq 0x48a0
cmpq $0x0, -0x20(%rbp)
jne 0x7e38
movq -0x10(%rbp), %rdi
callq 0x4390
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x8794
movl $0x7e, %edi
callq 0x46a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movl $0x7e, %edi
callq 0x46a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x50(%rax)
movl $0xb, %edi
callq 0x46a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x7e98
movq -0x10(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x7e98
movq -0x10(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x7ead
movq -0x10(%rbp), %rdi
callq 0x4390
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0x8794
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x40b0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xa9(%rbp)
jne 0x7efd
xorl %eax, %eax
cmpq $0x7d, -0x28(%rbp)
movb %al, -0xa9(%rbp)
jae 0x7efd
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
setb %al
movb %al, -0xa9(%rbp)
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0x7f09
jmp 0x7f3d
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x7ebd
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x7f69
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
callq 0x87b0
movq -0x10(%rbp), %rdi
callq 0x4390
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x8794
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
leaq 0xdadf(%rip), %rsi      # 0x15a67
callq 0x4580
cmpl $0x0, %eax
je 0x7fcd
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
leaq 0xdaca(%rip), %rsi      # 0x15a6b
callq 0x4580
cmpl $0x0, %eax
je 0x7fcd
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
callq 0x87b0
movq -0x10(%rbp), %rdi
callq 0x4390
movl $0xfffffffa, -0x4(%rbp) # imm = 0xFFFFFFFA
jmp 0x8794
movq $0x0, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x40b0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xaa(%rbp)
je 0x8006
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
setb %al
movb %al, -0xaa(%rbp)
movb -0xaa(%rbp), %al
testb $0x1, %al
jne 0x8012
jmp 0x8020
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x7fd5
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x804c
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
callq 0x87b0
movq -0x10(%rbp), %rdi
callq 0x4390
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x8794
jmp 0x804e
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x40b0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xab(%rbp)
jne 0x808e
xorl %eax, %eax
cmpq $0x7d, -0x28(%rbp)
movb %al, -0xab(%rbp)
jae 0x808e
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
setb %al
movb %al, -0xab(%rbp)
movb -0xab(%rbp), %al
testb $0x1, %al
jne 0x809a
jmp 0x80ce
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x804e
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x80fa
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
callq 0x87b0
movq -0x10(%rbp), %rdi
callq 0x4390
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x8794
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
leaq 0xd94e(%rip), %rsi      # 0x15a67
callq 0x4580
cmpl $0x0, %eax
jne 0x81b1
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x3f, %ecx
movb %al, -0xac(%rbp)
je 0x8166
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0xac(%rbp)
movb -0xac(%rbp), %al
testb $0x1, %al
jne 0x8172
jmp 0x8184
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x48(%rax)
jmp 0x8137
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movsbl (%rax), %eax
cmpl $0x3f, %eax
jne 0x81af
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x48(%rax)
jmp 0x81ef
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
leaq 0xd8b0(%rip), %rsi      # 0x15a70
callq 0x4120
cmpq $0x0, %rax
je 0x81ed
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
callq 0x87b0
movq -0x10(%rbp), %rdi
callq 0x4390
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x8794
jmp 0x81ef
movq $0x0, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x40b0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xad(%rbp)
je 0x8228
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
setb %al
movb %al, -0xad(%rbp)
movb -0xad(%rbp), %al
testb $0x1, %al
jne 0x8234
jmp 0x8242
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x81f7
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x826e
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
callq 0x87b0
movq -0x10(%rbp), %rdi
callq 0x4390
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x8794
jmp 0x8270
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x40b0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xae(%rbp)
jne 0x82b0
xorl %eax, %eax
cmpq $0xa, -0x28(%rbp)
movb %al, -0xae(%rbp)
jae 0x82b0
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
setb %al
movb %al, -0xae(%rbp)
movb -0xae(%rbp), %al
testb $0x1, %al
jne 0x82bc
jmp 0x82f0
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x8270
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x4220
cmpq $0x8, %rax
jae 0x8325
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
callq 0x87b0
movq -0x10(%rbp), %rdi
callq 0x4390
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x8794
movq -0x20(%rbp), %rdi
callq 0x45f0
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rdi
callq 0x4350
movq -0x38(%rbp), %rdi
leaq -0x18(%rbp), %rsi
movl $0x1, %edx
callq 0x4590
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rdi
callq 0x48a0
cmpq $0x0, -0x20(%rbp)
jne 0x8370
jmp 0x8741
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
leaq 0xd6ec(%rip), %rsi      # 0x15a6b
callq 0x4580
cmpl $0x0, %eax
jne 0x842f
cmpq $0x0, -0x18(%rbp)
jne 0x842f
movq -0x38(%rbp), %rdi
callq 0x4550
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x70(%rax)
movq -0x10(%rbp), %rax
movl 0x70(%rax), %eax
movl %eax, %edi
callq 0x46a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x68(%rax)
jne 0x83f0
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
callq 0x87b0
movq -0x10(%rbp), %rdi
callq 0x4390
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0x8794
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rdi
callq 0x4350
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x70(%rax), %eax
movl %eax, %edx
callq 0x4640
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rdi
callq 0x48a0
jmp 0x8741
cmpq $0x0, -0x18(%rbp)
jne 0x843b
jmp 0x8741
jmp 0x843d
jmp 0x843f
movq -0x10(%rbp), %rax
cmpq $0x0, 0x60(%rax)
jne 0x8485
movl $0x30, %edi
callq 0x44f0
movq %rax, %rdi
movq %rdi, -0xb8(%rbp)
xorl %esi, %esi
movl $0x30, %edx
callq 0x4290
movq -0xb8(%rbp), %rdi
callq 0xaf90
movq -0xb8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movl $0x3a, %esi
callq 0x41e0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x84c8
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
callq 0x87b0
movq -0x10(%rbp), %rdi
callq 0x4390
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x8794
movq -0x48(%rbp), %rax
movb $0x0, (%rax)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %edi
callq 0x40b0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xb9(%rbp)
je 0x8517
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
setb %al
movb %al, -0xb9(%rbp)
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x8523
jmp 0x853d
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x84eb
jmp 0x853f
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x40b0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xba(%rbp)
jne 0x8589
movq -0x28(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x40(%rbp), %rdi
callq 0x4220
movq %rax, %rcx
movq -0xc8(%rbp), %rax
cmpq %rcx, %rax
setb %al
movb %al, -0xba(%rbp)
movb -0xba(%rbp), %al
testb $0x1, %al
jne 0x8595
jmp 0x85af
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x853f
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x48(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x48(%rbp), %rax
movsbl (%rax), %edi
callq 0x40b0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xc9(%rbp)
je 0x8606
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
setb %al
movb %al, -0xc9(%rbp)
movb -0xc9(%rbp), %al
testb $0x1, %al
jne 0x8612
jmp 0x862c
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x85da
jmp 0x862e
movq -0x48(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x40b0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xca(%rbp)
jne 0x8678
movq -0x28(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x48(%rbp), %rdi
callq 0x4220
movq %rax, %rcx
movq -0xd8(%rbp), %rax
cmpq %rcx, %rax
setb %al
movb %al, -0xca(%rbp)
movb -0xca(%rbp), %al
testb $0x1, %al
jne 0x8684
jmp 0x869e
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x862e
movq -0x48(%rbp), %rax
movq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0xf8(%rbp)
leaq -0x88(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
leaq -0x40(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0xaff0
movq -0xf8(%rbp), %rdi
movq -0xf0(%rbp), %rsi
callq 0xafb0
movb %dl, -0xe1(%rbp)
movq %rax, -0xe0(%rbp)
jmp 0x86f6
movb -0xe1(%rbp), %al
movq -0xe0(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movb %al, -0xa0(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xb0d0
jmp 0x832e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xb0d0
jmp 0x87a0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
leaq 0xd31b(%rip), %rsi      # 0x15a6b
callq 0x4580
cmpl $0x0, %eax
jne 0x8784
movq -0x10(%rbp), %rax
cmpq $0x0, 0x68(%rax)
jne 0x8784
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
callq 0x87b0
movq -0x10(%rbp), %rdi
callq 0x4390
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x8794
movq -0x10(%rbp), %rdi
callq 0x4390
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x90(%rbp), %rdi
callq 0x4830
nopl (%rax)