#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 enum authdes_namekind {
  ____Placeholder_authdes_namekind
} authdes_namekind;
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) {
  enum authdes_namekind *padc_namekind = &cred->adc_namekind;
  if (!(xdr_enum(xdrs, (enum_t *)padc_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    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <xdr_enum@plt>
cmp    $0x0,%eax
jne    116f <xdr_authdes_cred+0x3f>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129b <xdr_authdes_cred+0x16b>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
sub    $0x80,%eax
je     124c <xdr_authdes_cred+0x11c>
jmp    1188 <xdr_authdes_cred+0x58>
mov    -0x24(%rbp),%eax
sub    $0x81,%eax
jne    128f <xdr_authdes_cred+0x15f>
jmp    119b <xdr_authdes_cred+0x6b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
add    $0x8,%rsi
mov    0x2e1e(%rip),%rax
mov    (%rax),%edx
call   1030 <xdr_string@plt>
cmp    $0x0,%eax
jne    11d3 <xdr_authdes_cred+0xa3>
mov    0x2e0f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129b <xdr_authdes_cred+0x16b>
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    1209 <xdr_authdes_cred+0xd9>
mov    0x2dd9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129b <xdr_authdes_cred+0x16b>
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    123b <xdr_authdes_cred+0x10b>
mov    0x2da7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129b <xdr_authdes_cred+0x16b>
mov    0x2da6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129b <xdr_authdes_cred+0x16b>
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    127e <xdr_authdes_cred+0x14e>
mov    0x2d64(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129b <xdr_authdes_cred+0x16b>
mov    0x2d63(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    129b <xdr_authdes_cred+0x16b>
mov    0x2d42(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%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*
%6 = alloca i32*
store i32* %0, i32** %4
store %struct.authdes_cred* %1, %struct.authdes_cred** %5
%7 = load %struct.authdes_cred*, %struct.authdes_cred** %5
%8 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %7, i32 0, i32 0
store i32* %8, i32** %6
%9 = load i32*, i32** %4
%10 = load i32*, i32** %6
%11 = call i32 @xdr_enum(i32* %9, i32* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = load i32, i32* @FALSE
store i32 %14, i32* %3
br label %64
15: ; preds = %2
%16 = load %struct.authdes_cred*, %struct.authdes_cred** %5
%17 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %16, i32 0, i32 0
%18 = load i32, i32* %17
switch i32 %18, label %62 [
i32 129, label %19
i32 128, label %51
]
19: ; preds = %15
%20 = load i32*, i32** %4
%21 = load %struct.authdes_cred*, %struct.authdes_cred** %5
%22 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %21, i32 0, i32 2
%23 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %22, i32 0, i32 2
%24 = load i32, i32* @MAXNETNAMELEN
%25 = call i32 @xdr_string(i32* %20, i32* %23, i32 %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %19
%28 = load i32, i32* @FALSE
store i32 %28, i32* %3
br label %64
29: ; preds = %19
%30 = load i32*, i32** %4
%31 = load %struct.authdes_cred*, %struct.authdes_cred** %5
%32 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %31, i32 0, i32 2
%33 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %32, i32 0, i32 1
%34 = ptrtoint i32* %33 to i32
%35 = call i32 @xdr_opaque(i32* %30, i32 %34, i32 4)
%36 = icmp ne i32 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %29
%38 = load i32, i32* @FALSE
store i32 %38, i32* %3
br label %64
39: ; preds = %29
%40 = load i32*, i32** %4
%41 = load %struct.authdes_cred*, %struct.authdes_cred** %5
%42 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %41, i32 0, i32 2
%43 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %42, i32 0, i32 0
%44 = ptrtoint i32* %43 to i32
%45 = call i32 @xdr_opaque(i32* %40, i32 %44, i32 4)
%46 = icmp ne i32 %45, 0
br i1 %46, label %49, label %47
47: ; preds = %39
%48 = load i32, i32* @FALSE
store i32 %48, i32* %3
br label %64
49: ; preds = %39
%50 = load i32, i32* @TRUE
store i32 %50, i32* %3
br label %64
51: ; preds = %15
%52 = load i32*, i32** %4
%53 = load %struct.authdes_cred*, %struct.authdes_cred** %5
%54 = getelementptr inbounds %struct.authdes_cred, %struct.authdes_cred* %53, i32 0, i32 1
%55 = ptrtoint i32* %54 to i32
%56 = call i32 @xdr_opaque(i32* %52, i32 %55, i32 4)
%57 = icmp ne i32 %56, 0
br i1 %57, label %60, label %58
58: ; preds = %51
%59 = load i32, i32* @FALSE
store i32 %59, i32* %3
br label %64
60: ; preds = %51
%61 = load i32, i32* @TRUE
store i32 %61, i32* %3
br label %64
62: ; preds = %15
%63 = load i32, i32* @FALSE
store i32 %63, i32* %3
br label %64
64: ; preds = %62, %60, %58, %49, %47, %37, %27, %13
%65 = load i32, i32* %3
ret i32 %65
}

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
}