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

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ window;
  int /*<<< orphan*/ key;
  int /*<<< orphan*/ name;
};
struct authdes_cred {
  int adc_namekind;
  int /*<<< orphan*/ adc_nickname;
  TYPE_1__ adc_fullname;
};
typedef int /*<<< orphan*/ enum_t;
typedef int /*<<< orphan*/ des_block;
typedef int /*<<< orphan*/ caddr_t;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
#define ADN_FULLNAME 129
#define ADN_NICKNAME 128
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ MAXNETNAMELEN;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ xdr_enum(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ xdr_opaque(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ xdr_string(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/);
bool_t xdr_authdes_cred(XDR *xdrs, struct authdes_cred *cred) {
  if (!(xdr_enum(xdrs, (enum_t *)&cred->adc_namekind)))
    return (FALSE);
  switch (cred->adc_namekind) {
  case ADN_FULLNAME:
    if (!(xdr_string(xdrs, &cred->adc_fullname.name, MAXNETNAMELEN)))
      return (FALSE);
    if (!(xdr_opaque(xdrs, (caddr_t)&cred->adc_fullname.key,
                     sizeof(des_block))))
      return (FALSE);
    if (!(xdr_opaque(xdrs, (caddr_t)&cred->adc_fullname.window,
                     sizeof(cred->adc_fullname.window))))
      return (FALSE);
    return (TRUE);
  case ADN_NICKNAME:
    if (!(xdr_opaque(xdrs, (caddr_t)&cred->adc_nickname,
                     sizeof(cred->adc_nickname))))
      return (FALSE);
    return TRUE;
  default:
    return FALSE;
  }
}


x86 assembly (clang, -O0):
<xdr_authdes_cred>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <xdr_enum@plt>
cmp    $0x0,%eax
jne    1167 <xdr_authdes_cred+0x37>
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1293 <xdr_authdes_cred+0x163>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x80,%eax
je     1244 <xdr_authdes_cred+0x114>
jmp    1180 <xdr_authdes_cred+0x50>
mov    -0x1c(%rbp),%eax
sub    $0x81,%eax
jne    1287 <xdr_authdes_cred+0x157>
jmp    1193 <xdr_authdes_cred+0x63>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
add    $0x8,%rsi
mov    0x2e26(%rip),%rax
mov    (%rax),%edx
call   1030 <xdr_string@plt>
cmp    $0x0,%eax
jne    11cb <xdr_authdes_cred+0x9b>
mov    0x2e17(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1293 <xdr_authdes_cred+0x163>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
add    $0x8,%rax
add    $0x4,%rax
mov    %eax,%esi
mov    $0x4,%edx
call   1050 <xdr_opaque@plt>
cmp    $0x0,%eax
jne    1201 <xdr_authdes_cred+0xd1>
mov    0x2de1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1293 <xdr_authdes_cred+0x163>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %eax,%esi
mov    $0x4,%edx
call   1050 <xdr_opaque@plt>
cmp    $0x0,%eax
jne    1233 <xdr_authdes_cred+0x103>
mov    0x2daf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1293 <xdr_authdes_cred+0x163>
mov    0x2dae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1293 <xdr_authdes_cred+0x163>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %eax,%esi
mov    $0x4,%edx
call   1050 <xdr_opaque@plt>
cmp    $0x0,%eax
jne    1276 <xdr_authdes_cred+0x146>
mov    0x2d6c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1293 <xdr_authdes_cred+0x163>
mov    0x2d6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1293 <xdr_authdes_cred+0x163>
mov    0x2d4a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_authdes_cred>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <xdr_enum@plt>
mov    0x2e91(%rip),%r15
test   %eax,%eax
je     11b5 <xdr_authdes_cred+0x85>
mov    (%rbx),%eax
cmp    $0x80,%eax
je     118e <xdr_authdes_cred+0x5e>
cmp    $0x81,%eax
jne    11b5 <xdr_authdes_cred+0x85>
lea    0x10(%rbx),%rsi
mov    0x2e6a(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
call   1030 <xdr_string@plt>
test   %eax,%eax
je     11b5 <xdr_authdes_cred+0x85>
lea    0xc(%rbx),%esi
mov    %r14,%rdi
mov    $0x4,%edx
call   1050 <xdr_opaque@plt>
test   %eax,%eax
je     11b5 <xdr_authdes_cred+0x85>
add    $0x8,%rbx
jmp    1192 <xdr_authdes_cred+0x62>
add    $0x4,%rbx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
call   1050 <xdr_opaque@plt>
test   %eax,%eax
jne    11ae <xdr_authdes_cred+0x7e>
mov    0x2e2c(%rip),%r15
jmp    11b5 <xdr_authdes_cred+0x85>
mov    0x2e33(%rip),%r15
mov    (%r15),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.authdes_cred = type { i32, i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32, i32, i32 }
@FALSE = global i32 0
@MAXNETNAMELEN = global i32 0
@TRUE = global i32 0
define i32 @xdr_authdes_cred(i32* %0, %struct.authdes_cred* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.authdes_cred*
store i32* %0, i32** %4
store %struct.authdes_cred* %1, %struct.authdes_cred** %5
%6 = load i32*, i32** %4
%7 = load %struct.authdes_cred*, %struct.authdes_cred** %5
%8 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %7, i32 0, i32 0
%9 = call i32 @xdr_enum(i32* %6, i32* %8)
%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 %62
13: ; preds = %2
%14 = load %struct.authdes_cred*, %struct.authdes_cred** %5
%15 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %14, i32 0, i32 0
%16 = load i32, i32* %15
switch i32 %16, label %60 [
i32 129, label %17
i32 128, label %49
]
17: ; preds = %13
%18 = load i32*, i32** %4
%19 = load %struct.authdes_cred*, %struct.authdes_cred** %5
%20 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %19, i32 0, i32 2
%21 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %20, i32 0, i32 2
%22 = load i32, i32* @MAXNETNAMELEN
%23 = call i32 @xdr_string(i32* %18, i32* %21, i32 %22)
%24 = icmp ne i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %17
%26 = load i32, i32* @FALSE
store i32 %26, i32* %3
br label %62
27: ; preds = %17
%28 = load i32*, i32** %4
%29 = load %struct.authdes_cred*, %struct.authdes_cred** %5
%30 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %29, i32 0, i32 2
%31 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %30, i32 0, i32 1
%32 = ptrtoint i32* %31 to i32
%33 = call i32 @xdr_opaque(i32* %28, i32 %32, i32 4)
%34 = icmp ne i32 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %27
%36 = load i32, i32* @FALSE
store i32 %36, i32* %3
br label %62
37: ; preds = %27
%38 = load i32*, i32** %4
%39 = load %struct.authdes_cred*, %struct.authdes_cred** %5
%40 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %39, i32 0, i32 2
%41 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %40, i32 0, i32 0
%42 = ptrtoint i32* %41 to i32
%43 = call i32 @xdr_opaque(i32* %38, i32 %42, i32 4)
%44 = icmp ne i32 %43, 0
br i1 %44, label %47, label %45
45: ; preds = %37
%46 = load i32, i32* @FALSE
store i32 %46, i32* %3
br label %62
47: ; preds = %37
%48 = load i32, i32* @TRUE
store i32 %48, i32* %3
br label %62
49: ; preds = %13
%50 = load i32*, i32** %4
%51 = load %struct.authdes_cred*, %struct.authdes_cred** %5
%52 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %51, i32 0, i32 1
%53 = ptrtoint i32* %52 to i32
%54 = call i32 @xdr_opaque(i32* %50, i32 %53, i32 4)
%55 = icmp ne i32 %54, 0
br i1 %55, label %58, label %56
56: ; preds = %49
%57 = load i32, i32* @FALSE
store i32 %57, i32* %3
br label %62
58: ; preds = %49
%59 = load i32, i32* @TRUE
store i32 %59, i32* %3
br label %62
60: ; preds = %13
%61 = load i32, i32* @FALSE
store i32 %61, i32* %3
br label %62
62: ; preds = %60, %58, %56, %47, %45, %35, %25, %11
%63 = load i32, i32* %3
ret i32 %63
}

LLVM IR (-O2):
%struct.authdes_cred = type { i32, i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32, i32, i32 }
@FALSE = global i32 0
@MAXNETNAMELEN = global i32 0
@TRUE = global i32 0
define i32 @xdr_authdes_cred(i32* %0, %struct.authdes_cred* %1) {
%3 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %1, i64 0, i32 0
%4 = tail call i32 @xdr_enum(i32* %0, i32* %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %30, label %6
6: ; preds = %2
%7 = load i32, i32* %3
switch i32 %7, label %30 [
i32 129, label %8
i32 128, label %21
]
8: ; preds = %6
%9 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %1, i64 0, i32 2, i32 2
%10 = load i32, i32* @MAXNETNAMELEN
%11 = tail call i32 @xdr_string(i32* %0, i32* %9, i32 %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %30, label %13
13: ; preds = %8
%14 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %1, i64 0, i32 2, i32 1
%15 = ptrtoint i32* %14 to i64
%16 = trunc i64 %15 to i32
%17 = tail call i32 @xdr_opaque(i32* %0, i32 %16, i32 4)
%18 = icmp eq i32 %17, 0
br i1 %18, label %30, label %19
19: ; preds = %13
%20 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %1, i64 0, i32 2, i32 0
br label %23
21: ; preds = %6
%22 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %1, i64 0, i32 1
br label %23
23: ; preds = %19, %21
%24 = phi i32* [ %22, %21 ], [ %20, %19 ]
%25 = ptrtoint i32* %24 to i64
%26 = trunc i64 %25 to i32
%27 = tail call i32 @xdr_opaque(i32* %0, i32 %26, i32 4)
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, i32* @FALSE, i32* @TRUE
br label %30
30: ; preds = %23, %6, %13, %8, %2
%31 = phi i32* [ @FALSE, %2 ], [ @FALSE, %8 ], [ @FALSE, %13 ], [ @FALSE, %6 ], [ %29, %23 ]
%32 = load i32, i32* %31
ret i32 %32
}