#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 /*<<< orphan*/ printf(char *, int);
struct queue *queue_create(int);
int /*<<< orphan*/ queue_dequeue(struct queue *);
int /*<<< orphan*/ queue_enqueue(struct queue *, int);
int queue_lookqueue(struct queue *, int);
int main() {
  struct queue *q;
  int i, val;
  q = queue_create(10);
  for (i = 1; i <= 11; i++) {
    queue_enqueue(q, i);
  }
  for (i = 1; i <= 11; i++) {
    printf("%d\n", queue_lookqueue(q, i));
  }
  for (i = 1; i <= 5; i++) {
    queue_dequeue(q);
  }
  for (i = 1; i <= 11; i++) {
    printf("%d\n", queue_lookqueue(q, i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <queue_create@plt>
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0xb,-0x14(%rbp)
jg     1198 <main+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <queue_enqueue@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1174 <main+0x24>
movl   $0x1,-0x14(%rbp)
cmpl   $0xb,-0x14(%rbp)
jg     11d1 <main+0x81>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <queue_lookqueue@plt>
mov    %eax,%esi
lea    0xe42(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119f <main+0x4f>
movl   $0x1,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jg     11f9 <main+0xa9>
mov    -0x10(%rbp),%rdi
call   1070 <queue_dequeue@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d8 <main+0x88>
movl   $0x1,-0x14(%rbp)
cmpl   $0xb,-0x14(%rbp)
jg     1232 <main+0xe2>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <queue_lookqueue@plt>
mov    %eax,%esi
lea    0xde1(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1200 <main+0xb0>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xa,%edi
call   1030 <queue_create@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
call   1040 <queue_enqueue@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <queue_enqueue@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <queue_enqueue@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <queue_enqueue@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <queue_enqueue@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <queue_enqueue@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <queue_enqueue@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <queue_enqueue@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <queue_enqueue@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <queue_enqueue@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <queue_enqueue@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1060 <queue_lookqueue@plt>
lea    0xdfc(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1070 <queue_dequeue@plt>
mov    %rbx,%rdi
call   1070 <queue_dequeue@plt>
mov    %rbx,%rdi
call   1070 <queue_dequeue@plt>
mov    %rbx,%rdi
call   1070 <queue_dequeue@plt>
mov    %rbx,%rdi
call   1070 <queue_dequeue@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1060 <queue_lookqueue@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.queue = type { i32 }
@.str = [4 x i8] c"%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* @queue_create(i32 10)
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 sle i32 %7, 11
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 @queue_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
store i32 1, i32* %3
br label %17
17: ; preds = %25, %16
%18 = load i32, i32* %3
%19 = icmp sle i32 %18, 11
br i1 %19, label %20, label %28
20: ; preds = %17
%21 = load %struct.queue*, %struct.queue** %2
%22 = load i32, i32* %3
%23 = call i32 @queue_lookqueue(%struct.queue* %21, i32 %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %20
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %17
28: ; preds = %17
store i32 1, i32* %3
br label %29
29: ; preds = %35, %28
%30 = load i32, i32* %3
%31 = icmp sle i32 %30, 5
br i1 %31, label %32, label %38
32: ; preds = %29
%33 = load %struct.queue*, %struct.queue** %2
%34 = call i32 @queue_dequeue(%struct.queue* %33)
br label %35
35: ; preds = %32
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %29
38: ; preds = %29
store i32 1, i32* %3
br label %39
39: ; preds = %47, %38
%40 = load i32, i32* %3
%41 = icmp sle i32 %40, 11
br i1 %41, label %42, label %50
42: ; preds = %39
%43 = load %struct.queue*, %struct.queue** %2
%44 = load i32, i32* %3
%45 = call i32 @queue_lookqueue(%struct.queue* %43, i32 %44)
%46 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %42
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
store i32 %49, i32* %3
br label %39
50: ; preds = %39
ret i32 0
}

LLVM IR (-O2):
%struct.queue = type { i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call %struct.queue* @queue_create(i32 10)
%2 = tail call i32 @queue_enqueue(%struct.queue* %1, i32 1)
%3 = tail call i32 @queue_enqueue(%struct.queue* %1, i32 2)
%4 = tail call i32 @queue_enqueue(%struct.queue* %1, i32 3)
%5 = tail call i32 @queue_enqueue(%struct.queue* %1, i32 4)
%6 = tail call i32 @queue_enqueue(%struct.queue* %1, i32 5)
%7 = tail call i32 @queue_enqueue(%struct.queue* %1, i32 6)
%8 = tail call i32 @queue_enqueue(%struct.queue* %1, i32 7)
%9 = tail call i32 @queue_enqueue(%struct.queue* %1, i32 8)
%10 = tail call i32 @queue_enqueue(%struct.queue* %1, i32 9)
%11 = tail call i32 @queue_enqueue(%struct.queue* %1, i32 10)
%12 = tail call i32 @queue_enqueue(%struct.queue* %1, i32 11)
%13 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 1)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 2)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 3)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 4)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 5)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 6)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 7)
%26 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 8)
%28 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 9)
%30 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 10)
%32 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %31)
%33 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 11)
%34 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = tail call i32 @queue_dequeue(%struct.queue* %1)
%36 = tail call i32 @queue_dequeue(%struct.queue* %1)
%37 = tail call i32 @queue_dequeue(%struct.queue* %1)
%38 = tail call i32 @queue_dequeue(%struct.queue* %1)
%39 = tail call i32 @queue_dequeue(%struct.queue* %1)
%40 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 1)
%41 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %40)
%42 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 2)
%43 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %42)
%44 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 3)
%45 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %44)
%46 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 4)
%47 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %46)
%48 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 5)
%49 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %48)
%50 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 6)
%51 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %50)
%52 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 7)
%53 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %52)
%54 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 8)
%55 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %54)
%56 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 9)
%57 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %56)
%58 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 10)
%59 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %58)
%60 = tail call i32 @queue_lookqueue(%struct.queue* %1, i32 11)
%61 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %60)
ret i32 0
}