#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 */

/* Variables and functions */
int /*<<< orphan*/ serializeUnpack(void *, int, int *, int *, int, int, void *);
int /*<<< orphan*/ vlistAttUnpack(int, int, void *, int, int *, void *);
void vlistAttsUnpack(int vlistID, int varID, void *buf, int size, int *position,
                     void *context) {
  int numAtts, i;
  serializeUnpack(buf, size, position, &numAtts, 1, 251, context);
  for (i = 0; i < numAtts; ++i) {
    vlistAttUnpack(vlistID, varID, buf, size, position, context);
  }
}


x86 assembly (clang, -O0):
<vlistAttsUnpack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rax
lea    -0x2c(%rbp),%rcx
mov    $0x1,%r8d
mov    $0xfb,%r9d
mov    %rax,(%rsp)
call   1030 <serializeUnpack@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    11a0 <vlistAttsUnpack+0x80>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1040 <vlistAttUnpack@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    116c <vlistAttsUnpack+0x4c>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlistAttsUnpack>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r13d
mov    %rdx,%rbx
mov    %esi,0x14(%rsp)
mov    %edi,%ebp
mov    %r9,%r15
mov    %r9,(%rsp)
lea    0x10(%rsp),%rcx
mov    %rdx,%rdi
mov    %r13d,%esi
mov    %r8,%r12
mov    %r8,%rdx
mov    $0x1,%r8d
mov    $0xfb,%r9d
call   1030 <serializeUnpack@plt>
cmpl   $0x0,0x10(%rsp)
jle    1192 <vlistAttsUnpack+0x72>
xor    %r14d,%r14d
nopl   (%rax)
mov    %ebp,%edi
mov    0x14(%rsp),%esi
mov    %rbx,%rdx
mov    %r13d,%ecx
mov    %r12,%r8
mov    %r15,%r9
call   1040 <vlistAttUnpack@plt>
add    $0x1,%r14d
cmp    0x10(%rsp),%r14d
jl     1170 <vlistAttsUnpack+0x50>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @vlistAttsUnpack(i32 %0, i32 %1, i8* %2, i32 %3, i32* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i8* %5, i8** %12
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = load i32*, i32** %11
%18 = load i8*, i8** %12
%19 = call i32 @serializeUnpack(i8* %15, i32 %16, i32* %17, i32* %13, i32 1, i32 251, i8* %18)
store i32 0, i32* %14
br label %20
20: ; preds = %32, %6
%21 = load i32, i32* %14
%22 = load i32, i32* %13
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %35
24: ; preds = %20
%25 = load i32, i32* %7
%26 = load i32, i32* %8
%27 = load i8*, i8** %9
%28 = load i32, i32* %10
%29 = load i32*, i32** %11
%30 = load i8*, i8** %12
%31 = call i32 @vlistAttUnpack(i32 %25, i32 %26, i8* %27, i32 %28, i32* %29, i8* %30)
br label %32
32: ; preds = %24
%33 = load i32, i32* %14
%34 = add nsw i32 %33, 1
store i32 %34, i32* %14
br label %20
35: ; preds = %20
ret void
}

LLVM IR (-O2):
define void @vlistAttsUnpack(i32 %0, i32 %1, i8* %2, i32 %3, i32* %4, i8* %5) {
%7 = alloca i32
%8 = bitcast i32* %7 to i8*
%9 = call i32 @serializeUnpack(i8* %2, i32 %3, i32* %4, i32* %7, i32 1, i32 251, i8* %5)
%10 = load i32, i32* %7
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %6, %12
%13 = phi i32 [ %15, %12 ], [ 0, %6 ]
%14 = call i32 @vlistAttUnpack(i32 %0, i32 %1, i8* %2, i32 %3, i32* %4, i8* %5)
%15 = add nuw nsw i32 %13, 1
%16 = load i32, i32* %7
%17 = icmp slt i32 %15, %16
br i1 %17, label %12, label %18
18: ; preds = %12, %6
ret void
}