#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 */

/* Variables and functions */
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ insert_last(int /*<<< orphan*/);
int /*<<< orphan*/ new_node(int);
int /*<<< orphan*/ print_out_list();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ remove_node(int);
int main() {
  initialize();
  for (int num = 0; num < 10; num++) {
    insert_last(new_node(num));
  }
  print_out_list();
  printf("============================================================\n");
  for (int num = 9; num >= 0; num--) {
    remove_node(num);
    print_out_list();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <initialize@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11a4 <main+0x44>
mov    -0x8(%rbp),%edi
call   1080 <new_node@plt>
mov    %eax,%edi
call   1030 <insert_last@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117d <main+0x1d>
mov    $0x0,%al
call   1060 <print_out_list@plt>
lea    0xe4e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x9,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     11e5 <main+0x85>
mov    -0xc(%rbp),%edi
call   1070 <remove_node@plt>
mov    $0x0,%al
call   1060 <print_out_list@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11be <main+0x5e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <initialize@plt>
xor    %edi,%edi
call   1080 <new_node@plt>
mov    %eax,%edi
call   1040 <insert_last@plt>
mov    $0x1,%edi
call   1080 <new_node@plt>
mov    %eax,%edi
call   1040 <insert_last@plt>
mov    $0x2,%edi
call   1080 <new_node@plt>
mov    %eax,%edi
call   1040 <insert_last@plt>
mov    $0x3,%edi
call   1080 <new_node@plt>
mov    %eax,%edi
call   1040 <insert_last@plt>
mov    $0x4,%edi
call   1080 <new_node@plt>
mov    %eax,%edi
call   1040 <insert_last@plt>
mov    $0x5,%edi
call   1080 <new_node@plt>
mov    %eax,%edi
call   1040 <insert_last@plt>
mov    $0x6,%edi
call   1080 <new_node@plt>
mov    %eax,%edi
call   1040 <insert_last@plt>
mov    $0x7,%edi
call   1080 <new_node@plt>
mov    %eax,%edi
call   1040 <insert_last@plt>
mov    $0x8,%edi
call   1080 <new_node@plt>
mov    %eax,%edi
call   1040 <insert_last@plt>
mov    $0x9,%edi
call   1080 <new_node@plt>
mov    %eax,%edi
call   1040 <insert_last@plt>
xor    %eax,%eax
call   1060 <print_out_list@plt>
lea    0xde3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x9,%edi
call   1070 <remove_node@plt>
xor    %eax,%eax
call   1060 <print_out_list@plt>
mov    $0x8,%edi
call   1070 <remove_node@plt>
xor    %eax,%eax
call   1060 <print_out_list@plt>
mov    $0x7,%edi
call   1070 <remove_node@plt>
xor    %eax,%eax
call   1060 <print_out_list@plt>
mov    $0x6,%edi
call   1070 <remove_node@plt>
xor    %eax,%eax
call   1060 <print_out_list@plt>
mov    $0x5,%edi
call   1070 <remove_node@plt>
xor    %eax,%eax
call   1060 <print_out_list@plt>
mov    $0x4,%edi
call   1070 <remove_node@plt>
xor    %eax,%eax
call   1060 <print_out_list@plt>
mov    $0x3,%edi
call   1070 <remove_node@plt>
xor    %eax,%eax
call   1060 <print_out_list@plt>
mov    $0x2,%edi
call   1070 <remove_node@plt>
xor    %eax,%eax
call   1060 <print_out_list@plt>
mov    $0x1,%edi
call   1070 <remove_node@plt>
xor    %eax,%eax
call   1060 <print_out_list@plt>
xor    %edi,%edi
call   1070 <remove_node@plt>
xor    %eax,%eax
call   1060 <print_out_list@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"============================================================\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @initialize()
store i32 0, i32* %2
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %2
%10 = call i32 @new_node(i32 %9)
%11 = call i32 @insert_last(i32 %10)
br label %12
12: ; preds = %8
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %5
15: ; preds = %5
%16 = call i32 (...) @print_out_list()
%17 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
store i32 9, i32* %3
br label %18
18: ; preds = %25, %15
%19 = load i32, i32* %3
%20 = icmp sge i32 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i32, i32* %3
%23 = call i32 @remove_node(i32 %22)
%24 = call i32 (...) @print_out_list()
br label %25
25: ; preds = %21
%26 = load i32, i32* %3
%27 = add nsw i32 %26, -1
store i32 %27, i32* %3
br label %18
28: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
@str = [61 x i8] c"============================================================\00"
define i32 @main() {
%1 = tail call i32 (...) @initialize()
%2 = tail call i32 @new_node(i32 0)
%3 = tail call i32 @insert_last(i32 %2)
%4 = tail call i32 @new_node(i32 1)
%5 = tail call i32 @insert_last(i32 %4)
%6 = tail call i32 @new_node(i32 2)
%7 = tail call i32 @insert_last(i32 %6)
%8 = tail call i32 @new_node(i32 3)
%9 = tail call i32 @insert_last(i32 %8)
%10 = tail call i32 @new_node(i32 4)
%11 = tail call i32 @insert_last(i32 %10)
%12 = tail call i32 @new_node(i32 5)
%13 = tail call i32 @insert_last(i32 %12)
%14 = tail call i32 @new_node(i32 6)
%15 = tail call i32 @insert_last(i32 %14)
%16 = tail call i32 @new_node(i32 7)
%17 = tail call i32 @insert_last(i32 %16)
%18 = tail call i32 @new_node(i32 8)
%19 = tail call i32 @insert_last(i32 %18)
%20 = tail call i32 @new_node(i32 9)
%21 = tail call i32 @insert_last(i32 %20)
%22 = tail call i32 (...) @print_out_list()
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%24 = tail call i32 @remove_node(i32 9)
%25 = tail call i32 (...) @print_out_list()
%26 = tail call i32 @remove_node(i32 8)
%27 = tail call i32 (...) @print_out_list()
%28 = tail call i32 @remove_node(i32 7)
%29 = tail call i32 (...) @print_out_list()
%30 = tail call i32 @remove_node(i32 6)
%31 = tail call i32 (...) @print_out_list()
%32 = tail call i32 @remove_node(i32 5)
%33 = tail call i32 (...) @print_out_list()
%34 = tail call i32 @remove_node(i32 4)
%35 = tail call i32 (...) @print_out_list()
%36 = tail call i32 @remove_node(i32 3)
%37 = tail call i32 (...) @print_out_list()
%38 = tail call i32 @remove_node(i32 2)
%39 = tail call i32 (...) @print_out_list()
%40 = tail call i32 @remove_node(i32 1)
%41 = tail call i32 (...) @print_out_list()
%42 = tail call i32 @remove_node(i32 0)
%43 = tail call i32 (...) @print_out_list()
ret i32 0
}