#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*/ assert(int /*<<< orphan*/);
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) {
  assert(xdrs != NULL);
  assert(ap != NULL);
  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)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
call   1030 <xdr_enum@plt>
cmp    $0x0,%rax
je     11a5 <xdr_opaque_auth+0x75>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x4,%rsi
mov    -0x18(%rbp),%rdx
mov    0x2e52(%rip),%rax
mov    (%rax),%ecx
call   1050 <xdr_bytes@plt>
mov    %eax,-0x4(%rbp)
jmp    11b1 <xdr_opaque_auth+0x81>
mov    0x2e2c(%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
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
lea    0x8(%rbx),%rsi
mov    %r14,%rdi
call   1030 <xdr_enum@plt>
test   %rax,%rax
je     1186 <xdr_opaque_auth+0x56>
lea    0x4(%rbx),%rsi
mov    0x2e76(%rip),%rax
mov    (%rax),%ecx
mov    %r14,%rdi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <xdr_bytes@plt>
mov    0x2e4b(%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 = icmp ne i32* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load %struct.opaque_auth*, %struct.opaque_auth** %5
%11 = icmp ne %struct.opaque_auth* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32*, i32** %4
%15 = load %struct.opaque_auth*, %struct.opaque_auth** %5
%16 = getelementptr inbounds %struct.opaque_auth, %struct.opaque_auth* %15, i32 0, i32 2
%17 = call i64 @xdr_enum(i32* %14, i32* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %27
19: ; preds = %2
%20 = load i32*, i32** %4
%21 = load %struct.opaque_auth*, %struct.opaque_auth** %5
%22 = getelementptr inbounds %struct.opaque_auth, %struct.opaque_auth* %21, i32 0, i32 1
%23 = load %struct.opaque_auth*, %struct.opaque_auth** %5
%24 = getelementptr inbounds %struct.opaque_auth, %struct.opaque_auth* %23, i32 0, i32 0
%25 = load i32, i32* @MAX_AUTH_BYTES
%26 = call i32 @xdr_bytes(i32* %20, i32* %22, i32* %24, i32 %25)
store i32 %26, i32* %3
br label %29
27: ; preds = %2
%28 = load i32, i32* @FALSE
store i32 %28, i32* %3
br label %29
29: ; preds = %27, %19
%30 = load i32, i32* %3
ret i32 %30
}

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 = icmp ne i32* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne %struct.opaque_auth* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = getelementptr inbounds %struct.opaque_auth, %struct.opaque_auth* %1, i64 0, i32 2
%10 = tail call i64 @xdr_enum(i32* %0, i32* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %2
%13 = getelementptr inbounds %struct.opaque_auth, %struct.opaque_auth* %1, i64 0, i32 1
%14 = getelementptr inbounds %struct.opaque_auth, %struct.opaque_auth* %1, i64 0, i32 0
%15 = load i32, i32* @MAX_AUTH_BYTES
%16 = tail call i32 @xdr_bytes(i32* %0, i32* %13, i32* %14, i32 %15)
br label %19
17: ; preds = %2
%18 = load i32, i32* @FALSE
br label %19
19: ; preds = %17, %12
%20 = phi i32 [ %16, %12 ], [ %18, %17 ]
ret i32 %20
}