// File: 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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x31b0
cmpq $0x0, %rax
jbe 0x488c
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3320
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x488c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4be0
leaq -0x30(%rbp), %rdi
callq 0x3390
movq -0x10(%rbp), %rdi
leaq 0x1291e(%rip), %rsi     # 0x171be
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
jne 0x48c9
movq -0x10(%rbp), %rdi
leaq 0x128af(%rip), %rsi     # 0x17169
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x48dc
movl $0x0, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq -0x10(%rbp), %rdi
leaq 0x128dc(%rip), %rsi     # 0x171c3
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
jne 0x4910
movq -0x10(%rbp), %rdi
leaq 0x1286c(%rip), %rsi     # 0x1716d
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x4923
movl $0x1, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq -0x10(%rbp), %rdi
leaq 0x1289a(%rip), %rsi     # 0x171c8
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
jne 0x4957
movq -0x10(%rbp), %rdi
leaq 0x12829(%rip), %rsi     # 0x17171
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x496a
movl $0x2, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq -0x10(%rbp), %rdi
leaq 0x12858(%rip), %rsi     # 0x171cd
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
jne 0x499e
movq -0x10(%rbp), %rdi
leaq 0x127e6(%rip), %rsi     # 0x17175
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x49b1
movl $0x3, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq -0x10(%rbp), %rdi
leaq 0x12816(%rip), %rsi     # 0x171d2
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x49de
movl $0x4, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq -0x10(%rbp), %rdi
leaq 0x127ee(%rip), %rsi     # 0x171d7
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x4a0b
movl $0x5, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq -0x10(%rbp), %rdi
leaq 0x12812(%rip), %rsi     # 0x17228
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x4a38
movl $0x6, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq -0x10(%rbp), %rdi
leaq 0x127e9(%rip), %rsi     # 0x1722c
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x4a65
movl $0x7, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq -0x10(%rbp), %rdi
leaq 0x127c0(%rip), %rsi     # 0x17230
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x4a92
movl $0x8, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq -0x10(%rbp), %rdi
leaq 0x12798(%rip), %rsi     # 0x17235
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x4abf
movl $0x9, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq -0x10(%rbp), %rdi
leaq 0x12770(%rip), %rsi     # 0x1723a
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x4aec
movl $0xa, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq -0x10(%rbp), %rdi
leaq 0x12748(%rip), %rsi     # 0x1723f
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x4b19
movl $0xb, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq -0x10(%rbp), %rdi
leaq 0x12720(%rip), %rsi     # 0x17244
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x4b46
movl $0xc, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq -0x10(%rbp), %rdi
leaq 0x126f8(%rip), %rsi     # 0x17249
xorl %eax, %eax
movl %eax, %edx
callq 0x34f0
cmpq $-0x1, %rax
je 0x4b70
movl $0xd, -0x4(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x4bd7
movq 0x1c479(%rip), %rdi     # 0x20ff0
leaq 0x126e9(%rip), %rsi     # 0x17267
callq 0x3240
movq %rax, -0x50(%rbp)
jmp 0x4b89
movq -0x50(%rbp), %rdi
movq 0x1c414(%rip), %rsi     # 0x20fa8
callq 0x3290
jmp 0x4b9b
movl $0x4, %edi
callq 0x3140
movq %rax, %rdi
movl $0x0, (%rdi)
movq 0x1c3db(%rip), %rsi     # 0x20f90
xorl %eax, %eax
movl %eax, %edx
callq 0x3450
jmp 0x4bf2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3180
jmp 0x4be9
leaq -0x30(%rbp), %rdi
callq 0x3180
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3480
nopw %cs:(%rax,%rax)