#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);
int dequeue(struct Queue *);
int /*<<< orphan*/ enqueue(struct Queue *, int);
int front(struct Queue *);
int /*<<< orphan*/ printf(char *, int);
int rear(struct Queue *);
int main() {
  struct Queue *queue = createQueue(1000);
  enqueue(queue, 10);
  enqueue(queue, 20);
  enqueue(queue, 30);
  enqueue(queue, 40);
  printf("%d dequeued from queue\n", dequeue(queue));
  printf("Front item is %d\n", front(queue));
  printf("Rear item is %d\n", rear(queue));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3e8,%edi
call   1030 <createQueue@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1080 <enqueue@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%esi
call   1080 <enqueue@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1e,%esi
call   1080 <enqueue@plt>
mov    -0x10(%rbp),%rdi
mov    $0x28,%esi
call   1080 <enqueue@plt>
mov    -0x10(%rbp),%rdi
call   1050 <dequeue@plt>
mov    %eax,%esi
lea    0xe39(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <front@plt>
mov    %eax,%esi
lea    0xe3a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <rear@plt>
mov    %eax,%esi
lea    0xe35(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3e8,%edi
call   1030 <createQueue@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1080 <enqueue@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1080 <enqueue@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
call   1080 <enqueue@plt>
mov    %rbx,%rdi
mov    $0x28,%esi
call   1080 <enqueue@plt>
mov    %rbx,%rdi
call   1050 <dequeue@plt>
lea    0xe4f(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1060 <front@plt>
lea    0xe51(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1070 <rear@plt>
lea    0xe4d(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Queue = type { i32 }
@.str = [24 x i8] c"%d dequeued from queue\0A\00"
@.str.1 = [18 x i8] c"Front item is %d\0A\00"
@.str.2 = [17 x i8] c"Rear item is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.Queue*
store i32 0, i32* %1
%3 = call %struct.Queue* @createQueue(i32 1000)
store %struct.Queue* %3, %struct.Queue** %2
%4 = load %struct.Queue*, %struct.Queue** %2
%5 = call i32 @enqueue(%struct.Queue* %4, i32 10)
%6 = load %struct.Queue*, %struct.Queue** %2
%7 = call i32 @enqueue(%struct.Queue* %6, i32 20)
%8 = load %struct.Queue*, %struct.Queue** %2
%9 = call i32 @enqueue(%struct.Queue* %8, i32 30)
%10 = load %struct.Queue*, %struct.Queue** %2
%11 = call i32 @enqueue(%struct.Queue* %10, i32 40)
%12 = load %struct.Queue*, %struct.Queue** %2
%13 = call i32 @dequeue(%struct.Queue* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load %struct.Queue*, %struct.Queue** %2
%16 = call i32 @front(%struct.Queue* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load %struct.Queue*, %struct.Queue** %2
%19 = call i32 @rear(%struct.Queue* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %19)
ret i32 0
}

LLVM IR (-O2):
%struct.Queue = type { i32 }
@.str = [24 x i8] c"%d dequeued from queue\0A\00"
@.str.1 = [18 x i8] c"Front item is %d\0A\00"
@.str.2 = [17 x i8] c"Rear item is %d\0A\00"
define i32 @main() {
%1 = tail call %struct.Queue* @createQueue(i32 1000)
%2 = tail call i32 @enqueue(%struct.Queue* %1, i32 10)
%3 = tail call i32 @enqueue(%struct.Queue* %1, i32 20)
%4 = tail call i32 @enqueue(%struct.Queue* %1, i32 30)
%5 = tail call i32 @enqueue(%struct.Queue* %1, i32 40)
%6 = tail call i32 @dequeue(%struct.Queue* %1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @front(%struct.Queue* %1)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = tail call i32 @rear(%struct.Queue* %1)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}