// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movslq (%rdi), %rax
leaq (%rax,%rax,2), %rdi
shlq $0x4, %rdi
addq 0x8(%rbx), %rdi
callq 0x5b44
movslq (%rbx), %rcx
movq 0x8(%rbx), %rdx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
addq %rdx, %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
jne 0x516d
leaq 0x2186(%rip), %rsi      # 0x721d
movq %r15, %rdi
callq 0x2070
testl %eax, %eax
je 0x50ce
leaq 0x2185(%rip), %rsi      # 0x722f
movq %r15, %rdi
callq 0x2070
testl %eax, %eax
je 0x50df
leaq 0x2159(%rip), %rsi      # 0x7216
movq %r15, %rdi
callq 0x2070
testl %eax, %eax
je 0x50f3
xorl %r13d, %r13d
jmp 0x5105
movl 0x50(%rbx), %r12d
leal 0x1(%r12), %eax
movl %eax, 0x50(%rbx)
xorl %r13d, %r13d
jmp 0x5105
movl 0x54(%rbx), %r12d
leal 0x1(%r12), %eax
movl %eax, 0x54(%rbx)
movl $0x1, %r13d
jmp 0x5105
movl 0x58(%rbx), %r12d
leal 0x1(%r12), %eax
movl %eax, 0x58(%rbx)
movl $0x2, %r13d
movslq (%rbx), %rax
leaq (%rax,%rax,2), %r15
shlq $0x4, %r15
addq 0x8(%rbx), %r15
leaq 0x10(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x3344
shlq $0x20, %r12
orq %r13, %r12
movq %r12, 0x20(%rbx)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5bce
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x515e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2160
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x211f(%rip), %rsi      # 0x72a0
movq %rsp, %rdi
movq %r14, %rdx
callq 0x55cf
leaq 0x210f(%rip), %rsi      # 0x72a2
movq %rsp, %rdi
callq 0x2270
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x51bc
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x51c9
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x36dc
xorl %ebp, %ebp
leaq 0x5bb7(%rip), %rsi      # 0xadb0
leaq -0x2262(%rip), %rdx     # 0x2f9e
movq %rbx, %rdi
callq 0x2240
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x522a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x522a
movq %rax, %r14
movb $0x1, %bpl
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x524d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x524d
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x5275
movq %rbx, %rdi
callq 0x2100
jmp 0x5275
movq %rax, %r14
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x5275
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2160
movq %r14, %rdi
callq 0x2250
nop