#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_8__ TYPE_3__;
typedef struct TYPE_7__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ (*xdrproc_t)(TYPE_1__ *, scalar_t__ *);
typedef scalar_t__ caddr_t;
typedef int /*<<< orphan*/ bool_t;
struct TYPE_7__ {
  int /*<<< orphan*/ x_op;
};
typedef TYPE_1__ XDR;
struct TYPE_8__ {
  scalar_t__ xp_p1;
};
typedef TYPE_3__ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ XDR_DECODE;
int /*<<< orphan*/ XDR_FREE;
int /*<<< orphan*/ stub1(TYPE_1__ *, scalar_t__ *);
bool_t byz_freeargs(SVCXPRT *xpt, xdrproc_t p, caddr_t b) {
  bool_t ret;
  ((XDR *)((xpt)->xp_p1))->x_op = XDR_FREE;
  ret = (*p)(((XDR *)((xpt)->xp_p1)), (caddr_t *)b);
  ((XDR *)((xpt)->xp_p1))->x_op = XDR_DECODE;
  return ret;
}


x86 assembly (clang, -O0):
<byz_freeargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
mov    %eax,-0x1c(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<byz_freeargs>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%rcx
mov    (%rcx),%ecx
mov    (%rdi),%rdi
mov    %ecx,(%rdi)
mov    %rdx,%rsi
call   *%rax
mov    0x2ecf(%rip),%rcx
mov    (%rcx),%ecx
mov    (%rbx),%rdx
mov    %ecx,(%rdx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_8__ = type { i64 }
%struct.TYPE_7__ = type { i32 }
@XDR_FREE = global i32 0
@XDR_DECODE = global i32 0
define i32 @byz_freeargs(%struct.TYPE_8__* %0, i32 (%struct.TYPE_7__*, i64*)* %1, i64 %2) {
%4 = alloca %struct.TYPE_8__*
%5 = alloca i32 (%struct.TYPE_7__*, i64*)*
%6 = alloca i64
%7 = alloca i32
store %struct.TYPE_8__* %0, %struct.TYPE_8__** %4
store i32 (%struct.TYPE_7__*, i64*)* %1, i32 (%struct.TYPE_7__*, i64*)** %5
store i64 %2, i64* %6
%8 = load i32, i32* @XDR_FREE
%9 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%10 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %9, i32 0, i32 0
%11 = load i64, i64* %10
%12 = inttoptr i64 %11 to %struct.TYPE_7__*
%13 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %12, i32 0, i32 0
store i32 %8, i32* %13
%14 = load i32 (%struct.TYPE_7__*, i64*)*, i32 (%struct.TYPE_7__*, i64*)** %5
%15 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%16 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %15, i32 0, i32 0
%17 = load i64, i64* %16
%18 = inttoptr i64 %17 to %struct.TYPE_7__*
%19 = load i64, i64* %6
%20 = inttoptr i64 %19 to i64*
%21 = call i32 %14(%struct.TYPE_7__* %18, i64* %20)
store i32 %21, i32* %7
%22 = load i32, i32* @XDR_DECODE
%23 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%24 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %23, i32 0, i32 0
%25 = load i64, i64* %24
%26 = inttoptr i64 %25 to %struct.TYPE_7__*
%27 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %26, i32 0, i32 0
store i32 %22, i32* %27
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
%struct.TYPE_8__ = type { i64 }
%struct.TYPE_7__ = type { i32 }
@XDR_FREE = global i32 0
@XDR_DECODE = global i32 0
define i32 @byz_freeargs(%struct.TYPE_8__* nocapture %0, i32 (%struct.TYPE_7__*, i64*)* nocapture %1, i64 %2) {
%4 = load i32, i32* @XDR_FREE
%5 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to %struct.TYPE_7__*
%8 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %7, i64 0, i32 0
store i32 %4, i32* %8
%9 = inttoptr i64 %2 to i64*
%10 = tail call i32 %1(%struct.TYPE_7__* %7, i64* %9)
%11 = load i32, i32* @XDR_DECODE
%12 = load i64, i64* %5
%13 = inttoptr i64 %12 to %struct.TYPE_7__*
%14 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %13, i64 0, i32 0
store i32 %11, i32* %14
ret i32 %10
}