#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 Queue {
  int dummy;
};

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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <createQueue@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1080 <enqueue@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1080 <enqueue@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1080 <enqueue@plt>
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1080 <enqueue@plt>
mov    -0x10(%rbp),%rdi
call   1070 <dequeue@plt>
mov    -0x10(%rbp),%rdi
call   1050 <print@plt>
mov    -0x10(%rbp),%rdi
call   1060 <empty@plt>
mov    -0x10(%rbp),%rdi
call   1050 <print@plt>
mov    -0x10(%rbp),%rdi
call   1060 <empty@plt>
mov    -0x10(%rbp),%rdi
call   1070 <dequeue@plt>
lea    -0x10(%rbp),%rdi
call   1040 <destroyQueue@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1080 <enqueue@plt>
mov    -0x10(%rbp),%rdi
call   1070 <dequeue@plt>
mov    -0x10(%rbp),%rdi
call   1050 <print@plt>
mov    -0x10(%rbp),%rdi
call   1060 <empty@plt>
mov    $0x0,%al
call   1030 <createQueue@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1080 <enqueue@plt>
mov    -0x10(%rbp),%rdi
call   1070 <dequeue@plt>
mov    -0x10(%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
xor    %eax,%eax
call   1030 <createQueue@plt>
mov    %rax,%rbx
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    $0x1,%esi
call   1080 <enqueue@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1080 <enqueue@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1080 <enqueue@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1080 <enqueue@plt>
mov    %rbx,%rdi
call   1070 <dequeue@plt>
mov    %rbx,%rdi
call   1050 <print@plt>
mov    %rbx,%rdi
call   1060 <empty@plt>
mov    %rbx,%rdi
call   1050 <print@plt>
mov    %rbx,%rdi
call   1060 <empty@plt>
mov    %rbx,%rdi
call   1070 <dequeue@plt>
lea    0x8(%rsp),%rdi
call   1040 <destroyQueue@plt>
mov    0x8(%rsp),%rdi
mov    $0x1,%esi
call   1080 <enqueue@plt>
mov    0x8(%rsp),%rdi
call   1070 <dequeue@plt>
mov    0x8(%rsp),%rdi
call   1050 <print@plt>
mov    0x8(%rsp),%rdi
call   1060 <empty@plt>
xor    %eax,%eax
call   1030 <createQueue@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    $0x1,%esi
call   1080 <enqueue@plt>
mov    0x8(%rsp),%rdi
call   1070 <dequeue@plt>
mov    0x8(%rsp),%rdi
call   1050 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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