// File: /workspace/github_cpp_makefile_star2_O1/yasz24[P]eau2/src/network/./../application/../store/kvstore.h
// Function: KVStore::resolve_remote_wait(Key*, Value*)
void resolve_remote_wait(Key* key, Value* val) {
        size_t outstandingReqs = pendingGets.length();

        if (outstandingReqs > 0) {
            for (size_t i = 0; i < outstandingReqs; i++) {
                WaitAndGet* req = dynamic_cast<WaitAndGet*>(pendingGets.get(i));
                if (req->key_->equals(key)) {
                    //compose a response to the sender
                    Reply resp(val->serialize(), this_node_, req->sender_, network_->msg_id);
                    //send the message
                    network_->send_msg(&resp);
                }   
            }
            WaitAndGet dummy(key, 0, 0, 0);
            //remove the req from pending reqs list.
            while (pendingGets.get(&dummy) != -1 ) {
                pendingGets.remove(pendingGets.get(&dummy));
            }
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, -0x30(%rbp)
movq 0xf0(%rdi), %r13
testq %r13, %r13
je 0x1391a
movq %rdx, %r12
movq %rdi, %rbx
leaq 0xd8(%rdi), %rax
movq %rax, -0x70(%rbp)
xorl %r15d, %r15d
movq 0xf0(%rbx), %rax
subq $0x1, %rax
setb %cl
cmpq %r15, %rax
setb %al
orb %cl, %al
je 0x137a1
xorl %edi, %edi
jmp 0x137ac
movq 0xe8(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x137cb
leaq 0x14a90(%rip), %rsi     # 0x28248
leaq 0x162b1(%rip), %rdx     # 0x29a70
xorl %ecx, %ecx
callq 0x7280
movq %rax, %r14
jmp 0x137ce
xorl %r14d, %r14d
movq 0x30(%r14), %rdi
movq (%rdi), %rax
movq -0x30(%rbp), %rsi
callq *0x18(%rax)
testb %al, %al
je 0x1382e
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
movq 0x18(%r14), %rcx
movq 0x18(%rbx), %rdx
movq 0x50(%rbx), %rdi
movq 0x40(%rdi), %rsi
movq $0x0, -0x60(%rbp)
leaq 0x1628f(%rip), %r8      # 0x29a98
movq %r8, -0x68(%rbp)
movl $0x3, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
movq %rcx, -0x48(%rbp)
movq %rsi, -0x40(%rbp)
movq %rax, -0x38(%rbp)
movq (%rdi), %rax
leaq -0x68(%rbp), %rsi
callq *0x50(%rax)
incq %r15
cmpq %r15, %r13
jne 0x13785
xorl %eax, %eax
movq %rax, -0x60(%rbp)
leaq 0x162a1(%rip), %rcx     # 0x29ae8
movq %rcx, -0x68(%rbp)
movl $0x5, -0x58(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, -0x50(%rbp)
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, -0x38(%rbp)
cmpq %rax, 0xf0(%rbx)
je 0x1391a
xorl %r15d, %r15d
leaq -0x68(%rbp), %r14
movabsq $0x100000000, %r12      # imm = 0x100000000
movq 0xe8(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
testb %al, %al
je 0x138e8
cmpl $-0x1, %r15d
je 0x1391a
movq $-0x1, %rsi
cmpq $0x0, 0xf0(%rbx)
je 0x138fd
xorl %r13d, %r13d
xorl %r15d, %r15d
movq 0xe8(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
testb %al, %al
jne 0x138f6
incq %r15
addq %r12, %r13
cmpq 0xf0(%rbx), %r15
jb 0x138b8
movq $-0x1, %rsi
jmp 0x138fd
incq %r15
cmpq 0xf0(%rbx), %r15
jb 0x13883
jmp 0x1391a
sarq $0x20, %r13
movq %r13, %rsi
movq -0x70(%rbp), %rdi
callq 0x8d2a
cmpq $0x0, 0xf0(%rbx)
movl $0x0, %r15d
jne 0x13883
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop