// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/http/http_conn.cpp
// Function: http_conn::do_request()
http_conn::HTTP_CODE http_conn::do_request()
{
    strcpy(m_real_file, doc_root);
    int len = strlen(doc_root);
    //printf("m_url:%s\n", m_url);
    const char *p = strrchr(m_url, '/');

    //处理cgi
    if (cgi == 1 && (*(p + 1) == '2' || *(p + 1) == '3'))
    {

        //根据标志判断是登录检测还是注册检测
        char flag = m_url[1];

        char *m_url_real = (char *)malloc(sizeof(char) * 200);
        strcpy(m_url_real, "/");
        strcat(m_url_real, m_url + 2);
        strncpy(m_real_file + len, m_url_real, FILENAME_LEN - len - 1);
        free(m_url_real);

        //将用户名和密码提取出来
        //user=123&passwd=123
        char name[100], password[100];
        int i;
        for (i = 5; m_string[i] != '&'; ++i)
            name[i - 5] = m_string[i];
        name[i - 5] = '\0';

        int j = 0;
        for (i = i + 10; m_string[i] != '\0'; ++i, ++j)
            password[j] = m_string[i];
        password[j] = '\0';

        if (0 == m_SQLVerify)
        {
            if (*(p + 1) == '3')
            {
                //如果是注册，先检测数据库中是否有重名的
                //没有重名的，进行增加数据
                char *sql_insert = (char *)malloc(sizeof(char) * 200);
                strcpy(sql_insert, "INSERT INTO user(username, passwd) VALUES(");
                strcat(sql_insert, "'");
                strcat(sql_insert, name);
                strcat(sql_insert, "', '");
                strcat(sql_insert, password);
                strcat(sql_insert, "')");

                if (users.find(name) == users.end())
                {
                    m_lock.lock();
                    int res = mysql_query(mysql, sql_insert);
                    users.insert(pair<string, string>(name, password));
                    m_lock.unlock();

                    if (!res)
                        strcpy(m_url, "/log.html");
                    else
                        strcpy(m_url, "/registerError.html");
                }
                else
                    strcpy(m_url, "/registerError.html");
            }
            //如果是登录，直接判断
            //若浏览器端输入的用户名和密码在表中可以查找到，返回1，否则返回0
            else if (*(p + 1) == '2')
            {
                if (users.find(name) != users.end() && users[name] == password)
                    strcpy(m_url, "/welcome.html");
                else
                    strcpy(m_url, "/logError.html");
            }
        }
        else if (1 == m_SQLVerify)
        {
            //注册
            if (*(p + 1) == '3')
            {
                //如果是注册，先检测数据库中是否有重名的
                //没有重名的，进行增加数据
                char *sql_insert = (char *)malloc(sizeof(char) * 200);
                strcpy(sql_insert, "INSERT INTO user(username, passwd) VALUES(");
                strcat(sql_insert, "'");
                strcat(sql_insert, name);
                strcat(sql_insert, "', '");
                strcat(sql_insert, password);
                strcat(sql_insert, "')");

                if (users.find(name) == users.end())
                {
                    m_lock.lock();
                    int res = mysql_query(mysql, sql_insert);
                    users.insert(pair<string, string>(name, password));
                    m_lock.unlock();

                    if (!res)
                    {
                        strcpy(m_url, "/log.html");
                        m_lock.lock();
                        //每次都需要重新更新id_passwd.txt
                        ofstream out("./CGImysql/id_passwd.txt", ios::app);
                        out << name << " " << password << endl;
                        out.close();
                        m_lock.unlock();
                    }
                    else
                        strcpy(m_url, "/registerError.html");
                }
                else
                    strcpy(m_url, "/registerError.html");
            }
            //登录
            else if (*(p + 1) == '2')
            {
                pid_t pid;
                int pipefd[2];
                if (pipe(pipefd) < 0)
                {
                    LOG_ERROR("pipe() error:%d", 4);
                    return BAD_REQUEST;
                }
                if ((pid = fork()) < 0)
                {
                    LOG_ERROR("fork() error:%d", 3);
                    return BAD_REQUEST;
                }

                if (pid == 0)
                {
                    //标准输出，文件描述符是1，然后将输出重定向到管道写端
                    dup2(pipefd[1], 1);
                    //关闭管道的读端
                    close(pipefd[0]);
                    //父进程去执行cgi程序，m_real_file,name,password为输入
                    execl(m_real_file, name, password, "./CGImysql/id_passwd.txt", "1", NULL);
                }
                else
                {
                    //子进程关闭写端，打开读端，读取父进程的输出
                    close(pipefd[1]);
                    char result;
                    int ret = read(pipefd[0], &result, 1);

                    if (ret != 1)
                    {
                        LOG_ERROR("管道read error:ret=%d", ret);
                        return BAD_REQUEST;
                    }

                    LOG_INFO("%s", "登录检测");

                    //当用户名和密码正确，则显示welcome界面，否则显示错误界面
                    if (result == '1')
                        strcpy(m_url, "/welcome.html");
                    else
                        strcpy(m_url, "/logError.html");

                    //回收进程资源
                    waitpid(pid, NULL, 0);
                }
            }
        }

        //CGI多进程登录校验,不用数据库连接池
        //子进程完成注册和登录
        else
        {
            //fd[0]:读管道，fd[1]:写管道
            pid_t pid;
            int pipefd[2];
            if (pipe(pipefd) < 0)
            {
                LOG_ERROR("pipe() error:%d", 4);
                return BAD_REQUEST;
            }
            if ((pid = fork()) < 0)
            {
                LOG_ERROR("fork() error:%d", 3);
                return BAD_REQUEST;
            }

            if (pid == 0)
            {
                //标准输出，文件描述符是1，然后将输出重定向到管道写端
                dup2(pipefd[1], 1);

                //关闭管道的读端
                close(pipefd[0]);

                //父进程去执行cgi程序
                execl(m_real_file, &flag, name, password, "2", sql_user, sql_passwd, sql_name, NULL);
            }
            else
            {
                //子进程关闭写端，打开读端，读取父进程的输出
                close(pipefd[1]);
                char result;
                int ret = read(pipefd[0], &result, 1);

                if (ret != 1)
                {
                    LOG_ERROR("管道read error:ret=%d", ret);
                    return BAD_REQUEST;
                }
                if (flag == '2')
                {
                    LOG_INFO("%s", "登录检测");


                    //当用户名和密码正确，则显示welcome界面，否则显示错误界面
                    if (result == '1')
                        strcpy(m_url, "/welcome.html");
                    else
                        strcpy(m_url, "/logError.html");
                }
                else if (flag == '3')
                {
                    LOG_INFO("%s", "注册检测");

                    //当成功注册后，则显示登陆界面，否则显示错误界面
                    if (result == '1')
                        strcpy(m_url, "/log.html");
                    else
                        strcpy(m_url, "/registerError.html");
                }
                //回收进程资源
                waitpid(pid, NULL, 0);
            }
        }
    }

    if (*(p + 1) == '0')
    {
        char *m_url_real = (char *)malloc(sizeof(char) * 200);
        strcpy(m_url_real, "/register.html");
        strncpy(m_real_file + len, m_url_real, strlen(m_url_real));

        free(m_url_real);
    }
    else if (*(p + 1) == '1')
    {
        char *m_url_real = (char *)malloc(sizeof(char) * 200);
        strcpy(m_url_real, "/log.html");
        strncpy(m_real_file + len, m_url_real, strlen(m_url_real));

        free(m_url_real);
    }
    else if (*(p + 1) == '5')
    {
        char *m_url_real = (char *)malloc(sizeof(char) * 200);
        strcpy(m_url_real, "/picture.html");
        strncpy(m_real_file + len, m_url_real, strlen(m_url_real));

        free(m_url_real);
    }
    else if (*(p + 1) == '6')
    {
        char *m_url_real = (char *)malloc(sizeof(char) * 200);
        strcpy(m_url_real, "/video.html");
        strncpy(m_real_file + len, m_url_real, strlen(m_url_real));

        free(m_url_real);
    }
    else if (*(p + 1) == '7')
    {
        char *m_url_real = (char *)malloc(sizeof(char) * 200);
        strcpy(m_url_real, "/fans.html");
        strncpy(m_real_file + len, m_url_real, strlen(m_url_real));

        free(m_url_real);
    }
    else
        strncpy(m_real_file + len, m_url, FILENAME_LEN - len - 1);

    if (stat(m_real_file, &m_file_stat) < 0)
        return NO_RESOURCE;

    if (!(m_file_stat.st_mode & S_IROTH))
        return FORBIDDEN_REQUEST;

    if (S_ISDIR(m_file_stat.st_mode))
        return BAD_REQUEST;

    int fd = open(m_real_file, O_RDONLY);
    m_file_address = (char *)mmap(0, m_file_stat.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
    close(fd);
    return FILE_REQUEST;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq %rdi, %rbx
leaq 0xc40(%rdi), %r14
movq 0xdf8(%rdi), %rsi
movq %r14, %rdi
callq 0x33f0
movq 0xdf8(%rbx), %rdi
callq 0x3180
movq %rax, %r15
movq 0xd08(%rbx), %r13
movq %r13, %rdi
movl $0x2f, %esi
callq 0x3490
movq %rax, %r12
cmpl $0x1, 0xde4(%rbx)
jne 0x594e
movb 0x1(%r12), %al
andb $-0x2, %al
cmpb $0x32, %al
jne 0x594e
movb 0x1(%r13), %al
movb %al, 0xf(%rsp)
movl $0xc8, %edi
callq 0x3580
movq %rax, %rbp
movw $0x2f, (%rax)
addq $0x2, %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x36f0
movslq %r15d, %rax
leaq (%r14,%rax), %rdi
movl $0xc7, %ecx
subl %eax, %ecx
movslq %ecx, %rdx
movq %rbp, %rsi
callq 0x3220
movq %rbp, %rdi
callq 0x3500
movq 0xde8(%rbx), %rax
movb 0x5(%rax), %dl
movl $0x5, %ecx
cmpb $0x26, %dl
je 0x504b
xorl %ecx, %ecx
movb %dl, 0x30(%rsp,%rcx)
movb 0x6(%rax,%rcx), %dl
incq %rcx
cmpb $0x26, %dl
jne 0x5038
addl $0x5, %ecx
movslq %ecx, %rdx
leaq 0x30(%rsp), %rsi
movb $0x0, -0x5(%rdx,%rsi)
movb 0xa(%rax,%rdx), %dl
testb %dl, %dl
je 0x5080
movl %ecx, %ecx
addq %rax, %rcx
addq $0xb, %rcx
xorl %eax, %eax
movb %dl, 0xa0(%rsp,%rax)
movb (%rcx,%rax), %dl
incq %rax
testb %dl, %dl
jne 0x506b
movl %eax, %eax
jmp 0x5082
xorl %eax, %eax
movb $0x0, 0xa0(%rsp,%rax)
movl 0xe30(%rbx), %eax
cmpl $0x1, %eax
je 0x5242
testl %eax, %eax
jne 0x537a
movzbl 0x1(%r12), %eax
cmpl $0x32, %eax
je 0x540a
cmpl $0x33, %eax
jne 0x594e
movl $0xc8, %edi
callq 0x3580
movq %rax, %r13
movups 0x5217(%rip), %xmm0     # 0xa2e4
movups %xmm0, (%rax)
movups 0x521d(%rip), %xmm0     # 0xa2f4
movups %xmm0, 0x10(%rax)
movups 0x521d(%rip), %xmm0     # 0xa2ff
movups %xmm0, 0x1b(%rax)
movq %rax, %rdi
callq 0x3180
movw $0x27, (%r13,%rax)
leaq 0x30(%rsp), %rsi
movq %r13, %rdi
callq 0x36f0
movq %r13, %rdi
callq 0x3180
xorl %ebp, %ebp
movb %bpl, 0x4(%r13,%rax)
movl $0x27202c27, (%r13,%rax) # imm = 0x27202C27
leaq 0xa0(%rsp), %rsi
movq %r13, %rdi
callq 0x36f0
movq %r13, %rdi
callq 0x3180
movb %bpl, 0x2(%r13,%rax)
movw $0x2927, (%r13,%rax)    # imm = 0x2927
leaq 0x118(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x30(%rsp), %rdi
callq 0x3180
leaq (%rsp,%rax), %rdx
addq $0x30, %rdx
leaq 0x108(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3e80
leaq 0x9321(%rip), %rdi      # 0xe498
leaq 0x108(%rsp), %rsi
callq 0x6914
movq %rax, %rbp
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x51ac
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3430
leaq 0x92ed(%rip), %rax      # 0xe4a0
cmpq %rax, %rbp
jne 0x535d
leaq 0x92ad(%rip), %rdi      # 0xe470
callq 0x35f0
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x32e0
movl %eax, %ebp
leaq 0x108(%rsp), %r13
leaq 0x30(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
movq %r13, %rdi
callq 0x63c8
leaq 0x929e(%rip), %rdi      # 0xe498
movq %r13, %rsi
callq 0x695a
leaq 0x108(%rsp), %rdi
callq 0x6446
leaq 0x925a(%rip), %rdi      # 0xe470
callq 0x3350
movq 0xd08(%rbx), %rax
testl %ebp, %ebp
jne 0x5364
movabsq $0x6d74682e676f6c2f, %rcx # imm = 0x6D74682E676F6C2F
movq %rcx, (%rax)
movw $0x6c, 0x8(%rax)
jmp 0x594e
movzbl 0x1(%r12), %eax
cmpl $0x32, %eax
je 0x54c0
cmpl $0x33, %eax
jne 0x594e
movl $0xc8, %edi
callq 0x3580
movq %rax, %r13
movups 0x5076(%rip), %xmm0     # 0xa2e4
movups %xmm0, (%rax)
movups 0x507c(%rip), %xmm0     # 0xa2f4
movups %xmm0, 0x10(%rax)
movups 0x507c(%rip), %xmm0     # 0xa2ff
movups %xmm0, 0x1b(%rax)
movq %rax, %rdi
callq 0x3180
movw $0x27, (%r13,%rax)
leaq 0x30(%rsp), %rsi
movq %r13, %rdi
callq 0x36f0
movq %r13, %rdi
callq 0x3180
xorl %ebp, %ebp
movb %bpl, 0x4(%r13,%rax)
movl $0x27202c27, (%r13,%rax) # imm = 0x27202C27
leaq 0xa0(%rsp), %rsi
movq %r13, %rdi
callq 0x36f0
movq %r13, %rdi
callq 0x3180
movb %bpl, 0x2(%r13,%rax)
movw $0x2927, (%r13,%rax)    # imm = 0x2927
leaq 0x118(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x30(%rsp), %rdi
callq 0x3180
leaq (%rsp,%rax), %rdx
addq $0x30, %rdx
leaq 0x108(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3e80
leaq 0x9180(%rip), %rdi      # 0xe498
leaq 0x108(%rsp), %rsi
callq 0x6914
movq %rax, %rbp
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x534d
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3430
leaq 0x914c(%rip), %rax      # 0xe4a0
cmpq %rax, %rbp
je 0x561f
movq 0xd08(%rbx), %rax
movups 0x4fb6(%rip), %xmm0     # 0xa321
movups %xmm0, (%rax)
movl $0x6c6d74, 0x10(%rax)   # imm = 0x6C6D74
jmp 0x594e
leaq 0x108(%rsp), %rdi
callq 0x35a0
testl %eax, %eax
js 0x53f8
callq 0x30d0
testl %eax, %eax
js 0x5581
movl 0x10c(%rsp), %edi
je 0x5593
movl %eax, %ebp
callq 0x37b0
movl 0x108(%rsp), %edi
leaq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x35d0
movq %rax, %r13
cmpl $0x1, %r13d
jne 0x57e4
movzbl 0xf(%rsp), %eax
cmpl $0x33, %eax
je 0x58cd
cmpl $0x32, %eax
jne 0x5939
cmpl $0x0, 0xe38(%rbx)
jne 0x5552
jmp 0x5523
cmpl $0x0, 0xe38(%rbx)
jne 0x5b0a
jmp 0x5601
leaq 0x118(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x30(%rsp), %r13
movq %r13, %rdi
callq 0x3180
leaq (%rsp,%rax), %rdx
addq $0x30, %rdx
leaq 0x108(%rsp), %rdi
movq %r13, %rsi
callq 0x3e80
leaq 0x9056(%rip), %rdi      # 0xe498
leaq 0x108(%rsp), %rsi
callq 0x6914
movq %rax, %r13
leaq 0x9047(%rip), %rax      # 0xe4a0
cmpq %rax, %r13
je 0x5757
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
callq 0x3180
leaq (%rsp,%rax), %rdx
addq $0x30, %rdx
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x3e80
leaq 0x9004(%rip), %rdi      # 0xe498
leaq 0x10(%rsp), %rsi
callq 0x647c
leaq 0xa0(%rsp), %rsi
movq %rax, %rdi
callq 0x30f0
testl %eax, %eax
sete %bpl
leaq 0x8fe5(%rip), %rax      # 0xe4a0
jmp 0x5759
leaq 0x108(%rsp), %rdi
callq 0x35a0
testl %eax, %eax
js 0x55f4
callq 0x30d0
testl %eax, %eax
js 0x57f6
movl 0x10c(%rsp), %edi
je 0x5835
movl %eax, %ebp
callq 0x37b0
movl 0x108(%rsp), %edi
leaq 0x10(%rsp), %rsi
movl $0x1, %edx
callq 0x35d0
movq %rax, %r13
movl 0xe38(%rbx), %eax
cmpl $0x1, %r13d
jne 0x5878
testl %eax, %eax
jne 0x5552
callq 0x629e
leaq 0x4db2(%rip), %rdx      # 0xa2e1
leaq 0x4e54(%rip), %rcx      # 0xa38a
movq %rax, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x6df4
callq 0x629e
movq %rax, %rdi
callq 0x7216
cmpb $0x31, 0x10(%rsp)
movq 0xd08(%rbx), %rax
jne 0x58b0
movabsq $0x6c6d74682e656d, %rcx # imm = 0x6C6D74682E656D
movq %rcx, 0x6(%rax)
movabsq $0x656d6f636c65772f, %rcx # imm = 0x656D6F636C65772F
jmp 0x58c8
cmpl $0x0, 0xe38(%rbx)
jne 0x5b0a
jmp 0x5803
movl $0x1, %esi
callq 0x33e0
movl 0x108(%rsp), %edi
callq 0x37b0
leaq 0xe3c(%rbx), %r9
leaq 0xea0(%rbx), %r10
leaq 0xf04(%rbx), %r11
subq $0x8, %rsp
leaq 0x4dce(%rip), %r8       # 0xa397
leaq 0x17(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0xa8(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
pushq $0x0
pushq %r11
pushq %r10
callq 0x3540
addq $0x20, %rsp
jmp 0x594e
cmpl $0x0, 0xe38(%rbx)
jne 0x5b0a
callq 0x629e
leaq 0x4d45(%rip), %rdx      # 0xa352
movq %rax, %rdi
movl $0x3, %esi
movl $0x4, %ecx
jmp 0x581c
leaq 0x8e4a(%rip), %rdi      # 0xe470
callq 0x35f0
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x32e0
movl %eax, %ebp
leaq 0x108(%rsp), %r13
leaq 0x30(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
movq %r13, %rdi
callq 0x63c8
leaq 0x8e3b(%rip), %rdi      # 0xe498
movq %r13, %rsi
callq 0x695a
leaq 0x108(%rsp), %rdi
callq 0x6446
leaq 0x8df7(%rip), %rdi      # 0xe470
callq 0x3350
movq 0xd08(%rbx), %rax
testl %ebp, %ebp
jne 0x5364
movabsq $0x6d74682e676f6c2f, %rcx # imm = 0x6D74682E676F6C2F
movq %rcx, (%rax)
movw $0x6c, 0x8(%rax)
leaq 0x8dc9(%rip), %rdi      # 0xe470
callq 0x35f0
leaq 0x4b9a(%rip), %rsi      # 0xa24d
leaq 0x108(%rsp), %r13
movq %r13, %rdi
movl $0x1, %edx
callq 0x3460
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
callq 0x3180
movq %r13, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x34c0
leaq 0x4dfb(%rip), %rsi      # 0xa4e5
leaq 0x108(%rsp), %rdi
movl $0x1, %edx
callq 0x34c0
leaq 0xa0(%rsp), %r13
movq %r13, %rdi
callq 0x3180
leaq 0x108(%rsp), %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x34c0
leaq 0x108(%rsp), %rdi
callq 0x31d0
leaq 0x108(%rsp), %rdi
callq 0x35c0
leaq 0x8d30(%rip), %rdi      # 0xe470
callq 0x3350
leaq 0x108(%rsp), %rdi
callq 0x3600
jmp 0x594e
xorl %ebp, %ebp
cmpq %rax, %r13
je 0x5779
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5779
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3430
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x579e
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3430
movq 0xd08(%rbx), %rax
testb %bpl, %bpl
je 0x57c4
movabsq $0x6c6d74682e656d, %rcx # imm = 0x6C6D74682E656D
movq %rcx, 0x6(%rax)
movabsq $0x656d6f636c65772f, %rcx # imm = 0x656D6F636C65772F
jmp 0x57dc
movabsq $0x6c6d74682e726f, %rcx # imm = 0x6C6D74682E726F
movq %rcx, 0x7(%rax)
movabsq $0x6f727245676f6c2f, %rcx # imm = 0x6F727245676F6C2F
movq %rcx, (%rax)
jmp 0x594e
cmpl $0x0, 0xe38(%rbx)
jne 0x5944
jmp 0x5880
cmpl $0x0, 0xe38(%rbx)
jne 0x5b0a
callq 0x629e
leaq 0x4b53(%rip), %rdx      # 0xa362
movq %rax, %rdi
movl $0x3, %esi
movl $0x3, %ecx
xorl %eax, %eax
callq 0x6df4
callq 0x629e
movq %rax, %rdi
callq 0x7216
jmp 0x5b0a
movl $0x1, %esi
callq 0x33e0
movl 0x108(%rsp), %edi
callq 0x37b0
leaq 0x49fb(%rip), %rcx      # 0xa24d
leaq 0x480a(%rip), %r8       # 0xa063
leaq 0x30(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
movq %r14, %rdi
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x3540
jmp 0x594e
testl %eax, %eax
jne 0x5944
callq 0x629e
leaq 0x4ae6(%rip), %rdx      # 0xa372
movq %rax, %rdi
movl $0x3, %esi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x6df4
callq 0x629e
movq %rax, %rdi
callq 0x7216
jmp 0x5944
movabsq $0x6c6d74682e726f, %rcx # imm = 0x6C6D74682E726F
movq %rcx, 0x7(%rax)
movabsq $0x6f727245676f6c2f, %rcx # imm = 0x6F727245676F6C2F
movq %rcx, (%rax)
jmp 0x5939
cmpl $0x0, 0xe38(%rbx)
jne 0x5905
callq 0x629e
leaq 0x49ff(%rip), %rdx      # 0xa2e1
leaq 0x4ab0(%rip), %rcx      # 0xa399
movq %rax, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x6df4
callq 0x629e
movq %rax, %rdi
callq 0x7216
cmpb $0x31, 0x10(%rsp)
movq 0xd08(%rbx), %rax
jne 0x5928
movabsq $0x6d74682e676f6c2f, %rcx # imm = 0x6D74682E676F6C2F
movq %rcx, (%rax)
movw $0x6c, 0x8(%rax)
jmp 0x5939
movups 0x49f2(%rip), %xmm0     # 0xa321
movups %xmm0, (%rax)
movl $0x6c6d74, 0x10(%rax)   # imm = 0x6C6D74
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3360
cmpl $0x1, %r13d
jne 0x5b0a
movzbl 0x1(%r12), %eax
addl $-0x30, %eax
cmpl $0x7, %eax
ja 0x599b
leaq 0x4769(%rip), %rcx      # 0xa0cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xc8, %edi
callq 0x3580
movq %rax, %r12
movabsq $0x657473696765722f, %rax # imm = 0x657473696765722F
movq %rax, (%r12)
movabsq $0x6c6d74682e7265, %rax # imm = 0x6C6D74682E7265
movq %rax, 0x7(%r12)
jmp 0x5a58
movslq %r15d, %rax
leaq (%r14,%rax), %rdi
movq 0xd08(%rbx), %rsi
movl $0xc7, %ecx
subl %eax, %ecx
movslq %ecx, %rdx
callq 0x3220
jmp 0x5a7c
movl $0xc8, %edi
callq 0x3580
movq %rax, %r12
movabsq $0x657275746369702f, %rax # imm = 0x657275746369702F
movq %rax, (%r12)
movabsq $0x6c6d74682e6572, %rax # imm = 0x6C6D74682E6572
movq %rax, 0x6(%r12)
jmp 0x5a58
movl $0xc8, %edi
callq 0x3580
movq %rax, %r12
movabsq $0x6d74682e676f6c2f, %rax # imm = 0x6D74682E676F6C2F
movq %rax, (%r12)
movw $0x6c, 0x8(%r12)
jmp 0x5a58
movl $0xc8, %edi
callq 0x3580
movq %rax, %r12
movabsq $0x682e6f656469762f, %rax # imm = 0x682E6F656469762F
movq %rax, (%r12)
movl $0x6c6d74, 0x8(%r12)    # imm = 0x6C6D74
jmp 0x5a58
movl $0xc8, %edi
callq 0x3580
movq %rax, %r12
movabsq $0x74682e736e61662f, %rax # imm = 0x74682E736E61662F
movq %rax, (%r12)
movl $0x6c6d74, 0x7(%r12)    # imm = 0x6C6D74
movslq %r15d, %r15
addq %r14, %r15
movq %r12, %rdi
callq 0x3180
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x3220
movq %r12, %rdi
callq 0x3500
leaq 0xd30(%rbx), %rsi
movq %r14, %rdi
callq 0x33c0
testl %eax, %eax
js 0x5af3
movl 0xd48(%rbx), %ecx
movl $0x4, %eax
testb $0x4, %cl
je 0x5af8
andl $0xf000, %ecx           # imm = 0xF000
movl $0x2, %eax
cmpl $0x4000, %ecx           # imm = 0x4000
je 0x5af8
movq %r14, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x3330
movl %eax, %ebp
movq 0xd60(%rbx), %rsi
xorl %edi, %edi
movl $0x1, %edx
movl $0x2, %ecx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x3700
movq %rax, 0xd28(%rbx)
movl %ebp, %edi
callq 0x37b0
movl $0x5, %eax
jmp 0x5af8
movl $0x3, %eax
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x2, %eax
jmp 0x5af8
jmp 0x5b13
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x6446
jmp 0x5b8f
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5b61
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3430
jmp 0x5b61
jmp 0x5b5e
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x3600
jmp 0x5b8f
jmp 0x5b5e
jmp 0x5b5e
movq %rax, %rbx
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x5b8f
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3430
jmp 0x5b8f
jmp 0x5b8c
jmp 0x5b8c
movq %rax, %rbx
movq %rbx, %rdi
callq 0x36e0
nop