// File: /workspace/github_cpp_makefile_star2_O2/cimtools[P]yaaclc/src/Analizer_ACL.cpp
// Function: Analizer_ACL::get_tokens()
int Analizer_ACL::get_tokens(){
    
    Token * readed_token;
    string token;
    char c = myfile->peek();

    while( c == 42 ){ 

        do{
           myfile->get();
        }while( myfile->peek() != '\n' );
        c = myfile->peek();
    }

    if( myfile->is_open() ){
        do{
            readed_token = new Token();
            token="";

            c = myfile->peek();

            while( c == 42 ){ 
                do{
                myfile->get();
                }while( myfile->peek() != '\n' );
                c = myfile->peek();
            }

            if( is_letter(c) ){ 
                do{
                    token += myfile->get();
                    c = myfile->peek();
                }while( is_letter(c) || is_number(c) );

                readed_token->content = token;

                if( commands.find(token) != commands.end() ){
                    readed_token->type ="COMMAND";
                }else{
                    readed_token->type ="WORD";
                }

            }else if( is_number(c) ){ 
                do{
                    token += myfile->get();
                }while( is_number(myfile->peek()) );

                readed_token->content = token;
                readed_token->type = "NUMBER";

            }else if( is_operator(c) ){ 
                do{
                    token += myfile->get();
                }while( is_operator(myfile->peek()) );

                readed_token->content = token;
                readed_token->type = "OPERATOR";

            }else if( c == '"' ){
                do{
                    token += myfile->get();
                }while( is_allowed_in_string(myfile->peek() ) && token.size()<= 40 );
                if( myfile->peek()!= '"' ){
                    //THROW ERROR
                    cout << "sintax error!!!!!!!!!!!!!!!!!!!!!!!!!!\n";
                    token = myfile->peek();
                    readed_token->content = token;
                    readed_token->type = "ERROR";     
                    return -1;       
                }else{
                    token+=myfile->get();
                }

                readed_token->content = token;
                readed_token->type = "STRING";

            }else if( c == '[' ){
                do{
                    token += myfile->get();
                }while( is_number(myfile->peek()));
                if( myfile->peek() != ']'){
                    //THROW ERROR
                    cout << "sintax error!!!!!!!!!!!!!!!!!!!!!!!!!!\n";
                    token = myfile->peek();
                    readed_token->content = token;
                    readed_token->type = "ERROR";
                    return -2;
                }else{
                    token += myfile->get();
                }

                readed_token->content = token;
                readed_token->type = "INDEX";

            }else if( c == '\n'  ){
                do{
                    token += myfile->get();
                }while( myfile->peek() == '\n' );

                readed_token->content = token;
                readed_token->type ="NEW LINE";

            }else if( c == EOF){
                readed_token->content = "";        
                readed_token->type ="END";

            }else if( c == ' ' || c == '\t' ){
                do{
                    token += myfile->get();
                    c = myfile->peek();
                }while( c==' ' || c == '\t' );

                readed_token->content = token;
                readed_token->type ="WHITE SPACE";

            }else{
                cout<< "None of the above!!     :  " << (int)c ;

                token = c;
                readed_token->content = token;
                readed_token->type ="ERROR";

            }   
            token_vector.push_back(readed_token);
        }while( token!="" );
    }else{
        cout << "The file is not open." << endl;
    }    
    #ifdef DEBUGGING
    cout << "The number of tokens readed were " << token_vector.size() << endl;
    #endif
    return 1; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %rbx
movb $0x0, (%rax)
movq 0x48(%rdi), %rdi
callq 0x20d0
cmpb $0x2a, %al
jne 0x2f97
movq 0x48(%rbx), %rdi
callq 0x2220
movq 0x48(%rbx), %rdi
callq 0x20d0
cmpl $0xa, %eax
jne 0x2f75
movq 0x48(%rbx), %rdi
callq 0x20d0
jmp 0x2f71
movq 0x48(%rbx), %rdi
addq $0x78, %rdi
callq 0x2080
pushq $0x1
popq %r14
testb %al, %al
je 0x33b4
leaq 0x20(%rbx), %rax
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %r14
movabsq $0x7000e84000000000, %r15 # imm = 0x7000E84000000000
pushq $0x40
popq %rdi
callq 0x21e0
leaq 0x10(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x10(%rax)
movq %rcx, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, 0x20(%rax)
movb $0x0, 0x30(%rax)
movq %rax, -0x30(%rbp)
movq %r14, %rdi
leaq 0x4142(%rip), %rsi      # 0x7148
callq 0x2370
movq 0x48(%rbx), %rdi
callq 0x20d0
movl %eax, %r12d
movl %r12d, %r13d
shll $0x18, %r13d
cmpl $0x2a000000, %r13d      # imm = 0x2A000000
jne 0x304c
movq 0x48(%rbx), %rdi
callq 0x2220
movq 0x48(%rbx), %rdi
callq 0x20d0
cmpl $0xa, %eax
jne 0x3027
movq 0x48(%rbx), %rdi
callq 0x20d0
movl %eax, %r12d
jmp 0x3017
movl %r12d, %eax
andb $-0x21, %al
addb $-0x41, %al
cmpb $0x19, %al
ja 0x30c8
movq 0x48(%rbx), %rdi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x21a0
movq 0x48(%rbx), %rdi
callq 0x20d0
leal -0x30(%rax), %ecx
cmpb $0xa, %cl
jb 0x3057
andb $-0x21, %al
addb $-0x41, %al
cmpb $0x1a, %al
jb 0x3057
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x2140
leaq 0x8199(%rip), %rdi      # 0xb230
movq %r14, %rsi
callq 0x659a
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
leaq 0x818a(%rip), %rcx      # 0xb238
cmpq %rcx, %rax
leaq 0x404c(%rip), %rsi      # 0x7104
leaq 0x404d(%rip), %rax      # 0x710c
cmoveq %rax, %rsi
jmp 0x3166
leal -0x30(%r12), %eax
cmpb $0x9, %al
ja 0x3111
movq 0x48(%rbx), %rdi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x21a0
movq 0x48(%rbx), %rdi
callq 0x20d0
addb $-0x30, %al
cmpb $0xa, %al
jb 0x30d1
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x2140
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
leaq 0x4002(%rip), %rsi      # 0x7111
jmp 0x3166
cmpb $0x3e, %r12b
ja 0x3194
movzbl %r12b, %eax
btq %rax, %r15
jae 0x3194
movq 0x48(%rbx), %rdi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x21a0
movq 0x48(%rbx), %rdi
callq 0x20d0
cmpb $0x3e, %al
ja 0x314b
movzbl %al, %eax
btq %rax, %r15
jb 0x3121
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x2140
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
leaq 0x3fb2(%rip), %rsi      # 0x7118
callq 0x2370
movq -0x58(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5c00
movq %r14, %rdi
leaq 0x3fc6(%rip), %rsi      # 0x7148
callq 0x5bf3
testb %al, %al
jne 0x2fc6
jmp 0x33d1
cmpl $0xff000000, %r13d      # imm = 0xFF000000
je 0x3390
cmpl $0x9000000, %r13d       # imm = 0x9000000
je 0x321c
cmpl $0x5b000000, %r13d      # imm = 0x5B000000
je 0x32d9
cmpl $0x20000000, %r13d      # imm = 0x20000000
je 0x321c
cmpl $0x22000000, %r13d      # imm = 0x22000000
je 0x3265
cmpl $0xa000000, %r13d       # imm = 0xA000000
jne 0x3342
movq 0x48(%rbx), %rdi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x21a0
movq 0x48(%rbx), %rdi
callq 0x20d0
cmpl $0xa, %eax
je 0x31da
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x2140
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
leaq 0x3f45(%rip), %rsi      # 0x715c
jmp 0x3166
movq 0x48(%rbx), %rdi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x21a0
movq 0x48(%rbx), %rdi
callq 0x20d0
cmpb $0x9, %al
je 0x321c
movzbl %al, %eax
cmpl $0x20, %eax
je 0x321c
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x2140
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
leaq 0x3f05(%rip), %rsi      # 0x7165
jmp 0x3166
movq 0x48(%rbx), %rdi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x21a0
movq 0x48(%rbx), %rdi
callq 0x20d0
cmpb $0x22, %al
je 0x3293
addb $-0x20, %al
cmpb $0x5e, %al
ja 0x3293
cmpq $0x29, -0x48(%rbp)
jb 0x3265
movq 0x48(%rbx), %rdi
callq 0x20d0
cmpl $0x22, %eax
jne 0x33f0
movq 0x48(%rbx), %rdi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x21a0
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x2140
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
leaq 0x3e7b(%rip), %rsi      # 0x714f
jmp 0x3166
movq 0x48(%rbx), %rdi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x21a0
movq 0x48(%rbx), %rdi
callq 0x20d0
addb $-0x30, %al
cmpb $0xa, %al
jb 0x32d9
movq 0x48(%rbx), %rdi
callq 0x20d0
cmpl $0x5d, %eax
jne 0x343d
movq 0x48(%rbx), %rdi
callq 0x2220
movsbl %al, %esi
movq %r14, %rdi
callq 0x21a0
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x2140
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
leaq 0x3e19(%rip), %rsi      # 0x7156
jmp 0x3166
movq 0x7c8f(%rip), %rdi      # 0xafd8
leaq 0x3e21(%rip), %rsi      # 0x7171
callq 0x21d0
sarl $0x18, %r13d
movq %rax, %rdi
movl %r13d, %esi
callq 0x2320
movsbl %r12b, %esi
movq %r14, %rdi
callq 0x2310
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x2140
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
leaq 0x3dbe(%rip), %rsi      # 0x7149
jmp 0x3166
movq -0x30(%rbp), %rdi
leaq 0x3dad(%rip), %rsi      # 0x7148
callq 0x2370
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
leaq 0x3d17(%rip), %rsi      # 0x70c6
jmp 0x3166
movq 0x7c1d(%rip), %rdi      # 0xafd8
leaq 0x3dcb(%rip), %rsi      # 0x718d
callq 0x21d0
movq %rax, %rdi
callq 0x2120
jmp 0x33d5
pushq $0x1
popq %r14
leaq -0x50(%rbp), %rdi
callq 0x2110
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7be1(%rip), %rdi      # 0xafd8
leaq 0x3d23(%rip), %rsi      # 0x7121
callq 0x21d0
movq 0x48(%rbx), %rdi
callq 0x20d0
movsbl %al, %esi
leaq -0x50(%rbp), %rdi
callq 0x2310
movq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2140
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
leaq 0x3d15(%rip), %rsi      # 0x7149
callq 0x2370
pushq $-0x1
jmp 0x33d3
movq 0x7b94(%rip), %rdi      # 0xafd8
leaq 0x3cd6(%rip), %rsi      # 0x7121
callq 0x21d0
movq 0x48(%rbx), %rdi
callq 0x20d0
movsbl %al, %esi
leaq -0x50(%rbp), %rdi
callq 0x2310
movq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2140
movq -0x30(%rbp), %rdi
addq $0x20, %rdi
leaq 0x3cc8(%rip), %rsi      # 0x7149
callq 0x2370
pushq $-0x2
jmp 0x33d3
jmp 0x34a7
jmp 0x34a7
jmp 0x34a7
jmp 0x34a7
jmp 0x34a7
jmp 0x34a7
jmp 0x34a7
jmp 0x34a7
jmp 0x34a7
jmp 0x34a7
jmp 0x34a7
jmp 0x34a7
jmp 0x34a7
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x2330
nop