#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 */
int DeQueue(struct queue *);
int /*<<< orphan*/ EnQueue(struct queue *, int);
struct queue *createQueue();
int /*<<< orphan*/ display(struct queue *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  struct queue *Q = createQueue();
  int i;
  for (i = 1; i < 8; i++)
    EnQueue(Q, i);
  display(Q);
  int d = DeQueue(Q);
  printf("DeQueued data is %d\n", d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <createQueue@plt>
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1195 <main+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <EnQueue@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1171 <main+0x21>
mov    -0x10(%rbp),%rdi
call   1060 <display@plt>
mov    -0x10(%rbp),%rdi
call   1050 <DeQueue@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe4c(%rip),%rdi
call   1070 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <createQueue@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
call   1040 <EnQueue@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <EnQueue@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <EnQueue@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <EnQueue@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <EnQueue@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <EnQueue@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <EnQueue@plt>
mov    %rbx,%rdi
call   1060 <display@plt>
mov    %rbx,%rdi
call   1050 <DeQueue@plt>
lea    0xe33(%rip),%rdi
mov    %eax,%esi
call   1070 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.queue = type { i32 }
@.str = [21 x i8] c"DeQueued data is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.queue*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call %struct.queue* (...) @createQueue()
store %struct.queue* %5, %struct.queue** %2
store i32 1, i32* %3
br label %6
6: ; preds = %13, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load %struct.queue*, %struct.queue** %2
%11 = load i32, i32* %3
%12 = call i32 @EnQueue(%struct.queue* %10, i32 %11)
br label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %6
16: ; preds = %6
%17 = load %struct.queue*, %struct.queue** %2
%18 = call i32 @display(%struct.queue* %17)
%19 = load %struct.queue*, %struct.queue** %2
%20 = call i32 @DeQueue(%struct.queue* %19)
store i32 %20, i32* %4
%21 = load i32, i32* %4
%22 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
%struct.queue = type { i32 }
@.str = [21 x i8] c"DeQueued data is %d\0A\00"
define i32 @main() {
%1 = tail call %struct.queue* (...) @createQueue()
%2 = tail call i32 @EnQueue(%struct.queue* %1, i32 1)
%3 = tail call i32 @EnQueue(%struct.queue* %1, i32 2)
%4 = tail call i32 @EnQueue(%struct.queue* %1, i32 3)
%5 = tail call i32 @EnQueue(%struct.queue* %1, i32 4)
%6 = tail call i32 @EnQueue(%struct.queue* %1, i32 5)
%7 = tail call i32 @EnQueue(%struct.queue* %1, i32 6)
%8 = tail call i32 @EnQueue(%struct.queue* %1, i32 7)
%9 = tail call i32 @display(%struct.queue* %1)
%10 = tail call i32 @DeQueue(%struct.queue* %1)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}