#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 */
struct Backup {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ initBackup(struct Backup *, int);
int /*<<< orphan*/ printUsage();
scalar_t__ strcmp(char const *, char *);
void getAction(const char *argv, struct Backup *backup) {
  bool isFull = strcmp(argv, "f") == 0 || strcmp(argv, "full") == 0;
  bool isIncremental =
      strcmp(argv, "i") == 0 || strcmp(argv, "incremental") == 0;
  if (!isFull && !isIncremental) {
    printUsage();
  }
  initBackup(backup, isFull);
}


x86 assembly (clang, -O0):
<getAction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     117c <getAction+0x4c>
mov    -0x8(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe75(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1a(%rbp)
je     11c3 <getAction+0x93>
mov    -0x8(%rbp),%rdi
lea    0xe55(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11e9 <getAction+0xb9>
cmpl   $0x0,-0x18(%rbp)
jne    11e9 <getAction+0xb9>
mov    $0x0,%al
call   1050 <printUsage@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <initBackup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAction>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1163 <getAction+0x33>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %bpl
jmp    1166 <getAction+0x36>
mov    $0x1,%bpl
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     119b <getAction+0x6b>
lea    0xe88(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %al
or     %bpl,%al
jne    119b <getAction+0x6b>
xor    %eax,%eax
call   1050 <printUsage@plt>
movzbl %bpl,%esi
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <initBackup@plt>

LLVM IR (-O0):
%struct.Backup = type { i32 }
@.str = [2 x i8] c"f\00"
@.str.1 = [5 x i8] c"full\00"
@.str.2 = [2 x i8] c"i\00"
@.str.3 = [12 x i8] c"incremental\00"
define void @getAction(i8* %0, %struct.Backup* %1) {
%3 = alloca i8*
%4 = alloca %struct.Backup*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store %struct.Backup* %1, %struct.Backup** %4
%7 = load i8*, i8** %3
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br label %14
14: ; preds = %10, %2
%15 = phi i1 [ true, %2 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
store i32 %16, i32* %5
%17 = load i8*, i8** %3
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %14
%21 = load i8*, i8** %3
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br label %24
24: ; preds = %20, %14
%25 = phi i1 [ true, %14 ], [ %23, %20 ]
%26 = zext i1 %25 to i32
store i32 %26, i32* %6
%27 = load i32, i32* %5
%28 = icmp ne i32 %27, 0
br i1 %28, label %34, label %29
29: ; preds = %24
%30 = load i32, i32* %6
%31 = icmp ne i32 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %29
%33 = call i32 (...) @printUsage()
br label %34
34: ; preds = %32, %29, %24
%35 = load %struct.Backup*, %struct.Backup** %4
%36 = load i32, i32* %5
%37 = call i32 @initBackup(%struct.Backup* %35, i32 %36)
ret void
}

LLVM IR (-O2):
%struct.Backup = type { i32 }
@.str = [2 x i8] c"f\00"
@.str.1 = [5 x i8] c"full\00"
@.str.2 = [2 x i8] c"i\00"
@.str.3 = [12 x i8] c"incremental\00"
define void @getAction(i8* %0, %struct.Backup* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br label %8
8: ; preds = %5, %2
%9 = phi i1 [ true, %2 ], [ %7, %5 ]
%10 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %8
%13 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
%15 = select i1 %9, i1 true, i1 %14
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = tail call i32 (...) @printUsage()
br label %18
18: ; preds = %8, %16, %12
%19 = zext i1 %9 to i32
%20 = tail call i32 @initBackup(%struct.Backup* %1, i32 %19)
ret void
}