// File: /workspace/github_cpp_makefile_star2_O1/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, 0x57f1(%rip)      # 0xd19b
je 0x7a10
movl %edx, %ebp
movq %rsi, %r15
testl %edx, %edx
js 0x7a4d
cmpl %ebp, 0x20(%r15)
jle 0x7a4d
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 0x7ac2
movq %rdi, %rbx
leaq (%rsi,%rsi,2), %rcx
leaq (%rax,%rcx,8), %rsi
callq 0x31c2
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 0x1a51(%rip), %rsi      # 0x9482
movq %rax, %rdi
callq 0x2090
movq %r14, (%rbx)
leaq 0x515d(%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 0x68(%rsp), %rdi
movl %ebp, %esi
callq 0x831f
leaq 0x1a44(%rip), %rsi      # 0x94be
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x82af
leaq 0x1a4c(%rip), %rsi      # 0x94df
leaq 0x88(%rsp), %rdi
callq 0x22d0
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7ad0
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x7add
leaq 0x17b9(%rip), %rdi      # 0x9282
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 0x48(%rsp), %rdi
callq 0x831f
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x8207
leaq 0x19df(%rip), %rsi      # 0x9500
leaq 0xa8(%rsp), %rdi
callq 0x22d0
leaq 0x38(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x7b4f
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x7b5c
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %r12b
movq %r14, %rdi
callq 0x2240
movq %r14, (%rbx)
xorl %r12d, %r12d
leaq 0x5010(%rip), %rsi      # 0xcba0
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2280
movq %rax, %r15
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7bbc
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x7bbc
movq %rax, %r15
movb $0x1, %r12b
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7be5
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x7be5
movq %rax, %r15
movb $0x1, %r12b
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7c08
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x7c08
movq %rax, %r15
movb $0x1, %r12b
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x7c27
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x7c27
movq %rax, %r15
movb $0x1, %r12b
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7c50
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x7c50
movq %rax, %r15
movb $0x1, %r12b
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7c73
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x7c73
movq %rax, %r15
movb $0x1, %r12b
testb %r12b, %r12b
je 0x7c9f
movl $0x10, %esi
movq %r14, %rdi
callq 0x2190
jmp 0x7c9f
movq %rax, %r15
movl $0x10, %esi
movq %r14, %rdi
callq 0x2190
jmp 0x7ca9
movq %rax, %r15
movb $0x1, %r12b
testb %r12b, %r12b
jne 0x7ca9
jmp 0x7cb1
movq %rax, %r15
movq %rbx, %rdi
callq 0x2110
movq %r15, %rdi
callq 0x22a0
nop