// File: /workspace/github_cpp_makefile_star2_O1/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), %r14d
movq 0x28(%rbp), %r13
movl 0x20(%rbp), %r12d
movl 0x18(%rbp), %eax
cmpl %r12d, %r14d
jne 0x34b1
movq 0x5ceb(%rip), %rbx      # 0x8fd8
leaq 0x2ddc(%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 0x3351
movl %r12d, %r14d
leaq 0x2db0(%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 0x333a
movl $0xa, %edi
callq 0x21a0
leaq -0xc8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x4e92
leaq -0xb0(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x4e92
leaq -0xe0(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x4f6e
leaq -0xc8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
movq %r13, %rcx
movl 0x18(%rbp), %r8d
movl %r12d, %r9d
callq 0x2f15
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x4f12
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x33d9
movq -0xa0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x33f4
movq -0xb8(%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 0x5bc1(%rip), %rbx      # 0x8fd8
leaq 0x2ccd(%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 0x3649
leaq 0x2b65(%rip), %rax      # 0x6004
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq -0x48(%rbp), %rax
jmp 0x35bd
movl 0x38(%rbp), %r13d
cmpl %eax, %r13d
jge 0x3637
movq 0x10(%rbp), %rcx
leaq -0x88(%rbp), %rax
movq %rax, -0x30(%rbp)
movslq %r14d, %rax
movq %rax, -0x68(%rbp)
incl %r14d
movslq %r13d, %rax
leaq (%rcx,%rax,4), %r15
movl 0x18(%rbp), %r12d
negl %r12d
incl %r13d
leaq -0xf8(%rbp), %rbx
movl (%r15), %eax
movq 0x28(%rbp), %rcx
movq -0x68(%rbp), %rdx
movl %eax, (%rcx,%rdx,4)
leaq -0x98(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x4e92
leaq -0x80(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x4e92
movq %rbx, %rdi
movq -0x50(%rbp), %rsi
callq 0x4f6e
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x98(%rbp), %rcx
leaq -0x80(%rbp), %r8
movq %rbx, %r9
pushq %r13
pushq %r14
pushq 0x28(%rbp)
movl 0x20(%rbp), %eax
pushq %rax
movl 0x18(%rbp), %eax
pushq %rax
pushq 0x10(%rbp)
callq 0x32a2
addq $0x30, %rsp
movq %rbx, %rdi
callq 0x4f12
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x3578
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x3593
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
addq $0x4, %r15
leal (%r12,%r13), %eax
incl %eax
movl %r13d, %ecx
incl %ecx
movl %ecx, %r13d
cmpl $0x1, %eax
jne 0x34ef
jmp 0x3637
movq -0x38(%rbp), %rax
jmp 0x35bd
movq -0x40(%rbp), %rax
incl (%rax)
jmp 0x3637
leaq 0x2b36(%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 0x2b10(%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 0x5988(%rip), %rdi      # 0x8fd8
leaq 0x2ac8(%rip), %rsi      # 0x611f
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movl $0x1, %edi
callq 0x2190
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x4f12
jmp 0x3682
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x36a2
movq -0xa0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
jmp 0x36a2
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x3704
leaq -0xb8(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x36f5
movq %rax, %rbx
jmp 0x36e9
movq %rax, %rbx
jmp 0x36d4
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x4f12
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x36e9
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x3704
movq -0x30(%rbp), %rax
movq (%rax), %rsi
subq %rdi, %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2220