// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/memcache/memcache.cpp
// Function: yrmcds::memcache::text_request::parse()
void text_request::parse() noexcept {
    const char* eol = cfind(m_p, LF, m_len);
    if( eol == nullptr ) return; // incomplete

    m_request_len = eol - m_p + 1;
    if( m_request_len == 1 ) return;  // invalid
    if( *(--eol) != CR ) return;

    const char* cmd_start = m_p;
    while( *cmd_start == SP ) ++cmd_start;
    const char* cmd_end = cfind(cmd_start, SP, (eol - cmd_start));
    if( cmd_end == nullptr ) cmd_end = eol;
    std::size_t cmd_len = (cmd_end - cmd_start);

    if( cmd_len == 10 ) {
        if( std::memcmp(cmd_start, "unlock_all", 10) == 0 ) {
            m_command = text_command::UNLOCK_ALL;
            m_valid = true;
            return;
        }
    }
    if( cmd_len == 9 ) {
        if( std::memcmp(cmd_start, "flush_all", 9) == 0 ) {
            m_command = text_command::FLUSH_ALL;
            parse_flushall(cmd_end, eol);
            return;
        }
        if( std::memcmp(cmd_start, "verbosity", 9) == 0 ) {
            m_command = text_command::VERBOSITY;
            parse_verbosity(cmd_end, eol);
            return;
        }
    }
    if( cmd_len == 7 ) {
        if( std::memcmp(cmd_start, "version", 7) == 0 ) {
            m_command = text_command::VERSION;
            m_valid = true;
            return;
        }
        if( std::memcmp(cmd_start, "prepend", 7) == 0 ) {
            m_command = text_command::PREPEND;
            parse_storage(cmd_end, eol, false);
            return;
        }
        if( std::memcmp(cmd_start, "replace", 7) == 0 ) {
            m_command = text_command::REPLACE;
            parse_storage(cmd_end, eol, false);
            return;
        }
    }
    if( cmd_len == 6 ) {
        if( std::memcmp(cmd_start, "append", 6) == 0 ) {
            m_command = text_command::APPEND;
            parse_storage(cmd_end, eol, false);
            return;
        }
        if( std::memcmp(cmd_start, "delete", 6) == 0 ) {
            m_command = text_command::DELETE;
            parse_delete(cmd_end, eol);
            return;
        }
        if( std::memcmp(cmd_start, "unlock", 6) == 0 ) {
            m_command = text_command::UNLOCK;
            parse_unlock(cmd_end, eol);
            return;
        }
    }
    if( cmd_len == 5 ) {
        if( std::memcmp(cmd_start, "touch", 5) == 0 ) {
            m_command = text_command::TOUCH;
            parse_touch(cmd_end, eol);
            return;
        }
        if( std::memcmp(cmd_start, "slabs", 5) == 0 ) {
            m_command = text_command::SLABS;
            m_valid = true;
            // ignore.
            return;
        }
        if( std::memcmp(cmd_start, "stats", 5) == 0 ) {
            m_command = text_command::STATS;
            parse_stats(cmd_end, eol);
            return;
        }
    }
    if( cmd_len == 4 ) {
        if( std::memcmp(cmd_start, "gets", 4) == 0 ) {
            m_command = text_command::GETS;
            parse_get(cmd_end, eol);
            return;
        }
        if( std::memcmp(cmd_start, "incr", 4) == 0 ) {
            m_command = text_command::INCR;
            parse_incdec(cmd_end, eol);
            return;
        }
        if( std::memcmp(cmd_start, "decr", 4) == 0 ) {
            m_command = text_command::DECR;
            parse_incdec(cmd_end, eol);
            return;
        }
        if( std::memcmp(cmd_start, "lock", 4) == 0 ) {
            m_command = text_command::LOCK;
            parse_lock(cmd_end, eol);
            return;
        }
        if( std::memcmp(cmd_start, "quit", 4) == 0 ) {
            m_command = text_command::QUIT;
            m_valid = true;
            return;
        }
        if( std::memcmp(cmd_start, "keys", 4) == 0 ) {
            m_command = text_command::KEYS;
            parse_keys(cmd_end, eol);
            return;
        }
    }
    if( cmd_len == 3 ) {
        if( std::memcmp(cmd_start, "set", 3) == 0 ) {
            m_command = text_command::SET;
            parse_storage(cmd_end, eol, false);
            return;
        }
        if( std::memcmp(cmd_start, "add", 3) == 0 ) {
            m_command = text_command::ADD;
            parse_storage(cmd_end, eol, false);
            return;
        }
        if( std::memcmp(cmd_start, "get", 3) == 0 ) {
            m_command = text_command::GET;
            parse_get(cmd_end, eol);
            return;
        }
        if( std::memcmp(cmd_start, "cas", 3) == 0 ) {
            m_command = text_command::CAS;
            parse_storage(cmd_end, eol, true);
            return;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r13
movq 0x8(%rdi), %rdx
pushq $0xa
popq %rsi
movq %r13, %rdi
callq 0x7560
testq %rax, %rax
je 0x1f584
movq %rax, %rcx
subq %r13, %rcx
leaq 0x1(%rcx), %rcx
movq %rcx, 0x10(%rbx)
je 0x1f584
cmpb $0xd, -0x1(%rax)
jne 0x1f584
leaq -0x1(%rax), %r14
movq %r13, %r12
decq %r12
incq %r13
cmpb $0x20, 0x1(%r12)
leaq 0x1(%r12), %r12
je 0x1f22b
subq %r13, %rax
pushq $0x20
popq %rsi
movq %r12, %rdi
movq %rax, %rdx
callq 0x7560
movq %rax, %r15
testq %rax, %rax
cmoveq %r14, %r15
movq %r15, %rax
subq %r13, %rax
addq $-0x2, %rax
cmpq $0x7, %rax
ja 0x1f584
leaq 0x997f(%rip), %rcx      # 0x28bf0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xa5b3(%rip), %rsi      # 0x29834
pushq $0x3
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
je 0x1f52e
leaq 0xa5a2(%rip), %rsi      # 0x2983d
pushq $0x3
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
je 0x1f570
leaq 0x96cf(%rip), %rsi      # 0x28984
pushq $0x3
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
je 0x1f5ea
leaq 0xa59d(%rip), %rsi      # 0x2986c
pushq $0x3
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
jne 0x1f584
movl $0x6, 0x18(%rbx)
pushq $0x1
popq %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
jmp 0x1f5be
leaq 0xa5ee(%rip), %rsi      # 0x298ef
pushq $0x9
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
je 0x1f504
leaq 0xa5f0(%rip), %rsi      # 0x2990b
pushq $0x9
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
jne 0x1f584
movl $0x14, 0x18(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2454c
cmpl $0x73746567, (%r12)     # imm = 0x73746567
je 0x1f522
cmpl $0x72636e69, (%r12)     # imm = 0x72636E69
je 0x1f567
cmpl $0x72636564, (%r12)     # imm = 0x72636564
je 0x1f5cc
cmpl $0x6b636f6c, (%r12)     # imm = 0x6B636F6C
je 0x1f608
cmpl $0x74697571, (%r12)     # imm = 0x74697571
je 0x1f626
cmpl $0x7379656b, (%r12)     # imm = 0x7379656B
jne 0x1f584
movl $0x16, 0x18(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x24e78
leaq 0xa504(%rip), %rsi      # 0x298c9
pushq $0xa
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
jne 0x1f584
movl $0xf, 0x18(%rbx)
jmp 0x1f580
leaq 0xa4bd(%rip), %rsi      # 0x298a8
pushq $0x5
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
je 0x1f537
leaq 0xa4d4(%rip), %rsi      # 0x298d9
pushq $0x5
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
je 0x1f579
leaq 0x9591(%rip), %rsi      # 0x289b0
pushq $0x5
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
jne 0x1f584
movl $0x11, 0x18(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x24b96
leaq 0xa3fc(%rip), %rsi      # 0x29853
pushq $0x6
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
je 0x1f555
leaq 0xa417(%rip), %rsi      # 0x29888
pushq $0x6
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
je 0x1f58e
leaq 0xa432(%rip), %rsi      # 0x298bd
pushq $0x6
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
jne 0x1f584
movl $0xe, 0x18(%rbx)
jmp 0x1f60f
leaq 0xa44d(%rip), %rsi      # 0x298fe
pushq $0x7
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
je 0x1f55e
leaq 0xa394(%rip), %rsi      # 0x2985f
pushq $0x7
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
je 0x1f5ac
leaq 0xa361(%rip), %rsi      # 0x29846
pushq $0x7
popq %rdx
movq %r12, %rdi
callq 0x7530
testl %eax, %eax
jne 0x1f584
movl $0x3, 0x18(%rbx)
jmp 0x1f5b3
movl $0x12, 0x18(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2442c
movl $0x8, 0x18(%rbx)
jmp 0x1f5f1
movl $0x1, 0x18(%rbx)
jmp 0x1f5b3
movl $0xc, 0x18(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x24a3c
movl $0x4, 0x18(%rbx)
jmp 0x1f5b3
movl $0x13, 0x18(%rbx)
jmp 0x1f580
movl $0xa, 0x18(%rbx)
jmp 0x1f5d3
movl $0x2, 0x18(%rbx)
jmp 0x1f5b3
movl $0x10, 0x18(%rbx)
movb $0x1, 0x1c(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0x9, 0x18(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x24958
movl $0x5, 0x18(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x246a8
movl $0xb, 0x18(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x24cc4
movl $0x7, 0x18(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x24c64
movl $0xd, 0x18(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x24e04
movl $0x15, 0x18(%rbx)
jmp 0x1f580