#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 */
struct mntent {
  char *mnt_type;
  char *mnt_dir;
  int /*<<< orphan*/ mnt_opts;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EINVAL;
int ENOKEY;
int ecryptfs_remove_auth_tok_from_keyring(char *);
int /*<<< orphan*/ endmntent(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ free(char *);
int get_mount_opt_value(int /*<<< orphan*/, char *, char **);
struct mntent *getmntent(int /*<<< orphan*/ *);
int /*<<< orphan*/ hasmntopt(struct mntent *, char *);
int /*<<< orphan*/ *setmntent(char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char const *, char *);
char *strerror(int);
int unlink_keys_from_keyring(const char *mnt_point) {
  struct mntent *mntent;
  FILE *file;
  char *fekek_sig = NULL, *fnek_sig = NULL;
  int fekek_fail = 0, fnek_fail = 0;
  int rc;
  file = setmntent("/etc/mtab", "r");
  if (!file) {
    rc = EINVAL;
    goto out;
  }
  while ((mntent = getmntent(file))) {
    if (strcmp("ecryptfs", mntent->mnt_type))
      continue;
    if (strcmp(mnt_point, mntent->mnt_dir))
      continue;
    break;
  }
  if (!mntent) {
    rc = EINVAL;
    goto end_out;
  }
  if (!hasmntopt(mntent, "ecryptfs_unlink_sigs")) {
    rc = 0;
    goto end_out;
  }
  rc = get_mount_opt_value(mntent->mnt_opts, "ecryptfs_sig=", &fekek_sig);
  if (!rc) {
    fekek_fail = ecryptfs_remove_auth_tok_from_keyring(fekek_sig);
    if (fekek_fail == ENOKEY)
      fekek_fail = 0;
    if (fekek_fail)
      fprintf(stderr,
              "Failed to remove fekek with sig [%s] "
              "from keyring: %s\n",
              fekek_sig, strerror(fekek_fail));
  } else {
    fekek_fail = rc;
  }
  if (!get_mount_opt_value(mntent->mnt_opts, "ecryptfs_fnek_sig=", &fnek_sig) &&
      strcmp(fekek_sig, fnek_sig)) {
    fnek_fail = ecryptfs_remove_auth_tok_from_keyring(fnek_sig);
    if (fnek_fail == ENOKEY)
      fnek_fail = 0;
    if (fnek_fail) {
      fprintf(stderr,
              "Failed to remove fnek with sig [%s] "
              "from keyring: %s\n",
              fnek_sig, strerror(fnek_fail));
    }
  }
  free(fekek_sig);
  free(fnek_sig);
end_out:
  endmntent(file);
out:
  return (fekek_fail ? fekek_fail : (fnek_fail ? fnek_fail : rc));
}


x86 assembly (clang, -O0):
<unlink_keys_from_keyring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
lea    0xe2f(%rip),%rdi
lea    0xe32(%rip),%rsi
call   1090 <setmntent@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11fd <unlink_keys_from_keyring+0x5d>
mov    0x2ddd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
jmp    13e9 <unlink_keys_from_keyring+0x249>
jmp    1202 <unlink_keys_from_keyring+0x62>
mov    -0x18(%rbp),%rdi
call   1080 <getmntent@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1260 <unlink_keys_from_keyring+0xc0>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xde5(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     123b <unlink_keys_from_keyring+0x9b>
jmp    1202 <unlink_keys_from_keyring+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     125b <unlink_keys_from_keyring+0xbb>
jmp    1202 <unlink_keys_from_keyring+0x62>
jmp    1260 <unlink_keys_from_keyring+0xc0>
cmpq   $0x0,-0x10(%rbp)
jne    127c <unlink_keys_from_keyring+0xdc>
mov    0x2d5e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
jmp    13e0 <unlink_keys_from_keyring+0x240>
mov    -0x10(%rbp),%rdi
lea    0xd8e(%rip),%rsi
call   10c0 <hasmntopt@plt>
cmp    $0x0,%eax
jne    12a1 <unlink_keys_from_keyring+0x101>
movl   $0x0,-0x34(%rbp)
jmp    13e0 <unlink_keys_from_keyring+0x240>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%edi
lea    0xd7b(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <get_mount_opt_value@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jne    132b <unlink_keys_from_keyring+0x18b>
mov    -0x20(%rbp),%rdi
call   10a0 <ecryptfs_remove_auth_tok_from_keyring@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2cfd(%rip),%rcx
cmp    (%rcx),%eax
jne    12ea <unlink_keys_from_keyring+0x14a>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     1326 <unlink_keys_from_keyring+0x186>
mov    0x2ce5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x2c(%rbp),%edi
call   10b0 <strerror@plt>
mov    -0x44(%rbp),%edi
mov    -0x40(%rbp),%rdx
mov    %rax,%rcx
lea    0xd17(%rip),%rsi
call   1070 <fprintf@plt>
jmp    1331 <unlink_keys_from_keyring+0x191>
mov    -0x34(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%edi
lea    0xd30(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <get_mount_opt_value@plt>
cmp    $0x0,%eax
jne    13ce <unlink_keys_from_keyring+0x22e>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     13ce <unlink_keys_from_keyring+0x22e>
mov    -0x28(%rbp),%rdi
call   10a0 <ecryptfs_remove_auth_tok_from_keyring@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    0x2c5a(%rip),%rcx
cmp    (%rcx),%eax
jne    138d <unlink_keys_from_keyring+0x1ed>
movl   $0x0,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
je     13c9 <unlink_keys_from_keyring+0x229>
mov    0x2c42(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x30(%rbp),%edi
call   10b0 <strerror@plt>
mov    -0x54(%rbp),%edi
mov    -0x50(%rbp),%rdx
mov    %rax,%rcx
lea    0xcbe(%rip),%rsi
call   1070 <fprintf@plt>
jmp    13ce <unlink_keys_from_keyring+0x22e>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1040 <endmntent@plt>
cmpl   $0x0,-0x2c(%rbp)
je     13fe <unlink_keys_from_keyring+0x25e>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x58(%rbp)
jmp    141f <unlink_keys_from_keyring+0x27f>
cmpl   $0x0,-0x30(%rbp)
je     1413 <unlink_keys_from_keyring+0x273>
mov    -0x30(%rbp),%eax
mov    %eax,-0x5c(%rbp)
jmp    1419 <unlink_keys_from_keyring+0x279>
mov    -0x34(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink_keys_from_keyring>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r14
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xe36(%rip),%rdi
lea    0xe39(%rip),%rsi
call   1090 <setmntent@plt>
test   %rax,%rax
je     136d <unlink_keys_from_keyring+0x1cd>
mov    %rax,%r12
mov    %rax,%rdi
call   1080 <getmntent@plt>
test   %rax,%rax
je     1359 <unlink_keys_from_keyring+0x1b9>
mov    %rax,%rbp
lea    0xe0f(%rip),%rbx
jmp    1214 <unlink_keys_from_keyring+0x74>
nop
mov    %r12,%rdi
call   1080 <getmntent@plt>
mov    %rax,%rbp
test   %rax,%rax
je     1359 <unlink_keys_from_keyring+0x1b9>
mov    0x0(%rbp),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1200 <unlink_keys_from_keyring+0x60>
mov    0x8(%rbp),%rsi
mov    %r14,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1200 <unlink_keys_from_keyring+0x60>
lea    0xdd8(%rip),%rsi
mov    %rbp,%rdi
call   10c0 <hasmntopt@plt>
test   %eax,%eax
je     138c <unlink_keys_from_keyring+0x1ec>
mov    0x10(%rbp),%edi
lea    0xdd3(%rip),%rsi
lea    0x10(%rsp),%rdx
call   1050 <get_mount_opt_value@plt>
mov    %eax,%r14d
mov    %eax,%r15d
test   %eax,%eax
jne    12b9 <unlink_keys_from_keyring+0x119>
mov    0x10(%rsp),%rdi
call   10a0 <ecryptfs_remove_auth_tok_from_keyring@plt>
mov    %eax,%ebx
mov    0x2d5a(%rip),%rax
xor    %r15d,%r15d
cmp    (%rax),%ebx
cmove  %r15d,%ebx
test   %ebx,%ebx
je     12b9 <unlink_keys_from_keyring+0x119>
mov    0x2d4e(%rip),%rax
mov    (%rax),%r15d
mov    0x10(%rsp),%r13
mov    %ebx,%edi
call   10b0 <strerror@plt>
lea    0xd90(%rip),%rsi
mov    %r15d,%edi
mov    %r13,%rdx
mov    %rax,%rcx
call   1070 <fprintf@plt>
mov    %ebx,%r15d
mov    0x10(%rbp),%edi
lea    0xdac(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1050 <get_mount_opt_value@plt>
xor    %ebp,%ebp
test   %eax,%eax
jne    1330 <unlink_keys_from_keyring+0x190>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1330 <unlink_keys_from_keyring+0x190>
mov    0x8(%rsp),%rdi
call   10a0 <ecryptfs_remove_auth_tok_from_keyring@plt>
mov    %eax,%ebx
mov    0x2cde(%rip),%rax
xor    %ebp,%ebp
cmp    (%rax),%ebx
cmove  %ebp,%ebx
test   %ebx,%ebx
je     1330 <unlink_keys_from_keyring+0x190>
mov    0x2cd4(%rip),%rax
mov    (%rax),%ebp
mov    0x8(%rsp),%r13
mov    %ebx,%edi
call   10b0 <strerror@plt>
lea    0xd61(%rip),%rsi
mov    %ebp,%edi
mov    %r13,%rdx
mov    %rax,%rcx
call   1070 <fprintf@plt>
mov    %ebx,%ebp
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1040 <endmntent@plt>
test   %ebp,%ebp
cmovne %ebp,%r14d
test   %r15d,%r15d
jne    137a <unlink_keys_from_keyring+0x1da>
jmp    1377 <unlink_keys_from_keyring+0x1d7>
mov    0x2c70(%rip),%rax
mov    (%rax),%r14d
mov    %r12,%rdi
call   1040 <endmntent@plt>
jmp    1377 <unlink_keys_from_keyring+0x1d7>
mov    0x2c5c(%rip),%rax
mov    (%rax),%r14d
mov    %r14d,%r15d
mov    %r15d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r14d,%r14d
jmp    1363 <unlink_keys_from_keyring+0x1c3>

LLVM IR (-O0):
%struct.mntent = type { i8*, i8*, i32 }
@.str = [10 x i8] c"/etc/mtab\00"
@.str.1 = [2 x i8] c"r\00"
@EINVAL = global i32 0
@.str.2 = [9 x i8] c"ecryptfs\00"
@.str.3 = [21 x i8] c"ecryptfs_unlink_sigs\00"
@.str.4 = [14 x i8] c"ecryptfs_sig=\00"
@ENOKEY = global i32 0
@stderr = global i32 0
@.str.5 = [55 x i8] c"Failed to remove fekek with sig [%s] from keyring: %s\0A\00"
@.str.6 = [19 x i8] c"ecryptfs_fnek_sig=\00"
@.str.7 = [54 x i8] c"Failed to remove fnek with sig [%s] from keyring: %s\0A\00"
define i32 @unlink_keys_from_keyring(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.mntent*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %2
store i8* null, i8** %5
store i8* null, i8** %6
store i32 0, i32* %7
store i32 0, i32* %8
%10 = call i32* @setmntent(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %4
%11 = load i32*, i32** %4
%12 = icmp ne i32* %11, null
br i1 %12, label %15, label %13
13: ; preds = %1
%14 = load i32, i32* @EINVAL
store i32 %14, i32* %9
br label %108
15: ; preds = %1
br label %16
16: ; preds = %34, %26, %15
%17 = load i32*, i32** %4
%18 = call %struct.mntent* @getmntent(i32* %17)
store %struct.mntent* %18, %struct.mntent** %3
%19 = icmp ne %struct.mntent* %18, null
br i1 %19, label %20, label %36
20: ; preds = %16
%21 = load %struct.mntent*, %struct.mntent** %3
%22 = getelementptr inbounds %struct.mntent, %struct.mntent* %21, i32 0, i32 0
%23 = load i8*, i8** %22
%24 = call i64 @strcmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %20
br label %16
27: ; preds = %20
%28 = load i8*, i8** %2
%29 = load %struct.mntent*, %struct.mntent** %3
%30 = getelementptr inbounds %struct.mntent, %struct.mntent* %29, i32 0, i32 1
%31 = load i8*, i8** %30
%32 = call i64 @strcmp(i8* %28, i8* %31)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %27
br label %16
35: ; preds = %27
br label %36
36: ; preds = %35, %16
%37 = load %struct.mntent*, %struct.mntent** %3
%38 = icmp ne %struct.mntent* %37, null
br i1 %38, label %41, label %39
39: ; preds = %36
%40 = load i32, i32* @EINVAL
store i32 %40, i32* %9
br label %105
41: ; preds = %36
%42 = load %struct.mntent*, %struct.mntent** %3
%43 = call i32 @hasmntopt(%struct.mntent* %42, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %41
store i32 0, i32* %9
br label %105
46: ; preds = %41
%47 = load %struct.mntent*, %struct.mntent** %3
%48 = getelementptr inbounds %struct.mntent, %struct.mntent* %47, i32 0, i32 2
%49 = load i32, i32* %48
%50 = call i32 @get_mount_opt_value(i32 %49, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8** %5)
store i32 %50, i32* %9
%51 = load i32, i32* %9
%52 = icmp ne i32 %51, 0
br i1 %52, label %70, label %53
53: ; preds = %46
%54 = load i8*, i8** %5
%55 = call i32 @ecryptfs_remove_auth_tok_from_keyring(i8* %54)
store i32 %55, i32* %7
%56 = load i32, i32* %7
%57 = load i32, i32* @ENOKEY
%58 = icmp eq i32 %56, %57
br i1 %58, label %59, label %60
59: ; preds = %53
store i32 0, i32* %7
br label %60
60: ; preds = %59, %53
%61 = load i32, i32* %7
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %69
63: ; preds = %60
%64 = load i32, i32* @stderr
%65 = load i8*, i8** %5
%66 = load i32, i32* %7
%67 = call i8* @strerror(i32 %66)
%68 = call i32 @fprintf(i32 %64, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), i8* %65, i8* %67)
br label %69
69: ; preds = %63, %60
br label %72
70: ; preds = %46
%71 = load i32, i32* %9
store i32 %71, i32* %7
br label %72
72: ; preds = %70, %69
%73 = load %struct.mntent*, %struct.mntent** %3
%74 = getelementptr inbounds %struct.mntent, %struct.mntent* %73, i32 0, i32 2
%75 = load i32, i32* %74
%76 = call i32 @get_mount_opt_value(i32 %75, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8** %6)
%77 = icmp ne i32 %76, 0
br i1 %77, label %100, label %78
78: ; preds = %72
%79 = load i8*, i8** %5
%80 = load i8*, i8** %6
%81 = call i64 @strcmp(i8* %79, i8* %80)
%82 = icmp ne i64 %81, 0
br i1 %82, label %83, label %100
83: ; preds = %78
%84 = load i8*, i8** %6
%85 = call i32 @ecryptfs_remove_auth_tok_from_keyring(i8* %84)
store i32 %85, i32* %8
%86 = load i32, i32* %8
%87 = load i32, i32* @ENOKEY
%88 = icmp eq i32 %86, %87
br i1 %88, label %89, label %90
89: ; preds = %83
store i32 0, i32* %8
br label %90
90: ; preds = %89, %83
%91 = load i32, i32* %8
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %99
93: ; preds = %90
%94 = load i32, i32* @stderr
%95 = load i8*, i8** %6
%96 = load i32, i32* %8
%97 = call i8* @strerror(i32 %96)
%98 = call i32 @fprintf(i32 %94, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), i8* %95, i8* %97)
br label %99
99: ; preds = %93, %90
br label %100
100: ; preds = %99, %78, %72
%101 = load i8*, i8** %5
%102 = call i32 @free(i8* %101)
%103 = load i8*, i8** %6
%104 = call i32 @free(i8* %103)
br label %105
105: ; preds = %100, %45, %39
%106 = load i32*, i32** %4
%107 = call i32 @endmntent(i32* %106)
br label %108
108: ; preds = %105, %13
%109 = load i32, i32* %7
%110 = icmp ne i32 %109, 0
br i1 %110, label %111, label %113
111: ; preds = %108
%112 = load i32, i32* %7
br label %122
113: ; preds = %108
%114 = load i32, i32* %8
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %118
116: ; preds = %113
%117 = load i32, i32* %8
br label %120
118: ; preds = %113
%119 = load i32, i32* %9
br label %120
120: ; preds = %118, %116
%121 = phi i32 [ %117, %116 ], [ %119, %118 ]
br label %122
122: ; preds = %120, %111
%123 = phi i32 [ %112, %111 ], [ %121, %120 ]
ret i32 %123
}

LLVM IR (-O2):
%struct.mntent = type { i8*, i8*, i32 }
@.str = [10 x i8] c"/etc/mtab\00"
@.str.1 = [2 x i8] c"r\00"
@EINVAL = global i32 0
@.str.2 = [9 x i8] c"ecryptfs\00"
@.str.3 = [21 x i8] c"ecryptfs_unlink_sigs\00"
@.str.4 = [14 x i8] c"ecryptfs_sig=\00"
@ENOKEY = global i32 0
@stderr = global i32 0
@.str.5 = [55 x i8] c"Failed to remove fekek with sig [%s] from keyring: %s\0A\00"
@.str.6 = [19 x i8] c"ecryptfs_fnek_sig=\00"
@.str.7 = [54 x i8] c"Failed to remove fnek with sig [%s] from keyring: %s\0A\00"
define i32 @unlink_keys_from_keyring(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%5 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%6 = tail call i32* @setmntent(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = tail call %struct.mntent* @getmntent(i32* %6)
%10 = icmp eq %struct.mntent* %9, null
br i1 %10, label %27, label %13
11: ; preds = %1
%12 = load i32, i32* @EINVAL
br label %84
13: ; preds = %8, %19
%14 = phi %struct.mntent* [ %20, %19 ], [ %9, %8 ]
%15 = getelementptr inbounds %struct.mntent, %struct.mntent* %14, i64 0, i32 0
%16 = load i8*, i8** %15
%17 = tail call i64 @strcmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %13, %22
%20 = tail call %struct.mntent* @getmntent(i32* %6)
%21 = icmp eq %struct.mntent* %20, null
br i1 %21, label %27, label %13
22: ; preds = %13
%23 = getelementptr inbounds %struct.mntent, %struct.mntent* %14, i64 0, i32 1
%24 = load i8*, i8** %23
%25 = tail call i64 @strcmp(i8* %0, i8* %24)
%26 = icmp eq i64 %25, 0
br i1 %26, label %29, label %19
27: ; preds = %19, %8
%28 = load i32, i32* @EINVAL
br label %71
29: ; preds = %22
%30 = tail call i32 @hasmntopt(%struct.mntent* %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i32 %30, 0
br i1 %31, label %71, label %32
32: ; preds = %29
%33 = getelementptr inbounds %struct.mntent, %struct.mntent* %14, i64 0, i32 2
%34 = load i32, i32* %33
%35 = call i32 @get_mount_opt_value(i32 %34, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8** %2)
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %49
37: ; preds = %32
%38 = load i8*, i8** %2
%39 = call i32 @ecryptfs_remove_auth_tok_from_keyring(i8* %38)
%40 = load i32, i32* @ENOKEY
%41 = icmp eq i32 %39, %40
%42 = select i1 %41, i32 0, i32 %39
%43 = icmp eq i32 %42, 0
br i1 %43, label %49, label %44
44: ; preds = %37
%45 = load i32, i32* @stderr
%46 = load i8*, i8** %2
%47 = call i8* @strerror(i32 %42)
%48 = call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), i8* %46, i8* %47)
br label %49
49: ; preds = %32, %37, %44
%50 = phi i32 [ %42, %44 ], [ 0, %37 ], [ %35, %32 ]
%51 = load i32, i32* %33
%52 = call i32 @get_mount_opt_value(i32 %51, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8** %3)
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %74
54: ; preds = %49
%55 = load i8*, i8** %2
%56 = load i8*, i8** %3
%57 = call i64 @strcmp(i8* %55, i8* %56)
%58 = icmp eq i64 %57, 0
br i1 %58, label %74, label %59
59: ; preds = %54
%60 = load i8*, i8** %3
%61 = call i32 @ecryptfs_remove_auth_tok_from_keyring(i8* %60)
%62 = load i32, i32* @ENOKEY
%63 = icmp eq i32 %61, %62
%64 = select i1 %63, i32 0, i32 %61
%65 = icmp eq i32 %64, 0
br i1 %65, label %74, label %66
66: ; preds = %59
%67 = load i32, i32* @stderr
%68 = load i8*, i8** %3
%69 = call i8* @strerror(i32 %64)
%70 = call i32 @fprintf(i32 %67, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), i8* %68, i8* %69)
br label %74
71: ; preds = %27, %29
%72 = phi i32 [ 0, %29 ], [ %28, %27 ]
%73 = tail call i32 @endmntent(i32* %6)
br label %84
74: ; preds = %49, %54, %66, %59
%75 = phi i32 [ 0, %49 ], [ %64, %66 ], [ 0, %59 ], [ 0, %54 ]
%76 = load i8*, i8** %2
%77 = call i32 @free(i8* %76)
%78 = load i8*, i8** %3
%79 = call i32 @free(i8* %78)
%80 = call i32 @endmntent(i32* %6)
%81 = icmp eq i32 %50, 0
%82 = icmp eq i32 %75, 0
%83 = select i1 %82, i32 %35, i32 %75
br i1 %81, label %84, label %86
84: ; preds = %74, %71, %11
%85 = phi i32 [ %72, %71 ], [ %12, %11 ], [ %83, %74 ]
br label %86
86: ; preds = %74, %84
%87 = phi i32 [ %85, %84 ], [ %50, %74 ]
ret i32 %87
}