// File: frolosofsky[P]pbft/main.cpp
// Function: ClientNode::on_tick()
void on_tick() override {
        auto inbox = take_inbox();
        for(auto const &m : inbox) {
            switch(m.second.type) {
            case Message::Type::Response: {
                auto const &r = m.second.data.response;
                char const *verified = (verify_message(r.msg, r.sig, m.first) ? "Verified" : "Malformed");
                std::cout << m.first << " -> " << m.second << " :: " << verified  << std::endl;
                ++_actual_answers;
            } break;
            case Message::Type::Write:
            case Message::Type::Read:
            case Message::Type::WriteAck:
            case Message::Type::ReadAck:
                assert(not("Unreachable"));
            case Message::Type::PrePrepare:
            case Message::Type::Prepare:
            case Message::Type::Commit:
                // Client is interconnected with all nodes, here you can debug service
                // messages comming from nodes
                // std::cout << m.first << " -> " << m.second << std::endl;
                break;
            }
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0xa0(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x8260
leaq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x82c0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x50e0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x82f0
testb $0x1, %al
jne 0x7b1b
jmp 0x7cc3
leaq -0x30(%rbp), %rdi
callq 0x8320
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0xa4(%rbp)
subl $0x4, %eax
jb 0x7c92
jmp 0x7b40
movl -0xa4(%rbp), %eax
subl $0x4, %eax
je 0x7b64
jmp 0x7b4d
movl -0xa4(%rbp), %eax
addl $-0x5, %eax
subl $0x3, %eax
jb 0x7cb1
jmp 0x7cb3
movq -0x40(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x8380
jmp 0x7b82
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x40(%rbp), %rax
movq (%rax), %rdx
leaq -0x88(%rbp), %rdi
callq 0x8340
movb %al, -0xa5(%rbp)
jmp 0x7ba5
movb -0xa5(%rbp), %dl
leaq 0x77f6(%rip), %rcx      # 0xf3a8
leaq 0x77f8(%rip), %rax      # 0xf3b1
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rsi
movq 0x11406(%rip), %rdi     # 0x18fd8
callq 0x2050
movq %rax, -0xb0(%rbp)
jmp 0x7be0
movq -0xb0(%rbp), %rdi
leaq 0x77cd(%rip), %rsi      # 0xf3bb
callq 0x2110
movq %rax, -0xb8(%rbp)
jmp 0x7bfc
movq -0xb8(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq $0x8, %rsi
callq 0x83e0
movq %rax, -0xc0(%rbp)
jmp 0x7c19
movq -0xc0(%rbp), %rdi
leaq 0x7799(%rip), %rsi      # 0xf3c0
callq 0x2110
movq %rax, -0xc8(%rbp)
jmp 0x7c35
movq -0xc8(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x2110
movq %rax, -0xd0(%rbp)
jmp 0x7c4e
movq -0xd0(%rbp), %rdi
movq 0x11364(%rip), %rsi     # 0x18fc0
callq 0x2150
jmp 0x7c63
movq -0xa0(%rbp), %rax
movl 0x64(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x64(%rax)
jmp 0x7cb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x7f80
jmp 0x7cd5
leaq 0x7478(%rip), %rdi      # 0xf111
leaq 0x7725(%rip), %rsi      # 0xf3c5
movl $0x47, %edx
leaq 0x7722(%rip), %rcx      # 0xf3ce
callq 0x20c0
jmp 0x7cb3
jmp 0x7cb5
leaq -0x30(%rbp), %rdi
callq 0x85f0
jmp 0x7b05
leaq -0x20(%rbp), %rdi
callq 0x7f80
addq $0xd0, %rsp
popq %rbp
retq
movq -0x90(%rbp), %rdi
callq 0x21e0
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)