#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 */
char *calloc(int, int);
char *getType(int type) {
  char *temp = calloc(7, sizeof(char));
  temp = "Unknown";
  if (type == 1) {
    temp = calloc(6, sizeof(char));
    temp = "number";
  }
  if (type == 4) {
    temp = calloc(19, sizeof(char));
    temp = "arithmetic operator";
  }
  if (type == 5) {
    temp = calloc(19, sizeof(char));
    temp = "letter";
  }
  return temp;
}


x86 assembly (clang, -O0):
<getType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x7,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1161 <getType+0x51>
mov    $0x6,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xeab(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x4,-0x4(%rbp)
jne    1189 <getType+0x79>
mov    $0x13,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    11b1 <getType+0xa1>
mov    $0x13,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe76(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getType>:
cmp    $0x1,%edi
lea    0xefe(%rip),%rax
lea    0xeef(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x4,%edi
lea    0xef0(%rip),%rdx
cmovne %rcx,%rdx
cmp    $0x5,%edi
lea    0xef6(%rip),%rax
cmovne %rdx,%rax
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"Unknown\00"
@.str.1 = [7 x i8] c"number\00"
@.str.2 = [20 x i8] c"arithmetic operator\00"
@.str.3 = [7 x i8] c"letter\00"
define i8* @getType(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
%4 = icmp eq i32 %0, 4
%5 = select i1 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %3
%6 = icmp eq i32 %0, 5
%7 = select i1 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %5
ret i8* %7
}