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

/* Variables and functions */
scalar_t__ xdr_int(int /*<<< orphan*/ *, int *);
scalar_t__ xdr_string(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                      int /*<<< orphan*/);
bool_t xdr_passwd(XDR *xdrs, struct passwd *objp) {
  return xdr_string(xdrs, &objp->pw_name, ~0) &&
         xdr_string(xdrs, &objp->pw_passwd, ~0) &&
         xdr_int(xdrs, (int *)&objp->pw_uid) &&
         xdr_int(xdrs, (int *)&objp->pw_gid) &&
         xdr_string(xdrs, &objp->pw_gecos, ~0) &&
         xdr_string(xdrs, &objp->pw_dir, ~0) &&
         xdr_string(xdrs, &objp->pw_shell, ~0);
}


x86 assembly (clang, -O0):
<xdr_passwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x18,%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1232 <xdr_passwd+0x112>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x14,%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1232 <xdr_passwd+0x112>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
call   1040 <xdr_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1232 <xdr_passwd+0x112>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0xc,%rsi
call   1040 <xdr_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1232 <xdr_passwd+0x112>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1232 <xdr_passwd+0x112>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1232 <xdr_passwd+0x112>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
cmp    $0x0,%rax
setne  %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):
<xdr_passwd>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rbp
add    $0x18,%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
xor    %r14d,%r14d
test   %rax,%rax
je     11be <xdr_passwd+0x9e>
lea    0x14(%rbx),%rsi
mov    %rbp,%rdi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
test   %rax,%rax
je     11be <xdr_passwd+0x9e>
lea    0x10(%rbx),%rsi
mov    %rbp,%rdi
call   1040 <xdr_int@plt>
test   %rax,%rax
je     11be <xdr_passwd+0x9e>
lea    0xc(%rbx),%rsi
mov    %rbp,%rdi
call   1040 <xdr_int@plt>
test   %rax,%rax
je     11be <xdr_passwd+0x9e>
lea    0x8(%rbx),%rsi
mov    %rbp,%rdi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
test   %rax,%rax
je     11be <xdr_passwd+0x9e>
lea    0x4(%rbx),%rsi
mov    %rbp,%rdi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
test   %rax,%rax
je     11be <xdr_passwd+0x9e>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
xor    %r14d,%r14d
test   %rax,%rax
setne  %r14b
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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