// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: MIX
void MIX(u8 byte1[], u8 byte2[], unsigned int blen){
    u8 temp[blen];
    u8 tempbyte;
    int i;
    u8 carry;

    memcpy(temp, byte1, blen);
    xor_byte_string(byte2, temp, blen);

    /*left rotate temp[] by one bit*/
    carry=temp[0]>>7;
    for(i=blen-1; i>=0; --i){
        tempbyte=temp[i];
        temp[i]=tempbyte<<1;
        temp[i]|=carry;
        carry=tempbyte>>7;
    }

    xor_byte_string(temp, byte1, blen);
    xor_byte_string(temp, byte2, blen);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r13d
movq %rsi, %rbx
movq %rdi, %r15
movl %edx, %r12d
movq %rsp, %r14
leaq 0xf(%r12), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2240
movabsq $0x1ffffffe0, %rsi      # imm = 0x1FFFFFFE0
testl %r13d, %r13d
je 0x394f
leaq 0x1f(%r12), %rax
andq %rsi, %rax
leaq -0x1(%r12), %rcx
vpbroadcastq %rcx, %ymm0
xorl %ecx, %ecx
vpmovsxbq 0x8950(%rip), %ymm1 # 0xc1a4
vpmovsxbq 0x894b(%rip), %ymm2 # 0xc1a8
vpmovsxbq 0x8946(%rip), %ymm3 # 0xc1ac
vpmovsxbq 0x8941(%rip), %ymm4 # 0xc1b0
vpmovsxbq 0x893c(%rip), %ymm5 # 0xc1b4
vpmovsxbq 0x8937(%rip), %ymm6 # 0xc1b8
vpmovsxbq 0x8932(%rip), %ymm7 # 0xc1bc
vpmovsxbq 0x892d(%rip), %ymm8 # 0xc1c0
vpbroadcastq %rcx, %ymm9
vpor %ymm1, %ymm9, %ymm10
vpor %ymm2, %ymm9, %ymm11
vpor %ymm3, %ymm9, %ymm12
vpor %ymm4, %ymm9, %ymm13
vpor %ymm5, %ymm9, %ymm14
vpor %ymm6, %ymm9, %ymm15
vporq %ymm7, %ymm9, %ymm16
vpor %ymm8, %ymm9, %ymm9
vpcmpleuq %ymm0, %ymm9, %k0
vpcmpleuq %ymm0, %ymm16, %k1
kshiftlb $0x4, %k1, %k1
korb %k1, %k0, %k0
vpcmpleuq %ymm0, %ymm15, %k1
vpcmpleuq %ymm0, %ymm14, %k2
kshiftlb $0x4, %k2, %k2
korb %k2, %k1, %k1
kunpckbw %k0, %k1, %k0
vpcmpleuq %ymm0, %ymm13, %k1
vpcmpleuq %ymm0, %ymm12, %k2
kshiftlb $0x4, %k2, %k2
korb %k2, %k1, %k1
vpcmpleuq %ymm0, %ymm11, %k2
vpcmpleuq %ymm0, %ymm10, %k3
kshiftlb $0x4, %k3, %k3
korb %k3, %k2, %k2
kunpckbw %k1, %k2, %k1
kunpckwd %k0, %k1, %k1
vmovdqu8 (%rbx,%rcx), %ymm9 {%k1} {z}
vmovdqu8 (%r14,%rcx), %ymm10 {%k1} {z}
vpxor %ymm9, %ymm10, %ymm9
vmovdqu8 %ymm9, (%r14,%rcx) {%k1}
addq $0x20, %rcx
cmpq %rcx, %rax
jne 0x3893
movl %r13d, %eax
decl %eax
js 0x3ad8
movl %eax, %ecx
addl $0x20, %eax
vpbroadcastb (%r14), %ymm11
andl $-0x20, %eax
vpbroadcastq %rcx, %ymm0
addq %r14, %rcx
addq $-0x1f, %rcx
xorl %edx, %edx
vpmovsxbq 0x8825(%rip), %ymm1 # 0xc1a4
vpmovsxbq 0x8820(%rip), %ymm2 # 0xc1a8
vpmovsxbq 0x881b(%rip), %ymm3 # 0xc1ac
vpmovsxbq 0x8816(%rip), %ymm4 # 0xc1b0
vpmovsxbq 0x8811(%rip), %ymm5 # 0xc1b4
vpmovsxbq 0x880c(%rip), %ymm6 # 0xc1b8
vpmovsxbq 0x8807(%rip), %ymm7 # 0xc1bc
vpmovsxbq 0x8802(%rip), %ymm8 # 0xc1c0
vbroadcasti128 0x8809(%rip), %ymm9 # ymm9 = mem[0,1,0,1]
vpbroadcastd 0x87d0(%rip), %ymm10 # 0xc1a0
vpbroadcastq %rdx, %ymm12
vpor %ymm1, %ymm12, %ymm13
vpor %ymm2, %ymm12, %ymm14
vpor %ymm3, %ymm12, %ymm15
vporq %ymm4, %ymm12, %ymm16
vporq %ymm5, %ymm12, %ymm17
vporq %ymm6, %ymm12, %ymm18
vporq %ymm7, %ymm12, %ymm19
vpor %ymm8, %ymm12, %ymm12
vpcmpleuq %ymm0, %ymm12, %k0
vpcmpleuq %ymm0, %ymm19, %k1
kshiftlb $0x4, %k1, %k1
korb %k1, %k0, %k0
vpcmpleuq %ymm0, %ymm18, %k1
vpcmpleuq %ymm0, %ymm17, %k2
kshiftlb $0x4, %k2, %k2
korb %k2, %k1, %k1
kunpckbw %k0, %k1, %k0
vpcmpleuq %ymm0, %ymm16, %k1
vpcmpleuq %ymm0, %ymm15, %k2
kshiftlb $0x4, %k2, %k2
korb %k2, %k1, %k1
vpcmpleuq %ymm0, %ymm14, %k2
vpcmpleuq %ymm0, %ymm13, %k3
kshiftlb $0x4, %k3, %k3
korb %k3, %k2, %k2
kunpckbw %k1, %k2, %k1
kunpckwd %k0, %k1, %k0
vpmovm2b %k0, %ymm12
vpshufb %ymm9, %ymm12, %ymm12
vpermq $0x4e, %ymm12, %ymm12   # ymm12 = ymm12[2,3,0,1]
vpmovb2m %ymm12, %k1
vmovdqu8 (%rcx), %ymm12 {%k1} {z}
vpshufb %ymm9, %ymm12, %ymm12
vperm2i128 $0x31, %ymm12, %ymm11, %ymm11 # ymm11 = ymm11[2,3],ymm12[2,3]
vpermq $0x4e, %ymm12, %ymm12   # ymm12 = ymm12[2,3,0,1]
vpalignr $0xf, %ymm11, %ymm12, %ymm11 # ymm11 = ymm11[15],ymm12[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],ymm11[31],ymm12[16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
vpsrlw $0x7, %ymm11, %ymm11
vpaddw %ymm12, %ymm12, %ymm13
vpternlogd $0xe4, %ymm10, %ymm11, %ymm13
vpshufb %ymm9, %ymm13, %ymm11
vpermq $0x4e, %ymm11, %ymm11   # ymm11 = ymm11[2,3,0,1]
vmovdqu8 %ymm11, (%rcx) {%k1}
addq $0x20, %rdx
addq $-0x20, %rcx
vmovdqa %ymm12, %ymm11
cmpq %rdx, %rax
jne 0x39d0
testl %r13d, %r13d
je 0x3cb6
leaq 0x1f(%r12), %rax
andq %rsi, %rax
decq %r12
vpbroadcastq %r12, %ymm0
xorl %ecx, %ecx
vpmovsxbq 0x86a7(%rip), %ymm1 # 0xc1a4
vpmovsxbq 0x86a2(%rip), %ymm2 # 0xc1a8
vpmovsxbq 0x869d(%rip), %ymm3 # 0xc1ac
vpmovsxbq 0x8698(%rip), %ymm4 # 0xc1b0
vpmovsxbq 0x8693(%rip), %ymm5 # 0xc1b4
vpmovsxbq 0x868e(%rip), %ymm6 # 0xc1b8
vpmovsxbq 0x8689(%rip), %ymm7 # 0xc1bc
vpmovsxbq 0x8684(%rip), %ymm8 # 0xc1c0
vpbroadcastq %rcx, %ymm9
vpor %ymm1, %ymm9, %ymm10
vpor %ymm2, %ymm9, %ymm11
vpor %ymm3, %ymm9, %ymm12
vpor %ymm4, %ymm9, %ymm13
vpor %ymm5, %ymm9, %ymm14
vpor %ymm6, %ymm9, %ymm15
vporq %ymm7, %ymm9, %ymm16
vpor %ymm8, %ymm9, %ymm9
vpcmpleuq %ymm0, %ymm9, %k0
vpcmpleuq %ymm0, %ymm16, %k1
kshiftlb $0x4, %k1, %k1
korb %k1, %k0, %k0
vpcmpleuq %ymm0, %ymm15, %k1
vpcmpleuq %ymm0, %ymm14, %k2
kshiftlb $0x4, %k2, %k2
korb %k2, %k1, %k1
kunpckbw %k0, %k1, %k0
vpcmpleuq %ymm0, %ymm13, %k1
vpcmpleuq %ymm0, %ymm12, %k2
kshiftlb $0x4, %k2, %k2
korb %k2, %k1, %k1
vpcmpleuq %ymm0, %ymm11, %k2
vpcmpleuq %ymm0, %ymm10, %k3
kshiftlb $0x4, %k3, %k3
korb %k3, %k2, %k2
kunpckbw %k1, %k2, %k1
kunpckwd %k0, %k1, %k1
vmovdqu8 (%r14,%rcx), %ymm9 {%k1} {z}
vmovdqu8 (%r15,%rcx), %ymm10 {%k1} {z}
vpxor %ymm9, %ymm10, %ymm9
vmovdqu8 %ymm9, (%r15,%rcx) {%k1}
addq $0x20, %rcx
cmpq %rcx, %rax
jne 0x3b3c
xorl %ecx, %ecx
vpbroadcastq %rcx, %ymm9
vpor %ymm1, %ymm9, %ymm10
vpor %ymm2, %ymm9, %ymm11
vpor %ymm3, %ymm9, %ymm12
vpor %ymm4, %ymm9, %ymm13
vpor %ymm5, %ymm9, %ymm14
vpor %ymm6, %ymm9, %ymm15
vporq %ymm7, %ymm9, %ymm16
vpor %ymm8, %ymm9, %ymm9
vpcmpleuq %ymm0, %ymm9, %k0
vpcmpleuq %ymm0, %ymm16, %k1
kshiftlb $0x4, %k1, %k1
korb %k1, %k0, %k0
vpcmpleuq %ymm0, %ymm15, %k1
vpcmpleuq %ymm0, %ymm14, %k2
kshiftlb $0x4, %k2, %k2
korb %k2, %k1, %k1
kunpckbw %k0, %k1, %k0
vpcmpleuq %ymm0, %ymm13, %k1
vpcmpleuq %ymm0, %ymm12, %k2
kshiftlb $0x4, %k2, %k2
korb %k2, %k1, %k1
vpcmpleuq %ymm0, %ymm11, %k2
vpcmpleuq %ymm0, %ymm10, %k3
kshiftlb $0x4, %k3, %k3
korb %k3, %k2, %k2
kunpckbw %k1, %k2, %k1
kunpckwd %k0, %k1, %k1
vmovdqu8 (%r14,%rcx), %ymm9 {%k1} {z}
vmovdqu8 (%rbx,%rcx), %ymm10 {%k1} {z}
vpxor %ymm9, %ymm10, %ymm9
vmovdqu8 %ymm9, (%rbx,%rcx) {%k1}
addq $0x20, %rcx
cmpq %rcx, %rax
jne 0x3bfa
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
vzeroupper
retq