#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 */
typedef int /*<<< orphan*/ (*xdrproc_t)(int /*<<< orphan*/ *, char *,
                                        unsigned int);
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ stub1(int /*<<< orphan*/ *, char *, unsigned int);
bool_t xdr_vector(XDR *xdrs, char *basep, unsigned int nelem,
                  unsigned int elemsize, xdrproc_t xdr_elem) {
  register unsigned int i;
  register char *elptr;
  elptr = basep;
  for (i = 0; i < nelem; i++) {
    if (!(*xdr_elem)(xdrs, elptr, ((unsigned int)0 - 1))) {
      return (FALSE);
    }
    elptr += elemsize;
  }
  return (TRUE);
}


x86 assembly (clang, -O0):
<xdr_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jae    1180 <xdr_vector+0x80>
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0xffffffff,%edx
call   *%rax
cmp    $0x0,%eax
jne    1162 <xdr_vector+0x62>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    118c <xdr_vector+0x8c>
mov    -0x20(%rbp),%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1129 <xdr_vector+0x29>
mov    0x2e61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_vector>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2ed6(%rip),%r12
test   %edx,%edx
je     1153 <xdr_vector+0x53>
mov    %r8,%r14
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %ecx,%r13d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0xffffffff,%edx
call   *%r14
test   %eax,%eax
je     114c <xdr_vector+0x4c>
add    %r13,%rbx
add    $0xffffffff,%ebp
jne    1130 <xdr_vector+0x30>
jmp    1153 <xdr_vector+0x53>
mov    0x2e85(%rip),%r12
mov    (%r12),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_vector(i32* %0, i8* %1, i32 %2, i32 %3, i32 (i32*, i8*, i32)* nocapture %4) {
%6 = icmp eq i32 %2, 0
br i1 %6, label %18, label %7
7: ; preds = %5
%8 = zext i32 %3 to i64
br label %9
9: ; preds = %7, %14
%10 = phi i8* [ %1, %7 ], [ %15, %14 ]
%11 = phi i32 [ 0, %7 ], [ %16, %14 ]
%12 = tail call i32 %4(i32* %0, i8* %10, i32 -1)
%13 = icmp eq i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %9
%15 = getelementptr inbounds i8, i8* %10, i64 %8
%16 = add nuw i32 %11, 1
%17 = icmp eq i32 %16, %2
br i1 %17, label %18, label %9
18: ; preds = %9, %14, %5
%19 = phi i32* [ @TRUE, %5 ], [ @TRUE, %14 ], [ @FALSE, %9 ]
%20 = load i32, i32* %19
ret i32 %20
}