// File: narula[P]skiplists/skiplist.cc
// Function: SkipList::pretty_print_skiplist()
void SkipList::pretty_print_skiplist() {
  node* ptr = head;
  while (ptr != 0) {
	if (ptr != head) {
	  for (int i = 0; i < ptr->topLevel; i++) {
		printf("   V   ");
	  }
	  for (int i = ptr->topLevel; i < max_level; i++) {
		printf("   |   ");
	  }
	}
	printf("\n");
	if (ptr == tail) {
	  for (int i = 0; i < max_level; i++) {
		printf("[K:ND] ");
	  }
	  printf("\n");
	  return;
	}
	for (int i = 0; i < ptr->topLevel; i++) {
	  printf("[K:%02d] ", ptr->key);
	}
	for (int i = ptr->topLevel; i < max_level; i++) {
	  printf("   |   ");
	}
	printf("\n");
	for (int i = 0; i < ptr->topLevel; i++) {
	  if (ptr->nn(i)->prefix == INT_MAX) {
		printf("[P:ND] ");
	  } else {
		printf("[P:%02d] ", ptr->nn(i)->prefix);
	  }
	}
	for (int i = ptr->topLevel; i < max_level; i++) {
	  printf("   |   ");
	}
	printf("\n");
	for (int i = 0; i < max_level; i++) {
	  printf("   |   ");
	}
	printf ("\n");
	ptr = ptr->nn(0)->nxt;
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq (%rax), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x1c58
movq (%rsp), %rcx
movq 0x28(%rsp), %rax
cmpq (%rcx), %rax
je 0x1a7b
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
movq 0x28(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x1a45
leaq 0x165f(%rip), %rdi      # 0x3090
movb $0x0, %al
callq 0x1030
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x1a1c
movq 0x28(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x20(%rsp)
movq (%rsp), %rcx
movl 0x20(%rsp), %eax
cmpl 0x14(%rcx), %eax
jge 0x1a79
leaq 0x1633(%rip), %rdi      # 0x3098
movb $0x0, %al
callq 0x1030
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x1a51
jmp 0x1a7b
leaq 0x16d3(%rip), %rdi      # 0x3155
movb $0x0, %al
callq 0x1030
movq (%rsp), %rcx
movq 0x28(%rsp), %rax
cmpq 0x8(%rcx), %rax
jne 0x1adb
movl $0x0, 0x1c(%rsp)
movq (%rsp), %rcx
movl 0x1c(%rsp), %eax
cmpl 0x14(%rcx), %eax
jge 0x1ac8
leaq 0x15ec(%rip), %rdi      # 0x30a0
movb $0x0, %al
callq 0x1030
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x1aa0
leaq 0x1686(%rip), %rdi      # 0x3155
movb $0x0, %al
callq 0x1030
jmp 0x1c58
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
movq 0x28(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x1b13
movq 0x28(%rsp), %rax
movl (%rax), %esi
leaq 0x15a9(%rip), %rdi      # 0x30a8
movb $0x0, %al
callq 0x1030
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x1ae3
movq 0x28(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x14(%rsp)
movq (%rsp), %rcx
movl 0x14(%rsp), %eax
cmpl 0x14(%rcx), %eax
jge 0x1b47
leaq 0x1565(%rip), %rdi      # 0x3098
movb $0x0, %al
callq 0x1030
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x1b1f
leaq 0x1607(%rip), %rdi      # 0x3155
movb $0x0, %al
callq 0x1030
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
movq 0x28(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x1bbe
movq 0x28(%rsp), %rdi
movl 0x10(%rsp), %esi
callq 0x2380
cmpl $0x7fffffff, (%rax)     # imm = 0x7FFFFFFF
jne 0x1b91
leaq 0x152a(%rip), %rdi      # 0x30b2
movb $0x0, %al
callq 0x1030
jmp 0x1baf
movq 0x28(%rsp), %rdi
movl 0x10(%rsp), %esi
callq 0x2380
movl (%rax), %esi
leaq 0x1512(%rip), %rdi      # 0x30ba
movb $0x0, %al
callq 0x1030
jmp 0x1bb1
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x1b5d
movq 0x28(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0xc(%rsp)
movq (%rsp), %rcx
movl 0xc(%rsp), %eax
cmpl 0x14(%rcx), %eax
jge 0x1bf2
leaq 0x14ba(%rip), %rdi      # 0x3098
movb $0x0, %al
callq 0x1030
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x1bca
leaq 0x155c(%rip), %rdi      # 0x3155
movb $0x0, %al
callq 0x1030
movl $0x0, 0x8(%rsp)
movq (%rsp), %rcx
movl 0x8(%rsp), %eax
cmpl 0x14(%rcx), %eax
jge 0x1c30
leaq 0x147c(%rip), %rdi      # 0x3098
movb $0x0, %al
callq 0x1030
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x1c08
leaq 0x151e(%rip), %rdi      # 0x3155
movb $0x0, %al
callq 0x1030
movq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0x2380
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
jmp 0x19fa
addq $0x38, %rsp
retq
nopl (%rax)