#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*/ sprintf(char *, char *, unsigned int);
const char *mfu_opcode(unsigned opcode) {
  static char ret[16];
  char *buf = ret;
  switch (opcode) {
  case 0:
    return "nop";
  case 1:
    return "rcp";
  case 2:
    return "rsq";
  case 3:
    return "lg2";
  case 4:
    return "ex2";
  case 5:
    return "sqrt";
  case 6:
    return "sin";
  case 7:
    return "cos";
  case 8:
    return "frc";
  case 9:
    return "preEx2";
  case 10:
    return "preSin";
  case 11:
    return "preCos";
  default:
    sprintf(buf, "op%d", opcode);
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<mfu_opcode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
lea    0x2f1e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0xb,%rax
ja     120b <mfu_opcode+0xfb>
mov    -0x20(%rbp),%rax
lea    0xebe(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xede(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <mfu_opcode+0x119>
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <mfu_opcode+0x119>
lea    0xec6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <mfu_opcode+0x119>
lea    0xeba(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <mfu_opcode+0x119>
lea    0xeae(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <mfu_opcode+0x119>
lea    0xea2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <mfu_opcode+0x119>
lea    0xe97(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <mfu_opcode+0x119>
lea    0xe8b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <mfu_opcode+0x119>
lea    0xe7f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <mfu_opcode+0x119>
lea    0xe73(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <mfu_opcode+0x119>
lea    0xe6a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <mfu_opcode+0x119>
lea    0xe61(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1229 <mfu_opcode+0x119>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe51(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2e1b(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfu_opcode>:
push   %rbx
mov    %edi,%edx
cmp    $0xc,%edi
jae    112b <mfu_opcode+0x1b>
movslq %edx,%rax
lea    0xf1e(%rip),%rcx
movslq (%rcx,%rax,4),%rbx
add    %rcx,%rbx
jmp    1141 <mfu_opcode+0x31>
lea    0x2f0e(%rip),%rbx
lea    0xf01(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@mfu_opcode.ret = internal global [16 x i8] zeroinitializer
@.str = [4 x i8] c"nop\00"
@.str.1 = [4 x i8] c"rcp\00"
@.str.2 = [4 x i8] c"rsq\00"
@.str.3 = [4 x i8] c"lg2\00"
@.str.4 = [4 x i8] c"ex2\00"
@.str.5 = [5 x i8] c"sqrt\00"
@.str.6 = [4 x i8] c"sin\00"
@.str.7 = [4 x i8] c"cos\00"
@.str.8 = [4 x i8] c"frc\00"
@.str.9 = [7 x i8] c"preEx2\00"
@.str.10 = [7 x i8] c"preSin\00"
@.str.11 = [7 x i8] c"preCos\00"
@.str.12 = [5 x i8] c"op%d\00"
define i8* @mfu_opcode(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @mfu_opcode.ret, i64 0, i64 0), i8** %4
%5 = load i32, i32* %3
switch i32 %5, label %18 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
i32 3, label %9
i32 4, label %10
i32 5, label %11
i32 6, label %12
i32 7, label %13
i32 8, label %14
i32 9, label %15
i32 10, label %16
i32 11, label %17
]
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %23
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %23
8: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %23
9: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %23
10: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %23
11: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %23
12: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %23
13: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %23
14: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %23
15: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %23
16: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %23
17: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %23
18: ; preds = %1
%19 = load i8*, i8** %4
%20 = load i32, i32* %3
%21 = call i32 @sprintf(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %18
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @mfu_opcode.ret, i64 0, i64 0), i8** %2
br label %23
23: ; preds = %22, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
@mfu_opcode.ret = internal global [16 x i8] zeroinitializer
@.str = [4 x i8] c"nop\00"
@.str.1 = [4 x i8] c"rcp\00"
@.str.2 = [4 x i8] c"rsq\00"
@.str.3 = [4 x i8] c"lg2\00"
@.str.4 = [4 x i8] c"ex2\00"
@.str.5 = [5 x i8] c"sqrt\00"
@.str.6 = [4 x i8] c"sin\00"
@.str.7 = [4 x i8] c"cos\00"
@.str.8 = [4 x i8] c"frc\00"
@.str.9 = [7 x i8] c"preEx2\00"
@.str.10 = [7 x i8] c"preSin\00"
@.str.11 = [7 x i8] c"preCos\00"
@.str.12 = [5 x i8] c"op%d\00"
@reltable.mfu_opcode = [12 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([12 x i32]* @reltable.mfu_opcode to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.mfu_opcode to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([12 x i32]* @reltable.mfu_opcode to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([12 x i32]* @reltable.mfu_opcode to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([12 x i32]* @reltable.mfu_opcode to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.5 to i64), i64 ptrtoint ([12 x i32]* @reltable.mfu_opcode to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([12 x i32]* @reltable.mfu_opcode to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.7 to i64), i64 ptrtoint ([12 x i32]* @reltable.mfu_opcode to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.8 to i64), i64 ptrtoint ([12 x i32]* @reltable.mfu_opcode to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.9 to i64), i64 ptrtoint ([12 x i32]* @reltable.mfu_opcode to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.10 to i64), i64 ptrtoint ([12 x i32]* @reltable.mfu_opcode to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.11 to i64), i64 ptrtoint ([12 x i32]* @reltable.mfu_opcode to i64)) to i32)]
define i8* @mfu_opcode(i32 %0) {
%2 = icmp ult i32 %0, 12
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @mfu_opcode.ret, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 %0)
br label %9
5: ; preds = %1
%6 = sext i32 %0 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.mfu_opcode to i8*), i64 %7)
br label %9
9: ; preds = %5, %3
%10 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @mfu_opcode.ret, i64 0, i64 0), %3 ], [ %8, %5 ]
ret i8* %10
}