// File: UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::PerThreadMap::initialize(unsigned int)
void initialize(unsigned classSizePowerMax) {
					int i;

					// Initialize the classSize-to-bag mapping with sorted powers-of-two
					unsigned minClassSizePower = LOG2(BIBOP_MIN_BLOCK_SIZE);
					unsigned numClassSizePowers = BIBOP_NUM_BAGS + minClassSizePower - 1;
					classSizeToBag[minClassSizePower] = 0;
					for(i = minClassSizePower + 1; i <= numClassSizePowers; i++) {
							classSizeToBag[i] = classSizeToBag[i - 1] + 1;
					}

					// Shuffle the contents of the classSize-to-bag mapping,
					// which will randomize the bag ordering for the subheap
					for(i = numClassSizePowers; i >= minClassSizePower; i--) {
							unsigned j = getRandomNumber() % ((i - minClassSizePower) + 1);
							unsigned temp = classSizeToBag[i];
							classSizeToBag[i] = classSizeToBag[j + minClassSizePower];
							classSizeToBag[j + minClassSizePower] = temp;
					}
					for(i = 0; i < minClassSizePower; i++) {
							classSizeToBag[i] = classSizeToBag[minClassSizePower];
					}

					// Initialize the bag-to-classSize mapping
					for(i = minClassSizePower; i <= numClassSizePowers; i++) {
							bagToClassSize[classSizeToBag[i]] = i;
					}

					static bool isFirstThread = true;
					if(isFirstThread) {
							// DEBUG OUTPUT
							for(i = 0; i <= numClassSizePowers; i++) {
									PRDBG("classSizeToBag[%u] = %u", i, classSizeToBag[i]);
							}
							for(i = 0; i < BIBOP_NUM_BAGS; i++) {
									PRDBG("bagToClassSize[%u] = %u", i, bagToClassSize[i]);
							}
							PRDBG("num bags=%d, num class size powers = %d", BIBOP_NUM_BAGS, numClassSizePowers);
							PRDBG("&classSizeToBag = %p, &bagToClassSize = %p", classSizeToBag, bagToClassSize);
							isFirstThread = false;
					}
			}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x4, -0x14(%rbp)
movl -0x14(%rbp), %ecx
addl $0x10, %ecx
subl $0x1, %ecx
movl %ecx, -0x18(%rbp)
movl -0x14(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x18(%rbp), %eax
ja 0x8a4d
movq -0x28(%rbp), %rax
movl -0x10(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %ecx
addl $0x1, %ecx
movb %cl, %dl
movslq -0x10(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x8a1d
movl -0x18(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x14(%rbp), %eax
jb 0x8aac
callq 0x5520
movl -0x10(%rbp), %ecx
subl -0x14(%rbp), %ecx
addl $0x1, %ecx
xorl %edx, %edx
divl %ecx
movq -0x28(%rbp), %rax
movl %edx, -0x1c(%rbp)
movslq -0x10(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
movl %ecx, -0x20(%rbp)
movl -0x1c(%rbp), %ecx
addl -0x14(%rbp), %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %dl
movslq -0x10(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x20(%rbp), %ecx
movb %cl, %dl
movl -0x1c(%rbp), %ecx
addl -0x14(%rbp), %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x10(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x8a53
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x8ad7
movq -0x28(%rbp), %rax
movl -0x14(%rbp), %ecx
movb (%rax,%rcx), %dl
movslq -0x10(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x8ab3
movl -0x14(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x18(%rbp), %eax
ja 0x8b05
movq -0x28(%rbp), %rax
movl -0x10(%rbp), %ecx
movb %cl, %dl
movslq -0x10(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
movb %dl, 0x22(%rax,%rcx)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x8add
movq 0x84b4(%rip), %rax      # 0x10fc0
testb $0x1, (%rax)
je 0x8d22
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x18(%rbp), %eax
ja 0x8baa
callq 0x52d0
movq %rax, -0x38(%rbp)
callq 0x5400
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movq -0x28(%rbp), %rax
movl -0x10(%rbp), %r10d
movslq -0x10(%rbp), %rdx
movzbl (%rax,%rdx), %eax
movl $0x1000, %esi           # imm = 0x1000
leaq 0x3de7(%rip), %rdx      # 0xc940
leaq 0x3a02(%rip), %r8       # 0xc562
movl $0x70, %r9d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x57e0
callq 0x52d0
movq %rax, -0x30(%rbp)
callq 0x52d0
movq %rax, %rdi
callq 0x51e0
movq -0x30(%rbp), %rsi
movq %rax, %rdx
movl $0x2, %edi
callq 0x5160
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x8b1c
movl $0x0, -0x10(%rbp)
cmpl $0x10, -0x10(%rbp)
jge 0x8c3e
callq 0x52d0
movq %rax, -0x48(%rbp)
callq 0x5400
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movq -0x28(%rbp), %rax
movl -0x10(%rbp), %r10d
movslq -0x10(%rbp), %rdx
movzbl 0x22(%rax,%rdx), %eax
movl $0x1000, %esi           # imm = 0x1000
leaq 0x3d8b(%rip), %rdx      # 0xc978
leaq 0x396e(%rip), %r8       # 0xc562
movl $0x73, %r9d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x57e0
callq 0x52d0
movq %rax, -0x40(%rbp)
callq 0x52d0
movq %rax, %rdi
callq 0x51e0
movq -0x40(%rbp), %rsi
movq %rax, %rdx
movl $0x2, %edi
callq 0x5160
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x8bb1
callq 0x52d0
movq %rax, -0x68(%rbp)
callq 0x5400
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movl -0x18(%rbp), %eax
movl $0x1000, %esi           # imm = 0x1000
leaq 0x3d4e(%rip), %rdx      # 0xc9b0
leaq 0x38f9(%rip), %r8       # 0xc562
movl $0x75, %r9d
movl $0x10, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x57e0
callq 0x52d0
movq %rax, -0x60(%rbp)
callq 0x52d0
movq %rax, %rdi
callq 0x51e0
movq -0x60(%rbp), %rsi
movq %rax, %rdx
movl $0x2, %edi
callq 0x5160
callq 0x52d0
movq %rax, -0x58(%rbp)
callq 0x5400
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %r10
movq %rax, %rcx
movq %r10, %rax
addq $0x22, %rax
movl $0x1000, %esi           # imm = 0x1000
leaq 0x3d24(%rip), %rdx      # 0xc9f8
leaq 0x3887(%rip), %r8       # 0xc562
movl $0x76, %r9d
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x57e0
callq 0x52d0
movq %rax, -0x50(%rbp)
callq 0x52d0
movq %rax, %rdi
callq 0x51e0
movq -0x50(%rbp), %rsi
movq %rax, %rdx
movl $0x2, %edi
callq 0x5160
movq 0x82a1(%rip), %rax      # 0x10fc0
movb $0x0, (%rax)
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)