// File: /workspace/github_cpp_makefile_star2_O3/obliviousram[P]oblivious-avl-tree/src/ServerStorage.cpp
// Function: ServerStorage::readBucket(int)
Bucket ServerStorage::readBucket(int position) {
	if (!this->is_capacity_set) {
		throw new runtime_error("Please call setCapacity before reading or writing any block");
	}

	if (position >= this->capacity || position < 0) {
		//std::ostringstream positionStream;
		//positionStream << position;
		throw new runtime_error("You are trying to access Bucket " + to_string(position) + ", but this Server contains only " + to_string(this->capacity) + " buckets.");
	}
	return this->buckets.at(position);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
cmpb $0x0, 0x5661(%rip)      # 0xd19b
je 0x7ba0
movl %edx, %ebp
movq %rsi, %r15
testl %edx, %edx
js 0x7bdd
cmpl %ebp, 0x20(%r15)
jle 0x7bdd
movl %ebp, %esi
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq %rsi, %rdx
jbe 0x7c53
movq %rdi, %rbx
leaq (%rsi,%rsi,2), %rcx
leaq (%rax,%rcx,8), %rsi
callq 0x3170
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, %edi
callq 0x20c0
movq %rax, %rbx
movl $0x10, %edi
callq 0x2180
movq %rax, %r14
leaq 0x18f1(%rip), %rsi      # 0x94b2
movq %rax, %rdi
callq 0x2090
movq %r14, (%rbx)
leaq 0x4fcd(%rip), %rsi      # 0xcba0
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2280
movl $0x8, %edi
callq 0x20c0
movq %rax, %rbx
movl $0x10, %edi
callq 0x2180
movq %rax, %r14
leaq 0x28(%rsp), %rdi
movl %ebp, %esi
callq 0x84ab
leaq 0x18e4(%rip), %rsi      # 0x94ee
leaq 0x88(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x843b
leaq 0x18ec(%rip), %rsi      # 0x950f
leaq 0x88(%rsp), %rdi
callq 0x22d0
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7c61
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x7c6e
leaq 0x18e0(%rip), %rdi      # 0x953a
xorl %eax, %eax
callq 0x2210
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x20(%r15), %esi
leaq 0x68(%rsp), %rdi
callq 0x84ab
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x8393
leaq 0x187e(%rip), %rsi      # 0x9530
leaq 0xa8(%rsp), %rdi
callq 0x22d0
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7ce0
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x7ced
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %r13b
movq %r14, %rdi
callq 0x2240
movq %r14, (%rbx)
xorl %r13d, %r13d
leaq 0x4e7f(%rip), %rsi      # 0xcba0
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2280
movq %rax, %r15
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7d4d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x7d4d
movq %rax, %r15
movb $0x1, %r13b
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7d76
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x7d76
movq %rax, %r15
movb $0x1, %r13b
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7d99
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x7d99
movq %rax, %r15
movb $0x1, %r13b
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x7db8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x7db8
movq %rax, %r15
movb $0x1, %r13b
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7dd9
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2190
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7df4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2190
testb %r13b, %r13b
jne 0x7e20
jmp 0x7e3c
movq %rax, %r15
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7e20
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x7e20
jmp 0x7e1d
movq %rax, %r15
movl $0x10, %esi
movq %r14, %rdi
callq 0x2190
jmp 0x7e34
jmp 0x7e31
movq %rax, %r15
movq %rbx, %rdi
callq 0x2110
movq %r15, %rdi
callq 0x22a0