#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*/ strcasecmp(char *, char *);
char oph_util_get_measure_type(char *measure_type) {
  if (!measure_type)
    return 0;
  if (!strcasecmp(measure_type, "byte"))
    return 'c';
  else if (!strcasecmp(measure_type, "short"))
    return 's';
  else if (!strcasecmp(measure_type, "int"))
    return 'i';
  else if (!strcasecmp(measure_type, "long"))
    return 'l';
  else if (!strcasecmp(measure_type, "float"))
    return 'f';
  else if (!strcasecmp(measure_type, "double"))
    return 'd';
  else if (!strcasecmp(measure_type, "bit"))
    return 'b';
  return 0;
}


x86 assembly (clang, -O0):
<oph_util_get_measure_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1130 <oph_util_get_measure_type+0x20>
movb   $0x0,-0x1(%rbp)
jmp    1240 <oph_util_get_measure_type+0x130>
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1152 <oph_util_get_measure_type+0x42>
movb   $0x63,-0x1(%rbp)
jmp    1240 <oph_util_get_measure_type+0x130>
mov    -0x10(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1174 <oph_util_get_measure_type+0x64>
movb   $0x73,-0x1(%rbp)
jmp    1240 <oph_util_get_measure_type+0x130>
mov    -0x10(%rbp),%rdi
lea    0xe8c(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1196 <oph_util_get_measure_type+0x86>
movb   $0x69,-0x1(%rbp)
jmp    1240 <oph_util_get_measure_type+0x130>
mov    -0x10(%rbp),%rdi
lea    0xe6e(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11b8 <oph_util_get_measure_type+0xa8>
movb   $0x6c,-0x1(%rbp)
jmp    1240 <oph_util_get_measure_type+0x130>
mov    -0x10(%rbp),%rdi
lea    0xe51(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11da <oph_util_get_measure_type+0xca>
movb   $0x66,-0x1(%rbp)
jmp    1240 <oph_util_get_measure_type+0x130>
mov    -0x10(%rbp),%rdi
lea    0xe35(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11fc <oph_util_get_measure_type+0xec>
movb   $0x64,-0x1(%rbp)
jmp    1240 <oph_util_get_measure_type+0x130>
mov    -0x10(%rbp),%rdi
lea    0xe1a(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    121e <oph_util_get_measure_type+0x10e>
movb   $0x62,-0x1(%rbp)
jmp    1240 <oph_util_get_measure_type+0x130>
jmp    1223 <oph_util_get_measure_type+0x113>
jmp    1228 <oph_util_get_measure_type+0x118>
jmp    122d <oph_util_get_measure_type+0x11d>
jmp    1232 <oph_util_get_measure_type+0x122>
jmp    1237 <oph_util_get_measure_type+0x127>
jmp    123c <oph_util_get_measure_type+0x12c>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oph_util_get_measure_type>:
push   %rbx
test   %rdi,%rdi
je     11ad <oph_util_get_measure_type+0x9d>
mov    %rdi,%rbx
lea    0xedc(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11b1 <oph_util_get_measure_type+0xa1>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11b5 <oph_util_get_measure_type+0xa5>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11b9 <oph_util_get_measure_type+0xa9>
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11bd <oph_util_get_measure_type+0xad>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11c1 <oph_util_get_measure_type+0xb1>
lea    0xe96(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11c5 <oph_util_get_measure_type+0xb5>
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
mov    $0x62,%eax
cmovne %ecx,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    $0x63,%al
pop    %rbx
ret
mov    $0x73,%al
pop    %rbx
ret
mov    $0x69,%al
pop    %rbx
ret
mov    $0x6c,%al
pop    %rbx
ret
mov    $0x66,%al
pop    %rbx
ret
mov    $0x64,%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 = [6 x i8] c"float\00"
@.str.5 = [7 x i8] c"double\00"
@.str.6 = [4 x i8] c"bit\00"
define signext i8 @oph_util_get_measure_type(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8 0, i8* %2
br label %49
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @strcasecmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7
store i8 99, i8* %2
br label %49
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = call i32 @strcasecmp(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %12
store i8 115, i8* %2
br label %49
17: ; preds = %12
%18 = load i8*, i8** %3
%19 = call i32 @strcasecmp(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp ne i32 %19, 0
br i1 %20, label %22, label %21
21: ; preds = %17
store i8 105, i8* %2
br label %49
22: ; preds = %17
%23 = load i8*, i8** %3
%24 = call i32 @strcasecmp(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %22
store i8 108, i8* %2
br label %49
27: ; preds = %22
%28 = load i8*, i8** %3
%29 = call i32 @strcasecmp(i8* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %32, label %31
31: ; preds = %27
store i8 102, i8* %2
br label %49
32: ; preds = %27
%33 = load i8*, i8** %3
%34 = call i32 @strcasecmp(i8* %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %32
store i8 100, i8* %2
br label %49
37: ; preds = %32
%38 = load i8*, i8** %3
%39 = call i32 @strcasecmp(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%40 = icmp ne i32 %39, 0
br i1 %40, label %42, label %41
41: ; preds = %37
store i8 98, i8* %2
br label %49
42: ; preds = %37
br label %43
43: ; preds = %42
br label %44
44: ; preds = %43
br label %45
45: ; preds = %44
br label %46
46: ; preds = %45
br label %47
47: ; preds = %46
br label %48
48: ; preds = %47
store i8 0, i8* %2
br label %49
49: ; preds = %48, %41, %36, %31, %26, %21, %16, %11, %6
%50 = load i8, i8* %2
ret i8 %50
}

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 = [6 x i8] c"float\00"
@.str.5 = [7 x i8] c"double\00"
@.str.6 = [4 x i8] c"bit\00"
define signext i8 @oph_util_get_measure_type(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %25, label %3
3: ; preds = %1
%4 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %25, label %6
6: ; preds = %3
%7 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %25, label %9
9: ; preds = %6
%10 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %25, label %12
12: ; preds = %9
%13 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %25, label %15
15: ; preds = %12
%16 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %25, label %18
18: ; preds = %15
%19 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %18
%22 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
%24 = select i1 %23, i8 98, i8 0
br label %25
25: ; preds = %21, %18, %15, %12, %9, %6, %3, %1
%26 = phi i8 [ 0, %1 ], [ 99, %3 ], [ 115, %6 ], [ 105, %9 ], [ 108, %12 ], [ 102, %15 ], [ 100, %18 ], [ %24, %21 ]
ret i8 %26
}