#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 node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ append(struct node **, int);
int count(struct node *);
int /*<<< orphan*/ delete (struct node **, int);
int /*<<< orphan*/ display(struct node *);
int /*<<< orphan*/ insert_after(struct node *, int, int);
int /*<<< orphan*/ prepend(struct node **, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  struct node *list;
  list = NULL;
  printf("No of elements in linked list = %d\n", count(list));
  display(list);
  append(&list, 14);
  append(&list, 30);
  append(&list, 25);
  append(&list, 42);
  append(&list, 17);
  printf("No of elements in linked list = %d\n", count(list));
  display(list);
  prepend(&list, 999);
  prepend(&list, 888);
  prepend(&list, 777);
  printf("No of elements in linked list = %d\n", count(list));
  display(list);
  insert_after(list, 1, 0);
  insert_after(list, 2, 1);
  insert_after(list, 5, 99);
  printf("No of elements in linked list = %d\n", count(list));
  display(list);
  insert_after(list, 99, 10);
  printf("No of elements in linked list = %d\n", count(list));
  display(list);
  delete (&list, 99);
  delete (&list, 1);
  printf("No of elements in linked list = %d\n", count(list));
  display(list);
  delete (&list, 10);
  printf("No of elements in linked list = %d\n", count(list));
  display(list);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <count@plt>
mov    %eax,%esi
lea    0xe67(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <display@plt>
lea    -0x10(%rbp),%rdi
mov    $0xe,%esi
call   1040 <append@plt>
lea    -0x10(%rbp),%rdi
mov    $0x1e,%esi
call   1040 <append@plt>
lea    -0x10(%rbp),%rdi
mov    $0x19,%esi
call   1040 <append@plt>
lea    -0x10(%rbp),%rdi
mov    $0x2a,%esi
call   1040 <append@plt>
lea    -0x10(%rbp),%rdi
mov    $0x11,%esi
call   1040 <append@plt>
mov    -0x10(%rbp),%rdi
call   1030 <count@plt>
mov    %eax,%esi
lea    0xe01(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <display@plt>
lea    -0x10(%rbp),%rdi
mov    $0x3e7,%esi
call   1050 <prepend@plt>
lea    -0x10(%rbp),%rdi
mov    $0x378,%esi
call   1050 <prepend@plt>
lea    -0x10(%rbp),%rdi
mov    $0x309,%esi
call   1050 <prepend@plt>
mov    -0x10(%rbp),%rdi
call   1030 <count@plt>
mov    %eax,%esi
lea    0xdb7(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <display@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1090 <insert_after@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1090 <insert_after@plt>
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
mov    $0x63,%edx
call   1090 <insert_after@plt>
mov    -0x10(%rbp),%rdi
call   1030 <count@plt>
mov    %eax,%esi
lea    0xd61(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <display@plt>
mov    -0x10(%rbp),%rdi
mov    $0x63,%esi
mov    $0xa,%edx
call   1090 <insert_after@plt>
mov    -0x10(%rbp),%rdi
call   1030 <count@plt>
mov    %eax,%esi
lea    0xd2e(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <display@plt>
lea    -0x10(%rbp),%rdi
mov    $0x63,%esi
call   1080 <delete@plt>
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1080 <delete@plt>
mov    -0x10(%rbp),%rdi
call   1030 <count@plt>
mov    %eax,%esi
lea    0xcf2(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <display@plt>
lea    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1080 <delete@plt>
mov    -0x10(%rbp),%rdi
call   1030 <count@plt>
mov    %eax,%esi
lea    0xcc4(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <display@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movq   $0x0,(%rsp)
xor    %edi,%edi
call   1030 <count@plt>
lea    0xe76(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1070 <printf@plt>
xor    %edi,%edi
call   1060 <display@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xe,%esi
call   1040 <append@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
call   1040 <append@plt>
mov    %rbx,%rdi
mov    $0x19,%esi
call   1040 <append@plt>
mov    %rbx,%rdi
mov    $0x2a,%esi
call   1040 <append@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1040 <append@plt>
mov    (%rsp),%rdi
call   1030 <count@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1070 <printf@plt>
mov    (%rsp),%rdi
call   1060 <display@plt>
mov    %rbx,%rdi
mov    $0x3e7,%esi
call   1050 <prepend@plt>
mov    %rbx,%rdi
mov    $0x378,%esi
call   1050 <prepend@plt>
mov    %rbx,%rdi
mov    $0x309,%esi
call   1050 <prepend@plt>
mov    (%rsp),%rdi
call   1030 <count@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1070 <printf@plt>
mov    (%rsp),%rdi
call   1060 <display@plt>
mov    (%rsp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1090 <insert_after@plt>
mov    (%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1090 <insert_after@plt>
mov    (%rsp),%rdi
mov    $0x5,%esi
mov    $0x63,%edx
call   1090 <insert_after@plt>
mov    (%rsp),%rdi
call   1030 <count@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1070 <printf@plt>
mov    (%rsp),%rdi
call   1060 <display@plt>
mov    (%rsp),%rdi
mov    $0x63,%esi
mov    $0xa,%edx
call   1090 <insert_after@plt>
mov    (%rsp),%rdi
call   1030 <count@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1070 <printf@plt>
mov    (%rsp),%rdi
call   1060 <display@plt>
mov    %rbx,%rdi
mov    $0x63,%esi
call   1080 <delete@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1080 <delete@plt>
mov    (%rsp),%rdi
call   1030 <count@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1070 <printf@plt>
mov    (%rsp),%rdi
call   1060 <display@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <delete@plt>
mov    (%rsp),%rdi
call   1030 <count@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1070 <printf@plt>
mov    (%rsp),%rdi
call   1060 <display@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [36 x i8] c"No of elements in linked list = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
store i32 0, i32* %1
store %struct.node* null, %struct.node** %2
%3 = load %struct.node*, %struct.node** %2
%4 = call i32 @count(%struct.node* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load %struct.node*, %struct.node** %2
%7 = call i32 @display(%struct.node* %6)
%8 = call i32 @append(%struct.node** %2, i32 14)
%9 = call i32 @append(%struct.node** %2, i32 30)
%10 = call i32 @append(%struct.node** %2, i32 25)
%11 = call i32 @append(%struct.node** %2, i32 42)
%12 = call i32 @append(%struct.node** %2, i32 17)
%13 = load %struct.node*, %struct.node** %2
%14 = call i32 @count(%struct.node* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load %struct.node*, %struct.node** %2
%17 = call i32 @display(%struct.node* %16)
%18 = call i32 @prepend(%struct.node** %2, i32 999)
%19 = call i32 @prepend(%struct.node** %2, i32 888)
%20 = call i32 @prepend(%struct.node** %2, i32 777)
%21 = load %struct.node*, %struct.node** %2
%22 = call i32 @count(%struct.node* %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = load %struct.node*, %struct.node** %2
%25 = call i32 @display(%struct.node* %24)
%26 = load %struct.node*, %struct.node** %2
%27 = call i32 @insert_after(%struct.node* %26, i32 1, i32 0)
%28 = load %struct.node*, %struct.node** %2
%29 = call i32 @insert_after(%struct.node* %28, i32 2, i32 1)
%30 = load %struct.node*, %struct.node** %2
%31 = call i32 @insert_after(%struct.node* %30, i32 5, i32 99)
%32 = load %struct.node*, %struct.node** %2
%33 = call i32 @count(%struct.node* %32)
%34 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = load %struct.node*, %struct.node** %2
%36 = call i32 @display(%struct.node* %35)
%37 = load %struct.node*, %struct.node** %2
%38 = call i32 @insert_after(%struct.node* %37, i32 99, i32 10)
%39 = load %struct.node*, %struct.node** %2
%40 = call i32 @count(%struct.node* %39)
%41 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %40)
%42 = load %struct.node*, %struct.node** %2
%43 = call i32 @display(%struct.node* %42)
%44 = call i32 @delete(%struct.node** %2, i32 99)
%45 = call i32 @delete(%struct.node** %2, i32 1)
%46 = load %struct.node*, %struct.node** %2
%47 = call i32 @count(%struct.node* %46)
%48 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %47)
%49 = load %struct.node*, %struct.node** %2
%50 = call i32 @display(%struct.node* %49)
%51 = call i32 @delete(%struct.node** %2, i32 10)
%52 = load %struct.node*, %struct.node** %2
%53 = call i32 @count(%struct.node* %52)
%54 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %53)
%55 = load %struct.node*, %struct.node** %2
%56 = call i32 @display(%struct.node* %55)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [36 x i8] c"No of elements in linked list = %d\0A\00"
define i32 @main() {
%1 = alloca %struct.node*
%2 = bitcast %struct.node** %1 to i8*
store %struct.node* null, %struct.node** %1
%3 = tail call i32 @count(%struct.node* null)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @display(%struct.node* null)
%6 = call i32 @append(%struct.node** %1, i32 14)
%7 = call i32 @append(%struct.node** %1, i32 30)
%8 = call i32 @append(%struct.node** %1, i32 25)
%9 = call i32 @append(%struct.node** %1, i32 42)
%10 = call i32 @append(%struct.node** %1, i32 17)
%11 = load %struct.node*, %struct.node** %1
%12 = call i32 @count(%struct.node* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load %struct.node*, %struct.node** %1
%15 = call i32 @display(%struct.node* %14)
%16 = call i32 @prepend(%struct.node** %1, i32 999)
%17 = call i32 @prepend(%struct.node** %1, i32 888)
%18 = call i32 @prepend(%struct.node** %1, i32 777)
%19 = load %struct.node*, %struct.node** %1
%20 = call i32 @count(%struct.node* %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load %struct.node*, %struct.node** %1
%23 = call i32 @display(%struct.node* %22)
%24 = load %struct.node*, %struct.node** %1
%25 = call i32 @insert_after(%struct.node* %24, i32 1, i32 0)
%26 = load %struct.node*, %struct.node** %1
%27 = call i32 @insert_after(%struct.node* %26, i32 2, i32 1)
%28 = load %struct.node*, %struct.node** %1
%29 = call i32 @insert_after(%struct.node* %28, i32 5, i32 99)
%30 = load %struct.node*, %struct.node** %1
%31 = call i32 @count(%struct.node* %30)
%32 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %31)
%33 = load %struct.node*, %struct.node** %1
%34 = call i32 @display(%struct.node* %33)
%35 = load %struct.node*, %struct.node** %1
%36 = call i32 @insert_after(%struct.node* %35, i32 99, i32 10)
%37 = load %struct.node*, %struct.node** %1
%38 = call i32 @count(%struct.node* %37)
%39 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %38)
%40 = load %struct.node*, %struct.node** %1
%41 = call i32 @display(%struct.node* %40)
%42 = call i32 @delete(%struct.node** %1, i32 99)
%43 = call i32 @delete(%struct.node** %1, i32 1)
%44 = load %struct.node*, %struct.node** %1
%45 = call i32 @count(%struct.node* %44)
%46 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %45)
%47 = load %struct.node*, %struct.node** %1
%48 = call i32 @display(%struct.node* %47)
%49 = call i32 @delete(%struct.node** %1, i32 10)
%50 = load %struct.node*, %struct.node** %1
%51 = call i32 @count(%struct.node* %50)
%52 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %51)
%53 = load %struct.node*, %struct.node** %1
%54 = call i32 @display(%struct.node* %53)
ret i32 0
}