#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_mul_src(unsigned src, int mul_idx) {
  static char ret[2][16];
  char *buf = ret[mul_idx];
  switch (src) {
  case 0:
    return "r0";
  case 1:
    return "r1";
  case 2:
    return "r2";
  case 3:
    return "r3";
  case 10:
    return "sfu";
  case 11:
    return "bar0";
  case 12:
    return "bar1";
  case 13:
    return "#1";
  default:
    sprintf(buf, "src%d", src);
    break;
  }
  return ret[mul_idx];
}


x86 assembly (clang, -O0):
<mfu_mul_src>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movslq -0x10(%rbp),%rcx
shl    $0x4,%rcx
lea    0x2f13(%rip),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0xd,%rax
ja     11d9 <mfu_mul_src+0xc9>
mov    -0x20(%rbp),%rax
lea    0xeb0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xee4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1202 <mfu_mul_src+0xf2>
lea    0xed9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1202 <mfu_mul_src+0xf2>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1202 <mfu_mul_src+0xf2>
lea    0xeab(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1202 <mfu_mul_src+0xf2>
lea    0xe9e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1202 <mfu_mul_src+0xf2>
lea    0xe92(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1202 <mfu_mul_src+0xf2>
lea    0xe87(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1202 <mfu_mul_src+0xf2>
lea    0xe7c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1202 <mfu_mul_src+0xf2>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe68(%rip),%rsi
call   1030 <sprintf@plt>
movslq -0x10(%rbp),%rcx
lea    0x2e49(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfu_mul_src>:
push   %rbx
mov    %edi,%edx
cmp    $0xe,%edi
jae    1122 <mfu_mul_src+0x12>
mov    $0x3c0f,%eax
bt     %edx,%eax
jb     1144 <mfu_mul_src+0x34>
movslq %esi,%rax
shl    $0x4,%rax
lea    0x2f10(%rip),%rbx
add    %rax,%rbx
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
jmp    1155 <mfu_mul_src+0x45>
movslq %edx,%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rbx
add    %rcx,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@mfu_mul_src.ret = internal global [2 x [16 x i8]] zeroinitializer
@.str = [3 x i8] c"r0\00"
@.str.1 = [3 x i8] c"r1\00"
@.str.2 = [3 x i8] c"r2\00"
@.str.3 = [3 x i8] c"r3\00"
@.str.4 = [4 x i8] c"sfu\00"
@.str.5 = [5 x i8] c"bar0\00"
@.str.6 = [5 x i8] c"bar1\00"
@.str.7 = [3 x i8] c"\00"
@.str.8 = [6 x i8] c"src%d\00"
define i8* @mfu_mul_src(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [2 x [16 x i8]], [2 x [16 x i8]]* @mfu_mul_src.ret, i64 0, i64 %8
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
store i8* %10, i8** %6
%11 = load i32, i32* %4
switch i32 %11, label %20 [
i32 0, label %12
i32 1, label %13
i32 2, label %14
i32 3, label %15
i32 10, label %16
i32 11, label %17
i32 12, label %18
i32 13, label %19
]
12: ; preds = %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3
br label %29
13: ; preds = %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %29
14: ; preds = %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %29
15: ; preds = %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %29
16: ; preds = %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %29
17: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %29
18: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %29
19: ; preds = %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %29
20: ; preds = %2
%21 = load i8*, i8** %6
%22 = load i32, i32* %4
%23 = call i32 @sprintf(i8* %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %20
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [2 x [16 x i8]], [2 x [16 x i8]]* @mfu_mul_src.ret, i64 0, i64 %26
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %27, i64 0, i64 0
store i8* %28, i8** %3
br label %29
29: ; preds = %24, %19, %18, %17, %16, %15, %14, %13, %12
%30 = load i8*, i8** %3
ret i8* %30
}

LLVM IR (-O2):
@mfu_mul_src.ret = internal global [2 x [16 x i8]] zeroinitializer
@.str = [3 x i8] c"r0\00"
@.str.1 = [3 x i8] c"r1\00"
@.str.2 = [3 x i8] c"r2\00"
@.str.3 = [3 x i8] c"r3\00"
@.str.4 = [4 x i8] c"sfu\00"
@.str.5 = [5 x i8] c"bar0\00"
@.str.6 = [5 x i8] c"bar1\00"
@.str.7 = [3 x i8] c"\00"
@.str.8 = [6 x i8] c"src%d\00"
@reltable.mfu_mul_src = [14 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.2 to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.3 to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.5 to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.6 to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.7 to i64), i64 ptrtoint ([14 x i32]* @reltable.mfu_mul_src to i64)) to i32)]
define i8* @mfu_mul_src(i32 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [2 x [16 x i8]], [2 x [16 x i8]]* @mfu_mul_src.ret, i64 0, i64 %3, i64 0
%5 = icmp ult i32 %0, 14
br i1 %5, label %8, label %6
6: ; preds = %8, %2
%7 = tail call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %0)
br label %17
8: ; preds = %2
%9 = trunc i32 %0 to i16
%10 = lshr i16 15375, %9
%11 = and i16 %10, 1
%12 = icmp eq i16 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %8
%14 = sext i32 %0 to i64
%15 = shl i64 %14, 2
%16 = call i8* @llvm.load.relative.i64(i8* bitcast ([14 x i32]* @reltable.mfu_mul_src to i8*), i64 %15)
br label %17
17: ; preds = %13, %6
%18 = phi i8* [ %4, %6 ], [ %16, %13 ]
ret i8* %18
}