// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4220
movq %rax, %rcx
movq -0x40(%rbp), %rax
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x4290
movq -0x38(%rbp), %rax
cmpb $0x0, (%rax)
je 0x12212
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x12204
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x20, %edx
callq 0x4270
jmp 0x12212
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x121cf
leaq -0x30(%rbp), %rdi
leaq 0x3ce4(%rip), %rsi      # 0x15f01
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x1223c
leaq 0x3cc8(%rip), %rax      # 0x15efb
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3cc4(%rip), %rsi      # 0x15f0b
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x12266
leaq 0x3ca8(%rip), %rax      # 0x15f05
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3c9e(%rip), %rsi      # 0x15f0f
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x12290
leaq 0x3c8c(%rip), %rax      # 0x15f13
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3c85(%rip), %rsi      # 0x15f20
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x122ba
leaq 0x3c73(%rip), %rax      # 0x15f24
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3c70(%rip), %rsi      # 0x15f35
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x122e4
leaq 0x3c54(%rip), %rax      # 0x15f2f
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3c4f(%rip), %rsi      # 0x15f3e
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x1230e
leaq 0x3c34(%rip), %rax      # 0x15f39
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3c29(%rip), %rsi      # 0x15f42
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x12338
leaq 0x3c17(%rip), %rax      # 0x15f46
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3c1c(%rip), %rsi      # 0x15f5f
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x12362
leaq 0x3bed(%rip), %rax      # 0x15f46
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3bf6(%rip), %rsi      # 0x15f63
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x1238c
leaq 0x3be4(%rip), %rax      # 0x15f67
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3bdf(%rip), %rsi      # 0x15f76
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x123b6
leaq 0x3bc3(%rip), %rax      # 0x15f70
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3bbf(%rip), %rsi      # 0x15f80
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x123e0
leaq 0x3ba3(%rip), %rax      # 0x15f7a
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3b9f(%rip), %rsi      # 0x15f8a
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x1240a
leaq 0x3b83(%rip), %rax      # 0x15f84
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3be9(%rip), %rsi      # 0x15ffe
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x12434
leaq 0x3b63(%rip), %rax      # 0x15f8e
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3b6d(%rip), %rsi      # 0x15fac
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x1245e
leaq 0x3b5b(%rip), %rax      # 0x15fb0
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3b60(%rip), %rsi      # 0x15fc9
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x12488
leaq 0x3b4e(%rip), %rax      # 0x15fcd
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3b4d(%rip), %rsi      # 0x15fe0
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x124b2
leaq 0x3b3b(%rip), %rax      # 0x15fe4
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3b41(%rip), %rsi      # 0x15ffe
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x124dc
leaq 0x3b1d(%rip), %rax      # 0x15ff0
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3b26(%rip), %rsi      # 0x1600d
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x12503
leaq 0x3b05(%rip), %rax      # 0x16002
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3b0e(%rip), %rsi      # 0x1601c
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x1252a
leaq 0x3aed(%rip), %rax      # 0x16011
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq -0x30(%rbp), %rdi
leaq 0x3ae7(%rip), %rsi      # 0x1601c
movl $0x3, %edx
callq 0x4240
cmpl $0x0, %eax
jne 0x12551
leaq 0x3ad5(%rip), %rax      # 0x16020
movq %rax, -0x8(%rbp)
jmp 0x1255c
leaq 0x3ae1(%rip), %rax      # 0x16039
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)