// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: Motorist::HandleTag(bool, std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&, bool)
bool Motorist::HandleTag(bool tagFlag, stringstream& T, bool unwrapFlag)
{
    stringstream Tprime;
    if (!tagFlag)
        engine.GetTags(Tprime, vector<unsigned int>(Pi, 0));
    else {
        vector<unsigned int> l(Pi, 0);
        l[0] = tau/8;
        engine.GetTags(Tprime, l);
        if (!unwrapFlag)
            T.str(Tprime.str());
        else if (Tprime.str() != T.str()) {
            phase = failed;
            return false;
        }
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movl %ecx, %ebp
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
leaq 0x60(%rsp), %rdi
callq 0x5730
testl %r15d, %r15d
je 0x9268
movl (%rbx), %esi
leaq 0x8(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x28(%rsp), %rdi
leaq 0x40(%rsp), %rcx
callq 0x53d0
movl 0x5c(%rbx), %eax
shrl $0x3, %eax
leaq 0x28(%rsp), %rdx
movq (%rdx), %rcx
movl %eax, (%rcx)
leaq 0x20(%rbx), %rdi
leaq 0x70(%rsp), %rsi
callq 0x5400
leaq 0x78(%rsp), %rsi
testb %bpl, %bpl
je 0x92b2
leaq 0x8(%rsp), %rdi
callq 0x54b0
addq $0x18, %r14
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x54b0
movq 0x10(%rsp), %rdx
movb $0x1, %bpl
cmpq 0x48(%rsp), %rdx
jne 0x92ec
testq %rdx, %rdx
je 0x92ea
movq 0x40(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x53c0
testl %eax, %eax
setne %bpl
jmp 0x92ec
movl (%rbx), %esi
leaq 0x40(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rcx
callq 0x53d0
leaq 0x70(%rsp), %rsi
addq $0x20, %rbx
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x5400
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x9360
movq 0x18(%rsp), %rsi
jmp 0x9358
leaq 0x8(%rsp), %rdi
callq 0x54b0
addq $0x18, %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x56f0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9349
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5060
jmp 0x9349
xorl %ebp, %ebp
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9307
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5060
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9322
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5060
testb %bpl, %bpl
je 0x9349
movl $0x2, 0x60(%rbx)
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x9345
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x5060
xorl %ebx, %ebx
jmp 0x9362
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x9360
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x5060
movb $0x1, %bl
movq 0x5c67(%rip), %rsi      # 0xefd0
leaq 0x60(%rsp), %rdi
callq 0x53b0
leaq 0xe0(%rsp), %rdi
callq 0x55c0
movl %ebx, %eax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9392
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x93cd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5060
jmp 0x93cd
jmp 0x93ca
jmp 0x93ca
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x93eb
movq 0x18(%rsp), %rsi
jmp 0x93dc
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x93eb
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x5060
jmp 0x93eb
jmp 0x93e8
movq %rax, %rbx
movq 0x5bde(%rip), %rsi      # 0xefd0
leaq 0x60(%rsp), %rdi
callq 0x53b0
leaq 0xe0(%rsp), %rdi
callq 0x55c0
movq %rbx, %rdi
callq 0x5680
nop