#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 */
struct CircularQueue {
  int dummy;
};

/* Variables and functions */
struct CircularQueue *createQueue(int);
int /*<<< orphan*/ dequeue(struct CircularQueue *);
int /*<<< orphan*/ destroyQueue(struct CircularQueue **);
int /*<<< orphan*/ enqueue(struct CircularQueue *, int);
int /*<<< orphan*/ print(struct CircularQueue *);
int main() {
  struct CircularQueue *queue = createQueue(5);
  dequeue(queue);
  enqueue(queue, 1);
  enqueue(queue, 2);
  enqueue(queue, 3);
  enqueue(queue, 4);
  enqueue(queue, 5);
  enqueue(queue, 6);
  print(queue);
  dequeue(queue);
  dequeue(queue);
  print(queue);
  dequeue(queue);
  dequeue(queue);
  dequeue(queue);
  dequeue(queue);
  print(queue);
  destroyQueue(&queue);
  enqueue(queue, 1);
  dequeue(queue);
  print(queue);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1030 <createQueue@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <dequeue@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1070 <enqueue@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1070 <enqueue@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1070 <enqueue@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1070 <enqueue@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
call   1070 <enqueue@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
call   1070 <enqueue@plt>
mov    -0x8(%rbp),%rdi
call   1050 <print@plt>
mov    -0x8(%rbp),%rdi
call   1060 <dequeue@plt>
mov    -0x8(%rbp),%rdi
call   1060 <dequeue@plt>
mov    -0x8(%rbp),%rdi
call   1050 <print@plt>
mov    -0x8(%rbp),%rdi
call   1060 <dequeue@plt>
mov    -0x8(%rbp),%rdi
call   1060 <dequeue@plt>
mov    -0x8(%rbp),%rdi
call   1060 <dequeue@plt>
mov    -0x8(%rbp),%rdi
call   1060 <dequeue@plt>
mov    -0x8(%rbp),%rdi
call   1050 <print@plt>
lea    -0x8(%rbp),%rdi
call   1040 <destroyQueue@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1070 <enqueue@plt>
mov    -0x8(%rbp),%rdi
call   1060 <dequeue@plt>
mov    -0x8(%rbp),%rdi
call   1050 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x5,%edi
call   1030 <createQueue@plt>
mov    %rax,%rbx
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
call   1060 <dequeue@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1070 <enqueue@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1070 <enqueue@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <enqueue@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1070 <enqueue@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1070 <enqueue@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1070 <enqueue@plt>
mov    %rbx,%rdi
call   1050 <print@plt>
mov    %rbx,%rdi
call   1060 <dequeue@plt>
mov    %rbx,%rdi
call   1060 <dequeue@plt>
mov    %rbx,%rdi
call   1050 <print@plt>
mov    %rbx,%rdi
call   1060 <dequeue@plt>
mov    %rbx,%rdi
call   1060 <dequeue@plt>
mov    %rbx,%rdi
call   1060 <dequeue@plt>
mov    %rbx,%rdi
call   1060 <dequeue@plt>
mov    %rbx,%rdi
call   1050 <print@plt>
lea    0x8(%rsp),%rdi
call   1040 <destroyQueue@plt>
mov    0x8(%rsp),%rdi
mov    $0x1,%esi
call   1070 <enqueue@plt>
mov    0x8(%rsp),%rdi
call   1060 <dequeue@plt>
mov    0x8(%rsp),%rdi
call   1050 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.CircularQueue = type { i32 }
define i32 @main() {
%1 = alloca %struct.CircularQueue*
%2 = call %struct.CircularQueue* @createQueue(i32 5)
store %struct.CircularQueue* %2, %struct.CircularQueue** %1
%3 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%4 = call i32 @dequeue(%struct.CircularQueue* %3)
%5 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%6 = call i32 @enqueue(%struct.CircularQueue* %5, i32 1)
%7 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%8 = call i32 @enqueue(%struct.CircularQueue* %7, i32 2)
%9 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%10 = call i32 @enqueue(%struct.CircularQueue* %9, i32 3)
%11 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%12 = call i32 @enqueue(%struct.CircularQueue* %11, i32 4)
%13 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%14 = call i32 @enqueue(%struct.CircularQueue* %13, i32 5)
%15 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%16 = call i32 @enqueue(%struct.CircularQueue* %15, i32 6)
%17 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%18 = call i32 @print(%struct.CircularQueue* %17)
%19 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%20 = call i32 @dequeue(%struct.CircularQueue* %19)
%21 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%22 = call i32 @dequeue(%struct.CircularQueue* %21)
%23 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%24 = call i32 @print(%struct.CircularQueue* %23)
%25 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%26 = call i32 @dequeue(%struct.CircularQueue* %25)
%27 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%28 = call i32 @dequeue(%struct.CircularQueue* %27)
%29 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%30 = call i32 @dequeue(%struct.CircularQueue* %29)
%31 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%32 = call i32 @dequeue(%struct.CircularQueue* %31)
%33 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%34 = call i32 @print(%struct.CircularQueue* %33)
%35 = call i32 @destroyQueue(%struct.CircularQueue** %1)
%36 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%37 = call i32 @enqueue(%struct.CircularQueue* %36, i32 1)
%38 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%39 = call i32 @dequeue(%struct.CircularQueue* %38)
%40 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%41 = call i32 @print(%struct.CircularQueue* %40)
ret i32 0
}

LLVM IR (-O2):
%struct.CircularQueue = type { i32 }
define i32 @main() {
%1 = alloca %struct.CircularQueue*
%2 = bitcast %struct.CircularQueue** %1 to i8*
%3 = tail call %struct.CircularQueue* @createQueue(i32 5)
store %struct.CircularQueue* %3, %struct.CircularQueue** %1
%4 = tail call i32 @dequeue(%struct.CircularQueue* %3)
%5 = tail call i32 @enqueue(%struct.CircularQueue* %3, i32 1)
%6 = tail call i32 @enqueue(%struct.CircularQueue* %3, i32 2)
%7 = tail call i32 @enqueue(%struct.CircularQueue* %3, i32 3)
%8 = tail call i32 @enqueue(%struct.CircularQueue* %3, i32 4)
%9 = tail call i32 @enqueue(%struct.CircularQueue* %3, i32 5)
%10 = tail call i32 @enqueue(%struct.CircularQueue* %3, i32 6)
%11 = tail call i32 @print(%struct.CircularQueue* %3)
%12 = tail call i32 @dequeue(%struct.CircularQueue* %3)
%13 = tail call i32 @dequeue(%struct.CircularQueue* %3)
%14 = tail call i32 @print(%struct.CircularQueue* %3)
%15 = tail call i32 @dequeue(%struct.CircularQueue* %3)
%16 = tail call i32 @dequeue(%struct.CircularQueue* %3)
%17 = tail call i32 @dequeue(%struct.CircularQueue* %3)
%18 = tail call i32 @dequeue(%struct.CircularQueue* %3)
%19 = tail call i32 @print(%struct.CircularQueue* %3)
%20 = call i32 @destroyQueue(%struct.CircularQueue** %1)
%21 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%22 = call i32 @enqueue(%struct.CircularQueue* %21, i32 1)
%23 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%24 = call i32 @dequeue(%struct.CircularQueue* %23)
%25 = load %struct.CircularQueue*, %struct.CircularQueue** %1
%26 = call i32 @print(%struct.CircularQueue* %25)
ret i32 0
}