#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);
int /*<<< orphan*/ PrintList(struct node *);
void test4() {
  int values[] = {1, 3, 5, 7, 9, 23};
  struct node *llist = CreateList(values, 6);
  llist = DeleteNode(llist, -1);
  llist = DeleteNode(llist, 0);
  llist = DeleteNode(llist, 9);
  llist = DeleteNode(llist, 1);
  llist = DeleteNode(llist, 5);
  llist = DeleteNode(llist, 3);
  PrintList(llist);
  DeleteNode(NULL, 0);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1040 <CreateList@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0xffffffff,%esi
call   1050 <DeleteNode@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
call   1050 <DeleteNode@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x9,%esi
call   1050 <DeleteNode@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
call   1050 <DeleteNode@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x5,%esi
call   1050 <DeleteNode@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x3,%esi
call   1050 <DeleteNode@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <PrintList@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1050 <DeleteNode@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
sub    $0x18,%rsp
mov    0xed5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1040 <CreateList@plt>
mov    %rax,%rdi
mov    $0xffffffff,%esi
call   1050 <DeleteNode@plt>
mov    %rax,%rdi
xor    %esi,%esi
call   1050 <DeleteNode@plt>
mov    %rax,%rdi
mov    $0x9,%esi
call   1050 <DeleteNode@plt>
mov    %rax,%rdi
mov    $0x1,%esi
call   1050 <DeleteNode@plt>
mov    %rax,%rdi
mov    $0x5,%esi
call   1050 <DeleteNode@plt>
mov    %rax,%rdi
mov    $0x3,%esi
call   1050 <DeleteNode@plt>
mov    %rax,%rdi
call   1030 <PrintList@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <DeleteNode@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@__const.test4.values = [6 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9, i32 23]
define void @test4() {
%1 = alloca [6 x i32]
%2 = alloca %struct.node*
%3 = bitcast [6 x i32]* %1 to i8*
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%5 = call %struct.node* @CreateList(i32* %4, i32 6)
store %struct.node* %5, %struct.node** %2
%6 = load %struct.node*, %struct.node** %2
%7 = call %struct.node* @DeleteNode(%struct.node* %6, i32 -1)
store %struct.node* %7, %struct.node** %2
%8 = load %struct.node*, %struct.node** %2
%9 = call %struct.node* @DeleteNode(%struct.node* %8, i32 0)
store %struct.node* %9, %struct.node** %2
%10 = load %struct.node*, %struct.node** %2
%11 = call %struct.node* @DeleteNode(%struct.node* %10, i32 9)
store %struct.node* %11, %struct.node** %2
%12 = load %struct.node*, %struct.node** %2
%13 = call %struct.node* @DeleteNode(%struct.node* %12, i32 1)
store %struct.node* %13, %struct.node** %2
%14 = load %struct.node*, %struct.node** %2
%15 = call %struct.node* @DeleteNode(%struct.node* %14, i32 5)
store %struct.node* %15, %struct.node** %2
%16 = load %struct.node*, %struct.node** %2
%17 = call %struct.node* @DeleteNode(%struct.node* %16, i32 3)
store %struct.node* %17, %struct.node** %2
%18 = load %struct.node*, %struct.node** %2
%19 = call i32 @PrintList(%struct.node* %18)
%20 = call %struct.node* @DeleteNode(%struct.node* null, i32 0)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
@__const.test4.values = [6 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9, i32 23]
define void @test4() {
%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 %struct.node* @DeleteNode(%struct.node* %4, i32 -1)
%6 = call %struct.node* @DeleteNode(%struct.node* %5, i32 0)
%7 = call %struct.node* @DeleteNode(%struct.node* %6, i32 9)
%8 = call %struct.node* @DeleteNode(%struct.node* %7, i32 1)
%9 = call %struct.node* @DeleteNode(%struct.node* %8, i32 5)
%10 = call %struct.node* @DeleteNode(%struct.node* %9, i32 3)
%11 = call i32 @PrintList(%struct.node* %10)
%12 = call %struct.node* @DeleteNode(%struct.node* null, i32 0)
ret void
}