#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 deqr(int *q, int *rear, int *front) {
  int item;
  if (*front == -1) {
    printf("\nqueue empty");
    return;
  } else if (*front == *rear) {
    item = q[*rear];
    *front = *rear = -1;
  } else {
    item = q[*rear];
    (*rear)--;
  }
  printf("\n %d deleted", item);
}


x86 assembly (clang, -O0):
<deqr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    1144 <deqr+0x34>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b2 <deqr+0xa2>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jne    1180 <deqr+0x70>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
jmp    119c <deqr+0x8c>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
jmp    11a1 <deqr+0x91>
mov    -0x1c(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deqr>:
movslq (%rdx),%rax
cmp    $0xffffffffffffffff,%rax
je     1131 <deqr+0x21>
movslq (%rsi),%rcx
cmp    %ecx,%eax
jne    113f <deqr+0x2f>
mov    (%rdi,%rax,4),%eax
movl   $0xffffffff,(%rsi)
movl   $0xffffffff,(%rdx)
jmp    1147 <deqr+0x37>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
mov    (%rdi,%rcx,4),%eax
add    $0xffffffff,%ecx
mov    %ecx,(%rsi)
lea    0xebf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

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