// File: /workspace/github_c_makefile_star2_O3/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 0x5720
testl %r15d, %r15d
je 0x91b8
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 0x9202
leaq 0x8(%rsp), %rdi
callq 0x54b0
addq $0x18, %r14
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x54b0
movq 0x10(%rsp), %rdx
cmpq 0x48(%rsp), %rdx
jne 0x923a
movq 0x40(%rsp), %r14
testq %rdx, %rdx
je 0x9244
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x53c0
testl %eax, %eax
setne %bpl
jmp 0x9246
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 0x92b9
movq 0x18(%rsp), %rsi
jmp 0x92b1
leaq 0x8(%rsp), %rdi
callq 0x54b0
addq $0x18, %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x56e0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x92a2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5060
jmp 0x92a2
movb $0x1, %bpl
movq 0x40(%rsp), %r14
jmp 0x9246
xorl %ebp, %ebp
leaq 0x50(%rsp), %rax
cmpq %rax, %r14
je 0x9260
movq 0x50(%rsp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x5060
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x927b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5060
testb %bpl, %bpl
je 0x92a2
movl $0x2, 0x60(%rbx)
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x929e
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x5060
xorl %ebx, %ebx
jmp 0x92bb
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x92b9
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x5060
movb $0x1, %bl
movq 0x5d0e(%rip), %rsi      # 0xefd0
leaq 0x60(%rsp), %rdi
callq 0x53b0
leaq 0xe0(%rsp), %rdi
callq 0x55b0
movl %ebx, %eax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x92eb
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9326
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5060
jmp 0x9326
jmp 0x9323
jmp 0x9323
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x9344
movq 0x18(%rsp), %rsi
jmp 0x9335
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x9344
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x5060
jmp 0x9344
jmp 0x9341
movq %rax, %rbx
movq 0x5c85(%rip), %rsi      # 0xefd0
leaq 0x60(%rsp), %rdi
callq 0x53b0
leaq 0xe0(%rsp), %rdi
callq 0x55b0
movq %rbx, %rdi
callq 0x5670