#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 *, struct stat *);
int shipnewer(register char **argv) {
  unsigned long ref;
  struct stat st;
  if (!*argv || stat(*argv, &st))
    return (1);
  ref = (unsigned long)st.st_mtime;
  while (*++argv)
    if (stat(*argv, &st) || ref < (unsigned long)st.st_mtime)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<shipnewer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1144 <shipnewer+0x34>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     1150 <shipnewer+0x40>
movl   $0x1,-0x4(%rbp)
jmp    11b2 <shipnewer+0xa2>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     11ab <shipnewer+0x9b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    119a <shipnewer+0x8a>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    11a6 <shipnewer+0x96>
movl   $0x1,-0x4(%rbp)
jmp    11b2 <shipnewer+0xa2>
jmp    1158 <shipnewer+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shipnewer>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0x1,%r14d
test   %rdi,%rdi
je     1164 <shipnewer+0x54>
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
jne    1164 <shipnewer+0x54>
mov    (%rsp),%rbp
add    $0x8,%rbx
mov    %rsp,%r15
mov    (%rbx),%rdi
test   %rdi,%rdi
je     1161 <shipnewer+0x51>
mov    %r15,%rsi
call   1030 <stat@plt>
test   %rax,%rax
jne    1164 <shipnewer+0x54>
add    $0x8,%rbx
cmp    (%rsp),%rbp
jae    1140 <shipnewer+0x30>
jmp    1164 <shipnewer+0x54>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @shipnewer(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i64
%5 = alloca %struct.stat
store i8** %0, i8*** %3
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = call i64 @stat(i8* %11, %struct.stat* %5)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9, %1
store i32 1, i32* %2
br label %36
15: ; preds = %9
%16 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%17 = load i64, i64* %16
store i64 %17, i64* %4
br label %18
18: ; preds = %34, %15
%19 = load i8**, i8*** %3
%20 = getelementptr inbounds i8*, i8** %19, i32 1
store i8** %20, i8*** %3
%21 = load i8*, i8** %20
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %35
23: ; preds = %18
%24 = load i8**, i8*** %3
%25 = load i8*, i8** %24
%26 = call i64 @stat(i8* %25, %struct.stat* %5)
%27 = icmp ne i64 %26, 0
br i1 %27, label %33, label %28
28: ; preds = %23
%29 = load i64, i64* %4
%30 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%31 = load i64, i64* %30
%32 = icmp ult i64 %29, %31
br i1 %32, label %33, label %34
33: ; preds = %28, %23
store i32 1, i32* %2
br label %36
34: ; preds = %28
br label %18
35: ; preds = %18
store i32 0, i32* %2
br label %36
36: ; preds = %35, %33, %14
%37 = load i32, i32* %2
ret i32 %37
}

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