#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 timeval {
  int member_0;
  int /*<<< orphan*/ member_1;
};
struct stat {
  int dummy;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
scalar_t__ ENOENT;
int /*<<< orphan*/ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int IN_DELETE;
int IN_DELETE_SELF;
int O_NONBLOCK;
int /*<<< orphan*/ close(int);
scalar_t__ errno;
int fcntl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int inotify_add_watch(int, char *, int);
int inotify_init();
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
char *strerror(scalar_t__);
scalar_t__ system(char *);
int test_inotify_support() {
  int is_ok = 1;
  int fd = inotify_init();
  if (fd < 0) {
    fprintf(stderr, "inotify_init failed");
  }
  int flags = fcntl(fd, F_GETFL, 0);
  if (flags == -1) {
    fprintf(stderr, "fcntl GETFL failed");
  }
  if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) {
    fprintf(stderr, "fcntl SETFL failed");
  }
  if (system("touch "
             "/tmp/inotify_test.tmp")) {
    fprintf(stderr, "touch failed");
  }
  int wd = inotify_add_watch(fd, "/tmp/inotify_test.tmp",
                             IN_DELETE | IN_DELETE_SELF);
  if (wd < 0) {
    fprintf(stderr, "inotify_add_watch failed: %s", strerror(errno));
  }
  if (system("rm "
             "/tmp/inotify_test.tmp")) {
    fprintf(stderr, "rm failed");
  }
  struct stat statbuf;
  if (stat("/tmp/inotify_test.tmp", &statbuf) != -1 || errno != ENOENT) {
    fprintf(stderr, "File at path "
                    "/tmp/inotify_test.tmp"
                    " still exists after deleting it");
  }
  struct timeval tv = {1, 0};
  fd_set fds;
  FD_ZERO(&fds);
  FD_SET(fd, &fds);
  int count = select(fd + 1, &fds, NULL, NULL, &tv);
  if (count == 0 || !FD_ISSET(fd, &fds)) {
    fprintf(stderr,
            "inotify file descriptor not readable. Is inotify busted?\n");
    is_ok = 0;
  } else {
    fprintf(stderr, "inotify seems OK\n");
    is_ok = 1;
  }
  if (fd >= 0) {
    close(fd);
  }
  return is_ok;
}


x86 assembly (clang, -O0):
<test_inotify_support>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1090 <inotify_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    11fa <test_inotify_support+0x3a>
mov    0x2de6(%rip),%rax
mov    (%rax),%edi
lea    0xe0d(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x8(%rbp),%edi
mov    0x2db4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1231 <test_inotify_support+0x71>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
lea    0xdea(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x8(%rbp),%edi
mov    0x2d8d(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    0x2da1(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
jne    126e <test_inotify_support+0xae>
mov    0x2d72(%rip),%rax
mov    (%rax),%edi
lea    0xdc0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    0xdc5(%rip),%rdi
call   1050 <system@plt>
cmp    $0x0,%rax
je     129b <test_inotify_support+0xdb>
mov    0x2d45(%rip),%rax
mov    (%rax),%edi
lea    0xdc2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x8(%rbp),%edi
mov    0x2d3b(%rip),%rax
mov    (%rax),%edx
mov    0x2cf2(%rip),%rax
or     (%rax),%edx
lea    0xd89(%rip),%rsi
call   10c0 <inotify_add_watch@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    12f8 <test_inotify_support+0x138>
mov    0x2d00(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2ce4(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
mov    -0x2c(%rbp),%edi
mov    %rax,%rdx
lea    0xd72(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    0xd81(%rip),%rdi
call   1050 <system@plt>
cmp    $0x0,%rax
je     1325 <test_inotify_support+0x165>
mov    0x2cbb(%rip),%rax
mov    (%rax),%edi
lea    0xd7b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    0xd14(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1080 <stat@plt>
cmp    $0xffffffff,%eax
jne    1358 <test_inotify_support+0x198>
mov    0x2c7b(%rip),%rax
mov    (%rax),%rax
mov    0x2c59(%rip),%rcx
cmp    (%rcx),%rax
je     136f <test_inotify_support+0x1af>
mov    0x2c71(%rip),%rax
mov    (%rax),%edi
lea    0xd3b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0xdbe(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x24(%rbp),%rdi
call   10a0 <FD_ZERO@plt>
mov    -0x8(%rbp),%edi
lea    -0x24(%rbp),%rsi
call   10e0 <FD_SET@plt>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
lea    -0x24(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x20(%rbp),%r8
mov    %rcx,%rdx
call   10b0 <select@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     13cb <test_inotify_support+0x20b>
mov    -0x8(%rbp),%edi
lea    -0x24(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%eax
jne    13ee <test_inotify_support+0x22e>
mov    0x2bfe(%rip),%rax
mov    (%rax),%edi
lea    0xd0a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    140c <test_inotify_support+0x24c>
mov    0x2bdb(%rip),%rax
mov    (%rax),%edi
lea    0xd21(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     141e <test_inotify_support+0x25e>
mov    -0x8(%rbp),%edi
call   1060 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_inotify_support>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
xor    %eax,%eax
call   1090 <inotify_init@plt>
mov    %eax,%r14d
test   %eax,%eax
jns    11ee <test_inotify_support+0x2e>
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
lea    0xe19(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x2dc3(%rip),%rax
mov    (%rax),%esi
mov    %r14d,%edi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    121f <test_inotify_support+0x5f>
mov    0x2dc1(%rip),%rax
mov    (%rax),%edi
lea    0xdfc(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x2da2(%rip),%rax
mov    (%rax),%esi
mov    0x2db9(%rip),%rax
mov    (%rax),%edx
or     %ebx,%edx
mov    %r14d,%edi
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
jne    1257 <test_inotify_support+0x97>
mov    0x2d89(%rip),%rax
mov    (%rax),%edi
lea    0xdd7(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xddc(%rip),%rdi
call   1050 <system@plt>
test   %rax,%rax
je     127f <test_inotify_support+0xbf>
mov    0x2d61(%rip),%rax
mov    (%rax),%edi
lea    0xdde(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x2d5a(%rip),%rax
mov    0x2d13(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
lea    0xda8(%rip),%rsi
mov    %r14d,%edi
call   10c0 <inotify_add_watch@plt>
test   %eax,%eax
jns    12cf <test_inotify_support+0x10f>
mov    0x2d25(%rip),%rax
mov    (%rax),%ebx
mov    0x2d0c(%rip),%rax
mov    (%rax),%rdi
call   10d0 <strerror@plt>
lea    0xda0(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xdaa(%rip),%rdi
call   1050 <system@plt>
test   %rax,%rax
je     12f7 <test_inotify_support+0x137>
mov    0x2ce9(%rip),%rax
mov    (%rax),%edi
lea    0xda9(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xd42(%rip),%rdi
lea    0x18(%rsp),%rsi
call   1080 <stat@plt>
cmp    $0xffffffff,%eax
jne    1323 <test_inotify_support+0x163>
mov    0x2cac(%rip),%rax
mov    (%rax),%rax
mov    0x2c8a(%rip),%rcx
cmp    (%rcx),%rax
je     133a <test_inotify_support+0x17a>
mov    0x2ca6(%rip),%rax
mov    (%rax),%edi
lea    0xd70(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
movq   $0x1,0x10(%rsp)
lea    0xc(%rsp),%r15
mov    %r15,%rdi
call   10a0 <FD_ZERO@plt>
mov    %r14d,%edi
mov    %r15,%rsi
call   10e0 <FD_SET@plt>
lea    0x1(%r14),%edi
xor    %ebx,%ebx
lea    0x10(%rsp),%r8
mov    %r15,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   10b0 <select@plt>
test   %eax,%eax
je     139e <test_inotify_support+0x1de>
lea    0xc(%rsp),%rsi
mov    %r14d,%edi
call   1040 <FD_ISSET@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
lea    0xd54(%rip),%rax
lea    0xd87(%rip),%rsi
cmove  %rax,%rsi
jmp    13a5 <test_inotify_support+0x1e5>
lea    0xd40(%rip),%rsi
mov    0x2c24(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %r14d,%r14d
js     13c2 <test_inotify_support+0x202>
mov    %r14d,%edi
call   1060 <close@plt>
mov    %ebx,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [20 x i8] c"inotify_init failed\00"
@F_GETFL = global i32 0
@.str.1 = [19 x i8] c"fcntl GETFL failed\00"
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@.str.2 = [19 x i8] c"fcntl SETFL failed\00"
@.str.3 = [28 x i8] c"touch /tmp/inotify_test.tmp\00"
@.str.4 = [13 x i8] c"touch failed\00"
@.str.5 = [22 x i8] c"/tmp/inotify_test.tmp\00"
@IN_DELETE = global i32 0
@IN_DELETE_SELF = global i32 0
@.str.6 = [29 x i8] c"inotify_add_watch failed: %s\00"
@errno = global i64 0
@.str.7 = [25 x i8] c"rm /tmp/inotify_test.tmp\00"
@.str.8 = [10 x i8] c"rm failed\00"
@ENOENT = global i64 0
@.str.9 = [66 x i8] c"File at path /tmp/inotify_test.tmp still exists after deleting it\00"
@__const.test_inotify_support.tv = %struct.timeval { i32 1, i32 0 }
@.str.10 = [58 x i8] c"inotify file descriptor not readable. Is inotify busted?\0A\00"
@.str.11 = [18 x i8] c"inotify seems OK\0A\00"
define i32 @test_inotify_support() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.stat
%6 = alloca %struct.timeval
%7 = alloca i32
%8 = alloca i32
store i32 1, i32* %1
%9 = call i32 (...) @inotify_init()
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %0
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %12, %0
%16 = load i32, i32* %2
%17 = load i32, i32* @F_GETFL
%18 = call i32 @fcntl(i32 %16, i32 %17, i32 0)
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %24
21: ; preds = %15
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %21, %15
%25 = load i32, i32* %2
%26 = load i32, i32* @F_SETFL
%27 = load i32, i32* %3
%28 = load i32, i32* @O_NONBLOCK
%29 = or i32 %27, %28
%30 = call i32 @fcntl(i32 %25, i32 %26, i32 %29)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %35
32: ; preds = %24
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %35
35: ; preds = %32, %24
%36 = call i64 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load i32, i32* @stderr
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %41
41: ; preds = %38, %35
%42 = load i32, i32* %2
%43 = load i32, i32* @IN_DELETE
%44 = load i32, i32* @IN_DELETE_SELF
%45 = or i32 %43, %44
%46 = call i32 @inotify_add_watch(i32 %42, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %45)
store i32 %46, i32* %4
%47 = load i32, i32* %4
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %54
49: ; preds = %41
%50 = load i32, i32* @stderr
%51 = load i64, i64* @errno
%52 = call i8* @strerror(i64 %51)
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %52)
br label %54
54: ; preds = %49, %41
%55 = call i64 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %54
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
br label %60
60: ; preds = %57, %54
%61 = call i32 @stat(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), %struct.stat* %5)
%62 = icmp ne i32 %61, -1
br i1 %62, label %67, label %63
63: ; preds = %60
%64 = load i64, i64* @errno
%65 = load i64, i64* @ENOENT
%66 = icmp ne i64 %64, %65
br i1 %66, label %67, label %70
67: ; preds = %63, %60
%68 = load i32, i32* @stderr
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.9, i64 0, i64 0))
br label %70
70: ; preds = %67, %63
%71 = bitcast %struct.timeval* %6 to i8*
%72 = call i32 @FD_ZERO(i32* %7)
%73 = load i32, i32* %2
%74 = call i32 @FD_SET(i32 %73, i32* %7)
%75 = load i32, i32* %2
%76 = add nsw i32 %75, 1
%77 = call i32 @select(i32 %76, i32* %7, i32* null, i32* null, %struct.timeval* %6)
store i32 %77, i32* %8
%78 = load i32, i32* %8
%79 = icmp eq i32 %78, 0
br i1 %79, label %84, label %80
80: ; preds = %70
%81 = load i32, i32* %2
%82 = call i32 @FD_ISSET(i32 %81, i32* %7)
%83 = icmp ne i32 %82, 0
br i1 %83, label %87, label %84
84: ; preds = %80, %70
%85 = load i32, i32* @stderr
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %1
br label %90
87: ; preds = %80
%88 = load i32, i32* @stderr
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
store i32 1, i32* %1
br label %90
90: ; preds = %87, %84
%91 = load i32, i32* %2
%92 = icmp sge i32 %91, 0
br i1 %92, label %93, label %96
93: ; preds = %90
%94 = load i32, i32* %2
%95 = call i32 @close(i32 %94)
br label %96
96: ; preds = %93, %90
%97 = load i32, i32* %1
ret i32 %97
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.timeval = type { i32, i32 }
@stderr = global i32 0
@.str = [20 x i8] c"inotify_init failed\00"
@F_GETFL = global i32 0
@.str.1 = [19 x i8] c"fcntl GETFL failed\00"
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@.str.2 = [19 x i8] c"fcntl SETFL failed\00"
@.str.3 = [28 x i8] c"touch /tmp/inotify_test.tmp\00"
@.str.4 = [13 x i8] c"touch failed\00"
@.str.5 = [22 x i8] c"/tmp/inotify_test.tmp\00"
@IN_DELETE = global i32 0
@IN_DELETE_SELF = global i32 0
@.str.6 = [29 x i8] c"inotify_add_watch failed: %s\00"
@errno = global i64 0
@.str.7 = [25 x i8] c"rm /tmp/inotify_test.tmp\00"
@.str.8 = [10 x i8] c"rm failed\00"
@ENOENT = global i64 0
@.str.9 = [66 x i8] c"File at path /tmp/inotify_test.tmp still exists after deleting it\00"
@.str.10 = [58 x i8] c"inotify file descriptor not readable. Is inotify busted?\0A\00"
@.str.11 = [18 x i8] c"inotify seems OK\0A\00"
define i32 @test_inotify_support() {
%1 = alloca %struct.stat
%2 = alloca i64
%3 = bitcast i64* %2 to %struct.timeval*
%4 = alloca i32
%5 = tail call i32 (...) @inotify_init()
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %0
%11 = load i32, i32* @F_GETFL
%12 = tail call i32 @fcntl(i32 %5, i32 %11, i32 0)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %14, %10
%18 = load i32, i32* @F_SETFL
%19 = load i32, i32* @O_NONBLOCK
%20 = or i32 %19, %12
%21 = tail call i32 @fcntl(i32 %5, i32 %18, i32 %20)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %26
23: ; preds = %17
%24 = load i32, i32* @stderr
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %23, %17
%27 = tail call i64 @system(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %32
32: ; preds = %29, %26
%33 = load i32, i32* @IN_DELETE
%34 = load i32, i32* @IN_DELETE_SELF
%35 = or i32 %34, %33
%36 = tail call i32 @inotify_add_watch(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %35)
%37 = icmp slt i32 %36, 0
br i1 %37, label %38, label %43
38: ; preds = %32
%39 = load i32, i32* @stderr
%40 = load i64, i64* @errno
%41 = tail call i8* @strerror(i64 %40)
%42 = tail call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %41)
br label %43
43: ; preds = %38, %32
%44 = tail call i64 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %49, label %46
46: ; preds = %43
%47 = load i32, i32* @stderr
%48 = tail call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
br label %49
49: ; preds = %46, %43
%50 = bitcast %struct.stat* %1 to i8*
%51 = call i32 @stat(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), %struct.stat* %1)
%52 = icmp eq i32 %51, -1
br i1 %52, label %53, label %57
53: ; preds = %49
%54 = load i64, i64* @errno
%55 = load i64, i64* @ENOENT
%56 = icmp eq i64 %54, %55
br i1 %56, label %60, label %57
57: ; preds = %53, %49
%58 = load i32, i32* @stderr
%59 = tail call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.9, i64 0, i64 0))
br label %60
60: ; preds = %57, %53
%61 = bitcast i64* %2 to i8*
store i64 1, i64* %2
%62 = bitcast i32* %4 to i8*
%63 = call i32 @FD_ZERO(i32* %4)
%64 = call i32 @FD_SET(i32 %5, i32* %4)
%65 = add nsw i32 %5, 1
%66 = call i32 @select(i32 %65, i32* %4, i32* null, i32* null, %struct.timeval* %3)
%67 = icmp eq i32 %66, 0
br i1 %67, label %74, label %68
68: ; preds = %60
%69 = call i32 @FD_ISSET(i32 %5, i32* %4)
%70 = icmp eq i32 %69, 0
%71 = select i1 %70, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0)
%72 = xor i1 %70, true
%73 = zext i1 %72 to i32
br label %74
74: ; preds = %68, %60
%75 = phi i8* [ getelementptr inbounds ([58 x i8], [58 x i8]* @.str.10, i64 0, i64 0), %60 ], [ %71, %68 ]
%76 = phi i32 [ 0, %60 ], [ %73, %68 ]
%77 = load i32, i32* @stderr
%78 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* %75)
%79 = icmp sgt i32 %5, -1
br i1 %79, label %80, label %82
80: ; preds = %74
%81 = call i32 @close(i32 %5)
br label %82
82: ; preds = %80, %74
ret i32 %76
}