#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 dequeue(int *queue, int *front, int *rear) {
  if (*front == -1) {
    printf("\nQueue is Empty!\n");
    return;
  }
  printf("\n%d was deleted.\n", queue[*front]);
  if (*front == *rear)
    *front = *rear = -1;
  else if (*front == 5 - 1)
    *front = 1;
  else
    *front += 1;
}


x86 assembly (clang, -O0):
<dequeue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    1144 <dequeue+0x34>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b7 <dequeue+0xa7>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    118b <dequeue+0x7b>
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
jmp    11b7 <dequeue+0xa7>
mov    -0x10(%rbp),%rax
cmpl   $0x4,(%rax)
jne    11a7 <dequeue+0x97>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    11b2 <dequeue+0xa2>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    11b7 <dequeue+0xa7>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dequeue>:
push   %r14
push   %rbx
push   %rax
movslq (%rsi),%rax
cmp    $0xffffffffffffffff,%rax
je     115a <dequeue+0x3a>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    (%rdi,%rax,4),%esi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%eax
cmp    (%r14),%eax
jne    116d <dequeue+0x4d>
movl   $0xffffffff,(%r14)
movl   $0xffffffff,(%rbx)
jmp    117f <dequeue+0x5f>
lea    0xeb1(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>
cmp    $0x4,%eax
jne    117a <dequeue+0x5a>
movl   $0x1,(%rbx)
jmp    117f <dequeue+0x5f>
add    $0x1,%eax
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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