#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ BlockDataTransfer(unsigned int);
int /*<<< orphan*/ Branch(unsigned int, unsigned int);
int /*<<< orphan*/ BranchExchange(unsigned int);
int /*<<< orphan*/ DataProcessing(unsigned int);
int /*<<< orphan*/ LoadStore(unsigned int);
int /*<<< orphan*/ Multiply(unsigned int);
int /*<<< orphan*/ SoftwareInterupt(unsigned int);
void DecodeInstruction(unsigned int instr, unsigned int instrAddress) {
  if (((instr & 0x0F000000) >> 24) == 0xF)
    SoftwareInterupt(instr);
  else if (((instr & 0x0F000000) >> 25) == 0x5)
    Branch(instr, instrAddress);
  else if ((((instr & 0x0FF00000) >> 22) == 0x0) &&
           (((instr & 0x000000F0) >> 4) == 0x9))
    Multiply(instr);
  else if (((instr & 0x0F000000) >> 26) == 0x0)
    DataProcessing(instr);
  else if (((instr & 0x0F000000) >> 26) == 0x1)
    LoadStore(instr);
  else if (((instr & 0x0F000000) >> 25) == 0x4)
    BlockDataTransfer(instr);
  else if (((instr & 0x0FFFFFF0) >> 4) == 0x12FFF1)
    BranchExchange(instr);
}


x86 assembly (clang, -O0):
<DecodeInstruction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf000000,%eax
shr    $0x18,%eax
cmp    $0xf,%eax
jne    119f <DecodeInstruction+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <SoftwareInterupt@plt>
jmp    1297 <DecodeInstruction+0x127>
mov    -0x4(%rbp),%eax
and    $0xf000000,%eax
shr    $0x19,%eax
cmp    $0x5,%eax
jne    11c3 <DecodeInstruction+0x53>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1080 <Branch@plt>
jmp    1292 <DecodeInstruction+0x122>
mov    -0x4(%rbp),%eax
and    $0xff00000,%eax
shr    $0x16,%eax
cmp    $0x0,%eax
jne    11f8 <DecodeInstruction+0x88>
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
shr    $0x4,%eax
cmp    $0x9,%eax
jne    11f8 <DecodeInstruction+0x88>
mov    -0x4(%rbp),%edi
call   1060 <Multiply@plt>
jmp    128d <DecodeInstruction+0x11d>
mov    -0x4(%rbp),%eax
and    $0xf000000,%eax
shr    $0x1a,%eax
cmp    $0x0,%eax
jne    1219 <DecodeInstruction+0xa9>
mov    -0x4(%rbp),%edi
call   1050 <DataProcessing@plt>
jmp    1288 <DecodeInstruction+0x118>
mov    -0x4(%rbp),%eax
and    $0xf000000,%eax
shr    $0x1a,%eax
cmp    $0x1,%eax
jne    123a <DecodeInstruction+0xca>
mov    -0x4(%rbp),%edi
call   1070 <LoadStore@plt>
jmp    1283 <DecodeInstruction+0x113>
mov    -0x4(%rbp),%eax
and    $0xf000000,%eax
shr    $0x19,%eax
cmp    $0x4,%eax
jne    125b <DecodeInstruction+0xeb>
mov    -0x4(%rbp),%edi
call   1040 <BlockDataTransfer@plt>
jmp    127e <DecodeInstruction+0x10e>
mov    -0x4(%rbp),%eax
and    $0xffffff0,%eax
shr    $0x4,%eax
cmp    $0x12fff1,%eax
jne    1279 <DecodeInstruction+0x109>
mov    -0x4(%rbp),%edi
call   1090 <BranchExchange@plt>
jmp    127e <DecodeInstruction+0x10e>
jmp    1283 <DecodeInstruction+0x113>
jmp    1288 <DecodeInstruction+0x118>
jmp    128d <DecodeInstruction+0x11d>
jmp    1292 <DecodeInstruction+0x122>
jmp    1297 <DecodeInstruction+0x127>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecodeInstruction>:
mov    %edi,%ecx
and    $0xf000000,%ecx
cmp    $0xf000000,%ecx
jne    1185 <DecodeInstruction+0x15>
jmp    1030 <SoftwareInterupt@plt>
mov    %ecx,%eax
shr    $0x19,%eax
cmp    $0x5,%eax
jne    1194 <DecodeInstruction+0x24>
jmp    1080 <Branch@plt>
mov    %edi,%edx
and    $0xfc000f0,%edx
cmp    $0x90,%edx
jne    11a9 <DecodeInstruction+0x39>
jmp    1060 <Multiply@plt>
cmp    $0x3ffffff,%ecx
ja     11b6 <DecodeInstruction+0x46>
jmp    1050 <DataProcessing@plt>
mov    %edi,%ecx
and    $0xc000000,%ecx
cmp    $0x4000000,%ecx
jne    11cb <DecodeInstruction+0x5b>
jmp    1070 <LoadStore@plt>
cmp    $0x4,%eax
jne    11d5 <DecodeInstruction+0x65>
jmp    1040 <BlockDataTransfer@plt>
mov    %edi,%eax
and    $0xffffff0,%eax
cmp    $0x12fff10,%eax
jne    11e8 <DecodeInstruction+0x78>
jmp    1090 <BranchExchange@plt>
ret

LLVM IR (-O0):
define void @DecodeInstruction(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 251658240
%7 = lshr i32 %6, 24
%8 = icmp eq i32 %7, 15
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %3
%11 = call i32 @SoftwareInterupt(i32 %10)
br label %72
12: ; preds = %2
%13 = load i32, i32* %3
%14 = and i32 %13, 251658240
%15 = lshr i32 %14, 25
%16 = icmp eq i32 %15, 5
br i1 %16, label %17, label %21
17: ; preds = %12
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 @Branch(i32 %18, i32 %19)
br label %71
21: ; preds = %12
%22 = load i32, i32* %3
%23 = and i32 %22, 267386880
%24 = lshr i32 %23, 22
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %34
26: ; preds = %21
%27 = load i32, i32* %3
%28 = and i32 %27, 240
%29 = lshr i32 %28, 4
%30 = icmp eq i32 %29, 9
br i1 %30, label %31, label %34
31: ; preds = %26
%32 = load i32, i32* %3
%33 = call i32 @Multiply(i32 %32)
br label %70
34: ; preds = %26, %21
%35 = load i32, i32* %3
%36 = and i32 %35, 251658240
%37 = lshr i32 %36, 26
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %34
%40 = load i32, i32* %3
%41 = call i32 @DataProcessing(i32 %40)
br label %69
42: ; preds = %34
%43 = load i32, i32* %3
%44 = and i32 %43, 251658240
%45 = lshr i32 %44, 26
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %50
47: ; preds = %42
%48 = load i32, i32* %3
%49 = call i32 @LoadStore(i32 %48)
br label %68
50: ; preds = %42
%51 = load i32, i32* %3
%52 = and i32 %51, 251658240
%53 = lshr i32 %52, 25
%54 = icmp eq i32 %53, 4
br i1 %54, label %55, label %58
55: ; preds = %50
%56 = load i32, i32* %3
%57 = call i32 @BlockDataTransfer(i32 %56)
br label %67
58: ; preds = %50
%59 = load i32, i32* %3
%60 = and i32 %59, 268435440
%61 = lshr i32 %60, 4
%62 = icmp eq i32 %61, 1245169
br i1 %62, label %63, label %66
63: ; preds = %58
%64 = load i32, i32* %3
%65 = call i32 @BranchExchange(i32 %64)
br label %66
66: ; preds = %63, %58
br label %67
67: ; preds = %66, %55
br label %68
68: ; preds = %67, %47
br label %69
69: ; preds = %68, %39
br label %70
70: ; preds = %69, %31
br label %71
71: ; preds = %70, %17
br label %72
72: ; preds = %71, %9
ret void
}

LLVM IR (-O2):
define void @DecodeInstruction(i32 %0, i32 %1) {
%3 = and i32 %0, 251658240
%4 = icmp eq i32 %3, 251658240
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @SoftwareInterupt(i32 %0)
br label %35
7: ; preds = %2
%8 = lshr i32 %3, 25
%9 = icmp eq i32 %8, 5
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @Branch(i32 %0, i32 %1)
br label %35
12: ; preds = %7
%13 = and i32 %0, 264241392
%14 = icmp eq i32 %13, 144
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 @Multiply(i32 %0)
br label %35
17: ; preds = %12
%18 = icmp ult i32 %3, 67108864
br i1 %18, label %19, label %21
19: ; preds = %17
%20 = tail call i32 @DataProcessing(i32 %0)
br label %35
21: ; preds = %17
%22 = and i32 %0, 201326592
%23 = icmp eq i32 %22, 67108864
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = tail call i32 @LoadStore(i32 %0)
br label %35
26: ; preds = %21
%27 = icmp eq i32 %8, 4
br i1 %27, label %28, label %30
28: ; preds = %26
%29 = tail call i32 @BlockDataTransfer(i32 %0)
br label %35
30: ; preds = %26
%31 = and i32 %0, 268435440
%32 = icmp eq i32 %31, 19922704
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = tail call i32 @BranchExchange(i32 %0)
br label %35
35: ; preds = %10, %19, %28, %33, %30, %24, %15, %5
ret void
}