LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Keccak-f.cpp
// Function: KeccakF::getName[abi:cxx11]() const
string KeccakF::getName() const
{
    stringstream a;
    a << "KeccakF-" << dec << width << "-" << nrRounds;
    if (startRoundIndex != 0)
        a << "-" << startRoundIndex;
    return a.str();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6a50
leaq 0x18(%rsp), %r15
leaq 0x3c2c(%rip), %rsi      # 0xb07e
movq %r15, %rdi
callq 0x61c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
movl 0x8(%r14), %esi
movq %rax, %rdi
callq 0x6a10
leaq 0x3c03(%rip), %rsi      # 0xb085
movq %rax, %rdi
callq 0x61c0
movl 0x18(%r14), %esi
movq %rax, %rdi
callq 0x6a10
cmpl $0x0, 0x14(%r14)
je 0x74b8
leaq 0x3be1(%rip), %rsi      # 0xb085
movq %r15, %rdi
callq 0x61c0
movl 0x14(%r14), %esi
movq %rax, %rdi
callq 0x68e0
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x66e0
leaq 0x8(%rsp), %rdi
callq 0x6a70
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6a70
movq %rbx, %rdi
callq 0x6980
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Keccak-f.cpp
// Function: KeccakF::buildBitName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int, unsigned int)
string KeccakF::buildBitName(const string& prefixSymbol, unsigned int laneSize, unsigned int z)
{
    stringstream s;
    s << prefixSymbol;
    if (laneSize > 1) {
        s.fill('0');
        if (laneSize <= 10)
            s.width(1);
        else if (laneSize <= 100)
            s.width(2);
        s << z;
    }
    return s.str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %r13
movq %rdi, %rbx
movq %rsp, %r12
movq %r12, %rdi
callq 0x6a50
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x6970
cmpl $0x2, %r15d
jb 0x7638
movq (%rsp), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
callq 0x66a0
movb $0x30, 0xe0(%r12)
cmpl $0xb, %r15d
jae 0x7618
pushq $0x1
jmp 0x7620
cmpl $0x64, %r15d
ja 0x762e
pushq $0x2
popq %rax
movq (%rsp), %rcx
movq -0x18(%rcx), %rcx
movq %rax, 0x10(%rsp,%rcx)
movl %ebp, %esi
movq %r14, %rdi
callq 0x6a10
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x66e0
movq %rsp, %rdi
callq 0x6a70
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6a70
movq %rbx, %rdi
callq 0x6980
nop
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Keccak-f.h
// Function: void KeccakF::round<unsigned long long>(std::vector<unsigned long long, std::allocator<unsigned long long>>&, int) const
void KeccakF::round(vector<Lane>& state, int roundIndex) const
{
    theta(state);
    rho(state);
    pi(state);
    chi(state);
    iota(state, roundIndex);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
callq 0x6110
movq %r15, %rdi
movq %r14, %rsi
callq 0x62b0
movq %r15, %rdi
movq %r14, %rsi
callq 0x69c0
movq %r15, %rdi
movq %r14, %rsi
callq 0x6430
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x68a0
nop
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Keccak-f.h
// Function: void KeccakF::theta<unsigned long long>(std::vector<unsigned long long, std::allocator<unsigned long long>>&) const
void KeccakF::theta(vector<Lane>& A) const
{
    vector<Lane> C(5);
    for(unsigned int x=0; x<5; x++) {
        C[x] = A[index(x,0)]; 
        for(unsigned int y=1; y<5; y++) 
            C[x] ^= A[index(x,y)];
    }
    vector<Lane> D(5);
    for(unsigned int x=0; x<5; x++) {
        Lane temp = C[index(x+1)];
        ROL(temp, 1);
        D[x] = temp ^ C[index(x-1)];
    }
    for(int x=0; x<5; x++)
        for(unsigned int y=0; y<5; y++)
            A[index(x,y)] ^= D[x];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
leaq 0x30(%rsp), %r12
pushq $0x5
popq %rsi
leaq 0x18(%rsp), %rdx
movq %r12, %rdi
callq 0x60c0
movq %rbx, 0x8(%rsp)
movq (%rbx), %r13
xorl %r15d, %r15d
movq (%r12), %r12
pushq $0x1
popq %rbx
cmpq $0x5, %r15
je 0x7ec5
movq (%r13,%r15,8), %r14
movq %r14, (%r12,%r15,8)
movl %ebx, %ebp
cmpl $0x5, %ebp
je 0x7ec0
movl %r15d, %edi
movl %ebp, %esi
callq 0x6aa0
movl %eax, %eax
xorq (%r13,%rax,8), %r14
movq %r14, (%r12,%r15,8)
incl %ebp
jmp 0x7ea2
incq %r15
jmp 0x7e91
leaq 0x18(%rsp), %rdi
pushq $0x5
popq %rsi
movq %rsp, %rdx
callq 0x60c0
movq 0x30(%rsp), %rbx
movq 0x18(%rsp), %r12
xorl %r13d, %r13d
pushq $0x1
popq %rbp
pushq $0x4
popq %r14
cmpq $0x5, %r13
je 0x7f34
leaq 0x1(%r13), %r15
cmpq $0x4, %r13
movl $0x0, %eax
cmovneq %r15, %rax
movq (%rbx,%rax,8), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
movl %ebp, %edx
callq 0x6730
leal -0x1(%r13), %eax
cmpq $0x1, %r15
cmoveq %r14, %rax
movq (%rbx,%rax,8), %rax
xorq (%rsp), %rax
movq %rax, (%r12,%r13,8)
movq %r15, %r13
jmp 0x7ee9
movq 0x8(%rsp), %rax
movq (%rax), %r14
xorl %ebx, %ebx
cmpq $0x5, %rbx
je 0x7f67
xorl %ebp, %ebp
cmpl $0x5, %ebp
je 0x7f62
movq (%r12,%rbx,8), %r15
movl %ebx, %edi
movl %ebp, %esi
callq 0x6aa0
movl %eax, %eax
xorq %r15, (%r14,%rax,8)
incl %ebp
jmp 0x7f46
incq %rbx
jmp 0x7f3e
leaq 0x18(%rsp), %rdi
callq 0x6780
leaq 0x30(%rsp), %rdi
callq 0x6780
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x6780
movq %rbx, %rdi
callq 0x6980
nop
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Keccak-f.h
// Function: void KeccakF::pi<unsigned long long>(std::vector<unsigned long long, std::allocator<unsigned long long>>&) const
void KeccakF::pi(vector<Lane>& A) const
{
    vector<Lane> a(A);
    for(unsigned int x=0; x<5; x++) 
    for(unsigned int y=0; y<5; y++) {
        unsigned int X, Y;
        pi(x, y, X, Y);
        A[index(X,Y)] = a[index(x,y)];
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x6650
movq (%r14), %rax
movq %rax, 0x8(%rsp)
movq (%rbx), %r13
xorl %r14d, %r14d
xorl %ebx, %ebx
cmpl $0x5, %ebx
je 0x807c
xorl %ebp, %ebp
movl %r14d, 0x4(%rsp)
movl %r14d, %eax
xorl %edx, %edx
pushq $0x5
popq %rcx
divl %ecx
cmpl $0x5, %ebp
je 0x806f
movl %edx, %r15d
movl %ebx, %edi
movl %ebp, %esi
callq 0x6aa0
movl %eax, %eax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %r12
movl %ebp, %edi
movl %r15d, %esi
callq 0x6aa0
movl %eax, %eax
movq %r12, (%r13,%rax,8)
incl %ebp
addl $0x3, %r14d
jmp 0x8030
incl %ebx
movl 0x4(%rsp), %r14d
addl $0x2, %r14d
jmp 0x8024
leaq 0x10(%rsp), %rdi
callq 0x6780
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Keccak-f.h
// Function: void KeccakF::chi<unsigned long long>(std::vector<unsigned long long, std::allocator<unsigned long long>>&) const
void KeccakF::chi(vector<Lane>& A) const
{
    vector<Lane> C(5);
    for(unsigned int y=0; y<5; y++) { 
        for(unsigned int x=0; x<5; x++)
            C[x] = A[index(x,y)] ^ ((~A[index(x+1,y)]) & A[index(x+2,y)]);
        for(unsigned int x=0; x<5; x++)
            A[index(x,y)] = C[index(x)];
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
leaq 0x10(%rsp), %r14
pushq $0x5
popq %rsi
leaq 0x7(%rsp), %rdx
movq %r14, %rdi
callq 0x60c0
movq (%rbx), %r12
xorl %ebx, %ebx
movq (%r14), %rax
movq %rax, 0x8(%rsp)
cmpl $0x5, %ebx
je 0x814d
xorl %r14d, %r14d
cmpq $0x5, %r14
je 0x811f
movl %r14d, %edi
movl %ebx, %esi
callq 0x6aa0
movl %eax, %eax
movq (%r12,%rax,8), %rbp
leaq 0x1(%r14), %r15
movl %r15d, %edi
movl %ebx, %esi
callq 0x6aa0
movl %eax, %eax
movq (%r12,%rax,8), %r13
leal 0x2(%r14), %edi
movl %ebx, %esi
callq 0x6aa0
movl %eax, %eax
andnq (%r12,%rax,8), %r13, %rax
xorq %rbp, %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx,%r14,8)
movq %r15, %r14
jmp 0x80d1
xorl %r14d, %r14d
cmpq $0x5, %r14
je 0x8146
movq 0x8(%rsp), %rax
movq (%rax,%r14,8), %r15
movl %r14d, %edi
movl %ebx, %esi
callq 0x6aa0
movl %eax, %eax
movq %r15, (%r12,%rax,8)
incq %r14
jmp 0x8122
incl %ebx
jmp 0x80c9
leaq 0x10(%rsp), %rdi
callq 0x6780
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Keccak-f.h
// Function: void KeccakF::inverseRound<unsigned long long>(std::vector<unsigned long long, std::allocator<unsigned long long>>&, int) const
void KeccakF::inverseRound(vector<Lane>& state, int roundIndex) const
{
    iota(state, roundIndex);
    inverseChi(state);
    inversePi(state);
    inverseRho(state);
    inverseTheta(state);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x68a0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x60d0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6860
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6420
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6230
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Keccak-f.h
// Function: void KeccakF::inverseChi<unsigned long long>(std::vector<unsigned long long, std::allocator<unsigned long long>>&) const
void KeccakF::inverseChi(vector<Lane>& A) const
{
    for(unsigned int y=0; y<5; y++) { 
        unsigned int length = 5;
        vector<Lane> C(length);
        for(unsigned int x=0; x<length; x++) C[index(x)] = A[index(x,y)];
        for(unsigned int x=0; x<(3*(length-1)/2); x++) {
            unsigned int X = (length-2)*x;
            A[index(X,y)] = C[index(X)] ^ (A[index(X+2,y)] & (~C[index(X+1)]));
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, 0x20(%rsp)
xorl %ebx, %ebx
leaq 0x40(%rsp), %r14
cmpl $0x5, %ebx
je 0x835d
movq %r14, %rdi
pushq $0x5
popq %rsi
leaq 0xb(%rsp), %rdx
callq 0x60c0
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %r14
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x8288
movl %r15d, %edi
movl %ebx, %esi
callq 0x6aa0
movl %eax, %eax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rax
movq %rax, (%r14,%r15,8)
incq %r15
jmp 0x8264
movq %rbx, 0x10(%rsp)
leaq 0x8(%r14), %rbx
xorl %edi, %edi
pushq $0x1
popq %r8
pushq $0x2
popq %rax
movl %eax, %r15d
movq %r8, %rax
xorl %edx, %edx
pushq $0x5
popq %rsi
divq %rsi
movq %rax, %rcx
movq %rdi, %rax
xorl %edx, %edx
divq %rsi
cmpl $0x14, %r15d
je 0x8344
imulq $-0x28, %rcx, %r12
imulq $-0x28, %rax, %rax
leal -0x2(%r15), %ecx
movl %ecx, 0xc(%rsp)
movq (%r14,%rax), %rbp
movq %rdi, 0x30(%rsp)
movl %r15d, %edi
movq 0x10(%rsp), %r13
movl %r13d, %esi
movq %r8, 0x28(%rsp)
callq 0x6aa0
movl %eax, %eax
movq (%rbx,%r12), %rcx
movq %rbx, 0x38(%rsp)
movq %r14, %rbx
movq 0x18(%rsp), %r14
andnq (%r14,%rax,8), %rcx, %r12
xorq %rbp, %r12
movl 0xc(%rsp), %edi
movl %r13d, %esi
callq 0x6aa0
movq 0x28(%rsp), %r8
movq 0x30(%rsp), %rdi
movl %eax, %eax
movq %r12, (%r14,%rax,8)
movq %rbx, %r14
movq 0x38(%rsp), %rbx
addl $0x3, %r15d
addq $0x18, %rbx
addq $0x3, %r8
addq $0x18, %r14
addq $0x3, %rdi
jmp 0x829d
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x6780
movq 0x10(%rsp), %rbx
incl %ebx
jmp 0x8236
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Keccak-f.h
// Function: void KeccakF::inversePi<unsigned long long>(std::vector<unsigned long long, std::allocator<unsigned long long>>&) const
void KeccakF::inversePi(vector<Lane>& A) const
{
    vector<Lane> a(A);
    for(unsigned int X=0; X<5; X++) 
    for(unsigned int Y=0; Y<5; Y++) {
        unsigned int x, y;
        inversePi(X, Y, x, y);
        A[index(x,y)] = a[index(X,Y)];
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x6650
movq (%r14), %rax
movq %rax, 0x8(%rsp)
movq (%rbx), %r13
xorl %ebx, %ebx
cmpl $0x5, %ebx
je 0x83e4
xorl %ebp, %ebp
movl %ebx, %r14d
movl %r14d, %eax
xorl %edx, %edx
pushq $0x5
popq %rcx
divl %ecx
cmpl $0x5, %ebp
je 0x83e0
movl %edx, %r15d
movl %ebx, %edi
movl %ebp, %esi
callq 0x6aa0
movl %eax, %eax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %r12
movl %r15d, %edi
movl %ebx, %esi
callq 0x6aa0
movl %eax, %eax
movq %r12, (%r13,%rax,8)
incl %ebp
addl $0x3, %r14d
jmp 0x83a1
incl %ebx
jmp 0x8397
leaq 0x10(%rsp), %rdi
callq 0x6780
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: enc8(unsigned int)
UINT8 enc8(unsigned int x)
{
    if (x > 255) {
        stringstream s;
        s << "The integer " << x << " cannot be encoded on 8 bits.";
        throw Exception(s.str());
    }
    else
        return UINT8(x);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movl %edi, %ebx
cmpl $0x100, %edi            # imm = 0x100
jae 0x8c68
movl %ebx, %eax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x28(%rsp), %rdi
callq 0x6a50
leaq 0x38(%rsp), %rdi
leaq 0x2562(%rip), %rsi      # 0xb1e0
callq 0x61c0
movl %ebx, %esi
movq %rax, %rdi
callq 0x6a10
leaq 0x2559(%rip), %rsi      # 0xb1ed
movq %rax, %rdi
callq 0x61c0
pushq $0x20
popq %rdi
callq 0x6890
movq %rax, %rbx
leaq 0x40(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x66e0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6460
xorl %ebp, %ebp
movq 0x62f9(%rip), %rsi      # 0xefc8
movq 0x62ea(%rip), %rdx      # 0xefc0
movq %rbx, %rdi
callq 0x6390
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x65b0
testb %bpl, %bpl
jne 0x8cf5
jmp 0x8d02
movq %rax, %r14
movq %rbx, %rdi
callq 0x6520
jmp 0x8d02
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x6a70
movq %r14, %rdi
callq 0x6980
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: Piston::Piston(Permutation const*, unsigned int, unsigned int)
Piston::Piston(const Permutation *aF, unsigned int aRs, unsigned int aRa)
    : f(aF), Rs(aRs), Ra(aRa)
{
    unsigned int b = f->getWidth();
    if (Rs > Ra)
        throw Exception("Rs is larger than Ra.");
    if (Ra > ((b-32)/8))
        throw Exception("Ra is larger than (b-32)/8.");
    state.reset(new UINT8[(b+7)/8]);
    memset(state.get(), 0, (b+7)/8);
    EOM = Ra;
    CryptEnd = Ra+1;
    InjectStart = Ra+2;
    InjectEnd = Ra+3;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movq %rsi, (%rdi)
leaq 0x8(%rdi), %rbx
andq $0x0, 0x8(%rdi)
movl %edx, 0x10(%rdi)
movl %ecx, 0x14(%rdi)
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x10(%rax)
movl %eax, %r15d
movl 0x14(%r14), %eax
cmpl %eax, 0x10(%r14)
ja 0x8daf
leal -0x20(%r15), %ecx
shrl $0x3, %ecx
cmpl %ecx, %eax
ja 0x8dfa
addl $0x7, %r15d
shrl $0x3, %r15d
movq %r15, %rdi
callq 0x68f0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x66d0
movq 0x8(%r14), %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x6310
movl 0x14(%r14), %eax
movl %eax, 0x18(%r14)
vpbroadcastd %eax, %xmm0
vpaddd 0x2439(%rip), %xmm0, %xmm0 # 0xb1d0
vmovq %xmm0, 0x1c(%r14)
addl $0x3, %eax
movl %eax, 0x24(%r14)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x6890
movq %rax, %r14
leaq 0x244a(%rip), %rsi      # 0xb20b
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x6950
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x6460
xorl %ebp, %ebp
movq 0x61df(%rip), %rsi      # 0xefc8
movq 0x61d0(%rip), %rdx      # 0xefc0
movq %r14, %rdi
callq 0x6390
jmp 0x8e43
pushq $0x20
popq %rdi
callq 0x6890
movq %rax, %r14
leaq 0x2415(%rip), %rsi      # 0xb221
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x6950
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x6460
xorl %ebp, %ebp
movq 0x6194(%rip), %rsi      # 0xefc8
movq 0x6185(%rip), %rdx      # 0xefc0
movq %r14, %rdi
callq 0x6390
jmp 0x8e47
jmp 0x8e5b
movq %rax, %r15
leaq 0x8(%rsp), %rdi
callq 0x65b0
testb %bpl, %bpl
jne 0x8e5e
jmp 0x8e6b
movq %rax, %r15
movq %r14, %rdi
callq 0x6520
jmp 0x8e6b
movq %rax, %r15
movq %rbx, %rdi
callq 0x6140
movq %r15, %rdi
callq 0x6980
nop
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: Piston::Crypt(std::istream&, std::ostream&, unsigned int, bool)
void Piston::Crypt(istream& I, ostream& O, unsigned int omega, bool unwrapFlag)
{
    while(hasMore(I) && (omega < Rs)) {
        UINT8 x = I.get();
        O.put(state.get()[omega] ^ x);
        if (unwrapFlag)
            state.get()[omega] = x;
        else
            state.get()[omega] ^= x;
        omega++;
    }
    state.get()[CryptEnd] ^= enc8(omega);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movl %ecx, %r15d
movq %r12, %rdi
callq 0x6100
testb %al, %al
je 0x8f59
movl 0x10(%rbx), %eax
cmpq %rax, %r15
jae 0x8f59
movq %r12, %rdi
callq 0x64d0
movl %eax, %r13d
movq 0x8(%rbx), %rax
movb (%rax,%r15), %al
xorb %r13b, %al
movsbl %al, %esi
movq %r14, %rdi
callq 0x6790
movq 0x8(%rbx), %rax
testb %bpl, %bpl
jne 0x8f50
xorb (%rax,%r15), %r13b
movb %r13b, (%rax,%r15)
incq %r15
jmp 0x8f0e
movl %r15d, %edi
callq 0x6a30
movq 0x8(%rbx), %rcx
movl 0x1c(%rbx), %edx
xorb %al, (%rcx,%rdx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: Piston::Inject(std::istream&, bool)
void Piston::Inject(istream& X, bool cryptingFlag)
{
    unsigned int omega;
    if (cryptingFlag)
        omega = Rs;
    else
        omega = 0;
    state.get()[InjectStart] ^= enc8(omega);
    while(hasMore(X) && (omega < Ra)) {
        state.get()[omega] ^= X.get();
        omega++;
    }
    state.get()[InjectEnd] ^= enc8(omega);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
testl %edx, %edx
cmovnel 0x10(%rdi), %r14d
movl %r14d, %edi
callq 0x6a30
movq 0x8(%rbx), %rcx
movl 0x20(%rbx), %edx
xorb %al, (%rcx,%rdx)
movq %r15, %rdi
callq 0x6100
testb %al, %al
je 0x8fca
movl 0x14(%rbx), %eax
cmpq %rax, %r14
jae 0x8fca
movq %r15, %rdi
callq 0x64d0
movq 0x8(%rbx), %rcx
xorb %al, (%rcx,%r14)
incq %r14
jmp 0x8fa1
movl %r14d, %edi
callq 0x6a30
movq 0x8(%rbx), %rcx
movl 0x24(%rbx), %edx
xorb %al, (%rcx,%rdx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: Piston::Spark(bool, unsigned int)
void Piston::Spark(bool eomFlag, unsigned int l)
{
    if (eomFlag) {
        if (l == 0)
            state.get()[EOM] ^= enc8(255);
        else
            state.get()[EOM] ^= enc8(l);
    }
    else
        state.get()[EOM] ^= enc8(0);
    (*f)(state.get());
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
je 0x9003
testl %edx, %edx
je 0x8ff7
movl %edx, %edi
callq 0x6a30
jmp 0x8ff9
movb $-0x1, %al
movq 0x8(%rbx), %rcx
movl 0x18(%rbx), %edx
xorb %al, (%rcx,%rdx)
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movq (%rdi), %rax
movq 0x18(%rax), %rax
popq %rbx
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: Piston::GetTag(std::ostream&, unsigned int) const
void Piston::GetTag(ostream& T, unsigned int l) const
{
    if (l > Rs)
        throw Exception("The requested tag is too long.");
    for(unsigned int i=0; i<l; i++)
        T.put(state.get()[i]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
cmpl %edx, 0x10(%rdi)
jb 0x9059
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %r15d
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x904c
movq 0x8(%r14), %rax
movsbl (%rax,%r12), %esi
movq %rbx, %rdi
callq 0x6790
incq %r12
jmp 0x9031
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x6890
movq %rax, %rbx
leaq 0x21d2(%rip), %rsi      # 0xb23d
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x6950
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x6460
xorl %ebp, %ebp
movq 0x5f35(%rip), %rsi      # 0xefc8
movq 0x5f26(%rip), %rdx      # 0xefc0
movq %rbx, %rdi
callq 0x6390
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x65b0
testb %bpl, %bpl
jne 0x90b9
jmp 0x90c1
movq %rax, %r14
movq %rbx, %rdi
callq 0x6520
movq %r14, %rdi
callq 0x6980
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: Engine::Crypt(std::istream&, std::ostream&, bool)
void Engine::Crypt(istream& I, ostream& O, bool unwrapFlag)
{
    if (phase != fresh)
        throw Exception("The phase must be fresh to call Engine::Crypt().");
    for(unsigned int i=0; i<Pi; i++)
        Pistons[i].Crypt(I, O, Et[i], unwrapFlag);
    if (hasMore(I))
        phase = crypted;
    else
        phase = endOfCrypt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x0, 0x10(%rdi)
jne 0x9242
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
xorl %r12d, %r12d
movzbl %cl, %ebp
xorl %r13d, %r13d
movl (%rbx), %eax
cmpq %rax, %r13
jae 0x9220
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
movq (%rax), %rdi
addq %r12, %rdi
movl (%rcx,%r13,4), %ecx
movq %r14, %rsi
movq %r15, %rdx
movl %ebp, %r8d
callq 0x65a0
incq %r13
addq $0x28, %r12
jmp 0x91f0
movq %r14, %rdi
callq 0x6100
movzbl %al, %eax
pushq $0x2
popq %rcx
subl %eax, %ecx
movl %ecx, 0x10(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x6890
movq %rax, %rbx
leaq 0x201e(%rip), %rsi      # 0xb272
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x6950
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6460
xorl %ebp, %ebp
movq 0x5d4c(%rip), %rsi      # 0xefc8
movq 0x5d3d(%rip), %rdx      # 0xefc0
movq %rbx, %rdi
callq 0x6390
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x65b0
testb %bpl, %bpl
jne 0x92a2
jmp 0x92aa
movq %rax, %r14
movq %rbx, %rdi
callq 0x6520
movq %r14, %rdi
callq 0x6980
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl 0x10(%rdi), %ebp
cmpl $0x3, %ebp
jae 0x935d
movq %rsi, %r14
movq %rdi, %rbx
decl %ebp
xorl %r15d, %r15d
xorl %r12d, %r12d
movl (%rbx), %esi
cmpq %rsi, %r12
jae 0x9302
xorl %edx, %edx
cmpl $0x2, %ebp
setb %dl
movq 0x8(%rbx), %rax
movq (%rax), %rdi
addq %r15, %rdi
movq %r14, %rsi
callq 0x6760
incq %r12
addq $0x28, %r15
jmp 0x92d8
cmpl $0x1, 0x10(%rbx)
je 0x9316
movq %r14, %rdi
callq 0x6100
testb %al, %al
je 0x934a
movl (%rbx), %esi
leaq 0xc(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xb(%rsp), %rcx
callq 0x6570
xorl %ebp, %ebp
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6530
leaq 0x10(%rsp), %rdi
callq 0x62d0
jmp 0x934d
pushq $0x3
popq %rbp
movl %ebp, 0x10(%rbx)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x6890
movq %rax, %rbx
leaq 0x1f34(%rip), %rsi      # 0xb2a3
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x6950
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x6460
xorl %ebp, %ebp
movq 0x5c31(%rip), %rsi      # 0xefc8
movq 0x5c22(%rip), %rdx      # 0xefc0
movq %rbx, %rdi
callq 0x6390
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x65b0
testb %bpl, %bpl
jne 0x93bd
jmp 0x93d9
movq %rax, %r14
movq %rbx, %rdi
callq 0x6520
jmp 0x93d9
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x62d0
jmp 0x93d9
movq %rax, %r14
movq %r14, %rdi
callq 0x6980
nop
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: Engine::GetTags(std::ostream&, std::vector<unsigned int, std::allocator<unsigned int>> const&)
void Engine::GetTags(ostream& T, const vector<unsigned int>& l)
{
    if (phase != endOfMessage)
        throw Exception("The phase must be endOfMessage to call Engine::GetTags().");
    Spark(true, l);
    for(unsigned int i=0; i<Pi; i++)
        Pistons[i].GetTag(T, l[i]);
    phase = fresh;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x3, 0x10(%rdi)
jne 0x944b
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
pushq $0x1
popq %rsi
callq 0x6530
xorl %r12d, %r12d
xorl %r13d, %r13d
movl (%r14), %eax
cmpq %rax, %r13
jae 0x9437
movq 0x8(%r14), %rax
movq (%rax), %rdi
addq %r12, %rdi
movq (%rbx), %rax
movl (%rax,%r13,4), %edx
movq %r15, %rsi
callq 0x6960
incq %r13
addq $0x28, %r12
jmp 0x940d
andl $0x0, 0x10(%r14)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x6890
movq %rax, %rbx
leaq 0x1e8f(%rip), %rsi      # 0xb2ec
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x6950
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6460
xorl %ebp, %ebp
movq 0x5b43(%rip), %rsi      # 0xefc8
movq 0x5b34(%rip), %rdx      # 0xefc0
movq %rbx, %rdi
callq 0x6390
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x65b0
testb %bpl, %bpl
jne 0x94ab
jmp 0x94b3
movq %rax, %r14
movq %rbx, %rdi
callq 0x6520
movq %r14, %rdi
callq 0x6980
nop
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: Motorist::StartEngine(std::istream&, bool, std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&, bool, bool)
bool Motorist::StartEngine(istream& SUV, bool tagFlag, stringstream& T, bool unwrapFlag, bool forgetFlag)
{
    if (phase != ready)
        throw Exception("The phase must be ready to call Motorist::StartEngine().");
    engine.InjectCollective(SUV, true);
    if (forgetFlag)
        MakeKnot();
    bool res = HandleTag(tagFlag, T, unwrapFlag);
    if (res)
        phase = riding;
    return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
cmpl $0x0, 0x60(%rdi)
jne 0x993f
movl %r9d, %r12d
movl %r8d, %ebp
movq %rcx, %r14
movl %edx, %r15d
movq %rdi, %rbx
addq $0x20, %rdi
pushq $0x1
popq %rdx
callq 0x6880
testb %r12b, %r12b
je 0x9914
movq %rbx, %rdi
callq 0x6830
movzbl %r15b, %esi
movzbl %bpl, %ecx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x64f0
testb %al, %al
je 0x9932
movl $0x1, 0x60(%rbx)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x6890
movq %rax, %rbx
leaq 0x1a1c(%rip), %rsi      # 0xb36d
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x6950
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x6460
xorl %ebp, %ebp
movq 0x564f(%rip), %rsi      # 0xefc8
movq 0x5640(%rip), %rdx      # 0xefc0
movq %rbx, %rdi
callq 0x6390
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x65b0
testb %bpl, %bpl
jne 0x999f
jmp 0x99a7
movq %rax, %r14
movq %rbx, %rdi
callq 0x6520
movq %r14, %rdi
callq 0x6980
nop
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: Motorist::MakeKnot()
void Motorist::MakeKnot()
{
    stringstream Tprime;
    engine.GetTags(Tprime, vector<unsigned int>(Pi, cprime/8));
    Tprime.seekg(0, ios_base::beg);
    engine.InjectCollective(Tprime, false);
}

// Assembly:
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, %rbx
leaq 0x28(%rsp), %rdi
callq 0x6a50
movl (%rbx), %esi
movl 0x58(%rbx), %eax
shrl $0x3, %eax
leaq 0xc(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xb(%rsp), %rcx
callq 0x6570
addq $0x20, %rbx
leaq 0x38(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x65c0
leaq 0x10(%rsp), %rdi
callq 0x62d0
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6210
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x6880
leaq 0x28(%rsp), %rdi
callq 0x6a70
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x62d0
jmp 0x9a47
jmp 0x9a44
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x6a70
movq %rbx, %rdi
callq 0x6980
nop
// File: /workspace/github_c_makefile_star2_O2/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 0x6a50
testl %r15d, %r15d
je 0x9b26
movl (%rbx), %esi
leaq 0x8(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x28(%rsp), %rdi
leaq 0x40(%rsp), %rcx
callq 0x6570
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 0x65c0
leaq 0x78(%rsp), %rsi
testb %bpl, %bpl
je 0x9b5c
leaq 0x8(%rsp), %rdi
callq 0x66e0
addq $0x18, %r14
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x66e0
leaq 0x8(%rsp), %r14
leaq 0x40(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x69b0
movl %eax, %ebp
movq %r15, %rdi
callq 0x65b0
movq %r14, %rdi
callq 0x65b0
testb %bpl, %bpl
je 0x9b81
movl $0x2, 0x60(%rbx)
leaq 0x28(%rsp), %rdi
callq 0x62d0
xorl %ebx, %ebx
jmp 0x9b8d
movl (%rbx), %esi
leaq 0x40(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rcx
callq 0x6570
leaq 0x70(%rsp), %rsi
addq $0x20, %rbx
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x65c0
leaq 0x8(%rsp), %rdi
jmp 0x9b86
leaq 0x8(%rsp), %rdi
callq 0x66e0
addq $0x18, %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x6a20
leaq 0x8(%rsp), %rdi
callq 0x65b0
leaq 0x28(%rsp), %rdi
callq 0x62d0
movb $0x1, %bl
leaq 0x60(%rsp), %rdi
callq 0x6a70
movl %ebx, %eax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9ba9
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x65b0
jmp 0x9bc9
jmp 0x9bc6
jmp 0x9bc6
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x9bce
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x62d0
jmp 0x9bda
jmp 0x9bd7
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x6a70
movq %rbx, %rdi
callq 0x6980
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/riverkeyakv2/ref/Motorist.cpp
// Function: Motorist::Wrap(std::istream&, std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&, std::istream&, std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&, bool, bool)
bool Motorist::Wrap(istream& I, stringstream& O, istream& A, stringstream& T, bool unwrapFlag, bool forgetFlag)
{
    if (phase != riding)
        throw Exception("The phase must be riding to call Motorist::Wrap().");
    if ((!hasMore(I)) && (!hasMore(A)))
        engine.Inject(A);
    while(hasMore(I)) {
        engine.Crypt(I, O, unwrapFlag);
        engine.Inject(A);
    }
    while(hasMore(A))
        engine.Inject(A);
    if ((Pi > 1) || forgetFlag)
        MakeKnot();
    bool res = HandleTag(true, T, unwrapFlag);
    if (!res)
        O.str(string(""));
    return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
cmpl $0x1, 0x60(%rdi)
jne 0x9d18
movl %r9d, %ebp
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
movq %r8, 0x18(%rsp)
movq %rsi, %rdi
callq 0x6100
testb %al, %al
jne 0x9c3c
movq %r12, %rdi
callq 0x6100
testb %al, %al
jne 0x9c3c
leaq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0x6a40
movb 0x80(%rsp), %r15b
movq %r14, 0x10(%rsp)
addq $0x20, %r14
movq %rbx, 0x20(%rsp)
addq $0x10, %rbx
movzbl %bpl, %ebp
movq %r13, %rdi
callq 0x6100
testb %al, %al
je 0x9c83
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x64a0
movq %r14, %rdi
movq %r12, %rsi
callq 0x6a40
jmp 0x9c5a
movq 0x20(%rsp), %rbx
movq %r12, %rdi
callq 0x6100
testb %al, %al
je 0x9ca1
movq %r14, %rdi
movq %r12, %rsi
callq 0x6a40
jmp 0x9c88
movq 0x10(%rsp), %r14
cmpl $0x2, (%r14)
setb %al
xorb $0x1, %r15b
testb %r15b, %al
jne 0x9cbe
movq %r14, %rdi
callq 0x6830
pushq $0x1
popq %rsi
movq %r14, %rdi
movq 0x18(%rsp), %rdx
movl %ebp, %ecx
callq 0x64f0
movl %eax, %ebp
testb %al, %al
jne 0x9d07
leaq 0x1395(%rip), %rsi      # 0xb072
leaq 0x28(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x6950
addq $0x18, %rbx
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x6a20
leaq 0x28(%rsp), %rdi
callq 0x65b0
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x6890
movq %rax, %rbx
leaq 0x167c(%rip), %rsi      # 0xb3a6
leaq 0x28(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x6950
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x6460
xorl %ebp, %ebp
movq 0x5276(%rip), %rsi      # 0xefc8
movq 0x5267(%rip), %rdx      # 0xefc0
movq %rbx, %rdi
callq 0x6390
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x65b0
jmp 0x9d94
movq %rax, %r14
jmp 0x9d94
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x65b0
testb %bpl, %bpl
jne 0x9d8c
jmp 0x9d94
movq %rax, %r14
movq %rbx, %rdi
callq 0x6520
movq %r14, %rdi
callq 0x6980
// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/config_app.c
// Function: uio_get_bar0_mapping
static void *
uio_get_bar0_mapping(const char *pci_addr,
		unsigned int bar_size, void *dev)
{
	char bar0path[PATH_MAX];
	int bar0addrfd;
	void *map;

	snprintf(bar0path, sizeof(bar0path),
			"%s/%s/%s", SYS_DIR, pci_addr, BAR0_FILE);
	bar0addrfd = open(bar0path, O_RDWR | O_SYNC);
	if (bar0addrfd < 0) {
		LOG(ERR, "Failed to open BAR %s", bar0path);
		exit(1);
	}
	map = mmap(0, bar_size, PROT_READ | PROT_WRITE, MAP_SHARED,
			bar0addrfd, 0);
	close(bar0addrfd);
	if (map == MAP_FAILED) {
		printf("ERR:SYSFS: mmap failed\n");
		map = NULL; /* MAP_FAILED is not equal to NULL */
	}
	return map;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movl %esi, %ebx
movq %rdi, %r8
leaq 0xd815(%rip), %rdx      # 0x1b20b
leaq 0xd817(%rip), %rcx      # 0x1b214
leaq 0xd825(%rip), %r9       # 0x1b229
movq %rsp, %r14
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
xorl %eax, %eax
callq 0xd180
movq %r14, %rdi
movl $0x101002, %esi         # imm = 0x101002
xorl %eax, %eax
callq 0xd300
testl %eax, %eax
js 0xda6d
movl %eax, %ebp
movl %ebx, %esi
pushq $0x3
popq %rdx
pushq $0x1
popq %rcx
xorl %edi, %edi
movl %eax, %r8d
xorl %r9d, %r9d
callq 0xd120
movq %rax, %rbx
movl %ebp, %edi
callq 0xd1b0
cmpq $-0x1, %rbx
jne 0xda5e
leaq 0xdb2e(%rip), %rdi      # 0x1b585
callq 0xd0c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %rbp
retq
callq 0xe2eb
leaq 0x27457(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
leaq 0xd7b0(%rip), %rdx      # 0x1b233
movq %rsp, %r9
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19400
pushq $0x1
popq %rdi
callq 0xd3f0
// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/config_app.c
// Function: get_file_val
static unsigned long
get_file_val(const char *file_path)
{
	char content[BUFSIZ];
	FILE *f;

	f = fopen(file_path, "r");
	if (NULL == f) {
		LOG(ERR, "Failed to open %s", file_path);
		exit(1);
	}
	if (fgets(content, sizeof(content), f) == NULL) {
		fclose(f);
		return false;
	}
	fclose(f);
	const unsigned long content_val = strtoul(content, NULL, 16);

	return content_val;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x2008, %rsp           # imm = 0x2008
movq %rdi, %rbx
leaq 0xdedd(%rip), %rsi      # 0x1c150
callq 0xd330
testq %rax, %rax
je 0xe2bc
movq %rax, %r14
movq %rsp, %rdi
movl $0x2000, %esi           # imm = 0x2000
movq %rax, %rdx
callq 0xd1f0
movq %rax, %rbx
movq %r14, %rdi
callq 0xd0f0
testq %rbx, %rbx
je 0xe2af
movq %rsp, %rdi
pushq $0x10
popq %rdx
xorl %esi, %esi
callq 0xd3a0
jmp 0xe2b1
xorl %eax, %eax
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %r14
retq
callq 0xe2eb
leaq 0x26c08(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
leaq 0xd19c(%rip), %rdx      # 0x1b46e
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
movq %rbx, %r9
xorl %eax, %eax
callq 0x19400
pushq $0x1
popq %rdi
callq 0xd3f0
// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/./bb_acc_log.h
// Function: timestamp
static char *timestamp()
{
	char *time_s;
	time_t now = time(NULL);
	const struct tm *gtm = gmtime(&now);
	if (gtm == NULL)
		return NULL;

	time_s = asctime(gtm);
	if (time_s == NULL)
		return NULL;

	time_s[strlen(time_s)-1] = '\0';
	return time_s;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
xorl %ebx, %ebx
xorl %edi, %edi
callq 0xd260
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
callq 0xd360
testq %rax, %rax
je 0xe32c
movq %rax, %rdi
callq 0xd130
testq %rax, %rax
je 0xe32a
movq %rax, %rbx
movq %rax, %rdi
callq 0xd110
movb $0x0, -0x1(%rbx,%rax)
jmp 0xe32c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/acc100/acc100_cfg_app.c
// Function: accFromQgid
int
accFromQgid(int qg_idx, struct acc100_conf *acc100_conf)
{
	int accQg[ACC100_NUM_QGRPS];
	int NumQGroupsPerFn[NUM_ACC];
	int acc, qgIdx, qgIndex = 0;
	for (qgIdx = 0; qgIdx < ACC100_NUM_QGRPS; qgIdx++)
		accQg[qgIdx] = 0;
	NumQGroupsPerFn[UL_4G] = acc100_conf->q_ul_4g.num_qgroups;
	NumQGroupsPerFn[UL_5G] = acc100_conf->q_ul_5g.num_qgroups;
	NumQGroupsPerFn[DL_4G] = acc100_conf->q_dl_4g.num_qgroups;
	NumQGroupsPerFn[DL_5G] = acc100_conf->q_dl_5g.num_qgroups;
	for (acc = UL_4G;  acc < NUM_ACC; acc++)
		for (qgIdx = 0; qgIdx < NumQGroupsPerFn[acc]; qgIdx++)
			accQg[qgIndex++] = acc;
	acc = accQg[qg_idx];
	return acc;
}

// Assembly:
xorl %eax, %eax
cmpq $0x8, %rax
je 0xe34a
andl $0x0, -0x28(%rsp,%rax,4)
incq %rax
jmp 0xe33a
movzwl 0x6(%rsi), %eax
movl %eax, -0x38(%rsp)
movzwl 0x12(%rsi), %eax
movl %eax, -0x34(%rsp)
movzwl 0xc(%rsi), %eax
movl %eax, -0x30(%rsp)
movzwl 0x18(%rsi), %eax
movl %eax, -0x2c(%rsp)
xorl %eax, %eax
xorl %ecx, %ecx
xorl %edx, %edx
cmpq $0x4, %rcx
je 0xe3a0
movl -0x38(%rsp,%rcx,4), %r8d
testl %r8d, %r8d
cmovlel %eax, %r8d
movslq %edx, %rsi
movl %r8d, %edx
addl %esi, %edx
movslq %edx, %r8
cmpq %rsi, %r8
je 0xe39b
movl %ecx, -0x28(%rsp,%rsi,4)
incq %rsi
jmp 0xe38d
incq %rcx
jmp 0xe370
movslq %edi, %rax
movl -0x28(%rsp,%rax,4), %eax
retq
// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/acc100/acc100_cfg_app.c
// Function: qtopFromAcc
void
qtopFromAcc(struct q_topology_t **qtop, int acc_enum,
		struct acc100_conf *acc100_conf)
{
	struct q_topology_t *p_qtop;
	p_qtop = NULL;
	switch (acc_enum) {
	case UL_4G:
		p_qtop = &(acc100_conf->q_ul_4g);
		break;
	case UL_5G:
		p_qtop = &(acc100_conf->q_ul_5g);
		break;
	case DL_4G:
		p_qtop = &(acc100_conf->q_dl_4g);
		break;
	case DL_5G:
		p_qtop = &(acc100_conf->q_dl_5g);
		break;
	default:
		/* NOTREACHED */
		LOG(ERR, "Unexpected error evaluating qtopFromAcc");
		break;
	}
	*qtop = p_qtop;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x3, %esi
ja 0xe3e1
movq %rdx, %r14
movl %esi, %eax
leaq 0xd2cc(%rip), %rcx      # 0x1b68c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x6, %r14
jmp 0xe408
addq $0xc, %r14
jmp 0xe408
addq $0x18, %r14
jmp 0xe408
addq $0x12, %r14
jmp 0xe408
callq 0xf732
leaq 0x26ae3(%rip), %rcx     # 0x34ed0
movq (%rcx), %r8
leaq 0xd2a5(%rip), %rdx      # 0x1b69c
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x19400
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/acc100/acc100_cfg_app.c
// Function: aqDepth
int
aqDepth(int qg_idx, struct acc100_conf *acc100_conf)
{
	struct q_topology_t *q_top = NULL;
	int acc_enum = accFromQgid(qg_idx, acc100_conf);
	qtopFromAcc(&q_top, acc_enum, acc100_conf);
	if (q_top == NULL)
		return 1;
	return MAX(1, q_top->aq_depth_log2);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsp, %r14
andq $0x0, (%r14)
callq 0xe338
movq %r14, %rdi
movl %eax, %esi
movq %rbx, %rdx
callq 0xe3a8
movq (%r14), %rax
testq %rax, %rax
je 0xe44b
movzwl 0x4(%rax), %eax
cmpw $0x1, %ax
adcl $0x0, %eax
movzwl %ax, %eax
jmp 0xe44e
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/acc100/acc100_cfg_app.c
// Function: aqNum
int
aqNum(int qg_idx, struct acc100_conf *acc100_conf)
{
	struct q_topology_t *q_top = NULL;
	int acc_enum = accFromQgid(qg_idx, acc100_conf);
	qtopFromAcc(&q_top, acc_enum, acc100_conf);
	if (q_top == NULL)
		return 0;
	return q_top->num_aqs_per_groups;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsp, %r14
andq $0x0, (%r14)
callq 0xe338
movq %r14, %rdi
movl %eax, %esi
movq %rbx, %rdx
callq 0xe3a8
movq (%r14), %rax
testq %rax, %rax
je 0xe484
movzwl 0x2(%rax), %eax
jmp 0xe486
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/acc100/acc100_cfg_parser.c
// Function: acc100_queue_range_check
int
acc100_queue_range_check(struct q_topology_t q_conf)
{
	if ((q_conf.num_aqs_per_groups < 1) ||
			(q_conf.num_aqs_per_groups > ACC100_NUM_AQS)) {
		printf("ERROR: Number of AQs out of range %d\n",
				q_conf.num_aqs_per_groups);
		return -1;
	}
	if ((q_conf.aq_depth_log2 < 1) ||
			(q_conf.aq_depth_log2 > ACC100_MAX_QDEPTH)) {
		printf("ERROR: AQ Depth out of range %d\n",
				q_conf.aq_depth_log2);
		return -1;
	}
	if (q_conf.num_qgroups > ACC100_NUM_QGRPS) {
		printf("ERROR: Number of QG out of range %d\n",
				q_conf.num_qgroups);
		return -1;
	}
	return 0;
}

// Assembly:
pushq %rax
movq %rdi, %rax
leal -0x110000(%rdi), %ecx
cmpl $0xffefffff, %ecx       # imm = 0xFFEFFFFF
ja 0xf79c
shrl $0x10, %eax
leaq 0xc398(%rip), %rdi      # 0x1bb30
movl %eax, %esi
jmp 0xf7c8
movq %rax, %rcx
shrq $0x20, %rcx
movzwl %cx, %esi
leal -0xd(%rsi), %ecx
cmpl $-0xd, %ecx
ja 0xf7b7
leaq 0xc3a1(%rip), %rdi      # 0x1bb56
jmp 0xf7c8
movzwl %ax, %esi
xorl %eax, %eax
cmpl $0x9, %esi
jb 0xf7d2
leaq 0xc3af(%rip), %rdi      # 0x1bb77
xorl %eax, %eax
callq 0xd160
pushq $-0x1
popq %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/acc100/acc100_cfg_parser.c
// Function: acc100_range_check
int
acc100_range_check(struct acc100_conf *acc100_conf)
{
	uint16_t totalQgs = acc100_conf->q_ul_4g.num_qgroups +
			acc100_conf->q_ul_5g.num_qgroups +
			acc100_conf->q_dl_4g.num_qgroups +
			acc100_conf->q_dl_5g.num_qgroups;
	if (totalQgs > ACC100_NUM_QGRPS) {
		printf("ERROR: Number of Qgroups %d > %d\n",
				totalQgs, ACC100_NUM_QGRPS);
		return -1;
	}
	if (acc100_conf->num_vf_bundles > ACC100_NUM_VFS) {
		printf("ERROR: Number of VFs bundle %d > %d\n",
				acc100_conf->num_vf_bundles, ACC100_NUM_VFS);
		return -1;
	}

	if (acc100_queue_range_check(acc100_conf->q_ul_4g) != 0)
		return -1;
	if (acc100_queue_range_check(acc100_conf->q_dl_4g) != 0)
		return -1;
	if (acc100_queue_range_check(acc100_conf->q_ul_5g) != 0)
		return -1;
	if (acc100_queue_range_check(acc100_conf->q_dl_5g) != 0)
		return -1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movzwl 0x12(%rdi), %eax
addw 0x6(%rdi), %ax
addw 0xc(%rdi), %ax
addw 0x18(%rdi), %ax
cmpw $0x9, %ax
jb 0xf7fb
movzwl %ax, %esi
leaq 0xc3a5(%rip), %rdi      # 0x1bb9c
pushq $0x8
jmp 0xf810
movq %rdi, %rbx
movzwl 0x4(%rdi), %esi
cmpl $0x11, %esi
jb 0xf824
leaq 0xc3b0(%rip), %rdi      # 0x1bbbe
pushq $0x10
popq %rdx
xorl %eax, %eax
callq 0xd160
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl 0x6(%rbx), %eax
movzwl 0xa(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0xf77c
pushq $-0x1
popq %rbp
testl %eax, %eax
jne 0xf81b
movl 0xc(%rbx), %eax
movl 0x10(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0xf77c
testl %eax, %eax
jne 0xf81b
movl 0x12(%rbx), %eax
movzwl 0x16(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0xf77c
testl %eax, %eax
jne 0xf81b
movl 0x18(%rbx), %eax
movl 0x1c(%rbx), %edi
shlq $0x20, %rdi
orq %rax, %rdi
callq 0xf77c
xorl %ebp, %ebp
negl %eax
sbbl %ebp, %ebp
jmp 0xf81b
// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/acc100/acc100_cfg_parser.c
// Function: acc100_parse_conf_file
int
acc100_parse_conf_file(const char *file_name, struct acc100_conf *acc100_conf)
{
	int ret;

	set_default_config(acc100_conf);

	ret = cfg_parse(file_name, acc100_handler, acc100_conf);

	if (ret != 0) {
		printf("ERROR: Config file parser error\n");
		set_default_config(acc100_conf);
		return -1;
	}

	ret = acc100_range_check(acc100_conf);
	if (ret != 0) {
		printf("ERROR: Parameter out of range\n");
		set_default_config(acc100_conf);
		return -1;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0xf8e5
leaq 0xf1(%rip), %rsi        # 0xf98f
movq %r14, %rdi
movq %rbx, %rdx
callq 0x13780
testl %eax, %eax
je 0xf8b6
leaq 0xc4ed(%rip), %rdi      # 0x1bda1
jmp 0xf8c9
movq %rbx, %rdi
callq 0xf7d4
testl %eax, %eax
je 0xf8e1
leaq 0xc4ba(%rip), %rdi      # 0x1bd83
callq 0xd0c0
movq %rbx, %rdi
callq 0xf8e5
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
jmp 0xf8d9
// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/acc100/acc100_cfg_parser.c
// Function: parse_number16
static int
parse_number16(const char *str, uint16_t *value)
{
	uint64_t val = 0;
	char *end;

	if (str == NULL)
		return -EINVAL;

	val = strtoul(str, &end, 0);
	if (val > UINT16_MAX || str == end) {
		printf("ERROR: Invalid value %" PRIu64 "\n", val);
		return -ERANGE;
	}

	*value = (uint16_t) val;
	return 1;
}

// Assembly:
testq %rdi, %rdi
je 0x10098
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %rsi
xorl %edx, %edx
callq 0xd3a0
cmpq $0xffff, %rax           # imm = 0xFFFF
ja 0x1009c
cmpq %r14, (%rsp)
je 0x1009c
movw %ax, (%rbx)
pushq $0x1
jmp 0x100af
pushq $-0x16
popq %rax
retq
leaq 0xbca0(%rip), %rdi      # 0x1bd43
movq %rax, %rsi
xorl %eax, %eax
callq 0xd160
pushq $-0x22
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/intel[P]pf-bb-config/acc100/acc100_cfg_parser.c
// Function: parse_item_no
static int
parse_item_no(const char *full_name, const char *base_name)
{
	int postfix_len, number_start, ret;
	uint16_t item_no = 0;

	postfix_len = strlen(full_name) - strlen(base_name);
	if (postfix_len > 0) {
		number_start = strlen((const char *) base_name);
		ret = parse_number16(&full_name[number_start], &item_no);
		if (ret != 1)
			printf("ERROR: Parsing item (%d) failed (%d)\n", item_no, ret);
	}

	return item_no;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
andw $0x0, 0xe(%rsp)
callq 0xd110
movq %rax, %r15
movq %r14, %rdi
callq 0xd110
subl %eax, %r15d
testl %r15d, %r15d
jle 0x10118
cltq
addq %rax, %rbx
leaq 0xe(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1006a
movzwl (%r14), %ebx
cmpl $0x1, %eax
je 0x1011a
movzwl %bx, %esi
leaq 0xbc50(%rip), %rdi      # 0x1bd5d
movl %eax, %edx
xorl %eax, %eax
callq 0xd160
jmp 0x1011a
xorl %ebx, %ebx
movzwl %bx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq