#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 */
scalar_t__ stat(char const *, struct stat *);
int olderf(const char *f1, const char *f2) {
  struct stat b1, b2;
  return (stat(f1, &b1) == 0 && stat(f2, &b2) == 0 &&
          b1.st_mtime < b2.st_mtime);
}


x86 assembly (clang, -O0):
<olderf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x21(%rbp)
jne    116c <olderf+0x5c>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x21(%rbp)
jne    116c <olderf+0x5c>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
setl   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<olderf>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
lea    0x10(%rsp),%rsi
call   1030 <stat@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    114c <olderf+0x3c>
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1030 <stat@plt>
test   %rax,%rax
jne    114c <olderf+0x3c>
mov    0x10(%rsp),%rax
xor    %ebx,%ebx
cmp    0x8(%rsp),%rax
setl   %bl
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @olderf(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.stat
%6 = alloca %struct.stat
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @stat(i8* %7, %struct.stat* %5)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i64 @stat(i8* %11, %struct.stat* %6)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%16 = load i64, i64* %15
%17 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%18 = load i64, i64* %17
%19 = icmp slt i64 %16, %18
br label %20
20: ; preds = %14, %10, %2
%21 = phi i1 [ false, %10 ], [ false, %2 ], [ %19, %14 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @olderf(i8* %0, i8* %1) {
%3 = alloca %struct.stat
%4 = alloca %struct.stat
%5 = bitcast %struct.stat* %3 to i8*
%6 = bitcast %struct.stat* %4 to i8*
%7 = call i64 @stat(i8* %0, %struct.stat* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = call i64 @stat(i8* %1, %struct.stat* %4)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%16 = load i64, i64* %15
%17 = icmp slt i64 %14, %16
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %12, %9, %2
%20 = phi i32 [ 0, %9 ], [ 0, %2 ], [ %18, %12 ]
ret i32 %20
}