// File: /workspace/github_cpp_makefile_star2_O1/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, %r15d
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x131f8(%rip), %rdi     # 0x1f418
movq %rbx, %rsi
callq 0xd3ec
movq %rax, %r12
movq %rbx, %rdi
callq 0xc031
testb %al, %al
je 0xc27f
leaq -0x250(%rbp), %rdi
callq 0x31a0
leaq -0x240(%rbp), %r14
leaq 0xa40f(%rip), %rsi      # 0x16660
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 0xc2d9
testb %r15b, %r15b
je 0xc3e2
leaq 0x13191(%rip), %rax     # 0x1f420
cmpq %rax, %r12
je 0xc31d
leaq -0x250(%rbp), %rdi
callq 0x31a0
leaq -0x240(%rbp), %rdi
movl 0x40(%r12), %esi
callq 0x3450
leaq 0xa3ab(%rip), %rsi      # 0x16667
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 0xc2f9
callq 0x3230
movq 0x12c98(%rip), %rsi     # 0x1ef98
leaq -0x250(%rbp), %rdi
callq 0x31c0
leaq -0x1d0(%rbp), %rdi
callq 0x30c0
jmp 0xc585
testb %r15b, %r15b
je 0xc3e2
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 0x130c4(%rip), %eax     # 0x1f414
movl %eax, 0x20(%r14)
leaq 0x130bd(%rip), %rdi     # 0x1f418
movq %r14, %rsi
callq 0xd1f2
movq -0x250(%rbp), %rdi
cmpq %r15, %rdi
je 0xc374
callq 0x3230
leaq -0x250(%rbp), %rdi
callq 0x31a0
leaq -0x240(%rbp), %rdi
movl 0x13087(%rip), %esi     # 0x1f414
callq 0x3450
leaq 0xa2ce(%rip), %rsi      # 0x16667
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 0xc3d6
callq 0x3230
addl $0x8, 0x13037(%rip)     # 0x1f414
jmp 0xc2f9
movq (%rbx), %rsi
cmpb $0x22, (%rsi)
jne 0xc537
movq 0x8(%rbx), %rax
cmpb $0x22, -0x1(%rsi,%rax)
jne 0xc537
movq %r14, %rdi
movq %rbx, %rsi
callq 0xcfdc
movq %r14, %rdi
movq %rax, %rsi
callq 0xd08e
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 0x9d46(%rip), %rsi      # 0x1618f
movl $0x2, %edx
movq %r15, %rdi
callq 0x32b0
movl 0x12fec(%rip), %esi     # 0x1f448
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 0x9233
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0xc4db
callq 0x3230
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0xc4e9
callq 0x3230
incl 0x12f59(%rip)           # 0x1f448
movq 0x12aa2(%rip), %rsi     # 0x1ef98
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 0xc531
callq 0x3230
movq -0x68(%rbp), %rdi
jmp 0xc568
leaq -0xb8(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0xc8(%rbp), %r15
movq %r15, %rdi
callq 0x4baa
movq %r15, %rdi
callq 0xc669
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0xc572
callq 0x3230
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd48a
movq %rbx, %rdi
callq 0xc11a
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc63f
movq %rax, %rbx
movq -0x250(%rbp), %rdi
cmpq %r15, %rdi
jne 0xc634
jmp 0xc661
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0xc5cd
callq 0x3230
jmp 0xc5cd
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0xc5e0
callq 0x3230
jmp 0xc5e0
movq %rax, %rbx
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc600
callq 0x3230
jmp 0xc600
movq %rax, %rbx
jmp 0xc61f
jmp 0xc63f
jmp 0xc63f
movq %rax, %rbx
movq 0x12991(%rip), %rsi     # 0x1ef98
leaq -0x250(%rbp), %rdi
callq 0x31c0
leaq -0x1d0(%rbp), %rdi
callq 0x30c0
movq -0x68(%rbp), %rdi
jmp 0xc62f
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0xc661
callq 0x3230
jmp 0xc661
jmp 0xc63f
jmp 0xc63f
movq %rax, %rbx
movq 0x1294f(%rip), %rsi     # 0x1ef98
leaq -0x250(%rbp), %rdi
callq 0x31c0
leaq -0x1d0(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3470