// File: tonymuu[P]distributed-kv-store/MP2Node.cpp
// Function: MP2Node::handleCreateMessage(Message)
void MP2Node::handleCreateMessage(Message msg) {
    Message reply(msg.transID, memberNode->addr, REPLY, msg.key, msg.value, msg.replica);
    if (!createKeyValue(msg.key, msg.value, msg.replica)) {
        log->logCreateFail(&msg.fromAddr, false, msg.transID, msg.key, msg.value);
        reply.success = false;
    } else {
        log->logCreateSuccess(&msg.fromAddr, false, msg.transID, msg.key, msg.value);
        reply.success = true;
    }
    sendMessage(msg.fromAddr, reply);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rsi, -0x228(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x238(%rbp)
movl 0x50(%rsi), %ecx
movl %ecx, -0x22c(%rbp)
movq 0x50(%rax), %rsi
addq $0x8, %rsi
leaq -0x8e(%rbp), %rdi
callq 0x18e40
movq -0x228(%rbp), %rsi
addq $0x8, %rsi
leaq -0xb0(%rbp), %rdi
callq 0x4160
movq -0x228(%rbp), %rsi
addq $0x28, %rsi
leaq -0xd0(%rbp), %rdi
callq 0x4160
jmp 0x207e2
movl -0x22c(%rbp), %esi
movq -0x228(%rbp), %rax
movl 0x4(%rax), %ecx
movq %rsp, %rax
movl %ecx, (%rax)
leaq -0x88(%rbp), %rdi
leaq -0x8e(%rbp), %rdx
movl $0x4, %ecx
leaq -0xb0(%rbp), %r8
leaq -0xd0(%rbp), %r9
callq 0x2a410
jmp 0x2081f
leaq -0xd0(%rbp), %rdi
callq 0x4200
leaq -0xb0(%rbp), %rdi
callq 0x4200
movq -0x228(%rbp), %rsi
addq $0x8, %rsi
leaq -0x100(%rbp), %rdi
callq 0x4160
jmp 0x20850
movq -0x228(%rbp), %rsi
addq $0x28, %rsi
leaq -0x120(%rbp), %rdi
callq 0x4160
jmp 0x20869
movq -0x238(%rbp), %rdi
movq -0x228(%rbp), %rax
movl 0x4(%rax), %ecx
leaq -0x100(%rbp), %rsi
leaq -0x120(%rbp), %rdx
callq 0x1fe70
movb %al, -0x239(%rbp)
jmp 0x20895
movb -0x239(%rbp), %al
xorb $-0x1, %al
movb %al, -0x23a(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x4200
leaq -0x100(%rbp), %rdi
callq 0x4200
movb -0x23a(%rbp), %al
testb $0x1, %al
jne 0x208ca
jmp 0x20a51
movq -0x228(%rbp), %rsi
movq -0x238(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x250(%rbp)
movq %rsi, %rax
addq $0x48, %rax
movq %rax, -0x248(%rbp)
movl 0x50(%rsi), %eax
movl %eax, -0x240(%rbp)
addq $0x8, %rsi
leaq -0x140(%rbp), %rdi
callq 0x4160
jmp 0x2090c
movq -0x228(%rbp), %rsi
addq $0x28, %rsi
leaq -0x160(%rbp), %rdi
callq 0x4160
jmp 0x20925
movl -0x240(%rbp), %ecx
movq -0x248(%rbp), %rsi
movq -0x250(%rbp), %rdi
xorl %edx, %edx
leaq -0x140(%rbp), %r8
leaq -0x160(%rbp), %r9
callq 0x18500
jmp 0x20950
leaq -0x160(%rbp), %rdi
callq 0x4200
leaq -0x140(%rbp), %rdi
callq 0x4200
movb $0x0, -0x34(%rbp)
jmp 0x20b38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x209a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x4200
leaq -0xb0(%rbp), %rdi
callq 0x4200
jmp 0x20bcd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x20bc1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x209fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x4200
leaq -0x100(%rbp), %rdi
callq 0x4200
jmp 0x20bc1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x20a40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x4200
leaq -0x140(%rbp), %rdi
callq 0x4200
jmp 0x20bc1
movq -0x228(%rbp), %rsi
movq -0x238(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x268(%rbp)
movq %rsi, %rax
addq $0x48, %rax
movq %rax, -0x260(%rbp)
movl 0x50(%rsi), %eax
movl %eax, -0x254(%rbp)
addq $0x8, %rsi
leaq -0x180(%rbp), %rdi
callq 0x4160
jmp 0x20a93
movq -0x228(%rbp), %rsi
addq $0x28, %rsi
leaq -0x1a0(%rbp), %rdi
callq 0x4160
jmp 0x20aac
movl -0x254(%rbp), %ecx
movq -0x260(%rbp), %rsi
movq -0x268(%rbp), %rdi
xorl %edx, %edx
leaq -0x180(%rbp), %r8
leaq -0x1a0(%rbp), %r9
callq 0x18000
jmp 0x20ad7
leaq -0x1a0(%rbp), %rdi
callq 0x4200
leaq -0x180(%rbp), %rdi
callq 0x4200
movb $0x1, -0x34(%rbp)
jmp 0x20b38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x20b27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x4200
leaq -0x180(%rbp), %rdi
callq 0x4200
jmp 0x20bc1
movq -0x228(%rbp), %rsi
addq $0x48, %rsi
leaq -0x1a6(%rbp), %rdi
callq 0x18e40
jmp 0x20b51
leaq -0x220(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x2a530
jmp 0x20b66
movq -0x238(%rbp), %rdi
leaq -0x1a6(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0x1f440
jmp 0x20b82
leaq -0x220(%rbp), %rdi
callq 0x21f90
leaq -0x88(%rbp), %rdi
callq 0x21f90
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x21f90
leaq -0x88(%rbp), %rdi
callq 0x21f90
movq -0xd8(%rbp), %rdi
callq 0x45b0
nopl (%rax)