#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};
struct stat {
  TYPE_1__ st_mtim;
};

/* Variables and functions */
int lstat(char const *, struct stat *);
bool utils_newer(const char *a, const char *b) {
  struct stat sta;
  struct stat stb;
  int resa = lstat(a, &sta);
  if (resa == -1)
    return false;
  int resb = lstat(b, &stb);
  if (resb == -1)
    return true;
  if (sta.st_mtim.tv_sec == stb.st_mtim.tv_sec) {
    return sta.st_mtim.tv_nsec > stb.st_mtim.tv_nsec;
  }
  return sta.st_mtim.tv_sec > stb.st_mtim.tv_sec;
}


x86 assembly (clang, -O0):
<utils_newer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <lstat@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0xffffffff,-0x3c(%rbp)
jne    1146 <utils_newer+0x36>
movl   $0x0,-0x4(%rbp)
jmp    11a5 <utils_newer+0x95>
mov    -0x18(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1030 <lstat@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0xffffffff,-0x40(%rbp)
jne    116c <utils_newer+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    11a5 <utils_newer+0x95>
mov    -0x28(%rbp),%rax
cmp    -0x38(%rbp),%rax
jne    1192 <utils_newer+0x82>
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11a5 <utils_newer+0x95>
mov    -0x28(%rbp),%rax
cmp    -0x38(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_newer>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
lea    0x10(%rsp),%rsi
call   1030 <lstat@plt>
cmp    $0xffffffff,%eax
je     1151 <utils_newer+0x41>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <lstat@plt>
cmp    $0xffffffff,%eax
je     1155 <utils_newer+0x45>
mov    (%rsp),%rax
cmp    %rax,0x10(%rsp)
jne    114c <utils_newer+0x3c>
mov    0x18(%rsp),%rax
cmp    0x8(%rsp),%rax
setg   %al
jmp    1157 <utils_newer+0x47>
xor    %eax,%eax
jmp    115a <utils_newer+0x4a>
mov    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64 }
define i32 @utils_newer(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.stat
%7 = alloca %struct.stat
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%10 = load i8*, i8** %4
%11 = call i32 @lstat(i8* %10, %struct.stat* %6)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %3
br label %47
15: ; preds = %2
%16 = load i8*, i8** %5
%17 = call i32 @lstat(i8* %16, %struct.stat* %7)
store i32 %17, i32* %9
%18 = load i32, i32* %9
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %21
20: ; preds = %15
store i32 1, i32* %3
br label %47
21: ; preds = %15
%22 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%23 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %22, i32 0, i32 0
%24 = load i64, i64* %23
%25 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%26 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %25, i32 0, i32 0
%27 = load i64, i64* %26
%28 = icmp eq i64 %24, %27
br i1 %28, label %29, label %38
29: ; preds = %21
%30 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%31 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %30, i32 0, i32 1
%32 = load i64, i64* %31
%33 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%34 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %33, i32 0, i32 1
%35 = load i64, i64* %34
%36 = icmp sgt i64 %32, %35
%37 = zext i1 %36 to i32
store i32 %37, i32* %3
br label %47
38: ; preds = %21
%39 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%40 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %39, i32 0, i32 0
%41 = load i64, i64* %40
%42 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%43 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %42, i32 0, i32 0
%44 = load i64, i64* %43
%45 = icmp sgt i64 %41, %44
%46 = zext i1 %45 to i32
store i32 %46, i32* %3
br label %47
47: ; preds = %38, %29, %20, %14
%48 = load i32, i32* %3
ret i32 %48
}

LLVM IR (-O2):
%struct.stat = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64 }
define i32 @utils_newer(i8* nocapture %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 = call i32 @lstat(i8* %0, %struct.stat* %3)
%8 = icmp eq i32 %7, -1
br i1 %8, label %29, label %9
9: ; preds = %2
%10 = call i32 @lstat(i8* %1, %struct.stat* %4)
%11 = icmp eq i32 %10, -1
br i1 %11, label %26, label %12
12: ; preds = %9
%13 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0, i32 0
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0, i32 0
%16 = load i64, i64* %15
%17 = icmp eq i64 %14, %16
br i1 %17, label %18, label %24
18: ; preds = %12
%19 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0, i32 1
%20 = load i64, i64* %19
%21 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0, i32 1
%22 = load i64, i64* %21
%23 = icmp sgt i64 %20, %22
br label %26
24: ; preds = %12
%25 = icmp sgt i64 %14, %16
br label %26
26: ; preds = %9, %24, %18
%27 = phi i1 [ %23, %18 ], [ %25, %24 ], [ true, %9 ]
%28 = zext i1 %27 to i32
br label %29
29: ; preds = %2, %26
%30 = phi i32 [ %28, %26 ], [ 0, %2 ]
ret i32 %30
}