#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 tm {
  scalar_t__ tm_sec;
  scalar_t__ tm_min;
  scalar_t__ tm_hour;
  scalar_t__ tm_mday;
  scalar_t__ tm_mon;
  scalar_t__ tm_year;
  scalar_t__ tm_gmtoff;
  int /*<<< orphan*/ tm_zone;
};

/* Variables and functions */
int /*<<< orphan*/ strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int tm_equals(struct tm a, struct tm b) {
  return (a.tm_sec == b.tm_sec && a.tm_min == b.tm_min &&
          a.tm_hour == b.tm_hour && a.tm_mday == b.tm_mday &&
          a.tm_mon == b.tm_mon && a.tm_year == b.tm_year &&
          a.tm_gmtoff == b.tm_gmtoff && !strcmp(a.tm_zone, b.tm_zone));
}


x86 assembly (clang, -O0):
<tm_equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0x50(%rbp),%rdx
mov    %rdx,-0x18(%rbp)
lea    0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    (%rax),%rcx
xor    %eax,%eax
cmp    (%rdx),%rcx
mov    %al,-0x1(%rbp)
jne    11f9 <tm_equals+0xe9>
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
xor    %eax,%eax
cmp    0x8(%rdx),%rcx
mov    %al,-0x1(%rbp)
jne    11f9 <tm_equals+0xe9>
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
xor    %eax,%eax
cmp    0x10(%rdx),%rcx
mov    %al,-0x1(%rbp)
jne    11f9 <tm_equals+0xe9>
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
xor    %eax,%eax
cmp    0x18(%rdx),%rcx
mov    %al,-0x1(%rbp)
jne    11f9 <tm_equals+0xe9>
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rcx
xor    %eax,%eax
cmp    0x20(%rdx),%rcx
mov    %al,-0x1(%rbp)
jne    11f9 <tm_equals+0xe9>
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rcx
xor    %eax,%eax
cmp    0x28(%rdx),%rcx
mov    %al,-0x1(%rbp)
jne    11f9 <tm_equals+0xe9>
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rcx
xor    %eax,%eax
cmp    0x30(%rdx),%rcx
mov    %al,-0x1(%rbp)
jne    11f9 <tm_equals+0xe9>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    0x38(%rcx),%edi
mov    0x38(%rax),%esi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tm_equals>:
push   %rax
mov    0x10(%rsp),%rcx
xor    %eax,%eax
cmp    0x50(%rsp),%rcx
jne    1179 <tm_equals+0x69>
lea    0x50(%rsp),%rcx
lea    0x10(%rsp),%rdx
mov    0x8(%rdx),%rsi
cmp    0x8(%rcx),%rsi
jne    1179 <tm_equals+0x69>
mov    0x10(%rdx),%rsi
cmp    0x10(%rcx),%rsi
jne    1179 <tm_equals+0x69>
mov    0x18(%rdx),%rsi
cmp    0x18(%rcx),%rsi
jne    1179 <tm_equals+0x69>
mov    0x20(%rdx),%rsi
cmp    0x20(%rcx),%rsi
jne    1179 <tm_equals+0x69>
mov    0x28(%rdx),%rsi
cmp    0x28(%rcx),%rsi
jne    1179 <tm_equals+0x69>
mov    0x30(%rdx),%rsi
cmp    0x30(%rcx),%rsi
jne    1179 <tm_equals+0x69>
mov    0x38(%rdx),%edi
mov    0x38(%rcx),%esi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

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

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