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

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *, char *, char *);
char *strerror(int /*<<< orphan*/);
int utime(char *, struct utimbuf *);
int resize(char *fname) {
  struct utimbuf times;
  int ret;
  times.actime = 0x20524553495A4541LL;
  times.modtime = 0x20524553495A454DLL;
  ret = utime(fname, &times);
  if (ret < 0) {
    printf("%s %s\n", fname, strerror(errno));
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x495a4541,-0x18(%rbp)
movl   $0x495a454d,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <utime@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1199 <resize+0x69>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x28(%rbp),%rsi
mov    %rax,%rdx
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a0 <resize+0x70>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movabs $0x495a454d495a4541,%rax
45 5a 49
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
call   1030 <utime@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jns    117e <resize+0x4e>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe92(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.utimbuf = type { i32, i32 }
@.str = [7 x i8] c"%s %s\0A\00"
@errno = global i32 0
define i32 @resize(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.utimbuf
%5 = alloca i32
store i8* %0, i8** %3
%6 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %4, i32 0, i32 0
store i32 1230652737, i32* %6
%7 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %4, i32 0, i32 1
store i32 1230652749, i32* %7
%8 = load i8*, i8** %3
%9 = call i32 @utime(i8* %8, %struct.utimbuf* %4)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = load i32, i32* @errno
%15 = call i8* @strerror(i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %15)
store i32 -1, i32* %2
br label %18
17: ; preds = %1
store i32 0, i32* %2
br label %18
18: ; preds = %17, %12
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.utimbuf = type { i32, i32 }
@.str = [7 x i8] c"%s %s\0A\00"
@errno = global i32 0
define i32 @resize(i8* %0) {
%2 = alloca %struct.utimbuf
%3 = bitcast %struct.utimbuf* %2 to i8*
%4 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %2, i64 0, i32 0
store i32 1230652737, i32* %4
%5 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %2, i64 0, i32 1
store i32 1230652749, i32* %5
%6 = call i32 @utime(i8* %0, %struct.utimbuf* %2)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = tail call i8* @strerror(i32 %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %10)
br label %12
12: ; preds = %1, %8
%13 = phi i32 [ -1, %8 ], [ 0, %1 ]
ret i32 %13
}