// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x3b79
movq (%rbx), %rax
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpb $0x25, (%rax)
jne 0x3e28
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x9665(%rip), %rsi      # 0xd1fa
xorl %r14d, %r14d
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x95ed(%rip), %rsi      # 0xd1a5
xorl %r14d, %r14d
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x9624(%rip), %rsi      # 0xd1ff
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
movl $0x1, %r14d
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x95a8(%rip), %rsi      # 0xd1a9
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x95e3(%rip), %rsi      # 0xd204
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
movl $0x2, %r14d
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x9566(%rip), %rsi      # 0xd1ad
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x95a2(%rip), %rsi      # 0xd209
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
movl $0x3, %r14d
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x9524(%rip), %rsi      # 0xd1b1
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x9561(%rip), %rsi      # 0xd20e
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
movl $0x4, %r14d
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x9540(%rip), %rsi      # 0xd213
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
movl $0x5, %r14d
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x956b(%rip), %rsi      # 0xd264
movl $0x1, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
movl $0x6, %r14d
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x9549(%rip), %rsi      # 0xd268
movl $0x1, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
movl $0x7, %r14d
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x9527(%rip), %rsi      # 0xd26c
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
movl $0x8, %r14d
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x9506(%rip), %rsi      # 0xd271
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
movl $0x9, %r14d
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x94e5(%rip), %rsi      # 0xd276
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
movl $0xa, %r14d
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x94c8(%rip), %rsi      # 0xd27b
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
movl $0xb, %r14d
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x94ab(%rip), %rsi      # 0xd280
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
movl $0xc, %r14d
cmpq $-0x1, %rax
jne 0x3e12
leaq 0x948e(%rip), %rsi      # 0xd285
movl $0x2, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x33b0
movl $0xd, %r14d
cmpq $-0x1, %rax
je 0x3e35
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3e28
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3200
movl %r14d, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0xf1b4(%rip), %rdi      # 0x12ff0
leaq 0x9460(%rip), %rsi      # 0xd2a3
movl $0xb, %edx
callq 0x3260
movq 0xf19c(%rip), %rdi      # 0x12ff0
callq 0x3100
movl $0x4, %edi
callq 0x3110
movl $0x0, (%rax)
movq 0xf128(%rip), %rsi      # 0x12f98
movq %rax, %rdi
xorl %edx, %edx
callq 0x3390
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3e93
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x33d0