#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 displaySubArray(int array[], int left, int right) {
  int i;
  for (i = 0; i < left; i++)
    printf("   ");
  for (i = left; i <= right; i++)
    printf(" %d", array[i]);
}


x86 assembly (clang, -O0):
<displaySubArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <displaySubArray+0x41>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <displaySubArray+0x19>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     118a <displaySubArray+0x7a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <displaySubArray+0x47>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displaySubArray>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r12d
mov    %esi,%r15d
mov    %rdi,%r14
test   %esi,%esi
jle    113f <displaySubArray+0x2f>
lea    0xed4(%rip),%rbp
mov    %r15d,%ebx
nop
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <displaySubArray+0x20>
cmp    %r12d,%r15d
jg     1177 <displaySubArray+0x67>
movslq %r15d,%rax
lea    (%r14,%rax,4),%rbp
sub    %r15d,%r12d
add    $0x1,%r12d
lea    0xeab(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1160 <displaySubArray+0x50>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
@.str.1 = [4 x i8] c" %d\00"
define void @displaySubArray(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %10, %3
%6 = icmp sgt i32 %1, %2
br i1 %6, label %23, label %7
7: ; preds = %5
%8 = sext i32 %1 to i64
%9 = add i32 %2, 1
br label %15
10: ; preds = %3, %10
%11 = phi i32 [ %13, %10 ], [ 0, %3 ]
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = add nuw nsw i32 %11, 1
%14 = icmp eq i32 %13, %1
br i1 %14, label %5, label %10
15: ; preds = %7, %15
%16 = phi i64 [ %8, %7 ], [ %20, %15 ]
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = add nsw i64 %16, 1
%21 = trunc i64 %20 to i32
%22 = icmp eq i32 %9, %21
br i1 %22, label %23, label %15
23: ; preds = %15, %5
ret void
}