#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 *, int, char *);
void **__snippet_print_blocks(char **blocks) {
  char *block = NULL;
  int i;
  for (i = 0, block = *blocks; block != NULL; i++, block = *++blocks) {
    printf("%i: %s\n", i, block);
    if (i == 10)
      break;
  }
}


x86 assembly (clang, -O0):
<__snippet_print_blocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     118d <__snippet_print_blocks+0x7d>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xa,-0x1c(%rbp)
jne    1163 <__snippet_print_blocks+0x53>
jmp    118d <__snippet_print_blocks+0x7d>
jmp    1168 <__snippet_print_blocks+0x58>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1136 <__snippet_print_blocks+0x26>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__snippet_print_blocks>:
push   %rbx
mov    (%rdi),%rdx
test   %rdx,%rdx
je     1246 <__snippet_print_blocks+0x136>
mov    %rdi,%rbx
lea    0xed9(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    0x8(%rbx),%rdx
test   %rdx,%rdx
je     1246 <__snippet_print_blocks+0x136>
lea    0xebe(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    0x10(%rbx),%rdx
test   %rdx,%rdx
je     1246 <__snippet_print_blocks+0x136>
lea    0xea0(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    0x18(%rbx),%rdx
test   %rdx,%rdx
je     1246 <__snippet_print_blocks+0x136>
lea    0xe82(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    0x20(%rbx),%rdx
test   %rdx,%rdx
je     1246 <__snippet_print_blocks+0x136>
lea    0xe64(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    0x28(%rbx),%rdx
test   %rdx,%rdx
je     1246 <__snippet_print_blocks+0x136>
lea    0xe46(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    0x30(%rbx),%rdx
test   %rdx,%rdx
je     1246 <__snippet_print_blocks+0x136>
lea    0xe2c(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    0x38(%rbx),%rdx
test   %rdx,%rdx
je     1246 <__snippet_print_blocks+0x136>
lea    0xe12(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    0x40(%rbx),%rdx
test   %rdx,%rdx
je     1246 <__snippet_print_blocks+0x136>
lea    0xdf8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    0x48(%rbx),%rdx
test   %rdx,%rdx
je     1246 <__snippet_print_blocks+0x136>
lea    0xdde(%rip),%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    0x50(%rbx),%rdx
test   %rdx,%rdx
je     1246 <__snippet_print_blocks+0x136>
lea    0xdc4(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%i: %s\0A\00"
define i8** @__snippet_print_blocks(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i32
store i8** %0, i8*** %3
store i8* null, i8** %4
store i32 0, i32* %5
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %4
br label %8
8: ; preds = %19, %1
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %25
11: ; preds = %8
%12 = load i32, i32* %5
%13 = load i8*, i8** %4
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %13)
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %18
17: ; preds = %11
br label %25
18: ; preds = %11
br label %19
19: ; preds = %18
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
%22 = load i8**, i8*** %3
%23 = getelementptr inbounds i8*, i8** %22, i32 1
store i8** %23, i8*** %3
%24 = load i8*, i8** %23
store i8* %24, i8** %4
br label %8
25: ; preds = %17, %8
%26 = load i8**, i8*** %2
ret i8** %26
}

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