#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 */
struct node *CreateList(int *, int);
struct node *DeleteNode(struct node *, int);
struct node *InsertAtEnd(struct node *, int);
struct node *InsertAtN(struct node *, int, int);
struct node *InsertInFront(struct node *, int);
int LinkedListLength(struct node *);
int /*<<< orphan*/ PrintList(struct node *);
int /*<<< orphan*/ assert(int);
void test1() {
  int ret;
  int values[] = {1, 3, 5, 7, 9, 23};
  struct node *llist = CreateList(values, 6);
  PrintList(llist);
  llist = InsertInFront(llist, 53);
  llist = InsertAtEnd(llist, 78);
  llist = InsertAtN(llist, 44, 3);
  llist = DeleteNode(llist, 5);
  PrintList(llist);
  ret = LinkedListLength(llist);
  assert(ret == 8);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xe71(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe6e(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe6b(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1080 <CreateList@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <PrintList@plt>
mov    -0x28(%rbp),%rdi
mov    $0x35,%esi
call   10a0 <InsertInFront@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x4e,%esi
call   1050 <InsertAtEnd@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x2c,%esi
mov    $0x3,%edx
call   1040 <InsertAtN@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x5,%esi
call   1090 <DeleteNode@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <PrintList@plt>
mov    -0x28(%rbp),%rdi
call   1060 <LinkedListLength@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
sub    $0x20,%rsp
mov    0xe84(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xe68(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1080 <CreateList@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <PrintList@plt>
mov    %rbx,%rdi
mov    $0x35,%esi
call   10a0 <InsertInFront@plt>
mov    %rax,%rdi
mov    $0x4e,%esi
call   1050 <InsertAtEnd@plt>
mov    %rax,%rdi
mov    $0x2c,%esi
mov    $0x3,%edx
call   1040 <InsertAtN@plt>
mov    %rax,%rdi
mov    $0x5,%esi
call   1090 <DeleteNode@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <PrintList@plt>
mov    %rbx,%rdi
call   1060 <LinkedListLength@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1070 <assert@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@__const.test1.values = [6 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9, i32 23]
define void @test1() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca %struct.node*
%4 = bitcast [6 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%6 = call %struct.node* @CreateList(i32* %5, i32 6)
store %struct.node* %6, %struct.node** %3
%7 = load %struct.node*, %struct.node** %3
%8 = call i32 @PrintList(%struct.node* %7)
%9 = load %struct.node*, %struct.node** %3
%10 = call %struct.node* @InsertInFront(%struct.node* %9, i32 53)
store %struct.node* %10, %struct.node** %3
%11 = load %struct.node*, %struct.node** %3
%12 = call %struct.node* @InsertAtEnd(%struct.node* %11, i32 78)
store %struct.node* %12, %struct.node** %3
%13 = load %struct.node*, %struct.node** %3
%14 = call %struct.node* @InsertAtN(%struct.node* %13, i32 44, i32 3)
store %struct.node* %14, %struct.node** %3
%15 = load %struct.node*, %struct.node** %3
%16 = call %struct.node* @DeleteNode(%struct.node* %15, i32 5)
store %struct.node* %16, %struct.node** %3
%17 = load %struct.node*, %struct.node** %3
%18 = call i32 @PrintList(%struct.node* %17)
%19 = load %struct.node*, %struct.node** %3
%20 = call i32 @LinkedListLength(%struct.node* %19)
store i32 %20, i32* %1
%21 = load i32, i32* %1
%22 = icmp eq i32 %21, 8
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
@__const.test1.values = [6 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9, i32 23]
define void @test1() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call %struct.node* @CreateList(i32* %3, i32 6)
%5 = call i32 @PrintList(%struct.node* %4)
%6 = call %struct.node* @InsertInFront(%struct.node* %4, i32 53)
%7 = call %struct.node* @InsertAtEnd(%struct.node* %6, i32 78)
%8 = call %struct.node* @InsertAtN(%struct.node* %7, i32 44, i32 3)
%9 = call %struct.node* @DeleteNode(%struct.node* %8, i32 5)
%10 = call i32 @PrintList(%struct.node* %9)
%11 = call i32 @LinkedListLength(%struct.node* %9)
%12 = icmp eq i32 %11, 8
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret void
}