// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rdi, %rbx
movl %ecx, -0x2c(%rbp)
leal (%r14,%r14,2), %eax
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
incl %eax
je 0x2752
movq %rsi, %r15
movl %eax, %r13d
xorl %r12d, %r12d
movl -0x2c(%rbp), %eax
cmpq %rax, %r12
je 0x274a
movq (%r15), %rcx
cmpl $-0x2, (%rcx,%r12,4)
je 0x274a
cltq
movl (%rcx,%rax,4), %eax
cmpq %rax, %r12
je 0x274a
movl %r12d, -0x30(%rbp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x273e
movl %r12d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x274a
movq %rbx, %rdi
leaq -0x30(%rbp), %rdx
callq 0x509c
incq %r12
cmpq %r12, %r13
jne 0x2707
movq (%rbx), %r15
movq 0x8(%rbx), %r12
cmpq %r12, %r15
je 0x27b1
leaq 0x4(%r15), %rax
cmpq %r12, %rax
je 0x27b1
movl $0x4, %r13d
callq 0x2060
cltq
movq %r13, %rcx
sarq $0x2, %rcx
incq %rcx
cqto
idivq %rcx
leaq (,%rdx,4), %rax
cmpq %rax, %r13
je 0x27a0
leaq (%r15,%r13), %rax
leaq (%r15,%rdx,4), %rcx
movl (%rax), %edx
movl (%rcx), %esi
movl %esi, (%rax)
movl %edx, (%rcx)
leaq (%r15,%r13), %rax
addq $0x4, %rax
addq $0x4, %r13
cmpq %r12, %rax
jne 0x276d
cmpl $0x2, -0x2c(%rbp)
jl 0x27c6
movq (%rbx), %rsi
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
callq 0x4cf4
movq 0x8(%rbx), %rax
addl %r14d, %r14d
movq %rax, %rcx
subq (%rbx), %rcx
movslq %r14d, %rdx
movq %rcx, %rsi
sarq $0x2, %rsi
cmpq %rdx, %rsi
jbe 0x27fe
addq $-0x4, %rcx
addq $-0x4, %rax
movq %rcx, %rsi
sarq $0x2, %rsi
addq $-0x4, %rcx
cmpq %rdx, %rsi
ja 0x27e6
movq %rax, 0x8(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2812
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2829
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2150
movq %r14, %rdi
callq 0x2220