// File: bhhbazinga[P]LockFreeHashTable/./lockfree_hashtable.h
// Function: LockFreeHashTable<int, int, std::hash<int>>::LockFreeHashTable()
LockFreeHashTable() : power_of_2_(1), size_(0), hash_func_(Hash()) {
    // Initialize first bucket
    int level = 1;
    Segment* segments = segments_;  // Point to current segment.
    while (level++ <= kMaxLevel - 2) {
      Segment* sub_segments = NewSegments(level);
      segments[0].data.store(sub_segments, std::memory_order_release);
      segments = sub_segments;
    }

    Bucket* buckets = NewBuckets();
    segments[0].data.store(buckets, std::memory_order_release);

    DummyNode* head = new DummyNode(0);
    buckets[0].store(head, std::memory_order_release);
    head_ = head;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x58(%rbp)
movl $0x1, %esi
callq 0x8c90
movq -0x58(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8c90
movq -0x58(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x50(%rbp)
movq %rax, %rcx
addq $0x400, %rcx            # imm = 0x400
movq %rcx, -0x48(%rbp)
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0x8cc0
jmp 0x4b8f
movq -0x48(%rbp), %rcx
movq -0x60(%rbp), %rax
addq $0x10, %rax
cmpq %rcx, %rax
movq %rax, -0x40(%rbp)
jne 0x4b80
movq -0x58(%rbp), %rax
movl $0x1, -0x18(%rbp)
addq $0x18, %rax
movq %rax, -0x20(%rbp)
movl -0x18(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x18(%rbp)
cmpl $0x2, %eax
jg 0x4c58
movq -0x58(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x8dd0
movq %rax, -0x68(%rbp)
jmp 0x4bdd
movq -0x68(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
movq -0x28(%rbp), %rsi
movl $0x3, %edx
callq 0x41b0
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x4bb7
movq -0x50(%rbp), %rcx
movq %rax, %rsi
movq -0x60(%rbp), %rax
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpq %rax, %rcx
movq %rax, -0x70(%rbp)
je 0x4c42
movq -0x70(%rbp), %rdi
addq $-0x10, %rdi
movq %rdi, -0x78(%rbp)
callq 0x8cf0
movq -0x50(%rbp), %rcx
movq -0x78(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x70(%rbp)
jne 0x4c20
jmp 0x4d3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
jmp 0x4cfc
movq -0x58(%rbp), %rdi
callq 0x8ef0
movq %rax, -0x80(%rbp)
jmp 0x4c67
movq -0x80(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
movq -0x30(%rbp), %rsi
movl $0x3, %edx
callq 0x41b0
movl $0x20, %edi
callq 0x2140
movq %rax, -0x88(%rbp)
jmp 0x4c98
movq -0x88(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8f50
jmp 0x4caa
movq -0x88(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x3, %edx
callq 0x8f90
movq -0x58(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, 0x418(%rax)
addq $0xa0, %rsp
popq %rbp
retq
movq -0x88(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x20, %esi
callq 0x2150
movq -0x50(%rbp), %rax
addq $0x400, %rax            # imm = 0x400
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rdi
addq $-0x10, %rdi
movq %rdi, -0x98(%rbp)
callq 0x8cf0
movq -0x50(%rbp), %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x90(%rbp)
jne 0x4d0d
jmp 0x4d3d
movq -0x10(%rbp), %rdi
callq 0x2230
nopw %cs:(%rax,%rax)