#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 dump_v_list(int *sorted_v_list) {
  int i = 0;
  printf("v-list dump:\n");
  while (*(sorted_v_list + i) != -99) {
    if (*(sorted_v_list + i) == -9) {
      printf(" | ");
    } else {
      printf("%d ", *(sorted_v_list + i));
    }
    i++;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<dump_v_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0xffffff9d,(%rax,%rcx,4)
je     118f <dump_v_list+0x7f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0xfffffff7,(%rax,%rcx,4)
jne    1168 <dump_v_list+0x58>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1181 <dump_v_list+0x71>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <dump_v_list+0x21>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_v_list>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb5(%rip),%r14
lea    0xeb2(%rip),%r15
jmp    116e <dump_v_list+0x3e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x4,%rbx
mov    (%rbx),%esi
cmp    $0xfffffff7,%esi
je     1160 <dump_v_list+0x30>
cmp    $0xffffff9d,%esi
je     118a <dump_v_list+0x5a>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x4,%rbx
jmp    116e <dump_v_list+0x3e>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"v-list dump:\0A\00"
@.str.1 = [4 x i8] c" | \00"
@.str.2 = [4 x i8] c"%d \00"
@.str.3 = [2 x i8] c"\0A\00"
define void @dump_v_list(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %28, %1
%6 = load i32*, i32** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, -99
br i1 %11, label %12, label %31
12: ; preds = %5
%13 = load i32*, i32** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, -9
br i1 %18, label %19, label %21
19: ; preds = %12
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %28
21: ; preds = %12
%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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %21, %19
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %5
31: ; preds = %5
%32 = 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.1 = [4 x i8] c" | \00"
@.str.2 = [4 x i8] c"%d \00"
@str = [13 x i8] c"v-list dump:\00"
define void @dump_v_list(i32* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %11, %1
%4 = phi i64 [ %12, %11 ], [ 0, %1 ]
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
switch i32 %6, label %9 [
i32 -99, label %13
i32 -9, label %7
]
7: ; preds = %3
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %3
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %6)
br label %11
11: ; preds = %9, %7
%12 = add nuw i64 %4, 1
br label %3
13: ; preds = %3
%14 = tail call i32 @putchar(i32 10)
ret void
}