// File: /workspace/github_cpp_makefile_star2_O2/NeoResearch[P]dbft3-spork-detect/main.cpp
// Function: getCommitSubsets(int&, int&, int&, std::vector<int, std::allocator<int>>, std::vector<int, std::allocator<int>>, std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>, int*, int, int, int*, int, int)
void getCommitSubsets(int &countZero, int &countOne, int &countHang, vector<int> cancels, vector<int> choices, vector<vector<pair<int, int>>> selections, int s[], int p, int k, int t[], int q = 0, int r = 0)
{
    // all subsets of size k, from p elements in total (N)
    if (q == k)
    {
        cout << "verifying subset pack:" << endl;
        for (int i = 0; i < k; i++)
            printf("%d ", t[i]);
        printf("\n");
        CommitStatus _com = verifyCommitSubset(cancels, choices, selections, t, p, k);
        int commit = -4;
        if (_com.undecided)
            commit = -3;
        else if (_com.dead)
            commit = -2;
        else
            commit = _com.commit;
        cout << "RETURNED COMMIT = " << commit << endl
             << endl;
        if (commit == 0)
            countZero++;
        else if (commit == 1)
            countOne++;
        else if (commit == -3)
            countHang++; // cannot decide, must wait
        else if (commit == -2)
        {
            cout << "DEAD NODE IN SUBSET!" << endl;
            cout << "IGNORING..." << endl;
        }
        else
        {
            cout << "UNDEFINED COMMIT!" << endl;
            exit(1);
        }
    }
    else
    {
        for (int i = r; i < p; i++)
        {
            t[q] = s[i];
            getCommitSubsets(countZero, countOne, countHang, cancels, choices, selections, s, p, k, t, q + 1, i + 1);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %r9, -0x48(%rbp)
movq %r8, -0x58(%rbp)
movq %rcx, -0x50(%rbp)
movq %rdx, -0x40(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdi, -0x30(%rbp)
movl 0x30(%rbp), %r13d
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %r12d
cmpl %eax, %r13d
jne 0x1e52
movq 0x51d0(%rip), %rdi      # 0x6fd8
leaq 0x22c1(%rip), %rsi      # 0x40d0
callq 0x1100
movq %rax, %rdi
callq 0x1090
testl %r13d, %r13d
movl $0x0, %ebx
cmovgl %r13d, %ebx
leaq 0x22b8(%rip), %r14      # 0x40e7
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x1f19
movq 0x28(%rbp), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1030
incq %r15
jmp 0x1e32
movl 0x38(%rbp), %eax
movslq %r13d, %rcx
movq %rcx, -0x68(%rbp)
incl %r13d
movq %r13, -0x60(%rbp)
movslq %eax, %r13
movslq %r12d, %rax
movq %rax, -0x70(%rbp)
leal 0x1(%r13), %ebx
leaq -0x100(%rbp), %r12
leaq -0xe8(%rbp), %r15
leaq -0xd0(%rbp), %r14
cmpq -0x70(%rbp), %r13
jge 0x2046
movq 0x10(%rbp), %rax
movl (%rax,%r13,4), %eax
movq 0x28(%rbp), %rcx
movq -0x68(%rbp), %rdx
movl %eax, (%rcx,%rdx,4)
movq %r12, %rdi
movq -0x50(%rbp), %rsi
callq 0x30aa
movq %r15, %rdi
movq -0x58(%rbp), %rsi
callq 0x30aa
movq %r14, %rdi
movq -0x48(%rbp), %rsi
callq 0x312e
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r12, %rcx
movq %r15, %r8
movq %r14, %r9
pushq %rbx
pushq -0x60(%rbp)
pushq 0x28(%rbp)
movl 0x20(%rbp), %eax
pushq %rax
movl 0x18(%rbp), %eax
pushq %rax
pushq 0x10(%rbp)
callq 0x1dc5
addq $0x30, %rsp
movq %r14, %rdi
callq 0x3102
movq %r15, %rdi
callq 0x322c
movq %r12, %rdi
callq 0x322c
incl %ebx
incq %r13
jmp 0x1e86
movq %r12, %rbx
pushq $0xa
popq %rdi
callq 0x1160
leaq -0xb8(%rbp), %r12
movq %r12, %rdi
movq -0x50(%rbp), %rsi
callq 0x30aa
leaq -0xa0(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x30aa
leaq -0x88(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x312e
leaq -0xb8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x88(%rbp), %rdx
movq 0x28(%rbp), %rcx
movl %ebx, %r8d
movl %r13d, %r9d
callq 0x1b4d
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x3102
leaq -0xa0(%rbp), %rdi
callq 0x322c
leaq -0xb8(%rbp), %rdi
callq 0x322c
btq $0x28, %rbx
pushq $-0x2
popq %rax
cmovael %ebx, %eax
btq $0x20, %rbx
pushq $-0x3
popq %rbx
cmovael %eax, %ebx
movq 0x5019(%rip), %rdi      # 0x6fd8
leaq 0x2125(%rip), %rsi      # 0x40eb
callq 0x1100
movq %rax, %rdi
movl %ebx, %esi
callq 0x11d0
movq %rax, %rdi
callq 0x1090
movq %rax, %rdi
callq 0x1090
addl $0x3, %ebx
cmpl $0x4, %ebx
ja 0x2058
leaq 0x2010(%rip), %rax      # 0x4004
movslq (%rax,%rbx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq -0x40(%rbp), %rax
jmp 0x200d
movq -0x30(%rbp), %rax
jmp 0x200d
movq -0x38(%rbp), %rax
incl (%rax)
jmp 0x2046
movq 0x4fc0(%rip), %rbx      # 0x6fd8
leaq 0x20df(%rip), %rsi      # 0x40fe
movq %rbx, %rdi
callq 0x1100
movq %rax, %rdi
callq 0x1090
leaq 0x20dd(%rip), %rsi      # 0x4113
movq %rbx, %rdi
callq 0x1100
movq %rax, %rdi
callq 0x1090
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4f79(%rip), %rdi      # 0x6fd8
leaq 0x20b9(%rip), %rsi      # 0x411f
callq 0x1100
movq %rax, %rdi
callq 0x1090
pushq $0x1
popq %rdi
callq 0x1150
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x3102
jmp 0x208f
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
jmp 0x20ba
jmp 0x209a
movq %rax, %rbx
jmp 0x20bf
movq %rax, %rbx
jmp 0x20b3
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x3102
leaq -0xe8(%rbp), %rdi
callq 0x322c
movq %r12, %rdi
callq 0x322c
movq %rbx, %rdi
callq 0x11e0