#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 stat {
  int /*<<< orphan*/ st_mode;
};
struct option {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ member_1;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ err(int, char *, char *);
int /*<<< orphan*/ errx(int, char *);
scalar_t__ freeze_f(int);
int fstat(int, struct stat *);
int getopt_long(int, char **, char *, struct option *, int /*<<< orphan*/ *);
int open(char *, int /*<<< orphan*/);
int optind;
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
scalar_t__ unfreeze_f(int);
int /*<<< orphan*/ usage(int /*<<< orphan*/);
int /*<<< orphan*/ warn(char *, char *);
int /*<<< orphan*/ warnx(char *, ...);
int main(int argc, char **argv) {
  int fd = -1, c;
  int freeze = -1, rc = EXIT_FAILURE;
  char *path;
  struct stat sb;
  struct option longopts[] = {{"help", 0, 0, 'h'},
                              {"freeze", 0, 0, 'f'},
                              {"unfreeze", 0, 0, 'u'},
                              {NULL, 0, 0, 0}};
  ;
  ;
  ;
  while ((c = getopt_long(argc, argv, "hfu", longopts, NULL)) != -1) {
    switch (c) {
    case 'h':
      usage(stdout);
      break;
    case 'f':
      freeze = 1;
      break;
    case 'u':
      freeze = 0;
      break;
    default:
      usage(stderr);
      break;
    }
  }
  if (freeze == -1)
    errx(EXIT_FAILURE, ("no action specified"));
  if (optind == argc)
    errx(EXIT_FAILURE, ("no filename specified"));
  path = argv[optind++];
  if (optind != argc) {
    warnx(("unexpected number of arguments"));
    usage(stderr);
  }
  fd = open(path, O_RDONLY);
  if (fd < 0)
    err(EXIT_FAILURE, ("%s: open failed"), path);
  if (fstat(fd, &sb) == -1) {
    warn(("%s: fstat failed"), path);
    goto done;
  }
  if (!S_ISDIR(sb.st_mode)) {
    warnx(("%s: is not a directory"), path);
    goto done;
  }
  if (freeze) {
    if (freeze_f(fd)) {
      warn(("%s: freeze failed"), path);
      goto done;
    }
  } else {
    if (unfreeze_f(fd)) {
      warn(("%s: unfreeze failed"), path);
      goto done;
    }
  }
  rc = EXIT_SUCCESS;
done:
  if (fd >= 0)
    close(fd);
  return rc;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    0x2dca(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x60,%edx
call   1080 <memset@plt>
lea    0xde3(%rip),%rax
mov    %rax,-0x90(%rbp)
movl   $0x68,-0x80(%rbp)
lea    0xdd5(%rip),%rax
mov    %rax,-0x78(%rbp)
movl   $0x66,-0x68(%rbp)
lea    0xdc1(%rip),%rax
mov    %rax,-0x60(%rbp)
movl   $0x75,-0x50(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x90(%rbp),%rcx
lea    0xdaa(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <getopt_long@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
je     12f7 <main+0x127>
mov    -0x18(%rbp),%eax
mov    %eax,-0x94(%rbp)
sub    $0x66,%eax
je     12cc <main+0xfc>
jmp    1291 <main+0xc1>
mov    -0x94(%rbp),%eax
sub    $0x68,%eax
je     12b9 <main+0xe9>
jmp    12a5 <main+0xd5>
mov    -0x94(%rbp),%eax
sub    $0x75,%eax
je     12d8 <main+0x108>
jmp    12e4 <main+0x114>
mov    0x2d00(%rip),%rax
mov    (%rax),%edi
call   10d0 <usage@plt>
jmp    12f2 <main+0x122>
movl   $0x1,-0x1c(%rbp)
jmp    12f2 <main+0x122>
movl   $0x0,-0x1c(%rbp)
jmp    12f2 <main+0x122>
mov    0x2ce5(%rip),%rax
mov    (%rax),%edi
call   10d0 <usage@plt>
jmp    124f <main+0x7f>
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1316 <main+0x146>
mov    0x2cc0(%rip),%rax
mov    (%rax),%edi
lea    0xd01(%rip),%rsi
call   1050 <errx@plt>
mov    0x2cc3(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    133d <main+0x16d>
mov    0x2c99(%rip),%rax
mov    (%rax),%edi
lea    0xcee(%rip),%rsi
call   1050 <errx@plt>
mov    -0x10(%rbp),%rax
mov    0x2c98(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    0x2c8a(%rip),%rdx
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    0x2c76(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
je     1391 <main+0x1c1>
lea    0xcc0(%rip),%rdi
mov    $0x0,%al
call   1060 <warnx@plt>
mov    0x2c46(%rip),%rax
mov    (%rax),%edi
call   10d0 <usage@plt>
mov    -0x28(%rbp),%rdi
mov    0x2c4c(%rip),%rax
mov    (%rax),%esi
call   10e0 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    13c9 <main+0x1f9>
mov    0x2c11(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
lea    0xc97(%rip),%rsi
call   10c0 <err@plt>
mov    -0x14(%rbp),%edi
lea    -0x30(%rbp),%rsi
call   10f0 <fstat@plt>
cmp    $0xffffffff,%eax
jne    13f3 <main+0x223>
mov    -0x28(%rbp),%rsi
lea    0xc82(%rip),%rdi
call   1030 <warn@plt>
jmp    1489 <main+0x2b9>
mov    -0x30(%rbp),%edi
call   1070 <S_ISDIR@plt>
cmp    $0x0,%eax
jne    141b <main+0x24b>
mov    -0x28(%rbp),%rsi
lea    0xc6d(%rip),%rdi
mov    $0x0,%al
call   1060 <warnx@plt>
jmp    1489 <main+0x2b9>
cmpl   $0x0,-0x1c(%rbp)
je     1451 <main+0x281>
mov    -0x14(%rbp),%edi
call   10b0 <freeze_f@plt>
cmp    $0x0,%rax
je     144c <main+0x27c>
mov    -0x28(%rbp),%rsi
lea    0xc51(%rip),%rdi
call   1030 <warn@plt>
jmp    1489 <main+0x2b9>
jmp    147d <main+0x2ad>
mov    -0x14(%rbp),%edi
call   10a0 <unfreeze_f@plt>
cmp    $0x0,%rax
je     1478 <main+0x2a8>
mov    -0x28(%rbp),%rsi
lea    0xc37(%rip),%rdi
call   1030 <warn@plt>
jmp    1489 <main+0x2b9>
jmp    147d <main+0x2ad>
mov    0x2b34(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     149b <main+0x2cb>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
mov    -0x20(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2dee(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
lea    0xdf9(%rip),%rax
mov    %rax,0x10(%rsp)
movl   $0x68,0x20(%rsp)
lea    0xdec(%rip),%rax
mov    %rax,0x28(%rsp)
movl   $0x66,0x38(%rsp)
lea    0xdd6(%rip),%rax
mov    %rax,0x40(%rsp)
movl   $0x75,0x50(%rsp)
movl   $0xffffffff,0x4(%rsp)
ff
lea    0xdc3(%rip),%r15
lea    0x10(%rsp),%r12
mov    0x2d79(%rip),%r14
mov    0x2d62(%rip),%r13
jmp    126d <main+0xad>
cmp    $0x75,%eax
je     12b4 <main+0xf4>
mov    (%r14),%edi
call   10c0 <usage@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
xor    %r8d,%r8d
call   1040 <getopt_long@plt>
cmp    $0x67,%eax
jle    12a0 <main+0xe0>
cmp    $0x68,%eax
jne    1260 <main+0xa0>
mov    0x0(%r13),%edi
call   10c0 <usage@plt>
jmp    126d <main+0xad>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0xffffffff,%eax
je     12be <main+0xfe>
cmp    $0x66,%eax
jne    1265 <main+0xa5>
movl   $0x1,0x4(%rsp)
jmp    126d <main+0xad>
movl   $0x0,0x4(%rsp)
jmp    126d <main+0xad>
mov    0x4(%rsp),%r12d
cmp    $0xffffffff,%r12d
mov    0x2cfa(%rip),%r13
jne    12e0 <main+0x120>
mov    0x0(%r13),%edi
lea    0xd37(%rip),%rsi
call   1050 <errx@plt>
mov    0x2cf9(%rip),%r15
mov    (%r15),%eax
cmp    %ebp,%eax
jne    1301 <main+0x141>
mov    0x0(%r13),%edi
lea    0xd2d(%rip),%rsi
call   1050 <errx@plt>
mov    (%r15),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%r15)
cltq
mov    (%rbx,%rax,8),%r15
cmp    %ebp,%ecx
je     1327 <main+0x167>
lea    0xd24(%rip),%rdi
xor    %eax,%eax
call   1060 <warnx@plt>
mov    (%r14),%edi
call   10c0 <usage@plt>
mov    0x2cba(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
call   10d0 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1351 <main+0x191>
mov    0x0(%r13),%edi
lea    0xd12(%rip),%rsi
mov    %r15,%rdx
call   10b0 <err@plt>
lea    0x8(%rsp),%rsi
mov    %ebx,%edi
call   10e0 <fstat@plt>
cmp    $0xffffffff,%eax
je     1389 <main+0x1c9>
mov    0x8(%rsp),%edi
call   1070 <S_ISDIR@plt>
test   %eax,%eax
je     1392 <main+0x1d2>
mov    %ebx,%edi
test   %r12d,%r12d
je     13a5 <main+0x1e5>
call   10a0 <freeze_f@plt>
test   %rax,%rax
je     13dd <main+0x21d>
lea    0xd0c(%rip),%rdi
jmp    13b6 <main+0x1f6>
lea    0xcdb(%rip),%rdi
jmp    13b6 <main+0x1f6>
lea    0xce3(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <warnx@plt>
jmp    13be <main+0x1fe>
call   1090 <unfreeze_f@plt>
test   %rax,%rax
je     13dd <main+0x21d>
lea    0xcef(%rip),%rdi
mov    %r15,%rsi
call   1030 <warn@plt>
mov    (%rsp),%ebp
test   %ebx,%ebx
js     13cc <main+0x20c>
mov    %ebx,%edi
call   1080 <close@plt>
mov    %ebp,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bd4(%rip),%rax
mov    (%rax),%ebp
test   %ebx,%ebx
jns    13c5 <main+0x205>
jmp    13cc <main+0x20c>

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.option = type { i8*, i8, i32, i32 }
@EXIT_FAILURE = global i32 0
@.str = [5 x i8] c"help\00"
@.str.1 = [7 x i8] c"freeze\00"
@.str.2 = [9 x i8] c"unfreeze\00"
@.str.3 = [4 x i8] c"hfu\00"
@stdout = global i32 0
@stderr = global i32 0
@.str.4 = [20 x i8] c"no action specified\00"
@optind = global i32 0
@.str.5 = [22 x i8] c"no filename specified\00"
@.str.6 = [31 x i8] c"unexpected number of arguments\00"
@O_RDONLY = global i32 0
@.str.7 = [16 x i8] c"%s: open failed\00"
@.str.8 = [17 x i8] c"%s: fstat failed\00"
@.str.9 = [23 x i8] c"%s: is not a directory\00"
@.str.10 = [18 x i8] c"%s: freeze failed\00"
@.str.11 = [20 x i8] c"%s: unfreeze failed\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca %struct.stat
%12 = alloca [4 x %struct.option]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
store i32 -1, i32* %8
%13 = load i32, i32* @EXIT_FAILURE
store i32 %13, i32* %9
%14 = bitcast [4 x %struct.option]* %12 to i8*
%15 = bitcast i8* %14 to [4 x %struct.option]*
%16 = getelementptr inbounds [4 x %struct.option], [4 x %struct.option]* %15, i32 0, i32 0
%17 = getelementptr inbounds %struct.option, %struct.option* %16, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8** %17
%18 = getelementptr inbounds %struct.option, %struct.option* %16, i32 0, i32 3
store i32 104, i32* %18
%19 = getelementptr inbounds [4 x %struct.option], [4 x %struct.option]* %15, i32 0, i32 1
%20 = getelementptr inbounds %struct.option, %struct.option* %19, i32 0, i32 0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8** %20
%21 = getelementptr inbounds %struct.option, %struct.option* %19, i32 0, i32 3
store i32 102, i32* %21
%22 = getelementptr inbounds [4 x %struct.option], [4 x %struct.option]* %15, i32 0, i32 2
%23 = getelementptr inbounds %struct.option, %struct.option* %22, i32 0, i32 0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i8** %23
%24 = getelementptr inbounds %struct.option, %struct.option* %22, i32 0, i32 3
store i32 117, i32* %24
br label %25
25: ; preds = %41, %2
%26 = load i32, i32* %4
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds [4 x %struct.option], [4 x %struct.option]* %12, i64 0, i64 0
%29 = call i32 @getopt_long(i32 %26, i8** %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %struct.option* %28, i32* null)
store i32 %29, i32* %7
%30 = icmp ne i32 %29, -1
br i1 %30, label %31, label %42
31: ; preds = %25
%32 = load i32, i32* %7
switch i32 %32, label %38 [
i32 104, label %33
i32 102, label %36
i32 117, label %37
]
33: ; preds = %31
%34 = load i32, i32* @stdout
%35 = call i32 @usage(i32 %34)
br label %41
36: ; preds = %31
store i32 1, i32* %8
br label %41
37: ; preds = %31
store i32 0, i32* %8
br label %41
38: ; preds = %31
%39 = load i32, i32* @stderr
%40 = call i32 @usage(i32 %39)
br label %41
41: ; preds = %38, %37, %36, %33
br label %25
42: ; preds = %25
%43 = load i32, i32* %8
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = load i32, i32* @EXIT_FAILURE
%47 = call i32 @errx(i32 %46, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %48
48: ; preds = %45, %42
%49 = load i32, i32* @optind
%50 = load i32, i32* %4
%51 = icmp eq i32 %49, %50
br i1 %51, label %52, label %55
52: ; preds = %48
%53 = load i32, i32* @EXIT_FAILURE
%54 = call i32 @errx(i32 %53, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %55
55: ; preds = %52, %48
%56 = load i8**, i8*** %5
%57 = load i32, i32* @optind
%58 = add nsw i32 %57, 1
store i32 %58, i32* @optind
%59 = sext i32 %57 to i64
%60 = getelementptr inbounds i8*, i8** %56, i64 %59
%61 = load i8*, i8** %60
store i8* %61, i8** %10
%62 = load i32, i32* @optind
%63 = load i32, i32* %4
%64 = icmp ne i32 %62, %63
br i1 %64, label %65, label %69
65: ; preds = %55
%66 = call i32 (i8*, ...) @warnx(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%67 = load i32, i32* @stderr
%68 = call i32 @usage(i32 %67)
br label %69
69: ; preds = %65, %55
%70 = load i8*, i8** %10
%71 = load i32, i32* @O_RDONLY
%72 = call i32 @open(i8* %70, i32 %71)
store i32 %72, i32* %6
%73 = load i32, i32* %6
%74 = icmp slt i32 %73, 0
br i1 %74, label %75, label %79
75: ; preds = %69
%76 = load i32, i32* @EXIT_FAILURE
%77 = load i8*, i8** %10
%78 = call i32 @err(i32 %76, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %77)
br label %79
79: ; preds = %75, %69
%80 = load i32, i32* %6
%81 = call i32 @fstat(i32 %80, %struct.stat* %11)
%82 = icmp eq i32 %81, -1
br i1 %82, label %83, label %86
83: ; preds = %79
%84 = load i8*, i8** %10
%85 = call i32 @warn(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* %84)
br label %115
86: ; preds = %79
%87 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 0
%88 = load i32, i32* %87
%89 = call i32 @S_ISDIR(i32 %88)
%90 = icmp ne i32 %89, 0
br i1 %90, label %94, label %91
91: ; preds = %86
%92 = load i8*, i8** %10
%93 = call i32 (i8*, ...) @warnx(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %92)
br label %115
94: ; preds = %86
%95 = load i32, i32* %8
%96 = icmp ne i32 %95, 0
br i1 %96, label %97, label %105
97: ; preds = %94
%98 = load i32, i32* %6
%99 = call i64 @freeze_f(i32 %98)
%100 = icmp ne i64 %99, 0
br i1 %100, label %101, label %104
101: ; preds = %97
%102 = load i8*, i8** %10
%103 = call i32 @warn(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i8* %102)
br label %115
104: ; preds = %97
br label %113
105: ; preds = %94
%106 = load i32, i32* %6
%107 = call i64 @unfreeze_f(i32 %106)
%108 = icmp ne i64 %107, 0
br i1 %108, label %109, label %112
109: ; preds = %105
%110 = load i8*, i8** %10
%111 = call i32 @warn(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i8* %110)
br label %115
112: ; preds = %105
br label %113
113: ; preds = %112, %104
%114 = load i32, i32* @EXIT_SUCCESS
store i32 %114, i32* %9
br label %115
115: ; preds = %113, %109, %101, %91, %83
%116 = load i32, i32* %6
%117 = icmp sge i32 %116, 0
br i1 %117, label %118, label %121
118: ; preds = %115
%119 = load i32, i32* %6
%120 = call i32 @close(i32 %119)
br label %121
121: ; preds = %118, %115
%122 = load i32, i32* %9
ret i32 %122
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.option = type { i8*, i8, i32, i32 }
@EXIT_FAILURE = global i32 0
@.str = [5 x i8] c"help\00"
@.str.1 = [7 x i8] c"freeze\00"
@.str.2 = [9 x i8] c"unfreeze\00"
@.str.3 = [4 x i8] c"hfu\00"
@stdout = global i32 0
@stderr = global i32 0
@.str.4 = [20 x i8] c"no action specified\00"
@optind = global i32 0
@.str.5 = [22 x i8] c"no filename specified\00"
@.str.6 = [31 x i8] c"unexpected number of arguments\00"
@O_RDONLY = global i32 0
@.str.7 = [16 x i8] c"%s: open failed\00"
@.str.8 = [17 x i8] c"%s: fstat failed\00"
@.str.9 = [23 x i8] c"%s: is not a directory\00"
@.str.10 = [18 x i8] c"%s: freeze failed\00"
@.str.11 = [20 x i8] c"%s: unfreeze failed\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.stat
%4 = alloca [4 x %struct.option]
%5 = load i32, i32* @EXIT_FAILURE
%6 = bitcast %struct.stat* %3 to i8*
%7 = bitcast [4 x %struct.option]* %4 to i8*
%8 = getelementptr inbounds [4 x %struct.option], [4 x %struct.option]* %4, i64 0, i64 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [4 x %struct.option], [4 x %struct.option]* %4, i64 0, i64 0, i32 3
store i32 104, i32* %9
%10 = getelementptr inbounds [4 x %struct.option], [4 x %struct.option]* %4, i64 0, i64 1, i32 0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [4 x %struct.option], [4 x %struct.option]* %4, i64 0, i64 1, i32 3
store i32 102, i32* %11
%12 = getelementptr inbounds [4 x %struct.option], [4 x %struct.option]* %4, i64 0, i64 2, i32 0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [4 x %struct.option], [4 x %struct.option]* %4, i64 0, i64 2, i32 3
store i32 117, i32* %13
%14 = getelementptr inbounds [4 x %struct.option], [4 x %struct.option]* %4, i64 0, i64 0
br label %15
15: ; preds = %23, %2
%16 = phi i32 [ -1, %2 ], [ %24, %23 ]
br label %17
17: ; preds = %28, %15
%18 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %struct.option* %14, i32* null)
switch i32 %18, label %25 [
i32 -1, label %29
i32 104, label %19
i32 102, label %23
i32 117, label %22
]
19: ; preds = %17
%20 = load i32, i32* @stdout
%21 = call i32 @usage(i32 %20)
br label %28
22: ; preds = %17
br label %23
23: ; preds = %17, %22
%24 = phi i32 [ 0, %22 ], [ 1, %17 ]
br label %15
25: ; preds = %17
%26 = load i32, i32* @stderr
%27 = call i32 @usage(i32 %26)
br label %28
28: ; preds = %25, %19
br label %17
29: ; preds = %17
%30 = icmp eq i32 %16, -1
br i1 %30, label %31, label %34
31: ; preds = %29
%32 = load i32, i32* @EXIT_FAILURE
%33 = call i32 @errx(i32 %32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %34
34: ; preds = %31, %29
%35 = load i32, i32* @optind
%36 = icmp eq i32 %35, %0
br i1 %36, label %37, label %41
37: ; preds = %34
%38 = load i32, i32* @EXIT_FAILURE
%39 = call i32 @errx(i32 %38, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%40 = load i32, i32* @optind
br label %41
41: ; preds = %37, %34
%42 = phi i32 [ %40, %37 ], [ %35, %34 ]
%43 = add nsw i32 %42, 1
store i32 %43, i32* @optind
%44 = sext i32 %42 to i64
%45 = getelementptr inbounds i8*, i8** %1, i64 %44
%46 = load i8*, i8** %45
%47 = icmp eq i32 %43, %0
br i1 %47, label %52, label %48
48: ; preds = %41
%49 = call i32 (i8*, ...) @warnx(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%50 = load i32, i32* @stderr
%51 = call i32 @usage(i32 %50)
br label %52
52: ; preds = %48, %41
%53 = load i32, i32* @O_RDONLY
%54 = call i32 @open(i8* %46, i32 %53)
%55 = icmp slt i32 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %52
%57 = load i32, i32* @EXIT_FAILURE
%58 = call i32 @err(i32 %57, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %46)
br label %59
59: ; preds = %56, %52
%60 = call i32 @fstat(i32 %54, %struct.stat* %3)
%61 = icmp eq i32 %60, -1
br i1 %61, label %62, label %64
62: ; preds = %59
%63 = call i32 @warn(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* %46)
br label %85
64: ; preds = %59
%65 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%66 = load i32, i32* %65
%67 = call i32 @S_ISDIR(i32 %66)
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %64
%70 = call i32 (i8*, ...) @warnx(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %46)
br label %85
71: ; preds = %64
%72 = icmp eq i32 %16, 0
br i1 %72, label %78, label %73
73: ; preds = %71
%74 = call i64 @freeze_f(i32 %54)
%75 = icmp eq i64 %74, 0
br i1 %75, label %83, label %76
76: ; preds = %73
%77 = call i32 @warn(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i8* %46)
br label %85
78: ; preds = %71
%79 = call i64 @unfreeze_f(i32 %54)
%80 = icmp eq i64 %79, 0
br i1 %80, label %83, label %81
81: ; preds = %78
%82 = call i32 @warn(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i8* %46)
br label %85
83: ; preds = %78, %73
%84 = load i32, i32* @EXIT_SUCCESS
br label %85
85: ; preds = %83, %81, %76, %69, %62
%86 = phi i32 [ %5, %62 ], [ %5, %76 ], [ %84, %83 ], [ %5, %81 ], [ %5, %69 ]
%87 = icmp sgt i32 %54, -1
br i1 %87, label %88, label %90
88: ; preds = %85
%89 = call i32 @close(i32 %54)
br label %90
90: ; preds = %88, %85
ret i32 %86
}