#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_fsname;
};
typedef int /*<<< orphan*/ errdir;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned int FIFREEZE;
unsigned int FITHAW;
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ MNTOPT_RO;
#define VSS_OP_FREEZE 129
#define VSS_OP_THAW 128
int /*<<< orphan*/ endmntent(int /*<<< orphan*/ *);
int errno;
struct mntent *getmntent(int /*<<< orphan*/ *);
int /*<<< orphan*/ *hasmntopt(struct mntent *, int /*<<< orphan*/);
int /*<<< orphan*/ *setmntent(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strerror(int);
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, ...);
int vss_do_freeze(char *, unsigned int);
int vss_operate(int operation) {
  char match[] = "/dev/";
  FILE *mounts;
  struct mntent *ent;
  char errdir[1024] = {0};
  unsigned int cmd;
  int error = 0, root_seen = 0, save_errno = 0;
  switch (operation) {
  case VSS_OP_FREEZE:
    cmd = FIFREEZE;
    break;
  case VSS_OP_THAW:
    cmd = FITHAW;
    break;
  default:
    return -1;
  }
  mounts = setmntent("/proc/mounts", "r");
  if (mounts == NULL) {
    return -1;
  }
  while ((ent = getmntent(mounts))) {
    if (strncmp(ent->mnt_fsname, match, strlen(match))) {
      continue;
    }
    if (hasmntopt(ent, MNTOPT_RO) != NULL) {
      continue;
    }
    if (strcmp(ent->mnt_type, "vfat") == 0) {
      continue;
    }
    if (strcmp(ent->mnt_dir, "/") == 0) {
      root_seen = 1;
      continue;
    }
    error |= vss_do_freeze(ent->mnt_dir, cmd);
    if (error && operation == VSS_OP_FREEZE) {
      goto err;
    }
  }
  endmntent(mounts);
  if (root_seen) {
    error |= vss_do_freeze("/", cmd);
    if (error && operation == VSS_OP_FREEZE) {
      goto err;
    }
  }
  goto out;
err:
  save_errno = errno;
  if (ent) {
    strncpy(errdir, ent->mnt_dir, sizeof(errdir) - 1);
    endmntent(mounts);
  }
  vss_operate(VSS_OP_THAW);
  if (ent)
    syslog(LOG_ERR, "FREEZE of %s failed; error:%d %s", errdir, save_errno,
           strerror(save_errno));
  else
    syslog(LOG_ERR, "FREEZE of / failed; error:%d %s", save_errno,
           strerror(save_errno));
out:
  return error;
}


x86 assembly (clang, -O0):
<vss_operate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
mov    %edi,-0x8(%rbp)
movw   $0x2f,-0xc(%rbp)
movl   $0x7665642f,-0x10(%rbp)
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
movl   $0x0,-0x428(%rbp)
movl   $0x0,-0x42c(%rbp)
movl   $0x0,-0x430(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x434(%rbp)
sub    $0x80,%eax
je     125f <vss_operate+0x8f>
jmp    1235 <vss_operate+0x65>
mov    -0x434(%rbp),%eax
sub    $0x81,%eax
jne    1273 <vss_operate+0xa3>
jmp    124b <vss_operate+0x7b>
mov    0x2d8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x424(%rbp)
jmp    127f <vss_operate+0xaf>
mov    0x2d5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x424(%rbp)
jmp    127f <vss_operate+0xaf>
movl   $0xffffffff,-0x4(%rbp)
jmp    151b <vss_operate+0x34b>
lea    0xd80(%rip),%rdi
lea    0xd86(%rip),%rsi
call   10b0 <setmntent@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12ad <vss_operate+0xdd>
movl   $0xffffffff,-0x4(%rbp)
jmp    151b <vss_operate+0x34b>
jmp    12b2 <vss_operate+0xe2>
mov    -0x18(%rbp),%rdi
call   10a0 <getmntent@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     13c0 <vss_operate+0x1f0>
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%eax
mov    %eax,-0x444(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x440(%rbp)
lea    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x444(%rbp),%edi
mov    -0x440(%rbp),%rsi
mov    %eax,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
je     130d <vss_operate+0x13d>
jmp    12b2 <vss_operate+0xe2>
mov    -0x20(%rbp),%rdi
mov    0x2cd0(%rip),%rax
mov    (%rax),%esi
call   10f0 <hasmntopt@plt>
cmp    $0x0,%rax
je     132e <vss_operate+0x15e>
jmp    12b2 <vss_operate+0xe2>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xcd9(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1350 <vss_operate+0x180>
jmp    12b2 <vss_operate+0xe2>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xca5(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    137d <vss_operate+0x1ad>
movl   $0x1,-0x42c(%rbp)
jmp    12b2 <vss_operate+0xe2>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x424(%rbp),%esi
call   1080 <vss_do_freeze@plt>
or     -0x428(%rbp),%eax
mov    %eax,-0x428(%rbp)
cmpl   $0x0,-0x428(%rbp)
je     13bb <vss_operate+0x1eb>
cmpl   $0x81,-0x8(%rbp)
jne    13bb <vss_operate+0x1eb>
jmp    141d <vss_operate+0x24d>
jmp    12b2 <vss_operate+0xe2>
mov    -0x18(%rbp),%rdi
call   1030 <endmntent@plt>
cmpl   $0x0,-0x42c(%rbp)
je     1418 <vss_operate+0x248>
mov    -0x424(%rbp),%esi
lea    0xc21(%rip),%rdi
call   1080 <vss_do_freeze@plt>
or     -0x428(%rbp),%eax
mov    %eax,-0x428(%rbp)
cmpl   $0x0,-0x428(%rbp)
je     1413 <vss_operate+0x243>
cmpl   $0x81,-0x8(%rbp)
jne    1413 <vss_operate+0x243>
jmp    141d <vss_operate+0x24d>
jmp    1418 <vss_operate+0x248>
jmp    1512 <vss_operate+0x342>
mov    0x2bac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x430(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1459 <vss_operate+0x289>
lea    -0x420(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x3ff,%edx
call   1040 <strncpy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <endmntent@plt>
mov    $0x80,%edi
call   10d0 <vss_operate@plt>
cmpq   $0x0,-0x20(%rbp)
je     14cb <vss_operate+0x2fb>
mov    0x2b43(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x454(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x450(%rbp)
mov    -0x430(%rbp),%eax
mov    %eax,-0x448(%rbp)
mov    -0x430(%rbp),%edi
call   10e0 <strerror@plt>
mov    -0x454(%rbp),%edi
mov    -0x450(%rbp),%rdx
mov    -0x448(%rbp),%ecx
mov    %eax,%r8d
lea    0xb5b(%rip),%rsi
mov    $0x0,%al
call   10c0 <syslog@plt>
jmp    150d <vss_operate+0x33d>
mov    0x2ae6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x45c(%rbp)
mov    -0x430(%rbp),%eax
mov    %eax,-0x458(%rbp)
mov    -0x430(%rbp),%edi
call   10e0 <strerror@plt>
mov    -0x45c(%rbp),%edi
mov    -0x458(%rbp),%edx
mov    %eax,%ecx
lea    0xb35(%rip),%rsi
mov    $0x0,%al
call   10c0 <syslog@plt>
jmp    1512 <vss_operate+0x342>
mov    -0x428(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vss_operate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
mov    %edi,%ebx
movw   $0x2f,0x1c(%rsp)
movl   $0x7665642f,0x18(%rsp)
76
lea    0x20(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    $0xffffffff,%r12d
cmp    $0x81,%ebx
je     1226 <vss_operate+0x56>
cmp    $0x80,%ebx
jne    1403 <vss_operate+0x233>
mov    0x2d9c(%rip),%rax
jmp    122d <vss_operate+0x5d>
mov    0x2db3(%rip),%rax
mov    (%rax),%ebp
lea    0xdd0(%rip),%rdi
lea    0xdd6(%rip),%rsi
call   10b0 <setmntent@plt>
test   %rax,%rax
je     1403 <vss_operate+0x233>
mov    %rax,%r13
mov    %ebp,0x10(%rsp)
mov    %ebx,0x14(%rsp)
xor    %eax,%eax
lea    0x18(%rsp),%rbp
xor    %r15d,%r15d
mov    %eax,0xc(%rsp)
mov    %r15d,%ecx
mov    0x2d7a(%rip),%r12
mov    %ecx,%r15d
mov    %r13,%rdi
call   10a0 <getmntent@plt>
test   %rax,%rax
je     1391 <vss_operate+0x1c1>
mov    %rax,%r14
jmp    12a4 <vss_operate+0xd4>
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   10a0 <getmntent@plt>
mov    %rax,%r14
test   %rax,%rax
je     1391 <vss_operate+0x1c1>
mov    0x10(%r14),%ebx
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
jne    1290 <vss_operate+0xc0>
mov    (%r12),%esi
mov    %r14,%rdi
call   10f0 <hasmntopt@plt>
test   %rax,%rax
jne    1290 <vss_operate+0xc0>
mov    (%r14),%rdi
lea    0xd39(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1290 <vss_operate+0xc0>
mov    0x8(%r14),%rdi
lea    0xd13(%rip),%rsi
call   1090 <strcmp@plt>
mov    $0x1,%ecx
test   %rax,%rax
je     126e <vss_operate+0x9e>
mov    0x8(%r14),%rdi
mov    0x10(%rsp),%esi
call   1080 <vss_do_freeze@plt>
mov    %eax,%r12d
or     0xc(%rsp),%r12d
mov    %r12d,%eax
cmpl   $0x81,0x14(%rsp)
jne    1260 <vss_operate+0x90>
mov    %r12d,%eax
test   %r12d,%r12d
je     1260 <vss_operate+0x90>
mov    0x2c93(%rip),%rax
mov    (%rax),%ebp
mov    0x8(%r14),%rsi
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x3ff,%edx
call   1040 <strncpy@plt>
mov    %r13,%rdi
call   1030 <endmntent@plt>
mov    $0x80,%edi
call   10d0 <vss_operate@plt>
mov    0x2c4a(%rip),%rax
mov    (%rax),%ebx
mov    %ebp,%edi
call   10e0 <strerror@plt>
lea    0xc9c(%rip),%rsi
mov    %ebx,%edi
mov    %r14,%rdx
mov    %ebp,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   10c0 <syslog@plt>
jmp    1403 <vss_operate+0x233>
mov    %r13,%rdi
call   1030 <endmntent@plt>
test   %r15d,%r15d
je     13fe <vss_operate+0x22e>
lea    0xc5f(%rip),%rdi
mov    0x10(%rsp),%esi
call   1080 <vss_do_freeze@plt>
mov    %eax,%r12d
or     0xc(%rsp),%r12d
cmpl   $0x81,0x14(%rsp)
jne    1403 <vss_operate+0x233>
test   %r12d,%r12d
je     1403 <vss_operate+0x233>
mov    0x2c04(%rip),%rax
mov    (%rax),%ebx
mov    $0x80,%edi
call   10d0 <vss_operate@plt>
mov    0x2bd9(%rip),%rax
mov    (%rax),%ebp
mov    %ebx,%edi
call   10e0 <strerror@plt>
lea    0xc4c(%rip),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   10c0 <syslog@plt>
jmp    1403 <vss_operate+0x233>
mov    0xc(%rsp),%r12d
mov    %r12d,%eax
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.mntent = type { i8*, i8*, i32 }
@__const.vss_operate.match = [6 x i8] c"/dev/\00"
@FIFREEZE = global i32 0
@FITHAW = global i32 0
@.str = [13 x i8] c"/proc/mounts\00"
@.str.1 = [2 x i8] c"r\00"
@MNTOPT_RO = global i32 0
@.str.2 = [5 x i8] c"vfat\00"
@.str.3 = [2 x i8] c"/\00"
@errno = global i32 0
@LOG_ERR = global i32 0
@.str.4 = [33 x i8] c"FREEZE of %s failed; error:%d %s\00"
@.str.5 = [32 x i8] c"FREEZE of / failed; error:%d %s\00"
define i32 @vss_operate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [6 x i8]
%5 = alloca i32*
%6 = alloca %struct.mntent*
%7 = alloca [1024 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %3
%12 = bitcast [6 x i8]* %4 to i8*
%13 = bitcast [1024 x i8]* %7 to i8*
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
%14 = load i32, i32* %3
switch i32 %14, label %19 [
i32 129, label %15
i32 128, label %17
]
15: ; preds = %1
%16 = load i32, i32* @FIFREEZE
store i32 %16, i32* %8
br label %20
17: ; preds = %1
%18 = load i32, i32* @FITHAW
store i32 %18, i32* %8
br label %20
19: ; preds = %1
store i32 -1, i32* %2
br label %125
20: ; preds = %17, %15
%21 = call i32* @setmntent(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %21, i32** %5
%22 = load i32*, i32** %5
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 -1, i32* %2
br label %125
25: ; preds = %20
br label %26
26: ; preds = %74, %59, %52, %45, %39, %25
%27 = load i32*, i32** %5
%28 = call %struct.mntent* @getmntent(i32* %27)
store %struct.mntent* %28, %struct.mntent** %6
%29 = icmp ne %struct.mntent* %28, null
br i1 %29, label %30, label %75
30: ; preds = %26
%31 = load %struct.mntent*, %struct.mntent** %6
%32 = getelementptr inbounds %struct.mntent, %struct.mntent* %31, i32 0, i32 2
%33 = load i32, i32* %32
%34 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%35 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%36 = call i32 @strlen(i8* %35)
%37 = call i64 @strncmp(i32 %33, i8* %34, i32 %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %30
br label %26
40: ; preds = %30
%41 = load %struct.mntent*, %struct.mntent** %6
%42 = load i32, i32* @MNTOPT_RO
%43 = call i32* @hasmntopt(%struct.mntent* %41, i32 %42)
%44 = icmp ne i32* %43, null
br i1 %44, label %45, label %46
45: ; preds = %40
br label %26
46: ; preds = %40
%47 = load %struct.mntent*, %struct.mntent** %6
%48 = getelementptr inbounds %struct.mntent, %struct.mntent* %47, i32 0, i32 0
%49 = load i8*, i8** %48
%50 = call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %46
br label %26
53: ; preds = %46
%54 = load %struct.mntent*, %struct.mntent** %6
%55 = getelementptr inbounds %struct.mntent, %struct.mntent* %54, i32 0, i32 1
%56 = load i8*, i8** %55
%57 = call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %60
59: ; preds = %53
store i32 1, i32* %10
br label %26
60: ; preds = %53
%61 = load %struct.mntent*, %struct.mntent** %6
%62 = getelementptr inbounds %struct.mntent, %struct.mntent* %61, i32 0, i32 1
%63 = load i8*, i8** %62
%64 = load i32, i32* %8
%65 = call i32 @vss_do_freeze(i8* %63, i32 %64)
%66 = load i32, i32* %9
%67 = or i32 %66, %65
store i32 %67, i32* %9
%68 = load i32, i32* %9
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %74
70: ; preds = %60
%71 = load i32, i32* %3
%72 = icmp eq i32 %71, 129
br i1 %72, label %73, label %74
73: ; preds = %70
br label %93
74: ; preds = %70, %60
br label %26
75: ; preds = %26
%76 = load i32*, i32** %5
%77 = call i32 @endmntent(i32* %76)
%78 = load i32, i32* %10
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %92
80: ; preds = %75
%81 = load i32, i32* %8
%82 = call i32 @vss_do_freeze(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %81)
%83 = load i32, i32* %9
%84 = or i32 %83, %82
store i32 %84, i32* %9
%85 = load i32, i32* %9
%86 = icmp ne i32 %85, 0
br i1 %86, label %87, label %91
87: ; preds = %80
%88 = load i32, i32* %3
%89 = icmp eq i32 %88, 129
br i1 %89, label %90, label %91
90: ; preds = %87
br label %93
91: ; preds = %87, %80
br label %92
92: ; preds = %91, %75
br label %123
93: ; preds = %90, %73
%94 = load i32, i32* @errno
store i32 %94, i32* %11
%95 = load %struct.mntent*, %struct.mntent** %6
%96 = icmp ne %struct.mntent* %95, null
br i1 %96, label %97, label %105
97: ; preds = %93
%98 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%99 = load %struct.mntent*, %struct.mntent** %6
%100 = getelementptr inbounds %struct.mntent, %struct.mntent* %99, i32 0, i32 1
%101 = load i8*, i8** %100
%102 = call i32 @strncpy(i8* %98, i8* %101, i32 1023)
%103 = load i32*, i32** %5
%104 = call i32 @endmntent(i32* %103)
br label %105
105: ; preds = %97, %93
%106 = call i32 @vss_operate(i32 128)
%107 = load %struct.mntent*, %struct.mntent** %6
%108 = icmp ne %struct.mntent* %107, null
br i1 %108, label %109, label %116
109: ; preds = %105
%110 = load i32, i32* @LOG_ERR
%111 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%112 = load i32, i32* %11
%113 = load i32, i32* %11
%114 = call i32 @strerror(i32 %113)
%115 = call i32 (i32, i8*, ...) @syslog(i32 %110, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %111, i32 %112, i32 %114)
br label %122
116: ; preds = %105
%117 = load i32, i32* @LOG_ERR
%118 = load i32, i32* %11
%119 = load i32, i32* %11
%120 = call i32 @strerror(i32 %119)
%121 = call i32 (i32, i8*, ...) @syslog(i32 %117, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %118, i32 %120)
br label %122
122: ; preds = %116, %109
br label %123
123: ; preds = %122, %92
%124 = load i32, i32* %9
store i32 %124, i32* %2
br label %125
125: ; preds = %123, %24, %19
%126 = load i32, i32* %2
ret i32 %126
}

LLVM IR (-O2):
%struct.mntent = type { i8*, i8*, i32 }
@__const.vss_operate.match = [6 x i8] c"/dev/\00"
@FIFREEZE = global i32 0
@FITHAW = global i32 0
@.str = [13 x i8] c"/proc/mounts\00"
@.str.1 = [2 x i8] c"r\00"
@MNTOPT_RO = global i32 0
@.str.2 = [5 x i8] c"vfat\00"
@.str.3 = [2 x i8] c"/\00"
@errno = global i32 0
@LOG_ERR = global i32 0
@.str.4 = [33 x i8] c"FREEZE of %s failed; error:%d %s\00"
@.str.5 = [32 x i8] c"FREEZE of / failed; error:%d %s\00"
define i32 @vss_operate(i32 %0) {
%2 = alloca [6 x i8]
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
switch i32 %0, label %76 [
i32 129, label %7
i32 128, label %6
]
6: ; preds = %1
br label %7
7: ; preds = %1, %6
%8 = phi i32* [ @FITHAW, %6 ], [ @FIFREEZE, %1 ]
%9 = load i32, i32* %8
%10 = tail call i32* @setmntent(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32* %10, null
br i1 %11, label %76, label %12
12: ; preds = %7
%13 = icmp eq i32 %0, 129
br label %14
14: ; preds = %12, %45
%15 = phi i32 [ 0, %12 ], [ %49, %45 ]
%16 = phi i32 [ 0, %12 ], [ %18, %45 ]
br label %17
17: ; preds = %14, %40
%18 = phi i32 [ %16, %14 ], [ 1, %40 ]
%19 = call %struct.mntent* @getmntent(i32* %10)
%20 = icmp eq %struct.mntent* %19, null
br i1 %20, label %52, label %21
21: ; preds = %17, %28
%22 = phi %struct.mntent* [ %29, %28 ], [ %19, %17 ]
%23 = getelementptr inbounds %struct.mntent, %struct.mntent* %22, i64 0, i32 2
%24 = load i32, i32* %23
%25 = call i32 @strlen(i8* %4)
%26 = call i64 @strncmp(i32 %24, i8* %4, i32 %25)
%27 = icmp eq i64 %26, 0
br i1 %27, label %31, label %28
28: ; preds = %21, %31, %35
%29 = call %struct.mntent* @getmntent(i32* %10)
%30 = icmp eq %struct.mntent* %29, null
br i1 %30, label %52, label %21
31: ; preds = %21
%32 = load i32, i32* @MNTOPT_RO
%33 = call i32* @hasmntopt(%struct.mntent* %22, i32 %32)
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %28
35: ; preds = %31
%36 = getelementptr inbounds %struct.mntent, %struct.mntent* %22, i64 0, i32 0
%37 = load i8*, i8** %36
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %28, label %40
40: ; preds = %35
%41 = getelementptr inbounds %struct.mntent, %struct.mntent* %22, i64 0, i32 1
%42 = load i8*, i8** %41
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %17, label %45
45: ; preds = %40
%46 = getelementptr inbounds %struct.mntent, %struct.mntent* %22, i64 0, i32 1
%47 = load i8*, i8** %46
%48 = call i32 @vss_do_freeze(i8* %47, i32 %9)
%49 = or i32 %48, %15
%50 = icmp ne i32 %49, 0
%51 = and i1 %13, %50
br i1 %51, label %60, label %14
52: ; preds = %17, %28
%53 = call i32 @endmntent(i32* %10)
%54 = icmp eq i32 %18, 0
br i1 %54, label %76, label %55
55: ; preds = %52
%56 = call i32 @vss_do_freeze(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%57 = or i32 %56, %15
%58 = icmp ne i32 %57, 0
%59 = and i1 %13, %58
br i1 %59, label %70, label %76
60: ; preds = %45
%61 = getelementptr inbounds %struct.mntent, %struct.mntent* %22, i64 0, i32 1
%62 = load i32, i32* @errno
%63 = load i8*, i8** %61
%64 = call i32 @strncpy(i8* %5, i8* %63, i32 1023)
%65 = call i32 @endmntent(i32* %10)
%66 = call i32 @vss_operate(i32 128)
%67 = load i32, i32* @LOG_ERR
%68 = call i32 @strerror(i32 %62)
%69 = call i32 (i32, i8*, ...) @syslog(i32 %67, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %5, i32 %62, i32 %68)
br label %76
70: ; preds = %55
%71 = load i32, i32* @errno
%72 = call i32 @vss_operate(i32 128)
%73 = load i32, i32* @LOG_ERR
%74 = call i32 @strerror(i32 %71)
%75 = call i32 (i32, i8*, ...) @syslog(i32 %73, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %71, i32 %74)
br label %76
76: ; preds = %55, %52, %70, %60, %7, %1
%77 = phi i32 [ -1, %1 ], [ -1, %7 ], [ %49, %60 ], [ %57, %70 ], [ %57, %55 ], [ %15, %52 ]
ret i32 %77
}