// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/HashFast.cpp
// Function: t2::HashBlock(unsigned char const*, t2::HashStateImpl*, void*)
void HashBlock(const uint8_t* block, HashStateImpl* state, void* debug_file_)
{
  const uint32_t* p = (const uint32_t*) block;
  const size_t buffer_size = sizeof(HashState().m_Buffer);

  if (FILE* debug_file = (FILE*) debug_file_)
  {
    const size_t line_size = 16;

    for (size_t i = 0; i < buffer_size; i += line_size)
    {
      for (size_t x = 0; x < line_size; ++x)
      {
        int ch = block[x + i];
        static const char hex[] = "0123456789ABCDEF";
        fputc(hex[(ch & 0xf0) >> 4], debug_file);
        fputc(hex[(ch & 0x0f)     ], debug_file);
        fputc(' ', debug_file);
      }

      fputs(" | ", debug_file);

      for (size_t x = 0; x < line_size; ++x)
      {
        int ch = block[x + i];
        if (isalnum(ch) || ispunct(ch) || ' ' == ch)
          fputc(ch, debug_file);
        else
          fputc('.', debug_file);
      }
      fputc('\n', debug_file);
    }
  }

  static_assert((buffer_size & 63) == 0, "buffer must be multiple of 64 bytes");

  for (size_t i = 0; i < buffer_size/64; ++i)
  {
    for (int v = 0; v < 4; ++v)
    {
      uint32_t v0 = state->m_V[v][0];
      uint32_t v1 = state->m_V[v][1];
      uint32_t v2 = state->m_V[v][2];
      uint32_t v3 = state->m_V[v][3];

      v0 += *p++ * kPrime32_2; v0 = RotateLeft(v0, 13); v0 *= kPrime32_1;
      v1 += *p++ * kPrime32_2; v1 = RotateLeft(v1, 13); v1 *= kPrime32_1;
      v2 += *p++ * kPrime32_2; v2 = RotateLeft(v2, 13); v2 *= kPrime32_1;
      v3 += *p++ * kPrime32_2; v3 = RotateLeft(v3, 13); v3 *= kPrime32_1;

      state->m_V[v][0] = v0;
      state->m_V[v][1] = v1;
      state->m_V[v][2] = v2;
      state->m_V[v][3] = v3;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x40, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x208b5
movq $0x10, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
cmpq $0x40, -0x40(%rbp)
jae 0x208b3
movq $0x0, -0x48(%rbp)
cmpq $0x10, -0x48(%rbp)
jae 0x20812
movq -0x8(%rbp), %rax
movq -0x48(%rbp), %rcx
addq -0x40(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
andl $0xf0, %eax
sarl $0x4, %eax
movslq %eax, %rcx
leaq 0x4f04(%rip), %rax      # 0x256d0
movsbl (%rax,%rcx), %edi
movq -0x30(%rbp), %rsi
callq 0x3410
movl -0x4c(%rbp), %eax
andl $0xf, %eax
movslq %eax, %rcx
leaq 0x4ee7(%rip), %rax      # 0x256d0
movsbl (%rax,%rcx), %edi
movq -0x30(%rbp), %rsi
callq 0x3410
movq -0x30(%rbp), %rsi
movl $0x20, %edi
callq 0x3410
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2079d
movq -0x30(%rbp), %rsi
leaq 0x4ec4(%rip), %rdi      # 0x256e1
callq 0x33a0
movq $0x0, -0x58(%rbp)
cmpq $0x10, -0x58(%rbp)
jae 0x20894
movq -0x8(%rbp), %rax
movq -0x58(%rbp), %rcx
addq -0x40(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %edi
callq 0x3360
cmpl $0x0, %eax
jne 0x20868
movl -0x5c(%rbp), %edi
callq 0x3610
cmpl $0x0, %eax
jne 0x20868
movl $0x20, %eax
cmpl -0x5c(%rbp), %eax
jne 0x20876
movl -0x5c(%rbp), %edi
movq -0x30(%rbp), %rsi
callq 0x3410
jmp 0x20884
movq -0x30(%rbp), %rsi
movl $0x2e, %edi
callq 0x3410
jmp 0x20886
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x2082a
movq -0x30(%rbp), %rsi
movl $0xa, %edi
callq 0x3410
movq -0x40(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x40(%rbp)
jmp 0x2078a
jmp 0x208b5
movq $0x0, -0x68(%rbp)
cmpq $0x1, -0x68(%rbp)
jae 0x20a74
movl $0x0, -0x6c(%rbp)
cmpl $0x4, -0x6c(%rbp)
jge 0x20a61
movq -0x10(%rbp), %rax
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x10(%rbp), %rax
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x74(%rbp)
movq -0x10(%rbp), %rax
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x7c(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x20(%rbp)
imull $0x85ebca77, (%rax), %eax # imm = 0x85EBCA77
addl -0x70(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %edi
movl $0xd, %esi
callq 0x20a80
movl %eax, -0x70(%rbp)
imull $0x9e3779b1, -0x70(%rbp), %eax # imm = 0x9E3779B1
movl %eax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x20(%rbp)
imull $0x85ebca77, (%rax), %eax # imm = 0x85EBCA77
addl -0x74(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %edi
movl $0xd, %esi
callq 0x20a80
movl %eax, -0x74(%rbp)
imull $0x9e3779b1, -0x74(%rbp), %eax # imm = 0x9E3779B1
movl %eax, -0x74(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x20(%rbp)
imull $0x85ebca77, (%rax), %eax # imm = 0x85EBCA77
addl -0x78(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %edi
movl $0xd, %esi
callq 0x20a80
movl %eax, -0x78(%rbp)
imull $0x9e3779b1, -0x78(%rbp), %eax # imm = 0x9E3779B1
movl %eax, -0x78(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x20(%rbp)
imull $0x85ebca77, (%rax), %eax # imm = 0x85EBCA77
addl -0x7c(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %edi
movl $0xd, %esi
callq 0x20a80
movl %eax, -0x7c(%rbp)
imull $0x9e3779b1, -0x7c(%rbp), %eax # imm = 0x9E3779B1
movl %eax, -0x7c(%rbp)
movl -0x70(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq -0x6c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0x74(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq -0x6c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x78(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq -0x6c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x7c(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq -0x6c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x208cf
jmp 0x20a63
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x208bd
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)