// File: /workspace/github_cpp_makefile_star2_O2/SunriseFox[P]very-simple-c-compiler/./src/asm.cpp
// Function: getRegNum(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int getRegNum(const string& reg) {

    if (reg.size() > 0 && reg.at(0) != '%')
        return -1;

    string tmp;
    if (reg.find("ax") != string::npos || reg.find("al") != string::npos) return 0;
    if (reg.find("bx") != string::npos || reg.find("bl") != string::npos) return 1;
    if (reg.find("cx") != string::npos || reg.find("cl") != string::npos) return 2;
    if (reg.find("dx") != string::npos || reg.find("dl") != string::npos) return 3;

    if (reg.find("si") != string::npos) return 4;
    if (reg.find("di") != string::npos) return 5;

    if (reg.find("8") != string::npos) return 6;
    if (reg.find("9") != string::npos) return 7;
    if (reg.find("10") != string::npos) return 8;
    if (reg.find("11") != string::npos) return 9;
    if (reg.find("12") != string::npos) return 10;
    if (reg.find("13") != string::npos) return 11;
    if (reg.find("14") != string::npos) return 12;
    if (reg.find("15") != string::npos) return 13;

    cerr << "unknown reg" << endl;
    throw 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x3ad5
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3260
cmpb $0x25, (%rax)
jne 0x3bee
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x76fd(%rip), %rsi      # 0xb1ea
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
jne 0x3cf6
leaq 0x768a(%rip), %rsi      # 0xb195
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
jne 0x3cf6
leaq 0x76c6(%rip), %rsi      # 0xb1ef
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
pushq $0x1
popq %r14
cmpq $-0x1, %rax
jne 0x3cf6
leaq 0x7651(%rip), %rsi      # 0xb199
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
jne 0x3cf6
leaq 0x7691(%rip), %rsi      # 0xb1f4
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
pushq $0x2
popq %r14
cmpq $-0x1, %rax
jne 0x3cf6
leaq 0x761b(%rip), %rsi      # 0xb19d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
jne 0x3cf6
leaq 0x765c(%rip), %rsi      # 0xb1f9
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
pushq $0x3
popq %r14
cmpq $-0x1, %rax
jne 0x3cf6
leaq 0x75e5(%rip), %rsi      # 0xb1a1
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
jne 0x3cf6
leaq 0x7627(%rip), %rsi      # 0xb1fe
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
je 0x3bf7
pushq $0x4
jmp 0x3cf4
pushq $-0x1
popq %r14
jmp 0x3d00
leaq 0x7605(%rip), %rsi      # 0xb203
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
je 0x3c15
pushq $0x5
jmp 0x3cf4
leaq 0x7638(%rip), %rsi      # 0xb254
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
je 0x3c33
pushq $0x6
jmp 0x3cf4
leaq 0x761e(%rip), %rsi      # 0xb258
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
je 0x3c51
pushq $0x7
jmp 0x3cf4
leaq 0x7604(%rip), %rsi      # 0xb25c
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
je 0x3c6f
pushq $0x8
jmp 0x3cf4
leaq 0x75eb(%rip), %rsi      # 0xb261
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
je 0x3c8a
pushq $0x9
jmp 0x3cf4
leaq 0x75d5(%rip), %rsi      # 0xb266
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
je 0x3ca5
pushq $0xa
jmp 0x3cf4
leaq 0x75bf(%rip), %rsi      # 0xb26b
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
je 0x3cc0
pushq $0xb
jmp 0x3cf4
leaq 0x75a9(%rip), %rsi      # 0xb270
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
je 0x3cdb
pushq $0xc
jmp 0x3cf4
leaq 0x7593(%rip), %rsi      # 0xb275
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33f0
cmpq $-0x1, %rax
je 0x3d0b
pushq $0xd
popq %r14
leaq 0x8(%rsp), %rdi
callq 0x30f0
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq 0xe2de(%rip), %rdi      # 0x11ff0
leaq 0x757a(%rip), %rsi      # 0xb293
callq 0x31d0
movq %rax, %rdi
callq 0x3100
pushq $0x4
popq %rdi
callq 0x3110
andl $0x0, (%rax)
movq 0xe260(%rip), %rsi      # 0x11f98
movq %rax, %rdi
xorl %edx, %edx
callq 0x3360
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x30f0
movq %rbx, %rdi
callq 0x3390