#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 */

/* Variables and functions */
int /*<<< orphan*/ popFromQueue();
int /*<<< orphan*/ popFromStack();
int /*<<< orphan*/ printQueue();
int /*<<< orphan*/ printStack();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pushToQueue(int);
int /*<<< orphan*/ pushToStack(int);
int main() {
  pushToQueue(1);
  pushToQueue(2);
  pushToQueue(3);
  printQueue();
  popFromQueue();
  popFromQueue();
  printQueue();
  printf("\n\n");
  pushToStack(1);
  pushToStack(2);
  pushToStack(3);
  printStack();
  popFromStack();
  popFromStack();
  printStack();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1070 <pushToQueue@plt>
mov    $0x2,%edi
call   1070 <pushToQueue@plt>
mov    $0x3,%edi
call   1070 <pushToQueue@plt>
mov    $0x0,%al
call   1080 <printQueue@plt>
mov    $0x0,%al
call   1050 <popFromQueue@plt>
mov    $0x0,%al
call   1050 <popFromQueue@plt>
mov    $0x0,%al
call   1080 <printQueue@plt>
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <pushToStack@plt>
mov    $0x2,%edi
call   1040 <pushToStack@plt>
mov    $0x3,%edi
call   1040 <pushToStack@plt>
mov    $0x0,%al
call   1060 <printStack@plt>
mov    $0x0,%al
call   1090 <popFromStack@plt>
mov    $0x0,%al
call   1090 <popFromStack@plt>
mov    $0x0,%al
call   1060 <printStack@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1070 <pushToQueue@plt>
mov    $0x2,%edi
call   1070 <pushToQueue@plt>
mov    $0x3,%edi
call   1070 <pushToQueue@plt>
xor    %eax,%eax
call   1080 <printQueue@plt>
xor    %eax,%eax
call   1050 <popFromQueue@plt>
xor    %eax,%eax
call   1050 <popFromQueue@plt>
xor    %eax,%eax
call   1080 <printQueue@plt>
lea    0xe4e(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <pushToStack@plt>
mov    $0x2,%edi
call   1040 <pushToStack@plt>
mov    $0x3,%edi
call   1040 <pushToStack@plt>
xor    %eax,%eax
call   1060 <printStack@plt>
xor    %eax,%eax
call   1090 <popFromStack@plt>
xor    %eax,%eax
call   1090 <popFromStack@plt>
xor    %eax,%eax
call   1060 <printStack@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @pushToQueue(i32 1)
%3 = call i32 @pushToQueue(i32 2)
%4 = call i32 @pushToQueue(i32 3)
%5 = call i32 (...) @printQueue()
%6 = call i32 (...) @popFromQueue()
%7 = call i32 (...) @popFromQueue()
%8 = call i32 (...) @printQueue()
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @pushToStack(i32 1)
%11 = call i32 @pushToStack(i32 2)
%12 = call i32 @pushToStack(i32 3)
%13 = call i32 (...) @printStack()
%14 = call i32 (...) @popFromStack()
%15 = call i32 (...) @popFromStack()
%16 = call i32 (...) @printStack()
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 @pushToQueue(i32 1)
%2 = tail call i32 @pushToQueue(i32 2)
%3 = tail call i32 @pushToQueue(i32 3)
%4 = tail call i32 (...) @printQueue()
%5 = tail call i32 (...) @popFromQueue()
%6 = tail call i32 (...) @popFromQueue()
%7 = tail call i32 (...) @printQueue()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @pushToStack(i32 1)
%10 = tail call i32 @pushToStack(i32 2)
%11 = tail call i32 @pushToStack(i32 3)
%12 = tail call i32 (...) @printStack()
%13 = tail call i32 (...) @popFromStack()
%14 = tail call i32 (...) @popFromStack()
%15 = tail call i32 (...) @printStack()
ret i32 0
}