#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 DLLHead_q {
  int dummy;
};
struct DLLHead {
  int dummy;
};

/* Variables and functions */
struct DLLHead_q *create_new_queue();
struct DLLHead *create_new_stack();
int /*<<< orphan*/ print_list(char *, struct DLLHead **);
int /*<<< orphan*/ print_list_q(char *, struct DLLHead_q **);
int /*<<< orphan*/ push(struct DLLHead **, int *);
int /*<<< orphan*/ q_push(struct DLLHead_q **, int *);
int main(int argc, char const *argv[]) {
  struct DLLHead *head = NULL;
  struct DLLHead_q *head_q = NULL;
  head = create_new_stack();
  head_q = create_new_queue();
  int a = 0;
  int b = 0;
  int c = 0;
  int d = 0;
  int e = 0;
  push(&head, &a);
  q_push(&head_q, &a);
  push(&head, &b);
  q_push(&head_q, &b);
  push(&head, &c);
  q_push(&head_q, &c);
  push(&head, &d);
  q_push(&head_q, &d);
  push(&head, &e);
  q_push(&head_q, &e);
  print_list("main_s", &head);
  print_list_q("main_q", &head_q);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1060 <create_new_stack@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <create_new_queue@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1070 <push@plt>
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1050 <q_push@plt>
lea    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1070 <push@plt>
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <q_push@plt>
lea    -0x18(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
call   1070 <push@plt>
lea    -0x20(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
call   1050 <q_push@plt>
lea    -0x18(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1070 <push@plt>
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1050 <q_push@plt>
lea    -0x18(%rbp),%rdi
lea    -0x34(%rbp),%rsi
call   1070 <push@plt>
lea    -0x20(%rbp),%rdi
lea    -0x34(%rbp),%rsi
call   1050 <q_push@plt>
lea    0xdb8(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <print_list@plt>
lea    0xdaf(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1080 <print_list_q@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
xor    %eax,%eax
call   1060 <create_new_stack@plt>
mov    %rax,0x28(%rsp)
xor    %eax,%eax
call   1040 <create_new_queue@plt>
mov    %rax,0x20(%rsp)
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x28(%rsp),%r14
lea    0x1c(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <push@plt>
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <q_push@plt>
lea    0x18(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <push@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <q_push@plt>
lea    0x14(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <push@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <q_push@plt>
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <push@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <q_push@plt>
lea    0xc(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <push@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <q_push@plt>
lea    0xdbf(%rip),%rdi
mov    %r14,%rsi
call   1030 <print_list@plt>
lea    0xdb7(%rip),%rdi
mov    %r15,%rsi
call   1080 <print_list_q@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.DLLHead = type { i32 }
%struct.DLLHead_q = type { i32 }
@.str = [7 x i8] c"main_s\00"
@.str.1 = [7 x i8] c"main_q\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.DLLHead*
%7 = alloca %struct.DLLHead_q*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.DLLHead* null, %struct.DLLHead** %6
store %struct.DLLHead_q* null, %struct.DLLHead_q** %7
%13 = call %struct.DLLHead* (...) @create_new_stack()
store %struct.DLLHead* %13, %struct.DLLHead** %6
%14 = call %struct.DLLHead_q* (...) @create_new_queue()
store %struct.DLLHead_q* %14, %struct.DLLHead_q** %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
%15 = call i32 @push(%struct.DLLHead** %6, i32* %8)
%16 = call i32 @q_push(%struct.DLLHead_q** %7, i32* %8)
%17 = call i32 @push(%struct.DLLHead** %6, i32* %9)
%18 = call i32 @q_push(%struct.DLLHead_q** %7, i32* %9)
%19 = call i32 @push(%struct.DLLHead** %6, i32* %10)
%20 = call i32 @q_push(%struct.DLLHead_q** %7, i32* %10)
%21 = call i32 @push(%struct.DLLHead** %6, i32* %11)
%22 = call i32 @q_push(%struct.DLLHead_q** %7, i32* %11)
%23 = call i32 @push(%struct.DLLHead** %6, i32* %12)
%24 = call i32 @q_push(%struct.DLLHead_q** %7, i32* %12)
%25 = call i32 @print_list(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.DLLHead** %6)
%26 = call i32 @print_list_q(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %struct.DLLHead_q** %7)
ret i32 0
}

LLVM IR (-O2):
%struct.DLLHead = type { i32 }
%struct.DLLHead_q = type { i32 }
@.str = [7 x i8] c"main_s\00"
@.str.1 = [7 x i8] c"main_q\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.DLLHead*
%4 = alloca %struct.DLLHead_q*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = bitcast %struct.DLLHead** %3 to i8*
%11 = bitcast %struct.DLLHead_q** %4 to i8*
%12 = tail call %struct.DLLHead* (...) @create_new_stack()
store %struct.DLLHead* %12, %struct.DLLHead** %3
%13 = tail call %struct.DLLHead_q* (...) @create_new_queue()
store %struct.DLLHead_q* %13, %struct.DLLHead_q** %4
%14 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%15 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%16 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%17 = bitcast i32* %8 to i8*
store i32 0, i32* %8
%18 = bitcast i32* %9 to i8*
store i32 0, i32* %9
%19 = call i32 @push(%struct.DLLHead** %3, i32* %5)
%20 = call i32 @q_push(%struct.DLLHead_q** %4, i32* %5)
%21 = call i32 @push(%struct.DLLHead** %3, i32* %6)
%22 = call i32 @q_push(%struct.DLLHead_q** %4, i32* %6)
%23 = call i32 @push(%struct.DLLHead** %3, i32* %7)
%24 = call i32 @q_push(%struct.DLLHead_q** %4, i32* %7)
%25 = call i32 @push(%struct.DLLHead** %3, i32* %8)
%26 = call i32 @q_push(%struct.DLLHead_q** %4, i32* %8)
%27 = call i32 @push(%struct.DLLHead** %3, i32* %9)
%28 = call i32 @q_push(%struct.DLLHead_q** %4, i32* %9)
%29 = call i32 @print_list(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.DLLHead** %3)
%30 = call i32 @print_list_q(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %struct.DLLHead_q** %4)
ret i32 0
}