#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_size;
  scalar_t__ st_mtime;
};

/* Variables and functions */
int statchanged(struct stat *prev, struct stat *curr) {
  if (curr->st_size != prev->st_size)
    return (1);
  if (curr->st_mtime != prev->st_mtime)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<statchanged>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
je     112c <statchanged+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1155 <statchanged+0x55>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    0x8(%rcx),%rax
je     114e <statchanged+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <statchanged+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<statchanged>:
mov    (%rsi),%rcx
mov    $0x1,%eax
cmp    (%rdi),%rcx
jne    111a <statchanged+0x1a>
mov    0x8(%rsi),%rcx
xor    %eax,%eax
cmp    0x8(%rdi),%rcx
setne  %al
ret

LLVM IR (-O0):
%struct.stat = type { i64, i64 }
define i32 @statchanged(%struct.stat* %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
%5 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %4
store %struct.stat* %1, %struct.stat** %5
%6 = load %struct.stat*, %struct.stat** %5
%7 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load %struct.stat*, %struct.stat** %4
%10 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%11 = load i64, i64* %10
%12 = icmp ne i64 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %24
14: ; preds = %2
%15 = load %struct.stat*, %struct.stat** %5
%16 = getelementptr inbounds %struct.stat, %struct.stat* %15, i32 0, i32 1
%17 = load i64, i64* %16
%18 = load %struct.stat*, %struct.stat** %4
%19 = getelementptr inbounds %struct.stat, %struct.stat* %18, i32 0, i32 1
%20 = load i64, i64* %19
%21 = icmp ne i64 %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 1, i32* %3
br label %24
23: ; preds = %14
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

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