#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*/ add1(int);
int /*<<< orphan*/ add2(int);
int /*<<< orphan*/ clear(int);
int /*<<< orphan*/ init(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ search(int);
int /*<<< orphan*/ traversal();
int main() {
  int x, value, val1, val2;
  printf("Enter the first 2 values: \n");
  printf("First Value: ");
  scanf("%d", &val1);
  printf("\nSecond Value: ");
  scanf("%d", &val2);
  init(val1, val2);
  traversal();
  printf("Please insert the values you want to insert at the begining and at "
         "the end: ");
  scanf("%d", &value);
  add1(value);
  scanf("%d", &value);
  add2(value);
  traversal();
  printf(" Please insert the value you want searched from the list: ");
  scanf("%d", &value);
  search(value);
  printf("Now the first element will be removed");
  clear(value);
  traversal();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
lea    0xe83(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1080 <scanf@plt>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
lea    0xe67(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1060 <init@plt>
mov    $0x0,%al
call   1070 <traversal@plt>
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
lea    0xe39(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <add1@plt>
lea    0xe21(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x8(%rbp),%edi
call   10a0 <add2@plt>
mov    $0x0,%al
call   1070 <traversal@plt>
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
lea    0xdf6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <search@plt>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1090 <clear@plt>
mov    $0x0,%al
call   1070 <traversal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xf31(%rip),%rdi
call   1030 <puts@plt>
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
lea    0xe58(%rip),%r14
lea    0x14(%rsp),%rsi
mov    %r14,%rdi
call   1090 <scanf@plt>
lea    0xe47(%rip),%rdi
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1090 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
call   1070 <init@plt>
xor    %eax,%eax
call   1080 <traversal@plt>
lea    0xe2a(%rip),%rdi
call   1040 <printf@plt>
lea    0xc(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    0xc(%rsp),%edi
call   1060 <add1@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    0xc(%rsp),%edi
call   10b0 <add2@plt>
xor    %eax,%eax
call   1080 <traversal@plt>
lea    0xe37(%rip),%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    0xc(%rsp),%edi
call   1050 <search@plt>
lea    0xe52(%rip),%rdi
call   1040 <printf@plt>
mov    0xc(%rsp),%edi
call   10a0 <clear@plt>
xor    %eax,%eax
call   1080 <traversal@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter the first 2 values: \0A\00"
@.str.1 = [14 x i8] c"First Value: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [16 x i8] c"\0ASecond Value: \00"
@.str.4 = [77 x i8] c"Please insert the values you want to insert at the begining and at the end: \00"
@.str.5 = [59 x i8] c" Please insert the value you want searched from the list: \00"
@.str.6 = [38 x i8] c"Now the first element will be removed\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @init(i32 %10, i32 %11)
%13 = call i32 (...) @traversal()
%14 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%16 = load i32, i32* %2
%17 = call i32 @add1(i32 %16)
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%19 = load i32, i32* %2
%20 = call i32 @add2(i32 %19)
%21 = call i32 (...) @traversal()
%22 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%24 = load i32, i32* %2
%25 = call i32 @search(i32 %24)
%26 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%27 = load i32, i32* %2
%28 = call i32 @clear(i32 %27)
%29 = call i32 (...) @traversal()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"First Value: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [16 x i8] c"\0ASecond Value: \00"
@.str.4 = [77 x i8] c"Please insert the values you want to insert at the begining and at the end: \00"
@.str.5 = [59 x i8] c" Please insert the value you want searched from the list: \00"
@.str.6 = [38 x i8] c"Now the first element will be removed\00"
@str = [27 x i8] c"Enter the first 2 values: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 @init(i32 %12, i32 %13)
%15 = call i32 (...) @traversal()
%16 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%18 = load i32, i32* %1
%19 = call i32 @add1(i32 %18)
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%21 = load i32, i32* %1
%22 = call i32 @add2(i32 %21)
%23 = call i32 (...) @traversal()
%24 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0))
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%26 = load i32, i32* %1
%27 = call i32 @search(i32 %26)
%28 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%29 = load i32, i32* %1
%30 = call i32 @clear(i32 %29)
%31 = call i32 (...) @traversal()
ret i32 0
}