// File: fondoger[P]C0-Compiler/src/symbol.cpp
// Function: readSymbol()
void readSymbol() 
{
goto_label:
    while (isBlankCharacter(ch))
        nextch();
    g_word_pos = g_pos - 1;
    if (std::isdigit(ch)) {
        readUnsignedInteger();
        return;
    }
    if (std::isalpha(ch) || ch == '_') {
        readIdentifier();
        return;
    }
    switch(ch) {
        case '\"': readString(); break;
        case '\'': readCharacter(); break;
        case '>': nextch();
                  if (ch == '=') {
                      g_sym = GEQ;
                      nextch();
                  } else g_sym = GTR;
                  break;
        case '<': nextch();
                  if (ch == '=') {
                      g_sym = LEQ;
                      nextch();
                  } else g_sym = LSS;
                  break;
        case '!': nextch();
                  if (ch != '=') {
                      std::cout << "operater ! is not allowed" 
                           << std::endl;
                      std::exit(1);
                  }
                  g_sym = NEQ;
                  nextch();
                  break;
        case '=': nextch();
                  if (ch == '=') {
                      g_sym = EQL;
                      nextch();
                  } else g_sym = BECOMES;
                  break;
        default: if (char2sym[(int)ch] == 0) {
                     error(ERR_UNSUPPORTED_CHARACTER);
                     nextch();
                     goto goto_label;
                 }
                 g_sym = char2sym[(int)ch];
                 nextch();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
jmp 0x2e05a
movsbl 0x172a7(%rip), %edi     # 0x45308
callq 0x2e2b0
testb $0x1, %al
jne 0x2e06c
jmp 0x2e073
callq 0x2e2f0
jmp 0x2e05a
movl 0x1d6a7(%rip), %eax     # 0x4b720
subl $0x1, %eax
movl %eax, 0x1d6a6(%rip)     # 0x4b728
movsbl 0x1727f(%rip), %edi     # 0x45308
callq 0x32d0
cmpl $0x0, %eax
je 0x2e09d
callq 0x2e490
jmp 0x2e297
movsbl 0x17264(%rip), %edi     # 0x45308
callq 0x3500
cmpl $0x0, %eax
jne 0x2e0ba
movsbl 0x17253(%rip), %eax     # 0x45308
cmpl $0x5f, %eax
jne 0x2e0c4
callq 0x2e500
jmp 0x2e297
movsbl 0x1723d(%rip), %eax     # 0x45308
addl $-0x21, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x1d, %eax
ja 0x2e1e9
movq -0x40(%rbp), %rax
leaq 0x8374(%rip), %rcx      # 0x3645c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x2e5b0
jmp 0x2e297
callq 0x2e750
jmp 0x2e297
callq 0x2e2f0
movsbl 0x171f7(%rip), %eax     # 0x45308
cmpl $0x3d, %eax
jne 0x2e127
movl $0x1c, 0x1d590(%rip)    # 0x4b6b0
callq 0x2e2f0
jmp 0x2e131
movl $0x1b, 0x1d57f(%rip)    # 0x4b6b0
jmp 0x2e297
callq 0x2e2f0
movsbl 0x171c6(%rip), %eax     # 0x45308
cmpl $0x3d, %eax
jne 0x2e158
movl $0x1a, 0x1d55f(%rip)    # 0x4b6b0
callq 0x2e2f0
jmp 0x2e162
movl $0x19, 0x1d54e(%rip)    # 0x4b6b0
jmp 0x2e297
callq 0x2e2f0
movsbl 0x17195(%rip), %eax     # 0x45308
cmpl $0x3d, %eax
je 0x2e1a4
movq 0x16e49(%rip), %rdi     # 0x44fc8
leaq 0x834f(%rip), %rsi      # 0x364d5
callq 0x3300
movq %rax, %rdi
movq 0x16e13(%rip), %rsi     # 0x44fa8
callq 0x3360
movl $0x1, %edi
callq 0x33c0
movl $0x18, 0x1d502(%rip)    # 0x4b6b0
callq 0x2e2f0
jmp 0x2e297
callq 0x2e2f0
movsbl 0x17144(%rip), %eax     # 0x45308
cmpl $0x3d, %eax
jne 0x2e1da
movl $0x17, 0x1d4dd(%rip)    # 0x4b6b0
callq 0x2e2f0
jmp 0x2e1e4
movl $0x23, 0x1d4cc(%rip)    # 0x4b6b0
jmp 0x2e297
movsbl 0x17118(%rip), %eax     # 0x45308
movslq %eax, %rcx
leaq 0x19cb6(%rip), %rax     # 0x47eb0
cmpl $0x0, (%rax,%rcx,4)
jne 0x2e278
leaq -0x21(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x3570
movq -0x48(%rbp), %rdx
leaq 0x82d7(%rip), %rsi      # 0x364ef
leaq -0x20(%rbp), %rdi
callq 0x3440
jmp 0x2e223
leaq -0x20(%rbp), %rdi
callq 0x18620
jmp 0x2e22e
leaq -0x20(%rbp), %rdi
callq 0x35e8
leaq -0x21(%rbp), %rdi
callq 0x3370
callq 0x2e2f0
jmp 0x2e058
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e26d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x35e8
leaq -0x21(%rbp), %rdi
callq 0x3370
jmp 0x2e29d
movsbl 0x17089(%rip), %eax     # 0x45308
movslq %eax, %rcx
leaq 0x19c27(%rip), %rax     # 0x47eb0
movl (%rax,%rcx,4), %eax
movl %eax, 0x1d41e(%rip)     # 0x4b6b0
callq 0x2e2f0
addq $0x50, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x3560
nopw %cs:(%rax,%rax)