#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(int *array, int start, int end) {
  int i;
  for (i = 0; i < 200000000; i++) {
    if (start <= i && i < end) {
      printf("%2d ", array[i]);
    } else {
      printf(" - ");
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xbebc200,-0x14(%rbp)
jge    118d <print+0x7d>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     116c <print+0x5c>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    116c <print+0x5c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117a <print+0x6a>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117f <print+0x6f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <print+0x19>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
movslq %edx,%r13
movslq %esi,%rbx
lea    0xec5(%rip),%r14
lea    0xec3(%rip),%r15
xor    %ebp,%ebp
jmp    1167 <print+0x47>
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    $0xbebc200,%rbp
je     1181 <print+0x61>
cmp    %rbx,%rbp
jl     1150 <print+0x30>
cmp    %r13,%rbp
jge    1150 <print+0x30>
mov    (%r12,%rbp,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    115a <print+0x3a>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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