#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*/ assert(int /*<<< orphan*/);
char *int_type_name(unsigned size, int is_signed) {
  switch (size) {
  case 1:
    return is_signed ? "byte" : "ubyte";
  case 2:
    return is_signed ? "short" : "ushort";
  case 4:
    return is_signed ? "int" : "uint";
  case 8:
    return is_signed ? "long" : "ulong";
  default:
    assert(0);
    return NULL;
  }
}


x86 assembly (clang, -O0):
<int_type_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x7,%eax
ja     11cb <int_type_name+0xbb>
mov    -0x18(%rbp),%rax
lea    0xec2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%edx
lea    0xecf(%rip),%rax
lea    0xec9(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    11da <int_type_name+0xca>
mov    -0x10(%rbp),%edx
lea    0xeb4(%rip),%rax
lea    0xeae(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    11da <int_type_name+0xca>
mov    -0x10(%rbp),%edx
lea    0xe9a(%rip),%rax
lea    0xe94(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    11da <int_type_name+0xca>
mov    -0x10(%rbp),%edx
lea    0xe7e(%rip),%rax
lea    0xe78(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    11da <int_type_name+0xca>
xor    %edi,%edi
call   1030 <assert@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_type_name>:
push   %rbx
add    $0xffffffff,%edi
cmp    $0x7,%edi
ja     114d <int_type_name+0x3d>
lea    0xee0(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
test   %esi,%esi
lea    0xeee(%rip),%rax
lea    0xee8(%rip),%rbx
jmp    117a <int_type_name+0x6a>
test   %esi,%esi
lea    0xee2(%rip),%rax
lea    0xedc(%rip),%rbx
jmp    117a <int_type_name+0x6a>
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <assert@plt>
jmp    117e <int_type_name+0x6e>
test   %esi,%esi
lea    0xecc(%rip),%rax
lea    0xec6(%rip),%rbx
jmp    117a <int_type_name+0x6a>
test   %esi,%esi
lea    0xebf(%rip),%rax
lea    0xeb9(%rip),%rbx
cmove  %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"byte\00"
@.str.1 = [6 x i8] c"ubyte\00"
@.str.2 = [6 x i8] c"short\00"
@.str.3 = [7 x i8] c"ushort\00"
@.str.4 = [4 x i8] c"int\00"
@.str.5 = [5 x i8] c"uint\00"
@.str.6 = [5 x i8] c"long\00"
@.str.7 = [6 x i8] c"ulong\00"
define i8* @int_type_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
switch i32 %6, label %27 [
i32 1, label %7
i32 2, label %12
i32 4, label %17
i32 8, label %22
]
7: ; preds = %2
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
store i8* %11, i8** %3
br label %29
12: ; preds = %2
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
store i8* %16, i8** %3
br label %29
17: ; preds = %2
%18 = load i32, i32* %5
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0)
store i8* %21, i8** %3
br label %29
22: ; preds = %2
%23 = load i32, i32* %5
%24 = icmp ne i32 %23, 0
%25 = zext i1 %24 to i64
%26 = select i1 %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0)
store i8* %26, i8** %3
br label %29
27: ; preds = %2
%28 = call i32 @assert(i32 0)
store i8* null, i8** %3
br label %29
29: ; preds = %27, %22, %17, %12, %7
%30 = load i8*, i8** %3
ret i8* %30
}

LLVM IR (-O2):
@.str = [5 x i8] c"byte\00"
@.str.1 = [6 x i8] c"ubyte\00"
@.str.2 = [6 x i8] c"short\00"
@.str.3 = [7 x i8] c"ushort\00"
@.str.4 = [4 x i8] c"int\00"
@.str.5 = [5 x i8] c"uint\00"
@.str.6 = [5 x i8] c"long\00"
@.str.7 = [6 x i8] c"ulong\00"
define i8* @int_type_name(i32 %0, i32 %1) {
switch i32 %0, label %15 [
i32 1, label %3
i32 2, label %6
i32 4, label %9
i32 8, label %12
]
3: ; preds = %2
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
br label %17
6: ; preds = %2
%7 = icmp eq i32 %1, 0
%8 = select i1 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
br label %17
9: ; preds = %2
%10 = icmp eq i32 %1, 0
%11 = select i1 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0)
br label %17
12: ; preds = %2
%13 = icmp eq i32 %1, 0
%14 = select i1 %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0)
br label %17
15: ; preds = %2
%16 = tail call i32 @assert(i32 0)
br label %17
17: ; preds = %15, %12, %9, %6, %3
%18 = phi i8* [ null, %15 ], [ %14, %12 ], [ %11, %9 ], [ %8, %6 ], [ %5, %3 ]
ret i8* %18
}