// File: /workspace/github_cpp_makefile_star2_O1/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
movb (%r13), %al
testb %al, %al
je 0xc53a
movq 0x20(%rbx), %rcx
movq %rcx, 0x20(%rsp)
xorl %r14d, %r14d
leaq 0x8bf2(%rip), %r12      # 0x15020
movq %r13, %r15
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 0xc500
movslq (%r12,%rcx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
movsbl %al, %edi
callq 0x5080
testl %eax, %eax
jne 0xc4fd
movl $0x1, (%rbx)
jmp 0xc500
cmpb $0x9, %al
jne 0xc4f9
movl $0x6, (%rbx)
incq %r15
movq %r15, 0x8(%rsp)
jmp 0xc4fd
cmpb $0x9, %al
jne 0xc4fd
movl $0x3, (%rbx)
jmp 0xc4fd
movsbl %al, %edi
callq 0x5080
testl %eax, %eax
jne 0xc4fd
movl $0x4, (%rbx)
movq %r15, 0x18(%rsp)
jmp 0xc500
movsbl %al, %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0xc516
movq 0x10(%rsp), %rcx
leal (%rcx,%rcx,4), %ecx
leal (%rax,%rcx,2), %eax
movq %rax, 0x10(%rsp)
jmp 0xc4fd
movsbl %al, %edi
callq 0x5080
testl %eax, %eax
je 0xc4fd
movl $0x6, (%rbx)
movq %r15, 0x8(%rsp)
jmp 0xc500
incl %r14d
incl %ebp
jmp 0xc500
incl 0x4(%rsp)
incl %r14d
movslq %r14d, %rax
leaq (%rax,%r13), %r15
movb (%r13,%rax), %al
testb %al, %al
jne 0xc456
jmp 0xc52a
movl $0x2, (%rbx)
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movl %ecx, (%rax)
jmp 0xc500
movq 0x8(%rsp), %r14
movq 0x18(%rsp), %rcx
movl 0x4(%rsp), %eax
jmp 0xc543
xorl %ecx, %ecx
xorl %r14d, %r14d
xorl %eax, %eax
xorl %ebp, %ebp
testl %eax, %eax
je 0xc55e
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0xc55e
movslq %eax, %r8
movq 0x8(%rdi), %rdx
xorl %esi, %esi
callq 0x57f0
testl %ebp, %ebp
je 0xc580
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0xc580
movq 0x8(%rbx), %rcx
addq 0x18(%rbx), %rcx
subq 0x10(%rbx), %r14
addq %rcx, %r14
movq %r14, (%rax)
movl %ebp, 0x8(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop