#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*/ addInBeginning(int, struct node **);
int /*<<< orphan*/ display(struct node **);
int /*<<< orphan*/ initList(struct node **);
int /*<<< orphan*/ insert(int, struct node **);
int /*<<< orphan*/ insertAtPosition(int, int, struct node **);
int main() {
  struct node *p;
  initList(&p);
  insert(1, &p);
  insert(2, &p);
  insert(3, &p);
  insert(4, &p);
  insert(5, &p);
  insert(6, &p);
  insert(7, &p);
  insert(8, &p);
  addInBeginning(-1, &p);
  insertAtPosition(5, 100, &p);
  insertAtPosition(500, 100, &p);
  display(&p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
call   1070 <initList@plt>
mov    $0x1,%edi
lea    -0x10(%rbp),%rsi
call   1060 <insert@plt>
mov    $0x2,%edi
lea    -0x10(%rbp),%rsi
call   1060 <insert@plt>
mov    $0x3,%edi
lea    -0x10(%rbp),%rsi
call   1060 <insert@plt>
mov    $0x4,%edi
lea    -0x10(%rbp),%rsi
call   1060 <insert@plt>
mov    $0x5,%edi
lea    -0x10(%rbp),%rsi
call   1060 <insert@plt>
mov    $0x6,%edi
lea    -0x10(%rbp),%rsi
call   1060 <insert@plt>
mov    $0x7,%edi
lea    -0x10(%rbp),%rsi
call   1060 <insert@plt>
mov    $0x8,%edi
lea    -0x10(%rbp),%rsi
call   1060 <insert@plt>
mov    $0xffffffff,%edi
lea    -0x10(%rbp),%rsi
call   1040 <addInBeginning@plt>
mov    $0x5,%edi
mov    $0x64,%esi
lea    -0x10(%rbp),%rdx
call   1050 <insertAtPosition@plt>
mov    $0x1f4,%edi
mov    $0x64,%esi
lea    -0x10(%rbp),%rdx
call   1050 <insertAtPosition@plt>
lea    -0x10(%rbp),%rdi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <initList@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1060 <insert@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1060 <insert@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
call   1060 <insert@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
call   1060 <insert@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1060 <insert@plt>
mov    $0x6,%edi
mov    %rbx,%rsi
call   1060 <insert@plt>
mov    $0x7,%edi
mov    %rbx,%rsi
call   1060 <insert@plt>
mov    $0x8,%edi
mov    %rbx,%rsi
call   1060 <insert@plt>
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1040 <addInBeginning@plt>
mov    $0x5,%edi
mov    $0x64,%esi
mov    %rbx,%rdx
call   1050 <insertAtPosition@plt>
mov    $0x1f4,%edi
mov    $0x64,%esi
mov    %rbx,%rdx
call   1050 <insertAtPosition@plt>
mov    %rbx,%rdi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
store i32 0, i32* %1
%3 = call i32 @initList(%struct.node** %2)
%4 = call i32 @insert(i32 1, %struct.node** %2)
%5 = call i32 @insert(i32 2, %struct.node** %2)
%6 = call i32 @insert(i32 3, %struct.node** %2)
%7 = call i32 @insert(i32 4, %struct.node** %2)
%8 = call i32 @insert(i32 5, %struct.node** %2)
%9 = call i32 @insert(i32 6, %struct.node** %2)
%10 = call i32 @insert(i32 7, %struct.node** %2)
%11 = call i32 @insert(i32 8, %struct.node** %2)
%12 = call i32 @addInBeginning(i32 -1, %struct.node** %2)
%13 = call i32 @insertAtPosition(i32 5, i32 100, %struct.node** %2)
%14 = call i32 @insertAtPosition(i32 500, i32 100, %struct.node** %2)
%15 = call i32 @display(%struct.node** %2)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca %struct.node*
%2 = bitcast %struct.node** %1 to i8*
%3 = call i32 @initList(%struct.node** %1)
%4 = call i32 @insert(i32 1, %struct.node** %1)
%5 = call i32 @insert(i32 2, %struct.node** %1)
%6 = call i32 @insert(i32 3, %struct.node** %1)
%7 = call i32 @insert(i32 4, %struct.node** %1)
%8 = call i32 @insert(i32 5, %struct.node** %1)
%9 = call i32 @insert(i32 6, %struct.node** %1)
%10 = call i32 @insert(i32 7, %struct.node** %1)
%11 = call i32 @insert(i32 8, %struct.node** %1)
%12 = call i32 @addInBeginning(i32 -1, %struct.node** %1)
%13 = call i32 @insertAtPosition(i32 5, i32 100, %struct.node** %1)
%14 = call i32 @insertAtPosition(i32 500, i32 100, %struct.node** %1)
%15 = call i32 @display(%struct.node** %1)
ret i32 0
}