// File: Davidc2525[P]Leaf/compiler/symb_tab/symbol_table.cpp
// Function: symbol_table::init()
void symbol_table::init()
{
    cout << "; iniciando tabla de simbolos" << endl;
    //PROCESS::Native * n = PROCESS::Native::getInstance();
    //Obj *o;
    cm_sp = 0;
    curScope = new Scope();
    curScope->outer = NULL;
    curLevel = 0;
    currMethodStack = (Obj **)malloc(sizeof(Obj *) * 100);

    //predeclared types
    boolType = new Struct(Struct::Bool);
    byteType = new Struct(Struct::Byte);
    intType = new Struct(Struct::Int);
    charType = new Struct(Struct::Char);
    floatType = new Struct(Struct::Float);
    doubleType = new Struct(Struct::Double);
    //stringType = new Struct(Struct::String);
    stringType = new Struct(Struct::Arr, charType);
    //string == char[]
    nullType = new Struct(Struct::Class);
    noType = new Struct(Struct::None);
    noObj = new Obj(Obj::Var, new string("???"), noType);

    //create predecared object
    insert(Obj::Type, new string(TYPES::_BOOOLEAN_), boolType);
    insert(Obj::Type, new string(TYPES::_BYTE_), byteType);
    insert(Obj::Type, new string(TYPES::_INT_), intType);
    insert(Obj::Type, new string(TYPES::_FLOAT_), floatType);
    insert(Obj::Type, new string(TYPES::_DOUBLE_), doubleType);
    insert(Obj::Type, new string(TYPES::_STRING_), stringType);
    insert(Obj::Type, new string(TYPES::_CHAR_), charType);
    insert(Obj::Con, new string(TYPES::_NULL_), nullType);
    insert(Obj::Type, new string("void"), noType);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq 0x29d4e(%rip), %rdi     # 0x49fd0
leaq 0x15b54(%rip), %rsi     # 0x35ddd
callq 0x62c0
movq %rax, %rdi
movq 0x29d18(%rip), %rsi     # 0x49fb0
callq 0x6320
movl $0x0, 0x2ade1(%rip)     # 0x4b088
movl $0x20, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, -0x28(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x20b70
movq -0x28(%rbp), %rax
movq %rax, 0x2ad5e(%rip)     # 0x4b030
movq 0x2ad57(%rip), %rax     # 0x4b030
movq $0x0, (%rax)
movl $0x0, 0x2ad4e(%rip)     # 0x4b038
movl $0x320, %edi            # imm = 0x320
callq 0x6420
movq %rax, 0x2ad95(%rip)     # 0x4b090
movl $0x30, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x20(%rbp)
movl $0x8, %esi
callq 0x1e7d0
jmp 0x2031b
movq -0x20(%rbp), %rax
movq %rax, 0x2ad1a(%rip)     # 0x4b040
movl $0x30, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x30(%rbp)
movl $0xd, %esi
callq 0x1e7d0
jmp 0x20346
movq -0x30(%rbp), %rax
movq %rax, 0x2acf7(%rip)     # 0x4b048
movl $0x30, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movl $0x1, %esi
callq 0x1e7d0
jmp 0x20371
movq -0x38(%rbp), %rax
movq %rax, 0x2acd4(%rip)     # 0x4b050
movl $0x30, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movl $0xb, %esi
callq 0x1e7d0
jmp 0x2039c
movq -0x40(%rbp), %rax
movq %rax, 0x2acb1(%rip)     # 0x4b058
movl $0x30, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
movl $0x2, %esi
callq 0x1e7d0
jmp 0x203c7
movq -0x48(%rbp), %rax
movq %rax, 0x2ac8e(%rip)     # 0x4b060
movl $0x30, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x50(%rbp)
movl $0x3, %esi
callq 0x1e7d0
jmp 0x203f2
movq -0x50(%rbp), %rax
movq %rax, 0x2ac6b(%rip)     # 0x4b068
movl $0x30, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x58(%rbp)
movq 0x2ac40(%rip), %rdx     # 0x4b058
movl $0x5, %esi
callq 0x1e820
jmp 0x20424
movq -0x58(%rbp), %rax
movq %rax, 0x2ac41(%rip)     # 0x4b070
movl $0x30, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x60(%rbp)
movl $0x6, %esi
callq 0x1e7d0
jmp 0x2044f
movq -0x60(%rbp), %rax
movq %rax, 0x2ac1e(%rip)     # 0x4b078
movl $0x30, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x68(%rbp)
xorl %esi, %esi
callq 0x1e7d0
jmp 0x20477
movq -0x68(%rbp), %rax
movq %rax, 0x2abfe(%rip)     # 0x4b080
movl $0x48, %edi
callq 0x62e0
movq %rax, -0x78(%rbp)
movb $0x1, -0xf(%rbp)
movl $0x20, %edi
callq 0x62e0
movq %rax, -0x70(%rbp)
jmp 0x204a4
movb $0x1, -0xe(%rbp)
leaq -0xd(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x6500
movq -0x70(%rbp), %rdi
movq -0x80(%rbp), %rdx
leaq 0x15937(%rip), %rsi     # 0x35dfb
callq 0xada0
jmp 0x204cb
movq -0x70(%rbp), %rdx
movq -0x78(%rbp), %rdi
movb $0x0, -0xe(%rbp)
movq 0x2aba2(%rip), %rcx     # 0x4b080
movl $0x1, %esi
callq 0x1fe10
jmp 0x204ea
movq -0x78(%rbp), %rax
movb $0x0, -0xf(%rbp)
movq %rax, 0x2abb7(%rip)     # 0x4b0b0
leaq -0xd(%rbp), %rdi
callq 0x6340
movl $0x20, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x88(%rbp)
leaq 0x2aac8(%rip), %rsi     # 0x4afe8
callq 0x6130
jmp 0x20527
movq -0x88(%rbp), %rsi
movq 0x2ab0b(%rip), %rdx     # 0x4b040
movl $0x2, %edi
callq 0x1fed0
movl $0x20, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x90(%rbp)
leaq 0x2a9cb(%rip), %rsi     # 0x4af28
callq 0x6130
jmp 0x20564
movq -0x90(%rbp), %rsi
movq 0x2aad6(%rip), %rdx     # 0x4b048
movl $0x2, %edi
callq 0x1fed0
movl $0x20, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x98(%rbp)
leaq 0x2a9ae(%rip), %rsi     # 0x4af48
callq 0x6130
jmp 0x205a1
movq -0x98(%rbp), %rsi
movq 0x2aaa1(%rip), %rdx     # 0x4b050
movl $0x2, %edi
callq 0x1fed0
movl $0x20, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xa0(%rbp)
leaq 0x2a991(%rip), %rsi     # 0x4af68
callq 0x6130
jmp 0x205de
movq -0xa0(%rbp), %rsi
movq 0x2aa74(%rip), %rdx     # 0x4b060
movl $0x2, %edi
callq 0x1fed0
movl $0x20, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xa8(%rbp)
leaq 0x2a974(%rip), %rsi     # 0x4af88
callq 0x6130
jmp 0x2061b
movq -0xa8(%rbp), %rsi
movq 0x2aa3f(%rip), %rdx     # 0x4b068
movl $0x2, %edi
callq 0x1fed0
movl $0x20, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xb0(%rbp)
leaq 0x2a977(%rip), %rsi     # 0x4afc8
callq 0x6130
jmp 0x20658
movq -0xb0(%rbp), %rsi
movq 0x2aa0a(%rip), %rdx     # 0x4b070
movl $0x2, %edi
callq 0x1fed0
movl $0x20, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xb8(%rbp)
leaq 0x2a91a(%rip), %rsi     # 0x4afa8
callq 0x6130
jmp 0x20695
movq -0xb8(%rbp), %rsi
movq 0x2a9b5(%rip), %rdx     # 0x4b058
movl $0x2, %edi
callq 0x1fed0
movl $0x20, %edi
callq 0x62e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xc0(%rbp)
leaq 0x2a93d(%rip), %rsi     # 0x4b008
callq 0x6130
jmp 0x206d2
movq -0xc0(%rbp), %rsi
movq 0x2a998(%rip), %rdx     # 0x4b078
xorl %edi, %edi
callq 0x1fed0
movl $0x20, %edi
callq 0x62e0
movq %rax, -0xd0(%rbp)
movq %rax, -0xd8(%rbp)
movb $0x1, -0x11(%rbp)
leaq -0x10(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x6500
movq -0xd0(%rbp), %rdi
movq -0xc8(%rbp), %rdx
leaq 0x156d7(%rip), %rsi     # 0x35dff
callq 0xada0
jmp 0x2072f
movq -0xd8(%rbp), %rsi
movb $0x0, -0x11(%rbp)
movq 0x2a93f(%rip), %rdx     # 0x4b080
movl $0x2, %edi
callq 0x1fed0
jmp 0x2074d
leaq -0x10(%rbp), %rdi
callq 0x6340
addq $0xe0, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x30, %esi
callq 0x62f0
jmp 0x20a03
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x30, %esi
callq 0x62f0
jmp 0x20a03
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x30, %esi
callq 0x62f0
jmp 0x20a03
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x30, %esi
callq 0x62f0
jmp 0x20a03
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x30, %esi
callq 0x62f0
jmp 0x20a03
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x30, %esi
callq 0x62f0
jmp 0x20a03
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x30, %esi
callq 0x62f0
jmp 0x20a03
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x30, %esi
callq 0x62f0
jmp 0x20a03
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x30, %esi
callq 0x62f0
jmp 0x20a03
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
jmp 0x208b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
leaq -0xd(%rbp), %rdi
callq 0x6340
testb $0x1, -0xe(%rbp)
jne 0x208a1
jmp 0x208af
movq -0x70(%rbp), %rdi
movl $0x20, %esi
callq 0x62f0
jmp 0x208b1
testb $0x1, -0xf(%rbp)
jne 0x208b9
jmp 0x208c7
movq -0x78(%rbp), %rdi
movl $0x48, %esi
callq 0x62f0
jmp 0x20a03
movq -0x88(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x20, %esi
callq 0x62f0
jmp 0x20a03
movq -0x90(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x20, %esi
callq 0x62f0
jmp 0x20a03
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x20, %esi
callq 0x62f0
jmp 0x20a03
movq -0xa0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x20, %esi
callq 0x62f0
jmp 0x20a03
movq -0xa8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x20, %esi
callq 0x62f0
jmp 0x20a03
movq -0xb0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x20, %esi
callq 0x62f0
jmp 0x20a03
movq -0xb8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x20, %esi
callq 0x62f0
jmp 0x20a03
movq -0xc0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movl $0x20, %esi
callq 0x62f0
jmp 0x20a03
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8(%rbp)
movl %eax, -0xc(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x6340
testb $0x1, -0x11(%rbp)
jne 0x209f0
jmp 0x20a01
movq -0xd8(%rbp), %rdi
movl $0x20, %esi
callq 0x62f0
jmp 0x20a03
movq -0x8(%rbp), %rdi
callq 0x64f0
nopl (%rax)