// File: /workspace/github_c_makefile_star2_O0/ataradov[P]edbg/utils.c
// Function: sha256_process
static void sha256_process(uint32_t *H, uint8_t *data)
{
  uint32_t W[64];
  uint32_t ah[8]; // Working variables 'a' to 'h'

  for (int t = 0; t < 16; t++)
    W[t] = (data[t*4] << 24) | (data[t*4+1] << 16) | (data[t*4+2] << 8) | (data[t*4+3]);

  for (int t = 16; t < 64; t++)
    W[t] = SL1(W[t-2]) + W[t-7] + SL0(W[t-15]) + W[t-16];

  for(int t = 0; t < 8; t++)
    ah[t] = H[t];

  for (int t = 0; t < 64; t++)
  {
    uint32_t T1 = ah[7] + SU1(ah[4]) + CH(ah[4], ah[5], ah[6]) + K[t] + W[t];
    uint32_t T2 = SU0(ah[0]) + MAJ(ah[0], ah[1], ah[2]);

    ah[7] = ah[6];
    ah[6] = ah[5];
    ah[5] = ah[4];
    ah[4] = ah[3] + T1;
    ah[3] = ah[2];
    ah[2] = ah[1];
    ah[1] = ah[0];
    ah[0] = T1 + T2;
  }

  for (int t = 0; t < 8; t++)
    H[t] += ah[t];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x134(%rbp)
cmpl $0x10, -0x134(%rbp)
jge 0x9ee4
movq -0x10(%rbp), %rax
movl -0x134(%rbp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %ecx
shll $0x18, %ecx
movq -0x10(%rbp), %rax
movl -0x134(%rbp), %edx
shll $0x2, %edx
addl $0x1, %edx
movslq %edx, %rdx
movzbl (%rax,%rdx), %eax
shll $0x10, %eax
orl %eax, %ecx
movq -0x10(%rbp), %rax
movl -0x134(%rbp), %edx
shll $0x2, %edx
addl $0x2, %edx
movslq %edx, %rdx
movzbl (%rax,%rdx), %eax
shll $0x8, %eax
orl %eax, %ecx
movq -0x10(%rbp), %rax
movl -0x134(%rbp), %edx
shll $0x2, %edx
addl $0x3, %edx
movslq %edx, %rdx
movzbl (%rax,%rdx), %eax
orl %eax, %ecx
movslq -0x134(%rbp), %rax
movl %ecx, -0x110(%rbp,%rax,4)
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0x9e4d
movl $0x10, -0x138(%rbp)
cmpl $0x40, -0x138(%rbp)
jge 0xa02a
movl -0x138(%rbp), %eax
subl $0x2, %eax
cltq
movl -0x110(%rbp,%rax,4), %ecx
shrl $0x11, %ecx
movl -0x138(%rbp), %eax
subl $0x2, %eax
cltq
movl -0x110(%rbp,%rax,4), %eax
shll $0xf, %eax
orl %eax, %ecx
movl -0x138(%rbp), %eax
subl $0x2, %eax
cltq
movl -0x110(%rbp,%rax,4), %eax
shrl $0x13, %eax
movl -0x138(%rbp), %edx
subl $0x2, %edx
movslq %edx, %rdx
movl -0x110(%rbp,%rdx,4), %edx
shll $0xd, %edx
orl %edx, %eax
xorl %eax, %ecx
movl -0x138(%rbp), %eax
subl $0x2, %eax
cltq
movl -0x110(%rbp,%rax,4), %eax
shrl $0xa, %eax
xorl %eax, %ecx
movl -0x138(%rbp), %eax
subl $0x7, %eax
cltq
addl -0x110(%rbp,%rax,4), %ecx
movl -0x138(%rbp), %eax
subl $0xf, %eax
cltq
movl -0x110(%rbp,%rax,4), %eax
shrl $0x7, %eax
movl -0x138(%rbp), %edx
subl $0xf, %edx
movslq %edx, %rdx
movl -0x110(%rbp,%rdx,4), %edx
shll $0x19, %edx
orl %edx, %eax
movl -0x138(%rbp), %edx
subl $0xf, %edx
movslq %edx, %rdx
movl -0x110(%rbp,%rdx,4), %edx
shrl $0x12, %edx
movl -0x138(%rbp), %esi
subl $0xf, %esi
movslq %esi, %rsi
movl -0x110(%rbp,%rsi,4), %esi
shll $0xe, %esi
orl %esi, %edx
xorl %edx, %eax
movl -0x138(%rbp), %edx
subl $0xf, %edx
movslq %edx, %rdx
movl -0x110(%rbp,%rdx,4), %edx
shrl $0x3, %edx
xorl %edx, %eax
addl %eax, %ecx
movl -0x138(%rbp), %eax
subl $0x10, %eax
cltq
addl -0x110(%rbp,%rax,4), %ecx
movslq -0x138(%rbp), %rax
movl %ecx, -0x110(%rbp,%rax,4)
movl -0x138(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x138(%rbp)
jmp 0x9eee
movl $0x0, -0x13c(%rbp)
cmpl $0x8, -0x13c(%rbp)
jge 0xa06a
movq -0x8(%rbp), %rax
movslq -0x13c(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movslq -0x13c(%rbp), %rax
movl %ecx, -0x130(%rbp,%rax,4)
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0xa034
movl $0x0, -0x140(%rbp)
cmpl $0x40, -0x140(%rbp)
jge 0xa1fd
movl -0x114(%rbp), %eax
movl -0x120(%rbp), %ecx
shrl $0x6, %ecx
movl -0x120(%rbp), %edx
shll $0x1a, %edx
orl %edx, %ecx
movl -0x120(%rbp), %edx
shrl $0xb, %edx
movl -0x120(%rbp), %esi
shll $0x15, %esi
orl %esi, %edx
xorl %edx, %ecx
movl -0x120(%rbp), %edx
shrl $0x19, %edx
movl -0x120(%rbp), %esi
shll $0x7, %esi
orl %esi, %edx
xorl %edx, %ecx
addl %ecx, %eax
movl -0x120(%rbp), %ecx
andl -0x11c(%rbp), %ecx
movl -0x120(%rbp), %edx
xorl $-0x1, %edx
andl -0x118(%rbp), %edx
xorl %edx, %ecx
addl %ecx, %eax
movslq -0x140(%rbp), %rdx
leaq 0xb70a(%rip), %rcx      # 0x15800
addl (%rcx,%rdx,4), %eax
movslq -0x140(%rbp), %rcx
addl -0x110(%rbp,%rcx,4), %eax
movl %eax, -0x144(%rbp)
movl -0x130(%rbp), %eax
shrl $0x2, %eax
movl -0x130(%rbp), %ecx
shll $0x1e, %ecx
orl %ecx, %eax
movl -0x130(%rbp), %ecx
shrl $0xd, %ecx
movl -0x130(%rbp), %edx
shll $0x13, %edx
orl %edx, %ecx
xorl %ecx, %eax
movl -0x130(%rbp), %ecx
shrl $0x16, %ecx
movl -0x130(%rbp), %edx
shll $0xa, %edx
orl %edx, %ecx
xorl %ecx, %eax
movl -0x130(%rbp), %ecx
andl -0x12c(%rbp), %ecx
movl -0x130(%rbp), %edx
andl -0x128(%rbp), %edx
xorl %edx, %ecx
movl -0x12c(%rbp), %edx
andl -0x128(%rbp), %edx
xorl %edx, %ecx
addl %ecx, %eax
movl %eax, -0x148(%rbp)
movl -0x118(%rbp), %eax
movl %eax, -0x114(%rbp)
movl -0x11c(%rbp), %eax
movl %eax, -0x118(%rbp)
movl -0x120(%rbp), %eax
movl %eax, -0x11c(%rbp)
movl -0x124(%rbp), %eax
addl -0x144(%rbp), %eax
movl %eax, -0x120(%rbp)
movl -0x128(%rbp), %eax
movl %eax, -0x124(%rbp)
movl -0x12c(%rbp), %eax
movl %eax, -0x128(%rbp)
movl -0x130(%rbp), %eax
movl %eax, -0x12c(%rbp)
movl -0x144(%rbp), %eax
addl -0x148(%rbp), %eax
movl %eax, -0x130(%rbp)
movl -0x140(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x140(%rbp)
jmp 0xa074
movl $0x0, -0x14c(%rbp)
cmpl $0x8, -0x14c(%rbp)
jge 0xa240
movslq -0x14c(%rbp), %rax
movl -0x130(%rbp,%rax,4), %edx
movq -0x8(%rbp), %rax
movslq -0x14c(%rbp), %rcx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movl -0x14c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14c(%rbp)
jmp 0xa207
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax)