// File: /workspace/github_c_makefile_star2_O1/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 0x9961
decq %rsi
cmpl $0x2e, %eax
jne 0x9943
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 0x9b20
movl $0x6967, %eax           # imm = 0x6967
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x66, %ecx
orw %ax, %cx
je 0x9b29
movl $0x6369, %eax           # imm = 0x6369
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x6f, %ecx
orw %ax, %cx
je 0x9b32
movl $0x706a, %eax           # imm = 0x706A
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x67, %ecx
orw %ax, %cx
je 0x9b3b
movl $0x7661, %eax           # imm = 0x7661
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x69, %ecx
orw %ax, %cx
je 0x9b44
movl $0x7363, %eax           # imm = 0x7363
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x73, %ecx
orw %ax, %cx
je 0x9b4d
movl $0x6c64, %ecx           # imm = 0x6C64
xorl -0x30(%rbp), %ecx
movzbl -0x2e(%rbp), %edx
xorl $0x6c, %edx
leaq 0x3507(%rip), %rax      # 0xcf0e
orw %cx, %dx
je 0x9b54
movl $0x7865, %ecx           # imm = 0x7865
xorl -0x30(%rbp), %ecx
movzbl -0x2e(%rbp), %edx
xorl $0x65, %edx
orw %cx, %dx
je 0x9b54
movl $0x7464, %eax           # imm = 0x7464
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x64, %ecx
orw %ax, %cx
je 0x9b5b
movl $0x706d, %eax           # imm = 0x706D
movl -0x30(%rbp), %ecx
xorl %eax, %ecx
movzbl -0x2e(%rbp), %edx
xorl $0x33, %edx
orw %cx, %dx
je 0x9b64
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x67, %ecx
orw %ax, %cx
je 0x9b6d
movl $0x6e70, %eax           # imm = 0x6E70
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x67, %ecx
orw %ax, %cx
je 0x9b76
movl $0x7070, %eax           # imm = 0x7070
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x74, %ecx
orw %ax, %cx
je 0x9b7f
movl $0x6c78, %eax           # imm = 0x6C78
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x73, %ecx
orw %ax, %cx
je 0x9b88
movl $0x6f64, %eax           # imm = 0x6F64
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x63, %ecx
orw %ax, %cx
je 0x9b91
movl $0x706d, %eax           # imm = 0x706D
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x34, %ecx
orw %ax, %cx
je 0x9b9a
movl $0x6d77, %eax           # imm = 0x6D77
movl -0x30(%rbp), %ecx
xorl %eax, %ecx
movzbl -0x2e(%rbp), %edx
xorl $0x61, %edx
orw %cx, %dx
je 0x9ba3
xorl -0x30(%rbp), %eax
movzbl -0x2e(%rbp), %ecx
xorl $0x76, %ecx
orw %ax, %cx
leaq 0x34b8(%rip), %rcx      # 0xcfcb
leaq 0x34c0(%rip), %rax      # 0xcfda
cmoveq %rcx, %rax
jmp 0x9b54
leaq 0x339c(%rip), %rax      # 0xcec3
jmp 0x9b54
leaq 0x339d(%rip), %rax      # 0xcecd
jmp 0x9b54
leaq 0x33a2(%rip), %rax      # 0xcedb
jmp 0x9b54
leaq 0x33aa(%rip), %rax      # 0xceec
jmp 0x9b54
leaq 0x33ac(%rip), %rax      # 0xcef7
jmp 0x9b54
leaq 0x33ad(%rip), %rax      # 0xcf01
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
leaq 0x33cd(%rip), %rax      # 0xcf2f
jmp 0x9b54
leaq 0x33cd(%rip), %rax      # 0xcf38
jmp 0x9b54
leaq 0x33ce(%rip), %rax      # 0xcf42
jmp 0x9b54
leaq 0x33cf(%rip), %rax      # 0xcf4c
jmp 0x9b54
leaq 0x33d4(%rip), %rax      # 0xcf5a
jmp 0x9b54
leaq 0x33ed(%rip), %rax      # 0xcf7c
jmp 0x9b54
leaq 0x3401(%rip), %rax      # 0xcf99
jmp 0x9b54
leaq 0x340f(%rip), %rax      # 0xcfb0
jmp 0x9b54
leaq 0x3412(%rip), %rax      # 0xcfbc
jmp 0x9b54