#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void UTIL_appendIndexList(int *index_list, int index) {
  int i;
  i = 0;
  while (index_list[i] >= 0) {
    if (i >= (100 - 2)) {
      fprintf(stderr, "%s %s", "Ran off end of index list.",
              "This seems to be some internal coding error.\n");
      exit(1);
    }
    i++;
  }
  index_list[i] = index;
  index_list[i + 1] = -1;
}


x86 assembly (clang, -O0):
<UTIL_appendIndexList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jl     118d <UTIL_appendIndexList+0x6d>
cmpl   $0x62,-0x10(%rbp)
jl     117f <UTIL_appendIndexList+0x5f>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
lea    0xe9d(%rip),%rdx
lea    0xeb1(%rip),%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <UTIL_appendIndexList+0x16>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movl   $0xffffffff,(%rax,%rcx,4)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTIL_appendIndexList>:
push   %rax
cmpl   $0x0,(%rdi)
js     1154 <UTIL_appendIndexList+0x34>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,0x4(%rdi,%rax,4)
js     1158 <UTIL_appendIndexList+0x38>
cmpl   $0x0,0x8(%rdi,%rax,4)
js     115e <UTIL_appendIndexList+0x3e>
cmp    $0x60,%rax
je     1174 <UTIL_appendIndexList+0x54>
lea    0x3(%rax),%rcx
cmpl   $0x0,0xc(%rdi,%rax,4)
mov    %rcx,%rax
jns    1130 <UTIL_appendIndexList+0x10>
jmp    1165 <UTIL_appendIndexList+0x45>
xor    %ecx,%ecx
jmp    1165 <UTIL_appendIndexList+0x45>
add    $0x1,%rax
jmp    1162 <UTIL_appendIndexList+0x42>
add    $0x2,%rax
mov    %rax,%rcx
mov    %ecx,%eax
mov    %esi,(%rdi,%rax,4)
movl   $0xffffffff,0x4(%rdi,%rax,4)
ff
pop    %rax
ret
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
lea    0xe7c(%rip),%rsi
lea    0xe7b(%rip),%rdx
lea    0xe8f(%rip),%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [27 x i8] c"Ran off end of index list.\00"
@.str.2 = [46 x i8] c"This seems to be some internal coding error.\0A\00"
define void @UTIL_appendIndexList(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 = %20, %2
%7 = load i32*, i32** %3
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %6
%14 = load i32, i32* %5
%15 = icmp sge i32 %14, 98
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %13
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
%24 = load i32, i32* %4
%25 = load i32*, i32** %3
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
store i32 %24, i32* %28
%29 = load i32*, i32** %3
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %29, i64 %32
store i32 -1, i32* %33
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [27 x i8] c"Ran off end of index list.\00"
@.str.2 = [46 x i8] c"This seems to be some internal coding error.\0A\00"
define void @UTIL_appendIndexList(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %30
5: ; preds = %2, %22
%6 = phi i64 [ %23, %22 ], [ 0, %2 ]
%7 = add nuw nsw i64 %6, 1
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = icmp sgt i32 %9, -1
br i1 %10, label %15, label %27
11: ; preds = %20
%12 = load i32, i32* @stderr
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %5
%16 = add nuw nsw i64 %6, 2
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
%19 = icmp sgt i32 %18, -1
br i1 %19, label %20, label %27
20: ; preds = %15
%21 = icmp eq i64 %16, 98
br i1 %21, label %11, label %22
22: ; preds = %20
%23 = add nuw nsw i64 %6, 3
%24 = getelementptr inbounds i32, i32* %0, i64 %23
%25 = load i32, i32* %24
%26 = icmp sgt i32 %25, -1
br i1 %26, label %5, label %27
27: ; preds = %22, %15, %5
%28 = phi i64 [ %7, %5 ], [ %16, %15 ], [ %23, %22 ]
%29 = trunc i64 %28 to i32
br label %30
30: ; preds = %27, %2
%31 = phi i32 [ 0, %2 ], [ %29, %27 ]
%32 = zext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %0, i64 %32
store i32 %1, i32* %33
%34 = add nuw nsw i32 %31, 1
%35 = zext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %0, i64 %35
store i32 -1, i32* %36
ret void
}