// File: rofl0r[P]ascc/cc_symboltable.cpp
// Function: symbolTable::get_friendly_name[abi:cxx11](int)
std::string symbolTable::get_friendly_name(int idx) {

    int actualIdx = idx & STYPE_MASK;
    if (actualIdx < 0 || (size_t)actualIdx >= entries.size()) {
        return std::string("(invalid symbol)");
    }
    
    std::string result;
    int mask = idx & (~STYPE_MASK);
    result = entries[actualIdx].sname;
    if (mask & STYPE_POINTER) {
        result = result + std::string("*");
    }
    if (mask & STYPE_DYNARRAY) {
        result = result + std::string("[]");
    }
    if (mask & STYPE_CONST) {
        result = std::string("const ") + result;
    }
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x128(%rbp)
movq %rdi, %rax
movq %rax, -0x120(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x118(%rbp)
movl -0x14(%rbp), %eax
andl $0xfffffff, %eax        # imm = 0xFFFFFFF
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jl 0x1f0ed
movq -0x118(%rbp), %rdi
movslq -0x18(%rbp), %rax
movq %rax, -0x130(%rbp)
addq $0x28, %rdi
callq 0x17e80
movq %rax, %rcx
movq -0x130(%rbp), %rax
cmpq %rcx, %rax
jb 0x1f141
leaq -0x19(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x4680
movq -0x128(%rbp), %rdi
movq -0x138(%rbp), %rdx
leaq 0x14967(%rip), %rsi     # 0x33a79
callq 0x18000
jmp 0x1f119
leaq -0x19(%rbp), %rdi
callq 0x43e0
jmp 0x1f3fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x19(%rbp), %rdi
callq 0x43e0
jmp 0x1f40b
movq -0x128(%rbp), %rdi
movb $0x0, -0x2d(%rbp)
callq 0x4500
movq -0x118(%rbp), %rdi
movl -0x14(%rbp), %eax
andl $0xf0000000, %eax       # imm = 0xF0000000
movl %eax, -0x34(%rbp)
addq $0x28, %rdi
movslq -0x18(%rbp), %rsi
callq 0x17e60
movq -0x128(%rbp), %rdi
movq %rax, %rsi
callq 0x4070
jmp 0x1f181
movl -0x34(%rbp), %eax
andl $0x40000000, %eax       # imm = 0x40000000
cmpl $0x0, %eax
je 0x1f240
leaq -0x79(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x4680
movq -0x140(%rbp), %rdx
leaq 0x1506c(%rip), %rsi     # 0x3421c
leaq -0x78(%rbp), %rdi
callq 0x18000
jmp 0x1f1bb
movq -0x128(%rbp), %rsi
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rdx
callq 0x1fa40
jmp 0x1f1d1
movq -0x128(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x4490
leaq -0x58(%rbp), %rdi
callq 0x4270
leaq -0x78(%rbp), %rdi
callq 0x4270
leaq -0x79(%rbp), %rdi
callq 0x43e0
jmp 0x1f240
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1f3ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1f232
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4270
leaq -0x79(%rbp), %rdi
callq 0x43e0
jmp 0x1f3ed
movl -0x34(%rbp), %eax
andl $0x10000000, %eax       # imm = 0x10000000
cmpl $0x0, %eax
je 0x1f30c
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x4680
movq -0x148(%rbp), %rdx
leaq 0x14818(%rip), %rsi     # 0x33a8a
leaq -0xc0(%rbp), %rdi
callq 0x18000
jmp 0x1f280
movq -0x128(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
callq 0x1fa40
jmp 0x1f29c
movq -0x128(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x4490
leaq -0xa0(%rbp), %rdi
callq 0x4270
leaq -0xc0(%rbp), %rdi
callq 0x4270
leaq -0xc1(%rbp), %rdi
callq 0x43e0
jmp 0x1f30c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1f2fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x4270
leaq -0xc1(%rbp), %rdi
callq 0x43e0
jmp 0x1f3ed
movl -0x34(%rbp), %eax
andl $0x20000000, %eax       # imm = 0x20000000
cmpl $0x0, %eax
je 0x1f3d5
leaq -0x109(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x4680
movq -0x150(%rbp), %rdx
leaq 0x1474f(%rip), %rsi     # 0x33a8d
leaq -0x108(%rbp), %rdi
callq 0x18000
jmp 0x1f34c
movq -0x128(%rbp), %rdx
leaq -0xe8(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x1fa90
jmp 0x1f368
movq -0x128(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x4490
leaq -0xe8(%rbp), %rdi
callq 0x4270
leaq -0x108(%rbp), %rdi
callq 0x4270
leaq -0x109(%rbp), %rdi
callq 0x43e0
jmp 0x1f3d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1f3c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x4270
leaq -0x109(%rbp), %rdi
callq 0x43e0
jmp 0x1f3ed
movb $0x1, -0x2d(%rbp)
testb $0x1, -0x2d(%rbp)
jne 0x1f3eb
movq -0x128(%rbp), %rdi
callq 0x4270
jmp 0x1f3fb
movq -0x128(%rbp), %rdi
callq 0x4270
jmp 0x1f40b
movq -0x120(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x4670
nopw %cs:(%rax,%rax)