// File: /workspace/github_cpp_makefile_star2_O3/koraa[P]sbcrack/cube/crypto.cpp
// Function: tiger::hash(unsigned char const*, int, tiger::hashval&)
void hash(const uchar *str, int length, hashval &val)
    {
        static bool init = false;
        if(!init) { gensboxes(); init = true; }

        uchar temp[64];

        val.chunks[0] = 0x0123456789ABCDEFULL;
        val.chunks[1] = 0xFEDCBA9876543210ULL;
        val.chunks[2] = 0xF096A5B4C3B2E187ULL;

        int i = length;
        for(; i >= 64; i -= 64, str += 64)
        {
            if(!*(const uchar *)&islittleendian)
            {
                loopj(64) temp[j^7] = str[j];
                compress((chunk *)temp, val.chunks);
            }
            else compress((chunk *)str, val.chunks);
        }

        int j;
        if(!*(const uchar *)&islittleendian)
        {
            for(j = 0; j < i; j++) temp[j^7] = str[j];
            temp[j^7] = 0x01;
            while(++j&7) temp[j^7] = 0;
        }
        else
        {
            for(j = 0; j < i; j++) temp[j] = str[j];
            temp[j] = 0x01;
            while(++j&7) temp[j] = 0;
        }

        if(j > 56)
        {
            while(j < 64) temp[j++] = 0;
            compress((chunk *)temp, val.chunks);
            j = 0;
        }
        while(j < 56) temp[j++] = 0;
        *(chunk *)(temp+56) = (chunk)length<<3;
        compress((chunk *)temp, val.chunks);
        if(!*(const uchar *)&islittleendian)
        {
            loopk(3) 
            {
                uchar *c = &val.bytes[k*sizeof(chunk)];
                loopl(sizeof(chunk)/2) swap(c[l], c[sizeof(chunk)-1-l]);
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
cmpb $0x0, 0x9654(%rip)      # 0xb0c0
jne 0x1a7a
callq 0x1946
movb $0x1, 0x9646(%rip)      # 0xb0c0
movabsq $0x123456789abcdef, %rax # imm = 0x123456789ABCDEF
movq %rax, (%rbx)
movabsq $-0x123456789abcdf0, %rax # imm = 0xFEDCBA9876543210
movq %rax, 0x8(%rbx)
movabsq $-0xf695a4b3c4d1e79, %rax # imm = 0xF096A5B4C3B2E187
movq %rax, 0x10(%rbx)
cmpl $0x40, %ebp
jl 0x1ac9
movl %ebp, %r15d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x131c
leal -0x40(%r15), %eax
addq $0x40, %r14
cmpl $0x7f, %r15d
movl %eax, %r15d
ja 0x1aab
jmp 0x1acb
movl %ebp, %eax
testl %eax, %eax
jle 0x1af2
movl %eax, %r15d
xorl %ecx, %ecx
movb (%r14,%rcx), %dl
movb %dl, (%rsp,%rcx)
incq %rcx
cmpq %rcx, %r15
jne 0x1ad4
movb $0x1, (%rsp,%r15)
leal 0x1(%rax), %ecx
testb $0x7, %cl
jne 0x1afb
jmp 0x1b28
movb $0x1, (%rsp)
xorl %r15d, %r15d
xorl %eax, %eax
movq %rsp, %rcx
leaq (%r15,%rcx), %rdi
incq %rdi
movl $0x6, %edx
subl %eax, %edx
andl $0x7, %edx
incl %edx
xorl %esi, %esi
callq 0x1060
movl %r15d, %eax
leal 0x2(%rax), %ecx
incl %eax
testb $0x7, %cl
jne 0x1b1b
leal 0x1(%rax), %ecx
cmpl $0x38, %eax
jb 0x1b55
cmpl $0x3f, %ecx
ja 0x1b46
movl %ecx, %eax
leaq (%rsp,%rax), %rdi
movl $0x40, %edx
subl %ecx, %edx
xorl %esi, %esi
callq 0x1060
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x131c
xorl %ecx, %ecx
jmp 0x1b5a
cmpl $0x37, %ecx
jg 0x1b72
movslq %ecx, %rax
leaq (%rsp,%rax), %rdi
movl $0x37, %edx
subl %eax, %edx
incq %rdx
xorl %esi, %esi
callq 0x1060
movslq %ebp, %rax
shlq $0x3, %rax
movq %rsp, %rdi
movq %rax, 0x38(%rdi)
movq %rbx, %rsi
callq 0x131c
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq