#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 front, int rear, int queue[]) {
  int i;
  if (rear == front)
    printf("queue is empty \n");
  else {
    for (i = front + 1; i <= rear; i++)
      printf("elemnts %d\n", queue[i]);
  }
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1141 <display+0x31>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1182 <display+0x72>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     117d <display+0x6d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114a <display+0x3a>
jmp    1182 <display+0x72>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
cmp    %edi,%esi
jne    1130 <display+0x10>
lea    0xee1(%rip),%rdi
jmp    1030 <puts@plt>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
jle    1168 <display+0x48>
mov    %rdx,%r15
movslq %edi,%rbx
movslq %esi,%r12
lea    0xeb6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    0x4(%r15,%rbx,4),%esi
add    $0x1,%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %rbx,%r12
jne    1150 <display+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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