// File: NeoResearch[P]dbft3-spork-detect/main.cpp
// Function: make2f(std::vector<int, std::allocator<int>>, int, int)
vector<int> make2f(vector<int> choices, int f, int i)
{
    int N = 3 * f + 1;
    vector<int> options;
    for (unsigned k = 0; k < N; k++)
        if ((k != i) && (choices[k] != -2) && (k != choices[i])) // not i and non-faulty
                                                                 // (last is to avoid repetition of response): R_2 | 0(0) |    0(2)    0(0)    | Cancel 0
            options.push_back(k);
    std::random_shuffle(options.begin(), options.end());
    // must add i as first on its list, if not proposer
    if (i > 1)                              // non-primary {0,1}
        options.insert(options.begin(), i); // insert first prepare response (choice)
    while (options.size() > 2 * f)
        options.pop_back();
    // must verify that, if responded to a second request, it's relaying first its response, than request itself (priority)
    // example: I answer to Prop1 first, then I receive Prop0... If I decide to also respond to it, I may prefer the response, than the request (it's more info)
    // perhaps a problem o logic in this method here... suppose I'm 2.. if I had choice 1, used 2 to respond to 1.. I cannot respond to 0 (2 was used already). Must do this outside this method.
    // TODO: must improve this, change this method signature with more precise info (value/origin)
    // This is the bug: R_3 | 1(1) |    1(3)    0(0)    | Cancel 1
    // Should respond to zero first with my index, than just prepare request

    return options;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rsi, -0x78(%rbp)
movq %rdi, -0x70(%rbp)
movq %rdi, %rax
movq %rax, -0x68(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
imull $0x3, -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movb $0x0, -0x1d(%rbp)
callq 0x4610
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x1760
movl -0x24(%rbp), %eax
cmpl -0x18(%rbp), %eax
je 0x1753
movq -0x78(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x44d0
cmpl $-0x2, (%rax)
je 0x1753
movq -0x78(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, -0x7c(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x44d0
movq %rax, %rcx
movl -0x7c(%rbp), %eax
cmpl (%rcx), %eax
je 0x1753
movq -0x70(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
leaq -0x28(%rbp), %rsi
callq 0x4630
jmp 0x1737
jmp 0x1753
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x45b0
jmp 0x1811
jmp 0x1755
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x16e2
movq -0x70(%rbp), %rdi
callq 0x4730
movq -0x70(%rbp), %rdi
movq %rax, -0x40(%rbp)
callq 0x4760
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x4660
jmp 0x1789
cmpl $0x1, -0x18(%rbp)
jle 0x17ce
movq -0x70(%rbp), %rdi
callq 0x4730
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x4990
movq -0x70(%rbp), %rdi
movq -0x50(%rbp), %rsi
leaq -0x18(%rbp), %rdx
callq 0x4790
movq %rax, -0x88(%rbp)
jmp 0x17c3
movq -0x88(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x17d0
movq -0x70(%rbp), %rdi
callq 0x44b0
movl -0x14(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jbe 0x17f1
movq -0x70(%rbp), %rdi
callq 0x49d0
jmp 0x17d0
movb $0x1, -0x1d(%rbp)
testb $0x1, -0x1d(%rbp)
jne 0x1804
movq -0x70(%rbp), %rdi
callq 0x45b0
movq -0x68(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x11c0
nopw (%rax,%rax)