#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 {
  int dummy;
};

/* Variables and functions */
scalar_t__ mtimecmp(struct stat *, struct stat *);
scalar_t__ stat(char *, struct stat *);
int binary_ot(char *s1, char *s2) {
  struct stat buf1, buf2;
  if (stat(s1, &buf1) || stat(s2, &buf2))
    return 0;
  return mtimecmp(&buf1, &buf2) < 0;
}


x86 assembly (clang, -O0):
<binary_ot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    115e <binary_ot+0x3e>
mov    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     116a <binary_ot+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1186 <binary_ot+0x66>
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <mtimecmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_ot>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
lea    0x10(%rsp),%rsi
call   1040 <stat@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    1163 <binary_ot+0x43>
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1040 <stat@plt>
test   %rax,%rax
jne    1163 <binary_ot+0x43>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <mtimecmp@plt>
mov    %rax,%rbx
shr    $0x3f,%rbx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @binary_ot(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 %16
9: ; preds = %2
%10 = call i64 @stat(i8* %1, %struct.stat* %4)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = call i64 @mtimecmp(%struct.stat* %3, %struct.stat* %4)
%14 = lshr i64 %13, 63
%15 = trunc i64 %14 to i32
br label %16
16: ; preds = %2, %9, %12
%17 = phi i32 [ %15, %12 ], [ 0, %9 ], [ 0, %2 ]
ret i32 %17
}