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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void UTIL_printIndexList(FILE *file, int *index_list) {
  int i;
  for (i = 0; i < 100; i++) {
    if (index_list[i] < 0)
      return;
    fprintf(file, " %d", index_list[i]);
  }
}


x86 assembly (clang, -O0):
<UTIL_printIndexList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1171 <UTIL_printIndexList+0x61>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    1148 <UTIL_printIndexList+0x38>
jmp    1171 <UTIL_printIndexList+0x61>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <UTIL_printIndexList+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTIL_printIndexList>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed9(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    (%r12,%rbx,4),%edx
test   %edx,%edx
js     114d <UTIL_printIndexList+0x3d>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1130 <UTIL_printIndexList+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %d\00"
define void @UTIL_printIndexList(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %25, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 100
br i1 %8, label %9, label %28
9: ; preds = %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %9
br label %28
17: ; preds = %9
%18 = load i32*, i32** %3
%19 = load i32*, i32** %4
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %17
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %6
28: ; preds = %16, %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define void @UTIL_printIndexList(i32* nocapture %0, i32* nocapture %1) {
br label %3
3: ; preds = %2, %8
%4 = phi i64 [ 0, %2 ], [ %10, %8 ]
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%10 = add nuw nsw i64 %4, 1
%11 = icmp eq i64 %10, 100
br i1 %11, label %12, label %3
12: ; preds = %8, %3
ret void
}