#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*/ printf(char *, ...);
void hash_open_print(int table[]) {
  int i;
  for (i = 0; i < 10; i += 1) {
    if (table[i] > 0)
      printf("%8d", table[i]);
    else if (table[i] == -2)
      printf(" VOID");
    else
      printf(" DELETED");
    if ((i + 1) % 15 == 0)
      printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<hash_open_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11cd <hash_open_print+0xbd>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    115d <hash_open_print+0x4d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1195 <hash_open_print+0x85>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0xfffffffe,(%rax,%rcx,4)
jne    1182 <hash_open_print+0x72>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1190 <hash_open_print+0x80>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1195 <hash_open_print+0x85>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ba <hash_open_print+0xaa>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bf <hash_open_print+0xaf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <hash_open_print+0x13>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_open_print>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%r13
lea    0xecd(%rip),%r14
lea    0xeca(%rip),%r15
lea    0xec9(%rip),%r12
xor    %ebx,%ebx
jmp    1164 <hash_open_print+0x44>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0xa,%rbx
je     1183 <hash_open_print+0x63>
mov    0x0(%r13,%rbx,4),%esi
test   %esi,%esi
jg     1150 <hash_open_print+0x30>
cmp    $0xfffffffe,%esi
jne    1177 <hash_open_print+0x57>
mov    %r15,%rdi
jmp    117a <hash_open_print+0x5a>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    115a <hash_open_print+0x3a>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%8d\00"
@.str.1 = [6 x i8] c" VOID\00"
@.str.2 = [9 x i8] c" DELETED\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @hash_open_print(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %41, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %44
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %7
%15 = load i32*, i32** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %33
21: ; preds = %7
%22 = load i32*, i32** %2
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
%26 = load i32, i32* %25
%27 = icmp eq i32 %26, -2
br i1 %27, label %28, label %30
28: ; preds = %21
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %32
30: ; preds = %21
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %32
32: ; preds = %30, %28
br label %33
33: ; preds = %32, %14
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
%36 = srem i32 %35, 15
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %33
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %40
40: ; preds = %38, %33
br label %41
41: ; preds = %40
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 1
store i32 %43, i32* %3
br label %4
44: ; preds = %4
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%8d\00"
@.str.1 = [6 x i8] c" VOID\00"
@.str.2 = [9 x i8] c" DELETED\00"
define void @hash_open_print(i32* nocapture %0) {
br label %2
2: ; preds = %1, %15
%3 = phi i64 [ 0, %1 ], [ %16, %15 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %15
9: ; preds = %2
%10 = icmp eq i32 %5, -2
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %15
13: ; preds = %9
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %11, %13, %7
%16 = add nuw nsw i64 %3, 1
%17 = icmp eq i64 %16, 10
br i1 %17, label %18, label %2
18: ; preds = %15
%19 = tail call i32 @putchar(i32 10)
ret void
}