#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 print_set(int *a) {
  int i;
  for (i = 0; i < 9 && a[i]; i++) {
    printf("%d ", a[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x9,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jge    1144 <print_set+0x34>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1154 <print_set+0x44>
jmp    117b <print_set+0x6b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_set+0x13>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_set>:
push   %rbx
mov    (%rdi),%esi
test   %esi,%esi
je     11ec <print_set+0xcc>
mov    %rdi,%rbx
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rbx),%esi
test   %esi,%esi
je     11ec <print_set+0xcc>
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%esi
test   %esi,%esi
je     11ec <print_set+0xcc>
lea    0xe99(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rbx),%esi
test   %esi,%esi
je     11ec <print_set+0xcc>
lea    0xe84(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%esi
test   %esi,%esi
je     11ec <print_set+0xcc>
lea    0xe6f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rbx),%esi
test   %esi,%esi
je     11ec <print_set+0xcc>
lea    0xe5a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx),%esi
test   %esi,%esi
je     11ec <print_set+0xcc>
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rbx),%esi
test   %esi,%esi
je     11ec <print_set+0xcc>
lea    0xe30(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rbx),%esi
test   %esi,%esi
je     11ec <print_set+0xcc>
lea    0xe1b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_set(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %23, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 9
br i1 %6, label %7, label %14
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 ne i32 %12, 0
br label %14
14: ; preds = %7, %4
%15 = phi i1 [ false, %4 ], [ %13, %7 ]
br i1 %15, label %16, label %26
16: ; preds = %14
%17 = load i32*, i32** %2
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %16
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %4
26: ; preds = %14
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

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