// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/twine80n6t4clocv2/vperm/encrypt.c
// Function: crypto_aead_encrypt
int crypto_aead_encrypt(
                        unsigned char *c, unsigned long long *clen,
                        const unsigned char *m, unsigned long long mlen,
                        const unsigned char *ad, unsigned long long adlen,
                        const unsigned char *nsec,                          //not relavent to CLOC
                        const unsigned char *npub,
                        const unsigned char *k
                        )
{
    word state, tmp;
    unsigned long long i, lastblocklen;
    /* set ciphertext length */
    *clen = mlen + CRYPTO_ABYTES;
    
    /* set key and compute round keys */
    Keyschedule80(k);
    
    /* process the associated data */
    
    /* process the first (partial) block of ad */
    load_partial_block(&state, ad, (adlen>STATE_LEN)?STATE_LEN:adlen, ONE_ZERO_PADDING);
    fix0(state);
    twine80_enc(state);
    if((ad[0] & 0x80) || (adlen == 0)){
        // appy h
        h(state);
    }
    else{
        // do nothing
    }
    
    if(adlen > STATE_LEN){ // ad is of moer than one block
        i = STATE_LEN;
        
        /* process the middle ad blocks, excluding the first and last (partial) block */
        while((i+STATE_LEN) < adlen)
        {
            tmp = LOADS(ad+i);
            state = XOR(state, tmp);
            twine80_enc(state);
            i += STATE_LEN;
        }
        
        /* process the last (partial) ad block */
        load_partial_block(&tmp, ad+i, adlen - i, ONE_ZERO_PADDING);
        state = XOR(state, tmp);
        twine80_enc(state);
    }
    
    
    /* process the nonce */
    load_partial_block(&tmp, npub, CRYPTO_NPUBBYTES, PARAM_OZP);
    state = XOR(state, tmp);
    
    if((adlen % STATE_LEN) || (adlen == 0)){
        /* apply f2 */
        f2(state);
    }
    else{
        /* apply f1 */
        f1(state);
    }
    
    /* copy the encryption to tag state */
    tmp = SHL4(MASK4L(state));
    if(mlen){
        /* apply g2 to tag state */
        g2(tmp);
    }
    else{
        /* apply g1 to tag state */
        g1(tmp);
    }
    state = XOR(MASK4L(state), MASK4U(tmp));
    twine80_enc(state);
    
    i = 0;
    /* process all the message except for the last message/ciphertext block */
    while((i + STATE_LEN) < mlen){
        tmp = LOADS(m+i);
        state = XOR(state, tmp);
        STORES(c+i, state);
        state = XOR(SHL4(MASK4L(state)), state);
        fix1(state);
        twine80_enc(state);
        i += STATE_LEN;
    }
    
    /* process the last block of the message/ciphetext */
    lastblocklen = mlen - i;
    
    if(lastblocklen > 0){
        load_partial_block(&tmp, m+i, lastblocklen, ZERO_APPEND);
        state = XOR(state, tmp);
        store_partial_block(c+i, state, lastblocklen);
        unsigned char shift_bytes = (STATE_LEN - (unsigned char)lastblocklen);
        tmp = AND(SHR(_mm_set1_epi8(0x0f), shift_bytes*2), state);
        state = XOR(state, SHL4(tmp));
        /* add the one zero padding */
        state = XOR(state, SHL(_mm_set_epi8(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x80), lastblocklen*2));
        
        if(mlen % STATE_LEN){
            /* apply f2 */
            f2(state);
        }
        else{
            /* apply f1 */
            f1(state);
        }
        twine80_enc(state);
    }
    
    /* output the tag */
    store_partial_block(c+mlen, SHR4(state), CRYPTO_ABYTES);
    
	return RETURN_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %r13
movq %r8, %rbp
movq %rdx, %r15
movq %rdi, 0x10(%rsp)
movq 0x90(%rsp), %rdi
movq %rcx, 0x18(%rsp)
leaq 0x4(%rcx), %rax
movq %rax, (%rsi)
callq 0x1050
movl $0x8, %r14d
cmpq %r14, %r13
movl $0x8, %ebx
cmovbq %r13, %rbx
movq %rsp, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1080
leaq (%rsp,%rbx), %r12
subq %rbx, %r14
movq %r12, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1030
cmpq $0x7, %r13
ja 0x16f2
movb $-0x80, (%r12)
vmovq (%rsp), %xmm0
vpbroadcastb 0x192a(%rip), %xmm14 # 0x302a
movq 0x88(%rsp), %rdx
vpsrlw $0x4, %xmm0, %xmm1
vpand %xmm1, %xmm14, %xmm1
vpmovzxbw %xmm1, %xmm1    # xmm1 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero,xmm1[4],zero,xmm1[5],zero,xmm1[6],zero,xmm1[7],zero
vpand 0x1b42(%rip), %xmm1, %xmm1 # 0x3260
vpand %xmm0, %xmm14, %xmm2
vpmovwb %xmm1, %xmm0
vmovq %xmm2, %xmm1            # xmm1 = xmm2[0],zero
movq 0x386d(%rip), %r14      # 0x4fa0
leaq 0x30(%r14), %rax
movq 0x38a2(%rip), %rdi      # 0x4fe0
vmovdqa (%rdi), %xmm7
movq $-0x4, %rcx
vmovdqa 0x1a5f(%rip), %xmm9     # 0x31b0
vmovdqa 0x1a67(%rip), %xmm10    # 0x31c0
vmovdqa 0x1a6f(%rip), %xmm11    # 0x31d0
vmovdqa 0x1a77(%rip), %xmm12    # 0x31e0
vpxor -0x30(%rax), %xmm0, %xmm2
vpshufb %xmm2, %xmm7, %xmm2
vpxor %xmm2, %xmm1, %xmm1
vpshufb %xmm9, %xmm0, %xmm0
vpxor -0x20(%rax), %xmm1, %xmm2
vpshufb %xmm2, %xmm7, %xmm2
vpxor %xmm0, %xmm2, %xmm0
vpxor -0x10(%rax), %xmm0, %xmm2
vpshufb %xmm10, %xmm1, %xmm1
vpshufb %xmm2, %xmm7, %xmm2
vpxor %xmm2, %xmm1, %xmm1
vpshufb %xmm11, %xmm0, %xmm0
vpxor (%rax), %xmm1, %xmm2
vpshufb %xmm2, %xmm7, %xmm2
vpxor %xmm0, %xmm2, %xmm0
vpshufb %xmm12, %xmm1, %xmm1
addq $0x4, %rcx
addq $0x40, %rax
cmpq $0x20, %rcx
jb 0x1769
vpunpcklbw %xmm0, %xmm1, %xmm2 # xmm2 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
vmovdqa 0x1a22(%rip), %xmm13    # 0x31f0
vpshufb %xmm13, %xmm2, %xmm2
vpunpckhbw %xmm0, %xmm1, %xmm0 # xmm0 = xmm1[8],xmm0[8],xmm1[9],xmm0[9],xmm1[10],xmm0[10],xmm1[11],xmm0[11],xmm1[12],xmm0[12],xmm1[13],xmm0[13],xmm1[14],xmm0[14],xmm1[15],xmm0[15]
vpshufb %xmm13, %xmm0, %xmm0
vpsllw $0x4, %xmm0, %xmm0
vpxor %xmm2, %xmm0, %xmm6
testq %r13, %r13
je 0x17f0
cmpb $0x0, (%rbp)
jns 0x1817
vpshufd $0x24, %xmm6, %xmm0     # xmm0 = xmm6[0,1,2,0]
vpshufd $0x79, %xmm6, %xmm1     # xmm1 = xmm6[1,2,3,1]
vpxor %xmm1, %xmm0, %xmm0
movq 0x37e3(%rip), %rax      # 0x4fe8
vmovdqa %xmm0, (%rax)
vpxor %xmm1, %xmm1, %xmm1
vpblendd $0x8, %xmm6, %xmm1, %xmm1 # xmm1 = xmm1[0,1,2],xmm6[3]
vpxor %xmm1, %xmm0, %xmm6
cmpq $0x9, %r13
jb 0x1abb
movl $0x8, %eax
cmpq $0x11, %r13
vmovdqa %xmm7, 0x20(%rsp)
jb 0x194a
leaq -0x11(%r13), %rax
andq $-0x8, %rax
movl $0x8, %ecx
vmovdqa 0x1a25(%rip), %xmm0     # 0x3270
vpbroadcastq 0x1aac(%rip), %xmm1 # 0x3300
movl $0x10, %esi
vmovdqa 0x1a1f(%rip), %xmm2     # 0x3280
vmovdqa 0x1a27(%rip), %xmm3     # 0x3290
leaq 0x30(%r14), %rdx
vmovq (%rbp,%rcx), %xmm4
movq %rsi, %rcx
vpsrlw $0x4, %xmm4, %xmm5
vpunpcklbw %xmm4, %xmm5, %xmm5 # xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1],xmm5[2],xmm4[2],xmm5[3],xmm4[3],xmm5[4],xmm4[4],xmm5[5],xmm4[5],xmm5[6],xmm4[6],xmm5[7],xmm4[7]
vpternlogq $0x6c, %xmm14, %xmm6, %xmm5
vpmovwb %xmm5, %xmm6
vpshufb %xmm0, %xmm5, %xmm4
vpsrlw $0x4, %xmm4, %xmm4
vpternlogq $0x48, %xmm6, %xmm1, %xmm4
vpshufb %xmm2, %xmm5, %xmm6
vpshufb %xmm3, %xmm5, %xmm5
vpsrlw $0x4, %xmm5, %xmm5
vpternlogq $0x48, %xmm6, %xmm1, %xmm5
movq $-0x4, %rsi
movq %rdx, %rdi
vpxor -0x30(%rdi), %xmm4, %xmm6
vpshufb %xmm6, %xmm7, %xmm6
vpxor %xmm6, %xmm5, %xmm5
vpshufb %xmm9, %xmm4, %xmm4
vpxor -0x20(%rdi), %xmm5, %xmm6
vpshufb %xmm6, %xmm7, %xmm6
vpxor %xmm4, %xmm6, %xmm4
vpxor -0x10(%rdi), %xmm4, %xmm6
vpshufb %xmm10, %xmm5, %xmm5
vpshufb %xmm6, %xmm7, %xmm6
vpxor %xmm6, %xmm5, %xmm5
vpshufb %xmm11, %xmm4, %xmm4
vpxor (%rdi), %xmm5, %xmm6
vpshufb %xmm6, %xmm7, %xmm6
vpxor %xmm4, %xmm6, %xmm4
vpshufb %xmm12, %xmm5, %xmm5
addq $0x4, %rsi
addq $0x40, %rdi
cmpq $0x20, %rsi
jb 0x18bd
vpunpcklbw %xmm4, %xmm5, %xmm6 # xmm6 = xmm5[0],xmm4[0],xmm5[1],xmm4[1],xmm5[2],xmm4[2],xmm5[3],xmm4[3],xmm5[4],xmm4[4],xmm5[5],xmm4[5],xmm5[6],xmm4[6],xmm5[7],xmm4[7]
vpshufb %xmm13, %xmm6, %xmm6
vpunpckhbw %xmm4, %xmm5, %xmm4 # xmm4 = xmm5[8],xmm4[8],xmm5[9],xmm4[9],xmm5[10],xmm4[10],xmm5[11],xmm4[11],xmm5[12],xmm4[12],xmm5[13],xmm4[13],xmm5[14],xmm4[14],xmm5[15],xmm4[15]
vpshufb %xmm13, %xmm4, %xmm4
vpsllw $0x4, %xmm4, %xmm4
vpxor %xmm6, %xmm4, %xmm6
leaq 0x8(%rcx), %rsi
cmpq %r13, %rsi
jb 0x186d
vmovdqa %xmm6, 0x30(%rsp)
addq $0x10, %rax
jmp 0x1950
vmovdqa %xmm6, 0x30(%rsp)
addq %rax, %rbp
movq %r13, %rcx
subq %rax, %rcx
movslq %ecx, %rbx
movq %rcx, %r12
shlq $0x20, %r12
movq %rsp, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1080
leaq (%rsp,%rbx), %rbp
movabsq $0x800000000, %rdx      # imm = 0x800000000
subq %r12, %rdx
sarq $0x20, %rdx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x1030
cmpl $0x7, %ebx
jg 0x1999
movb $-0x80, (%rbp)
vmovq (%rsp), %xmm0
vpsrlw $0x4, %xmm0, %xmm1
vpunpcklbw %xmm0, %xmm1, %xmm0 # xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
vpbroadcastb 0x167a(%rip), %xmm14 # 0x302a
vmovdqa 0x30(%rsp), %xmm4
vpternlogq $0x78, %xmm14, %xmm0, %xmm4
vpmovwb %xmm4, %xmm1
vpshufb 0x18a4(%rip), %xmm4, %xmm0 # 0x3270
vpsrlw $0x4, %xmm0, %xmm0
vpbroadcastq 0x1926(%rip), %xmm2 # 0x3300
vpternlogq $0x48, %xmm1, %xmm2, %xmm0
vpshufb 0x1896(%rip), %xmm4, %xmm3 # 0x3280
vpshufb 0x189d(%rip), %xmm4, %xmm1 # 0x3290
vpsrlw $0x4, %xmm1, %xmm1
vpternlogq $0x48, %xmm3, %xmm2, %xmm1
leaq 0x30(%r14), %rax
movq $-0x4, %rcx
vmovdqa 0x179e(%rip), %xmm9     # 0x31b0
vmovdqa 0x17a6(%rip), %xmm10    # 0x31c0
vmovdqa 0x17ae(%rip), %xmm11    # 0x31d0
vmovdqa 0x17b6(%rip), %xmm12    # 0x31e0
movq 0x35af(%rip), %rdi      # 0x4fe0
vmovdqa 0x17b7(%rip), %xmm13    # 0x31f0
vmovdqa 0x20(%rsp), %xmm7
movq 0x88(%rsp), %rdx
vpxor -0x30(%rax), %xmm0, %xmm2
vpshufb %xmm2, %xmm7, %xmm2
vpxor %xmm2, %xmm1, %xmm1
vpshufb %xmm9, %xmm0, %xmm0
vpxor -0x20(%rax), %xmm1, %xmm2
vpshufb %xmm2, %xmm7, %xmm2
vpxor %xmm0, %xmm2, %xmm0
vpxor -0x10(%rax), %xmm0, %xmm2
vpshufb %xmm10, %xmm1, %xmm1
vpshufb %xmm2, %xmm7, %xmm2
vpxor %xmm2, %xmm1, %xmm1
vpshufb %xmm11, %xmm0, %xmm0
vpxor (%rax), %xmm1, %xmm2
vpshufb %xmm2, %xmm7, %xmm2
vpxor %xmm0, %xmm2, %xmm0
vpshufb %xmm12, %xmm1, %xmm1
addq $0x4, %rcx
addq $0x40, %rax
cmpq $0x20, %rcx
jb 0x1a47
vpunpcklbw %xmm0, %xmm1, %xmm2 # xmm2 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
vpshufb %xmm13, %xmm2, %xmm2
vpunpckhbw %xmm0, %xmm1, %xmm0 # xmm0 = xmm1[8],xmm0[8],xmm1[9],xmm0[9],xmm1[10],xmm0[10],xmm1[11],xmm0[11],xmm1[12],xmm0[12],xmm1[13],xmm0[13],xmm1[14],xmm0[14],xmm1[15],xmm0[15]
vpshufb %xmm13, %xmm0, %xmm0
vpsllw $0x4, %xmm0, %xmm0
vpxor %xmm2, %xmm0, %xmm6
movq 0x18(%rsp), %rbx
movq 0x10(%rsp), %rsi
testq %r13, %r13
setne %al
movzwl 0x4(%rdx), %ecx
movl (%rdx), %edx
shlq $0x8, %rdx
shlq $0x28, %rcx
orq %rdx, %rcx
movabsq $-0x7fffffffffffff34, %rdx # imm = 0x80000000000000CC
orq %rcx, %rdx
vmovq %rdx, %xmm0
vpsrlw $0x4, %xmm0, %xmm1
vpunpcklbw %xmm0, %xmm1, %xmm0 # xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
testb $0x7, %r13b
sete %cl
vpternlogq $0x6c, %xmm14, %xmm6, %xmm0
testb %cl, %al
jne 0x1b19
vpshufd $0x39, %xmm0, %xmm1     # xmm1 = xmm0[1,2,3,0]
vpshufb 0x1789(%rip), %xmm0, %xmm0 # 0x32a0
jmp 0x1b3c
vpbroadcastq %xmm0, %xmm1
vpshufd $0x9e, %xmm0, %xmm2     # xmm2 = xmm0[2,3,1,2]
vpxor %xmm2, %xmm1, %xmm1
movq 0x34ba(%rip), %rax      # 0x4fe8
vmovdqa %xmm1, (%rax)
vpxor %xmm2, %xmm2, %xmm2
vpblendd $0xc, %xmm0, %xmm2, %xmm0 # xmm0 = xmm2[0,1],xmm0[2,3]
vpxor %xmm0, %xmm1, %xmm0
vpandq 0x17b6(%rip){1to2}, %xmm0, %xmm1 # 0x3300
vpsllw $0x4, %xmm1, %xmm0
testq %rbx, %rbx
je 0x1b64
vpshufd $0x39, %xmm0, %xmm2     # xmm2 = xmm0[1,2,3,0]
vpshufb 0x173e(%rip), %xmm0, %xmm0 # 0x32a0
jmp 0x1b72
vpshufd $0x4e, %xmm0, %xmm2     # xmm2 = xmm0[2,3,0,1]
vpxor %xmm3, %xmm3, %xmm3
vshufps $0x94, %xmm0, %xmm3, %xmm0 # xmm0 = xmm3[0,1],xmm0[1,2]
vpxor %xmm0, %xmm2, %xmm0
vpternlogq $0xf8, 0x1787(%rip){1to2}, %xmm0, %xmm1 # 0x3308
vpmovwb %xmm1, %xmm2
vpshufb 0x16e0(%rip), %xmm1, %xmm0 # 0x3270
vpsrlw $0x4, %xmm0, %xmm0
vpbroadcastq 0x1762(%rip), %xmm15 # 0x3300
vpternlogq $0x48, %xmm2, %xmm15, %xmm0
vpshufb 0x16d2(%rip), %xmm1, %xmm2 # 0x3280
vpshufb 0x16d9(%rip), %xmm1, %xmm1 # 0x3290
vpsrlw $0x4, %xmm1, %xmm1
vpternlogq $0x48, %xmm2, %xmm15, %xmm1
leaq 0x30(%r14), %rax
movq $-0x4, %rcx
vpxor -0x30(%rax), %xmm0, %xmm2
vpshufb %xmm2, %xmm7, %xmm2
vpxor %xmm2, %xmm1, %xmm1
vpshufb %xmm9, %xmm0, %xmm0
vpxor -0x20(%rax), %xmm1, %xmm2
vpshufb %xmm2, %xmm7, %xmm2
vpxor %xmm0, %xmm2, %xmm0
vpxor -0x10(%rax), %xmm0, %xmm2
vpshufb %xmm10, %xmm1, %xmm1
vpshufb %xmm2, %xmm7, %xmm2
vpxor %xmm2, %xmm1, %xmm1
vpshufb %xmm11, %xmm0, %xmm0
vpxor (%rax), %xmm1, %xmm2
vpshufb %xmm2, %xmm7, %xmm2
vpxor %xmm0, %xmm2, %xmm0
vpshufb %xmm12, %xmm1, %xmm1
addq $0x4, %rcx
addq $0x40, %rax
cmpq $0x20, %rcx
jb 0x1bce
vpunpcklbw %xmm0, %xmm1, %xmm2 # xmm2 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
vpshufb %xmm13, %xmm2, %xmm2
vpunpckhbw %xmm0, %xmm1, %xmm0 # xmm0 = xmm1[8],xmm0[8],xmm1[9],xmm0[9],xmm1[10],xmm0[10],xmm1[11],xmm0[11],xmm1[12],xmm0[12],xmm1[13],xmm0[13],xmm1[14],xmm0[14],xmm1[15],xmm0[15]
vpshufb %xmm13, %xmm0, %xmm0
vpsllw $0x4, %xmm0, %xmm0
vpxor %xmm2, %xmm0, %xmm7
cmpq $0x9, %rbx
jb 0x1d7e
movl $0x8, %ecx
vmovq 0x15a7(%rip), %xmm0     # 0x3200
vpmovsxbq 0x13cc(%rip), %xmm1 # 0x302e
vmovdqa 0x1606(%rip), %xmm2     # 0x3270
xorl %r13d, %r13d
vmovdqa 0x160b(%rip), %xmm3     # 0x3280
vmovdqa 0x1613(%rip), %xmm4     # 0x3290
leaq 0x30(%r14), %rax
vmovq (%r15,%r13), %xmm5
vpsrlw $0x4, %xmm5, %xmm6
vpunpcklbw %xmm5, %xmm6, %xmm5 # xmm5 = xmm6[0],xmm5[0],xmm6[1],xmm5[1],xmm6[2],xmm5[2],xmm6[3],xmm5[3],xmm6[4],xmm5[4],xmm6[5],xmm5[5],xmm6[6],xmm5[6],xmm6[7],xmm5[7]
vpternlogq $0x6c, %xmm14, %xmm7, %xmm5
vpand %xmm5, %xmm15, %xmm6
vpsllw $0x4, %xmm6, %xmm7
vpmovwb %xmm7, %xmm8
vpshufb %xmm0, %xmm6, %xmm6
vpor %xmm6, %xmm8, %xmm6
vmovq %xmm6, (%rsi,%r13)
movq %rcx, %r13
vpxor %xmm7, %xmm5, %xmm5
vpor %xmm1, %xmm5, %xmm6
vpmovwb %xmm6, %xmm7
vpshufb %xmm2, %xmm6, %xmm6
vpsrlw $0x4, %xmm6, %xmm6
vpternlogq $0x48, %xmm7, %xmm15, %xmm6
vpshufb %xmm3, %xmm5, %xmm8
vpshufb %xmm4, %xmm5, %xmm5
vpsrlw $0x4, %xmm5, %xmm7
vpternlogq $0x48, %xmm8, %xmm15, %xmm7
vmovdqa (%rdi), %xmm5
movq $-0x4, %rcx
movq %rax, %rdx
vpxor -0x30(%rdx), %xmm6, %xmm8
vpshufb %xmm8, %xmm5, %xmm8
vpxor %xmm7, %xmm8, %xmm7
vpshufb %xmm9, %xmm6, %xmm6
vpxor -0x20(%rdx), %xmm7, %xmm8
vpshufb %xmm8, %xmm5, %xmm8
vpxor %xmm6, %xmm8, %xmm6
vpxor -0x10(%rdx), %xmm6, %xmm8
vpshufb %xmm10, %xmm7, %xmm7
vpshufb %xmm8, %xmm5, %xmm8
vpxor %xmm7, %xmm8, %xmm7
vpshufb %xmm11, %xmm6, %xmm6
vpxor (%rdx), %xmm7, %xmm8
vpshufb %xmm8, %xmm5, %xmm8
vpxor %xmm6, %xmm8, %xmm6
vpshufb %xmm12, %xmm7, %xmm7
addq $0x4, %rcx
addq $0x40, %rdx
cmpq $0x20, %rcx
jb 0x1cfb
vpunpcklbw %xmm6, %xmm7, %xmm5 # xmm5 = xmm7[0],xmm6[0],xmm7[1],xmm6[1],xmm7[2],xmm6[2],xmm7[3],xmm6[3],xmm7[4],xmm6[4],xmm7[5],xmm6[5],xmm7[6],xmm6[6],xmm7[7],xmm6[7]
vpshufb %xmm13, %xmm5, %xmm5
vpunpckhbw %xmm6, %xmm7, %xmm6 # xmm6 = xmm7[8],xmm6[8],xmm7[9],xmm6[9],xmm7[10],xmm6[10],xmm7[11],xmm6[11],xmm7[12],xmm6[12],xmm7[13],xmm6[13],xmm7[14],xmm6[14],xmm7[15],xmm6[15]
vpshufb %xmm13, %xmm6, %xmm6
vpsllw $0x4, %xmm6, %xmm6
vpxor %xmm5, %xmm6, %xmm7
leaq 0x8(%r13), %rcx
cmpq %rbx, %rcx
jb 0x1c81
jmp 0x1d81
xorl %r13d, %r13d
movq %rbx, %r12
subq %r13, %r12
je 0x1fba
addq %r13, %r15
movq %r12, %rbx
shlq $0x20, %rbx
movslq %r12d, %rbp
movq %rsp, %rdi
movq %r15, %rsi
movq %rbp, %rdx
vmovdqa %xmm7, 0x20(%rsp)
callq 0x1080
leaq (%rsp,%rbp), %rdi
movabsq $0x800000000, %rdx      # imm = 0x800000000
subq %rbx, %rdx
sarq $0x20, %rdx
xorl %esi, %esi
callq 0x1030
movq %rsp, %rax
vmovq (%rax), %xmm0
vpsrlw $0x4, %xmm0, %xmm1
vpunpcklbw %xmm0, %xmm1, %xmm0 # xmm0 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
vmovdqa 0x20(%rsp), %xmm1
vpbroadcastb 0x1241(%rip), %xmm2 # 0x302a
vpternlogq $0x78, %xmm2, %xmm0, %xmm1
vmovdqa %xmm1, 0x20(%rsp)
addq 0x10(%rsp), %r13
vpshufb 0x13fc(%rip), %xmm1, %xmm0 # 0x3200
vpsllw $0x4, %xmm1, %xmm1
vpmovwb %xmm1, %xmm1
vpternlogq $0xf8, %xmm2, %xmm0, %xmm1
vmovq %xmm1, (%rax)
movq %rsp, %rsi
movq %r13, %rdi
movq %rbp, %rdx
movq 0x18(%rsp), %rbx
callq 0x1080
vpbroadcastb %r12d, %xmm0
vpaddb %xmm0, %xmm0, %xmm0
vmovdqa 0x1481(%rip), %xmm1     # 0x32c0
vpsubb %xmm0, %xmm1, %xmm1
vpbroadcastb 0x11de(%rip), %xmm2 # 0x302a
vpshufb %xmm1, %xmm2, %xmm1
vmovdqa 0x20(%rsp), %xmm3
vpand %xmm1, %xmm3, %xmm1
vpsllw $0x4, %xmm1, %xmm1
vmovdqa 0x1468(%rip), %xmm2     # 0x32d0
vpsubb %xmm0, %xmm2, %xmm0
vpmovzxbq 0x11bb(%rip), %xmm2 # 0x3030
vpshufb %xmm0, %xmm2, %xmm0
vpternlogq $0x96, %xmm1, %xmm3, %xmm0
testb $0x7, %bl
je 0x1e96
vpshufd $0x39, %xmm0, %xmm1     # xmm1 = xmm0[1,2,3,0]
vpshufb 0x140c(%rip), %xmm0, %xmm0 # 0x32a0
jmp 0x1eb9
vpbroadcastq %xmm0, %xmm1
vpshufd $0x9e, %xmm0, %xmm2     # xmm2 = xmm0[2,3,1,2]
vpxor %xmm2, %xmm1, %xmm1
movq 0x313d(%rip), %rax      # 0x4fe8
vmovdqa %xmm1, (%rax)
vpxor %xmm2, %xmm2, %xmm2
vpblendd $0xc, %xmm0, %xmm2, %xmm0 # xmm0 = xmm2[0,1],xmm0[2,3]
vpxor %xmm0, %xmm1, %xmm1
vmovdqa 0x12eb(%rip), %xmm4     # 0x31b0
vmovdqa 0x12f3(%rip), %xmm5     # 0x31c0
vmovdqa 0x12fb(%rip), %xmm6     # 0x31d0
vmovdqa 0x1303(%rip), %xmm7     # 0x31e0
movq 0x30fc(%rip), %rax      # 0x4fe0
vmovdqa 0x1304(%rip), %xmm8     # 0x31f0
vpbroadcastq 0x140b(%rip), %xmm9 # 0x3300
vpmovwb %xmm1, %xmm2
vpshufb 0x136c(%rip), %xmm1, %xmm0 # 0x3270
vpsrlw $0x4, %xmm0, %xmm0
vpternlogq $0x48, %xmm2, %xmm9, %xmm0
vpshufb 0x1367(%rip), %xmm1, %xmm3 # 0x3280
vpshufb 0x136e(%rip), %xmm1, %xmm1 # 0x3290
vpsrlw $0x4, %xmm1, %xmm2
vpternlogq $0x48, %xmm3, %xmm9, %xmm2
addq $0x30, %r14
vmovdqa (%rax), %xmm1
movq $-0x4, %rax
movq 0x10(%rsp), %rsi
vpxor -0x30(%r14), %xmm0, %xmm3
vpshufb %xmm3, %xmm1, %xmm3
vpxor %xmm3, %xmm2, %xmm2
vpshufb %xmm4, %xmm0, %xmm0
vpxor -0x20(%r14), %xmm2, %xmm3
vpshufb %xmm3, %xmm1, %xmm3
vpxor %xmm0, %xmm3, %xmm0
vpxor -0x10(%r14), %xmm0, %xmm3
vpshufb %xmm5, %xmm2, %xmm2
vpshufb %xmm3, %xmm1, %xmm3
vpxor %xmm3, %xmm2, %xmm2
vpshufb %xmm6, %xmm0, %xmm0
vpxor (%r14), %xmm2, %xmm3
vpshufb %xmm3, %xmm1, %xmm3
vpxor %xmm0, %xmm3, %xmm0
vpshufb %xmm7, %xmm2, %xmm2
addq $0x4, %rax
addq $0x40, %r14
cmpq $0x20, %rax
jb 0x1f42
vpunpcklbw %xmm0, %xmm2, %xmm1 # xmm1 = 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]
vpshufb %xmm8, %xmm1, %xmm1
vpunpckhbw %xmm0, %xmm2, %xmm0 # xmm0 = xmm2[8],xmm0[8],xmm2[9],xmm0[9],xmm2[10],xmm0[10],xmm2[11],xmm0[11],xmm2[12],xmm0[12],xmm2[13],xmm0[13],xmm2[14],xmm0[14],xmm2[15],xmm0[15]
vpshufb %xmm8, %xmm0, %xmm0
vpsllw $0x4, %xmm0, %xmm0
vpxor %xmm1, %xmm0, %xmm7
vpsrlw $0x4, %xmm7, %xmm0
vpshufb 0x1328(%rip), %xmm0, %xmm0 # 0x32f0
vpbroadcastw 0x105b(%rip), %xmm1 # 0x302c
vpand %xmm1, %xmm7, %xmm1
vpmovwb %xmm1, %xmm1
vpor %xmm0, %xmm1, %xmm0
vmovd %xmm0, (%rsi,%rbx)
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq