#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ logmsg(int, char *);
scalar_t__ strcmp(char *, char *);
char *strdup(char *);
int utl_fs2oratype(char **fstype) {
  char *type = *fstype;
  if (strcmp(type, "PACKAGE_SPEC") == 0) {
    free(type);
    type = strdup("PACKAGE");
  } else if (strcmp(type, "PACKAGE_BODY") == 0) {
    free(type);
    type = strdup("PACKAGE BODY");
  } else if (strcmp(type, "TYPE_BODY") == 0) {
    free(type);
    type = strdup("TYPE BODY");
  } else if (strcmp(type, "JAVA_SOURCE") == 0) {
    free(type);
    type = strdup("JAVA SOURCE");
  } else if (strcmp(type, "JAVA_CLASS") == 0) {
    free(type);
    type = strdup("JAVA CLASS");
  } else if (strcmp(type, "MATERIALIZED_VIEW") == 0) {
    free(type);
    type = strdup("MATERIALIZED VIEW");
  }
  if (type == NULL) {
    logmsg(1, "str_fs2oratype() - unable to malloc for normalized type.");
    return EXIT_FAILURE;
  }
  *fstype = type;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<utl_fs2oratype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    118f <utl_fs2oratype+0x4f>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
lea    0xe8c(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    12bb <utl_fs2oratype+0x17b>
mov    -0x18(%rbp),%rdi
lea    0xe7b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c7 <utl_fs2oratype+0x87>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
lea    0xe69(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    12b6 <utl_fs2oratype+0x176>
mov    -0x18(%rbp),%rdi
lea    0xe5d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ff <utl_fs2oratype+0xbf>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
lea    0xe48(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    12b1 <utl_fs2oratype+0x171>
mov    -0x18(%rbp),%rdi
lea    0xe39(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1237 <utl_fs2oratype+0xf7>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
lea    0xe26(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    12ac <utl_fs2oratype+0x16c>
mov    -0x18(%rbp),%rdi
lea    0xe19(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    126f <utl_fs2oratype+0x12f>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
lea    0xe05(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    12a7 <utl_fs2oratype+0x167>
mov    -0x18(%rbp),%rdi
lea    0xdf7(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12a2 <utl_fs2oratype+0x162>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
lea    0xdea(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    12a7 <utl_fs2oratype+0x167>
jmp    12ac <utl_fs2oratype+0x16c>
jmp    12b1 <utl_fs2oratype+0x171>
jmp    12b6 <utl_fs2oratype+0x176>
jmp    12bb <utl_fs2oratype+0x17b>
cmpq   $0x0,-0x18(%rbp)
jne    12e8 <utl_fs2oratype+0x1a8>
mov    $0x1,%edi
lea    0xdc3(%rip),%rsi
call   1050 <logmsg@plt>
mov    0x2d02(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12ff <utl_fs2oratype+0x1bf>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    0x2cde(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utl_fs2oratype>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11d3 <utl_fs2oratype+0x93>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11e4 <utl_fs2oratype+0xa4>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11f5 <utl_fs2oratype+0xb5>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1206 <utl_fs2oratype+0xc6>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1217 <utl_fs2oratype+0xd7>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    122e <utl_fs2oratype+0xee>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xeb2(%rip),%rdi
jmp    1226 <utl_fs2oratype+0xe6>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe2b(%rip),%rdi
jmp    1226 <utl_fs2oratype+0xe6>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe2f(%rip),%rdi
jmp    1226 <utl_fs2oratype+0xe6>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe35(%rip),%rdi
jmp    1226 <utl_fs2oratype+0xe6>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe3a(%rip),%rdi
jmp    1226 <utl_fs2oratype+0xe6>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe40(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rbx
test   %rbx,%rbx
je     123f <utl_fs2oratype+0xff>
mov    %rbx,(%r14)
mov    0x2d9b(%rip),%rax
jmp    1257 <utl_fs2oratype+0x117>
lea    0xe4f(%rip),%rsi
mov    $0x1,%edi
call   1050 <logmsg@plt>
mov    0x2d89(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"PACKAGE_SPEC\00"
@.str.1 = [8 x i8] c"PACKAGE\00"
@.str.2 = [13 x i8] c"PACKAGE_BODY\00"
@.str.3 = [13 x i8] c"PACKAGE BODY\00"
@.str.4 = [10 x i8] c"TYPE_BODY\00"
@.str.5 = [10 x i8] c"TYPE BODY\00"
@.str.6 = [12 x i8] c"JAVA_SOURCE\00"
@.str.7 = [12 x i8] c"JAVA SOURCE\00"
@.str.8 = [11 x i8] c"JAVA_CLASS\00"
@.str.9 = [11 x i8] c"JAVA CLASS\00"
@.str.10 = [18 x i8] c"MATERIALIZED_VIEW\00"
@.str.11 = [18 x i8] c"MATERIALIZED VIEW\00"
@.str.12 = [57 x i8] c"str_fs2oratype() - unable to malloc for normalized type.\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @utl_fs2oratype(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = call i32 @free(i8* %11)
%13 = call i8* @strdup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i8* %13, i8** %4
br label %59
14: ; preds = %1
%15 = load i8*, i8** %4
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8*, i8** %4
%20 = call i32 @free(i8* %19)
%21 = call i8* @strdup(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
store i8* %21, i8** %4
br label %58
22: ; preds = %14
%23 = load i8*, i8** %4
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i8*, i8** %4
%28 = call i32 @free(i8* %27)
%29 = call i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
store i8* %29, i8** %4
br label %57
30: ; preds = %22
%31 = load i8*, i8** %4
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = load i8*, i8** %4
%36 = call i32 @free(i8* %35)
%37 = call i8* @strdup(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
store i8* %37, i8** %4
br label %56
38: ; preds = %30
%39 = load i8*, i8** %4
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %38
%43 = load i8*, i8** %4
%44 = call i32 @free(i8* %43)
%45 = call i8* @strdup(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
store i8* %45, i8** %4
br label %55
46: ; preds = %38
%47 = load i8*, i8** %4
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %54
50: ; preds = %46
%51 = load i8*, i8** %4
%52 = call i32 @free(i8* %51)
%53 = call i8* @strdup(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
store i8* %53, i8** %4
br label %54
54: ; preds = %50, %46
br label %55
55: ; preds = %54, %42
br label %56
56: ; preds = %55, %34
br label %57
57: ; preds = %56, %26
br label %58
58: ; preds = %57, %18
br label %59
59: ; preds = %58, %10
%60 = load i8*, i8** %4
%61 = icmp eq i8* %60, null
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = call i32 @logmsg(i32 1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.12, i64 0, i64 0))
%64 = load i32, i32* @EXIT_FAILURE
store i32 %64, i32* %2
br label %69
65: ; preds = %59
%66 = load i8*, i8** %4
%67 = load i8**, i8*** %3
store i8* %66, i8** %67
%68 = load i32, i32* @EXIT_SUCCESS
store i32 %68, i32* %2
br label %69
69: ; preds = %65, %62
%70 = load i32, i32* %2
ret i32 %70
}

LLVM IR (-O2):
@.str = [13 x i8] c"PACKAGE_SPEC\00"
@.str.1 = [8 x i8] c"PACKAGE\00"
@.str.2 = [13 x i8] c"PACKAGE_BODY\00"
@.str.3 = [13 x i8] c"PACKAGE BODY\00"
@.str.4 = [10 x i8] c"TYPE_BODY\00"
@.str.5 = [10 x i8] c"TYPE BODY\00"
@.str.6 = [12 x i8] c"JAVA_SOURCE\00"
@.str.7 = [12 x i8] c"JAVA SOURCE\00"
@.str.8 = [11 x i8] c"JAVA_CLASS\00"
@.str.9 = [11 x i8] c"JAVA CLASS\00"
@.str.10 = [18 x i8] c"MATERIALIZED_VIEW\00"
@.str.11 = [18 x i8] c"MATERIALIZED VIEW\00"
@.str.12 = [57 x i8] c"str_fs2oratype() - unable to malloc for normalized type.\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @utl_fs2oratype(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @free(i8* %2)
%7 = tail call dereferenceable_or_null(8) i8* @strdup(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %38
8: ; preds = %1
%9 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = tail call i32 @free(i8* %2)
%13 = tail call dereferenceable_or_null(13) i8* @strdup(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %38
14: ; preds = %8
%15 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = tail call i32 @free(i8* %2)
%19 = tail call dereferenceable_or_null(10) i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %38
20: ; preds = %14
%21 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = tail call i32 @free(i8* %2)
%25 = tail call dereferenceable_or_null(12) i8* @strdup(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
br label %38
26: ; preds = %20
%27 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = tail call i32 @free(i8* %2)
%31 = tail call dereferenceable_or_null(11) i8* @strdup(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
br label %38
32: ; preds = %26
%33 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = tail call i32 @free(i8* %2)
%37 = tail call dereferenceable_or_null(18) i8* @strdup(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
br label %38
38: ; preds = %11, %23, %32, %35, %29, %17, %5
%39 = phi i8* [ %7, %5 ], [ %13, %11 ], [ %19, %17 ], [ %25, %23 ], [ %31, %29 ], [ %37, %35 ], [ %2, %32 ]
%40 = icmp eq i8* %39, null
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = tail call i32 @logmsg(i32 1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.12, i64 0, i64 0))
br label %44
43: ; preds = %38
store i8* %39, i8** %0
br label %44
44: ; preds = %43, %41
%45 = phi i32* [ @EXIT_FAILURE, %41 ], [ @EXIT_SUCCESS, %43 ]
%46 = load i32, i32* %45
ret i32 %46
}