#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 st_ctime;
  int st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int S_IFDIR;
int S_IFLNK;
int S_IFREG;
int /*<<< orphan*/ assert(int);
int chmod(char *, int);
int fchmod(int /*<<< orphan*/, int);
int lchmod(char *, int);
int /*<<< orphan*/ lstat(char *, struct stat *);
int /*<<< orphan*/ memset(struct stat *, int /*<<< orphan*/, int);
int /*<<< orphan*/ open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stat(char *, struct stat *);
void test() {
  int err;
  int lastctime;
  struct stat s;
  memset(&s, 0, sizeof s);
  stat("file", &s);
  lastctime = s.st_ctime;
  sleep(1);
  err = chmod("file", 0200);
  assert(!err);
  memset(&s, 0, sizeof s);
  stat("file", &s);
  assert(s.st_mode == (0200 | S_IFREG));
  assert(s.st_ctime != lastctime);
  lastctime = s.st_ctime;
  sleep(1);
  err = fchmod(open("file", O_WRONLY), 0100);
  assert(!err);
  memset(&s, 0, sizeof s);
  stat("file", &s);
  assert(s.st_mode == (0100 | S_IFREG));
  assert(s.st_ctime != lastctime);
  memset(&s, 0, sizeof s);
  stat("folder", &s);
  lastctime = s.st_ctime;
  sleep(1);
  err = chmod("folder", 0300);
  assert(!err);
  memset(&s, 0, sizeof s);
  stat("folder", &s);
  assert(s.st_mode == (0300 | S_IFDIR));
  assert(s.st_ctime != lastctime);
  err = chmod("file-link", 0400);
  assert(!err);
  stat("file-link", &s);
  assert(s.st_mode == (0400 | S_IFREG));
  lstat("file-link", &s);
  assert(s.st_mode == (0777 | S_IFLNK));
  err = lchmod("file-link", 0500);
  assert(!err);
  stat("file-link", &s);
  assert(s.st_mode == (0400 | S_IFREG));
  lstat("file-link", &s);
  assert(s.st_mode == (0500 | S_IFLNK));
  puts("success");
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    0xe41(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <stat@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   10c0 <sleep@plt>
lea    0xe21(%rip),%rdi
mov    $0x80,%esi
call   10a0 <chmod@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    0xdea(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <stat@plt>
mov    -0xc(%rbp),%eax
mov    0x2dbf(%rip),%rcx
mov    (%rcx),%ecx
or     $0x80,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    0x2d5e(%rip),%rax
mov    (%rax),%esi
lea    0xd8d(%rip),%rdi
call   10b0 <open@plt>
mov    %eax,%edi
mov    $0x40,%esi
call   1090 <fchmod@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    0xd4f(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <stat@plt>
mov    -0xc(%rbp),%eax
mov    0x2d24(%rip),%rcx
mov    (%rcx),%ecx
or     $0x40,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    0xd03(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <stat@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   10c0 <sleep@plt>
lea    0xce3(%rip),%rdi
mov    $0xc0,%esi
call   10a0 <chmod@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    0xcac(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <stat@plt>
mov    -0xc(%rbp),%eax
mov    0x2c54(%rip),%rcx
mov    (%rcx),%ecx
or     $0xc0,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    0xc6f(%rip),%rdi
mov    $0x100,%esi
call   10a0 <chmod@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    0xc48(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <stat@plt>
mov    -0xc(%rbp),%eax
mov    0x2c11(%rip),%rcx
mov    (%rcx),%ecx
or     $0x100,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    0xc17(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <lstat@plt>
mov    -0xc(%rbp),%eax
mov    0x2bd8(%rip),%rcx
mov    (%rcx),%ecx
or     $0x1ff,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    0xbe6(%rip),%rdi
mov    $0x140,%esi
call   1030 <lchmod@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    0xbbf(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <stat@plt>
mov    -0xc(%rbp),%eax
mov    0x2b88(%rip),%rcx
mov    (%rcx),%ecx
or     $0x100,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    0xb8e(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <lstat@plt>
mov    -0xc(%rbp),%eax
mov    0x2b4f(%rip),%rcx
mov    (%rcx),%ecx
or     $0x140,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
lea    0xb67(%rip),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    0xe3c(%rip),%r12
mov    %r12,%rdi
mov    %r14,%rsi
call   1080 <stat@plt>
mov    (%rsp),%ebp
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0x80,%ebx
mov    %r12,%rdi
mov    $0x80,%esi
call   10a0 <chmod@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1070 <assert@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1080 <stat@plt>
mov    0x2dcc(%rip),%r15
or     (%r15),%ebx
xor    %edi,%edi
cmp    %ebx,0x4(%rsp)
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmp    %ebp,(%rsp)
setne  %dil
call   1070 <assert@plt>
mov    (%rsp),%ebp
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    0x2d78(%rip),%rax
mov    (%rax),%esi
mov    %r12,%rdi
call   10b0 <open@plt>
mov    %eax,%edi
mov    $0x40,%esi
call   1090 <fchmod@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1070 <assert@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1080 <stat@plt>
mov    (%r15),%eax
or     $0x40,%eax
xor    %edi,%edi
cmp    %eax,0x4(%rsp)
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmp    %ebp,(%rsp)
setne  %dil
call   1070 <assert@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
lea    0xd3f(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <stat@plt>
mov    (%rsp),%r12d
mov    $0x1,%edi
call   10c0 <sleep@plt>
mov    $0xc0,%ebp
mov    %rbx,%rdi
mov    $0xc0,%esi
call   10a0 <chmod@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1070 <assert@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <stat@plt>
mov    0x2ca1(%rip),%rax
or     (%rax),%ebp
xor    %edi,%edi
cmp    %ebp,0x4(%rsp)
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmp    %r12d,(%rsp)
setne  %dil
call   1070 <assert@plt>
lea    0xcc6(%rip),%r13
mov    $0x100,%ebp
mov    %r13,%rdi
mov    $0x100,%esi
call   10a0 <chmod@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1070 <assert@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1080 <stat@plt>
mov    (%r15),%eax
or     %ebp,%eax
xor    %edi,%edi
cmp    %eax,0x4(%rsp)
sete   %dil
call   1070 <assert@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1060 <lstat@plt>
mov    0x2c4a(%rip),%r12
mov    $0x1ff,%eax
or     (%r12),%eax
xor    %edi,%edi
cmp    %eax,0x4(%rsp)
sete   %dil
call   1070 <assert@plt>
mov    $0x140,%ebx
mov    %r13,%rdi
mov    $0x140,%esi
call   1030 <lchmod@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1070 <assert@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1080 <stat@plt>
or     (%r15),%ebp
xor    %edi,%edi
cmp    %ebp,0x4(%rsp)
sete   %dil
call   1070 <assert@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1060 <lstat@plt>
or     (%r12),%ebx
xor    %edi,%edi
cmp    %ebx,0x4(%rsp)
sete   %dil
call   1070 <assert@plt>
lea    0xc07(%rip),%rdi
call   1040 <puts@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32, i32 }
@.str = [5 x i8] c"file\00"
@S_IFREG = global i32 0
@O_WRONLY = global i32 0
@.str.1 = [7 x i8] c"folder\00"
@S_IFDIR = global i32 0
@.str.2 = [10 x i8] c"file-link\00"
@S_IFLNK = global i32 0
@.str.3 = [8 x i8] c"success\00"
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.stat
%4 = call i32 @memset(%struct.stat* %3, i32 0, i32 8)
%5 = call i32 @stat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
store i32 %7, i32* %2
%8 = call i32 @sleep(i32 1)
%9 = call i32 @chmod(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 128)
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i32 @memset(%struct.stat* %3, i32 0, i32 8)
%16 = call i32 @stat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %3)
%17 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 1
%18 = load i32, i32* %17
%19 = load i32, i32* @S_IFREG
%20 = or i32 128, %19
%21 = icmp eq i32 %18, %20
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%25 = load i32, i32* %24
%26 = load i32, i32* %2
%27 = icmp ne i32 %25, %26
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%31 = load i32, i32* %30
store i32 %31, i32* %2
%32 = call i32 @sleep(i32 1)
%33 = load i32, i32* @O_WRONLY
%34 = call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = call i32 @fchmod(i32 %34, i32 64)
store i32 %35, i32* %1
%36 = load i32, i32* %1
%37 = icmp ne i32 %36, 0
%38 = xor i1 %37, true
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = call i32 @memset(%struct.stat* %3, i32 0, i32 8)
%42 = call i32 @stat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %3)
%43 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 1
%44 = load i32, i32* %43
%45 = load i32, i32* @S_IFREG
%46 = or i32 64, %45
%47 = icmp eq i32 %44, %46
%48 = zext i1 %47 to i32
%49 = call i32 @assert(i32 %48)
%50 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%51 = load i32, i32* %50
%52 = load i32, i32* %2
%53 = icmp ne i32 %51, %52
%54 = zext i1 %53 to i32
%55 = call i32 @assert(i32 %54)
%56 = call i32 @memset(%struct.stat* %3, i32 0, i32 8)
%57 = call i32 @stat(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %3)
%58 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%59 = load i32, i32* %58
store i32 %59, i32* %2
%60 = call i32 @sleep(i32 1)
%61 = call i32 @chmod(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 192)
store i32 %61, i32* %1
%62 = load i32, i32* %1
%63 = icmp ne i32 %62, 0
%64 = xor i1 %63, true
%65 = zext i1 %64 to i32
%66 = call i32 @assert(i32 %65)
%67 = call i32 @memset(%struct.stat* %3, i32 0, i32 8)
%68 = call i32 @stat(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %3)
%69 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 1
%70 = load i32, i32* %69
%71 = load i32, i32* @S_IFDIR
%72 = or i32 192, %71
%73 = icmp eq i32 %70, %72
%74 = zext i1 %73 to i32
%75 = call i32 @assert(i32 %74)
%76 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%77 = load i32, i32* %76
%78 = load i32, i32* %2
%79 = icmp ne i32 %77, %78
%80 = zext i1 %79 to i32
%81 = call i32 @assert(i32 %80)
%82 = call i32 @chmod(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 256)
store i32 %82, i32* %1
%83 = load i32, i32* %1
%84 = icmp ne i32 %83, 0
%85 = xor i1 %84, true
%86 = zext i1 %85 to i32
%87 = call i32 @assert(i32 %86)
%88 = call i32 @stat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %struct.stat* %3)
%89 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 1
%90 = load i32, i32* %89
%91 = load i32, i32* @S_IFREG
%92 = or i32 256, %91
%93 = icmp eq i32 %90, %92
%94 = zext i1 %93 to i32
%95 = call i32 @assert(i32 %94)
%96 = call i32 @lstat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %struct.stat* %3)
%97 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 1
%98 = load i32, i32* %97
%99 = load i32, i32* @S_IFLNK
%100 = or i32 511, %99
%101 = icmp eq i32 %98, %100
%102 = zext i1 %101 to i32
%103 = call i32 @assert(i32 %102)
%104 = call i32 @lchmod(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 320)
store i32 %104, i32* %1
%105 = load i32, i32* %1
%106 = icmp ne i32 %105, 0
%107 = xor i1 %106, true
%108 = zext i1 %107 to i32
%109 = call i32 @assert(i32 %108)
%110 = call i32 @stat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %struct.stat* %3)
%111 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 1
%112 = load i32, i32* %111
%113 = load i32, i32* @S_IFREG
%114 = or i32 256, %113
%115 = icmp eq i32 %112, %114
%116 = zext i1 %115 to i32
%117 = call i32 @assert(i32 %116)
%118 = call i32 @lstat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %struct.stat* %3)
%119 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 1
%120 = load i32, i32* %119
%121 = load i32, i32* @S_IFLNK
%122 = or i32 320, %121
%123 = icmp eq i32 %120, %122
%124 = zext i1 %123 to i32
%125 = call i32 @assert(i32 %124)
%126 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32, i32 }
@.str = [5 x i8] c"file\00"
@S_IFREG = global i32 0
@O_WRONLY = global i32 0
@.str.1 = [7 x i8] c"folder\00"
@S_IFDIR = global i32 0
@.str.2 = [10 x i8] c"file-link\00"
@S_IFLNK = global i32 0
@.str.3 = [8 x i8] c"success\00"
define void @test() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @memset(%struct.stat* %1, i32 0, i32 8)
%4 = call i32 @stat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @sleep(i32 1)
%8 = call i32 @chmod(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 128)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 @memset(%struct.stat* %1, i32 0, i32 8)
%13 = call i32 @stat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%14 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 1
%15 = load i32, i32* %14
%16 = load i32, i32* @S_IFREG
%17 = or i32 %16, 128
%18 = icmp eq i32 %15, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32, i32* %5
%22 = icmp ne i32 %21, %6
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = load i32, i32* %5
%26 = call i32 @sleep(i32 1)
%27 = load i32, i32* @O_WRONLY
%28 = call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = call i32 @fchmod(i32 %28, i32 64)
%30 = icmp eq i32 %29, 0
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = call i32 @memset(%struct.stat* %1, i32 0, i32 8)
%34 = call i32 @stat(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%35 = load i32, i32* %14
%36 = load i32, i32* @S_IFREG
%37 = or i32 %36, 64
%38 = icmp eq i32 %35, %37
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = load i32, i32* %5
%42 = icmp ne i32 %41, %25
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = call i32 @memset(%struct.stat* %1, i32 0, i32 8)
%46 = call i32 @stat(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %1)
%47 = load i32, i32* %5
%48 = call i32 @sleep(i32 1)
%49 = call i32 @chmod(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 192)
%50 = icmp eq i32 %49, 0
%51 = zext i1 %50 to i32
%52 = call i32 @assert(i32 %51)
%53 = call i32 @memset(%struct.stat* %1, i32 0, i32 8)
%54 = call i32 @stat(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %1)
%55 = load i32, i32* %14
%56 = load i32, i32* @S_IFDIR
%57 = or i32 %56, 192
%58 = icmp eq i32 %55, %57
%59 = zext i1 %58 to i32
%60 = call i32 @assert(i32 %59)
%61 = load i32, i32* %5
%62 = icmp ne i32 %61, %47
%63 = zext i1 %62 to i32
%64 = call i32 @assert(i32 %63)
%65 = call i32 @chmod(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 256)
%66 = icmp eq i32 %65, 0
%67 = zext i1 %66 to i32
%68 = call i32 @assert(i32 %67)
%69 = call i32 @stat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %struct.stat* %1)
%70 = load i32, i32* %14
%71 = load i32, i32* @S_IFREG
%72 = or i32 %71, 256
%73 = icmp eq i32 %70, %72
%74 = zext i1 %73 to i32
%75 = call i32 @assert(i32 %74)
%76 = call i32 @lstat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %struct.stat* %1)
%77 = load i32, i32* %14
%78 = load i32, i32* @S_IFLNK
%79 = or i32 %78, 511
%80 = icmp eq i32 %77, %79
%81 = zext i1 %80 to i32
%82 = call i32 @assert(i32 %81)
%83 = call i32 @lchmod(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 320)
%84 = icmp eq i32 %83, 0
%85 = zext i1 %84 to i32
%86 = call i32 @assert(i32 %85)
%87 = call i32 @stat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %struct.stat* %1)
%88 = load i32, i32* %14
%89 = load i32, i32* @S_IFREG
%90 = or i32 %89, 256
%91 = icmp eq i32 %88, %90
%92 = zext i1 %91 to i32
%93 = call i32 @assert(i32 %92)
%94 = call i32 @lstat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %struct.stat* %1)
%95 = load i32, i32* %14
%96 = load i32, i32* @S_IFLNK
%97 = or i32 %96, 320
%98 = icmp eq i32 %95, %97
%99 = zext i1 %98 to i32
%100 = call i32 @assert(i32 %99)
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
ret void
}