#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 passwd {
  scalar_t__ pw_uid;
  scalar_t__ pw_gid;
  int /*<<< orphan*/ pw_shell;
  int /*<<< orphan*/ pw_dir;
  int /*<<< orphan*/ pw_gecos;
  int /*<<< orphan*/ pw_passwd;
  int /*<<< orphan*/ pw_name;
};

/* Variables and functions */
scalar_t__ strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
bool equal(const struct passwd *a, const struct passwd *b) {
  return strcmp(a->pw_name, b->pw_name) == 0 &&
         strcmp(a->pw_passwd, b->pw_passwd) == 0 && a->pw_uid == b->pw_uid &&
         a->pw_gid == b->pw_gid && strcmp(a->pw_gecos, b->pw_gecos) == 0 &&
         strcmp(a->pw_dir, b->pw_dir) == 0 &&
         strcmp(a->pw_shell, b->pw_shell) == 0;
}


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%esi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1205 <equal+0xf5>
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x1c(%rax),%esi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1205 <equal+0xf5>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
mov    %al,-0x11(%rbp)
jne    1205 <equal+0xf5>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    0x8(%rdx),%rcx
mov    %al,-0x11(%rbp)
jne    1205 <equal+0xf5>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%esi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1205 <equal+0xf5>
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%esi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1205 <equal+0xf5>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%esi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    0x20(%rdi),%edi
mov    0x20(%rsi),%esi
call   1030 <strcmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
jne    1185 <equal+0x75>
mov    0x1c(%rbp),%edi
mov    0x1c(%rbx),%esi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1185 <equal+0x75>
mov    0x0(%rbp),%rax
cmp    (%rbx),%rax
jne    1185 <equal+0x75>
mov    0x8(%rbp),%rax
cmp    0x8(%rbx),%rax
jne    1185 <equal+0x75>
mov    0x18(%rbp),%edi
mov    0x18(%rbx),%esi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1185 <equal+0x75>
mov    0x14(%rbp),%edi
mov    0x14(%rbx),%esi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1185 <equal+0x75>
mov    0x10(%rbp),%edi
mov    0x10(%rbx),%esi
call   1030 <strcmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
sete   %r14b
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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