#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 */

/* Variables and functions */
int /*<<< orphan*/ cleanup();
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ stderr;
char *strerror(int);
void fail(char *msg, long expect, long got) {
  int saved_errno = errno;
  if (expect == got && got == 0)
    fprintf(stderr, "utimensat: %s: %s\n", msg, strerror(saved_errno));
  else
    fprintf(stderr, "utimensat: %s: expected %ld got %ld\n", msg, expect, got);
  cleanup();
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    11b2 <fail+0x72>
cmpq   $0x0,-0x18(%rbp)
jne    11b2 <fail+0x72>
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
call   1060 <strerror@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rdx
mov    %rax,%rcx
lea    0xe5a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11d5 <fail+0x95>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe45(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rdx,%rax
or     %rsi,%rax
jne    117d <fail+0x3d>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    0x2e82(%rip),%rax
mov    (%rax),%ebp
call   1060 <strerror@plt>
lea    0xe94(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    119d <fail+0x5d>
mov    %rdx,%r8
mov    %rsi,%rcx
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@stderr = global i32 0
@.str = [19 x i8] c"utimensat: %s: %s\0A\00"
@.str.1 = [37 x i8] c"utimensat: %s: expected %ld got %ld\0A\00"
define void @fail(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i32, i32* @errno
store i32 %8, i32* %7
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %3
%13 = load i64, i64* %6
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %4
%18 = load i32, i32* %7
%19 = call i8* @strerror(i32 %18)
%20 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %17, i8* %19)
br label %27
21: ; preds = %12, %3
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %4
%24 = load i64, i64* %5
%25 = load i64, i64* %6
%26 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %23, i64 %24, i64 %25)
br label %27
27: ; preds = %21, %15
%28 = call i32 (...) @cleanup()
%29 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [19 x i8] c"utimensat: %s: %s\0A\00"
@.str.1 = [37 x i8] c"utimensat: %s: expected %ld got %ld\0A\00"
define void @fail(i8* %0, i64 %1, i64 %2) {
%4 = or i64 %2, %1
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* @errno
%8 = load i32, i32* @stderr
%9 = tail call i8* @strerror(i32 %7)
%10 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %9)
br label %14
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %0, i64 %1, i64 %2)
br label %14
14: ; preds = %11, %6
%15 = tail call i32 (...) @cleanup()
%16 = tail call i32 @exit(i32 1)
unreachable
}