#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*/ fin(int);
int /*<<< orphan*/ init();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rem(int);
int /*<<< orphan*/ sor();
int /*<<< orphan*/ travers();
int main() {
  init();
  addfirst(3);
  addlast(8);
  addfirst(6);
  addlast(1);
  travers();
  fin(8);
  rem(5);
  rem(2);
  printf("\nnoua lista este:\n");
  travers();
  printf("\n lista sortata:\n");
  sor();
  travers();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <init@plt>
mov    $0x3,%edi
call   1030 <addfirst@plt>
mov    $0x8,%edi
call   1040 <addlast@plt>
mov    $0x6,%edi
call   1030 <addfirst@plt>
mov    $0x1,%edi
call   1040 <addlast@plt>
mov    $0x0,%al
call   1070 <travers@plt>
mov    $0x8,%edi
call   10a0 <fin@plt>
mov    $0x5,%edi
call   1080 <rem@plt>
mov    $0x2,%edi
call   1080 <rem@plt>
lea    0xe16(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <travers@plt>
lea    0xe16(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1090 <sor@plt>
mov    $0x0,%al
call   1070 <travers@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <init@plt>
mov    $0x3,%edi
call   1030 <addfirst@plt>
mov    $0x8,%edi
call   1050 <addlast@plt>
mov    $0x6,%edi
call   1030 <addfirst@plt>
mov    $0x1,%edi
call   1050 <addlast@plt>
xor    %eax,%eax
call   1070 <travers@plt>
mov    $0x8,%edi
call   10a0 <fin@plt>
mov    $0x5,%edi
call   1080 <rem@plt>
mov    $0x2,%edi
call   1080 <rem@plt>
lea    0xe24(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <travers@plt>
lea    0xe23(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1090 <sor@plt>
xor    %eax,%eax
call   1070 <travers@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0Anoua lista este:\0A\00"
@.str.1 = [18 x i8] c"\0A lista sortata:\0A\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 @addfirst(i32 6)
%6 = call i32 @addlast(i32 1)
%7 = call i32 (...) @travers()
%8 = call i32 @fin(i32 8)
%9 = call i32 @rem(i32 5)
%10 = call i32 @rem(i32 2)
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (...) @travers()
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (...) @sor()
%15 = call i32 (...) @travers()
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"\0Anoua lista este:\00"
@str.2 = [17 x i8] c"\0A lista sortata:\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 @addfirst(i32 6)
%5 = tail call i32 @addlast(i32 1)
%6 = tail call i32 (...) @travers()
%7 = tail call i32 @fin(i32 8)
%8 = tail call i32 @rem(i32 5)
%9 = tail call i32 @rem(i32 2)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 (...) @travers()
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
%13 = tail call i32 (...) @sor()
%14 = tail call i32 (...) @travers()
ret i32 0
}