// File: protonpopsicle[P]lang/src/compiler/ZoneMgr.cpp
// Function: ZoneMgr::addVar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void ZoneMgr::addVar(std::string id, std::string type) {
    varTable::iterator iter = zones[inUse].find(id);
    VarData varData;
    
    if (iter == zones[inUse].end()) {
        if (type == "bool") {
            varData.type = BOOL;
            varData.index = boolCount;
            boolCount++;
        }
        else if (type == "int") {
            varData.type = INT;
            varData.index = intCount;
            intCount++;
        }
        else if (type == "string") {
            varData.type = STRING;
            varData.index = stringCount;
            stringCount++;
        }
        zones[inUse].insert(std::make_pair(id, varData));
    }
    else {
        throw Error("'" + id + "' already declared in this scope");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rsi, -0xd0(%rbp)
movq %rdx, -0xd8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq %rax, %rdi
addq $0x8, %rdi
movslq (%rax), %rsi
callq 0xa620
movq -0xd0(%rbp), %rsi
movq %rax, %rdi
callq 0xa640
movq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq %rax, %rdi
addq $0x8, %rdi
movslq (%rax), %rsi
callq 0xa620
movq %rax, %rdi
callq 0xa6a0
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa670
testb $0x1, %al
jne 0x9fbd
jmp 0xa0f4
movq -0xd8(%rbp), %rdi
leaq 0x420b(%rip), %rsi      # 0xe1d6
callq 0xa6d0
testb $0x1, %al
jne 0x9fd6
jmp 0x9ff2
movq -0xc8(%rbp), %rax
movb $0x0, -0x28(%rbp)
movl 0x50(%rax), %ecx
movl %ecx, -0x24(%rbp)
movl 0x50(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x50(%rax)
jmp 0xa05e
movq -0xd8(%rbp), %rdi
leaq 0x41e8(%rip), %rsi      # 0xe1e8
callq 0xa6d0
testb $0x1, %al
jne 0xa00b
jmp 0xa027
movq -0xc8(%rbp), %rax
movb $0x1, -0x28(%rbp)
movl 0x54(%rax), %ecx
movl %ecx, -0x24(%rbp)
movl 0x54(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x54(%rax)
jmp 0xa05c
movq -0xd8(%rbp), %rdi
leaq 0x419a(%rip), %rsi      # 0xe1cf
callq 0xa6d0
testb $0x1, %al
jne 0xa040
jmp 0xa05a
movq -0xc8(%rbp), %rax
movb $0x2, -0x28(%rbp)
movl 0x58(%rax), %ecx
movl %ecx, -0x24(%rbp)
movl 0x58(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x58(%rax)
jmp 0xa05c
jmp 0xa05e
movq -0xc8(%rbp), %rax
movq %rax, %rdi
addq $0x8, %rdi
movslq (%rax), %rsi
callq 0xa620
movq -0xd0(%rbp), %rsi
movq %rax, -0xf8(%rbp)
leaq -0x58(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
leaq -0x28(%rbp), %rdx
callq 0xa740
movq -0xf8(%rbp), %rdi
movq -0xf0(%rbp), %rsi
callq 0xa700
movb %dl, -0xe1(%rbp)
movq %rax, -0xe0(%rbp)
jmp 0xa0b8
movb -0xe1(%rbp), %al
movq -0xe0(%rbp), %rcx
movq %rcx, -0x78(%rbp)
movb %al, -0x70(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xa780
jmp 0xa1d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xa780
jmp 0xa1de
movb $0x1, -0xb9(%rbp)
movl $0x20, %edi
callq 0x2120
movq -0xd0(%rbp), %rdx
movq %rax, -0x100(%rbp)
leaq 0x4108(%rip), %rsi      # 0xe222
leaq -0xb8(%rbp), %rdi
callq 0xa7a0
jmp 0xa128
leaq 0x40f5(%rip), %rdx      # 0xe224
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x6db0
jmp 0xa144
movq -0x100(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x6400
jmp 0xa159
movq -0x100(%rbp), %rdi
movb $0x0, -0xb9(%rbp)
leaq 0xac42(%rip), %rsi      # 0x14db0
leaq -0x6845(%rip), %rdx     # 0x3930
callq 0x2370
jmp 0xa1e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xa1bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xa1b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x2160
leaq -0xb8(%rbp), %rdi
callq 0x2160
testb $0x1, -0xb9(%rbp)
jne 0xa1c7
jmp 0xa1d3
movq -0x100(%rbp), %rdi
callq 0x21b0
jmp 0xa1de
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x2390
nopw (%rax,%rax)