#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 /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

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


x86 assembly (clang, -O0):
<xdr_passwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x18,%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
cmp    $0x0,%eax
jne    1160 <xdr_passwd+0x40>
mov    0x2e82(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <xdr_passwd+0x15e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x14,%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
cmp    $0x0,%eax
jne    1190 <xdr_passwd+0x70>
mov    0x2e52(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <xdr_passwd+0x15e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x10,%rsi
call   1040 <xdr_int32_t@plt>
cmp    $0x0,%eax
jne    11bb <xdr_passwd+0x9b>
mov    0x2e27(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <xdr_passwd+0x15e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0xc,%rsi
call   1040 <xdr_int32_t@plt>
cmp    $0x0,%eax
jne    11e6 <xdr_passwd+0xc6>
mov    0x2dfc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <xdr_passwd+0x15e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
cmp    $0x0,%eax
jne    1216 <xdr_passwd+0xf6>
mov    0x2dcc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <xdr_passwd+0x15e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x4,%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
cmp    $0x0,%eax
jne    1246 <xdr_passwd+0x126>
mov    0x2d9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <xdr_passwd+0x15e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
cmp    $0x0,%eax
jne    1272 <xdr_passwd+0x152>
mov    0x2d70(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <xdr_passwd+0x15e>
mov    0x2d6f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_passwd>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x18,%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
mov    0x2e98(%rip),%r15
test   %eax,%eax
je     11cb <xdr_passwd+0xab>
lea    0x14(%r14),%rsi
mov    %rbx,%rdi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
test   %eax,%eax
je     11cb <xdr_passwd+0xab>
lea    0x10(%r14),%rsi
mov    %rbx,%rdi
call   1040 <xdr_int32_t@plt>
test   %eax,%eax
je     11cb <xdr_passwd+0xab>
lea    0xc(%r14),%rsi
mov    %rbx,%rdi
call   1040 <xdr_int32_t@plt>
test   %eax,%eax
je     11cb <xdr_passwd+0xab>
lea    0x8(%r14),%rsi
mov    %rbx,%rdi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
test   %eax,%eax
je     11cb <xdr_passwd+0xab>
lea    0x4(%r14),%rsi
mov    %rbx,%rdi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
test   %eax,%eax
je     11cb <xdr_passwd+0xab>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xffffffff,%edx
call   1030 <xdr_string@plt>
test   %eax,%eax
jne    11c4 <xdr_passwd+0xa4>
mov    0x2e16(%rip),%r15
jmp    11cb <xdr_passwd+0xab>
mov    0x2e1d(%rip),%r15
mov    (%r15),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.passwd = type { i32, i32, i32, i32, i32, i32, i32 }
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_passwd(i32* %0, %struct.passwd* %1) {
%3 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 6
%4 = tail call i32 @xdr_string(i32* %0, i32* %3, i32 -1)
%5 = icmp eq i32 %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 i32 @xdr_string(i32* %0, i32* %7, i32 -1)
%9 = icmp eq i32 %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 i32 @xdr_int32_t(i32* %0, i32* %11)
%13 = icmp eq i32 %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 i32 @xdr_int32_t(i32* %0, i32* %15)
%17 = icmp eq i32 %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 i32 @xdr_string(i32* %0, i32* %19, i32 -1)
%21 = icmp eq i32 %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 i32 @xdr_string(i32* %0, i32* %23, i32 -1)
%25 = icmp eq i32 %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 i32 @xdr_string(i32* %0, i32* %27, i32 -1)
%29 = icmp eq i32 %28, 0
%30 = select i1 %29, i32* @FALSE, i32* @TRUE
br label %31
31: ; preds = %26, %22, %18, %14, %10, %6, %2
%32 = phi i32* [ @FALSE, %2 ], [ @FALSE, %6 ], [ @FALSE, %10 ], [ @FALSE, %14 ], [ @FALSE, %18 ], [ @FALSE, %22 ], [ %30, %26 ]
%33 = load i32, i32* %32
ret i32 %33
}