// File: jixinqi[P]lazurite/./src/lazurite_core/http_request.cpp
// Function: lazurite::http::request_parser::parser_first_line()
bool lazurite::http::request_parser::parser_first_line()
{
    const std::size_t index = _request.raw_msg().find("\r\n");
    if (index == _request.raw_msg().npos)
    {
        return (_request.raw_msg().length() + 2 <= http_msg_first_line_max_length);
    }
    else if(index + 2 > http_msg_first_line_max_length)
    {
        return false;
    }

    std::vector<std::string> items;
    std::string temp = "";
    for (std::size_t i = 0; i != index; i++)
    {
        if (_request.raw_msg().at(i) != ' ')
        {
            temp.push_back(_request.raw_msg().at(i));
        }
        else
        {
            items.push_back(temp);
            temp.clear();
        }
    }
    items.push_back(temp);

    if (items.size() != 3)
    {
        return false;
    }

    _request.request_method(items.at(0));
    _request.request_uri(items.at(1));
    _request.request_version(items.at(2));
    _request.first_line_end_index(index + 2);

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0x128(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x25b10
leaq -0x38(%rbp), %rdi
leaq 0x63dd(%rip), %rsi      # 0x2c27b
xorl %eax, %eax
movl %eax, %edx
callq 0x6780
movq %rax, -0x130(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x67a8
movq -0x130(%rbp), %rax
movq -0x128(%rbp), %rsi
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x25b10
leaq -0x58(%rbp), %rdi
callq 0x67a8
movq -0x120(%rbp), %rax
cmpq $-0x1, %rax
jne 0x25f2c
movq -0x128(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x25b10
leaq -0x78(%rbp), %rdi
callq 0x65d0
addq $0x2, %rax
cmpq $0x2000, %rax           # imm = 0x2000
setbe %al
andb $0x1, %al
movb %al, -0x1(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x67a8
jmp 0x26260
movq -0x18(%rbp), %rax
addq $0x2, %rax
cmpq $0x2000, %rax           # imm = 0x2000
jbe 0x25f45
movb $0x0, -0x1(%rbp)
jmp 0x26260
jmp 0x25f47
leaq -0x90(%rbp), %rdi
callq 0x26a60
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x66b0
movq -0x138(%rbp), %rdx
leaq 0x6309(%rip), %rsi      # 0x2c27d
leaq -0xb0(%rbp), %rdi
callq 0x6540
jmp 0x25f82
leaq -0xb1(%rbp), %rdi
callq 0x6420
movq $0x0, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
cmpq -0x18(%rbp), %rax
je 0x2611a
movq -0x128(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x25b10
jmp 0x25fbf
movq -0xd0(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x6740
movq %rax, -0x140(%rbp)
jmp 0x25fdb
movq -0x140(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x144(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x67a8
movl -0x144(%rbp), %eax
cmpl $0x20, %eax
je 0x260e0
movq -0x128(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x25b10
jmp 0x2601b
movq -0xd0(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x6740
movq %rax, -0x150(%rbp)
jmp 0x26037
movq -0x150(%rbp), %rax
movsbl (%rax), %esi
leaq -0xb0(%rbp), %rdi
callq 0x6380
jmp 0x2604f
leaq -0x110(%rbp), %rdi
callq 0x67a8
jmp 0x26101
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0xb1(%rbp), %rdi
callq 0x6420
jmp 0x26252
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
jmp 0x26246
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x67a8
jmp 0x26246
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc0(%rbp)
movl %eax, -0xc4(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x67a8
jmp 0x26246
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x26a80
jmp 0x260f5
leaq -0xb0(%rbp), %rdi
callq 0x6500
jmp 0x26103
movq -0xd0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xd0(%rbp)
jmp 0x25f99
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x26a80
jmp 0x2612f
leaq -0x90(%rbp), %rdi
callq 0x26af0
cmpq $0x3, %rax
je 0x26154
movb $0x0, -0x1(%rbp)
movl $0x1, -0x114(%rbp)
jmp 0x2622c
movq -0x128(%rbp), %rax
movq %rax, -0x160(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x90(%rbp), %rdi
callq 0x26b10
movq %rax, -0x158(%rbp)
jmp 0x2617b
movq -0x158(%rbp), %rsi
movq -0x160(%rbp), %rdi
callq 0x25a80
jmp 0x26190
movq -0x128(%rbp), %rax
movq %rax, -0x170(%rbp)
leaq -0x90(%rbp), %rdi
movl $0x1, %esi
callq 0x26b10
movq %rax, -0x168(%rbp)
jmp 0x261b8
movq -0x168(%rbp), %rsi
movq -0x170(%rbp), %rdi
callq 0x25ab0
jmp 0x261cd
movq -0x128(%rbp), %rax
movq %rax, -0x180(%rbp)
leaq -0x90(%rbp), %rdi
movl $0x2, %esi
callq 0x26b10
movq %rax, -0x178(%rbp)
jmp 0x261f5
movq -0x178(%rbp), %rsi
movq -0x180(%rbp), %rdi
callq 0x25ae0
jmp 0x2620a
movq -0x128(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x2, %rsi
callq 0x25c50
movb $0x1, -0x1(%rbp)
movl $0x1, -0x114(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x67a8
leaq -0x90(%rbp), %rdi
callq 0x26b50
jmp 0x26260
leaq -0xb0(%rbp), %rdi
callq 0x67a8
leaq -0x90(%rbp), %rdi
callq 0x26b50
jmp 0x2626e
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0xc0(%rbp), %rdi
callq 0x6680
nopw (%rax,%rax)