// File: /workspace/github_c_makefile_star2_O3/tstword[P]MIPSAssemblerC/src/tokenizer.c
// Function: init_fsm
state_fsm init_fsm(struct tokenizer *tokenizer) {
    int ch = tgetc(tokenizer);

    switch(ch) {
        case ':':
            return colon_accept;
        case ',':
            return comma_accept;
        case '(':
            return left_paren_accept;
        case ')':
            return right_paren_accept;
        case '\n':
            tokenizer->lineno++;
            tokenizer->colno = 1;
            return eol_accept;
        /* To comply with Microsoft's C++ compiler... */
        case 'A': case 'B': case 'C': case 'D':
        case 'E': case 'F': case 'G': case 'H':
        case 'I': case 'J': case 'K': case 'L':
        case 'M': case 'N': case 'O': case 'P':
        case 'Q': case 'R': case 'S': case 'T':
        case 'U': case 'V': case 'W': case 'X':
        case 'Y': case 'Z':
        /* To comply with Microsoft's C++ compiler... */
        case 'a': case 'b': case 'c': case 'd':
        case 'e': case 'f': case 'g': case 'h':
        case 'i': case 'j': case 'k': case 'l':
        case 'm': case 'n': case 'o': case 'p':
        case 'q': case 'r': case 's': case 't':
        case 'u': case 'v': case 'w': case 'x':
        case 'y': case 'z':
        case '$':
        case '_':
        case '.':
            return identifier_state;
        case '"':
            /* Ignore " character */
            tokenizer->bufpos--;
            return string_state;
        case '\'':
            return character_state;
        case '#':
            return comment_state;
        case '-':
            return negative_state;
        /* To comply with Microsoft's C++ compiler... */
        case '1': case '2': case '3':
        case '4': case '5': case '6': case '7':
        case '8': case '9':
            return integer_state;
        case '0':
            return zero_state;
        case ' ':
        case '\t':
            /* Skip whitespace */
            tokenizer->bufpos--;
            return init_state;
        case EOF:
            tungetc(ch, tokenizer);
            return eof_accept;
        default:
            if(isprint(ch))
                report_fsm(tokenizer, "Unexpected character '%c' on line %ld, column %ld", ch, tokenizer->lineno, tokenizer->colno - 1);
            else 
                report_fsm(tokenizer, "Unexpected character 0x%02X on line %ld, column %ld", ch, tokenizer->lineno, tokenizer->colno - 1);
            return invalid_state;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x62d7
movl %eax, %r14d
leal 0x1(%r14), %eax
cmpl $0x7b, %eax
ja 0x651f
leaq 0x167f(%rip), %rcx      # 0x7b00
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x5, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x7, %eax
jmp 0x648f
decq 0x28(%rbx)
xorl %eax, %eax
jmp 0x648f
movl $0x1, %eax
jmp 0x648f
movl $0x4, %eax
jmp 0x648f
movl $0x10, %eax
jmp 0x648f
movl $0x3, %eax
jmp 0x648f
movl $0x2, %eax
jmp 0x648f
movq 0x8(%rbx), %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3100
decq 0x40(%rbx)
decq 0x28(%rbx)
movl $0xd, %eax
jmp 0x648f
decq 0x28(%rbx)
movl $0x11, %eax
jmp 0x648f
incq 0x38(%rbx)
movq $0x1, 0x40(%rbx)
movl $0x15, %eax
jmp 0x648f
movl $0xe, %eax
jmp 0x648f
movl $0xb, %eax
jmp 0x648f
movl $0xa, %eax
jmp 0x648f
callq 0x3180
movq (%rax), %rax
movslq %r14d, %rdx
movq 0x38(%rbx), %rcx
movq 0x40(%rbx), %r8
decq %r8
testb $0x40, 0x1(%rax,%rdx,2)
jne 0x6545
leaq 0x1cc6(%rip), %rsi      # 0x8209
jmp 0x654c
leaq 0x1c8b(%rip), %rsi      # 0x81d7
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x636f
movl $0x16, %eax
jmp 0x648f