#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 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();
  }
  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     11ad <main+0x3d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    11b8 <main+0x48>
lea    0xe4c(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe41(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11e1 <main+0x71>
mov    $0x0,%al
call   1030 <libntfs_version@plt>
mov    %eax,-0x1c(%rbp)
jmp    1294 <main+0x124>
mov    -0x18(%rbp),%rdi
lea    0xe1d(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    120a <main+0x9a>
mov    $0x0,%al
call   1080 <libextfs_version@plt>
mov    %eax,-0x1c(%rbp)
jmp    128f <main+0x11f>
mov    -0x18(%rbp),%rdi
lea    0xdfa(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1233 <main+0xc3>
mov    $0x0,%al
call   1050 <libreiserfs_version@plt>
mov    %eax,-0x1c(%rbp)
jmp    128a <main+0x11a>
mov    -0x18(%rbp),%rdi
lea    0xdda(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    125c <main+0xec>
mov    $0x0,%al
call   1090 <libvmfs_version@plt>
mov    %eax,-0x1c(%rbp)
jmp    1285 <main+0x115>
mov    -0x18(%rbp),%rdi
lea    0xdb6(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1280 <main+0x110>
mov    $0x0,%al
call   1070 <libpreiser4_version@plt>
mov    %eax,-0x1c(%rbp)
jmp    1285 <main+0x115>
jmp    128a <main+0x11a>
jmp    128f <main+0x11f>
jmp    1294 <main+0x124>
cmpl   $0x1,-0x1c(%rbp)
jne    12aa <main+0x13a>
lea    0xd80(%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    0xe81(%rip),%rbx
cmovne %rax,%rbx
lea    0xe7a(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11f5 <main+0x85>
lea    0xe6b(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1203 <main+0x93>
lea    0xe5d(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1211 <main+0xa1>
lea    0xe52(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     122d <main+0xbd>
lea    0xe43(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1229 <main+0xb9>
xor    %eax,%eax
call   1070 <libpreiser4_version@plt>
cmp    $0x1,%eax
je     121d <main+0xad>
jmp    1229 <main+0xb9>
xor    %eax,%eax
call   1040 <libntfs_version@plt>
cmp    $0x1,%eax
je     121d <main+0xad>
jmp    1229 <main+0xb9>
xor    %eax,%eax
call   1080 <libextfs_version@plt>
cmp    $0x1,%eax
je     121d <main+0xad>
jmp    1229 <main+0xb9>
xor    %eax,%eax
call   1050 <libreiserfs_version@plt>
cmp    $0x1,%eax
jne    1229 <main+0xb9>
lea    0xe01(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1090 <libvmfs_version@plt>
cmp    $0x1,%eax
je     121d <main+0xad>
jmp    1229 <main+0xb9>

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 = [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 %51
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 %50
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 %49
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 %48
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 %47
47: ; preds = %45, %41
br label %48
48: ; preds = %47, %39
br label %49
49: ; preds = %48, %33
br label %50
50: ; preds = %49, %27
br label %51
51: ; preds = %50, %21
%52 = load i32, i32* %7
%53 = icmp eq i32 %52, 1
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %56
56: ; preds = %54, %51
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 = [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 %31
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 %31
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 %31
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 %31
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 %36
29: ; preds = %26
%30 = tail call i32 (...) @libpreiser4_version()
br label %31
31: ; preds = %14, %24, %29, %19, %9
%32 = phi i32 [ %10, %9 ], [ %15, %14 ], [ %20, %19 ], [ %25, %24 ], [ %30, %29 ]
%33 = icmp eq i32 %32, 1
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %36
36: ; preds = %26, %34, %31
ret i32 0
}