// File: ELD[P]HackAssembler/src/parser.cpp
// Function: hack::Parser::getCompBits[abi:cxx11]()
std::string Parser::getCompBits()
    {
        if (commandType() != C_COMMAND) {
            return "";
        }

        auto equalPos = _currentCommand.find("=");
        auto semiColonPos = _currentCommand.find(";");

        if (equalPos == std::string::npos && semiColonPos == std::string::npos) {
            return "";
        }

        std::string comp;
        if (equalPos != std::string::npos) {
            comp = _currentCommand.substr(equalPos + 1);
            auto bitPair = CompTable::lookup[comp];
            return bitPair.first + bitPair.second;
        } else if (semiColonPos != std::string::npos) {
            comp = _currentCommand.substr(0, semiColonPos);
            auto bitPair = CompTable::lookup[comp];
            return bitPair.first + bitPair.second;
        }

        return "";
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x148(%rbp)
movq %rdi, %rax
movq %rax, -0x140(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0xa6c0
cmpl $0x2, %eax
je 0xacfd
leaq -0x11(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x6720
movq -0x148(%rbp), %rdi
movq -0x150(%rbp), %rdx
leaq 0x2f5a2(%rip), %rsi     # 0x3a270
callq 0x8200
jmp 0xacd5
leaq -0x11(%rbp), %rdi
callq 0x6480
jmp 0xafe0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x11(%rbp), %rdi
callq 0x6480
jmp 0xaff0
movq -0x138(%rbp), %rdi
addq $0x8, %rdi
leaq 0x2f512(%rip), %rsi     # 0x3a221
xorl %eax, %eax
movl %eax, %edx
callq 0x67f0
movq -0x138(%rbp), %rdi
movq %rax, -0x30(%rbp)
addq $0x8, %rdi
leaq 0x2f4f5(%rip), %rsi     # 0x3a223
xorl %eax, %eax
movl %eax, %edx
callq 0x67f0
movq %rax, -0x38(%rbp)
cmpq $-0x1, -0x30(%rbp)
jne 0xad9d
cmpq $-0x1, -0x38(%rbp)
jne 0xad9d
leaq -0x39(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x6720
movq -0x148(%rbp), %rdi
movq -0x158(%rbp), %rdx
leaq 0x2f502(%rip), %rsi     # 0x3a270
callq 0x8200
jmp 0xad75
leaq -0x39(%rbp), %rdi
callq 0x6480
jmp 0xafe0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x6480
jmp 0xaff0
leaq -0x60(%rbp), %rdi
callq 0x6590
cmpq $-0x1, -0x30(%rbp)
je 0xae92
movq -0x138(%rbp), %rsi
addq $0x8, %rsi
movq -0x30(%rbp), %rdx
incq %rdx
leaq -0x80(%rbp), %rdi
movq $-0x1, %rcx
callq 0x6440
jmp 0xadd5
leaq -0x60(%rbp), %rdi
movq %rdi, -0x168(%rbp)
leaq -0x80(%rbp), %rsi
movq %rsi, -0x170(%rbp)
callq 0x6500
movq -0x170(%rbp), %rdi
callq 0x62b0
movq -0x168(%rbp), %rsi
leaq 0x4aab6(%rip), %rdi     # 0x558c0
callq 0xbce0
movq %rax, -0x160(%rbp)
jmp 0xae18
movq -0x160(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0xbdc0
jmp 0xae2d
movq -0x148(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
leaq -0xc0(%rbp), %rsi
callq 0xbe20
jmp 0xae49
movl $0x1, -0xc4(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0xbea0
jmp 0xafca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xafd5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0xbea0
jmp 0xafd5
cmpq $-0x1, -0x38(%rbp)
je 0xaf67
movq -0x138(%rbp), %rsi
addq $0x8, %rsi
movq -0x38(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0xe8(%rbp), %rdi
callq 0x6440
jmp 0xaebe
leaq -0x60(%rbp), %rdi
movq %rdi, -0x180(%rbp)
leaq -0xe8(%rbp), %rsi
movq %rsi, -0x188(%rbp)
callq 0x6500
movq -0x188(%rbp), %rdi
callq 0x62b0
movq -0x180(%rbp), %rsi
leaq 0x4a9ca(%rip), %rdi     # 0x558c0
callq 0xbce0
movq %rax, -0x178(%rbp)
jmp 0xaf04
movq -0x178(%rbp), %rsi
leaq -0x128(%rbp), %rdi
callq 0xbdc0
jmp 0xaf19
movq -0x148(%rbp), %rdi
leaq -0x108(%rbp), %rdx
leaq -0x128(%rbp), %rsi
callq 0xbe20
jmp 0xaf35
movl $0x1, -0xc4(%rbp)
leaq -0x128(%rbp), %rdi
callq 0xbea0
jmp 0xafca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x128(%rbp), %rdi
callq 0xbea0
jmp 0xafd5
jmp 0xaf69
leaq -0x129(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x6720
movq -0x148(%rbp), %rdi
movq -0x190(%rbp), %rdx
leaq 0x2f2df(%rip), %rsi     # 0x3a270
callq 0x8200
jmp 0xaf98
leaq -0x129(%rbp), %rdi
callq 0x6480
movl $0x1, -0xc4(%rbp)
jmp 0xafca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x129(%rbp), %rdi
callq 0x6480
jmp 0xafd5
leaq -0x60(%rbp), %rdi
callq 0x62b0
jmp 0xafe0
leaq -0x60(%rbp), %rdi
callq 0x62b0
jmp 0xaff0
movq -0x140(%rbp), %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x6710
nopl (%rax)