// File: /workspace/github_cpp_makefile_star2_O1/obliviousram[P]PathOHeap/src/ServerStorage.cpp
// Function: ServerStorage::checkRWValid(int)
void ServerStorage::checkRWValid(int position) {
  if (!this->is_capacity_set) {
    throw std::runtime_error("Please call setCapacity before reading or writing any block");
  }
  if (position >= this->capacity || position < 0) {
    throw std::runtime_error("You are trying to access Bucket " + std::to_string(position) +
        ", but this Server contains only " + std::to_string(this->capacity) + " buckets.");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc0, %rsp
cmpb $0x0, 0x4e8e(%rip)      # 0xb16c
je 0x62ff
movl %esi, %ebp
movq %rdi, %r14
testl %esi, %esi
js 0x6331
cmpl %ebp, 0x8(%r14)
jle 0x6331
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x109a(%rip), %rsi      # 0x73ad
movq %rax, %rdi
callq 0x2090
movq 0x4cce(%rip), %rsi      # 0xaff0
movq 0x4c9f(%rip), %rdx      # 0xafc8
movq %rbx, %rdi
callq 0x2230
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
movl %ebp, %esi
callq 0x6779
leaq 0x1098(%rip), %rsi      # 0x73e9
leaq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x6709
leaq 0x10a0(%rip), %rsi      # 0x740a
leaq 0x80(%rsp), %rdi
callq 0x2270
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6398
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x63a4
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x8(%r14), %esi
leaq 0x40(%rsp), %rdi
callq 0x6779
leaq 0xa0(%rsp), %rdi
movq %rsp, %rsi
leaq 0x40(%rsp), %rdx
callq 0x6661
leaq 0x1045(%rip), %rsi      # 0x742b
leaq 0xa0(%rsp), %rdi
callq 0x2270
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6416
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x6423
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x2200
xorl %ebp, %ebp
movq 0x4b9d(%rip), %rsi      # 0xaff0
movq 0x4b6e(%rip), %rdx      # 0xafc8
movq %rbx, %rdi
callq 0x2230
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x6484
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x6484
movq %rax, %r14
movb $0x1, %bpl
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64ad
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x64ad
movq %rax, %r14
movb $0x1, %bpl
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x64d0
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x64d0
movq %rax, %r14
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x64ee
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x64ee
movq %rax, %r14
movb $0x1, %bpl
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6517
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x6517
movq %rax, %r14
movb $0x1, %bpl
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x653a
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x653a
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
jne 0x6544
jmp 0x654c
movq %rax, %r14
movq %rbx, %rdi
callq 0x2110
movq %r14, %rdi
callq 0x2250