#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 cirListDeque {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addBackCirListDeque(struct cirListDeque *, int);
int /*<<< orphan*/ addFrontCirListDeque(struct cirListDeque *, int);
double backCirListDeque(struct cirListDeque *);
struct cirListDeque *createCirListDeque();
int /*<<< orphan*/ deleteCirListDeque(struct cirListDeque *);
double frontCirListDeque(struct cirListDeque *);
int /*<<< orphan*/ printCirListDeque(struct cirListDeque *);
int /*<<< orphan*/ printf(char *, double, double);
int /*<<< orphan*/ removeBackCirListDeque(struct cirListDeque *);
int /*<<< orphan*/ removeFrontCirListDeque(struct cirListDeque *);
int /*<<< orphan*/ reverseCirListDeque(struct cirListDeque *);
int main(int argc, char *argv[]) {
  struct cirListDeque *q = createCirListDeque();
  addFrontCirListDeque(q, 2);
  addBackCirListDeque(q, 3);
  addFrontCirListDeque(q, 1);
  addBackCirListDeque(q, 4);
  printCirListDeque(q);
  reverseCirListDeque(q);
  printCirListDeque(q);
  removeFrontCirListDeque(q);
  removeBackCirListDeque(q);
  printCirListDeque(q);
  double i = frontCirListDeque(q);
  double j = backCirListDeque(q);
  printf("front: %lf\tback: %lf\n", i, j);
  deleteCirListDeque(q);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   10a0 <createCirListDeque@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1060 <addFrontCirListDeque@plt>
mov    -0x18(%rbp),%rdi
mov    $0x3,%esi
call   1080 <addBackCirListDeque@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1060 <addFrontCirListDeque@plt>
mov    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   1080 <addBackCirListDeque@plt>
mov    -0x18(%rbp),%rdi
call   1040 <printCirListDeque@plt>
mov    -0x18(%rbp),%rdi
call   10b0 <reverseCirListDeque@plt>
mov    -0x18(%rbp),%rdi
call   1040 <printCirListDeque@plt>
mov    -0x18(%rbp),%rdi
call   10d0 <removeFrontCirListDeque@plt>
mov    -0x18(%rbp),%rdi
call   1030 <removeBackCirListDeque@plt>
mov    -0x18(%rbp),%rdi
call   1040 <printCirListDeque@plt>
mov    -0x18(%rbp),%rdi
call   10c0 <frontCirListDeque@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <backCirListDeque@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xd94(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1090 <deleteCirListDeque@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   10a0 <createCirListDeque@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2,%esi
call   1060 <addFrontCirListDeque@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1080 <addBackCirListDeque@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1060 <addFrontCirListDeque@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1080 <addBackCirListDeque@plt>
mov    %rbx,%rdi
call   1040 <printCirListDeque@plt>
mov    %rbx,%rdi
call   10b0 <reverseCirListDeque@plt>
mov    %rbx,%rdi
call   1040 <printCirListDeque@plt>
mov    %rbx,%rdi
call   10d0 <removeFrontCirListDeque@plt>
mov    %rbx,%rdi
call   1030 <removeBackCirListDeque@plt>
mov    %rbx,%rdi
call   1040 <printCirListDeque@plt>
mov    %rbx,%rdi
call   10c0 <frontCirListDeque@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1070 <backCirListDeque@plt>
movaps %xmm0,%xmm1
lea    0xdbd(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1090 <deleteCirListDeque@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.cirListDeque = type { i32 }
@.str = [22 x i8] c"front: %lf\09back: %lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.cirListDeque*
%7 = alloca double
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call %struct.cirListDeque* (...) @createCirListDeque()
store %struct.cirListDeque* %9, %struct.cirListDeque** %6
%10 = load %struct.cirListDeque*, %struct.cirListDeque** %6
%11 = call i32 @addFrontCirListDeque(%struct.cirListDeque* %10, i32 2)
%12 = load %struct.cirListDeque*, %struct.cirListDeque** %6
%13 = call i32 @addBackCirListDeque(%struct.cirListDeque* %12, i32 3)
%14 = load %struct.cirListDeque*, %struct.cirListDeque** %6
%15 = call i32 @addFrontCirListDeque(%struct.cirListDeque* %14, i32 1)
%16 = load %struct.cirListDeque*, %struct.cirListDeque** %6
%17 = call i32 @addBackCirListDeque(%struct.cirListDeque* %16, i32 4)
%18 = load %struct.cirListDeque*, %struct.cirListDeque** %6
%19 = call i32 @printCirListDeque(%struct.cirListDeque* %18)
%20 = load %struct.cirListDeque*, %struct.cirListDeque** %6
%21 = call i32 @reverseCirListDeque(%struct.cirListDeque* %20)
%22 = load %struct.cirListDeque*, %struct.cirListDeque** %6
%23 = call i32 @printCirListDeque(%struct.cirListDeque* %22)
%24 = load %struct.cirListDeque*, %struct.cirListDeque** %6
%25 = call i32 @removeFrontCirListDeque(%struct.cirListDeque* %24)
%26 = load %struct.cirListDeque*, %struct.cirListDeque** %6
%27 = call i32 @removeBackCirListDeque(%struct.cirListDeque* %26)
%28 = load %struct.cirListDeque*, %struct.cirListDeque** %6
%29 = call i32 @printCirListDeque(%struct.cirListDeque* %28)
%30 = load %struct.cirListDeque*, %struct.cirListDeque** %6
%31 = call double @frontCirListDeque(%struct.cirListDeque* %30)
store double %31, double* %7
%32 = load %struct.cirListDeque*, %struct.cirListDeque** %6
%33 = call double @backCirListDeque(%struct.cirListDeque* %32)
store double %33, double* %8
%34 = load double, double* %7
%35 = load double, double* %8
%36 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %34, double %35)
%37 = load %struct.cirListDeque*, %struct.cirListDeque** %6
%38 = call i32 @deleteCirListDeque(%struct.cirListDeque* %37)
ret i32 0
}

LLVM IR (-O2):
%struct.cirListDeque = type { i32 }
@.str = [22 x i8] c"front: %lf\09back: %lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.cirListDeque* (...) @createCirListDeque()
%4 = tail call i32 @addFrontCirListDeque(%struct.cirListDeque* %3, i32 2)
%5 = tail call i32 @addBackCirListDeque(%struct.cirListDeque* %3, i32 3)
%6 = tail call i32 @addFrontCirListDeque(%struct.cirListDeque* %3, i32 1)
%7 = tail call i32 @addBackCirListDeque(%struct.cirListDeque* %3, i32 4)
%8 = tail call i32 @printCirListDeque(%struct.cirListDeque* %3)
%9 = tail call i32 @reverseCirListDeque(%struct.cirListDeque* %3)
%10 = tail call i32 @printCirListDeque(%struct.cirListDeque* %3)
%11 = tail call i32 @removeFrontCirListDeque(%struct.cirListDeque* %3)
%12 = tail call i32 @removeBackCirListDeque(%struct.cirListDeque* %3)
%13 = tail call i32 @printCirListDeque(%struct.cirListDeque* %3)
%14 = tail call double @frontCirListDeque(%struct.cirListDeque* %3)
%15 = tail call double @backCirListDeque(%struct.cirListDeque* %3)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %14, double %15)
%17 = tail call i32 @deleteCirListDeque(%struct.cirListDeque* %3)
ret i32 0
}