// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: Engine::Inject(std::istream&)
void Engine::Inject(istream& A)
{
    if ((phase != fresh) && (phase != crypted) && (phase != endOfCrypt))
        throw Exception("The phase must be fresh, crypted or endOfCrypt to call Engine::Inject().");
    bool cryptingFlag = (phase == crypted) || (phase == endOfCrypt);
    for(unsigned int i=0; i<Pi; i++)
        Pistons[i].Inject(A, cryptingFlag);
    if ((phase == crypted) || hasMore(A)) {
        Spark(false, vector<unsigned int>(Pi, 0));
        phase = fresh;
    }
    else
        phase = endOfMessage;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x30(%rsp)
cmpl $0x0, 0x10(%rax)
je 0x15c34
movq 0x30(%rsp), %rax
cmpl $0x1, 0x10(%rax)
je 0x15c34
movq 0x30(%rsp), %rax
cmpl $0x2, 0x10(%rax)
je 0x15c34
movb $0x1, 0x63(%rsp)
movl $0x20, %edi
callq 0xe570
movq %rax, 0x20(%rsp)
leaq 0x77(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xdce0
movq 0x28(%rsp), %rdx
leaq 0x56c7(%rip), %rsi      # 0x1b272
leaq 0x78(%rsp), %rdi
callq 0xe740
jmp 0x15bb7
movq 0x20(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0xde70
jmp 0x15bc8
movq 0x20(%rsp), %rdi
movb $0x0, 0x63(%rsp)
movq 0xa3e7(%rip), %rsi      # 0x1ffc0
movq 0xa3d8(%rip), %rdx      # 0x1ffb8
callq 0xd8c0
jmp 0x15d94
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
jmp 0x15c12
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x78(%rsp), %rdi
callq 0xe450
leaq 0x77(%rsp), %rdi
callq 0xe050
testb $0x1, 0x63(%rsp)
jne 0x15c25
jmp 0x15c2f
movq 0x20(%rsp), %rdi
callq 0xdd30
jmp 0x15d8a
movq 0x30(%rsp), %rcx
movb $0x1, %al
cmpl $0x1, 0x10(%rcx)
movb %al, 0x1f(%rsp)
je 0x15c55
movq 0x30(%rsp), %rax
cmpl $0x2, 0x10(%rax)
sete %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
andb $0x1, %al
movb %al, 0x62(%rsp)
movl $0x0, 0x5c(%rsp)
movq 0x30(%rsp), %rcx
movl 0x5c(%rsp), %eax
cmpl (%rcx), %eax
jae 0x15cae
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
movl 0x5c(%rsp), %eax
movl %eax, %esi
callq 0xe150
movq %rax, %rdi
movq 0x98(%rsp), %rsi
movb 0x62(%rsp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0xe280
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x15c67
movq 0x30(%rsp), %rax
cmpl $0x1, 0x10(%rax)
je 0x15ccf
movq 0x98(%rsp), %rdi
callq 0xd250
testb $0x1, %al
jne 0x15ccf
jmp 0x15d76
movq 0x30(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x8(%rsp)
movl $0x0, 0x3c(%rsp)
leaq 0x3b(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xdc10
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rcx
leaq 0x40(%rsp), %rdi
leaq 0x3c(%rsp), %rdx
callq 0xde50
jmp 0x15d0d
movq 0x30(%rsp), %rdi
xorl %esi, %esi
leaq 0x40(%rsp), %rdx
callq 0xdd70
jmp 0x15d20
leaq 0x40(%rsp), %rdi
callq 0xeaf0
leaq 0x3b(%rsp), %rdi
callq 0xe160
movq 0x30(%rsp), %rax
movl $0x0, 0x10(%rax)
jmp 0x15d82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
jmp 0x15d6a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xeaf0
leaq 0x3b(%rsp), %rdi
callq 0xe160
jmp 0x15d8a
movq 0x30(%rsp), %rax
movl $0x3, 0x10(%rax)
addq $0xa8, %rsp
retq
movq 0x68(%rsp), %rdi
callq 0xe7c0
nopw %cs:(%rax,%rax)