#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 */
typedef scalar_t__ time_t;
struct TYPE_2__ {
  scalar_t__ tv_sec;
};
struct stat {
  long long st_size;
  TYPE_1__ st_mtim;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int stat(char const *const, struct stat *);
bool xfstat(const char *const path, time_t *const mtime,
            long long *const size) {
  assert(path != NULL);
  assert(mtime != NULL);
  assert(size != NULL);
  struct stat st;
  if (stat(path, &st) == -1)
    return false;
  assert(st.st_mtim.tv_sec >= 0);
  assert(st.st_size >= 0);
  *mtime = st.st_mtim.tv_sec;
  *size = st.st_size;
  assert(*mtime >= 0);
  assert(*size >= 0);
  return true;
}


x86 assembly (clang, -O0):
<xfstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x20(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
jne    118c <xfstat+0x6c>
movl   $0x0,-0x4(%rbp)
jmp    11f7 <xfstat+0xd7>
cmpq   $0x0,-0x28(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x30(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfstat>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1030 <assert@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     11bc <xfstat+0x9c>
mov    0x8(%rsp),%r12
mov    %r12,%rbx
shr    $0x3f,%rbx
xor    $0x1,%ebx
mov    %ebx,%edi
call   1030 <assert@plt>
mov    (%rsp),%r13
mov    %r13,%rdi
shr    $0x3f,%rdi
xor    $0x1,%edi
call   1030 <assert@plt>
mov    %r12,(%r14)
mov    %r13,(%r15)
mov    %ebx,%edi
call   1030 <assert@plt>
mov    (%r15),%rdi
shr    $0x3f,%rdi
xor    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%eax
jmp    11be <xfstat+0x9e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.stat = type { i64, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64 }
define i32 @xfstat(i8* %0, i64* writeonly %1, i64* %2) {
%4 = alloca %struct.stat
%5 = icmp ne i8* %0, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp ne i64* %1, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = icmp ne i64* %2, null
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = bitcast %struct.stat* %4 to i8*
%15 = call i32 @stat(i8* %0, %struct.stat* %4)
%16 = icmp eq i32 %15, -1
br i1 %16, label %36, label %17
17: ; preds = %3
%18 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 1, i32 0
%19 = load i64, i64* %18
%20 = lshr i64 %19, 63
%21 = trunc i64 %20 to i32
%22 = xor i32 %21, 1
%23 = tail call i32 @assert(i32 %22)
%24 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%25 = load i64, i64* %24
%26 = lshr i64 %25, 63
%27 = trunc i64 %26 to i32
%28 = xor i32 %27, 1
%29 = tail call i32 @assert(i32 %28)
store i64 %19, i64* %1
store i64 %25, i64* %2
%30 = tail call i32 @assert(i32 %22)
%31 = load i64, i64* %2
%32 = lshr i64 %31, 63
%33 = trunc i64 %32 to i32
%34 = xor i32 %33, 1
%35 = tail call i32 @assert(i32 %34)
br label %36
36: ; preds = %3, %17
%37 = phi i32 [ 1, %17 ], [ 0, %3 ]
ret i32 %37
}