// File: /workspace/github_cpp_makefile_star2_O3/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, -0x50(%rbp)
movq %r8, -0x60(%rbp)
movq %rcx, -0x58(%rbp)
movq %rdx, -0x48(%rbp)
movq %rsi, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
movl 0x30(%rbp), %r12d
movq 0x28(%rbp), %r13
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %ecx
cmpl %eax, %r12d
jne 0x34d8
movq 0x5cc4(%rip), %rbx      # 0x8fd8
leaq 0x2db5(%rip), %rsi      # 0x60d0
movl $0x16, %edx
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
testl %r12d, %r12d
jle 0x3378
movl %r12d, %r14d
leaq 0x2d89(%rip), %rbx      # 0x60e7
xorl %r15d, %r15d
movl (%r13,%r15,4), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2040
incq %r15
cmpq %r15, %r14
jne 0x3361
movl $0xa, %edi
callq 0x21a0
leaq -0xb8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x4ec6
leaq -0xa0(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x4ec6
leaq -0xe8(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x4fa8
leaq -0xb8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0xe8(%rbp), %rdx
movq %r13, %rcx
movl 0x18(%rbp), %r8d
movl %r12d, %r9d
callq 0x2f53
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x4f46
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x3400
movq -0x90(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x341b
movq -0xa8(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
btq $0x28, %rbx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmovael %ebx, %eax
btq $0x20, %rbx
movl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
cmovael %eax, %r14d
movq 0x5b9a(%rip), %rbx      # 0x8fd8
leaq 0x2ca6(%rip), %rsi      # 0x60eb
movl $0x12, %edx
movq %rbx, %rdi
callq 0x2170
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2210
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
addl $0x3, %r14d
cmpl $0x4, %r14d
ja 0x367b
leaq 0x2b3e(%rip), %rax      # 0x6004
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq -0x48(%rbp), %rax
jmp 0x35ef
movq %r12, %rax
movl 0x38(%rbp), %r12d
cmpl %ecx, %r12d
jge 0x3669
movq 0x10(%rbp), %rcx
movslq %eax, %rdx
movq %rdx, -0x70(%rbp)
incl %eax
movq %rax, -0x68(%rbp)
leaq -0x78(%rbp), %rax
movq %rax, -0x30(%rbp)
movslq %r12d, %rax
leaq (%rcx,%rax,4), %r13
movl 0x18(%rbp), %ebx
negl %ebx
incl %r12d
leaq -0xd0(%rbp), %r14
leaq -0x100(%rbp), %r15
movl (%r13), %eax
movq 0x28(%rbp), %rcx
movq -0x70(%rbp), %rdx
movl %eax, (%rcx,%rdx,4)
leaq -0x88(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x4ec6
movq %r14, %rdi
movq -0x60(%rbp), %rsi
callq 0x4ec6
movq %r15, %rdi
movq -0x50(%rbp), %rsi
callq 0x4fa8
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x88(%rbp), %rcx
movq %r14, %r8
movq %r15, %r9
pushq %r12
pushq -0x68(%rbp)
pushq 0x28(%rbp)
movl 0x20(%rbp), %eax
pushq %rax
movl 0x18(%rbp), %eax
pushq %rax
pushq 0x10(%rbp)
callq 0x32ca
addq $0x30, %rsp
movq %r15, %rdi
callq 0x4f46
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x35ad
movq -0xc0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x35c5
movq -0x78(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
addq $0x4, %r13
leal (%rbx,%r12), %eax
incl %eax
movl %r12d, %ecx
incl %ecx
movl %ecx, %r12d
cmpl $0x1, %eax
jne 0x351e
jmp 0x3669
movq -0x38(%rbp), %rax
jmp 0x35ef
movq -0x40(%rbp), %rax
incl (%rax)
jmp 0x3669
leaq 0x2b04(%rip), %rsi      # 0x60fe
movl $0x14, %edx
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
leaq 0x2ade(%rip), %rsi      # 0x6113
movl $0xb, %edx
movq %rbx, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5956(%rip), %rdi      # 0x8fd8
leaq 0x2a96(%rip), %rsi      # 0x611f
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movl $0x1, %edi
callq 0x2190
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x4f46
jmp 0x36b4
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x36d4
movq -0x90(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
jmp 0x36d4
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x373c
leaq -0xa8(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x372d
movq %rax, %rbx
jmp 0x3721
movq %rax, %rbx
jmp 0x3706
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x4f46
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x3721
movq -0xc0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x373c
movq -0x30(%rbp), %rax
movq (%rax), %rsi
subq %rdi, %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2220