#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 utimbuf {
  int member_0;
  int member_1;
  scalar_t__ actime;
  scalar_t__ modtime;
};
struct stat {
  scalar_t__ st_atime;
  scalar_t__ st_mtime;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ memset(struct stat *, int /*<<< orphan*/, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stat(char *, struct stat *);
int /*<<< orphan*/ utime(char *, struct utimbuf *);
void test() {
  struct stat s;
  struct utimbuf t = {1000000000, 1000000000};
  utime("writeable", &t);
  assert(!errno);
  memset(&s, 0, sizeof s);
  stat("writeable", &s);
  assert(s.st_atime == t.actime);
  assert(s.st_mtime == t.modtime);
  utime("unwriteable", &t);
  assert(!errno);
  memset(&s, 0, sizeof s);
  stat("unwriteable", &s);
  assert(s.st_atime == t.actime);
  assert(s.st_mtime == t.modtime);
  puts("success");
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xea1(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe9e(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe9b(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <utime@plt>
mov    0x2e50(%rip),%rax
cmpl   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
lea    0xe61(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1070 <stat@plt>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe25(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <utime@plt>
mov    0x2ddd(%rip),%rax
cmpl   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
lea    0xdec(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1070 <stat@plt>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xdbe(%rip),%rdi
call   1040 <puts@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
mov    0xeac(%rip),%rax
mov    %rax,0x20(%rsp)
movups 0xe90(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xe9e(%rip),%r15
lea    0x10(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <utime@plt>
mov    0x2e4d(%rip),%r13
xor    %edi,%edi
cmpl   $0x0,0x0(%r13)
sete   %dil
call   1060 <assert@plt>
mov    %rsp,%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <stat@plt>
xor    %edi,%edi
cmpq   $0x0,(%rsp)
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpq   $0x0,0x8(%rsp)
sete   %dil
call   1060 <assert@plt>
lea    0xe30(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <utime@plt>
xor    %edi,%edi
cmpl   $0x0,0x0(%r13)
sete   %dil
call   1060 <assert@plt>
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1070 <stat@plt>
xor    %edi,%edi
cmpq   $0x0,(%rsp)
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpq   $0x0,0x8(%rsp)
sete   %dil
call   1060 <assert@plt>
lea    0xddf(%rip),%rdi
call   1040 <puts@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.utimbuf = type { i32, i32, i64, i64 }
%struct.stat = type { i64, i64 }
@__const.test.t = %struct.utimbuf { i32 1000000000, i32 1000000000, i64 0, i64 0 }
@.str = [10 x i8] c"writeable\00"
@errno = global i32 0
@.str.1 = [12 x i8] c"unwriteable\00"
@.str.2 = [8 x i8] c"success\00"
define void @test() {
%1 = alloca %struct.stat
%2 = alloca %struct.utimbuf
%3 = bitcast %struct.utimbuf* %2 to i8*
%4 = call i32 @utime(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.utimbuf* %2)
%5 = load i32, i32* @errno
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @memset(%struct.stat* %1, i32 0, i32 16)
%11 = call i32 @stat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%12 = getelementptr inbounds %struct.stat, %struct.stat* %1, i32 0, i32 0
%13 = load i64, i64* %12
%14 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %2, i32 0, i32 2
%15 = load i64, i64* %14
%16 = icmp eq i64 %13, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = getelementptr inbounds %struct.stat, %struct.stat* %1, i32 0, i32 1
%20 = load i64, i64* %19
%21 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %2, i32 0, i32 3
%22 = load i64, i64* %21
%23 = icmp eq i64 %20, %22
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call i32 @utime(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %struct.utimbuf* %2)
%27 = load i32, i32* @errno
%28 = icmp ne i32 %27, 0
%29 = xor i1 %28, true
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
%32 = call i32 @memset(%struct.stat* %1, i32 0, i32 16)
%33 = call i32 @stat(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %1)
%34 = getelementptr inbounds %struct.stat, %struct.stat* %1, i32 0, i32 0
%35 = load i64, i64* %34
%36 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %2, i32 0, i32 2
%37 = load i64, i64* %36
%38 = icmp eq i64 %35, %37
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = getelementptr inbounds %struct.stat, %struct.stat* %1, i32 0, i32 1
%42 = load i64, i64* %41
%43 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %2, i32 0, i32 3
%44 = load i64, i64* %43
%45 = icmp eq i64 %42, %44
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.utimbuf = type { i32, i32, i64, i64 }
%struct.stat = type { i64, i64 }
@__const.test.t = %struct.utimbuf { i32 1000000000, i32 1000000000, i64 0, i64 0 }
@.str = [10 x i8] c"writeable\00"
@errno = global i32 0
@.str.1 = [12 x i8] c"unwriteable\00"
@.str.2 = [8 x i8] c"success\00"
define void @test() {
%1 = alloca %struct.stat
%2 = alloca %struct.utimbuf
%3 = bitcast %struct.stat* %1 to i8*
%4 = bitcast %struct.utimbuf* %2 to i8*
%5 = call i32 @utime(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.utimbuf* %2)
%6 = load i32, i32* @errno
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = call i32 @memset(%struct.stat* %1, i32 0, i32 16)
%11 = call i32 @stat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%12 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%13 = load i64, i64* %12
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 1
%18 = load i64, i64* %17
%19 = icmp eq i64 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call i32 @utime(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %struct.utimbuf* %2)
%23 = load i32, i32* @errno
%24 = icmp eq i32 %23, 0
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = call i32 @memset(%struct.stat* %1, i32 0, i32 16)
%28 = call i32 @stat(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %1)
%29 = load i64, i64* %12
%30 = icmp eq i64 %29, 0
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = load i64, i64* %17
%34 = icmp eq i64 %33, 0
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}