#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*/ addBack(int);
int /*<<< orphan*/ addFront(int);
int /*<<< orphan*/ display();
int /*<<< orphan*/ printf(char *, int);
int removeBack();
int removeFront();
int main() {
  int num;
  addBack(12);
  display();
  addFront(42);
  display();
  addFront(9);
  display();
  addBack(14);
  display();
  num = removeFront();
  if (num != 0)
    printf("Removed %d from deque.\n", num);
  display();
  num = removeBack();
  if (num != 0)
    printf("Removed %d from deque.\n", num);
  display();
  num = removeFront();
  if (num != 0)
    printf("Removed %d from deque.\n", num);
  display();
  num = removeFront();
  if (num != 0)
    printf("Removed %d from deque.\n", num);
  display();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xc,%edi
call   1050 <addBack@plt>
mov    $0x0,%al
call   1030 <display@plt>
mov    $0x2a,%edi
call   1080 <addFront@plt>
mov    $0x0,%al
call   1030 <display@plt>
mov    $0x9,%edi
call   1080 <addFront@plt>
mov    $0x0,%al
call   1030 <display@plt>
mov    $0xe,%edi
call   1050 <addBack@plt>
mov    $0x0,%al
call   1030 <display@plt>
mov    $0x0,%al
call   1070 <removeFront@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11d6 <main+0x76>
mov    -0x8(%rbp),%esi
lea    0xe2f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <display@plt>
mov    $0x0,%al
call   1060 <removeBack@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1200 <main+0xa0>
mov    -0x8(%rbp),%esi
lea    0xe05(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <display@plt>
mov    $0x0,%al
call   1070 <removeFront@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     122a <main+0xca>
mov    -0x8(%rbp),%esi
lea    0xddb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <display@plt>
mov    $0x0,%al
call   1070 <removeFront@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1254 <main+0xf4>
mov    -0x8(%rbp),%esi
lea    0xdb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <display@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1050 <addBack@plt>
xor    %eax,%eax
call   1030 <display@plt>
mov    $0x2a,%edi
call   1080 <addFront@plt>
xor    %eax,%eax
call   1030 <display@plt>
mov    $0x9,%edi
call   1080 <addFront@plt>
xor    %eax,%eax
call   1030 <display@plt>
mov    $0xe,%edi
call   1050 <addBack@plt>
xor    %eax,%eax
call   1030 <display@plt>
xor    %eax,%eax
call   1070 <removeFront@plt>
test   %eax,%eax
je     11be <main+0x5e>
lea    0xe49(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <display@plt>
xor    %eax,%eax
call   1060 <removeBack@plt>
test   %eax,%eax
je     11de <main+0x7e>
lea    0xe29(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <display@plt>
xor    %eax,%eax
call   1070 <removeFront@plt>
test   %eax,%eax
je     11fe <main+0x9e>
lea    0xe09(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <display@plt>
xor    %eax,%eax
call   1070 <removeFront@plt>
test   %eax,%eax
je     121e <main+0xbe>
lea    0xde9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <display@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Removed %d from deque.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @addBack(i32 12)
%4 = call i32 (...) @display()
%5 = call i32 @addFront(i32 42)
%6 = call i32 (...) @display()
%7 = call i32 @addFront(i32 9)
%8 = call i32 (...) @display()
%9 = call i32 @addBack(i32 14)
%10 = call i32 (...) @display()
%11 = call i32 (...) @removeFront()
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %0
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %0
%18 = call i32 (...) @display()
%19 = call i32 (...) @removeBack()
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = load i32, i32* %2
%24 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %22, %17
%26 = call i32 (...) @display()
%27 = call i32 (...) @removeFront()
store i32 %27, i32* %2
%28 = load i32, i32* %2
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %25
%31 = load i32, i32* %2
%32 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %30, %25
%34 = call i32 (...) @display()
%35 = call i32 (...) @removeFront()
store i32 %35, i32* %2
%36 = load i32, i32* %2
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %33
%39 = load i32, i32* %2
%40 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %38, %33
%42 = call i32 (...) @display()
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Removed %d from deque.\0A\00"
define i32 @main() {
%1 = tail call i32 @addBack(i32 12)
%2 = tail call i32 (...) @display()
%3 = tail call i32 @addFront(i32 42)
%4 = tail call i32 (...) @display()
%5 = tail call i32 @addFront(i32 9)
%6 = tail call i32 (...) @display()
%7 = tail call i32 @addBack(i32 14)
%8 = tail call i32 (...) @display()
%9 = tail call i32 (...) @removeFront()
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %0
%12 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %13
13: ; preds = %11, %0
%14 = tail call i32 (...) @display()
%15 = tail call i32 (...) @removeBack()
%16 = icmp eq i32 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %13
%18 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %19
19: ; preds = %17, %13
%20 = tail call i32 (...) @display()
%21 = tail call i32 (...) @removeFront()
%22 = icmp eq i32 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %19
%24 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %21)
br label %25
25: ; preds = %23, %19
%26 = tail call i32 (...) @display()
%27 = tail call i32 (...) @removeFront()
%28 = icmp eq i32 %27, 0
br i1 %28, label %31, label %29
29: ; preds = %25
%30 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %27)
br label %31
31: ; preds = %29, %25
%32 = tail call i32 (...) @display()
ret i32 0
}