int op_code_det(base, counter) {
  int op_c = 0b1111000000000000;
  int opcode_r = 0;
  opcode_r = base & op_c;
  if (opcode_r == 0b0001000000000000) {
    add_and(base);
  } else if (opcode_r == 0b0101000000000000) {
    add_and(base);
  } else if (opcode_r == 0b1100000000000000) {
    jmp(base);
  } else if (opcode_r == 0b0000000000000000) {
    br(base, counter);
  } else {
    printf("This is not a currently supported hex code.\n");
  }
}


x86 assembly (clang, -O0):
<op_code_det>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xf000,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1000,-0x14(%rbp)
jne    1181 <op_code_det+0x41>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <add_and@plt>
jmp    11f2 <op_code_det+0xb2>
cmpl   $0x5000,-0x14(%rbp)
jne    119d <op_code_det+0x5d>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <add_and@plt>
jmp    11ed <op_code_det+0xad>
cmpl   $0xc000,-0x14(%rbp)
jne    11b9 <op_code_det+0x79>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1060 <jmp@plt>
jmp    11e8 <op_code_det+0xa8>
cmpl   $0x0,-0x14(%rbp)
jne    11d5 <op_code_det+0x95>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1050 <br@plt>
jmp    11e3 <op_code_det+0xa3>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e8 <op_code_det+0xa8>
jmp    11ed <op_code_det+0xad>
jmp    11f2 <op_code_det+0xb2>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_code_det>:
push   %rax
lea    0x4000(%rdi),%eax
movzwl %ax,%eax
shr    $0xc,%eax
cmp    $0x9,%ax
ja     1175 <op_code_det+0x35>
lea    0xea6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1040 <add_and@plt>
pop    %rcx
ret
xor    %eax,%eax
call   1060 <jmp@plt>
pop    %rcx
ret
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
pop    %rcx
ret
xor    %eax,%eax
call   1050 <br@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"This is not a currently supported hex code.\0A\00"
define i32 @op_code_det(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 61440, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = and i32 %8, %9
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, 4096
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %4
%15 = call i32 (i32, ...) bitcast (i32 (...)* @add_and to i32 (i32, ...)*)(i32 %14)
br label %40
16: ; preds = %2
%17 = load i32, i32* %7
%18 = icmp eq i32 %17, 20480
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* %4
%21 = call i32 (i32, ...) bitcast (i32 (...)* @add_and to i32 (i32, ...)*)(i32 %20)
br label %39
22: ; preds = %16
%23 = load i32, i32* %7
%24 = icmp eq i32 %23, 49152
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* %4
%27 = call i32 (i32, ...) bitcast (i32 (...)* @jmp to i32 (i32, ...)*)(i32 %26)
br label %38
28: ; preds = %22
%29 = load i32, i32* %7
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load i32, i32* %4
%33 = load i32, i32* %5
%34 = call i32 (i32, i32, ...) bitcast (i32 (...)* @br to i32 (i32, i32, ...)*)(i32 %32, i32 %33)
br label %37
35: ; preds = %28
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
br label %37
37: ; preds = %35, %31
br label %38
38: ; preds = %37, %25
br label %39
39: ; preds = %38, %19
br label %40
40: ; preds = %39, %13
%41 = load i32, i32* %3
ret i32 %41
}

LLVM IR (-O2):
@str = [44 x i8] c"This is not a currently supported hex code.\00"
define i32 @op_code_det(i32 %0, i32 %1) {
%3 = trunc i32 %0 to i16
%4 = add i16 %3, 16384
%5 = lshr i16 %4, 12
switch i16 %5, label %14 [
i16 5, label %6
i16 9, label %8
i16 0, label %10
i16 4, label %12
]
6: ; preds = %2
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @add_and to i32 (i32, ...)*)(i32 %0)
br label %16
8: ; preds = %2
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @add_and to i32 (i32, ...)*)(i32 %0)
br label %16
10: ; preds = %2
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @jmp to i32 (i32, ...)*)(i32 %0)
br label %16
12: ; preds = %2
%13 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @br to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
br label %16
14: ; preds = %2
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
br label %16
16: ; preds = %8, %12, %14, %10, %6
ret i32 undef
}