// File: /workspace/github_cpp_makefile_star2_O1/lszp[P]SmallWebServer/http/http_conn.cpp
// Function: http_conn::process_write(http_conn::HTTP_CODE)
bool http_conn::process_write(HTTP_CODE ret)
{
    switch (ret)
    {
    case INTERNAL_ERROR:
    {
        add_status_line(500, error_500_title);
        add_headers(strlen(error_500_form));
        if (!add_content(error_500_form))
            return false;
        break;
    }
    case BAD_REQUEST:
    {
        add_status_line(404, error_404_title);
        add_headers(strlen(error_404_form));
        if (!add_content(error_404_form))
            return false;
        break;
    }
    case FORBIDDEN_REQUEST:
    {
        add_status_line(403, error_403_title);
        add_headers(strlen(error_403_form));
        if (!add_content(error_403_form))
            return false;
        break;
    }
    case FILE_REQUEST:
    {
        add_status_line(200, ok_200_title);
        if (m_file_stat.st_size != 0)
        {
            add_headers(m_file_stat.st_size);
            m_iv[0].iov_base = m_write_buf;
            m_iv[0].iov_len = m_write_idx;
            m_iv[1].iov_base = m_file_address;
            m_iv[1].iov_len = m_file_stat.st_size;
            m_iv_count = 2;
            bytes_to_send = m_write_idx + m_file_stat.st_size;
            return true;
        }
        else
        {
            const char *ok_string = "<html><body></body></html>";
            add_headers(strlen(ok_string));
            if (!add_content(ok_string))
                return false;
        }
    }
    default:
        return false;
    }
    m_iv[0].iov_base = m_write_buf;
    m_iv[0].iov_len = m_write_idx;
    m_iv_count = 1;
    bytes_to_send = m_write_idx;
    return true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
xorl %ebp, %ebp
addl $-0x2, %esi
cmpl $0x4, %esi
ja 0x6195
movq %rdi, %rbx
leaq 0x40ff(%rip), %rax      # 0xa0ec
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x8423(%rip), %r8       # 0xe420
leaq 0x43e1(%rip), %rsi      # 0xa3e5
leaq 0x4271(%rip), %rdx      # 0xa27c
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x194, %ecx            # imm = 0x194
xorl %eax, %eax
callq 0x5dc2
movq 0x8405(%rip), %rdi      # 0xe428
callq 0x3180
movq %rbx, %rdi
movl %eax, %esi
callq 0x5ef8
movq 0x83ef(%rip), %rdx      # 0xe428
jmp 0x6151
movq 0x83b3(%rip), %r8       # 0xe3f8
leaq 0x4399(%rip), %rsi      # 0xa3e5
leaq 0x4229(%rip), %rdx      # 0xa27c
movq %rbx, %rdi
movl $0xc8, %ecx
xorl %eax, %eax
callq 0x5dc2
movq 0xd60(%rbx), %rsi
movq %rbx, %rdi
testq %rsi, %rsi
je 0x619e
callq 0x5ef8
leaq 0x834(%rbx), %rax
movq %rax, 0xdc0(%rbx)
movslq 0xc34(%rbx), %rax
movq %rax, 0xdc8(%rbx)
movq 0xd28(%rbx), %rcx
movq 0xd60(%rbx), %rdx
movq %rcx, 0xdd0(%rbx)
movq %rdx, 0xdd8(%rbx)
movl $0x2, 0xde0(%rbx)
addl %eax, %edx
movl %edx, 0xdf0(%rbx)
jmp 0x6192
movq 0x8340(%rip), %r8       # 0xe410
leaq 0x430e(%rip), %rsi      # 0xa3e5
leaq 0x419e(%rip), %rdx      # 0xa27c
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x193, %ecx            # imm = 0x193
xorl %eax, %eax
callq 0x5dc2
movq 0x8322(%rip), %rdi      # 0xe418
callq 0x3180
movq %rbx, %rdi
movl %eax, %esi
callq 0x5ef8
movq 0x830c(%rip), %rdx      # 0xe418
jmp 0x6151
movq 0x831b(%rip), %r8       # 0xe430
leaq 0x42c9(%rip), %rsi      # 0xa3e5
leaq 0x4159(%rip), %rdx      # 0xa27c
xorl %ebp, %ebp
movq %rbx, %rdi
movl $0x1f4, %ecx            # imm = 0x1F4
xorl %eax, %eax
callq 0x5dc2
movq 0x82fd(%rip), %rdi      # 0xe438
callq 0x3180
movq %rbx, %rdi
movl %eax, %esi
callq 0x5ef8
movq 0x82e7(%rip), %rdx      # 0xe438
leaq 0x4189(%rip), %rsi      # 0xa2e1
movq %rbx, %rdi
xorl %eax, %eax
callq 0x5dc2
testb %al, %al
je 0x6195
leaq 0x834(%rbx), %rax
movq %rax, 0xdc0(%rbx)
movslq 0xc34(%rbx), %rax
movq %rax, 0xdc8(%rbx)
movl $0x1, 0xde0(%rbx)
movl %eax, 0xdf0(%rbx)
movb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl $0x1a, %esi
callq 0x5ef8
leaq 0x4132(%rip), %rsi      # 0xa2e1
leaq 0x4280(%rip), %rdx      # 0xa436
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0x5dc2
jmp 0x6195