// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: Engine::InjectCollective(std::istream&, bool)
void Engine::InjectCollective(istream& X, bool diversifyFlag)
{
    if (phase != fresh)
        throw Exception("The phase must be fresh to call Engine::InjectCollective().");
    stringstream *Xt = new stringstream[Pi];
    while(hasMore(X)) {
        UINT8 x = X.get();
        for(unsigned int i=0; i<Pi; i++)
            Xt[i].put(x);
    }
    if (diversifyFlag) {
        for(unsigned int i=0; i<Pi; i++) {
            Xt[i].put(enc8(Pi));
            Xt[i].put(enc8(i));
        }
    }
    for(unsigned int i=0; i<Pi; i++)
        Xt[i].seekg(0, ios_base::beg);
    while(hasMore(Xt[0])) {
        for(unsigned int i=0; i<Pi; i++)
            Pistons[i].Inject(Xt[i], 0);
        if (hasMore(Xt[0]))
            Spark(false, vector<unsigned int>(Pi, 0));
    }
    phase = endOfMessage;
    delete[] Xt;
}

// Assembly:
subq $0x138, %rsp            # imm = 0x138
movb %dl, %al
movq %rdi, 0x130(%rsp)
movq %rsi, 0x128(%rsp)
andb $0x1, %al
movb %al, 0x127(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0xa0(%rsp)
cmpl $0x0, 0x10(%rax)
je 0x1604a
movb $0x1, 0xeb(%rsp)
movl $0x20, %edi
callq 0xe570
movq %rax, 0x90(%rsp)
leaq 0xff(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0xdce0
movq 0x98(%rsp), %rdx
leaq 0x535b(%rip), %rsi      # 0x1b2f5
leaq 0x100(%rsp), %rdi
callq 0xe740
jmp 0x15fa9
movq 0x90(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0xde70
jmp 0x15fc0
movq 0x90(%rsp), %rdi
movb $0x0, 0xeb(%rsp)
movq 0x9fe9(%rip), %rsi      # 0x1ffc0
movq 0x9fda(%rip), %rdx      # 0x1ffb8
callq 0xd8c0
jmp 0x16533
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x1601f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0x100(%rsp), %rdi
callq 0xe450
leaq 0xff(%rsp), %rdi
callq 0xe050
testb $0x1, 0xeb(%rsp)
jne 0x16038
jmp 0x16045
movq 0x90(%rsp), %rdi
callq 0xdd30
jmp 0x16526
movq 0xa0(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x78(%rsp)
movl $0x188, %ecx            # imm = 0x188
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, 0x70(%rsp)
callq 0xe6a0
movq %rax, %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x80(%rsp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, 0x88(%rsp)
cmpq $0x0, %rax
je 0x160fc
movq 0x88(%rsp), %rax
movq 0x78(%rsp), %rcx
imulq $0x188, %rcx, %rdx      # imm = 0x188
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x60(%rsp)
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xea00
jmp 0x160e2
movq 0x60(%rsp), %rcx
movq 0x58(%rsp), %rax
addq $0x188, %rax            # imm = 0x188
cmpq %rcx, %rax
movq %rax, 0x68(%rsp)
jne 0x160d1
movq 0x88(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq 0x128(%rsp), %rdi
callq 0xd250
testb $0x1, %al
jne 0x16122
jmp 0x16207
movq 0x128(%rsp), %rdi
callq 0xdca0
movb %al, 0xdf(%rsp)
movl $0x0, 0xd8(%rsp)
movq 0xa0(%rsp), %rcx
movl 0xd8(%rsp), %eax
cmpl (%rcx), %eax
jae 0x16202
movq 0xe0(%rsp), %rdi
movl 0xd8(%rsp), %eax
imulq $0x188, %rax, %rax      # imm = 0x188
addq %rax, %rdi
addq $0x10, %rdi
movsbl 0xdf(%rsp), %esi
callq 0xe310
movl 0xd8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd8(%rsp)
jmp 0x16141
movq 0x88(%rsp), %rcx
movq %rax, %rsi
movq 0x58(%rsp), %rax
movq %rsi, 0xf0(%rsp)
movl %edx, 0xec(%rsp)
cmpq %rax, %rcx
movq %rax, 0x50(%rsp)
je 0x161eb
movq 0x50(%rsp), %rdi
addq $-0x188, %rdi           # imm = 0xFE78
movq %rdi, 0x48(%rsp)
callq 0xea90
movq 0x88(%rsp), %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x50(%rsp)
jne 0x161be
movq 0x70(%rsp), %rsi
movq 0x80(%rsp), %rdi
callq 0xe540
jmp 0x16526
jmp 0x1610c
testb $0x1, 0x127(%rsp)
je 0x162c8
movl $0x0, 0xd4(%rsp)
movq 0xa0(%rsp), %rcx
movl 0xd4(%rsp), %eax
cmpl (%rcx), %eax
jae 0x162c6
movq 0xa0(%rsp), %rax
movq 0xe0(%rsp), %rcx
movl 0xd4(%rsp), %edx
imulq $0x188, %rdx, %rdx      # imm = 0x188
addq %rdx, %rcx
addq $0x10, %rcx
movq %rcx, 0x38(%rsp)
movl (%rax), %edi
callq 0xe9c0
movq 0x38(%rsp), %rdi
movsbl %al, %esi
callq 0xe310
movq 0xe0(%rsp), %rax
movl 0xd4(%rsp), %ecx
imulq $0x188, %rcx, %rcx      # imm = 0x188
addq %rcx, %rax
addq $0x10, %rax
movq %rax, 0x40(%rsp)
movl 0xd4(%rsp), %edi
callq 0xe9c0
movq 0x40(%rsp), %rdi
movsbl %al, %esi
callq 0xe310
movl 0xd4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd4(%rsp)
jmp 0x16220
jmp 0x162c8
movl $0x0, 0xd0(%rsp)
movq 0xa0(%rsp), %rcx
movl 0xd0(%rsp), %eax
cmpl (%rcx), %eax
jae 0x1631d
movq 0xe0(%rsp), %rdi
movl 0xd0(%rsp), %eax
imulq $0x188, %rax, %rax      # imm = 0x188
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0xd4c0
movl 0xd0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd0(%rsp)
jmp 0x162d3
jmp 0x1631f
movq 0xe0(%rsp), %rdi
callq 0xd250
testb $0x1, %al
jne 0x16335
jmp 0x16489
movl $0x0, 0xcc(%rsp)
movq 0xa0(%rsp), %rcx
movl 0xcc(%rsp), %eax
cmpl (%rcx), %eax
jae 0x163a3
movq 0xa0(%rsp), %rax
movq 0x8(%rax), %rdi
movl 0xcc(%rsp), %eax
movl %eax, %esi
callq 0xe150
movq %rax, %rdi
movq 0xe0(%rsp), %rsi
movl 0xcc(%rsp), %eax
imulq $0x188, %rax, %rax      # imm = 0x188
addq %rax, %rsi
xorl %edx, %edx
callq 0xe280
movl 0xcc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xcc(%rsp)
jmp 0x16340
movq 0xe0(%rsp), %rdi
callq 0xd250
testb $0x1, %al
jne 0x163b9
jmp 0x16484
movq 0xa0(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x28(%rsp)
movl $0x0, 0xac(%rsp)
leaq 0xab(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xdc10
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rcx
leaq 0xb0(%rsp), %rdi
leaq 0xac(%rsp), %rdx
callq 0xde50
jmp 0x16406
movq 0xa0(%rsp), %rdi
xorl %esi, %esi
leaq 0xb0(%rsp), %rdx
callq 0xdd70
jmp 0x1641f
leaq 0xb0(%rsp), %rdi
callq 0xeaf0
leaq 0xab(%rsp), %rdi
callq 0xe160
jmp 0x16484
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x16472
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0xeaf0
leaq 0xab(%rsp), %rdi
callq 0xe160
jmp 0x16526
jmp 0x1631f
movq 0xa0(%rsp), %rax
movl $0x3, 0x10(%rax)
movq 0xe0(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x1651e
movq 0x20(%rsp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, 0x8(%rsp)
movq -0x8(%rcx), %rax
movq %rax, 0x10(%rsp)
imulq $0x188, %rax, %rdx      # imm = 0x188
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, 0x18(%rsp)
je 0x16504
movq 0x18(%rsp), %rdi
addq $-0x188, %rdi           # imm = 0xFE78
movq %rdi, (%rsp)
callq 0xea90
movq 0x20(%rsp), %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x18(%rsp)
jne 0x164dc
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
imulq $0x188, %rax, %rsi      # imm = 0x188
addq $0x8, %rsi
callq 0xe540
addq $0x138, %rsp            # imm = 0x138
retq
movq 0xf0(%rsp), %rdi
callq 0xe7c0
nopw %cs:(%rax,%rax)