#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*/ debug_outf(char *, char const *, int, int);
void list_points(int *table, const char *desc) {
  int c;
  for (c = 0; c < 8; c++)
    if (table[c] != -1)
      debug_outf("    %s %i : %04X\n", desc, c, table[c]);
}


x86 assembly (clang, -O0):
<list_points>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1174 <list_points+0x64>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     1161 <list_points+0x51>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xea4(%rip),%rdi
call   1030 <debug_outf@plt>
jmp    1166 <list_points+0x56>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <list_points+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_points>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%ecx
cmp    $0xffffffff,%ecx
je     1132 <list_points+0x22>
lea    0xed8(%rip),%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <debug_outf@plt>
mov    0x4(%rbx),%ecx
cmp    $0xffffffff,%ecx
je     114e <list_points+0x3e>
lea    0xebf(%rip),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <debug_outf@plt>
mov    0x8(%rbx),%ecx
cmp    $0xffffffff,%ecx
je     116a <list_points+0x5a>
lea    0xea3(%rip),%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <debug_outf@plt>
mov    0xc(%rbx),%ecx
cmp    $0xffffffff,%ecx
je     1186 <list_points+0x76>
lea    0xe87(%rip),%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   1030 <debug_outf@plt>
mov    0x10(%rbx),%ecx
cmp    $0xffffffff,%ecx
je     11a2 <list_points+0x92>
lea    0xe6b(%rip),%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <debug_outf@plt>
mov    0x14(%rbx),%ecx
cmp    $0xffffffff,%ecx
je     11be <list_points+0xae>
lea    0xe4f(%rip),%rdi
mov    %r14,%rsi
mov    $0x5,%edx
call   1030 <debug_outf@plt>
mov    0x18(%rbx),%ecx
cmp    $0xffffffff,%ecx
je     11da <list_points+0xca>
lea    0xe33(%rip),%rdi
mov    %r14,%rsi
mov    $0x6,%edx
call   1030 <debug_outf@plt>
mov    0x1c(%rbx),%ecx
cmp    $0xffffffff,%ecx
je     11fd <list_points+0xed>
lea    0xe17(%rip),%rdi
mov    %r14,%rsi
mov    $0x7,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <debug_outf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c" %s %i : %04X\0A\00"
define void @list_points(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %26, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %29
9: ; preds = %6
%10 = load i32*, i32** %3
%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 ne i32 %14, -1
br i1 %15, label %16, label %25
16: ; preds = %9
%17 = load i8*, i8** %4
%18 = load i32, i32* %5
%19 = load i32*, i32** %3
%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 @debug_outf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %18, i32 %23)
br label %25
25: ; preds = %16, %9
br label %26
26: ; preds = %25
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %6
29: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c" %s %i : %04X\0A\00"
define void @list_points(i32* nocapture %0, i8* %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @debug_outf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i32 0, i32 %3)
br label %7
7: ; preds = %2, %5
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, -1
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = tail call i32 @debug_outf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i32 1, i32 %9)
br label %13
13: ; preds = %11, %7
%14 = getelementptr inbounds i32, i32* %0, i64 2
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, -1
br i1 %16, label %19, label %17
17: ; preds = %13
%18 = tail call i32 @debug_outf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i32 2, i32 %15)
br label %19
19: ; preds = %17, %13
%20 = getelementptr inbounds i32, i32* %0, i64 3
%21 = load i32, i32* %20
%22 = icmp eq i32 %21, -1
br i1 %22, label %25, label %23
23: ; preds = %19
%24 = tail call i32 @debug_outf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i32 3, i32 %21)
br label %25
25: ; preds = %23, %19
%26 = getelementptr inbounds i32, i32* %0, i64 4
%27 = load i32, i32* %26
%28 = icmp eq i32 %27, -1
br i1 %28, label %31, label %29
29: ; preds = %25
%30 = tail call i32 @debug_outf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i32 4, i32 %27)
br label %31
31: ; preds = %29, %25
%32 = getelementptr inbounds i32, i32* %0, i64 5
%33 = load i32, i32* %32
%34 = icmp eq i32 %33, -1
br i1 %34, label %37, label %35
35: ; preds = %31
%36 = tail call i32 @debug_outf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i32 5, i32 %33)
br label %37
37: ; preds = %35, %31
%38 = getelementptr inbounds i32, i32* %0, i64 6
%39 = load i32, i32* %38
%40 = icmp eq i32 %39, -1
br i1 %40, label %43, label %41
41: ; preds = %37
%42 = tail call i32 @debug_outf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i32 6, i32 %39)
br label %43
43: ; preds = %41, %37
%44 = getelementptr inbounds i32, i32* %0, i64 7
%45 = load i32, i32* %44
%46 = icmp eq i32 %45, -1
br i1 %46, label %49, label %47
47: ; preds = %43
%48 = tail call i32 @debug_outf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i32 7, i32 %45)
br label %49
49: ; preds = %47, %43
ret void
}