#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 libbtrfs_version();
int libextfs_version();
int libntfs_version();
int libpreiser4_version();
int libreiserfs_version();
int libvmfs_version();
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  char *libfs;
  int err = 0;
  if (argv[1]) {
    libfs = argv[1];
  } else {
    libfs = "xxx";
  }
  if (strcmp(libfs, "ntfs") == 0) {
    err = libntfs_version();
  } else if (strcmp(libfs, "extfs") == 0) {
    err = libextfs_version();
  } else if (strcmp(libfs, "reiserfs") == 0) {
    err = libreiserfs_version();
  } else if (strcmp(libfs, "vmfs") == 0) {
    err = libvmfs_version();
  } else if (strcmp(libfs, "reiser4") == 0) {
    err = libpreiser4_version();
  } else if (strcmp(libfs, "btrfs") == 0) {
    err = libbtrfs_version();
  }
  if (err == 1) {
    printf("0\n");
  }
  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)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     11bd <main+0x3d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    11c8 <main+0x48>
lea    0xe3c(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe31(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11f1 <main+0x71>
mov    $0x0,%al
call   1030 <libntfs_version@plt>
mov    %eax,-0x1c(%rbp)
jmp    12d2 <main+0x152>
mov    -0x18(%rbp),%rdi
lea    0xe0d(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    121a <main+0x9a>
mov    $0x0,%al
call   1080 <libextfs_version@plt>
mov    %eax,-0x1c(%rbp)
jmp    12cd <main+0x14d>
mov    -0x18(%rbp),%rdi
lea    0xdea(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1243 <main+0xc3>
mov    $0x0,%al
call   1050 <libreiserfs_version@plt>
mov    %eax,-0x1c(%rbp)
jmp    12c8 <main+0x148>
mov    -0x18(%rbp),%rdi
lea    0xdca(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    126c <main+0xec>
mov    $0x0,%al
call   1090 <libvmfs_version@plt>
mov    %eax,-0x1c(%rbp)
jmp    12c3 <main+0x143>
mov    -0x18(%rbp),%rdi
lea    0xda6(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1295 <main+0x115>
mov    $0x0,%al
call   1070 <libpreiser4_version@plt>
mov    %eax,-0x1c(%rbp)
jmp    12be <main+0x13e>
mov    -0x18(%rbp),%rdi
lea    0xd85(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12b9 <main+0x139>
mov    $0x0,%al
call   10a0 <libbtrfs_version@plt>
mov    %eax,-0x1c(%rbp)
jmp    12be <main+0x13e>
jmp    12c3 <main+0x143>
jmp    12c8 <main+0x148>
jmp    12cd <main+0x14d>
jmp    12d2 <main+0x152>
cmpl   $0x1,-0x1c(%rbp)
jne    12e8 <main+0x168>
lea    0xd48(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rax
test   %rax,%rax
lea    0xe71(%rip),%rbx
cmovne %rax,%rbx
lea    0xe6a(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1219 <main+0x99>
lea    0xe5b(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1227 <main+0xa7>
lea    0xe4d(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1235 <main+0xb5>
lea    0xe42(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1243 <main+0xc3>
lea    0xe33(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     125f <main+0xdf>
lea    0xe27(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    125b <main+0xdb>
xor    %eax,%eax
call   10a0 <libbtrfs_version@plt>
cmp    $0x1,%eax
je     124f <main+0xcf>
jmp    125b <main+0xdb>
xor    %eax,%eax
call   1040 <libntfs_version@plt>
cmp    $0x1,%eax
je     124f <main+0xcf>
jmp    125b <main+0xdb>
xor    %eax,%eax
call   1080 <libextfs_version@plt>
cmp    $0x1,%eax
je     124f <main+0xcf>
jmp    125b <main+0xdb>
xor    %eax,%eax
call   1050 <libreiserfs_version@plt>
cmp    $0x1,%eax
je     124f <main+0xcf>
jmp    125b <main+0xdb>
xor    %eax,%eax
call   1090 <libvmfs_version@plt>
cmp    $0x1,%eax
jne    125b <main+0xdb>
lea    0xdd5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1070 <libpreiser4_version@plt>
cmp    $0x1,%eax
je     124f <main+0xcf>
jmp    125b <main+0xdb>

LLVM IR (-O0):
@.str = [4 x i8] c"xxx\00"
@.str.1 = [5 x i8] c"ntfs\00"
@.str.2 = [6 x i8] c"extfs\00"
@.str.3 = [9 x i8] c"reiserfs\00"
@.str.4 = [5 x i8] c"vmfs\00"
@.str.5 = [8 x i8] c"reiser4\00"
@.str.6 = [6 x i8] c"btrfs\00"
@.str.7 = [3 x i8] c"0\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
store i8* %15, i8** %6
br label %17
16: ; preds = %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %6
br label %17
17: ; preds = %16, %12
%18 = load i8*, i8** %6
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 (...) @libntfs_version()
store i32 %22, i32* %7
br label %58
23: ; preds = %17
%24 = load i8*, i8** %6
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 (...) @libextfs_version()
store i32 %28, i32* %7
br label %57
29: ; preds = %23
%30 = load i8*, i8** %6
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 (...) @libreiserfs_version()
store i32 %34, i32* %7
br label %56
35: ; preds = %29
%36 = load i8*, i8** %6
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i32 (...) @libvmfs_version()
store i32 %40, i32* %7
br label %55
41: ; preds = %35
%42 = load i8*, i8** %6
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = call i32 (...) @libpreiser4_version()
store i32 %46, i32* %7
br label %54
47: ; preds = %41
%48 = load i8*, i8** %6
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = call i32 (...) @libbtrfs_version()
store i32 %52, i32* %7
br label %53
53: ; preds = %51, %47
br label %54
54: ; preds = %53, %45
br label %55
55: ; preds = %54, %39
br label %56
56: ; preds = %55, %33
br label %57
57: ; preds = %56, %27
br label %58
58: ; preds = %57, %21
%59 = load i32, i32* %7
%60 = icmp eq i32 %59, 1
br i1 %60, label %61, label %63
61: ; preds = %58
%62 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %63
63: ; preds = %61, %58
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"xxx\00"
@.str.1 = [5 x i8] c"ntfs\00"
@.str.2 = [6 x i8] c"extfs\00"
@.str.3 = [9 x i8] c"reiserfs\00"
@.str.4 = [5 x i8] c"vmfs\00"
@.str.5 = [8 x i8] c"reiser4\00"
@.str.6 = [6 x i8] c"btrfs\00"
@str = [2 x i8] c"0\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (...) @libntfs_version()
br label %36
11: ; preds = %2
%12 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 (...) @libextfs_version()
br label %36
16: ; preds = %11
%17 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 (...) @libreiserfs_version()
br label %36
21: ; preds = %16
%22 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = tail call i32 (...) @libvmfs_version()
br label %36
26: ; preds = %21
%27 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = tail call i32 (...) @libpreiser4_version()
br label %36
31: ; preds = %26
%32 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %41
34: ; preds = %31
%35 = tail call i32 (...) @libbtrfs_version()
br label %36
36: ; preds = %14, %24, %34, %29, %19, %9
%37 = phi i32 [ %10, %9 ], [ %15, %14 ], [ %20, %19 ], [ %25, %24 ], [ %30, %29 ], [ %35, %34 ]
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %41
41: ; preds = %31, %39, %36
ret i32 0
}