#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 stat {
  scalar_t__ st_mtime;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(char *);
scalar_t__ stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
main(int argc, char *argv[]) {
  struct stat b1, b2;
  if (argc != 3) {
    fprintf(stderr, "Usage: %s file1 file2\n", argv[0]);
    exit(-1);
  } else if (stat(argv[1], &b1) < 0) {
    perror(argv[1]);
    exit(-2);
  } else if (stat(argv[2], &b2) < 0) {
    perror(argv[2]);
    exit(-2);
  } else
    exit(b1.st_mtime > b2.st_mtime ? 0 : 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1186 <main+0x46>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe89(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jge    11b8 <main+0x78>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <perror@plt>
mov    $0xfffffffe,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jge    11ea <main+0xaa>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <perror@plt>
mov    $0xfffffffe,%edi
call   1060 <exit@plt>
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdx
mov    $0x1,%edi
xor    %eax,%eax
cmp    %rdx,%rcx
cmovg  %eax,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    1166 <main+0x26>
mov    0x8(%rbx),%rdi
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
test   %rax,%rax
jns    1188 <main+0x48>
mov    0x8(%rbx),%rdi
jmp    119d <main+0x5d>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe87(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    0x10(%rbx),%rdi
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
jns    11ac <main+0x6c>
mov    0x10(%rbx),%rdi
call   1050 <perror@plt>
mov    $0xfffffffe,%edi
call   1060 <exit@plt>
mov    0x8(%rsp),%rax
xor    %edi,%edi
cmp    (%rsp),%rax
setle  %dil
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i64 }
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s file1 file2\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.stat
%7 = alloca %struct.stat
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = call i32 @exit(i32 -1)
unreachable
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @stat(i8* %20, %struct.stat* %6)
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %29
23: ; preds = %17
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @perror(i8* %26)
%28 = call i32 @exit(i32 -2)
unreachable
29: ; preds = %17
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = call i64 @stat(i8* %32, %struct.stat* %7)
%34 = icmp slt i64 %33, 0
br i1 %34, label %35, label %41
35: ; preds = %29
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 2
%38 = load i8*, i8** %37
%39 = call i32 @perror(i8* %38)
%40 = call i32 @exit(i32 -2)
unreachable
41: ; preds = %29
%42 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%43 = load i64, i64* %42
%44 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%45 = load i64, i64* %44
%46 = icmp sgt i64 %43, %45
%47 = zext i1 %46 to i64
%48 = select i1 %46, i32 0, i32 1
%49 = call i32 @exit(i32 %48)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s file1 file2\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = alloca %struct.stat
%5 = bitcast %struct.stat* %3 to i8*
%6 = bitcast %struct.stat* %4 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = tail call i32 @exit(i32 -1)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @stat(i8* %15, %struct.stat* %3)
%17 = icmp slt i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i8*, i8** %14
%20 = call i32 @perror(i8* %19)
%21 = call i32 @exit(i32 -2)
unreachable
22: ; preds = %13
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = call i64 @stat(i8* %24, %struct.stat* %4)
%26 = icmp slt i64 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %22
%28 = load i8*, i8** %23
%29 = call i32 @perror(i8* %28)
%30 = call i32 @exit(i32 -2)
unreachable
31: ; preds = %22
%32 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%33 = load i64, i64* %32
%34 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%35 = load i64, i64* %34
%36 = icmp sle i64 %33, %35
%37 = zext i1 %36 to i32
%38 = call i32 @exit(i32 %37)
unreachable
}