#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*/ printf(char *);
int showt(int t) {
  if (t != 0) {
    if (t == 1)
      printf("One Thousand ");
    if (t == 2)
      printf("Two Thousand ");
    if (t == 3)
      printf("Three Thousand ");
  }
  return 0;
}


x86 assembly (clang, -O0):
<showt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116c <showt+0x5c>
cmpl   $0x1,-0x4(%rbp)
jne    113b <showt+0x2b>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x2,-0x4(%rbp)
jne    1151 <showt+0x41>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x3,-0x4(%rbp)
jne    1167 <showt+0x57>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    116c <showt+0x5c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showt>:
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     1133 <showt+0x23>
push   %rax
movslq %edi,%rax
lea    0xf09(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1030 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"One Thousand \00"
@.str.1 = [14 x i8] c"Two Thousand \00"
@.str.2 = [16 x i8] c"Three Thousand \00"
define i32 @showt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %21
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
br label %21
21: ; preds = %20, %1
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"One Thousand \00"
@.str.1 = [14 x i8] c"Two Thousand \00"
@.str.2 = [16 x i8] c"Three Thousand \00"
@reltable.showt = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.showt to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.showt to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.showt to i64)) to i32)]
define i32 @showt(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.showt to i8*), i64 %6)
%8 = tail call i32 @printf(i8* dereferenceable(1) %7)
br label %9
9: ; preds = %1, %4
ret i32 0
}