// File: /workspace/github_c_makefile_star2_O2/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 0x5d43
movl %eax, %r14d
leal 0x1(%r14), %eax
cmpl $0x7b, %eax
ja 0x5f6e
leaq 0x1bf9(%rip), %rcx      # 0x7b00
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x5
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x7
jmp 0x5f12
decq 0x28(%rbx)
xorl %eax, %eax
jmp 0x5f13
pushq $0x1
jmp 0x5f12
pushq $0x4
jmp 0x5f12
pushq $0x10
jmp 0x5f12
pushq $0x3
jmp 0x5f12
pushq $0x2
jmp 0x5f12
pushq $-0x1
popq %rdi
movq %rbx, %rsi
callq 0x5dae
pushq $0xd
jmp 0x5f12
decq 0x28(%rbx)
pushq $0x11
jmp 0x5f12
incq 0x38(%rbx)
movq $0x1, 0x40(%rbx)
pushq $0x15
jmp 0x5f12
pushq $0xe
jmp 0x5f12
pushq $0xb
jmp 0x5f12
pushq $0xa
jmp 0x5f12
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 0x5f94
leaq 0x2277(%rip), %rsi      # 0x8209
jmp 0x5f9b
leaq 0x223c(%rip), %rsi      # 0x81d7
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x5dea
pushq $0x16
jmp 0x5f12