#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_3__ TYPE_1__;

/* Type definitions */
typedef scalar_t__ u_int;
typedef int /*<<< orphan*/ bool_t;
struct TYPE_3__ {
  scalar_t__ x_handy;
  char *x_private;
};
typedef TYPE_1__ XDR;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ memmove(char *, char const *, scalar_t__);
bool_t xdrmem_putbytes(XDR *xdrs, const char *addr, u_int len) {
  if (xdrs->x_handy < len)
    return (FALSE);
  xdrs->x_handy -= len;
  memmove(xdrs->x_private, addr, len);
  xdrs->x_private = (char *)xdrs->x_private + len;
  return (TRUE);
}


x86 assembly (clang, -O0):
<xdrmem_putbytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
jge    1146 <xdrmem_putbytes+0x36>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    118c <xdrmem_putbytes+0x7c>
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
sub    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memmove@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
add    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    0x2e61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdrmem_putbytes>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rax
sub    %rdx,%rax
jge    1125 <xdrmem_putbytes+0x15>
mov    0x2eb5(%rip),%rax
jmp    1142 <xdrmem_putbytes+0x32>
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rax,(%rdi)
mov    0x8(%rdi),%rdi
call   1030 <memmove@plt>
add    %r14,0x8(%rbx)
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i8* }
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdrmem_putbytes(%struct.TYPE_3__* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_3__*
%6 = alloca i8*
%7 = alloca i64
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = load i64, i64* %7
%12 = icmp slt i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = load i32, i32* @FALSE
store i32 %14, i32* %4
br label %35
15: ; preds = %3
%16 = load i64, i64* %7
%17 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %17, i32 0, i32 0
%19 = load i64, i64* %18
%20 = sub nsw i64 %19, %16
store i64 %20, i64* %18
%21 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %21, i32 0, i32 1
%23 = load i8*, i8** %22
%24 = load i8*, i8** %6
%25 = load i64, i64* %7
%26 = call i32 @memmove(i8* %23, i8* %24, i64 %25)
%27 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%28 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %27, i32 0, i32 1
%29 = load i8*, i8** %28
%30 = load i64, i64* %7
%31 = getelementptr inbounds i8, i8* %29, i64 %30
%32 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%33 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %32, i32 0, i32 1
store i8* %31, i8** %33
%34 = load i32, i32* @TRUE
store i32 %34, i32* %4
br label %35
35: ; preds = %15, %13
%36 = load i32, i32* %4
ret i32 %36
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i8* }
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdrmem_putbytes(%struct.TYPE_3__* nocapture %0, i8* %1, i64 %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = icmp slt i64 %5, %2
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = sub nsw i64 %5, %2
store i64 %8, i64* %4
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%10 = load i8*, i8** %9
%11 = tail call i32 @memmove(i8* %10, i8* %1, i64 %2)
%12 = load i8*, i8** %9
%13 = getelementptr inbounds i8, i8* %12, i64 %2
store i8* %13, i8** %9
br label %14
14: ; preds = %3, %7
%15 = phi i32* [ @TRUE, %7 ], [ @FALSE, %3 ]
%16 = load i32, i32* %15
ret i32 %16
}