// File: /workspace/github_c_makefile_star2_O3/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 0x98c5
decq %rsi
cmpl $0x2e, %eax
jne 0x98a7
leaq -0x30(%rbp), %rdi
movl $0x20, %edx
callq 0x3230
movl $0x6d62, %eax           # imm = 0x6D62
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x70, %ecx
orw %ax, %cx
je 0x9a84
movl $0x6967, %eax           # imm = 0x6967
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x66, %ecx
orw %ax, %cx
je 0x9a8d
movl $0x6369, %eax           # imm = 0x6369
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x6f, %ecx
orw %ax, %cx
je 0x9a96
movl $0x706a, %eax           # imm = 0x706A
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x67, %ecx
orw %ax, %cx
je 0x9a9f
movl $0x7661, %eax           # imm = 0x7661
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x69, %ecx
orw %ax, %cx
je 0x9aa8
movl $0x7363, %eax           # imm = 0x7363
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x73, %ecx
orw %ax, %cx
je 0x9ab1
movl $0x6c64, %ecx           # imm = 0x6C64
xorl -0x30(%rbp), %ecx
movzbl -0x2e(%rbp), %edx
xorl $0x6c, %edx
leaq 0x3585(%rip), %rax      # 0xcef0
orw %cx, %dx
je 0x9ab8
movl $0x7865, %ecx           # imm = 0x7865
xorl -0x30(%rbp), %ecx
movzbl -0x2e(%rbp), %edx
xorl $0x65, %edx
orw %cx, %dx
je 0x9ab8
movl $0x7464, %eax           # imm = 0x7464
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x64, %ecx
orw %ax, %cx
je 0x9abf
movl $0x706d, %eax           # imm = 0x706D
movl -0x30(%rbp), %ecx
xorl %eax, %ecx
movzbl -0x2e(%rbp), %edx
xorl $0x33, %edx
orw %cx, %dx
je 0x9ac8
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x67, %ecx
orw %ax, %cx
je 0x9ad1
movl $0x6e70, %eax           # imm = 0x6E70
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x67, %ecx
orw %ax, %cx
je 0x9ada
movl $0x7070, %eax           # imm = 0x7070
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x74, %ecx
orw %ax, %cx
je 0x9ae3
movl $0x6c78, %eax           # imm = 0x6C78
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x73, %ecx
orw %ax, %cx
je 0x9aec
movl $0x6f64, %eax           # imm = 0x6F64
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x63, %ecx
orw %ax, %cx
je 0x9af5
movl $0x706d, %eax           # imm = 0x706D
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x34, %ecx
orw %ax, %cx
je 0x9afe
movl $0x6d77, %eax           # imm = 0x6D77
movl -0x30(%rbp), %ecx
xorl %eax, %ecx
movzbl -0x2e(%rbp), %edx
xorl $0x61, %edx
orw %cx, %dx
je 0x9b07
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x76, %ecx
orw %ax, %cx
leaq 0x3536(%rip), %rcx      # 0xcfad
leaq 0x353e(%rip), %rax      # 0xcfbc
cmoveq %rcx, %rax
jmp 0x9ab8
leaq 0x341a(%rip), %rax      # 0xcea5
jmp 0x9ab8
leaq 0x341b(%rip), %rax      # 0xceaf
jmp 0x9ab8
leaq 0x3420(%rip), %rax      # 0xcebd
jmp 0x9ab8
leaq 0x3428(%rip), %rax      # 0xcece
jmp 0x9ab8
leaq 0x342a(%rip), %rax      # 0xced9
jmp 0x9ab8
leaq 0x342b(%rip), %rax      # 0xcee3
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
leaq 0x344b(%rip), %rax      # 0xcf11
jmp 0x9ab8
leaq 0x344b(%rip), %rax      # 0xcf1a
jmp 0x9ab8
leaq 0x344c(%rip), %rax      # 0xcf24
jmp 0x9ab8
leaq 0x344d(%rip), %rax      # 0xcf2e
jmp 0x9ab8
leaq 0x3452(%rip), %rax      # 0xcf3c
jmp 0x9ab8
leaq 0x346b(%rip), %rax      # 0xcf5e
jmp 0x9ab8
leaq 0x347f(%rip), %rax      # 0xcf7b
jmp 0x9ab8
leaq 0x348d(%rip), %rax      # 0xcf92
jmp 0x9ab8
leaq 0x3490(%rip), %rax      # 0xcf9e
jmp 0x9ab8