#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_7__ TYPE_2__;
typedef struct TYPE_6__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ bool_t;
struct TYPE_7__ {
  int x_op;
  TYPE_1__ *x_ops;
};
typedef TYPE_2__ XDR;
struct TYPE_6__ {
  int /*<<< orphan*/ (*x_getlong)(TYPE_2__ *, long *);
  int /*<<< orphan*/ (*x_putlong)(TYPE_2__ *, long *);
};

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
#define XDR_DECODE 130
#define XDR_ENCODE 129
#define XDR_FREE 128
int /*<<< orphan*/ stub1(TYPE_2__ *, long *);
int /*<<< orphan*/ stub2(TYPE_2__ *, long *);
bool_t xdr_bool(XDR *xdrs, bool_t *bp) {
  long lb;
  switch (xdrs->x_op) {
  case XDR_ENCODE:
    lb = *bp ? ((long)1) : ((long)0);
    return (*(xdrs)->x_ops->x_putlong)(xdrs, &lb);
  case XDR_DECODE:
    if (!(*(xdrs)->x_ops->x_getlong)(xdrs, &lb)) {
      return FALSE;
    }
    *bp = (lb == ((long)0)) ? FALSE : TRUE;
    return TRUE;
  case XDR_FREE:
    return TRUE;
  }
  return FALSE;
}


x86 assembly (clang, -O0):
<xdr_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
sub    $0x80,%eax
je     11f6 <xdr_bool+0xf6>
jmp    1129 <xdr_bool+0x29>
mov    -0x24(%rbp),%eax
sub    $0x81,%eax
je     114f <xdr_bool+0x4f>
jmp    113c <xdr_bool+0x3c>
mov    -0x24(%rbp),%eax
sub    $0x82,%eax
je     1185 <xdr_bool+0x85>
jmp    1207 <xdr_bool+0x107>
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x8(%rax),%rax
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   *%rax
mov    %eax,-0x4(%rbp)
jmp    1213 <xdr_bool+0x113>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   *%rax
cmp    $0x0,%eax
jne    11b4 <xdr_bool+0xb4>
mov    0x2e2e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1213 <xdr_bool+0x113>
cmpq   $0x0,-0x20(%rbp)
jne    11d0 <xdr_bool+0xd0>
mov    0x2e12(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
jmp    11dc <xdr_bool+0xdc>
mov    0x2e11(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2dfc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1213 <xdr_bool+0x113>
mov    0x2deb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1213 <xdr_bool+0x113>
mov    0x2dca(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_bool>:
push   %rbx
sub    $0x10,%rsp
mov    (%rdi),%eax
cmp    $0x80,%eax
je     113a <xdr_bool+0x3a>
mov    %rsi,%rbx
cmp    $0x82,%eax
je     1143 <xdr_bool+0x43>
cmp    $0x81,%eax
jne    1171 <xdr_bool+0x71>
xor    %eax,%eax
cmpl   $0x0,(%rbx)
setne  %al
mov    %rax,0x8(%rsp)
mov    0x8(%rdi),%rax
lea    0x8(%rsp),%rsi
call   *0x8(%rax)
jmp    117a <xdr_bool+0x7a>
mov    0x2ea7(%rip),%rax
jmp    1178 <xdr_bool+0x78>
mov    0x8(%rdi),%rax
lea    0x8(%rsp),%rsi
call   *(%rax)
test   %eax,%eax
je     1171 <xdr_bool+0x71>
cmpq   $0x0,0x8(%rsp)
mov    0x2e89(%rip),%rax
mov    %rax,%rcx
jne    116b <xdr_bool+0x6b>
mov    0x2e6d(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rbx)
jmp    1178 <xdr_bool+0x78>
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_7__ = type { i32, %struct.TYPE_6__* }
%struct.TYPE_6__ = type { i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)* }
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_bool(%struct.TYPE_7__* %0, i32* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_7__*
%5 = alloca i32*
%6 = alloca i64
store %struct.TYPE_7__* %0, %struct.TYPE_7__** %4
store i32* %1, i32** %5
%7 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%8 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %7, i32 0, i32 0
%9 = load i32, i32* %8
switch i32 %9, label %47 [
i32 129, label %10
i32 130, label %23
i32 128, label %45
]
10: ; preds = %2
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i64 1, i64 0
store i64 %15, i64* %6
%16 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%17 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %16, i32 0, i32 1
%18 = load %struct.TYPE_6__*, %struct.TYPE_6__** %17
%19 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %18, i32 0, i32 1
%20 = load i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)** %19
%21 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%22 = call i32 %20(%struct.TYPE_7__* %21, i64* %6)
store i32 %22, i32* %3
br label %49
23: ; preds = %2
%24 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%25 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %24, i32 0, i32 1
%26 = load %struct.TYPE_6__*, %struct.TYPE_6__** %25
%27 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %26, i32 0, i32 0
%28 = load i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)** %27
%29 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%30 = call i32 %28(%struct.TYPE_7__* %29, i64* %6)
%31 = icmp ne i32 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %23
%33 = load i32, i32* @FALSE
store i32 %33, i32* %3
br label %49
34: ; preds = %23
%35 = load i64, i64* %6
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = load i32, i32* @FALSE
br label %41
39: ; preds = %34
%40 = load i32, i32* @TRUE
br label %41
41: ; preds = %39, %37
%42 = phi i32 [ %38, %37 ], [ %40, %39 ]
%43 = load i32*, i32** %5
store i32 %42, i32* %43
%44 = load i32, i32* @TRUE
store i32 %44, i32* %3
br label %49
45: ; preds = %2
%46 = load i32, i32* @TRUE
store i32 %46, i32* %3
br label %49
47: ; preds = %2
%48 = load i32, i32* @FALSE
store i32 %48, i32* %3
br label %49
49: ; preds = %47, %45, %41, %32, %10
%50 = load i32, i32* %3
ret i32 %50
}

LLVM IR (-O2):
%struct.TYPE_7__ = type { i32, %struct.TYPE_6__* }
%struct.TYPE_6__ = type { i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)* }
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_bool(%struct.TYPE_7__* %0, i32* nocapture %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %0, i64 0, i32 0
%6 = load i32, i32* %5
switch i32 %6, label %34 [
i32 129, label %7
i32 130, label %16
i32 128, label %32
]
7: ; preds = %2
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
store i64 %10, i64* %3
%11 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %0, i64 0, i32 1
%12 = load %struct.TYPE_6__*, %struct.TYPE_6__** %11
%13 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %12, i64 0, i32 1
%14 = load i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)** %13
%15 = call i32 %14(%struct.TYPE_7__* %0, i64* %3)
br label %36
16: ; preds = %2
%17 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %0, i64 0, i32 1
%18 = load %struct.TYPE_6__*, %struct.TYPE_6__** %17
%19 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %18, i64 0, i32 0
%20 = load i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)** %19
%21 = call i32 %20(%struct.TYPE_7__* %0, i64* %3)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %16
%24 = load i32, i32* @FALSE
br label %36
25: ; preds = %16
%26 = load i64, i64* %3
%27 = icmp eq i64 %26, 0
%28 = load i32, i32* @FALSE
%29 = load i32, i32* @TRUE
%30 = select i1 %27, i32 %28, i32 %29
store i32 %30, i32* %1
%31 = load i32, i32* @TRUE
br label %36
32: ; preds = %2
%33 = load i32, i32* @TRUE
br label %36
34: ; preds = %2
%35 = load i32, i32* @FALSE
br label %36
36: ; preds = %34, %32, %25, %23, %7
%37 = phi i32 [ %35, %34 ], [ %33, %32 ], [ %31, %25 ], [ %24, %23 ], [ %15, %7 ]
ret i32 %37
}