#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 printIntVector(int *arr, int start, int end) {
  int i;
  for (i = start; i < end; i++) {
    printf("%d", arr[i]);
    if (i != end - 1)
      printf(" ");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printIntVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117f <printIntVector+0x6f>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     116c <printIntVector+0x5c>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1171 <printIntVector+0x61>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <printIntVector+0x18>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIntVector>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmp    %edx,%esi
jge    1178 <printIntVector+0x58>
mov    %edx,%r15d
lea    -0x1(%r15),%eax
movslq %esi,%rcx
movslq %eax,%r13
sub    %rcx,%r13
lea    (%rdi,%rcx,4),%r12
sub    %esi,%r15d
lea    0xeb5(%rip),%r14
xor    %ebx,%ebx
jmp    1159 <printIntVector+0x39>
nop
add    $0x1,%rbx
cmp    %ebx,%r15d
je     1178 <printIntVector+0x58>
mov    (%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %rbx,%r13
je     1150 <printIntVector+0x30>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1150 <printIntVector+0x30>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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