// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x124a5(%rip), %rdi     # 0x1c3d8
movq %rbx, %rsi
callq 0xb09a
movq %rax, %r15
movq %rbx, %rdi
callq 0x9e33
testb %al, %al
je 0x9f86
leaq -0x248(%rbp), %rdi
callq 0x3180
leaq -0x238(%rbp), %rdi
leaq 0x86e1(%rip), %rsi      # 0x12645
callq 0x31f0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x31d0
leaq -0x230(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x3380
jmp 0x9fd6
testb %r12b, %r12b
je 0x9ffe
leaq 0x1244e(%rip), %rax     # 0x1c3e0
cmpq %rax, %r15
je 0xa129
leaq -0x248(%rbp), %rdi
callq 0x3180
leaq -0x238(%rbp), %rdi
movl 0x40(%r15), %esi
callq 0x33d0
leaq 0x868e(%rip), %rsi      # 0x1264c
movq %rax, %rdi
callq 0x31f0
leaq -0x230(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x3380
leaq -0x40(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32b0
movq %r14, %rdi
callq 0x3448
leaq -0x248(%rbp), %rdi
callq 0x3190
jmp 0xa119
movq (%rbx), %rax
cmpb $0x22, (%rax)
jne 0xa0e0
movq 0x8(%rbx), %rcx
cmpb $0x22, -0x1(%rax,%rcx)
jne 0xa0e0
movq %r14, %rdi
movq %rbx, %rsi
callq 0xab2a
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
callq 0x32f0
leaq -0x248(%rbp), %rdi
callq 0x3180
leaq -0x238(%rbp), %rdi
leaq 0x8125(%rip), %rsi      # 0x1216f
callq 0x31f0
movl 0x123b3(%rip), %esi     # 0x1c408
movq %rax, %rdi
callq 0x33d0
leaq -0x230(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x3380
leaq -0x40(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x32f0
leaq -0xa0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x32f0
leaq -0x40(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
xorl %esi, %esi
callq 0x8184
leaq -0xa0(%rbp), %rdi
callq 0x3448
leaq -0x40(%rbp), %rdi
callq 0x3448
incl 0x12351(%rip)           # 0x1c408
leaq -0x248(%rbp), %rdi
callq 0x3190
leaq -0x80(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x32b0
movq %r15, %rdi
callq 0x3448
leaq -0x60(%rbp), %rdi
jmp 0xa101
leaq -0xc0(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x32f0
movq %r15, %rdi
callq 0xa242
leaq -0xc0(%rbp), %rdi
callq 0x3448
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb124
movq %rbx, %rdi
callq 0x9e6f
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x122a4(%rip), %rdx     # 0x1c3d4
leaq -0x248(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xaa3a
leaq 0x1228f(%rip), %rdi     # 0x1c3d8
movq %r14, %rsi
callq 0xadba
leaq -0x248(%rbp), %rdi
callq 0x3448
leaq -0x248(%rbp), %rdi
callq 0x3180
leaq -0x238(%rbp), %rdi
movl 0x1225e(%rip), %esi     # 0x1c3d4
callq 0x33d0
leaq 0x84ca(%rip), %rsi      # 0x1264c
movq %rax, %rdi
callq 0x31f0
leaq -0x230(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x3380
leaq -0x40(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32b0
movq %r14, %rdi
callq 0x3448
addl $0x8, 0x1221c(%rip)     # 0x1c3d4
jmp 0x9fed
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x3448
jmp 0xa1d1
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x3448
jmp 0xa1df
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x3448
jmp 0xa202
movq %rax, %rbx
jmp 0xa20e
jmp 0xa22b
movq %rax, %rbx
leaq -0x248(%rbp), %rdi
jmp 0xa220
jmp 0xa22b
movq %rax, %rbx
leaq -0x248(%rbp), %rdi
callq 0x3190
leaq -0x60(%rbp), %rdi
jmp 0xa220
jmp 0xa22b
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x3448
jmp 0xa23a
jmp 0xa22b
jmp 0xa22b
movq %rax, %rbx
leaq -0x248(%rbp), %rdi
callq 0x3190
movq %rbx, %rdi
callq 0x33f0