#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*/ delete (int);
int /*<<< orphan*/ deleteFirst();
int /*<<< orphan*/ deleteLast();
int /*<<< orphan*/ displayBackward();
int /*<<< orphan*/ displayForward();
int /*<<< orphan*/ insertAfter(int, int, int);
int /*<<< orphan*/ insertFirst(int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  insertFirst(1, 10);
  insertFirst(2, 20);
  insertFirst(3, 30);
  insertFirst(4, 1);
  insertFirst(5, 40);
  insertFirst(6, 56);
  printf("\nList (First to Last): ");
  displayForward();
  printf("\n");
  printf("\nList (Last to first): ");
  displayBackward();
  printf("\nList , after deleting first record: ");
  deleteFirst();
  displayForward();
  printf("\nList , after deleting last record: ");
  deleteLast();
  displayForward();
  printf("\nList , insert after key(4) : ");
  insertAfter(4, 7, 13);
  displayForward();
  printf("\nList  , after delete key(4) : ");
  delete (4);
  displayForward();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0xa,%esi
call   1030 <insertFirst@plt>
mov    $0x2,%edi
mov    $0x14,%esi
call   1030 <insertFirst@plt>
mov    $0x3,%edi
mov    $0x1e,%esi
call   1030 <insertFirst@plt>
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <insertFirst@plt>
mov    $0x5,%edi
mov    $0x28,%esi
call   1030 <insertFirst@plt>
mov    $0x6,%edi
mov    $0x38,%esi
call   1030 <insertFirst@plt>
lea    0xe1b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <displayForward@plt>
lea    0xe20(%rip),%rdi
call   1040 <printf@plt>
lea    0xe16(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <displayBackward@plt>
lea    0xe1b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   10a0 <deleteFirst@plt>
mov    $0x0,%al
call   1060 <displayForward@plt>
lea    0xe27(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <deleteLast@plt>
mov    $0x0,%al
call   1060 <displayForward@plt>
lea    0xe32(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
mov    $0x7,%esi
mov    $0xd,%edx
call   1080 <insertAfter@plt>
mov    $0x0,%al
call   1060 <displayForward@plt>
lea    0xe2a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
call   1090 <delete@plt>
mov    $0x0,%al
call   1060 <displayForward@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0xa,%esi
call   1040 <insertFirst@plt>
mov    $0x2,%edi
mov    $0x14,%esi
call   1040 <insertFirst@plt>
mov    $0x3,%edi
mov    $0x1e,%esi
call   1040 <insertFirst@plt>
mov    $0x4,%edi
mov    $0x1,%esi
call   1040 <insertFirst@plt>
mov    $0x5,%edi
mov    $0x28,%esi
call   1040 <insertFirst@plt>
mov    $0x6,%edi
mov    $0x38,%esi
call   1040 <insertFirst@plt>
lea    0xe0e(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <displayForward@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe09(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <displayBackward@plt>
lea    0xe0e(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   10b0 <deleteFirst@plt>
xor    %eax,%eax
call   1070 <displayForward@plt>
lea    0xe1a(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1080 <deleteLast@plt>
xor    %eax,%eax
call   1070 <displayForward@plt>
lea    0xe25(%rip),%rdi
call   1050 <printf@plt>
mov    $0x4,%edi
mov    $0x7,%esi
mov    $0xd,%edx
call   1090 <insertAfter@plt>
xor    %eax,%eax
call   1070 <displayForward@plt>
lea    0xe1d(%rip),%rdi
call   1050 <printf@plt>
mov    $0x4,%edi
call   10a0 <delete@plt>
xor    %eax,%eax
call   1070 <displayForward@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0AList (First to Last): \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [24 x i8] c"\0AList (Last to first): \00"
@.str.3 = [38 x i8] c"\0AList , after deleting first record: \00"
@.str.4 = [37 x i8] c"\0AList , after deleting last record: \00"
@.str.5 = [31 x i8] c"\0AList , insert after key(4) : \00"
@.str.6 = [32 x i8] c"\0AList , after delete key(4) : \00"
define i32 @main() {
%1 = call i32 @insertFirst(i32 1, i32 10)
%2 = call i32 @insertFirst(i32 2, i32 20)
%3 = call i32 @insertFirst(i32 3, i32 30)
%4 = call i32 @insertFirst(i32 4, i32 1)
%5 = call i32 @insertFirst(i32 5, i32 40)
%6 = call i32 @insertFirst(i32 6, i32 56)
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @displayForward()
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (...) @displayBackward()
%12 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (...) @deleteFirst()
%14 = call i32 (...) @displayForward()
%15 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (...) @deleteLast()
%17 = call i32 (...) @displayForward()
%18 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%19 = call i32 @insertAfter(i32 4, i32 7, i32 13)
%20 = call i32 (...) @displayForward()
%21 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
%22 = call i32 @delete(i32 4)
%23 = call i32 (...) @displayForward()
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0AList (First to Last): \00"
@.str.2 = [24 x i8] c"\0AList (Last to first): \00"
@.str.3 = [38 x i8] c"\0AList , after deleting first record: \00"
@.str.4 = [37 x i8] c"\0AList , after deleting last record: \00"
@.str.5 = [31 x i8] c"\0AList , insert after key(4) : \00"
@.str.6 = [32 x i8] c"\0AList , after delete key(4) : \00"
define i32 @main() {
%1 = tail call i32 @insertFirst(i32 1, i32 10)
%2 = tail call i32 @insertFirst(i32 2, i32 20)
%3 = tail call i32 @insertFirst(i32 3, i32 30)
%4 = tail call i32 @insertFirst(i32 4, i32 1)
%5 = tail call i32 @insertFirst(i32 5, i32 40)
%6 = tail call i32 @insertFirst(i32 6, i32 56)
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @displayForward()
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%11 = tail call i32 (...) @displayBackward()
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%13 = tail call i32 (...) @deleteFirst()
%14 = tail call i32 (...) @displayForward()
%15 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%16 = tail call i32 (...) @deleteLast()
%17 = tail call i32 (...) @displayForward()
%18 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%19 = tail call i32 @insertAfter(i32 4, i32 7, i32 13)
%20 = tail call i32 (...) @displayForward()
%21 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
%22 = tail call i32 @delete(i32 4)
%23 = tail call i32 (...) @displayForward()
ret i32 0
}