#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 fsck_exfat_main(int, char **);
int mkfs_exfat_main(int, char **);
int mount_exfat_main(int, char **);
scalar_t__ strstr(char *, char *);
int main(int argc, char *argv[]) {
  if (strstr(argv[0], "mkfs.exfat") != 0)
    return mkfs_exfat_main(argc, argv);
  if (strstr(argv[0], "fsck.exfat") != 0)
    return fsck_exfat_main(argc, argv);
  return mount_exfat_main(argc, argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe9c(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     1187 <main+0x47>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <mkfs_exfat_main@plt>
mov    %eax,-0x4(%rbp)
jmp    11c7 <main+0x87>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe76(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     11b8 <main+0x78>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fsck_exfat_main@plt>
mov    %eax,-0x4(%rbp)
jmp    11c7 <main+0x87>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <mount_exfat_main@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
lea    0xeae(%rip),%rsi
call   1050 <strstr@plt>
test   %rax,%rax
je     116c <main+0x2c>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mkfs_exfat_main@plt>
mov    (%rbx),%rdi
lea    0xe95(%rip),%rsi
call   1050 <strstr@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
test   %rax,%rax
je     1190 <main+0x50>
pop    %rbx
pop    %rbp
jmp    1030 <fsck_exfat_main@plt>
pop    %rbx
pop    %rbp
jmp    1040 <mount_exfat_main@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"mkfs.exfat\00"
@.str.1 = [11 x i8] c"fsck.exfat\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i64 @strstr(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @mkfs_exfat_main(i32 %12, i8** %13)
store i32 %14, i32* %3
br label %29
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i64 @strstr(i8* %18, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %15
%22 = load i32, i32* %4
%23 = load i8**, i8*** %5
%24 = call i32 @fsck_exfat_main(i32 %22, i8** %23)
store i32 %24, i32* %3
br label %29
25: ; preds = %15
%26 = load i32, i32* %4
%27 = load i8**, i8*** %5
%28 = call i32 @mount_exfat_main(i32 %26, i8** %27)
store i32 %28, i32* %3
br label %29
29: ; preds = %25, %21, %11
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str = [11 x i8] c"mkfs.exfat\00"
@.str.1 = [11 x i8] c"fsck.exfat\00"
define i32 @main(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @strstr(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @mkfs_exfat_main(i32 %0, i8** %1)
br label %16
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i64 @strstr(i8* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = tail call i32 @fsck_exfat_main(i32 %0, i8** %1)
br label %16
14: ; preds = %8
%15 = tail call i32 @mount_exfat_main(i32 %0, i8** %1)
br label %16
16: ; preds = %14, %12, %6
%17 = phi i32 [ %7, %6 ], [ %13, %12 ], [ %15, %14 ]
ret i32 %17
}