// File: /workspace/github_c_makefile_star2_O2/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd_test.c
// Function: getFileType(char const*)
const char *getFileType(const char *filename){ //根据扩展名返回文件类型描述  
    char sExt[32];
    const char *p_start = filename + strlen(filename) - 1;
    memset(sExt, 0, sizeof(sExt));
    while (*p_start)
    {
        if (*p_start == '.')
        {
            p_start++;
            strncpy(sExt, p_start, sizeof(sExt));
            break;

        }
        p_start--;

    }

    if (strncmp(sExt, "bmp", 3) == 0)
        return "image/bmp";

    if (strncmp(sExt, "gif", 3) == 0)
        return "image/gif";

    if (strncmp(sExt, "ico", 3) == 0)
        return "image/x-icon";

    if (strncmp(sExt, "jpg", 3) == 0)
        return "image/jpeg";

    if (strncmp(sExt, "avi", 3) == 0)
        return "video/avi";

    if (strncmp(sExt, "css", 3) == 0)
        return "text/css";

    if (strncmp(sExt, "dll", 3) == 0)
        return "application/x-msdownload";

    if (strncmp(sExt, "exe", 3) == 0)
        return "application/x-msdownload";

    if (strncmp(sExt, "dtd", 3) == 0)
        return "text/xml";

    if (strncmp(sExt, "mp3", 3) == 0)
        return "audio/mp3";

    if (strncmp(sExt, "mpg", 3) == 0)
        return "video/mpg";

    if (strncmp(sExt, "png", 3) == 0)
    {
        return "image/png";
    }

    if (strncmp(sExt, "ppt", 3) == 0)
        return "application/vnd.ms-powerpoint";

    if (strncmp(sExt, "xls", 3) == 0)
        return "application/vnd.ms-excel";

    if (strncmp(sExt, "doc", 3) == 0)
        return "application/msword";

    if (strncmp(sExt, "mp4", 3) == 0)
        return "video/mpeg4";

    if (strncmp(sExt, "ppt", 3) == 0)
        return "application/x-ppt";

    if (strncmp(sExt, "wma", 3) == 0)
        return "audio/x-ms-wma";

    if (strncmp(sExt, "wmv", 3) == 0)
        return "video/x-ms-wmv";
    if(strncmp(sExt, "wmv", 3) == 0)
        return "application/x-javascript";
    return "text/html";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
callq 0x31f0
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
movaps %xmm0, -0x20(%rbp)
leaq (%rax,%rbx), %rsi
incq %rsi
movzbl -0x2(%rsi), %eax
testl %eax, %eax
je 0x923f
decq %rsi
cmpl $0x2e, %eax
jne 0x9223
leaq -0x30(%rbp), %rdi
pushq $0x20
popq %rdx
callq 0x3240
leaq 0x2c65(%rip), %rsi      # 0xbeab
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x943a
leaq 0x2c54(%rip), %rsi      # 0xbeb5
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x9443
leaq 0x2c3d(%rip), %rsi      # 0xbeb9
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x944c
leaq 0x2c33(%rip), %rsi      # 0xbeca
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x9455
leaq 0x2c2d(%rip), %rsi      # 0xbedf
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x945e
leaq 0x2c1b(%rip), %rsi      # 0xbee8
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x9467
leaq 0x2c04(%rip), %rsi      # 0xbeec
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
leaq 0x2bf5(%rip), %rbx      # 0xbef0
testl %eax, %eax
je 0x946e
leaq 0x2bff(%rip), %rsi      # 0xbf09
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x946e
leaq 0x2be8(%rip), %rsi      # 0xbf0d
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x9478
leaq 0x2be0(%rip), %rsi      # 0xbf20
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x9481
leaq 0x2bcf(%rip), %rsi      # 0xbf2a
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x948a
leaq 0x2bbe(%rip), %rsi      # 0xbf34
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x9493
leaq 0x2ba7(%rip), %rsi      # 0xbf38
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x949c
leaq 0x2bae(%rip), %rsi      # 0xbf5a
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x94a5
leaq 0x2bb0(%rip), %rsi      # 0xbf77
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x94ae
leaq 0x2bac(%rip), %rsi      # 0xbf8e
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x94b7
leaq 0x2bac(%rip), %rsi      # 0xbfa9
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
je 0x94c0
leaq 0x2ba0(%rip), %rsi      # 0xbfb8
leaq -0x30(%rbp), %rdi
pushq $0x3
popq %rdx
callq 0x3480
testl %eax, %eax
leaq 0x2b80(%rip), %rax      # 0xbfad
leaq 0x2b88(%rip), %rbx      # 0xbfbc
cmoveq %rax, %rbx
jmp 0x946e
leaq 0x2a64(%rip), %rbx      # 0xbea5
jmp 0x946e
leaq 0x2a65(%rip), %rbx      # 0xbeaf
jmp 0x946e
leaq 0x2a6a(%rip), %rbx      # 0xbebd
jmp 0x946e
leaq 0x2a72(%rip), %rbx      # 0xbece
jmp 0x946e
leaq 0x2a74(%rip), %rbx      # 0xbed9
jmp 0x946e
leaq 0x2a75(%rip), %rbx      # 0xbee3
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
leaq 0x2a92(%rip), %rbx      # 0xbf11
jmp 0x946e
leaq 0x2a92(%rip), %rbx      # 0xbf1a
jmp 0x946e
leaq 0x2a93(%rip), %rbx      # 0xbf24
jmp 0x946e
leaq 0x2a94(%rip), %rbx      # 0xbf2e
jmp 0x946e
leaq 0x2a99(%rip), %rbx      # 0xbf3c
jmp 0x946e
leaq 0x2ab2(%rip), %rbx      # 0xbf5e
jmp 0x946e
leaq 0x2ac6(%rip), %rbx      # 0xbf7b
jmp 0x946e
leaq 0x2ad4(%rip), %rbx      # 0xbf92
jmp 0x946e
leaq 0x2ad7(%rip), %rbx      # 0xbf9e
jmp 0x946e