#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 {
  scalar_t__ modtime;
  scalar_t__ actime;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ report(char const *);
int /*<<< orphan*/ stderr;
scalar_t__ utime(char const *, struct utimbuf *);
void apply_mkold(const char *file, const char *err) {
  struct utimbuf utb;
  utb.actime = utb.modtime = 0;
  if (utime(file, &utb) < 0) {
    report(file);
    return;
  }
  fprintf(stderr, "made %s look old", file);
  fprintf(stderr, err == 0 ? "\n" : " due to a remote problem: %s\n", err);
}


x86 assembly (clang, -O0):
<apply_mkold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <utime@plt>
cmp    $0x0,%rax
jge    1175 <apply_mkold+0x45>
mov    -0x8(%rbp),%rdi
call   1050 <report@plt>
jmp    11ba <apply_mkold+0x8a>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe77(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rcx
lea    0xe6f(%rip),%rsi
lea    0xe84(%rip),%rax
cmp    $0x0,%rcx
cmove  %rax,%rsi
mov    -0x10(%rbp),%rdx
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_mkold>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
call   1030 <utime@plt>
test   %rax,%rax
js     1195 <apply_mkold+0x65>
mov    0x2e86(%rip),%r15
mov    (%r15),%edi
lea    0xe9c(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    (%r15),%edi
test   %r14,%r14
lea    0xeb4(%rip),%rax
lea    0xe91(%rip),%rsi
cmove  %rax,%rsi
mov    %r14,%rdx
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <report@plt>

LLVM IR (-O0):
%struct.utimbuf = type { i64, i64 }
@stderr = global i32 0
@.str = [17 x i8] c"made %s look old\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [30 x i8] c" due to a remote problem: %s\0A\00"
define void @apply_mkold(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.utimbuf
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %5, i32 0, i32 0
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %5, i32 0, i32 1
store i64 0, i64* %7
%8 = load i8*, i8** %3
%9 = call i64 @utime(i8* %8, %struct.utimbuf* %5)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @report(i8* %12)
br label %25
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %3
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %4
%20 = icmp eq i8* %19, null
%21 = zext i1 %20 to i64
%22 = select i1 %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0)
%23 = load i8*, i8** %4
%24 = call i32 @fprintf(i32 %18, i8* %22, i8* %23)
br label %25
25: ; preds = %14, %11
ret void
}

LLVM IR (-O2):
%struct.utimbuf = type { i64, i64 }
@stderr = global i32 0
@.str = [17 x i8] c"made %s look old\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [30 x i8] c" due to a remote problem: %s\0A\00"
define void @apply_mkold(i8* %0, i8* %1) {
%3 = alloca %struct.utimbuf
%4 = bitcast %struct.utimbuf* %3 to i8*
%5 = bitcast %struct.utimbuf* %3 to i8*
%6 = call i64 @utime(i8* %0, %struct.utimbuf* %3)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @report(i8* %0)
br label %17
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%13 = load i32, i32* @stderr
%14 = icmp eq i8* %1, null
%15 = select i1 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0)
%16 = tail call i32 @fprintf(i32 %13, i8* %15, i8* %1)
br label %17
17: ; preds = %10, %8
ret void
}