#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_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  scalar_t__ family;
  scalar_t__ address_length;
  scalar_t__ number_length;
  int /*<<< orphan*/ number;
  int /*<<< orphan*/ address;
};
typedef TYPE_1__ Xauth;

/* Variables and functions */
scalar_t__ memcmp(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
int match_auth_dpy(register Xauth *a, register Xauth *b) {
  return ((a->family == b->family && a->address_length == b->address_length &&
           a->number_length == b->number_length &&
           memcmp(a->address, b->address, a->address_length) == 0 &&
           memcmp(a->number, b->number, a->number_length) == 0)
              ? 1
              : 0);
}


x86 assembly (clang, -O0):
<match_auth_dpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
mov    %al,-0x11(%rbp)
jne    11c1 <match_auth_dpy+0xb1>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    0x8(%rdx),%rcx
mov    %al,-0x11(%rbp)
jne    11c1 <match_auth_dpy+0xb1>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    0x10(%rdx),%rcx
mov    %al,-0x11(%rbp)
jne    11c1 <match_auth_dpy+0xb1>
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x1c(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdx
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    11c1 <match_auth_dpy+0xb1>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_auth_dpy>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%rax
xor    %r14d,%r14d
cmp    (%rsi),%rax
jne    1162 <match_auth_dpy+0x52>
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    0x8(%rdi),%rdx
cmp    0x8(%rsi),%rdx
jne    1162 <match_auth_dpy+0x52>
mov    0x10(%rbx),%rax
cmp    0x10(%rbp),%rax
jne    1162 <match_auth_dpy+0x52>
mov    0x1c(%rbx),%edi
mov    0x1c(%rbp),%esi
call   1030 <memcmp@plt>
test   %rax,%rax
jne    1162 <match_auth_dpy+0x52>
mov    0x18(%rbx),%edi
mov    0x18(%rbp),%esi
mov    0x10(%rbx),%rdx
call   1030 <memcmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
sete   %r14b
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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