#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 backup(int, char **);
int bsf(char *);
int fsf(char *);
int get_record_size();
int initialize(char *);
int insert();
int print_header();
int restore(int, char **);
int show_backups();
int show_records(int, char **);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int ret;
  if (!strcmp(argv[1], "initialize")) {
    ret = initialize(argv[2]);
  } else if (!strcmp(argv[1], "insert")) {
    ret = insert();
  } else if (!strcmp(argv[1], "backup")) {
    ret = backup(argc, argv);
  } else if (!strcmp(argv[1], "restore")) {
    ret = restore(argc, argv);
  } else if (!strcmp(argv[1], "show_records")) {
    ret = show_records(argc, argv);
  } else if (!strcmp(argv[1], "show_backups")) {
    ret = show_backups();
  } else if (!strcmp(argv[1], "fsf")) {
    ret = fsf(argv[2]);
  } else if (!strcmp(argv[1], "bsf")) {
    ret = bsf(argv[2]);
  } else if (!strcmp(argv[1], "print_header")) {
    ret = print_header();
  } else if (!strcmp(argv[1], "get_record_size")) {
    ret = get_record_size();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11f8 <main+0x48>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <initialize@plt>
mov    %eax,-0x14(%rbp)
jmp    13c7 <main+0x217>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe04(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1224 <main+0x74>
mov    $0x0,%al
call   1080 <insert@plt>
mov    %eax,-0x14(%rbp)
jmp    13c2 <main+0x212>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xddf(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1255 <main+0xa5>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <backup@plt>
mov    %eax,-0x14(%rbp)
jmp    13bd <main+0x20d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdb5(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1286 <main+0xd6>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <restore@plt>
mov    %eax,-0x14(%rbp)
jmp    13b8 <main+0x208>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd8c(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12b7 <main+0x107>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10d0 <show_records@plt>
mov    %eax,-0x14(%rbp)
jmp    13b3 <main+0x203>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd68(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12e3 <main+0x133>
mov    $0x0,%al
call   10b0 <show_backups@plt>
mov    %eax,-0x14(%rbp)
jmp    13ae <main+0x1fe>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd49(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1315 <main+0x165>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <fsf@plt>
mov    %eax,-0x14(%rbp)
jmp    13a9 <main+0x1f9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd1b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1347 <main+0x197>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <bsf@plt>
mov    %eax,-0x14(%rbp)
jmp    13a4 <main+0x1f4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xced(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1373 <main+0x1c3>
mov    $0x0,%al
call   1090 <print_header@plt>
mov    %eax,-0x14(%rbp)
jmp    139f <main+0x1ef>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xcce(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    139a <main+0x1ea>
mov    $0x0,%al
call   10a0 <get_record_size@plt>
mov    %eax,-0x14(%rbp)
jmp    139f <main+0x1ef>
jmp    13a4 <main+0x1f4>
jmp    13a9 <main+0x1f9>
jmp    13ae <main+0x1fe>
jmp    13b3 <main+0x203>
jmp    13b8 <main+0x208>
jmp    13bd <main+0x20d>
jmp    13c2 <main+0x212>
jmp    13c7 <main+0x217>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x8(%rsi),%rbx
lea    0xe3c(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12a0 <main+0xf0>
lea    0xe30(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12ab <main+0xfb>
lea    0xe20(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12b4 <main+0x104>
lea    0xe10(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12c0 <main+0x110>
lea    0xe01(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12cc <main+0x11c>
lea    0xdf7(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12d8 <main+0x128>
lea    0xded(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12e1 <main+0x131>
lea    0xdda(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12ec <main+0x13c>
lea    0xdcb(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12f7 <main+0x147>
lea    0xdc5(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    12fe <main+0x14e>
xor    %eax,%eax
call   10a0 <get_record_size@plt>
jmp    12fe <main+0x14e>
mov    0x10(%r14),%rdi
call   1040 <initialize@plt>
jmp    12fe <main+0x14e>
xor    %eax,%eax
call   1080 <insert@plt>
jmp    12fe <main+0x14e>
mov    %ebp,%edi
mov    %r14,%rsi
call   1070 <backup@plt>
jmp    12fe <main+0x14e>
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <restore@plt>
jmp    12fe <main+0x14e>
mov    %ebp,%edi
mov    %r14,%rsi
call   10d0 <show_records@plt>
jmp    12fe <main+0x14e>
xor    %eax,%eax
call   10b0 <show_backups@plt>
jmp    12fe <main+0x14e>
mov    0x10(%r14),%rdi
call   1060 <fsf@plt>
jmp    12fe <main+0x14e>
mov    0x10(%r14),%rdi
call   10c0 <bsf@plt>
jmp    12fe <main+0x14e>
xor    %eax,%eax
call   1090 <print_header@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"initialize\00"
@.str.1 = [7 x i8] c"insert\00"
@.str.2 = [7 x i8] c"backup\00"
@.str.3 = [8 x i8] c"restore\00"
@.str.4 = [13 x i8] c"show_records\00"
@.str.5 = [13 x i8] c"show_backups\00"
@.str.6 = [4 x i8] c"fsf\00"
@.str.7 = [4 x i8] c"bsf\00"
@.str.8 = [13 x i8] c"print_header\00"
@.str.9 = [16 x i8] c"get_record_size\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @strcmp(i8* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @initialize(i8* %15)
store i32 %16, i32* %6
br label %110
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @strcmp(i8* %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %17
%24 = call i32 (...) @insert()
store i32 %24, i32* %6
br label %109
25: ; preds = %17
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @strcmp(i8* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %35, label %31
31: ; preds = %25
%32 = load i32, i32* %4
%33 = load i8**, i8*** %5
%34 = call i32 @backup(i32 %32, i8** %33)
store i32 %34, i32* %6
br label %108
35: ; preds = %25
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i32 @strcmp(i8* %38, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%40 = icmp ne i32 %39, 0
br i1 %40, label %45, label %41
41: ; preds = %35
%42 = load i32, i32* %4
%43 = load i8**, i8*** %5
%44 = call i32 @restore(i32 %42, i8** %43)
store i32 %44, i32* %6
br label %107
45: ; preds = %35
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i32 @strcmp(i8* %48, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%50 = icmp ne i32 %49, 0
br i1 %50, label %55, label %51
51: ; preds = %45
%52 = load i32, i32* %4
%53 = load i8**, i8*** %5
%54 = call i32 @show_records(i32 %52, i8** %53)
store i32 %54, i32* %6
br label %106
55: ; preds = %45
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 1
%58 = load i8*, i8** %57
%59 = call i32 @strcmp(i8* %58, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%60 = icmp ne i32 %59, 0
br i1 %60, label %63, label %61
61: ; preds = %55
%62 = call i32 (...) @show_backups()
store i32 %62, i32* %6
br label %105
63: ; preds = %55
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 1
%66 = load i8*, i8** %65
%67 = call i32 @strcmp(i8* %66, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%68 = icmp ne i32 %67, 0
br i1 %68, label %74, label %69
69: ; preds = %63
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 2
%72 = load i8*, i8** %71
%73 = call i32 @fsf(i8* %72)
store i32 %73, i32* %6
br label %104
74: ; preds = %63
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 1
%77 = load i8*, i8** %76
%78 = call i32 @strcmp(i8* %77, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%79 = icmp ne i32 %78, 0
br i1 %79, label %85, label %80
80: ; preds = %74
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 2
%83 = load i8*, i8** %82
%84 = call i32 @bsf(i8* %83)
store i32 %84, i32* %6
br label %103
85: ; preds = %74
%86 = load i8**, i8*** %5
%87 = getelementptr inbounds i8*, i8** %86, i64 1
%88 = load i8*, i8** %87
%89 = call i32 @strcmp(i8* %88, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%90 = icmp ne i32 %89, 0
br i1 %90, label %93, label %91
91: ; preds = %85
%92 = call i32 (...) @print_header()
store i32 %92, i32* %6
br label %102
93: ; preds = %85
%94 = load i8**, i8*** %5
%95 = getelementptr inbounds i8*, i8** %94, i64 1
%96 = load i8*, i8** %95
%97 = call i32 @strcmp(i8* %96, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%98 = icmp ne i32 %97, 0
br i1 %98, label %101, label %99
99: ; preds = %93
%100 = call i32 (...) @get_record_size()
store i32 %100, i32* %6
br label %101
101: ; preds = %99, %93
br label %102
102: ; preds = %101, %91
br label %103
103: ; preds = %102, %80
br label %104
104: ; preds = %103, %69
br label %105
105: ; preds = %104, %61
br label %106
106: ; preds = %105, %51
br label %107
107: ; preds = %106, %41
br label %108
108: ; preds = %107, %31
br label %109
109: ; preds = %108, %23
br label %110
110: ; preds = %109, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"initialize\00"
@.str.1 = [7 x i8] c"insert\00"
@.str.2 = [7 x i8] c"backup\00"
@.str.3 = [8 x i8] c"restore\00"
@.str.4 = [13 x i8] c"show_records\00"
@.str.5 = [13 x i8] c"show_backups\00"
@.str.6 = [4 x i8] c"fsf\00"
@.str.7 = [4 x i8] c"bsf\00"
@.str.8 = [13 x i8] c"print_header\00"
@.str.9 = [16 x i8] c"get_record_size\00"
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @initialize(i8* %9)
br label %60
11: ; preds = %2
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 (...) @insert()
br label %60
16: ; preds = %11
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 @backup(i32 %0, i8** %1)
br label %60
21: ; preds = %16
%22 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = tail call i32 @restore(i32 %0, i8** %1)
br label %60
26: ; preds = %21
%27 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = tail call i32 @show_records(i32 %0, i8** %1)
br label %60
31: ; preds = %26
%32 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = tail call i32 (...) @show_backups()
br label %60
36: ; preds = %31
%37 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %43
39: ; preds = %36
%40 = getelementptr inbounds i8*, i8** %1, i64 2
%41 = load i8*, i8** %40
%42 = tail call i32 @fsf(i8* %41)
br label %60
43: ; preds = %36
%44 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %50
46: ; preds = %43
%47 = getelementptr inbounds i8*, i8** %1, i64 2
%48 = load i8*, i8** %47
%49 = tail call i32 @bsf(i8* %48)
br label %60
50: ; preds = %43
%51 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %50
%54 = tail call i32 (...) @print_header()
br label %60
55: ; preds = %50
%56 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(16) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = tail call i32 (...) @get_record_size()
br label %60
60: ; preds = %14, %24, %34, %46, %55, %58, %53, %39, %29, %19, %7
ret i32 0
}