#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 dequeue(int *, int *, int *);
int /*<<< orphan*/ empty(int *);
int /*<<< orphan*/ enqueue(int *, int, int *, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[10];
  int front = -1, rear = -1;
  enqueue(arr, 23, &front, &rear);
  enqueue(arr, 9, &front, &rear);
  enqueue(arr, 11, &front, &rear);
  enqueue(arr, -10, &front, &rear);
  enqueue(arr, 25, &front, &rear);
  enqueue(arr, 16, &front, &rear);
  enqueue(arr, 17, &front, &rear);
  enqueue(arr, 22, &front, &rear);
  enqueue(arr, 19, &front, &rear);
  enqueue(arr, 30, &front, &rear);
  enqueue(arr, 32, &front, &rear);
  int i;
  for (int idx = 0; idx < 10 + 1; idx++) {
    if (!empty(&front)) {
      i = dequeue(arr, &front, &rear);
      printf("Received Dequeued item: %d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x34(%rbp)
movl   $0xffffffff,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x17,%esi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1060 <enqueue@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1060 <enqueue@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1060 <enqueue@plt>
lea    -0x30(%rbp),%rdi
mov    $0xfffffff6,%esi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1060 <enqueue@plt>
lea    -0x30(%rbp),%rdi
mov    $0x19,%esi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1060 <enqueue@plt>
lea    -0x30(%rbp),%rdi
mov    $0x10,%esi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1060 <enqueue@plt>
lea    -0x30(%rbp),%rdi
mov    $0x11,%esi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1060 <enqueue@plt>
lea    -0x30(%rbp),%rdi
mov    $0x16,%esi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1060 <enqueue@plt>
lea    -0x30(%rbp),%rdi
mov    $0x13,%esi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1060 <enqueue@plt>
lea    -0x30(%rbp),%rdi
mov    $0x1e,%esi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1060 <enqueue@plt>
lea    -0x30(%rbp),%rdi
mov    $0x20,%esi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1060 <enqueue@plt>
movl   $0x0,-0x40(%rbp)
cmpl   $0xb,-0x40(%rbp)
jge    12a8 <main+0x168>
lea    -0x34(%rbp),%rdi
call   1040 <empty@plt>
cmp    $0x0,%eax
jne    1295 <main+0x155>
lea    -0x30(%rbp),%rdi
lea    -0x34(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1050 <dequeue@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xd70(%rip),%rdi
call   1030 <printf@plt>
jmp    129a <main+0x15a>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1256 <main+0x116>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
movl   $0xffffffff,0x8(%rsp)
ff
movl   $0xffffffff,0xc(%rsp)
ff
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%rbx
lea    0xc(%rsp),%r15
mov    %r14,%rdi
mov    $0x17,%esi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1060 <enqueue@plt>
mov    %r14,%rdi
mov    $0x9,%esi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1060 <enqueue@plt>
mov    %r14,%rdi
mov    $0xb,%esi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1060 <enqueue@plt>
mov    %r14,%rdi
mov    $0xfffffff6,%esi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1060 <enqueue@plt>
mov    %r14,%rdi
mov    $0x19,%esi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1060 <enqueue@plt>
mov    %r14,%rdi
mov    $0x10,%esi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1060 <enqueue@plt>
mov    %r14,%rdi
mov    $0x11,%esi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1060 <enqueue@plt>
mov    %r14,%rdi
mov    $0x16,%esi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1060 <enqueue@plt>
mov    %r14,%rdi
mov    $0x13,%esi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1060 <enqueue@plt>
mov    %r14,%rdi
mov    $0x1e,%esi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1060 <enqueue@plt>
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1060 <enqueue@plt>
mov    %rbx,%rdi
call   1040 <empty@plt>
test   %eax,%eax
jne    1267 <main+0x127>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <dequeue@plt>
lea    0xda0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <empty@plt>
test   %eax,%eax
jne    1297 <main+0x157>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <dequeue@plt>
lea    0xd70(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <empty@plt>
test   %eax,%eax
jne    12c7 <main+0x187>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <dequeue@plt>
lea    0xd40(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <empty@plt>
test   %eax,%eax
jne    12f7 <main+0x1b7>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <dequeue@plt>
lea    0xd10(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <empty@plt>
test   %eax,%eax
jne    1327 <main+0x1e7>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <dequeue@plt>
lea    0xce0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <empty@plt>
test   %eax,%eax
jne    1357 <main+0x217>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <dequeue@plt>
lea    0xcb0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <empty@plt>
test   %eax,%eax
jne    1387 <main+0x247>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <dequeue@plt>
lea    0xc80(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <empty@plt>
test   %eax,%eax
jne    13b7 <main+0x277>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <dequeue@plt>
lea    0xc50(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <empty@plt>
test   %eax,%eax
jne    13e7 <main+0x2a7>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <dequeue@plt>
lea    0xc20(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <empty@plt>
test   %eax,%eax
jne    1417 <main+0x2d7>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <dequeue@plt>
lea    0xbf0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdi
call   1040 <empty@plt>
test   %eax,%eax
jne    1447 <main+0x307>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <dequeue@plt>
lea    0xbc0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Received Dequeued item: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %3
store i32 -1, i32* %4
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call i32 @enqueue(i32* %7, i32 23, i32* %3, i32* %4)
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = call i32 @enqueue(i32* %9, i32 9, i32* %3, i32* %4)
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%12 = call i32 @enqueue(i32* %11, i32 11, i32* %3, i32* %4)
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%14 = call i32 @enqueue(i32* %13, i32 -10, i32* %3, i32* %4)
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%16 = call i32 @enqueue(i32* %15, i32 25, i32* %3, i32* %4)
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%18 = call i32 @enqueue(i32* %17, i32 16, i32* %3, i32* %4)
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%20 = call i32 @enqueue(i32* %19, i32 17, i32* %3, i32* %4)
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%22 = call i32 @enqueue(i32* %21, i32 22, i32* %3, i32* %4)
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%24 = call i32 @enqueue(i32* %23, i32 19, i32* %3, i32* %4)
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%26 = call i32 @enqueue(i32* %25, i32 30, i32* %3, i32* %4)
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%28 = call i32 @enqueue(i32* %27, i32 32, i32* %3, i32* %4)
store i32 0, i32* %6
br label %29
29: ; preds = %41, %0
%30 = load i32, i32* %6
%31 = icmp slt i32 %30, 11
br i1 %31, label %32, label %44
32: ; preds = %29
%33 = call i32 @empty(i32* %3)
%34 = icmp ne i32 %33, 0
br i1 %34, label %40, label %35
35: ; preds = %32
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%37 = call i32 @dequeue(i32* %36, i32* %3, i32* %4)
store i32 %37, i32* %5
%38 = load i32, i32* %5
%39 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %35, %32
br label %41
41: ; preds = %40
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
br label %29
44: ; preds = %29
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Received Dequeued item: %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [10 x i32]* %1 to i8*
%5 = bitcast i32* %2 to i8*
store i32 -1, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = call i32 @enqueue(i32* %7, i32 23, i32* %2, i32* %3)
%9 = call i32 @enqueue(i32* %7, i32 9, i32* %2, i32* %3)
%10 = call i32 @enqueue(i32* %7, i32 11, i32* %2, i32* %3)
%11 = call i32 @enqueue(i32* %7, i32 -10, i32* %2, i32* %3)
%12 = call i32 @enqueue(i32* %7, i32 25, i32* %2, i32* %3)
%13 = call i32 @enqueue(i32* %7, i32 16, i32* %2, i32* %3)
%14 = call i32 @enqueue(i32* %7, i32 17, i32* %2, i32* %3)
%15 = call i32 @enqueue(i32* %7, i32 22, i32* %2, i32* %3)
%16 = call i32 @enqueue(i32* %7, i32 19, i32* %2, i32* %3)
%17 = call i32 @enqueue(i32* %7, i32 30, i32* %2, i32* %3)
%18 = call i32 @enqueue(i32* %7, i32 32, i32* %2, i32* %3)
%19 = call i32 @empty(i32* %2)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %0
%22 = call i32 @dequeue(i32* %7, i32* %2, i32* %3)
%23 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %0, %21
%25 = call i32 @empty(i32* %2)
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = call i32 @dequeue(i32* %7, i32* %2, i32* %3)
%29 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %27, %24
%31 = call i32 @empty(i32* %2)
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = call i32 @dequeue(i32* %7, i32* %2, i32* %3)
%35 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %33, %30
%37 = call i32 @empty(i32* %2)
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = call i32 @dequeue(i32* %7, i32* %2, i32* %3)
%41 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %39, %36
%43 = call i32 @empty(i32* %2)
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = call i32 @dequeue(i32* %7, i32* %2, i32* %3)
%47 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %46)
br label %48
48: ; preds = %45, %42
%49 = call i32 @empty(i32* %2)
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %48
%52 = call i32 @dequeue(i32* %7, i32* %2, i32* %3)
%53 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %51, %48
%55 = call i32 @empty(i32* %2)
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %54
%58 = call i32 @dequeue(i32* %7, i32* %2, i32* %3)
%59 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %57, %54
%61 = call i32 @empty(i32* %2)
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = call i32 @dequeue(i32* %7, i32* %2, i32* %3)
%65 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %64)
br label %66
66: ; preds = %63, %60
%67 = call i32 @empty(i32* %2)
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %72
69: ; preds = %66
%70 = call i32 @dequeue(i32* %7, i32* %2, i32* %3)
%71 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %70)
br label %72
72: ; preds = %69, %66
%73 = call i32 @empty(i32* %2)
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %78
75: ; preds = %72
%76 = call i32 @dequeue(i32* %7, i32* %2, i32* %3)
%77 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %76)
br label %78
78: ; preds = %75, %72
%79 = call i32 @empty(i32* %2)
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %84
81: ; preds = %78
%82 = call i32 @dequeue(i32* %7, i32* %2, i32* %3)
%83 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %82)
br label %84
84: ; preds = %81, %78
ret i32 0
}