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

/* Type definitions */
struct TYPE_6__ {
  scalar_t__ name_length;
  int /*<<< orphan*/ name;
};
typedef TYPE_1__ Xauth;

/* Variables and functions */
scalar_t__ match_auth_dpy(TYPE_1__ *, TYPE_1__ *);
scalar_t__ memcmp(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
int match_auth(register Xauth *a, register Xauth *b) {
  return ((match_auth_dpy(a, b) && a->name_length == b->name_length &&
           memcmp(a->name, b->name, a->name_length) == 0)
              ? 1
              : 0);
}


x86 assembly (clang, -O0):
<match_auth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <match_auth_dpy@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     118c <match_auth+0x6c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
mov    %al,-0x11(%rbp)
jne    118c <match_auth+0x6c>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
call   1040 <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>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <match_auth_dpy@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1158 <match_auth+0x38>
mov    (%rbx),%rdx
cmp    (%r14),%rdx
jne    1158 <match_auth+0x38>
mov    0x8(%rbx),%edi
mov    0x8(%r14),%esi
call   1040 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.TYPE_6__ = type { i64, i32 }
define i32 @match_auth(%struct.TYPE_6__* %0, %struct.TYPE_6__* %1) {
%3 = tail call i64 @match_auth_dpy(%struct.TYPE_6__* %0, %struct.TYPE_6__* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2
%6 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %0, i64 0, i32 0
%7 = load i64, i64* %6
%8 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = icmp eq i64 %7, %9
br i1 %10, label %11, label %19
11: ; preds = %5
%12 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %0, i64 0, i32 1
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %1, i64 0, i32 1
%15 = load i32, i32* %14
%16 = tail call i64 @memcmp(i32 %13, i32 %15, i64 %7)
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %11, %5, %2
%20 = phi i32 [ 0, %5 ], [ 0, %2 ], [ %18, %11 ]
ret i32 %20
}