#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 /*<<< orphan*/ modtime;
  int /*<<< orphan*/ actime;
};
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int syscall(int, char const *, struct timeval *);
int utime(const char *path, const struct utimbuf *times) {
  if (times) {
    struct timeval tv[2] = {{.tv_sec = times->actime},
                            {.tv_sec = times->modtime}};
    return syscall(269, path, tv);
  }
  return syscall(269, path, 0);
}


x86 assembly (clang, -O0):
<utime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1158 <utime+0x48>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x10d,%edi
call   1030 <syscall@plt>
mov    %eax,-0x4(%rbp)
jmp    116d <utime+0x5d>
mov    -0x10(%rbp),%rsi
mov    $0x10d,%edi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <syscall@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utime>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1137 <utime+0x27>
push   %rax
mov    0x4(%rsi),%ecx
mov    %ecx,(%rsp)
mov    (%rsi),%ecx
mov    %ecx,0x4(%rsp)
mov    %rsp,%rdx
mov    $0x10d,%edi
mov    %rax,%rsi
call   1030 <syscall@plt>
pop    %rcx
ret
mov    $0x10d,%edi
mov    %rax,%rsi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.utimbuf = type { i32, i32 }
%struct.timeval = type { i32 }
define i32 @utime(i8* %0, %struct.utimbuf* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.utimbuf*
%6 = alloca [2 x %struct.timeval]
store i8* %0, i8** %4
store %struct.utimbuf* %1, %struct.utimbuf** %5
%7 = load %struct.utimbuf*, %struct.utimbuf** %5
%8 = icmp ne %struct.utimbuf* %7, null
br i1 %8, label %9, label %23
9: ; preds = %2
%10 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %6, i64 0, i64 0
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
%12 = load %struct.utimbuf*, %struct.utimbuf** %5
%13 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %12, i32 0, i32 1
%14 = load i32, i32* %13
store i32 %14, i32* %11
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i64 1
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 0
%17 = load %struct.utimbuf*, %struct.utimbuf** %5
%18 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %17, i32 0, i32 0
%19 = load i32, i32* %18
store i32 %19, i32* %16
%20 = load i8*, i8** %4
%21 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %6, i64 0, i64 0
%22 = call i32 @syscall(i32 269, i8* %20, %struct.timeval* %21)
store i32 %22, i32* %3
br label %26
23: ; preds = %2
%24 = load i8*, i8** %4
%25 = call i32 @syscall(i32 269, i8* %24, %struct.timeval* null)
store i32 %25, i32* %3
br label %26
26: ; preds = %23, %9
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
%struct.utimbuf = type { i32, i32 }
%struct.timeval = type { i32 }
define i32 @utime(i8* %0, %struct.utimbuf* %1) {
%3 = alloca [2 x %struct.timeval]
%4 = icmp eq %struct.utimbuf* %1, null
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = bitcast [2 x %struct.timeval]* %3 to i8*
%7 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %3, i64 0, i64 0
%8 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %3, i64 0, i64 0, i32 0
%9 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %1, i64 0, i32 1
%10 = load i32, i32* %9
store i32 %10, i32* %8
%11 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %3, i64 0, i64 1, i32 0
%12 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %1, i64 0, i32 0
%13 = load i32, i32* %12
store i32 %13, i32* %11
%14 = call i32 @syscall(i32 269, i8* %0, %struct.timeval* %7)
br label %17
15: ; preds = %2
%16 = tail call i32 @syscall(i32 269, i8* %0, %struct.timeval* null)
br label %17
17: ; preds = %15, %5
%18 = phi i32 [ %14, %5 ], [ %16, %15 ]
ret i32 %18
}