// File: /workspace/github_cpp_makefile_star2_O3/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 0x10(%rdi), %r15
movb (%r15), %al
testb %al, %al
je 0xc570
movq %rdi, %rbx
movq 0x20(%rdi), %rcx
movq %rcx, 0x20(%rsp)
xorl %r14d, %r14d
leaq 0x8bf7(%rip), %r13      # 0x15020
movq %r15, %r12
xorl %ebp, %ebp
movl $0x0, 0x4(%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movl (%rbx), %ecx
cmpq $0x6, %rcx
ja 0xc4fc
movslq (%r13,%rcx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
movsbl %al, %edi
callq 0x5080
testl %eax, %eax
jne 0xc4f9
movl $0x1, (%rbx)
jmp 0xc4fc
cmpb $0x9, %al
jne 0xc4f5
movl $0x6, (%rbx)
incq %r12
movq %r12, 0x8(%rsp)
jmp 0xc4f9
cmpb $0x9, %al
jne 0xc4f9
movl $0x3, (%rbx)
jmp 0xc4f9
movsbl %al, %edi
callq 0x5080
testl %eax, %eax
jne 0xc4f9
movl $0x4, (%rbx)
movq %r12, 0x18(%rsp)
jmp 0xc4fc
movsbl %al, %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0xc511
movq 0x10(%rsp), %rcx
leal (%rcx,%rcx,4), %ecx
leal (%rax,%rcx,2), %eax
movq %rax, 0x10(%rsp)
jmp 0xc4f9
movsbl %al, %edi
callq 0x5080
testl %eax, %eax
je 0xc4f9
movl $0x6, (%rbx)
movq %r12, 0x8(%rsp)
jmp 0xc4fc
incl %r14d
incl %ebp
jmp 0xc4fc
incl 0x4(%rsp)
incl %r14d
movslq %r14d, %rax
leaq (%r15,%rax), %r12
movb (%r15,%rax), %al
testb %al, %al
jne 0xc451
jmp 0xc525
movl $0x2, (%rbx)
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movl %ecx, (%rax)
jmp 0xc4fc
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0xc549
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0xc549
movslq %eax, %r8
movq 0x8(%rdi), %rdx
xorl %esi, %esi
movq 0x18(%rsp), %rcx
callq 0x57f0
testl %ebp, %ebp
je 0xc570
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0xc570
movq 0x8(%rbx), %rcx
addq 0x18(%rbx), %rcx
movq 0x8(%rsp), %rdx
subq 0x10(%rbx), %rdx
addq %rcx, %rdx
movq %rdx, (%rax)
movl %ebp, 0x8(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop