#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 opaque_auth {
  int /*<<< orphan*/ oa_length;
  int /*<<< orphan*/ oa_base;
  int /*<<< orphan*/ oa_flavor;
};
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ MAX_AUTH_BYTES;
int /*<<< orphan*/ xdr_bytes(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *, int /*<<< orphan*/);
scalar_t__ xdr_enum(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap) {
  if (xdr_enum(xdrs, &(ap->oa_flavor)))
    return xdr_bytes(xdrs, &ap->oa_base, &ap->oa_length, MAX_AUTH_BYTES);
  return FALSE;
}


x86 assembly (clang, -O0):
<xdr_opaque_auth>:
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    $0x8,%rsi
call   1030 <xdr_enum@plt>
cmp    $0x0,%rax
je     1171 <xdr_opaque_auth+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x4,%rsi
mov    -0x18(%rbp),%rdx
mov    0x2e86(%rip),%rax
mov    (%rax),%ecx
call   1040 <xdr_bytes@plt>
mov    %eax,-0x4(%rbp)
jmp    117d <xdr_opaque_auth+0x5d>
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_opaque_auth>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x8,%rsi
call   1030 <xdr_enum@plt>
test   %rax,%rax
je     1157 <xdr_opaque_auth+0x37>
lea    0x4(%rbx),%rsi
mov    0x2ea5(%rip),%rax
mov    (%rax),%ecx
mov    %r14,%rdi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <xdr_bytes@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.opaque_auth = type { i32, i32, i32 }
@MAX_AUTH_BYTES = global i32 0
@FALSE = global i32 0
define i32 @xdr_opaque_auth(i32* %0, %struct.opaque_auth* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.opaque_auth*
store i32* %0, i32** %4
store %struct.opaque_auth* %1, %struct.opaque_auth** %5
%6 = load i32*, i32** %4
%7 = load %struct.opaque_auth*, %struct.opaque_auth** %5
%8 = getelementptr inbounds %struct.opaque_auth, %struct.opaque_auth* %7, i32 0, i32 2
%9 = call i64 @xdr_enum(i32* %6, i32* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i32*, i32** %4
%13 = load %struct.opaque_auth*, %struct.opaque_auth** %5
%14 = getelementptr inbounds %struct.opaque_auth, %struct.opaque_auth* %13, i32 0, i32 1
%15 = load %struct.opaque_auth*, %struct.opaque_auth** %5
%16 = getelementptr inbounds %struct.opaque_auth, %struct.opaque_auth* %15, i32 0, i32 0
%17 = load i32, i32* @MAX_AUTH_BYTES
%18 = call i32 @xdr_bytes(i32* %12, i32* %14, i32* %16, i32 %17)
store i32 %18, i32* %3
br label %21
19: ; preds = %2
%20 = load i32, i32* @FALSE
store i32 %20, i32* %3
br label %21
21: ; preds = %19, %11
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
%struct.opaque_auth = type { i32, i32, i32 }
@MAX_AUTH_BYTES = global i32 0
@FALSE = global i32 0
define i32 @xdr_opaque_auth(i32* %0, %struct.opaque_auth* %1) {
%3 = getelementptr inbounds %struct.opaque_auth, %struct.opaque_auth* %1, i64 0, i32 2
%4 = tail call i64 @xdr_enum(i32* %0, i32* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds %struct.opaque_auth, %struct.opaque_auth* %1, i64 0, i32 1
%8 = getelementptr inbounds %struct.opaque_auth, %struct.opaque_auth* %1, i64 0, i32 0
%9 = load i32, i32* @MAX_AUTH_BYTES
%10 = tail call i32 @xdr_bytes(i32* %0, i32* %7, i32* %8, i32 %9)
br label %13
11: ; preds = %2
%12 = load i32, i32* @FALSE
br label %13
13: ; preds = %11, %6
%14 = phi i32 [ %10, %6 ], [ %12, %11 ]
ret i32 %14
}