// File: /workspace/github_cpp_makefile_star2_O1/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
jg 0x1aab
jmp 0x1acb
movl %ebp, %eax
testl %eax, %eax
jle 0x1ae4
movl %eax, %ecx
xorl %eax, %eax
movb (%r14,%rax), %dl
movb %dl, (%rsp,%rax)
incq %rax
cmpq %rax, %rcx
jne 0x1ad3
jmp 0x1ae6
xorl %eax, %eax
movl %eax, %r14d
movb $0x1, (%rsp,%r14)
leal 0x1(%rax), %ecx
testb $0x7, %cl
je 0x1b22
leaq (%rsp,%r14), %rdi
incq %rdi
movl $0x6, %edx
subl %eax, %edx
andl $0x7, %edx
incl %edx
xorl %esi, %esi
callq 0x1060
leal 0x2(%r14), %eax
incq %r14
testb $0x7, %al
jne 0x1b10
leal 0x1(%r14), %ecx
movl %r14d, %eax
cmpl $0x38, %eax
jb 0x1b4d
cmpl $0x3f, %ecx
ja 0x1b40
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
cmpl $0x37, %ecx
jg 0x1b6a
movslq %ecx, %rax
leaq (%rsp,%rax), %rdi
movl $0x37, %edx
subl %ecx, %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