// File: frolosofsky[P]pbft/main.cpp
// Function: Simulator::init_nodes(int, int)
void init_nodes(int f, int n) {
        _client = std::make_shared<ClientNode>();
        for(int i = 0; i < n; ++i) {
            _nodes.emplace_back(std::make_shared<PBFTNode>(i == 0 ? PBFTNode::Role::Primary : PBFTNode::Role::Replica, f));
            _nodes[i]->set_primary(_nodes[0]);
            _nodes[i]->set_success_startegy(std::make_unique<PBFT_DB>());
            _links.emplace_back(Link::make(_client, _nodes[i]));
        }
        for(size_t i = 0; i < _nodes.size() - 1; ++i) {
            for(size_t j = i + 1; j < _nodes.size(); ++j) {
                _links.emplace_back(Link::make(_nodes[i], _nodes[j]));
            }
        }

    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x6d40
movq -0xe8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x6db0
leaq -0x20(%rbp), %rdi
callq 0x6b10
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x688a
movq -0xe8(%rbp), %rax
addq $0x10, %rax
movq %rax, -0xf8(%rbp)
movl -0x24(%rbp), %eax
testl %eax, %eax
setne %al
movzbl %al, %eax
movl %eax, -0x3c(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
leaq -0x3c(%rbp), %rsi
leaq -0xc(%rbp), %rdx
callq 0x6e50
movq -0xf8(%rbp), %rdi
movq -0xf0(%rbp), %rsi
callq 0x6de0
jmp 0x6662
leaq -0x38(%rbp), %rdi
callq 0x6ed0
movq -0xe8(%rbp), %rdi
addq $0x10, %rdi
movq %rdi, -0x110(%rbp)
movslq -0x24(%rbp), %rsi
callq 0x6ef0
movq %rax, %rdi
callq 0x6f10
movq -0x110(%rbp), %rdi
movq %rax, -0x108(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x6ef0
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x6f60
movq -0x108(%rbp), %rdi
movq -0x100(%rbp), %rsi
callq 0x6f30
jmp 0x66cd
leaq -0x60(%rbp), %rdi
callq 0x3470
movq -0xe8(%rbp), %rdi
addq $0x10, %rdi
movslq -0x24(%rbp), %rsi
callq 0x6ef0
movq %rax, %rdi
callq 0x6f10
movq %rax, -0x120(%rbp)
leaq -0x70(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x6fc0
movq -0x128(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x7020
movq -0x120(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x6f90
jmp 0x6735
leaq -0x68(%rbp), %rdi
callq 0x7070
leaq -0x70(%rbp), %rdi
callq 0x70c0
movq -0xe8(%rbp), %rsi
movq %rsi, %rax
addq $0x28, %rax
movq %rax, -0x140(%rbp)
leaq -0x90(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x7190
movq -0xe8(%rbp), %rdi
addq $0x10, %rdi
movslq -0x24(%rbp), %rsi
callq 0x6ef0
movq %rax, %rsi
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x6f60
movq -0x138(%rbp), %rsi
movq -0x130(%rbp), %rdx
leaq -0x80(%rbp), %rdi
callq 0x2a50
jmp 0x67b2
movq -0x140(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x7120
jmp 0x67c4
leaq -0x80(%rbp), %rdi
callq 0x30c0
leaq -0xa0(%rbp), %rdi
callq 0x3470
leaq -0x90(%rbp), %rdi
callq 0x3470
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x6609
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x6ed0
jmp 0x6a46
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3470
jmp 0x6a46
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x7070
leaq -0x70(%rbp), %rdi
callq 0x70c0
jmp 0x6a46
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x686d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x30c0
leaq -0xa0(%rbp), %rdi
callq 0x3470
leaq -0x90(%rbp), %rdi
callq 0x3470
jmp 0x6a46
movq $0x0, -0xa8(%rbp)
movq -0xe8(%rbp), %rdi
movq -0xa8(%rbp), %rax
movq %rax, -0x148(%rbp)
addq $0x10, %rdi
callq 0x71c0
movq %rax, %rcx
movq -0x148(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x6a3d
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb0(%rbp)
movq -0xe8(%rbp), %rdi
movq -0xb0(%rbp), %rax
movq %rax, -0x150(%rbp)
addq $0x10, %rdi
callq 0x71c0
movq %rax, %rcx
movq -0x150(%rbp), %rax
cmpq %rcx, %rax
jae 0x6a24
movq -0xe8(%rbp), %rdi
movq %rdi, %rax
addq $0x28, %rax
movq %rax, -0x170(%rbp)
addq $0x10, %rdi
movq %rdi, -0x168(%rbp)
movq -0xa8(%rbp), %rsi
callq 0x6ef0
movq %rax, %rsi
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x6f60
movq -0x168(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0x6ef0
movq %rax, %rsi
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x6f60
movq -0x160(%rbp), %rsi
movq -0x158(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0x2a50
jmp 0x6994
movq -0x170(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x7120
jmp 0x69a9
leaq -0xc0(%rbp), %rdi
callq 0x30c0
leaq -0xe0(%rbp), %rdi
callq 0x3470
leaq -0xd0(%rbp), %rdi
callq 0x3470
movq -0xb0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb0(%rbp)
jmp 0x68dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6a0a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x30c0
leaq -0xe0(%rbp), %rdi
callq 0x3470
leaq -0xd0(%rbp), %rdi
callq 0x3470
jmp 0x6a46
jmp 0x6a26
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x6895
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x21e0
nop