// File: yasz24[P]eau2/src/network/./../application/../store/kvstore.h
// Function: KVStore::process_message_(Message*)
void process_message_(Message* m) {
        MsgKind kind = m->kind_;
        //switch on the kind and call the appropriate processing function.
        switch (kind) {
        case MsgKind::Put: {
            Put* put = dynamic_cast<Put*>(m);
            process_put_request_(put);
            break;
        }
        case MsgKind::Get: {
            Get* get = dynamic_cast<Get*>(m);
            process_get_request_(get);
            break;
        }
        case MsgKind::WaitAndGet: {
            WaitAndGet* waitAndget = dynamic_cast<WaitAndGet*>(m);
            process_waitAndGet_request_(waitAndget);
            break;
        }
        case MsgKind::Reply: {
            store_mtx_.lock();
            received_msg = m;
            store_mtx_.notify_all();
            //std::cout << "notified\n";
            store_mtx_.unlock();
            break;
        }
        case MsgKind::Ack: {
            store_mtx_.lock();
            received_msg = m;
            store_mtx_.notify_all();
            store_mtx_.unlock();
            break;
        }
        case MsgKind::Nack: {
            store_mtx_.lock();
            received_msg = m;
            store_mtx_.notify_all();
            store_mtx_.unlock();
            break;
        }
        default:
            break;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq %rax, -0x38(%rbp)
subq $0x5, %rax
ja 0x1f806
movq -0x38(%rbp), %rax
leaq 0xca66(%rip), %rcx      # 0x2c0d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0x1f6a6
movq -0x48(%rbp), %rdi
leaq 0x1ab38(%rip), %rsi     # 0x3a1c8
leaq 0x1c3f1(%rip), %rdx     # 0x3ba88
xorl %eax, %eax
movl %eax, %ecx
callq 0x82f0
movq %rax, -0x50(%rbp)
jmp 0x1f6ae
xorl %eax, %eax
movq %rax, -0x50(%rbp)
jmp 0x1f6ae
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rsi
callq 0x1f810
jmp 0x1f808
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0x1f6f7
movq -0x58(%rbp), %rdi
leaq 0x1aae7(%rip), %rsi     # 0x3a1c8
leaq 0x1b628(%rip), %rdx     # 0x3ad10
xorl %eax, %eax
movl %eax, %ecx
callq 0x82f0
movq %rax, -0x60(%rbp)
jmp 0x1f6ff
xorl %eax, %eax
movq %rax, -0x60(%rbp)
jmp 0x1f6ff
movq -0x40(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
callq 0x1f940
jmp 0x1f808
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, %rax
je 0x1f748
movq -0x68(%rbp), %rdi
leaq 0x1aa96(%rip), %rsi     # 0x3a1c8
leaq 0x1c367(%rip), %rdx     # 0x3baa0
xorl %eax, %eax
movl %eax, %ecx
callq 0x82f0
movq %rax, -0x70(%rbp)
jmp 0x1f750
xorl %eax, %eax
movq %rax, -0x70(%rbp)
jmp 0x1f750
movq -0x40(%rbp), %rdi
movq -0x70(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rsi
callq 0x1fa80
jmp 0x1f808
movq -0x40(%rbp), %rdi
addq $0x58, %rdi
callq 0x11df0
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, 0xd0(%rdi)
addq $0x58, %rdi
callq 0x1e520
movq -0x40(%rbp), %rdi
addq $0x58, %rdi
callq 0x121e0
jmp 0x1f808
movq -0x40(%rbp), %rdi
addq $0x58, %rdi
callq 0x11df0
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, 0xd0(%rdi)
addq $0x58, %rdi
callq 0x1e520
movq -0x40(%rbp), %rdi
addq $0x58, %rdi
callq 0x121e0
jmp 0x1f808
movq -0x40(%rbp), %rdi
addq $0x58, %rdi
callq 0x11df0
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, 0xd0(%rdi)
addq $0x58, %rdi
callq 0x1e520
movq -0x40(%rbp), %rdi
addq $0x58, %rdi
callq 0x121e0
jmp 0x1f808
jmp 0x1f808
addq $0x70, %rsp
popq %rbp
retq
nop