#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 */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ throwException(char *);
char getPrimType(char *s) {
  char primtype;
  if (strcmp(s, "byte") == 0)
    primtype = 'B';
  else if (strcmp(s, "short") == 0)
    primtype = 'S';
  else if (strcmp(s, "int") == 0)
    primtype = 'I';
  else if (strcmp(s, "long") == 0)
    primtype = 'J';
  else if (strcmp(s, "char") == 0)
    primtype = 'C';
  else if (strcmp(s, "float") == 0)
    primtype = 'F';
  else if (strcmp(s, "double") == 0)
    primtype = 'D';
  else if (strcmp(s, "boolean") == 0)
    primtype = 'Z';
  else
    throwException("getPrimType error");
  return primtype;
}


x86 assembly (clang, -O0):
<getPrimType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    114f <getPrimType+0x2f>
movb   $0x42,-0x9(%rbp)
jmp    1273 <getPrimType+0x153>
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1172 <getPrimType+0x52>
movb   $0x53,-0x9(%rbp)
jmp    126e <getPrimType+0x14e>
mov    -0x8(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1195 <getPrimType+0x75>
movb   $0x49,-0x9(%rbp)
jmp    1269 <getPrimType+0x149>
mov    -0x8(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11b8 <getPrimType+0x98>
movb   $0x4a,-0x9(%rbp)
jmp    1264 <getPrimType+0x144>
mov    -0x8(%rbp),%rdi
lea    0xe51(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11db <getPrimType+0xbb>
movb   $0x43,-0x9(%rbp)
jmp    125f <getPrimType+0x13f>
mov    -0x8(%rbp),%rdi
lea    0xe33(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11fe <getPrimType+0xde>
movb   $0x46,-0x9(%rbp)
jmp    125a <getPrimType+0x13a>
mov    -0x8(%rbp),%rdi
lea    0xe16(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1221 <getPrimType+0x101>
movb   $0x44,-0x9(%rbp)
jmp    1255 <getPrimType+0x135>
mov    -0x8(%rbp),%rdi
lea    0xdfa(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1244 <getPrimType+0x124>
movb   $0x5a,-0x9(%rbp)
jmp    1250 <getPrimType+0x130>
lea    0xde3(%rip),%rdi
call   1030 <throwException@plt>
jmp    1255 <getPrimType+0x135>
jmp    125a <getPrimType+0x13a>
jmp    125f <getPrimType+0x13f>
jmp    1264 <getPrimType+0x144>
jmp    1269 <getPrimType+0x149>
jmp    126e <getPrimType+0x14e>
jmp    1273 <getPrimType+0x153>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPrimType>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11d7 <getPrimType+0xb7>
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11db <getPrimType+0xbb>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11df <getPrimType+0xbf>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11e3 <getPrimType+0xc3>
lea    0xe94(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11e7 <getPrimType+0xc7>
lea    0xe85(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11eb <getPrimType+0xcb>
lea    0xe77(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11ef <getPrimType+0xcf>
lea    0xe6a(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11f3 <getPrimType+0xd3>
lea    0xe5e(%rip),%rdi
call   1030 <throwException@plt>
pop    %rbx
ret
mov    $0x42,%al
pop    %rbx
ret
mov    $0x53,%al
pop    %rbx
ret
mov    $0x49,%al
pop    %rbx
ret
mov    $0x4a,%al
pop    %rbx
ret
mov    $0x43,%al
pop    %rbx
ret
mov    $0x46,%al
pop    %rbx
ret
mov    $0x44,%al
pop    %rbx
ret
mov    $0x5a,%al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"byte\00"
@.str.1 = [6 x i8] c"short\00"
@.str.2 = [4 x i8] c"int\00"
@.str.3 = [5 x i8] c"long\00"
@.str.4 = [5 x i8] c"char\00"
@.str.5 = [6 x i8] c"float\00"
@.str.6 = [7 x i8] c"double\00"
@.str.7 = [8 x i8] c"boolean\00"
@.str.8 = [18 x i8] c"getPrimType error\00"
define signext i8 @getPrimType(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 66, i8* %3
br label %52
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 83, i8* %3
br label %51
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 73, i8* %3
br label %50
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 74, i8* %3
br label %49
23: ; preds = %18
%24 = load i8*, i8** %2
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %23
store i8 67, i8* %3
br label %48
28: ; preds = %23
%29 = load i8*, i8** %2
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %28
store i8 70, i8* %3
br label %47
33: ; preds = %28
%34 = load i8*, i8** %2
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %33
store i8 68, i8* %3
br label %46
38: ; preds = %33
%39 = load i8*, i8** %2
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %38
store i8 90, i8* %3
br label %45
43: ; preds = %38
%44 = call i32 @throwException(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
br label %45
45: ; preds = %43, %42
br label %46
46: ; preds = %45, %37
br label %47
47: ; preds = %46, %32
br label %48
48: ; preds = %47, %27
br label %49
49: ; preds = %48, %22
br label %50
50: ; preds = %49, %17
br label %51
51: ; preds = %50, %12
br label %52
52: ; preds = %51, %7
%53 = load i8, i8* %3
ret i8 %53
}

LLVM IR (-O2):
@.str = [5 x i8] c"byte\00"
@.str.1 = [6 x i8] c"short\00"
@.str.2 = [4 x i8] c"int\00"
@.str.3 = [5 x i8] c"long\00"
@.str.4 = [5 x i8] c"char\00"
@.str.5 = [6 x i8] c"float\00"
@.str.6 = [7 x i8] c"double\00"
@.str.7 = [8 x i8] c"boolean\00"
@.str.8 = [18 x i8] c"getPrimType error\00"
define signext i8 @getPrimType(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %27, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %27, label %7
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %27, label %10
10: ; preds = %7
%11 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %27, label %13
13: ; preds = %10
%14 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %27, label %16
16: ; preds = %13
%17 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %27, label %19
19: ; preds = %16
%20 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %27, label %22
22: ; preds = %19
%23 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 @throwException(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
br label %27
27: ; preds = %22, %19, %16, %13, %10, %7, %4, %1, %25
%28 = phi i8 [ undef, %25 ], [ 66, %1 ], [ 83, %4 ], [ 73, %7 ], [ 74, %10 ], [ 67, %13 ], [ 70, %16 ], [ 68, %19 ], [ 90, %22 ]
ret i8 %28
}