// File: /workspace/github_c_makefile_star2_O0/hikalium[P]compilium/compilium.c
// Function: TestList
void TestList() {
  fprintf(stderr, "Testing List...");

  struct Node *list = AllocList();
  struct Node *item1 = AllocNode(kNodeNone);
  struct Node *item2 = AllocNode(kNodeNone);
  assert(list);

  PushToList(list, item1);
  assert(GetSizeOfList(list) == 1);
  PushToList(list, item2);
  assert(GetSizeOfList(list) == 2);

  assert(GetNodeAt(list, 0) == item1);
  assert(GetNodeAt(list, 1) == item2);

  int base_capacity = list->capacity;
  while (GetSizeOfList(list) <= base_capacity) {
    PushToList(list, item1);
  }
  assert(list->capacity > base_capacity);
  assert(GetNodeAt(list, 0) == item1);
  assert(GetNodeAt(list, 1) == item2);
  assert(GetNodeAt(list, GetSizeOfList(list) - 1) == item1);

  PushKeyValueToList(list, "item1", item1);
  PushKeyValueToList(list, "item2", item2);
  assert(GetNodeByKey(list, "item1") == item1);
  assert(GetNodeByKey(list, "item2") == item2);
  assert(GetNodeByKey(list, "not_existed") == NULL);

  fprintf(stderr, "PASS\n");
  exit(EXIT_SUCCESS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq 0xfdb9(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
leaq 0xb3be(%rip), %rsi      # 0x10607
movb $0x0, %al
callq 0x2100
callq 0x4e30
movq %rax, -0x8(%rbp)
xorl %edi, %edi
callq 0x3a70
movq %rax, -0x10(%rbp)
xorl %edi, %edi
callq 0x3a70
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x528e
leaq 0xbf85(%rip), %rdi      # 0x11202
leaq 0xb2f8(%rip), %rsi      # 0x1057c
movl $0xa3, %edx
callq 0x4b20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4f10
movq -0x8(%rbp), %rdi
callq 0x4fe0
cmpl $0x1, %eax
je 0x52c1
leaq 0xb367(%rip), %rdi      # 0x10617
leaq 0xb2c5(%rip), %rsi      # 0x1057c
movl $0xa6, %edx
callq 0x4b20
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4f10
movq -0x8(%rbp), %rdi
callq 0x4fe0
cmpl $0x2, %eax
je 0x52f4
leaq 0xb34d(%rip), %rdi      # 0x10630
leaq 0xb292(%rip), %rsi      # 0x1057c
movl $0xa8, %edx
callq 0x4b20
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x5030
cmpq -0x10(%rbp), %rax
je 0x531d
leaq 0xb33d(%rip), %rdi      # 0x10649
leaq 0xb269(%rip), %rsi      # 0x1057c
movl $0xaa, %edx
callq 0x4b20
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x5030
cmpq -0x18(%rbp), %rax
je 0x5349
leaq 0xb32d(%rip), %rdi      # 0x10665
leaq 0xb23d(%rip), %rsi      # 0x1057c
movl $0xab, %edx
callq 0x4b20
movq -0x8(%rbp), %rax
movl 0x84(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4fe0
cmpl -0x1c(%rbp), %eax
jg 0x5373
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4f10
jmp 0x5356
movq -0x8(%rbp), %rax
movl 0x84(%rax), %eax
cmpl -0x1c(%rbp), %eax
jg 0x539a
leaq 0xb2f8(%rip), %rdi      # 0x10681
leaq 0xb1ec(%rip), %rsi      # 0x1057c
movl $0xb1, %edx
callq 0x4b20
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x5030
cmpq -0x10(%rbp), %rax
je 0x53c3
leaq 0xb297(%rip), %rdi      # 0x10649
leaq 0xb1c3(%rip), %rsi      # 0x1057c
movl $0xb2, %edx
callq 0x4b20
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x5030
cmpq -0x18(%rbp), %rax
je 0x53ef
leaq 0xb287(%rip), %rdi      # 0x10665
leaq 0xb197(%rip), %rsi      # 0x1057c
movl $0xb3, %edx
callq 0x4b20
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4fe0
movq -0x28(%rbp), %rdi
movl %eax, %esi
subl $0x1, %esi
callq 0x5030
cmpq -0x10(%rbp), %rax
je 0x542c
leaq 0xb285(%rip), %rdi      # 0x106a0
leaq 0xb15a(%rip), %rsi      # 0x1057c
movl $0xb4, %edx
callq 0x4b20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0xb2b6(%rip), %rsi      # 0x106f1
callq 0x4f60
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0xb2c7(%rip), %rsi      # 0x10716
callq 0x4f60
movq -0x8(%rbp), %rdi
leaq 0xb292(%rip), %rsi      # 0x106f1
callq 0x5170
cmpq -0x10(%rbp), %rax
je 0x5482
leaq 0xb261(%rip), %rdi      # 0x106d2
leaq 0xb104(%rip), %rsi      # 0x1057c
movl $0xb8, %edx
callq 0x4b20
movq -0x8(%rbp), %rdi
leaq 0xb289(%rip), %rsi      # 0x10716
callq 0x5170
cmpq -0x18(%rbp), %rax
je 0x54b0
leaq 0xb258(%rip), %rdi      # 0x106f7
leaq 0xb0d6(%rip), %rsi      # 0x1057c
movl $0xb9, %edx
callq 0x4b20
movq -0x8(%rbp), %rdi
leaq 0xb261(%rip), %rsi      # 0x1071c
callq 0x5170
cmpq $0x0, %rax
je 0x54de
leaq 0xb25b(%rip), %rdi      # 0x10728
leaq 0xb0a8(%rip), %rsi      # 0x1057c
movl $0xba, %edx
callq 0x4b20
movq 0xfb13(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
leaq 0xb263(%rip), %rsi      # 0x10752
movb $0x0, %al
callq 0x2100
xorl %edi, %edi
callq 0x2190
nopl (%rax)