// File: /workspace/github_cpp_makefile_star2_O3/olly-larkin[P]mips-parser/src/instructionList.cpp
// Function: R_TYPE(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, std::vector<OP_TYPE, std::allocator<OP_TYPE>> const&, int, int)
uint32_t R_TYPE(std::vector<std::string>& argVec, const std::vector<OP_TYPE>& opcodes, int fn, int pc) {
    uint32_t returnNum = fn;
    std::vector<int> index;
    for(int i = 0; i < opcodes.size(); ++i) {
        if (opcodes[i] == $s || opcodes[i] == $t || opcodes[i] == $d)
            index.push_back(i+1);
    }
    if (!regCheck(argVec, index))
        exitError("Invalid register input \"" + giveStr(argVec) + "\" on instruction number " + std::to_string(pc+1), 5);
    for(int i = 0; i < opcodes.size(); ++i) {
        switch(opcodes[i]) {
            case shAmt:
                int32_t shAmtNum;
                if (!validIntStr(argVec[i+1], shAmtNum))
                    exitError("Invalid instruction argument \"" + giveStr(argVec) + "\" on instruction number " + std::to_string(pc+1), 5);
                returnNum = returnNum | ((shAmtNum & 0x1F) << 6);
                break;
            case $d:
                returnNum = returnNum | ((regMap[argVec[i+1]] & 0x1F) << 11);
                break;
            case $t:
                returnNum = returnNum | ((regMap[argVec[i+1]] & 0x1F) << 16);
                break;
            case $s:
                returnNum = returnNum | ((regMap[argVec[i+1]] & 0x1F) << 21);
                break;
            default:
                break;
        }
    }
    return returnNum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rcx, -0xa8(%rbp)
movl %edx, -0x2c(%rbp)
movq %rsi, %r12
movq %rdi, -0x38(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
movq $0x0, -0x90(%rbp)
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
cmpq %rax, %rcx
je 0x6896
xorl %r15d, %r15d
leaq -0xa0(%rbp), %rbx
leaq -0x58(%rbp), %r13
cmpl $0x3, (%rax,%r15,4)
jae 0x686e
incq %r15
movl %r15d, -0x58(%rbp)
movq -0x98(%rbp), %rsi
cmpq -0x90(%rbp), %rsi
je 0x6873
movl %r15d, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x98(%rbp)
jmp 0x6887
incq %r15
jmp 0x6887
movq %rbx, %rdi
movq %r13, %rdx
callq 0xa060
movq (%r12), %rax
movq 0x8(%r12), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r15, %rdx
ja 0x6840
leaq -0xa0(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x6709
testb %al, %al
je 0x6a62
movq (%r12), %rax
cmpq %rax, 0x8(%r12)
je 0x69d9
movl $0x20, %r13d
xorl %r15d, %r15d
leaq -0x128(%rbp), %rbx
movl (%rax,%r15,4), %eax
cmpq $0x3, %rax
ja 0x69b9
leaq 0x4a5a(%rip), %rcx      # 0xb33c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x38(%rbp), %rax
movq (%rax), %rsi
addq %r13, %rsi
leaq 0x897c(%rip), %rdi      # 0xf278
callq 0x4e78
movl (%rax), %eax
andl $0x1f, %eax
shll $0x15, %eax
jmp 0x69b6
movq -0x38(%rbp), %rax
movq (%rax), %rsi
addq %r13, %rsi
leaq 0x8959(%rip), %rdi      # 0xf278
callq 0x4e78
movl (%rax), %eax
shll $0xb, %eax
movzwl %ax, %eax
jmp 0x69b6
movq -0x38(%rbp), %rax
movq (%rax), %rax
leaq -0x118(%rbp), %rcx
movq %rcx, -0x128(%rbp)
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x40ca
movq %rbx, %r14
movq %rbx, %rdi
leaq -0x7c(%rbp), %rsi
callq 0x4168
movl %eax, %ebx
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x6983
callq 0x21f0
testb %bl, %bl
je 0x69ff
movl -0x7c(%rbp), %eax
andl $0x1f, %eax
shll $0x6, %eax
orl %eax, -0x2c(%rbp)
movq %r14, %rbx
jmp 0x69b9
movq -0x38(%rbp), %rax
movq (%rax), %rsi
addq %r13, %rsi
leaq 0x88cf(%rip), %rdi      # 0xf278
callq 0x4e78
movl (%rax), %eax
andl $0x1f, %eax
shll $0x10, %eax
orl %eax, -0x2c(%rbp)
incq %r15
movq (%r12), %rax
movq 0x8(%r12), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
addq $0x20, %r13
cmpq %r15, %rcx
ja 0x68cd
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x69ea
callq 0x21f0
movl -0x2c(%rbp), %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x160(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x62c6
leaq -0x148(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x6612
leaq 0x4a2b(%rip), %rcx      # 0xb454
leaq -0x148(%rbp), %rdi
movl $0x1e, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x2240
leaq -0xd8(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6acc
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x6add
leaq -0x178(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x62c6
leaq -0x148(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x6612
leaq 0x49af(%rip), %rcx      # 0xb43b
leaq -0x148(%rbp), %rdi
movl $0x18, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x2240
leaq -0xd8(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6bba
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x6bcb
movq %rdx, -0xe8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xd8(%rbp)
movq 0x8(%rax), %rdx
leaq -0xe8(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x46c9(%rip), %rsi      # 0xb1cb
callq 0x23b0
leaq -0x48(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6b2a
movups (%rcx), %xmm0
leaq -0x48(%rbp), %rdx
movups %xmm0, (%rdx)
jmp 0x6b35
movq %rdx, -0x58(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x48(%rbp)
movq 0x8(%rax), %rdx
movq %rdx, -0x50(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0xa8(%rbp), %rax
incl %eax
movl %eax, %ebx
negl %ebx
movq %rax, %rsi
cmovsl %eax, %ebx
movl $0x1, %r14d
cmpl $0xa, %ebx
jb 0x6c28
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebx, %ecx
cmpl $0x63, %ecx
jbe 0x6c1f
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x6c25
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x6c28
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x6b7b
addl $-0x3, %r14d
jmp 0x6c28
movq %rdx, -0xe8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xd8(%rbp)
movq 0x8(%rax), %rdx
leaq -0xe8(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x45db(%rip), %rsi      # 0xb1cb
callq 0x23b0
leaq -0x48(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6d0e
movups (%rcx), %xmm0
leaq -0x48(%rbp), %rdx
movups %xmm0, (%rdx)
jmp 0x6d19
addl $-0x2, %r14d
jmp 0x6c28
decl %r14d
shrl $0x1f, %esi
movq %rsi, %r12
addl %r14d, %esi
leaq -0x68(%rbp), %r13
movq %r13, -0x10(%r13)
leaq -0x78(%rbp), %rdi
movl $0x2d, %edx
callq 0x2260
movl %r12d, %edi
addq -0x78(%rbp), %rdi
movl %r14d, %esi
movl %ebx, %edx
callq 0x5255
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %r8
movq -0x70(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
leaq -0x48(%rbp), %rsi
cmpq %rsi, %rcx
je 0x6c7a
movq -0x48(%rbp), %rdi
movq -0x78(%rbp), %rsi
cmpq %rdi, %rax
jbe 0x6c96
movl $0xf, %edi
cmpq %r13, %rsi
je 0x6c91
movq -0x68(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x6ca1
leaq -0x58(%rbp), %rdi
callq 0x20d0
jmp 0x6cae
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2240
leaq -0xb8(%rbp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
jne 0x6ccd
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
jmp 0x6cde
movq %rsi, -0xc8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xb8(%rbp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0xc0(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq -0xc8(%rbp), %rdi
movl $0x5, %esi
callq 0x65e4
movq %rdx, -0x58(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x48(%rbp)
movq 0x8(%rax), %rdx
movq %rdx, -0x50(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0xa8(%rbp), %rax
incl %eax
movl %eax, %ebx
negl %ebx
movq %rax, %rsi
cmovsl %eax, %ebx
movl $0x1, %r14d
cmpl $0xa, %ebx
jb 0x6d97
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebx, %ecx
cmpl $0x63, %ecx
jbe 0x6d8e
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x6d94
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x6d97
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x6d5b
addl $-0x3, %r14d
jmp 0x6d97
addl $-0x2, %r14d
jmp 0x6d97
decl %r14d
shrl $0x1f, %esi
movq %rsi, %r12
addl %r14d, %esi
leaq -0x68(%rbp), %r13
movq %r13, -0x10(%r13)
leaq -0x78(%rbp), %rdi
movl $0x2d, %edx
callq 0x2260
movl %r12d, %edi
addq -0x78(%rbp), %rdi
movl %r14d, %esi
movl %ebx, %edx
callq 0x5255
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %r8
movq -0x70(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
leaq -0x48(%rbp), %rsi
cmpq %rsi, %rcx
je 0x6de9
movq -0x48(%rbp), %rdi
movq -0x78(%rbp), %rsi
cmpq %rdi, %rax
jbe 0x6e05
movl $0xf, %edi
cmpq %r13, %rsi
je 0x6e00
movq -0x68(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x6e10
leaq -0x58(%rbp), %rdi
callq 0x20d0
jmp 0x6e1d
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2240
leaq -0xf8(%rbp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
jne 0x6e3c
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
jmp 0x6e4d
movq %rsi, -0x108(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xf8(%rbp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x100(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq -0x108(%rbp), %rdi
movl $0x5, %esi
callq 0x65e4
movq %rax, %rbx
leaq -0xf8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e9a
callq 0x21f0
jmp 0x6e9a
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r13, %rdi
je 0x6ead
callq 0x21f0
jmp 0x6ead
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x6ec4
callq 0x21f0
jmp 0x6ec4
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
cmpq %r15, %rdi
je 0x6f07
callq 0x21f0
jmp 0x6f07
movq %rax, %rbx
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6ef4
callq 0x21f0
jmp 0x6ef4
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r13, %rdi
je 0x6f21
callq 0x21f0
jmp 0x6f21
movq %rax, %rbx
leaq -0x138(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6f38
callq 0x21f0
jmp 0x6f38
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x6f44
callq 0x21f0
jmp 0x6f44
movq %rax, %rbx
leaq -0x178(%rbp), %rdi
jmp 0x6f7f
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
cmpq %r15, %rdi
je 0x6f5c
callq 0x21f0
jmp 0x6f5c
jmp 0x6fa7
movq %rax, %rbx
leaq -0x138(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6f78
callq 0x21f0
jmp 0x6f78
jmp 0x6fa7
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x4072
jmp 0x6faa
jmp 0x6fa7
jmp 0x6fa7
movq %rax, %rbx
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x6faa
callq 0x21f0
jmp 0x6faa
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x6fbb
callq 0x21f0
movq %rbx, %rdi
callq 0x2370