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


x86 assembly (clang, -O0):
<deqf>:
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 <deqf+0x34>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b2 <deqf+0xa2>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jne    1180 <deqf+0x70>
mov    -0x8(%rbp),%rax
mov    -0x18(%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 <deqf+0x8c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    11a1 <deqf+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):
<deqf>:
movslq (%rdx),%rcx
cmp    $0xffffffffffffffff,%rcx
je     1130 <deqf+0x20>
mov    %rsi,%rax
mov    (%rdi,%rcx,4),%esi
cmp    (%rax),%ecx
jne    113e <deqf+0x2e>
movl   $0xffffffff,(%rax)
mov    $0xffffffff,%ecx
jmp    1141 <deqf+0x31>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
add    $0x1,%ecx
mov    %ecx,(%rdx)
lea    0xec3(%rip),%rdi
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 @deqf(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** %6
%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** %6
%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** %6
%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 @deqf(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 %20
8: ; preds = %3
%9 = load i32, i32* %1
%10 = icmp eq i32 %4, %9
%11 = sext i32 %4 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
br i1 %10, label %14, label %15
14: ; preds = %8
store i32 -1, i32* %1
br label %17
15: ; preds = %8
%16 = add nuw nsw i32 %4, 1
br label %17
17: ; preds = %14, %15
%18 = phi i32 [ %16, %15 ], [ -1, %14 ]
store i32 %18, i32* %2
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %20
20: ; preds = %17, %6
ret void
}