#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ i915_decode_alu1(int *, int, int, char *, char *);
int /*<<< orphan*/ i915_decode_alu2(int *, int, int, char *, char *);
int /*<<< orphan*/ i915_decode_alu3(int *, int, int, char *, char *);
int /*<<< orphan*/ i915_decode_dcl(int *, int, int, char *);
int /*<<< orphan*/ i915_decode_tex(int *, int, int, char *, char *);
int /*<<< orphan*/ instr_out(int *, int, int /*<<< orphan*/, char *, char *);
void i915_decode_instruction(uint32_t *data, uint32_t hw_offset, int i,
                             char *instr_prefix) {
  switch ((data[i] >> 24) & 0x1f) {
  case 0x0:
    instr_out(data, hw_offset, i++, "%s: NOP\n", instr_prefix);
    instr_out(data, hw_offset, i++, "%s\n", instr_prefix);
    instr_out(data, hw_offset, i++, "%s\n", instr_prefix);
    break;
  case 0x01:
    i915_decode_alu2(data, hw_offset, i, instr_prefix, "ADD");
    break;
  case 0x02:
    i915_decode_alu1(data, hw_offset, i, instr_prefix, "MOV");
    break;
  case 0x03:
    i915_decode_alu2(data, hw_offset, i, instr_prefix, "MUL");
    break;
  case 0x04:
    i915_decode_alu3(data, hw_offset, i, instr_prefix, "MAD");
    break;
  case 0x05:
    i915_decode_alu3(data, hw_offset, i, instr_prefix, "DP2ADD");
    break;
  case 0x06:
    i915_decode_alu2(data, hw_offset, i, instr_prefix, "DP3");
    break;
  case 0x07:
    i915_decode_alu2(data, hw_offset, i, instr_prefix, "DP4");
    break;
  case 0x08:
    i915_decode_alu1(data, hw_offset, i, instr_prefix, "FRC");
    break;
  case 0x09:
    i915_decode_alu1(data, hw_offset, i, instr_prefix, "RCP");
    break;
  case 0x0a:
    i915_decode_alu1(data, hw_offset, i, instr_prefix, "RSQ");
    break;
  case 0x0b:
    i915_decode_alu1(data, hw_offset, i, instr_prefix, "EXP");
    break;
  case 0x0c:
    i915_decode_alu1(data, hw_offset, i, instr_prefix, "LOG");
    break;
  case 0x0d:
    i915_decode_alu2(data, hw_offset, i, instr_prefix, "CMP");
    break;
  case 0x0e:
    i915_decode_alu2(data, hw_offset, i, instr_prefix, "MIN");
    break;
  case 0x0f:
    i915_decode_alu2(data, hw_offset, i, instr_prefix, "MAX");
    break;
  case 0x10:
    i915_decode_alu1(data, hw_offset, i, instr_prefix, "FLR");
    break;
  case 0x11:
    i915_decode_alu1(data, hw_offset, i, instr_prefix, "MOD");
    break;
  case 0x12:
    i915_decode_alu1(data, hw_offset, i, instr_prefix, "TRC");
    break;
  case 0x13:
    i915_decode_alu2(data, hw_offset, i, instr_prefix, "SGE");
    break;
  case 0x14:
    i915_decode_alu2(data, hw_offset, i, instr_prefix, "SLT");
    break;
  case 0x15:
    i915_decode_tex(data, hw_offset, i, instr_prefix, "TEXLD");
    break;
  case 0x16:
    i915_decode_tex(data, hw_offset, i, instr_prefix, "TEXLDP");
    break;
  case 0x17:
    i915_decode_tex(data, hw_offset, i, instr_prefix, "TEXLDB");
    break;
  case 0x19:
    i915_decode_dcl(data, hw_offset, i, instr_prefix);
    break;
  default:
    instr_out(data, hw_offset, i++, "%s: unknown\n", instr_prefix);
    instr_out(data, hw_offset, i++, "%s\n", instr_prefix);
    instr_out(data, hw_offset, i++, "%s\n", instr_prefix);
    break;
  }
}


x86 assembly (clang, -O0):
<i915_decode_instruction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl 0x3(%rax,%rcx,4),%eax
and    $0x1f,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x19,%eax
ja     14f5 <i915_decode_instruction+0x395>
mov    -0x20(%rbp),%rax
lea    0xe60(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%r8
lea    0xea2(%rip),%rcx
call   1050 <instr_out@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%r8
lea    0xe89(%rip),%rcx
call   1050 <instr_out@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%r8
lea    0xe67(%rip),%rcx
call   1050 <instr_out@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xe5b(%rip),%r8
call   1040 <i915_decode_alu2@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xe2d(%rip),%r8
call   1060 <i915_decode_alu1@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xe12(%rip),%r8
call   1040 <i915_decode_alu2@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xdf7(%rip),%r8
call   1070 <i915_decode_alu3@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xddc(%rip),%r8
call   1070 <i915_decode_alu3@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xdc4(%rip),%r8
call   1040 <i915_decode_alu2@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xda9(%rip),%r8
call   1040 <i915_decode_alu2@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xd8e(%rip),%r8
call   1060 <i915_decode_alu1@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xd73(%rip),%r8
call   1060 <i915_decode_alu1@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xd58(%rip),%r8
call   1060 <i915_decode_alu1@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xd3d(%rip),%r8
call   1060 <i915_decode_alu1@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xd22(%rip),%r8
call   1060 <i915_decode_alu1@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xd07(%rip),%r8
call   1040 <i915_decode_alu2@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xcec(%rip),%r8
call   1040 <i915_decode_alu2@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xcd1(%rip),%r8
call   1040 <i915_decode_alu2@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xcb6(%rip),%r8
call   1060 <i915_decode_alu1@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xc9b(%rip),%r8
call   1060 <i915_decode_alu1@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xc80(%rip),%r8
call   1060 <i915_decode_alu1@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xc65(%rip),%r8
call   1040 <i915_decode_alu2@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xc4a(%rip),%r8
call   1040 <i915_decode_alu2@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xc2f(%rip),%r8
call   1030 <i915_decode_tex@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xc16(%rip),%r8
call   1030 <i915_decode_tex@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xbfe(%rip),%r8
call   1030 <i915_decode_tex@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1080 <i915_decode_dcl@plt>
jmp    155b <i915_decode_instruction+0x3fb>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%r8
lea    0xbc6(%rip),%rcx
call   1050 <instr_out@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%r8
lea    0xb3d(%rip),%rcx
call   1050 <instr_out@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%r8
lea    0xb1b(%rip),%rcx
call   1050 <instr_out@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i915_decode_instruction>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebx
mov    %esi,%r15d
mov    %rdi,%rbp
movslq %edx,%rax
movzbl 0x3(%rdi,%rax,4),%eax
and    $0x1f,%eax
cmp    $0x19,%eax
ja     12f8 <i915_decode_instruction+0x198>
lea    0xe6f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1(%rbx),%r12d
lea    0xec3(%rip),%rcx
jmp    1303 <i915_decode_instruction+0x1a3>
lea    0xed3(%rip),%r8
jmp    12a3 <i915_decode_instruction+0x143>
lea    0xeb8(%rip),%r8
jmp    1275 <i915_decode_instruction+0x115>
lea    0xeb0(%rip),%r8
jmp    12a3 <i915_decode_instruction+0x143>
lea    0xea8(%rip),%r8
jmp    11de <i915_decode_instruction+0x7e>
lea    0xea3(%rip),%r8
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <i915_decode_alu3@plt>
lea    0xe85(%rip),%r8
jmp    12a3 <i915_decode_instruction+0x143>
lea    0xe7d(%rip),%r8
jmp    12a3 <i915_decode_instruction+0x143>
lea    0xe75(%rip),%r8
jmp    1275 <i915_decode_instruction+0x115>
lea    0xe70(%rip),%r8
jmp    1275 <i915_decode_instruction+0x115>
lea    0xe6b(%rip),%r8
jmp    1275 <i915_decode_instruction+0x115>
lea    0xe66(%rip),%r8
jmp    1275 <i915_decode_instruction+0x115>
lea    0xe61(%rip),%r8
jmp    1275 <i915_decode_instruction+0x115>
lea    0xe5c(%rip),%r8
jmp    12a3 <i915_decode_instruction+0x143>
lea    0xe57(%rip),%r8
jmp    12a3 <i915_decode_instruction+0x143>
lea    0xe52(%rip),%r8
jmp    12a3 <i915_decode_instruction+0x143>
lea    0xe4d(%rip),%r8
jmp    1275 <i915_decode_instruction+0x115>
lea    0xe48(%rip),%r8
jmp    1275 <i915_decode_instruction+0x115>
lea    0xe43(%rip),%r8
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <i915_decode_alu1@plt>
lea    0xe22(%rip),%r8
jmp    12a3 <i915_decode_instruction+0x143>
lea    0xe1d(%rip),%r8
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <i915_decode_alu2@plt>
lea    0xdfc(%rip),%r8
jmp    12da <i915_decode_instruction+0x17a>
lea    0xdf9(%rip),%r8
jmp    12da <i915_decode_instruction+0x17a>
lea    0xdf7(%rip),%r8
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <i915_decode_tex@plt>
lea    0x1(%rbx),%r12d
lea    0xdd5(%rip),%rcx
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %r14,%r8
call   1050 <instr_out@plt>
add    $0x2,%ebx
lea    0xd54(%rip),%r13
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r12d,%edx
mov    %r13,%rcx
mov    %r14,%r8
call   1050 <instr_out@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %r13,%rcx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <instr_out@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <i915_decode_dcl@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s: NOP\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [4 x i8] c"ADD\00"
@.str.3 = [4 x i8] c"MOV\00"
@.str.4 = [4 x i8] c"MUL\00"
@.str.5 = [4 x i8] c"MAD\00"
@.str.6 = [7 x i8] c"DP2ADD\00"
@.str.7 = [4 x i8] c"DP3\00"
@.str.8 = [4 x i8] c"DP4\00"
@.str.9 = [4 x i8] c"FRC\00"
@.str.10 = [4 x i8] c"RCP\00"
@.str.11 = [4 x i8] c"RSQ\00"
@.str.12 = [4 x i8] c"EXP\00"
@.str.13 = [4 x i8] c"LOG\00"
@.str.14 = [4 x i8] c"CMP\00"
@.str.15 = [4 x i8] c"MIN\00"
@.str.16 = [4 x i8] c"MAX\00"
@.str.17 = [4 x i8] c"FLR\00"
@.str.18 = [4 x i8] c"MOD\00"
@.str.19 = [4 x i8] c"TRC\00"
@.str.20 = [4 x i8] c"SGE\00"
@.str.21 = [4 x i8] c"SLT\00"
@.str.22 = [6 x i8] c"TEXLD\00"
@.str.23 = [7 x i8] c"TEXLDP\00"
@.str.24 = [7 x i8] c"TEXLDB\00"
@.str.25 = [13 x i8] c"%s: unknown\0A\00"
define void @i915_decode_instruction(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %7
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = ashr i32 %13, 24
%15 = and i32 %14, 31
switch i32 %15, label %179 [
i32 0, label %16
i32 1, label %35
i32 2, label %41
i32 3, label %47
i32 4, label %53
i32 5, label %59
i32 6, label %65
i32 7, label %71
i32 8, label %77
i32 9, label %83
i32 10, label %89
i32 11, label %95
i32 12, label %101
i32 13, label %107
i32 14, label %113
i32 15, label %119
i32 16, label %125
i32 17, label %131
i32 18, label %137
i32 19, label %143
i32 20, label %149
i32 21, label %155
i32 22, label %161
i32 23, label %167
i32 25, label %173
]
16: ; preds = %4
%17 = load i32*, i32** %5
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = add nsw i32 %19, 1
store i32 %20, i32* %7
%21 = load i8*, i8** %8
%22 = call i32 @instr_out(i32* %17, i32 %18, i32 %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = load i32*, i32** %5
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
%27 = load i8*, i8** %8
%28 = call i32 @instr_out(i32* %23, i32 %24, i32 %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %27)
%29 = load i32*, i32** %5
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
%33 = load i8*, i8** %8
%34 = call i32 @instr_out(i32* %29, i32 %30, i32 %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %33)
br label %198
35: ; preds = %4
%36 = load i32*, i32** %5
%37 = load i32, i32* %6
%38 = load i32, i32* %7
%39 = load i8*, i8** %8
%40 = call i32 @i915_decode_alu2(i32* %36, i32 %37, i32 %38, i8* %39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %198
41: ; preds = %4
%42 = load i32*, i32** %5
%43 = load i32, i32* %6
%44 = load i32, i32* %7
%45 = load i8*, i8** %8
%46 = call i32 @i915_decode_alu1(i32* %42, i32 %43, i32 %44, i8* %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %198
47: ; preds = %4
%48 = load i32*, i32** %5
%49 = load i32, i32* %6
%50 = load i32, i32* %7
%51 = load i8*, i8** %8
%52 = call i32 @i915_decode_alu2(i32* %48, i32 %49, i32 %50, i8* %51, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %198
53: ; preds = %4
%54 = load i32*, i32** %5
%55 = load i32, i32* %6
%56 = load i32, i32* %7
%57 = load i8*, i8** %8
%58 = call i32 @i915_decode_alu3(i32* %54, i32 %55, i32 %56, i8* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %198
59: ; preds = %4
%60 = load i32*, i32** %5
%61 = load i32, i32* %6
%62 = load i32, i32* %7
%63 = load i8*, i8** %8
%64 = call i32 @i915_decode_alu3(i32* %60, i32 %61, i32 %62, i8* %63, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %198
65: ; preds = %4
%66 = load i32*, i32** %5
%67 = load i32, i32* %6
%68 = load i32, i32* %7
%69 = load i8*, i8** %8
%70 = call i32 @i915_decode_alu2(i32* %66, i32 %67, i32 %68, i8* %69, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %198
71: ; preds = %4
%72 = load i32*, i32** %5
%73 = load i32, i32* %6
%74 = load i32, i32* %7
%75 = load i8*, i8** %8
%76 = call i32 @i915_decode_alu2(i32* %72, i32 %73, i32 %74, i8* %75, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %198
77: ; preds = %4
%78 = load i32*, i32** %5
%79 = load i32, i32* %6
%80 = load i32, i32* %7
%81 = load i8*, i8** %8
%82 = call i32 @i915_decode_alu1(i32* %78, i32 %79, i32 %80, i8* %81, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %198
83: ; preds = %4
%84 = load i32*, i32** %5
%85 = load i32, i32* %6
%86 = load i32, i32* %7
%87 = load i8*, i8** %8
%88 = call i32 @i915_decode_alu1(i32* %84, i32 %85, i32 %86, i8* %87, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %198
89: ; preds = %4
%90 = load i32*, i32** %5
%91 = load i32, i32* %6
%92 = load i32, i32* %7
%93 = load i8*, i8** %8
%94 = call i32 @i915_decode_alu1(i32* %90, i32 %91, i32 %92, i8* %93, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
br label %198
95: ; preds = %4
%96 = load i32*, i32** %5
%97 = load i32, i32* %6
%98 = load i32, i32* %7
%99 = load i8*, i8** %8
%100 = call i32 @i915_decode_alu1(i32* %96, i32 %97, i32 %98, i8* %99, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
br label %198
101: ; preds = %4
%102 = load i32*, i32** %5
%103 = load i32, i32* %6
%104 = load i32, i32* %7
%105 = load i8*, i8** %8
%106 = call i32 @i915_decode_alu1(i32* %102, i32 %103, i32 %104, i8* %105, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
br label %198
107: ; preds = %4
%108 = load i32*, i32** %5
%109 = load i32, i32* %6
%110 = load i32, i32* %7
%111 = load i8*, i8** %8
%112 = call i32 @i915_decode_alu2(i32* %108, i32 %109, i32 %110, i8* %111, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
br label %198
113: ; preds = %4
%114 = load i32*, i32** %5
%115 = load i32, i32* %6
%116 = load i32, i32* %7
%117 = load i8*, i8** %8
%118 = call i32 @i915_decode_alu2(i32* %114, i32 %115, i32 %116, i8* %117, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
br label %198
119: ; preds = %4
%120 = load i32*, i32** %5
%121 = load i32, i32* %6
%122 = load i32, i32* %7
%123 = load i8*, i8** %8
%124 = call i32 @i915_decode_alu2(i32* %120, i32 %121, i32 %122, i8* %123, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
br label %198
125: ; preds = %4
%126 = load i32*, i32** %5
%127 = load i32, i32* %6
%128 = load i32, i32* %7
%129 = load i8*, i8** %8
%130 = call i32 @i915_decode_alu1(i32* %126, i32 %127, i32 %128, i8* %129, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
br label %198
131: ; preds = %4
%132 = load i32*, i32** %5
%133 = load i32, i32* %6
%134 = load i32, i32* %7
%135 = load i8*, i8** %8
%136 = call i32 @i915_decode_alu1(i32* %132, i32 %133, i32 %134, i8* %135, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
br label %198
137: ; preds = %4
%138 = load i32*, i32** %5
%139 = load i32, i32* %6
%140 = load i32, i32* %7
%141 = load i8*, i8** %8
%142 = call i32 @i915_decode_alu1(i32* %138, i32 %139, i32 %140, i8* %141, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0))
br label %198
143: ; preds = %4
%144 = load i32*, i32** %5
%145 = load i32, i32* %6
%146 = load i32, i32* %7
%147 = load i8*, i8** %8
%148 = call i32 @i915_decode_alu2(i32* %144, i32 %145, i32 %146, i8* %147, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0))
br label %198
149: ; preds = %4
%150 = load i32*, i32** %5
%151 = load i32, i32* %6
%152 = load i32, i32* %7
%153 = load i8*, i8** %8
%154 = call i32 @i915_decode_alu2(i32* %150, i32 %151, i32 %152, i8* %153, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0))
br label %198
155: ; preds = %4
%156 = load i32*, i32** %5
%157 = load i32, i32* %6
%158 = load i32, i32* %7
%159 = load i8*, i8** %8
%160 = call i32 @i915_decode_tex(i32* %156, i32 %157, i32 %158, i8* %159, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
br label %198
161: ; preds = %4
%162 = load i32*, i32** %5
%163 = load i32, i32* %6
%164 = load i32, i32* %7
%165 = load i8*, i8** %8
%166 = call i32 @i915_decode_tex(i32* %162, i32 %163, i32 %164, i8* %165, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0))
br label %198
167: ; preds = %4
%168 = load i32*, i32** %5
%169 = load i32, i32* %6
%170 = load i32, i32* %7
%171 = load i8*, i8** %8
%172 = call i32 @i915_decode_tex(i32* %168, i32 %169, i32 %170, i8* %171, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.24, i64 0, i64 0))
br label %198
173: ; preds = %4
%174 = load i32*, i32** %5
%175 = load i32, i32* %6
%176 = load i32, i32* %7
%177 = load i8*, i8** %8
%178 = call i32 @i915_decode_dcl(i32* %174, i32 %175, i32 %176, i8* %177)
br label %198
179: ; preds = %4
%180 = load i32*, i32** %5
%181 = load i32, i32* %6
%182 = load i32, i32* %7
%183 = add nsw i32 %182, 1
store i32 %183, i32* %7
%184 = load i8*, i8** %8
%185 = call i32 @instr_out(i32* %180, i32 %181, i32 %182, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* %184)
%186 = load i32*, i32** %5
%187 = load i32, i32* %6
%188 = load i32, i32* %7
%189 = add nsw i32 %188, 1
store i32 %189, i32* %7
%190 = load i8*, i8** %8
%191 = call i32 @instr_out(i32* %186, i32 %187, i32 %188, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %190)
%192 = load i32*, i32** %5
%193 = load i32, i32* %6
%194 = load i32, i32* %7
%195 = add nsw i32 %194, 1
store i32 %195, i32* %7
%196 = load i8*, i8** %8
%197 = call i32 @instr_out(i32* %192, i32 %193, i32 %194, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %196)
br label %198
198: ; preds = %179, %173, %167, %161, %155, %149, %143, %137, %131, %125, %119, %113, %107, %101, %95, %89, %83, %77, %71, %65, %59, %53, %47, %41, %35, %16
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s: NOP\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [4 x i8] c"ADD\00"
@.str.3 = [4 x i8] c"MOV\00"
@.str.4 = [4 x i8] c"MUL\00"
@.str.5 = [4 x i8] c"MAD\00"
@.str.6 = [7 x i8] c"DP2ADD\00"
@.str.7 = [4 x i8] c"DP3\00"
@.str.8 = [4 x i8] c"DP4\00"
@.str.9 = [4 x i8] c"FRC\00"
@.str.10 = [4 x i8] c"RCP\00"
@.str.11 = [4 x i8] c"RSQ\00"
@.str.12 = [4 x i8] c"EXP\00"
@.str.13 = [4 x i8] c"LOG\00"
@.str.14 = [4 x i8] c"CMP\00"
@.str.15 = [4 x i8] c"MIN\00"
@.str.16 = [4 x i8] c"MAX\00"
@.str.17 = [4 x i8] c"FLR\00"
@.str.18 = [4 x i8] c"MOD\00"
@.str.19 = [4 x i8] c"TRC\00"
@.str.20 = [4 x i8] c"SGE\00"
@.str.21 = [4 x i8] c"SLT\00"
@.str.22 = [6 x i8] c"TEXLD\00"
@.str.23 = [7 x i8] c"TEXLDP\00"
@.str.24 = [7 x i8] c"TEXLDB\00"
@.str.25 = [13 x i8] c"%s: unknown\0A\00"
define void @i915_decode_instruction(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = lshr i32 %7, 24
%9 = and i32 %8, 31
switch i32 %9, label %64 [
i32 0, label %10
i32 1, label %16
i32 2, label %18
i32 3, label %20
i32 4, label %22
i32 5, label %24
i32 6, label %26
i32 7, label %28
i32 8, label %30
i32 9, label %32
i32 10, label %34
i32 11, label %36
i32 12, label %38
i32 13, label %40
i32 14, label %42
i32 15, label %44
i32 16, label %46
i32 17, label %48
i32 18, label %50
i32 19, label %52
i32 20, label %54
i32 21, label %56
i32 22, label %58
i32 23, label %60
i32 25, label %62
]
10: ; preds = %4
%11 = add nsw i32 %2, 1
%12 = tail call i32 @instr_out(i32* %0, i32 %1, i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3)
%13 = add nsw i32 %2, 2
%14 = tail call i32 @instr_out(i32* %0, i32 %1, i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%15 = tail call i32 @instr_out(i32* %0, i32 %1, i32 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %70
16: ; preds = %4
%17 = tail call i32 @i915_decode_alu2(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %70
18: ; preds = %4
%19 = tail call i32 @i915_decode_alu1(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %70
20: ; preds = %4
%21 = tail call i32 @i915_decode_alu2(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %70
22: ; preds = %4
%23 = tail call i32 @i915_decode_alu3(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %70
24: ; preds = %4
%25 = tail call i32 @i915_decode_alu3(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %70
26: ; preds = %4
%27 = tail call i32 @i915_decode_alu2(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %70
28: ; preds = %4
%29 = tail call i32 @i915_decode_alu2(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %70
30: ; preds = %4
%31 = tail call i32 @i915_decode_alu1(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %70
32: ; preds = %4
%33 = tail call i32 @i915_decode_alu1(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %70
34: ; preds = %4
%35 = tail call i32 @i915_decode_alu1(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
br label %70
36: ; preds = %4
%37 = tail call i32 @i915_decode_alu1(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
br label %70
38: ; preds = %4
%39 = tail call i32 @i915_decode_alu1(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
br label %70
40: ; preds = %4
%41 = tail call i32 @i915_decode_alu2(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
br label %70
42: ; preds = %4
%43 = tail call i32 @i915_decode_alu2(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
br label %70
44: ; preds = %4
%45 = tail call i32 @i915_decode_alu2(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
br label %70
46: ; preds = %4
%47 = tail call i32 @i915_decode_alu1(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
br label %70
48: ; preds = %4
%49 = tail call i32 @i915_decode_alu1(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
br label %70
50: ; preds = %4
%51 = tail call i32 @i915_decode_alu1(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0))
br label %70
52: ; preds = %4
%53 = tail call i32 @i915_decode_alu2(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0))
br label %70
54: ; preds = %4
%55 = tail call i32 @i915_decode_alu2(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0))
br label %70
56: ; preds = %4
%57 = tail call i32 @i915_decode_tex(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
br label %70
58: ; preds = %4
%59 = tail call i32 @i915_decode_tex(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0))
br label %70
60: ; preds = %4
%61 = tail call i32 @i915_decode_tex(i32* %0, i32 %1, i32 %2, i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.24, i64 0, i64 0))
br label %70
62: ; preds = %4
%63 = tail call i32 @i915_decode_dcl(i32* %0, i32 %1, i32 %2, i8* %3)
br label %70
64: ; preds = %4
%65 = add nsw i32 %2, 1
%66 = tail call i32 @instr_out(i32* %0, i32 %1, i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* %3)
%67 = add nsw i32 %2, 2
%68 = tail call i32 @instr_out(i32* %0, i32 %1, i32 %65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%69 = tail call i32 @instr_out(i32* %0, i32 %1, i32 %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %70
70: ; preds = %64, %62, %60, %58, %56, %54, %52, %50, %48, %46, %44, %42, %40, %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %10
ret void
}