// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x2c8, %rsp            # imm = 0x2C8
movb %cl, %al
movb %sil, %cl
movq %rdi, 0x2b8(%rsp)
andb $0x1, %cl
movb %cl, 0x2b7(%rsp)
movq %rdx, 0x2a8(%rsp)
andb $0x1, %al
movb %al, 0x2a7(%rsp)
movq 0x2b8(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x118(%rsp), %rdi
callq 0xea00
testb $0x1, 0x2b7(%rsp)
jne 0x16c1b
movq 0x58(%rsp), %rax
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, 0x38(%rsp)
leaq 0x128(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movl (%rax), %eax
movq %rax, 0x48(%rsp)
movl $0x0, 0xfc(%rsp)
leaq 0xfb(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xdc10
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rcx
leaq 0x100(%rsp), %rdi
leaq 0xfc(%rsp), %rdx
callq 0xde50
jmp 0x16b9a
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdi
leaq 0x100(%rsp), %rdx
callq 0xdf00
jmp 0x16bb3
leaq 0x100(%rsp), %rdi
callq 0xeaf0
leaq 0xfb(%rsp), %rdi
callq 0xe160
jmp 0x16e4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x16c09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0x100(%rsp), %rdi
callq 0xeaf0
leaq 0xfb(%rsp), %rdi
callq 0xe160
jmp 0x16e7a
movq 0x58(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x28(%rsp)
movl $0x0, 0xcc(%rsp)
leaq 0xcb(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xdc10
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rcx
leaq 0xd0(%rsp), %rdi
leaq 0xcc(%rsp), %rdx
callq 0xde50
jmp 0x16c65
leaq 0xcb(%rsp), %rdi
callq 0xe160
movq 0x58(%rsp), %rax
movl 0x5c(%rax), %eax
shrl $0x3, %eax
movl %eax, 0x1c(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xe3a0
movl 0x1c(%rsp), %ecx
movq 0x58(%rsp), %rdi
movq 0x20(%rsp), %rdx
movl %ecx, (%rax)
addq $0x20, %rdi
leaq 0x128(%rsp), %rsi
callq 0xdf00
jmp 0x16cba
testb $0x1, 0x2a7(%rsp)
jne 0x16d77
movq 0x2a8(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0xa8(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xe1f0
jmp 0x16cec
movq 0x10(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xd160
jmp 0x16d00
leaq 0xa8(%rsp), %rdi
callq 0xe450
jmp 0x16e1c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0xcb(%rsp), %rdi
callq 0xe160
jmp 0x16e7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x16e3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0xe450
jmp 0x16e3d
leaq 0x88(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xe1f0
jmp 0x16d8e
movq 0x2a8(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0xe1f0
jmp 0x16da2
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xe870
movb %al, 0xf(%rsp)
leaq 0x68(%rsp), %rdi
callq 0xe450
leaq 0x88(%rsp), %rdi
callq 0xe450
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x16dd9
jmp 0x16e1a
movq 0x58(%rsp), %rax
movl $0x2, 0x60(%rax)
movb $0x0, 0x2c7(%rsp)
movl $0x1, 0x64(%rsp)
jmp 0x16e24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0x88(%rsp), %rdi
callq 0xe450
jmp 0x16e3d
jmp 0x16e1c
movl $0x0, 0x64(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0xeaf0
movl 0x64(%rsp), %eax
testl %eax, %eax
jne 0x16e5c
jmp 0x16e3b
jmp 0x16e4c
leaq 0xd0(%rsp), %rdi
callq 0xeaf0
jmp 0x16e7a
movb $0x1, 0x2c7(%rsp)
movl $0x1, 0x64(%rsp)
leaq 0x118(%rsp), %rdi
callq 0xea90
movb 0x2c7(%rsp), %al
andb $0x1, %al
addq $0x2c8, %rsp            # imm = 0x2C8
retq
leaq 0x118(%rsp), %rdi
callq 0xea90
movq 0xf0(%rsp), %rdi
callq 0xe7c0
nopw %cs:(%rax,%rax)