#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*/ addfirst(int);
int /*<<< orphan*/ addlast(int);
int /*<<< orphan*/ init();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rmov(int);
int /*<<< orphan*/ search(int);
int /*<<< orphan*/ sortin();
int /*<<< orphan*/ traversal();
int main() {
  init();
  addfirst(3);
  addlast(8);
  traversal();
  search(8);
  rmov(6);
  printf("\nnew list is:");
  traversal();
  printf("\nsorted list:");
  sortin();
  traversal();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1090 <init@plt>
mov    $0x3,%edi
call   1030 <addfirst@plt>
mov    $0x8,%edi
call   1060 <addlast@plt>
mov    $0x0,%al
call   10a0 <traversal@plt>
mov    $0x8,%edi
call   1080 <search@plt>
mov    $0x6,%edi
call   1040 <rmov@plt>
lea    0xe34(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   10a0 <traversal@plt>
lea    0xe2f(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1050 <sortin@plt>
mov    $0x0,%al
call   10a0 <traversal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1090 <init@plt>
mov    $0x3,%edi
call   1030 <addfirst@plt>
mov    $0x8,%edi
call   1060 <addlast@plt>
xor    %eax,%eax
call   10a0 <traversal@plt>
mov    $0x8,%edi
call   1080 <search@plt>
mov    $0x6,%edi
call   1040 <rmov@plt>
lea    0xe42(%rip),%rdi
call   1070 <printf@plt>
xor    %eax,%eax
call   10a0 <traversal@plt>
lea    0xe3d(%rip),%rdi
call   1070 <printf@plt>
xor    %eax,%eax
call   1050 <sortin@plt>
xor    %eax,%eax
call   10a0 <traversal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\0Anew list is:\00"
@.str.1 = [14 x i8] c"\0Asorted list:\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init()
%3 = call i32 @addfirst(i32 3)
%4 = call i32 @addlast(i32 8)
%5 = call i32 (...) @traversal()
%6 = call i32 @search(i32 8)
%7 = call i32 @rmov(i32 6)
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @traversal()
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (...) @sortin()
%12 = call i32 (...) @traversal()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0Anew list is:\00"
@.str.1 = [14 x i8] c"\0Asorted list:\00"
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 @addfirst(i32 3)
%3 = tail call i32 @addlast(i32 8)
%4 = tail call i32 (...) @traversal()
%5 = tail call i32 @search(i32 8)
%6 = tail call i32 @rmov(i32 6)
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @traversal()
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 (...) @sortin()
%11 = tail call i32 (...) @traversal()
ret i32 0
}