// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd_test.c
// Function: httpd_handler(httpChilent_t*)
void httpd_handler(struct httpChilent_t * httpChilent) 
{
    char path[512];
    do{
        if(strcasecmp(httpChilent->request.method, "GET") == 0)
        {
            if(strcmp(httpChilent->request.url,"/") == 0 || strcmp(httpChilent->request.url, "/null") == 0)
            {
                sprintf(path, "./wwwroot/index.html");
            }
            else
            {
                sprintf(path, "./wwwroot%s", httpChilent->request.url);
                if(httpChilent->request.url[strlen(httpChilent->request.url) - 1] == '/')
                {
                    strcat(path, "index.html");
                }

            }
            serve_file(httpChilent, path);
            /*
            httpChilent->resqonse.resqonseCode = HTTP_OK;
            int len  = httpChilent->resqonse.Resqonse_data_len= strlen(HTTP_MOVEPERM_CONTENT);
            sprintf(num,"%d",len);
            httpChilent->resqonse.HeadParameter->insert(HaedParameteMapPairi("Content-Type", "text/html"));
            httpChilent->resqonse.HeadParameter->insert(HaedParameteMapPairi("Content-Length",num));
            httpChilent->resqonse.resqonse_data = (char *)malloc(httpChilent->resqonse.Resqonse_data_len);
            strcpy(httpChilent->resqonse.resqonse_data, HTTP_MOVEPERM_CONTENT);
            */
        }
        else if(strcasecmp(httpChilent->request.method, "POST") == 0)
        {
             
        }
        if(httpChilent->request.HeadParameter != NULL)
        {
            HeadParameterMap::iterator v;
            v = httpChilent->request.HeadParameter->find("Connection");
            if(v != httpChilent->request.HeadParameter->end())
            {
                if(strcasecmp(v->second.c_str(), "keep-alive") == 0)
                {

                }
                else if(strcasecmp(v->second.c_str(), "close") == 0)
                {
                    break;
                }
            }
            else
            {
                break;
            }
        }
        resqonse(httpChilent);
        return;
    }while(0);
    resqonse(httpChilent);
    httpChilent_Close(httpChilent);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rdi, %rbx
movq 0x40(%rdi), %rdi
leaq 0x2d09(%rip), %rsi      # 0xca9b
callq 0x34a0
testl %eax, %eax
jne 0x9e48
movq 0x50(%rbx), %r14
cmpb $0x2f, (%r14)
jne 0x9db0
cmpb $0x0, 0x1(%r14)
je 0x9e1a
leaq 0x3234(%rip), %rsi      # 0xcfeb
movq %r14, %rdi
callq 0x35c0
testl %eax, %eax
je 0x9e1a
leaq 0x323c(%rip), %rsi      # 0xd006
leaq -0x240(%rbp), %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x30f0
movq 0x50(%rbx), %r14
movq %r14, %rdi
callq 0x31f0
cmpb $0x2f, -0x1(%r14,%rax)
jne 0x9e39
leaq -0x240(%rbp), %rdi
callq 0x31f0
movabsq $0x74682e7865646e69, %rcx # imm = 0x74682E7865646E69
movq %rcx, -0x240(%rbp,%rax)
movl $0x6c6d74, -0x239(%rbp,%rax) # imm = 0x6C6D74
jmp 0x9e39
movups 0x31d0(%rip), %xmm0     # 0xcff1
movaps %xmm0, -0x240(%rbp)
movabsq $0x6c6d74682e7865, %rax # imm = 0x6C6D74682E7865
movq %rax, -0x233(%rbp)
leaq -0x240(%rbp), %rsi
movq %rbx, %rdi
callq 0x9b63
movq 0x60(%rbx), %r14
testq %r14, %r14
je 0x9ece
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x31b1(%rip), %rsi      # 0xd012
leaq 0x31b4(%rip), %rdx      # 0xd01c
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0x8130
movq %r14, %rdi
movq %r15, %rsi
callq 0x80a6
movq %rax, %r14
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x9e97
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3460
movq 0x60(%rbx), %rax
addq $0x8, %rax
cmpq %rax, %r14
je 0x9ed8
movq 0x40(%r14), %r14
leaq 0x316e(%rip), %rsi      # 0xd01d
movq %r14, %rdi
callq 0x34a0
testl %eax, %eax
je 0x9ece
leaq 0x3166(%rip), %rsi      # 0xd028
movq %r14, %rdi
callq 0x34a0
testl %eax, %eax
je 0x9ed8
movq %rbx, %rdi
callq 0x587b
jmp 0x9ee8
movq %rbx, %rdi
callq 0x587b
movq %rbx, %rdi
callq 0x7157
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x9f10
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3460
movq %rbx, %rdi
callq 0x3740