// File: /workspace/github_cpp_makefile_star2_O3/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 0x134dc
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
jne 0x1338d
movq 0xe8(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x1338d
leaq 0x13f56(%rip), %rsi     # 0x272d0
leaq 0x156ef(%rip), %rdx     # 0x28a70
xorl %ecx, %ecx
callq 0x7280
movq %rax, %r14
jmp 0x13390
xorl %r14d, %r14d
movq 0x30(%r14), %rdi
movq (%rdi), %rax
movq -0x30(%rbp), %rsi
callq *0x18(%rax)
testb %al, %al
je 0x133f0
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 0x156cd(%rip), %r8      # 0x28a98
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 0x1334b
xorl %eax, %eax
movq %rax, -0x60(%rbp)
leaq 0x156df(%rip), %rcx     # 0x28ae8
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 0x134dc
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 0x134aa
cmpl $-0x1, %r15d
je 0x134dc
movq $-0x1, %rsi
cmpq $0x0, 0xf0(%rbx)
je 0x134bf
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 0x134b8
incq %r15
addq %r12, %r13
cmpq 0xf0(%rbx), %r15
jb 0x1347a
movq $-0x1, %rsi
jmp 0x134bf
incq %r15
cmpq 0xf0(%rbx), %r15
jb 0x13445
jmp 0x134dc
sarq $0x20, %r13
movq %r13, %rsi
movq -0x70(%rbp), %rdi
callq 0x8cea
cmpq $0x0, 0xf0(%rbx)
movl $0x0, %r15d
jne 0x13445
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop