// File: /workspace/github_c_makefile_star2_O3/skeeto[P]enchive/src/sha256.c
// Function: sha256_transform
void sha256_transform(SHA256_CTX *ctx, const uint8_t data[])
{
	uint32_t a, b, c, d, e, f, g, h, i, j, t1, t2, m[64];

	for (i = 0, j = 0; i < 16; ++i, j += 4)
		m[i] = (data[j] << 24) | (data[j + 1] << 16) | (data[j + 2] << 8) | (data[j + 3]);
	for ( ; i < 64; ++i)
		m[i] = SIG1(m[i - 2]) + m[i - 7] + SIG0(m[i - 15]) + m[i - 16];

	a = ctx->state[0];
	b = ctx->state[1];
	c = ctx->state[2];
	d = ctx->state[3];
	e = ctx->state[4];
	f = ctx->state[5];
	g = ctx->state[6];
	h = ctx->state[7];

	for (i = 0; i < 64; ++i) {
		t1 = h + EP1(e) + CH(e,f,g) + k[i] + m[i];
		t2 = EP0(a) + MAJ(a,b,c);
		h = g;
		g = f;
		f = e;
		e = d + t1;
		d = c;
		c = b;
		b = a;
		a = t1 + t2;
	}

	ctx->state[0] += a;
	ctx->state[1] += b;
	ctx->state[2] += c;
	ctx->state[3] += d;
	ctx->state[4] += e;
	ctx->state[5] += f;
	ctx->state[6] += g;
	ctx->state[7] += h;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
xorl %eax, %eax
pxor %xmm0, %xmm0
movzbl 0x4(%rsi,%rax,4), %ecx
movzbl (%rsi,%rax,4), %edx
movd %edx, %xmm2
pinsrw $0x2, %ecx, %xmm2
movzbl 0x8(%rsi,%rax,4), %ecx
pinsrw $0x4, %ecx, %xmm2
movzbl 0xc(%rsi,%rax,4), %ecx
pinsrw $0x6, %ecx, %xmm2
pslld $0x18, %xmm2
movzbl 0x1(%rsi,%rax,4), %ecx
movzbl 0x5(%rsi,%rax,4), %edx
movzbl 0x9(%rsi,%rax,4), %r8d
shll $0x8, %edx
orl %ecx, %edx
shll $0x10, %r8d
orl %edx, %r8d
movzbl 0xd(%rsi,%rax,4), %ecx
shll $0x18, %ecx
orl %r8d, %ecx
movd %ecx, %xmm3
punpcklbw %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3],xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
pxor %xmm1, %xmm1
punpcklwd %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1],xmm1[2],xmm3[2],xmm1[3],xmm3[3]
por %xmm2, %xmm1
movzbl 0x2(%rsi,%rax,4), %ecx
movzbl 0x6(%rsi,%rax,4), %edx
movzbl 0xa(%rsi,%rax,4), %r8d
shll $0x8, %edx
orl %ecx, %edx
shll $0x10, %r8d
orl %edx, %r8d
movzbl 0xe(%rsi,%rax,4), %ecx
shll $0x18, %ecx
orl %r8d, %ecx
movd %ecx, %xmm2
punpcklbw %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3],xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
pslld $0x8, %xmm2
movzbl 0x3(%rsi,%rax,4), %ecx
movzbl 0x7(%rsi,%rax,4), %edx
movzbl 0xb(%rsi,%rax,4), %r8d
shll $0x8, %edx
orl %ecx, %edx
shll $0x10, %r8d
orl %edx, %r8d
movzbl 0xf(%rsi,%rax,4), %ecx
shll $0x18, %ecx
orl %r8d, %ecx
movd %ecx, %xmm3
punpcklbw %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3],xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
punpcklwd %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3]
por %xmm2, %xmm3
por %xmm1, %xmm3
movdqa %xmm3, -0x60(%rsp,%rax,4)
addq $0x4, %rax
cmpq $0x10, %rax
jne 0x6d97
movl $0x10, %eax
movl -0x60(%rsp), %ecx
movl -0x9c(%rsp,%rax,4), %edx
movl -0x68(%rsp,%rax,4), %esi
movl %esi, %r8d
roll $0xf, %r8d
movl %esi, %r9d
roll $0xd, %r9d
xorl %r8d, %r9d
shrl $0xa, %esi
xorl %r9d, %esi
addl -0x7c(%rsp,%rax,4), %esi
movl %edx, %r8d
roll $0x19, %r8d
movl %edx, %r9d
roll $0xe, %r9d
xorl %r8d, %r9d
movl %edx, %r8d
shrl $0x3, %r8d
xorl %r9d, %r8d
addl %ecx, %r8d
addl %esi, %r8d
movl %r8d, -0x60(%rsp,%rax,4)
incq %rax
movl %edx, %ecx
cmpq $0x40, %rax
jne 0x6e8d
movl 0x50(%rdi), %r11d
movl 0x54(%rdi), %r12d
movl 0x58(%rdi), %ecx
movl 0x5c(%rdi), %r9d
movl 0x60(%rdi), %r8d
movl 0x64(%rdi), %ebp
movl 0x68(%rdi), %ebx
movl 0x6c(%rdi), %r14d
xorl %r15d, %r15d
leaq 0x20b5(%rip), %r13      # 0x8fc0
movl %r11d, -0x80(%rsp)
movl %r12d, -0x7c(%rsp)
movl %r14d, -0x64(%rsp)
movl %ebx, -0x68(%rsp)
movl %ebp, -0x6c(%rsp)
movl %r8d, -0x70(%rsp)
movl %r9d, -0x74(%rsp)
movl %ecx, -0x78(%rsp)
movl %ecx, %edx
movl %r8d, %eax
movl %ebp, %r10d
roll $0x1a, %r8d
movl %ebx, %esi
movl %eax, %ebx
roll $0x15, %ebx
movl %r12d, %ecx
movl %eax, %ebp
roll $0x7, %ebp
xorl %r8d, %ebx
xorl %ebx, %ebp
movl %r10d, %ebx
xorl %esi, %ebx
andl %eax, %ebx
xorl %esi, %ebx
addl %r14d, %ebx
addl %ebp, %ebx
addl (%r15,%r13), %ebx
addl -0x60(%rsp,%r15), %ebx
movl %r11d, %r12d
movl %r11d, %r8d
roll $0x1e, %r8d
roll $0x13, %r11d
xorl %r8d, %r11d
movl %r12d, %r8d
roll $0xa, %r8d
xorl %r11d, %r8d
movl %ecx, %ebp
xorl %edx, %ebp
andl %r12d, %ebp
movl %ecx, %r11d
andl %edx, %r11d
xorl %ebp, %r11d
addl %r8d, %r11d
movl %r9d, %r8d
addl %ebx, %r8d
addl %ebx, %r11d
addq $0x4, %r15
movl %esi, %r14d
movl %r10d, %ebx
movl %eax, %ebp
movl %edx, %r9d
cmpq $0x100, %r15            # imm = 0x100
jne 0x6f30
addl -0x80(%rsp), %r11d
movl %r11d, 0x50(%rdi)
addl -0x7c(%rsp), %r12d
movl %r12d, 0x54(%rdi)
addl -0x78(%rsp), %ecx
movl %ecx, 0x58(%rdi)
addl -0x74(%rsp), %edx
movl %edx, 0x5c(%rdi)
addl -0x70(%rsp), %r8d
movl %r8d, 0x60(%rdi)
addl -0x6c(%rsp), %eax
movl %eax, 0x64(%rdi)
addl -0x68(%rsp), %r10d
movl %r10d, 0x68(%rdi)
addl -0x64(%rsp), %esi
movl %esi, 0x6c(%rdi)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq