#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 *, ...);
scalar_t__ validate_range(int);
void print_first(int *first) {
  printf("Possible first numbers:  ");
  int i;
  for (i = 0; i < 10; i++) {
    if (validate_range(first[i]))
      printf("%-4d", first[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1191 <print_first+0x71>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <validate_range@plt>
cmp    $0x0,%rax
je     117e <print_first+0x5e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1183 <print_first+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <print_first+0x21>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_first>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1050 <validate_range@plt>
test   %rax,%rax
je     115e <print_first+0x2e>
mov    (%rbx),%esi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rbx),%edi
call   1050 <validate_range@plt>
test   %rax,%rax
je     117c <print_first+0x4c>
mov    0x4(%rbx),%esi
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%edi
call   1050 <validate_range@plt>
test   %rax,%rax
je     119a <print_first+0x6a>
mov    0x8(%rbx),%esi
lea    0xe87(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rbx),%edi
call   1050 <validate_range@plt>
test   %rax,%rax
je     11b8 <print_first+0x88>
mov    0xc(%rbx),%esi
lea    0xe69(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%edi
call   1050 <validate_range@plt>
test   %rax,%rax
je     11d6 <print_first+0xa6>
mov    0x10(%rbx),%esi
lea    0xe4b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rbx),%edi
call   1050 <validate_range@plt>
test   %rax,%rax
je     11f4 <print_first+0xc4>
mov    0x14(%rbx),%esi
lea    0xe2d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx),%edi
call   1050 <validate_range@plt>
test   %rax,%rax
je     1212 <print_first+0xe2>
mov    0x18(%rbx),%esi
lea    0xe0f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rbx),%edi
call   1050 <validate_range@plt>
test   %rax,%rax
je     1230 <print_first+0x100>
mov    0x1c(%rbx),%esi
lea    0xdf1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rbx),%edi
call   1050 <validate_range@plt>
test   %rax,%rax
je     124e <print_first+0x11e>
mov    0x20(%rbx),%esi
lea    0xdd3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rbx),%edi
call   1050 <validate_range@plt>
test   %rax,%rax
je     126c <print_first+0x13c>
mov    0x24(%rbx),%esi
lea    0xdb5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [26 x i8] c"Possible first numbers: \00"
@.str.1 = [5 x i8] c"%-4d\00"
define void @print_first(i32* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %0
%4 = tail call i64 @validate_range(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %1, %6
%10 = getelementptr inbounds i32, i32* %0, i64 1
%11 = load i32, i32* %10
%12 = tail call i64 @validate_range(i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %9
%15 = load i32, i32* %10
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %9
%18 = getelementptr inbounds i32, i32* %0, i64 2
%19 = load i32, i32* %18
%20 = tail call i64 @validate_range(i32 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %17
%23 = load i32, i32* %18
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %22, %17
%26 = getelementptr inbounds i32, i32* %0, i64 3
%27 = load i32, i32* %26
%28 = tail call i64 @validate_range(i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %25
%31 = load i32, i32* %26
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %30, %25
%34 = getelementptr inbounds i32, i32* %0, i64 4
%35 = load i32, i32* %34
%36 = tail call i64 @validate_range(i32 %35)
%37 = icmp eq i64 %36, 0
br i1 %37, label %41, label %38
38: ; preds = %33
%39 = load i32, i32* %34
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %38, %33
%42 = getelementptr inbounds i32, i32* %0, i64 5
%43 = load i32, i32* %42
%44 = tail call i64 @validate_range(i32 %43)
%45 = icmp eq i64 %44, 0
br i1 %45, label %49, label %46
46: ; preds = %41
%47 = load i32, i32* %42
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %47)
br label %49
49: ; preds = %46, %41
%50 = getelementptr inbounds i32, i32* %0, i64 6
%51 = load i32, i32* %50
%52 = tail call i64 @validate_range(i32 %51)
%53 = icmp eq i64 %52, 0
br i1 %53, label %57, label %54
54: ; preds = %49
%55 = load i32, i32* %50
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %55)
br label %57
57: ; preds = %54, %49
%58 = getelementptr inbounds i32, i32* %0, i64 7
%59 = load i32, i32* %58
%60 = tail call i64 @validate_range(i32 %59)
%61 = icmp eq i64 %60, 0
br i1 %61, label %65, label %62
62: ; preds = %57
%63 = load i32, i32* %58
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %63)
br label %65
65: ; preds = %62, %57
%66 = getelementptr inbounds i32, i32* %0, i64 8
%67 = load i32, i32* %66
%68 = tail call i64 @validate_range(i32 %67)
%69 = icmp eq i64 %68, 0
br i1 %69, label %73, label %70
70: ; preds = %65
%71 = load i32, i32* %66
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %71)
br label %73
73: ; preds = %70, %65
%74 = getelementptr inbounds i32, i32* %0, i64 9
%75 = load i32, i32* %74
%76 = tail call i64 @validate_range(i32 %75)
%77 = icmp eq i64 %76, 0
br i1 %77, label %81, label %78
78: ; preds = %73
%79 = load i32, i32* %74
%80 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %79)
br label %81
81: ; preds = %78, %73
%82 = tail call i32 @putchar(i32 10)
ret void
}