// File: /workspace/github_cpp_makefile_star2_O3/johan-bjareholt[P]lua-compiler/src/convert.cc
// Function: formatSymbol(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, bool)
void formatSymbol(std::string& val, std::set<std::string>& symbolTable, bool localScope){
    auto lvar = localVars.find(val);
    if (is_digits(val)){
        std::stringstream tempss;
        tempss << "$" << val;
        val = tempss.str();
	}
    else if (localScope && lvar != localVars.end()){
        std::stringstream tempss;
        tempss << (*lvar).second << "(%%rsp)";
        val = tempss.str();
    }
    else if (localScope){
        localVars.insert(std::make_pair(val, varoffset));
        std::stringstream tmpss;
        tmpss << varoffset << "(%%rsp)";
        val = tmpss.str();
        varoffset+=8;
    }
	else {
        if (is_string(val)){
            symbolTable.erase(val);
            val = newString(val);
        }
        else {
            regVar(val);
        }
	    symbolTable.insert(val);
        add_brackets(val);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1123c(%rip), %rdi     # 0x1d418
movq %rbx, %rsi
callq 0xd390
movq %rax, %r15
movq %rbx, %rdi
callq 0xbfed
testb %al, %al
je 0xc23b
leaq -0x250(%rbp), %rdi
callq 0x31a0
leaq -0x240(%rbp), %r14
leaq 0x9453(%rip), %rsi      # 0x15660
movl $0x1, %edx
movq %r14, %rdi
callq 0x32b0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x32b0
leaq -0x238(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3400
jmp 0xc294
testb %r12b, %r12b
je 0xc2d8
leaq 0x111d5(%rip), %rax     # 0x1d420
cmpq %rax, %r15
je 0xc489
leaq -0x250(%rbp), %rdi
callq 0x31a0
leaq -0x240(%rbp), %rdi
movl 0x40(%r15), %esi
callq 0x3450
leaq 0x93f0(%rip), %rsi      # 0x15667
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
leaq -0x238(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3400
leaq -0x48(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3320
movq (%r14), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xc2b4
callq 0x3230
movq 0x10cdd(%rip), %rsi     # 0x1cf98
leaq -0x250(%rbp), %rdi
callq 0x31c0
leaq -0x1d0(%rbp), %rdi
callq 0x30c0
jmp 0xc477
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
cmpb $0x22, (%rsi)
jne 0xc42d
cmpb $0x22, -0x1(%rsi,%rdx)
jne 0xc42d
movq %r14, %rdi
movq %rbx, %rsi
callq 0xcf80
movq %r14, %rdi
movq %rax, %rsi
callq 0xd03c
leaq -0x58(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x4baa
leaq -0x250(%rbp), %rdi
callq 0x31a0
leaq -0x240(%rbp), %r15
leaq 0x8e50(%rip), %rsi      # 0x1518f
movl $0x2, %edx
movq %r15, %rdi
callq 0x32b0
movl 0x110f6(%rip), %esi     # 0x1d448
movq %r15, %rdi
callq 0x3450
leaq -0x238(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x3400
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x4baa
leaq -0x98(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %rdi
callq 0x4baa
leaq -0x48(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
xorl %esi, %esi
callq 0x91f7
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0xc3d1
callq 0x3230
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0xc3df
callq 0x3230
incl 0x11063(%rip)           # 0x1d448
movq 0x10bac(%rip), %rsi     # 0x1cf98
leaq -0x250(%rbp), %rdi
callq 0x31c0
leaq -0x1d0(%rbp), %rdi
callq 0x30c0
leaq -0x88(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3320
movq (%r15), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xc427
callq 0x3230
movq -0x68(%rbp), %rdi
jmp 0xc45a
leaq -0xb8(%rbp), %r12
movq %r12, -0x10(%r12)
addq %rsi, %rdx
leaq -0xc8(%rbp), %r15
movq %r15, %rdi
callq 0x4baa
movq %r15, %rdi
callq 0xc60d
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0xc464
callq 0x3230
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd42e
movq %rbx, %rdi
callq 0xc0d6
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x240(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x250(%rbp), %r14
movq %r14, %rdi
callq 0x4baa
movl 0x10f61(%rip), %eax     # 0x1d414
movl %eax, 0x20(%r14)
leaq 0x10f5a(%rip), %rdi     # 0x1d418
movq %r14, %rsi
callq 0xd1a0
movq -0x250(%rbp), %rdi
cmpq %r15, %rdi
je 0xc4d7
callq 0x3230
leaq -0x250(%rbp), %rdi
callq 0x31a0
leaq -0x240(%rbp), %rdi
movl 0x10f24(%rip), %esi     # 0x1d414
callq 0x3450
leaq 0x916b(%rip), %rsi      # 0x15667
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
leaq -0x238(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3400
leaq -0x48(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3320
movq (%r14), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xc539
callq 0x3230
addl $0x8, 0x10ed4(%rip)     # 0x1d414
jmp 0xc2b4
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0xc55e
callq 0x3230
jmp 0xc55e
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0xc571
callq 0x3230
jmp 0xc571
movq %rax, %rbx
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc5a2
callq 0x3230
jmp 0xc5a2
movq %rax, %rbx
jmp 0xc5c1
jmp 0xc5e3
movq %rax, %rbx
movq -0x250(%rbp), %rdi
cmpq %r15, %rdi
jne 0xc5d8
jmp 0xc605
jmp 0xc5e3
movq %rax, %rbx
movq 0x109ef(%rip), %rsi     # 0x1cf98
leaq -0x250(%rbp), %rdi
callq 0x31c0
leaq -0x1d0(%rbp), %rdi
callq 0x30c0
movq -0x68(%rbp), %rdi
jmp 0xc5d3
jmp 0xc5e3
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0xc605
callq 0x3230
jmp 0xc605
jmp 0xc5e3
jmp 0xc5e3
movq %rax, %rbx
movq 0x109ab(%rip), %rsi     # 0x1cf98
leaq -0x250(%rbp), %rdi
callq 0x31c0
leaq -0x1d0(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3470