#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*/ syntax();
int getbackuptype(char *str) {
  if (!str || !*str || (!strcmp(str, "none")) || (!strcmp(str, "off")))
    return 0;
  else if ((!strcmp(str, "t")) || (!strcmp(str, "numbered")))
    return 1;
  else if ((!strcmp(str, "nil")) || (!strcmp(str, "existing")))
    return 2;
  else if ((!strcmp(str, "simple")) || (!strcmp(str, "never")))
    return 3;
  else
    syntax();
}


x86 assembly (clang, -O0):
<getbackuptype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1176 <getbackuptype+0x56>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1176 <getbackuptype+0x56>
mov    -0x10(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     1176 <getbackuptype+0x56>
mov    -0x10(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1182 <getbackuptype+0x62>
movl   $0x0,-0x4(%rbp)
jmp    1252 <getbackuptype+0x132>
mov    -0x10(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     11b4 <getbackuptype+0x94>
mov    -0x10(%rbp),%rdi
lea    0xe65(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11c0 <getbackuptype+0xa0>
movl   $0x1,-0x4(%rbp)
jmp    1252 <getbackuptype+0x132>
mov    -0x10(%rbp),%rdi
lea    0xe49(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     11f2 <getbackuptype+0xd2>
mov    -0x10(%rbp),%rdi
lea    0xe34(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11fe <getbackuptype+0xde>
movl   $0x2,-0x4(%rbp)
jmp    1252 <getbackuptype+0x132>
mov    -0x10(%rbp),%rdi
lea    0xe18(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     1230 <getbackuptype+0x110>
mov    -0x10(%rbp),%rdi
lea    0xe06(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    123c <getbackuptype+0x11c>
movl   $0x3,-0x4(%rbp)
jmp    1252 <getbackuptype+0x132>
mov    $0x0,%al
call   1040 <syntax@plt>
jmp    1248 <getbackuptype+0x128>
jmp    124d <getbackuptype+0x12d>
jmp    1252 <getbackuptype+0x132>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbackuptype>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     11f0 <getbackuptype+0xd0>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     11f0 <getbackuptype+0xd0>
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11f0 <getbackuptype+0xd0>
lea    0xead(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11f0 <getbackuptype+0xd0>
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     11f0 <getbackuptype+0xd0>
lea    0xe84(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11f0 <getbackuptype+0xd0>
lea    0xe7a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    $0x2,%ebp
test   %eax,%eax
je     11f0 <getbackuptype+0xd0>
lea    0xe66(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11f0 <getbackuptype+0xd0>
lea    0xe5c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    $0x3,%ebp
test   %eax,%eax
je     11f0 <getbackuptype+0xd0>
lea    0xe4b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11f0 <getbackuptype+0xd0>
xor    %eax,%eax
call   1040 <syntax@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"none\00"
@.str.1 = [4 x i8] c"off\00"
@.str.2 = [2 x i8] c"t\00"
@.str.3 = [9 x i8] c"numbered\00"
@.str.4 = [4 x i8] c"nil\00"
@.str.5 = [9 x i8] c"existing\00"
@.str.6 = [7 x i8] c"simple\00"
@.str.7 = [6 x i8] c"never\00"
define i32 @getbackuptype(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %18
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = call i32 @strcmp(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %14, %10, %6, %1
store i32 0, i32* %2
br label %51
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = call i32 @strcmp(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8*, i8** %3
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp ne i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %23, %19
store i32 1, i32* %2
br label %51
28: ; preds = %23
%29 = load i8*, i8** %3
%30 = call i32 @strcmp(i8* %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %28
%33 = load i8*, i8** %3
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %32, %28
store i32 2, i32* %2
br label %51
37: ; preds = %32
%38 = load i8*, i8** %3
%39 = call i32 @strcmp(i8* %38, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %45
41: ; preds = %37
%42 = load i8*, i8** %3
%43 = call i32 @strcmp(i8* %42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %41, %37
store i32 3, i32* %2
br label %51
46: ; preds = %41
%47 = call i32 (...) @syntax()
br label %48
48: ; preds = %46
br label %49
49: ; preds = %48
br label %50
50: ; preds = %49
br label %51
51: ; preds = %18, %27, %36, %45, %50
%52 = load i32, i32* %2
ret i32 %52
}

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
@.str.1 = [4 x i8] c"off\00"
@.str.2 = [2 x i8] c"t\00"
@.str.3 = [9 x i8] c"numbered\00"
@.str.4 = [4 x i8] c"nil\00"
@.str.5 = [9 x i8] c"existing\00"
@.str.6 = [7 x i8] c"simple\00"
@.str.7 = [6 x i8] c"never\00"
define i32 @getbackuptype(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %32, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %32, label %6
6: ; preds = %3
%7 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %32, label %9
9: ; preds = %6
%10 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %32, label %12
12: ; preds = %9
%13 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %32, label %15
15: ; preds = %12
%16 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %32, label %18
18: ; preds = %15
%19 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %32, label %21
21: ; preds = %18
%22 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %32, label %24
24: ; preds = %21
%25 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
br i1 %26, label %32, label %27
27: ; preds = %24
%28 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%29 = icmp eq i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = tail call i32 (...) @syntax()
br label %32
32: ; preds = %24, %27, %18, %21, %12, %15, %1, %3, %6, %9, %30
%33 = phi i32 [ undef, %30 ], [ 0, %9 ], [ 0, %6 ], [ 0, %3 ], [ 0, %1 ], [ 1, %15 ], [ 1, %12 ], [ 2, %21 ], [ 2, %18 ], [ 3, %27 ], [ 3, %24 ]
ret i32 %33
}