#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*/ cdiCheckZaxis(int);
int vlistNzaxis(int);
int vlistZaxis(int, int);
int zaxisInqType(int);
void vlist_check_contents(int vlistID) {
  int index, nzaxis, zaxisID;
  nzaxis = vlistNzaxis(vlistID);
  for (index = 0; index < nzaxis; index++) {
    zaxisID = vlistZaxis(vlistID, index);
    if (zaxisInqType(zaxisID) == 1)
      cdiCheckZaxis(zaxisID);
  }
}


x86 assembly (clang, -O0):
<vlist_check_contents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <vlistNzaxis@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a3 <vlist_check_contents+0x63>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <vlistZaxis@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <zaxisInqType@plt>
cmp    $0x1,%eax
jne    1190 <vlist_check_contents+0x50>
mov    -0x10(%rbp),%edi
call   1060 <cdiCheckZaxis@plt>
jmp    1195 <vlist_check_contents+0x55>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115d <vlist_check_contents+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlist_check_contents>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
call   1050 <vlistNzaxis@plt>
test   %eax,%eax
jle    1189 <vlist_check_contents+0x49>
mov    %eax,%r15d
xor    %ebx,%ebx
jmp    1168 <vlist_check_contents+0x28>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    %ebx,%r15d
je     1189 <vlist_check_contents+0x49>
mov    %r14d,%edi
mov    %ebx,%esi
call   1030 <vlistZaxis@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <zaxisInqType@plt>
cmp    $0x1,%eax
jne    1160 <vlist_check_contents+0x20>
mov    %ebp,%edi
call   1060 <cdiCheckZaxis@plt>
jmp    1160 <vlist_check_contents+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @vlist_check_contents(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @vlistNzaxis(i32 %6)
store i32 %7, i32* %4
store i32 0, i32* %3
br label %8
8: ; preds = %23, %1
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %26
12: ; preds = %8
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @vlistZaxis(i32 %13, i32 %14)
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = call i32 @zaxisInqType(i32 %16)
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %22
19: ; preds = %12
%20 = load i32, i32* %5
%21 = call i32 @cdiCheckZaxis(i32 %20)
br label %22
22: ; preds = %19, %12
br label %23
23: ; preds = %22
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %8
26: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @vlist_check_contents(i32 %0) {
%2 = tail call i32 @vlistNzaxis(i32 %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1, %11
%5 = phi i32 [ %12, %11 ], [ 0, %1 ]
%6 = tail call i32 @vlistZaxis(i32 %0, i32 %5)
%7 = tail call i32 @zaxisInqType(i32 %6)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @cdiCheckZaxis(i32 %6)
br label %11
11: ; preds = %4, %9
%12 = add nuw nsw i32 %5, 1
%13 = icmp eq i32 %12, %2
br i1 %13, label %14, label %4
14: ; preds = %11, %1
ret void
}