#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 display(int *arr, int start, int end) {
  if (start == end)
    printf("\nQueue is empty");
  else
    while (start != end) {
      printf("%d   ", *(arr + start));
      start++;
    }
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1141 <display+0x31>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117e <display+0x6e>
jmp    1146 <display+0x36>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1179 <display+0x69>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <display+0x36>
jmp    117e <display+0x6e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
cmp    %edx,%esi
jne    1122 <display+0x12>
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r12d
movslq %esi,%rax
lea    (%rdi,%rax,4),%r15
sub    %esi,%r12d
lea    0xed2(%rip),%r14
xor    %ebx,%ebx
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1140 <display+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"\0AQueue is empty\00"
@.str.1 = [6 x i8] c"%d \00"
define void @display(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %27
12: ; preds = %3
br label %13
13: ; preds = %17, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %26
17: ; preds = %13
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %13
26: ; preds = %13
br label %27
27: ; preds = %26, %10
ret void
}

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