// File: /workspace/github_cpp_makefile_star2_O2/nilnilnil[P]autocomplete/src/main.cpp
// Function: InputLineParser::start_parsing()
void
    start_parsing() {
        int i = 0;
        int n = 0;
        const char *p_start = NULL, *s_start = NULL;
        int p_len = 0, s_len = 0;

        while (this->buff[i]) {
            char ch = this->buff[i];
            DCERR("State: "<<this->state<<", read: "<<ch<<"\n");

            switch (this->state) {
            case ILP_BEFORE_NON_WS:
                if (!isspace(ch)) {
                    this->state = ILP_WEIGHT;
                }
                else {
                    ++i;
                }
                break;

            case ILP_WEIGHT:
                if (isdigit(ch)) {
                    n *= 10;
                    n += (ch - '0');
                    ++i;
                }
                else {
                    this->state = ILP_BEFORE_PTAB;
                    on_weight(n);
                }
                break;

            case ILP_BEFORE_PTAB:
                if (ch == '\t') {
                    this->state = ILP_AFTER_PTAB;
                }
                ++i;
                break;

            case ILP_AFTER_PTAB:
                if (isspace(ch)) {
                    ++i;
                }
                else {
                    p_start = this->buff + i;
                    this->state = ILP_PHRASE;
                }
                break;

            case ILP_PHRASE:
                // DCERR("State: ILP_PHRASE: "<<buff[i]<<endl);
                if (ch != '\t') {
                    ++p_len;
                }
                else {
                    // Note: Skip to ILP_SNIPPET since the snippet may
                    // start with a white-space that we wish to
                    // preserve.
                    // 
                    // this->state = ILP_AFTER_STAB;
                    this->state = ILP_SNIPPET;
                    s_start = this->buff + i + 1;
                }
                ++i;
                break;

            case ILP_AFTER_STAB:
                if (isspace(ch)) {
                    this->state = ILP_SNIPPET;
                    s_start = this->buff + i;
                }
                else {
                    ++i;
                }
                break;

            case ILP_SNIPPET:
                ++i;
                ++s_len;
                break;

            };
        }
        on_phrase(p_start, p_len);
        on_snippet(s_start, s_len);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %r13
movq 0x20(%rdi), %rax
movq %rax, 0x20(%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x846c(%rip), %r15      # 0x12020
movq $0x0, 0x18(%rsp)
movq $0x0, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
movslq %r12d, %r14
movsbl (%r13,%r14), %edi
testl %edi, %edi
je 0x9cab
movl (%rbx), %eax
cmpq $0x6, %rax
ja 0x9bd3
addq %r13, %r14
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
callq 0x5070
testl %eax, %eax
jne 0x9c8c
movl $0x1, (%rbx)
jmp 0x9bd3
cmpb $0x9, %dil
jne 0x9c88
movl $0x6, (%rbx)
incq %r14
movq %r14, 0x8(%rsp)
jmp 0x9c8c
cmpb $0x9, %dil
jne 0x9c8c
movl $0x3, (%rbx)
jmp 0x9c8c
callq 0x5070
testl %eax, %eax
jne 0x9c8c
movl $0x4, (%rbx)
movq %r14, 0x18(%rsp)
jmp 0x9bd3
addl $-0x30, %edi
cmpl $0x9, %edi
ja 0x9c94
imull $0xa, 0x10(%rsp), %eax
addl %eax, %edi
incl %r12d
movl %edi, %eax
movq %rax, 0x10(%rsp)
jmp 0x9bd3
callq 0x5070
testl %eax, %eax
je 0x9c8c
movl $0x6, (%rbx)
movq %r14, 0x8(%rsp)
jmp 0x9bd3
incl %r12d
incl %ebp
jmp 0x9bd3
incl 0x4(%rsp)
incl %r12d
jmp 0x9bd3
movl $0x2, (%rbx)
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movl %ecx, (%rax)
jmp 0x9bd3
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
movl 0x4(%rsp), %edx
callq 0xb122
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movl %ebp, %edx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb138