// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/aescopav2/ref/aes-core.c
// Function: aesc_keyexp
void aesc_keyexp(const uint8_t key[], uint8_t key_sched[])
{
	uint8_t key_sched_0, key_sched_1, key_sched_2, key_sched_3, tmp;
	
	unsigned int i;
	
	block_copy(key_sched, key);
	
	for (i = 16; i < 176; i += 4) {		
		key_sched_0 = key_sched[i - 4];
		key_sched_1 = key_sched[i - 3];
		key_sched_2 = key_sched[i - 2];
		key_sched_3 = key_sched[i - 1];
		
		if (!(i & 0x0f)) {
			tmp = key_sched_0;
			key_sched_0 = sbox(key_sched_1) ^ rcon(i >> 4);
			key_sched_1 = sbox(key_sched_2);
			key_sched_2 = sbox(key_sched_3);
			key_sched_3 = sbox(tmp);
		}
		
		key_sched[i] = key_sched[i - 16] ^ key_sched_0;
		key_sched[i + 1] = key_sched[i - 15] ^ key_sched_1;
		key_sched[i + 2] = key_sched[i - 14] ^ key_sched_2;
		key_sched[i + 3] = key_sched[i - 13] ^ key_sched_3;
	}
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x10(%rsp), %rax
movq -0x8(%rsp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movl $0x10, -0x1c(%rsp)
cmpl $0xb0, -0x1c(%rsp)
jae 0x1418
movq -0x10(%rsp), %rax
movl -0x1c(%rsp), %ecx
subl $0x4, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0x11(%rsp)
movq -0x10(%rsp), %rax
movl -0x1c(%rsp), %ecx
subl $0x3, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0x12(%rsp)
movq -0x10(%rsp), %rax
movl -0x1c(%rsp), %ecx
subl $0x2, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0x13(%rsp)
movq -0x10(%rsp), %rax
movl -0x1c(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0x14(%rsp)
movl -0x1c(%rsp), %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x135d
movb -0x11(%rsp), %al
movb %al, -0x15(%rsp)
movzbl -0x12(%rsp), %eax
movl %eax, %ecx
leaq 0x2d02(%rip), %rax      # 0x4000
movzbl (%rax,%rcx), %eax
movl -0x1c(%rsp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x2dec(%rip), %rcx      # 0x4100
movzbl (%rcx,%rdx), %ecx
xorl %ecx, %eax
movb %al, -0x11(%rsp)
movzbl -0x13(%rsp), %eax
movl %eax, %ecx
leaq 0x2cd4(%rip), %rax      # 0x4000
movb (%rax,%rcx), %al
movb %al, -0x12(%rsp)
movzbl -0x14(%rsp), %eax
movl %eax, %ecx
leaq 0x2cbf(%rip), %rax      # 0x4000
movb (%rax,%rcx), %al
movb %al, -0x13(%rsp)
movzbl -0x15(%rsp), %eax
movl %eax, %ecx
leaq 0x2caa(%rip), %rax      # 0x4000
movb (%rax,%rcx), %al
movb %al, -0x14(%rsp)
movq -0x10(%rsp), %rax
movl -0x1c(%rsp), %ecx
subl $0x10, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movzbl -0x11(%rsp), %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x10(%rsp), %rax
movl -0x1c(%rsp), %ecx
movb %dl, (%rax,%rcx)
movq -0x10(%rsp), %rax
movl -0x1c(%rsp), %ecx
subl $0xf, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movzbl -0x12(%rsp), %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x10(%rsp), %rax
movl -0x1c(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movq -0x10(%rsp), %rax
movl -0x1c(%rsp), %ecx
subl $0xe, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movzbl -0x13(%rsp), %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x10(%rsp), %rax
movl -0x1c(%rsp), %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movq -0x10(%rsp), %rax
movl -0x1c(%rsp), %ecx
subl $0xd, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movzbl -0x14(%rsp), %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x10(%rsp), %rax
movl -0x1c(%rsp), %ecx
addl $0x3, %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x1c(%rsp), %eax
addl $0x4, %eax
movl %eax, -0x1c(%rsp)
jmp 0x127a
retq
nopl (%rax)