#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*/ d_fail(char *);
char *make_u_type(int i) {
  switch (i) {
  case 1:
    return "uint8";
  case 2:
    return "uint16";
  case 4:
    return "uint32";
  default:
    d_fail("bad case");
    return "";
  }
}


x86 assembly (clang, -O0):
<make_u_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     1151 <make_u_type+0x41>
jmp    112f <make_u_type+0x1f>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1161 <make_u_type+0x51>
jmp    1140 <make_u_type+0x30>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     1171 <make_u_type+0x61>
jmp    1181 <make_u_type+0x71>
lea    0xea8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1198 <make_u_type+0x88>
lea    0xe9e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1198 <make_u_type+0x88>
lea    0xe95(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1198 <make_u_type+0x88>
lea    0xe8c(%rip),%rdi
call   1030 <d_fail@plt>
lea    0xe7f(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_u_type>:
cmp    $0x1,%edi
je     1127 <make_u_type+0x17>
cmp    $0x4,%edi
je     112f <make_u_type+0x1f>
cmp    $0x2,%edi
jne    1137 <make_u_type+0x27>
lea    0xee0(%rip),%rax
ret
lea    0xed2(%rip),%rax
ret
lea    0xed7(%rip),%rax
ret
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <d_fail@plt>
lea    0xec8(%rip),%rax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"uint8\00"
@.str.1 = [7 x i8] c"uint16\00"
@.str.2 = [7 x i8] c"uint32\00"
@.str.3 = [9 x i8] c"bad case\00"
@.str.4 = [1 x i8] zeroinitializer
define i8* @make_u_type(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 1, label %5
i32 2, label %6
i32 4, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
%9 = call i32 @d_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %8, %7, %6, %5
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"uint8\00"
@.str.1 = [7 x i8] c"uint16\00"
@.str.2 = [7 x i8] c"uint32\00"
@.str.3 = [9 x i8] c"bad case\00"
@.str.4 = [1 x i8] zeroinitializer
define i8* @make_u_type(i32 %0) {
switch i32 %0, label %4 [
i32 1, label %6
i32 2, label %2
i32 4, label %3
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
%5 = tail call i32 @d_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %6
6: ; preds = %1, %4, %3, %2
%7 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), %4 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %7
}