#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 bool_t;
struct TYPE_7__ {
  int x_op;
  TYPE_1__ *x_ops;
};
typedef TYPE_2__ XDR;
struct TYPE_6__ {
  int (*x_putlong)(TYPE_2__ *, long *);
  int (*x_getlong)(TYPE_2__ *, long *);
};

/* Variables and functions */
#define XDR_DECODE 130
#define XDR_ENCODE 129
#define XDR_FREE 128
int stub1(TYPE_2__ *, long *);
int stub2(TYPE_2__ *, long *);
bool_t xdr_long(XDR *xdrs, long int *lp) {
  switch (xdrs->x_op) {
  case XDR_ENCODE:
    return ((*(xdrs)->x_ops->x_putlong)(xdrs, lp));
  case XDR_DECODE:
    return ((*(xdrs)->x_ops->x_getlong)(xdrs, lp));
  case XDR_FREE:
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<xdr_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x80,%eax
je     118a <xdr_long+0x8a>
jmp    1129 <xdr_long+0x29>
mov    -0x1c(%rbp),%eax
sub    $0x81,%eax
je     114f <xdr_long+0x4f>
jmp    113c <xdr_long+0x3c>
mov    -0x1c(%rbp),%eax
sub    $0x82,%eax
je     116c <xdr_long+0x6c>
jmp    1196 <xdr_long+0x96>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
mov    %eax,-0x4(%rbp)
jmp    119d <xdr_long+0x9d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x8(%rax),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
mov    %eax,-0x4(%rbp)
jmp    119d <xdr_long+0x9d>
movl   $0x1,-0x4(%rbp)
jmp    119d <xdr_long+0x9d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_long>:
mov    (%rdi),%eax
cmp    $0x80,%eax
je     1120 <xdr_long+0x20>
cmp    $0x82,%eax
je     1126 <xdr_long+0x26>
cmp    $0x81,%eax
jne    1130 <xdr_long+0x30>
mov    0x8(%rdi),%rax
mov    (%rax),%rax
jmp    *%rax
mov    $0x1,%eax
ret
mov    0x8(%rdi),%rax
mov    0x8(%rax),%rax
jmp    *%rax
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TYPE_7__ = type { i32, %struct.TYPE_6__* }
%struct.TYPE_6__ = type { {}*, {}* }
define i32 @xdr_long(%struct.TYPE_7__* %0, i64* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_7__*
%5 = alloca i64*
store %struct.TYPE_7__* %0, %struct.TYPE_7__** %4
store i64* %1, i64** %5
%6 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%7 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %6, i32 0, i32 0
%8 = load i32, i32* %7
switch i32 %8, label %30 [
i32 129, label %9
i32 130, label %19
i32 128, label %29
]
9: ; preds = %2
%10 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%11 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %10, i32 0, i32 1
%12 = load %struct.TYPE_6__*, %struct.TYPE_6__** %11
%13 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %12, i32 0, i32 0
%14 = bitcast {}** %13 to i32 (%struct.TYPE_7__*, i64*)**
%15 = load i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)** %14
%16 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%17 = load i64*, i64** %5
%18 = call i32 %15(%struct.TYPE_7__* %16, i64* %17)
store i32 %18, i32* %3
br label %31
19: ; preds = %2
%20 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%21 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %20, i32 0, i32 1
%22 = load %struct.TYPE_6__*, %struct.TYPE_6__** %21
%23 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %22, i32 0, i32 1
%24 = bitcast {}** %23 to i32 (%struct.TYPE_7__*, i64*)**
%25 = load i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)** %24
%26 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%27 = load i64*, i64** %5
%28 = call i32 %25(%struct.TYPE_7__* %26, i64* %27)
store i32 %28, i32* %3
br label %31
29: ; preds = %2
store i32 1, i32* %3
br label %31
30: ; preds = %2
store i32 0, i32* %3
br label %31
31: ; preds = %30, %29, %19, %9
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
%struct.TYPE_7__ = type { i32, %struct.TYPE_6__* }
%struct.TYPE_6__ = type { {}*, {}* }
define i32 @xdr_long(%struct.TYPE_7__* %0, i64* %1) {
%3 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %0, i64 0, i32 0
%4 = load i32, i32* %3
switch i32 %4, label %18 [
i32 129, label %5
i32 130, label %11
i32 128, label %19
]
5: ; preds = %2
%6 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %0, i64 0, i32 1
%7 = bitcast %struct.TYPE_6__** %6 to i32 (%struct.TYPE_7__*, i64*)***
%8 = load i32 (%struct.TYPE_7__*, i64*)**, i32 (%struct.TYPE_7__*, i64*)*** %7
%9 = load i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)** %8
%10 = tail call i32 %9(%struct.TYPE_7__* %0, i64* %1)
br label %19
11: ; preds = %2
%12 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %0, i64 0, i32 1
%13 = load %struct.TYPE_6__*, %struct.TYPE_6__** %12
%14 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %13, i64 0, i32 1
%15 = bitcast {}** %14 to i32 (%struct.TYPE_7__*, i64*)**
%16 = load i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)** %15
%17 = tail call i32 %16(%struct.TYPE_7__* %0, i64* %1)
br label %19
18: ; preds = %2
br label %19
19: ; preds = %2, %18, %11, %5
%20 = phi i32 [ 0, %18 ], [ %17, %11 ], [ %10, %5 ], [ 1, %2 ]
ret i32 %20
}