#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_mode;
  scalar_t__ st_uid;
  scalar_t__ st_gid;
  scalar_t__ st_mtime;
};

/* Variables and functions */
int stcmp(struct stat *st1, struct stat *st2, int content_only) {
  if (content_only)
    return st1->st_size != st2->st_size;
  return st1->st_mode != st2->st_mode || st1->st_uid != st2->st_uid ||
         st1->st_gid != st2->st_gid || st1->st_size != st2->st_size ||
         st1->st_mtime != st2->st_mtime;
}


x86 assembly (clang, -O0):
<stcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1137 <stcmp+0x37>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11c2 <stcmp+0xc2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x18(%rbp),%rdx
mov    $0x1,%al
cmp    0x8(%rdx),%rcx
mov    %al,-0x1d(%rbp)
jne    11b7 <stcmp+0xb7>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x18(%rbp),%rdx
mov    $0x1,%al
cmp    0x10(%rdx),%rcx
mov    %al,-0x1d(%rbp)
jne    11b7 <stcmp+0xb7>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
mov    -0x18(%rbp),%rdx
mov    $0x1,%al
cmp    0x18(%rdx),%rcx
mov    %al,-0x1d(%rbp)
jne    11b7 <stcmp+0xb7>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rdx
mov    $0x1,%al
cmp    (%rdx),%rcx
mov    %al,-0x1d(%rbp)
jne    11b7 <stcmp+0xb7>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    0x20(%rcx),%rax
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stcmp>:
test   %edx,%edx
je     1111 <stcmp+0x11>
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
setne  %al
jmp    1146 <stcmp+0x46>
mov    0x8(%rdi),%rcx
mov    $0x1,%eax
cmp    0x8(%rsi),%rcx
jne    1146 <stcmp+0x46>
mov    0x10(%rdi),%rcx
cmp    0x10(%rsi),%rcx
jne    1146 <stcmp+0x46>
mov    0x18(%rdi),%rcx
cmp    0x18(%rsi),%rcx
jne    1146 <stcmp+0x46>
mov    (%rdi),%rcx
cmp    (%rsi),%rcx
jne    1146 <stcmp+0x46>
add    $0x20,%rdi
add    $0x20,%rsi
jmp    1104 <stcmp+0x4>
ret

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

LLVM IR (-O2):
%struct.stat = type { i64, i64, i64, i64, i64 }
define i32 @stcmp(%struct.stat* nocapture %0, %struct.stat* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%7 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
br label %35
8: ; preds = %3
%9 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 1
%10 = load i64, i64* %9
%11 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 1
%12 = load i64, i64* %11
%13 = icmp eq i64 %10, %12
br i1 %13, label %14, label %42
14: ; preds = %8
%15 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 2
%16 = load i64, i64* %15
%17 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 2
%18 = load i64, i64* %17
%19 = icmp eq i64 %16, %18
br i1 %19, label %20, label %42
20: ; preds = %14
%21 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 3
%22 = load i64, i64* %21
%23 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 3
%24 = load i64, i64* %23
%25 = icmp eq i64 %22, %24
br i1 %25, label %26, label %42
26: ; preds = %20
%27 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%28 = load i64, i64* %27
%29 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%30 = load i64, i64* %29
%31 = icmp eq i64 %28, %30
br i1 %31, label %32, label %42
32: ; preds = %26
%33 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 4
%34 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 4
br label %35
35: ; preds = %5, %32
%36 = phi i64* [ %34, %32 ], [ %7, %5 ]
%37 = phi i64* [ %33, %32 ], [ %6, %5 ]
%38 = load i64, i64* %37
%39 = load i64, i64* %36
%40 = icmp ne i64 %38, %39
%41 = zext i1 %40 to i32
br label %42
42: ; preds = %35, %8, %14, %20, %26
%43 = phi i32 [ 1, %26 ], [ 1, %20 ], [ 1, %14 ], [ 1, %8 ], [ %41, %35 ]
ret i32 %43
}