#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 add_mount(char const *, char const *, char const *, char const *,
              char const *);
int add_mount_legacy(char const *, char const *, char const *, char const *,
                     char const *);
int /*<<< orphan*/ mtab_needs_update(char const *);
int fuse_mnt_add_mount(const char *progname, const char *fsname,
                       const char *mnt, const char *type, const char *opts) {
  int res;
  if (!mtab_needs_update(mnt))
    return 0;
  res = add_mount(progname, fsname, mnt, type, opts);
  if (res == -1)
    res = add_mount_legacy(progname, fsname, mnt, type, opts);
  return res;
}


x86 assembly (clang, -O0):
<fuse_mnt_add_mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <mtab_needs_update@plt>
cmp    $0x0,%eax
jne    116a <fuse_mnt_add_mount+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    11b2 <fuse_mnt_add_mount+0x82>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1040 <add_mount@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jne    11ac <fuse_mnt_add_mount+0x7c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1030 <add_mount_legacy@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuse_mnt_add_mount>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %rsi,%r12
mov    %rdi,%r13
mov    %rdx,%rdi
call   1050 <mtab_needs_update@plt>
test   %eax,%eax
je     118a <fuse_mnt_add_mount+0x5a>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1040 <add_mount@plt>
cmp    $0xffffffff,%eax
jne    118c <fuse_mnt_add_mount+0x5c>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r14,%r8
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <add_mount_legacy@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @fuse_mnt_add_mount(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
%13 = load i8*, i8** %9
%14 = call i32 @mtab_needs_update(i8* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %5
store i32 0, i32* %6
br label %35
17: ; preds = %5
%18 = load i8*, i8** %7
%19 = load i8*, i8** %8
%20 = load i8*, i8** %9
%21 = load i8*, i8** %10
%22 = load i8*, i8** %11
%23 = call i32 @add_mount(i8* %18, i8* %19, i8* %20, i8* %21, i8* %22)
store i32 %23, i32* %12
%24 = load i32, i32* %12
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %33
26: ; preds = %17
%27 = load i8*, i8** %7
%28 = load i8*, i8** %8
%29 = load i8*, i8** %9
%30 = load i8*, i8** %10
%31 = load i8*, i8** %11
%32 = call i32 @add_mount_legacy(i8* %27, i8* %28, i8* %29, i8* %30, i8* %31)
store i32 %32, i32* %12
br label %33
33: ; preds = %26, %17
%34 = load i32, i32* %12
store i32 %34, i32* %6
br label %35
35: ; preds = %33, %16
%36 = load i32, i32* %6
ret i32 %36
}

LLVM IR (-O2):
define i32 @fuse_mnt_add_mount(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @mtab_needs_update(i8* %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %5
%9 = tail call i32 @add_mount(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @add_mount_legacy(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4)
br label %13
13: ; preds = %8, %11, %5
%14 = phi i32 [ 0, %5 ], [ %12, %11 ], [ %9, %8 ]
ret i32 %14
}