#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*/ list_add_tail(struct node *, int);
int /*<<< orphan*/ list_del_node(struct node *, int);
int /*<<< orphan*/ list_del_node_at_pos(struct node *, int);
struct node *list_get_node(int);
int /*<<< orphan*/ list_print_all(struct node *);
int main() {
  struct node *head = NULL;
  int ret = 0;
  head = list_get_node(9);
  list_add_tail(head, 5);
  list_add_tail(head, 7);
  list_add_tail(head, 8);
  list_add_tail(head, 9);
  list_add_tail(head, 3);
  list_print_all(head);
  list_del_node_at_pos(head, 2);
  list_print_all(head);
  list_del_node(head, 9);
  list_del_node(head, 5);
  list_del_node(head, 7);
  list_print_all(head);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x9,%edi
call   1040 <list_get_node@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1070 <list_add_tail@plt>
mov    -0x10(%rbp),%rdi
mov    $0x7,%esi
call   1070 <list_add_tail@plt>
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1070 <list_add_tail@plt>
mov    -0x10(%rbp),%rdi
mov    $0x9,%esi
call   1070 <list_add_tail@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1070 <list_add_tail@plt>
mov    -0x10(%rbp),%rdi
call   1050 <list_print_all@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1030 <list_del_node_at_pos@plt>
mov    -0x10(%rbp),%rdi
call   1050 <list_print_all@plt>
mov    -0x10(%rbp),%rdi
mov    $0x9,%esi
call   1060 <list_del_node@plt>
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1060 <list_del_node@plt>
mov    -0x10(%rbp),%rdi
mov    $0x7,%esi
call   1060 <list_del_node@plt>
mov    -0x10(%rbp),%rdi
call   1050 <list_print_all@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x9,%edi
call   1040 <list_get_node@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x5,%esi
call   1070 <list_add_tail@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1070 <list_add_tail@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1070 <list_add_tail@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1070 <list_add_tail@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <list_add_tail@plt>
mov    %rbx,%rdi
call   1050 <list_print_all@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <list_del_node_at_pos@plt>
mov    %rbx,%rdi
call   1050 <list_print_all@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1060 <list_del_node@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1060 <list_del_node@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1060 <list_del_node@plt>
mov    %rbx,%rdi
call   1050 <list_print_all@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
%3 = alloca i32
store i32 0, i32* %1
store %struct.node* null, %struct.node** %2
store i32 0, i32* %3
%4 = call %struct.node* @list_get_node(i32 9)
store %struct.node* %4, %struct.node** %2
%5 = load %struct.node*, %struct.node** %2
%6 = call i32 @list_add_tail(%struct.node* %5, i32 5)
%7 = load %struct.node*, %struct.node** %2
%8 = call i32 @list_add_tail(%struct.node* %7, i32 7)
%9 = load %struct.node*, %struct.node** %2
%10 = call i32 @list_add_tail(%struct.node* %9, i32 8)
%11 = load %struct.node*, %struct.node** %2
%12 = call i32 @list_add_tail(%struct.node* %11, i32 9)
%13 = load %struct.node*, %struct.node** %2
%14 = call i32 @list_add_tail(%struct.node* %13, i32 3)
%15 = load %struct.node*, %struct.node** %2
%16 = call i32 @list_print_all(%struct.node* %15)
%17 = load %struct.node*, %struct.node** %2
%18 = call i32 @list_del_node_at_pos(%struct.node* %17, i32 2)
%19 = load %struct.node*, %struct.node** %2
%20 = call i32 @list_print_all(%struct.node* %19)
%21 = load %struct.node*, %struct.node** %2
%22 = call i32 @list_del_node(%struct.node* %21, i32 9)
%23 = load %struct.node*, %struct.node** %2
%24 = call i32 @list_del_node(%struct.node* %23, i32 5)
%25 = load %struct.node*, %struct.node** %2
%26 = call i32 @list_del_node(%struct.node* %25, i32 7)
%27 = load %struct.node*, %struct.node** %2
%28 = call i32 @list_print_all(%struct.node* %27)
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = tail call %struct.node* @list_get_node(i32 9)
%2 = tail call i32 @list_add_tail(%struct.node* %1, i32 5)
%3 = tail call i32 @list_add_tail(%struct.node* %1, i32 7)
%4 = tail call i32 @list_add_tail(%struct.node* %1, i32 8)
%5 = tail call i32 @list_add_tail(%struct.node* %1, i32 9)
%6 = tail call i32 @list_add_tail(%struct.node* %1, i32 3)
%7 = tail call i32 @list_print_all(%struct.node* %1)
%8 = tail call i32 @list_del_node_at_pos(%struct.node* %1, i32 2)
%9 = tail call i32 @list_print_all(%struct.node* %1)
%10 = tail call i32 @list_del_node(%struct.node* %1, i32 9)
%11 = tail call i32 @list_del_node(%struct.node* %1, i32 5)
%12 = tail call i32 @list_del_node(%struct.node* %1, i32 7)
%13 = tail call i32 @list_print_all(%struct.node* %1)
ret i32 0
}