// File: /workspace/github_c_makefile_star2_O1/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 %rcx, %rbx
movq %rdx, 0x20(%rsp)
movq %rdi, %r15
movq 0x90(%rsp), %rdi
leaq 0x4(%rcx), %rax
movq %rax, (%rsi)
callq 0x1050
movl $0x8, %r14d
cmpq %r14, %r13
movl $0x8, %r12d
cmovbq %r13, %r12
movq %rsp, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x1080
leaq (%rsp,%r12), %rdi
subq %r12, %r14
xorl %esi, %esi
movq %r14, %rdx
callq 0x1030
cmpq $0x7, %r13
ja 0x166e
movb $-0x80, (%rsp,%r12)
vmovq (%rsp), %xmm0
vpbroadcastb 0x19ae(%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 0x1be6(%rip), %xmm1, %xmm1 # 0x3280
vpand %xmm0, %xmm14, %xmm0
vpmovwb %xmm1, %xmm1
vmovq %xmm0, %xmm2            # xmm2 = xmm0[0],zero
movq 0x38f1(%rip), %r14      # 0x4fa0
leaq 0x30(%r14), %rax
movq 0x3926(%rip), %rsi      # 0x4fe0
vmovdqa (%rsi), %xmm0
movq $-0x4, %rcx
vmovdqa 0x1ae3(%rip), %xmm9     # 0x31b0
vmovdqa 0x1aeb(%rip), %xmm10    # 0x31c0
vmovdqa 0x1af3(%rip), %xmm11    # 0x31d0
vmovdqa 0x1afb(%rip), %xmm12    # 0x31e0
vpxor -0x30(%rax), %xmm1, %xmm3
vpshufb %xmm3, %xmm0, %xmm3
vpxor %xmm3, %xmm2, %xmm2
vpshufb %xmm9, %xmm1, %xmm1
vpxor -0x20(%rax), %xmm2, %xmm3
vpshufb %xmm3, %xmm0, %xmm3
vpxor %xmm1, %xmm3, %xmm1
vpxor -0x10(%rax), %xmm1, %xmm3
vpshufb %xmm10, %xmm2, %xmm2
vpshufb %xmm3, %xmm0, %xmm3
vpxor %xmm3, %xmm2, %xmm2
vpshufb %xmm11, %xmm1, %xmm1
vpxor (%rax), %xmm2, %xmm3
vpshufb %xmm3, %xmm0, %xmm3
vpxor %xmm1, %xmm3, %xmm1
vpshufb %xmm12, %xmm2, %xmm2
addq $0x4, %rcx
addq $0x40, %rax
cmpq $0x20, %rcx
jb 0x16e5
vpunpcklbw %xmm1, %xmm2, %xmm0 # xmm0 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3],xmm2[4],xmm1[4],xmm2[5],xmm1[5],xmm2[6],xmm1[6],xmm2[7],xmm1[7]
vmovdqa 0x1aa6(%rip), %xmm13    # 0x31f0
vpshufb %xmm13, %xmm0, %xmm0
vpunpckhbw %xmm1, %xmm2, %xmm1 # xmm1 = xmm2[8],xmm1[8],xmm2[9],xmm1[9],xmm2[10],xmm1[10],xmm2[11],xmm1[11],xmm2[12],xmm1[12],xmm2[13],xmm1[13],xmm2[14],xmm1[14],xmm2[15],xmm1[15]
vpshufb %xmm13, %xmm1, %xmm1
vpsllw $0x4, %xmm1, %xmm1
vpxor %xmm0, %xmm1, %xmm7
testq %r13, %r13
je 0x176c
cmpb $0x0, (%rbp)
jns 0x1793
vpshufd $0x24, %xmm7, %xmm0     # xmm0 = xmm7[0,1,2,0]
vpshufd $0x79, %xmm7, %xmm1     # xmm1 = xmm7[1,2,3,1]
vpxor %xmm1, %xmm0, %xmm0
movq 0x3867(%rip), %rax      # 0x4fe8
vmovdqa %xmm0, (%rax)
vpxor %xmm1, %xmm1, %xmm1
vpblendd $0x8, %xmm7, %xmm1, %xmm1 # xmm1 = xmm1[0,1,2],xmm7[3]
vpxor %xmm1, %xmm0, %xmm7
cmpq $0x9, %r13
movq %r15, 0x18(%rsp)
jb 0x18cc
movl $0x8, %eax
cmpq $0x11, %r13
jb 0x18d6
vmovdqa (%rsi), %xmm0
leaq -0x11(%r13), %rax
andq $-0x8, %rax
movl $0x8, %ecx
vmovdqa 0x1ac6(%rip), %xmm1     # 0x3290
vpbroadcastq 0x1b4d(%rip), %xmm2 # 0x3320
movl $0x10, %esi
vmovdqa 0x1ac0(%rip), %xmm3     # 0x32a0
vmovdqa 0x1ac8(%rip), %xmm4     # 0x32b0
leaq 0x30(%r14), %rdx
vmovq (%rbp,%rcx), %xmm5
movq %rsi, %rcx
vpsrlw $0x4, %xmm5, %xmm6
vpunpcklbw %xmm5, %xmm6, %xmm6 # xmm6 = 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, %xmm6
vpmovwb %xmm6, %xmm7
vpshufb %xmm1, %xmm6, %xmm5
vpsrlw $0x4, %xmm5, %xmm5
vpternlogq $0x48, %xmm7, %xmm2, %xmm5
vpshufb %xmm3, %xmm6, %xmm7
vpshufb %xmm4, %xmm6, %xmm6
vpsrlw $0x4, %xmm6, %xmm6
vpternlogq $0x48, %xmm7, %xmm2, %xmm6
movq $-0x4, %rsi
movq %rdx, %rdi
vpxor -0x30(%rdi), %xmm5, %xmm7
vpshufb %xmm7, %xmm0, %xmm7
vpxor %xmm7, %xmm6, %xmm6
vpshufb %xmm9, %xmm5, %xmm5
vpxor -0x20(%rdi), %xmm6, %xmm7
vpshufb %xmm7, %xmm0, %xmm7
vpxor %xmm5, %xmm7, %xmm5
vpxor -0x10(%rdi), %xmm5, %xmm7
vpshufb %xmm10, %xmm6, %xmm6
vpshufb %xmm7, %xmm0, %xmm7
vpxor %xmm7, %xmm6, %xmm6
vpshufb %xmm11, %xmm5, %xmm5
vpxor (%rdi), %xmm6, %xmm7
vpshufb %xmm7, %xmm0, %xmm7
vpxor %xmm5, %xmm7, %xmm5
vpshufb %xmm12, %xmm6, %xmm6
addq $0x4, %rsi
addq $0x40, %rdi
cmpq $0x20, %rsi
jb 0x183c
vpunpcklbw %xmm5, %xmm6, %xmm7 # xmm7 = 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]
vpshufb %xmm13, %xmm7, %xmm7
vpunpckhbw %xmm5, %xmm6, %xmm5 # xmm5 = xmm6[8],xmm5[8],xmm6[9],xmm5[9],xmm6[10],xmm5[10],xmm6[11],xmm5[11],xmm6[12],xmm5[12],xmm6[13],xmm5[13],xmm6[14],xmm5[14],xmm6[15],xmm5[15]
vpshufb %xmm13, %xmm5, %xmm5
vpsllw $0x4, %xmm5, %xmm5
vpxor %xmm7, %xmm5, %xmm7
leaq 0x8(%rcx), %rsi
cmpq %r13, %rsi
jb 0x17ec
vmovdqa %xmm7, 0x30(%rsp)
movq %rbx, %r15
addq $0x10, %rax
jmp 0x18df
movq 0x20(%rsp), %rdi
jmp 0x1a54
vmovdqa %xmm7, 0x30(%rsp)
movq %rbx, %r15
addq %rax, %rbp
movq %r13, %rcx
subq %rax, %rcx
movslq %ecx, %r12
movq %rcx, %rbx
shlq $0x20, %rbx
movq %rsp, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x1080
leaq (%rsp,%r12), %rdi
movabsq $0x800000000, %rdx      # imm = 0x800000000
subq %rbx, %rdx
sarq $0x20, %rdx
xorl %esi, %esi
callq 0x1030
cmpl $0x7, %r12d
jg 0x1927
movb $-0x80, (%rsp,%r12)
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 0x16ec(%rip), %xmm14 # 0x302a
vmovdqa 0x30(%rsp), %xmm2
vpternlogq $0x78, %xmm14, %xmm0, %xmm2
vpmovwb %xmm2, %xmm1
vpshufb 0x1936(%rip), %xmm2, %xmm0 # 0x3290
vpbroadcastq 0x19bd(%rip), %xmm3 # 0x3320
vpsrlw $0x4, %xmm0, %xmm0
vpternlogq $0x48, %xmm1, %xmm3, %xmm0
vpshufb 0x1928(%rip), %xmm2, %xmm1 # 0x32a0
vpshufb 0x192f(%rip), %xmm2, %xmm2 # 0x32b0
vpsrlw $0x4, %xmm2, %xmm2
vpternlogq $0x48, %xmm1, %xmm3, %xmm2
leaq 0x30(%r14), %rax
movq 0x3648(%rip), %rsi      # 0x4fe0
vmovdqa (%rsi), %xmm1
movq $-0x4, %rcx
movq %r15, %rbx
vmovdqa 0x1802(%rip), %xmm9     # 0x31b0
vmovdqa 0x180a(%rip), %xmm10    # 0x31c0
vmovdqa 0x1812(%rip), %xmm11    # 0x31d0
vmovdqa 0x181a(%rip), %xmm12    # 0x31e0
vmovdqa 0x1822(%rip), %xmm13    # 0x31f0
movq 0x20(%rsp), %rdi
movq 0x88(%rsp), %rdx
vpxor -0x30(%rax), %xmm0, %xmm3
vpshufb %xmm3, %xmm1, %xmm3
vpxor %xmm3, %xmm2, %xmm2
vpshufb %xmm9, %xmm0, %xmm0
vpxor -0x20(%rax), %xmm2, %xmm3
vpshufb %xmm3, %xmm1, %xmm3
vpxor %xmm0, %xmm3, %xmm0
vpxor -0x10(%rax), %xmm0, %xmm3
vpshufb %xmm10, %xmm2, %xmm2
vpshufb %xmm3, %xmm1, %xmm3
vpxor %xmm3, %xmm2, %xmm2
vpshufb %xmm11, %xmm0, %xmm0
vpxor (%rax), %xmm2, %xmm3
vpshufb %xmm3, %xmm1, %xmm3
vpxor %xmm0, %xmm3, %xmm0
vpshufb %xmm12, %xmm2, %xmm2
addq $0x4, %rcx
addq $0x40, %rax
cmpq $0x20, %rcx
jb 0x19db
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 %xmm13, %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 %xmm13, %xmm0, %xmm0
vpsllw $0x4, %xmm0, %xmm0
vpxor %xmm1, %xmm0, %xmm7
movq 0x18(%rsp), %r15
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, %xmm7, %xmm0
testb %cl, %al
jne 0x1aa8
vpshufd $0x39, %xmm0, %xmm1     # xmm1 = xmm0[1,2,3,0]
vpshufb 0x181a(%rip), %xmm0, %xmm0 # 0x32c0
jmp 0x1acb
vpbroadcastq %xmm0, %xmm1
vpshufd $0x9e, %xmm0, %xmm2     # xmm2 = xmm0[2,3,1,2]
vpxor %xmm2, %xmm1, %xmm1
movq 0x352b(%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 0x1847(%rip){1to2}, %xmm0, %xmm1 # 0x3320
vpsllw $0x4, %xmm1, %xmm0
testq %rbx, %rbx
je 0x1af3
vpshufd $0x39, %xmm0, %xmm2     # xmm2 = xmm0[1,2,3,0]
vpshufb 0x17cf(%rip), %xmm0, %xmm0 # 0x32c0
jmp 0x1b01
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, 0x1818(%rip){1to2}, %xmm0, %xmm1 # 0x3328
vpmovwb %xmm1, %xmm2
vpshufb 0x1771(%rip), %xmm1, %xmm0 # 0x3290
vpbroadcastq 0x17f8(%rip), %xmm15 # 0x3320
vpsrlw $0x4, %xmm0, %xmm0
vpternlogq $0x48, %xmm2, %xmm15, %xmm0
vpshufb 0x1763(%rip), %xmm1, %xmm3 # 0x32a0
vpshufb 0x176a(%rip), %xmm1, %xmm1 # 0x32b0
vpsrlw $0x4, %xmm1, %xmm2
vpternlogq $0x48, %xmm3, %xmm15, %xmm2
leaq 0x30(%r14), %rax
vmovdqa (%rsi), %xmm1
movq $-0x4, %rcx
vpxor -0x30(%rax), %xmm0, %xmm3
vpshufb %xmm3, %xmm1, %xmm3
vpxor %xmm3, %xmm2, %xmm2
vpshufb %xmm9, %xmm0, %xmm0
vpxor -0x20(%rax), %xmm2, %xmm3
vpshufb %xmm3, %xmm1, %xmm3
vpxor %xmm0, %xmm3, %xmm0
vpxor -0x10(%rax), %xmm0, %xmm3
vpshufb %xmm10, %xmm2, %xmm2
vpshufb %xmm3, %xmm1, %xmm3
vpxor %xmm3, %xmm2, %xmm2
vpshufb %xmm11, %xmm0, %xmm0
vpxor (%rax), %xmm2, %xmm3
vpshufb %xmm3, %xmm1, %xmm3
vpxor %xmm0, %xmm3, %xmm0
vpshufb %xmm12, %xmm2, %xmm2
addq $0x4, %rcx
addq $0x40, %rax
cmpq $0x20, %rcx
jb 0x1b61
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 %xmm13, %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 %xmm13, %xmm0, %xmm0
vpsllw $0x4, %xmm0, %xmm0
vpxor %xmm1, %xmm0, %xmm7
cmpq $0x9, %rbx
jb 0x1d11
movl $0x8, %ecx
vmovq 0x1614(%rip), %xmm0     # 0x3200
vpmovsxbq 0x1439(%rip), %xmm1 # 0x302e
vmovdqa 0x1693(%rip), %xmm2     # 0x3290
xorl %r13d, %r13d
vmovdqa 0x1698(%rip), %xmm3     # 0x32a0
vmovdqa 0x16a0(%rip), %xmm4     # 0x32b0
leaq 0x30(%r14), %rax
vmovq (%rdi,%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, (%r15,%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 (%rsi), %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 0x1c8e
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 0x1c14
jmp 0x1d14
xorl %r13d, %r13d
movq %rbx, %r15
subq %r13, %rbx
je 0x1f44
addq %r13, %rdi
movq %rbx, %r12
shlq $0x20, %r12
movq %rdi, %rsi
movslq %ebx, %rbp
movq %rsp, %rdi
movq %rbp, %rdx
vmovdqa %xmm7, 0x20(%rsp)
callq 0x1080
leaq (%rsp,%rbp), %rdi
movabsq $0x800000000, %rdx      # imm = 0x800000000
subq %r12, %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 0x12ae(%rip), %xmm2 # 0x302a
vpternlogq $0x78, %xmm2, %xmm0, %xmm1
vmovdqa %xmm1, 0x20(%rsp)
addq 0x18(%rsp), %r13
vpshufb 0x1469(%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
callq 0x1080
vpbroadcastb %ebx, %xmm0
vpaddb %xmm0, %xmm0, %xmm0
vmovdqa 0x1513(%rip), %xmm1     # 0x32e0
vpsubb %xmm0, %xmm1, %xmm1
vpbroadcastb 0x1250(%rip), %xmm2 # 0x302a
vpshufb %xmm1, %xmm2, %xmm1
vmovdqa 0x20(%rsp), %xmm3
vpand %xmm1, %xmm3, %xmm1
vpsllw $0x4, %xmm1, %xmm1
vmovdqa 0x14fa(%rip), %xmm2     # 0x32f0
vpsubb %xmm0, %xmm2, %xmm0
vpmovzxbq 0x122d(%rip), %xmm2 # 0x3030
vpshufb %xmm0, %xmm2, %xmm0
vpternlogq $0x96, %xmm1, %xmm3, %xmm0
testb $0x7, %r15b
je 0x1e25
vpshufd $0x39, %xmm0, %xmm1     # xmm1 = xmm0[1,2,3,0]
vpshufb 0x149d(%rip), %xmm0, %xmm0 # 0x32c0
jmp 0x1e48
vpbroadcastq %xmm0, %xmm1
vpshufd $0x9e, %xmm0, %xmm2     # xmm2 = xmm0[2,3,1,2]
vpxor %xmm2, %xmm1, %xmm1
movq 0x31ae(%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 0x135c(%rip), %xmm4     # 0x31b0
vmovdqa 0x1364(%rip), %xmm5     # 0x31c0
vmovdqa 0x136c(%rip), %xmm6     # 0x31d0
vmovdqa 0x1374(%rip), %xmm7     # 0x31e0
movq 0x316d(%rip), %rax      # 0x4fe0
vmovdqa 0x1375(%rip), %xmm8     # 0x31f0
vpbroadcastq 0x149c(%rip), %xmm9 # 0x3320
vpmovwb %xmm1, %xmm2
vpshufb 0x13fd(%rip), %xmm1, %xmm0 # 0x3290
vpsrlw $0x4, %xmm0, %xmm0
vpternlogq $0x48, %xmm2, %xmm9, %xmm0
vpshufb 0x13f8(%rip), %xmm1, %xmm3 # 0x32a0
vpshufb 0x13ff(%rip), %xmm1, %xmm1 # 0x32b0
vpsrlw $0x4, %xmm1, %xmm2
vpternlogq $0x48, %xmm3, %xmm9, %xmm2
addq $0x30, %r14
vmovdqa (%rax), %xmm1
movq $-0x4, %rax
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 0x1ecc
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 0x13be(%rip), %xmm0, %xmm0 # 0x3310
vpbroadcastw 0x10d1(%rip), %xmm1 # 0x302c
vpand %xmm1, %xmm7, %xmm1
vpmovwb %xmm1, %xmm1
vpor %xmm0, %xmm1, %xmm0
movq 0x18(%rsp), %rax
vmovd %xmm0, (%rax,%r15)
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq