#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*/ strcmp(char *, char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
char *C_type(char *s) {
  if (!strcmp(s, "INTEGER(IntKi)"))
    return ("int");
  if (!strcmp(s, "LOGICAL"))
    return ("bool");
  if (!strcmp(s, "REAL(ReKi)"))
    return ("float");
  if (!strcmp(s, "REAL(SiKi)"))
    return ("float");
  if (!strcmp(s, "REAL(DbKi)"))
    return ("double");
  if (!strcmp(s, "REAL(R8Ki)"))
    return ("double");
  if (!strncmp(s, "CHARACTER", 9))
    return ("char");
  return ("unknown");
}


x86 assembly (clang, -O0):
<C_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1155 <C_type+0x35>
lea    0xec3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    125b <C_type+0x13b>
mov    -0x10(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    117e <C_type+0x5e>
lea    0xea6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    125b <C_type+0x13b>
mov    -0x10(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11a7 <C_type+0x87>
lea    0xe8d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    125b <C_type+0x13b>
mov    -0x10(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11d0 <C_type+0xb0>
lea    0xe64(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    125b <C_type+0x13b>
mov    -0x10(%rbp),%rdi
lea    0xe61(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11f9 <C_type+0xd9>
lea    0xe57(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    125b <C_type+0x13b>
mov    -0x10(%rbp),%rdi
lea    0xe4a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1222 <C_type+0x102>
lea    0xe2e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    125b <C_type+0x13b>
mov    -0x10(%rbp),%rdi
lea    0xe2c(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1250 <C_type+0x130>
lea    0xe1c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    125b <C_type+0x13b>
lea    0xe11(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_type>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11d6 <C_type+0xb6>
lea    0xed1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11df <C_type+0xbf>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
lea    0xec3(%rip),%r14
test   %eax,%eax
je     11e6 <C_type+0xc6>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11e6 <C_type+0xc6>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
lea    0xeb2(%rip),%r14
test   %eax,%eax
je     11e6 <C_type+0xc6>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11e6 <C_type+0xc6>
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
mov    $0x9,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
lea    0xe9a(%rip),%rax
lea    0xe98(%rip),%r14
cmove  %rax,%r14
jmp    11e6 <C_type+0xc6>
lea    0xe32(%rip),%r14
jmp    11e6 <C_type+0xc6>
lea    0xe35(%rip),%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"INTEGER(IntKi)\00"
@.str.1 = [4 x i8] c"int\00"
@.str.2 = [8 x i8] c"LOGICAL\00"
@.str.3 = [5 x i8] c"bool\00"
@.str.4 = [11 x i8] c"REAL(ReKi)\00"
@.str.5 = [6 x i8] c"float\00"
@.str.6 = [11 x i8] c"REAL(SiKi)\00"
@.str.7 = [11 x i8] c"REAL(DbKi)\00"
@.str.8 = [7 x i8] c"double\00"
@.str.9 = [11 x i8] c"REAL(R8Ki)\00"
@.str.10 = [10 x i8] c"CHARACTER\00"
@.str.11 = [5 x i8] c"char\00"
@.str.12 = [8 x i8] c"unknown\00"
define i8* @C_type(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %39
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strcmp(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %39
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i32 @strcmp(i8* %14, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %39
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %18
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %39
23: ; preds = %18
%24 = load i8*, i8** %3
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%26 = icmp ne i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %23
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %39
28: ; preds = %23
%29 = load i8*, i8** %3
%30 = call i32 @strcmp(i8* %29, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%31 = icmp ne i32 %30, 0
br i1 %31, label %33, label %32
32: ; preds = %28
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %39
33: ; preds = %28
%34 = load i8*, i8** %3
%35 = call i32 @strncmp(i8* %34, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 9)
%36 = icmp ne i32 %35, 0
br i1 %36, label %38, label %37
37: ; preds = %33
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %39
38: ; preds = %33
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %39
39: ; preds = %38, %37, %32, %27, %22, %17, %12, %7
%40 = load i8*, i8** %2
ret i8* %40
}

LLVM IR (-O2):
@.str = [15 x i8] c"INTEGER(IntKi)\00"
@.str.1 = [4 x i8] c"int\00"
@.str.2 = [8 x i8] c"LOGICAL\00"
@.str.3 = [5 x i8] c"bool\00"
@.str.4 = [11 x i8] c"REAL(ReKi)\00"
@.str.5 = [6 x i8] c"float\00"
@.str.6 = [11 x i8] c"REAL(SiKi)\00"
@.str.7 = [11 x i8] c"REAL(DbKi)\00"
@.str.8 = [7 x i8] c"double\00"
@.str.9 = [11 x i8] c"REAL(R8Ki)\00"
@.str.10 = [10 x i8] c"CHARACTER\00"
@.str.11 = [5 x i8] c"char\00"
@.str.12 = [8 x i8] c"unknown\00"
define i8* @C_type(i8* %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(15) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %23, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %23, label %7
7: ; preds = %4
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %23, label %10
10: ; preds = %7
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %23, label %13
13: ; preds = %10
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %23, label %16
16: ; preds = %13
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %16
%20 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 9)
%21 = icmp eq i32 %20, 0
%22 = select i1 %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0)
br label %23
23: ; preds = %19, %16, %13, %10, %7, %4, %1
%24 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %1 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), %10 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), %13 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), %16 ], [ %22, %19 ]
ret i8* %24
}