// File: /workspace/github_c_makefile_star2_O1/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 0x2c82(%rip), %rsi      # 0xca9b
callq 0x34a0
testl %eax, %eax
jne 0x9ed5
movq 0x50(%rbx), %r14
leaq 0x31d6(%rip), %rsi      # 0xd007
movq %r14, %rdi
callq 0x35c0
testl %eax, %eax
je 0x9ea7
leaq 0x31c5(%rip), %rsi      # 0xd009
movq %r14, %rdi
callq 0x35c0
testl %eax, %eax
je 0x9ea7
leaq 0x31cd(%rip), %rsi      # 0xd024
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 0x9ec6
leaq -0x240(%rbp), %rdi
callq 0x31f0
movabsq $0x74682e7865646e69, %rcx # imm = 0x74682E7865646E69
movq %rcx, -0x240(%rbp,%rax)
movl $0x6c6d74, -0x239(%rbp,%rax) # imm = 0x6C6D74
jmp 0x9ec6
movups 0x3161(%rip), %xmm0     # 0xd00f
movaps %xmm0, -0x240(%rbp)
movabsq $0x6c6d74682e7865, %rax # imm = 0x6C6D74682E7865
movq %rax, -0x233(%rbp)
leaq -0x240(%rbp), %rsi
movq %rbx, %rdi
callq 0x9bff
movq 0x60(%rbx), %r14
testq %r14, %r14
je 0x9f5b
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x3142(%rip), %rsi      # 0xd030
leaq 0x3145(%rip), %rdx      # 0xd03a
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0x819a
movq %r14, %rdi
movq %r15, %rsi
callq 0x8110
movq %rax, %r14
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x9f24
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3460
movq 0x60(%rbx), %rax
addq $0x8, %rax
cmpq %rax, %r14
je 0x9f65
movq 0x40(%r14), %r14
leaq 0x30ff(%rip), %rsi      # 0xd03b
movq %r14, %rdi
callq 0x34a0
testl %eax, %eax
je 0x9f5b
leaq 0x30f7(%rip), %rsi      # 0xd046
movq %r14, %rdi
callq 0x34a0
testl %eax, %eax
je 0x9f65
movq %rbx, %rdi
callq 0x57d7
jmp 0x9f75
movq %rbx, %rdi
callq 0x57d7
movq %rbx, %rdi
callq 0x716b
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 0x9f9d
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3460
movq %rbx, %rdi
callq 0x3740