// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/paeq128/aesni/encrypt.cpp
// Function: PAEQ128_opt_AESNI_encrypt(unsigned char*, unsigned long long*, unsigned char const*, unsigned long long, unsigned char const*, unsigned long long, unsigned char const*, unsigned char const*)
int PAEQ128_opt_AESNI_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 *npub,
	const unsigned char *k
	)

{

	if (clen == NULL)
		return -1;
	if ((mlen == 0) && (adlen == 0))
	{
		*clen = 0;
		return 0;
	}

	//Assume that we do encryption and/or authentication so we need a key and a ciphertext pointer valid
	if ((k == NULL) || (c == NULL))
		return -2;

	if (npub == NULL)
		return -7;

	//1.1 Initializing constants
	uint64_t D_left = ((uint64_t)CRYPTO_NPUBBYTES * 8) + (((uint64_t)CRYPTO_KEYBYTES * 8) << 8);
	__m128i D0 = _mm_set_epi64x(0, D_left);
	__m128i D2 = _mm_set_epi64x(0, D_left + 2);
	__m128i one128 = _mm_set_epi64x(0, 1);
	__m128i four128 = _mm_set_epi64x(0, 4);
	__m128i six128 = _mm_set_epi64x(0, 6);
	__m128i counter_one128 = _mm_set_epi64x(0, 1 << 16);  //value to increase the counter
	__m128i Dmask = _mm_set_epi32(0xffffffff, 0xffffffff, 0xffffffff, 0xffff0000);
	(*clen) = 0;

	//Block variables
	__m128i BlockInput[4];  //V1 - input to the first layer call of F
	__m128i BlockMiddle[4];  //W1 - output of the first layer call of F
	__m128i BlockOutput[4];  //Y1 - output of the second layer call of F

	//Extra variables
	__m128i BlockExtraInput[4];
	__m128i BlockExtraMiddle[4];
	__m128i BlockExtraOutput[4];


	__m128i BlockLastInput[4];  //Z1 - input to the last call of F
	__m128i Tag[4]; //Tag output

	//1.2 Clearing variables
	memset(BlockLastInput, 0, 64);
	memset(BlockInput, 0, 64);  //Also sets counter to 0
	memset(BlockOutput, 0, 64);
	memset(BlockMiddle, 0, 64);
	memset(BlockMiddle, 0, 64);

	//1.3 Setting first block: Constant (bytes 0-1) || Counter (bytes 2-35) || Nonce (bytes 36-47) || Key (bytes 48-63)
	//1.3.1 Domain separation
	BlockInput[0] = D0;  //Domain separation constant

	//1.3.2 Nonce
	uint64_t nonce_low = (*((uint64_t*)npub)) << 32;
	uint64_t nonce_high = *((uint64_t*)(npub + 4));
	BlockInput[2] = _mm_set_epi64x(nonce_high, nonce_low);   

	//1.3.3 Key
	__m128i Key = _mm_set_epi64x(*((uint64_t*)(k + 8)), (*((uint64_t*)k)));
	BlockInput[3] = Key;

	unsigned long long encrypted_bytes = 0;//Encrypted bytes counter

	//Encryption part
	if (mlen != 0)
	{
		if (m == NULL)
			return -3;

		while ((mlen>0))
		{
			// I. First layer 

			if ((mlen < 2 * CRYPTO_MBLOCK) || (encrypted_bytes == 0))
			{

				//1. Domain-separation constant
				if (mlen < CRYPTO_MBLOCK) //Last incomplete block
					BlockInput[0] = _mm_add_epi64(BlockInput[0], one128);

				//2. Counter incrementing
				BlockInput[0] = _mm_add_epi64(BlockInput[0], counter_one128);

				//3. Permutation call
				FPermAsm(BlockInput, BlockMiddle); //First layer call to F

				// II. Encryption

				//1. Filling plaintext buffers
				__m128i plaintext128[3];
				uint64_t plaintext_buffer[6];
				uint64_t ciphertext_buffer[6];
				plaintext_buffer[0] = D_left + 2; //Making D2
				if (mlen >= CRYPTO_MBLOCK)//Full block encryption
					memcpy(((char*)plaintext_buffer) + 2, m + encrypted_bytes, CRYPTO_MBLOCK);
				else
				{
					plaintext_buffer[0]++; //Making D3
					//Filling buffers with mlen
					plaintext_buffer[0] ^= (((uint64_t)mlen * 0x01010101) << 32) ^ ((uint64_t)mlen * 0x01010000);
					for (unsigned i = 1; i < 6; ++i)
						plaintext_buffer[i] = (((uint64_t)mlen * 0x01010101) << 32) ^ ((uint64_t)mlen * 0x01010101);
					memcpy(((char*)plaintext_buffer) + 2, m + encrypted_bytes, mlen);
				}

				//2. Working with BlockMiddle
				plaintext128[0] = _mm_set_epi64x(plaintext_buffer[1], plaintext_buffer[0]);
				plaintext128[1] = _mm_set_epi64x(plaintext_buffer[3], plaintext_buffer[2]);
				plaintext128[2] = _mm_set_epi64x(plaintext_buffer[5], plaintext_buffer[4]);

				BlockMiddle[0] = _mm_and_si128(BlockMiddle[0], Dmask); //Clearing first two bytes
				BlockMiddle[0] = _mm_xor_si128(BlockMiddle[0], plaintext128[0]);
				BlockMiddle[1] = _mm_xor_si128(BlockMiddle[1], plaintext128[1]);
				BlockMiddle[2] = _mm_xor_si128(BlockMiddle[2], plaintext128[2]);

				//Ciphertext extraction
				_mm_storeu_si128((__m128i*)ciphertext_buffer, BlockMiddle[0]);
				_mm_storeu_si128((__m128i*)(ciphertext_buffer+2), BlockMiddle[1]);
				_mm_storeu_si128((__m128i*)(ciphertext_buffer+4), BlockMiddle[2]);

				if (mlen >= CRYPTO_MBLOCK)
					memcpy(c + encrypted_bytes, ((char*)ciphertext_buffer) + 2, CRYPTO_MBLOCK);
				else //Last incomplete block
					memcpy(c + encrypted_bytes, ((char*)ciphertext_buffer) + 2, mlen);
				memset(ciphertext_buffer, 0, 6 * sizeof(uint64_t));

				//Counters increment
				if (mlen >= CRYPTO_MBLOCK)
				{
					encrypted_bytes += CRYPTO_MBLOCK;
					mlen -= CRYPTO_MBLOCK;
				}
				else
				{
					encrypted_bytes += mlen;
					mlen = 0;
				}
				(*clen) = encrypted_bytes;

				//III. Second permutation call
				//1. Call
				FPermAsm(BlockMiddle, BlockOutput); //Second layer call to F

				//2. Buffer update: Adding the output to tag preparation buffer
				BlockLastInput[0] = _mm_xor_si128(BlockOutput[0], BlockLastInput[0]);
				BlockLastInput[1] = _mm_xor_si128(BlockOutput[1], BlockLastInput[1]);
				BlockLastInput[2] = _mm_xor_si128(BlockOutput[2], BlockLastInput[2]);
			}//end of <138 byte condition


			else //More than 137 bytes to encrypt
			{
				BlockExtraInput[0] = _mm_add_epi64(BlockInput[0], counter_one128);
				BlockInput[0] = _mm_add_epi64(BlockExtraInput[0], counter_one128);
				BlockExtraInput[1] = BlockInput[1];
				BlockExtraInput[2] = BlockInput[2];
				BlockExtraInput[3] = BlockInput[3];

				//2. Two-permutation call
				DoubleFPermAsm(BlockExtraInput, BlockInput, BlockExtraMiddle, BlockMiddle); //First layer call to F


				//3. Loading plaintext
				__m128i plaintext_buffer[6];  //96-byte storage
				plaintext_buffer[0] = _mm_loadu_si128((__m128i*)(m + encrypted_bytes - 2));   //Bytes [0:13]
				plaintext_buffer[1] = _mm_loadu_si128((__m128i*)(m + encrypted_bytes + 14));  //Bytes [14:29]
				plaintext_buffer[2] = _mm_loadu_si128((__m128i*)(m + encrypted_bytes + 30));  //Bytes [30:45]
				plaintext_buffer[3] = _mm_loadu_si128((__m128i*)(m + encrypted_bytes + 44));  //Bytes [0:13]
				plaintext_buffer[4] = _mm_loadu_si128((__m128i*)(m + encrypted_bytes + 60));   //Bytes [14:29]
				plaintext_buffer[5] = _mm_loadu_si128((__m128i*)(m + encrypted_bytes + 76));  //Bytes [30:45]

				//4. Preparing the middle layer
				BlockMiddle[0] = _mm_and_si128(BlockMiddle[0], Dmask); //Clearing first two bytes
				BlockExtraMiddle[0] = _mm_and_si128(BlockExtraMiddle[0], Dmask);
				BlockMiddle[0] = _mm_xor_si128(BlockMiddle[0], D2);    //Loading D2
				BlockExtraMiddle[0] = _mm_xor_si128(BlockExtraMiddle[0], D2);

				//5. Xoring plaintext
				plaintext_buffer[0] = _mm_and_si128(plaintext_buffer[0], Dmask); //Clearing first two bytes
				plaintext_buffer[3] = _mm_and_si128(plaintext_buffer[3], Dmask); //Clearing first two bytes
				BlockExtraMiddle[0] = _mm_xor_si128(BlockExtraMiddle[0], plaintext_buffer[0]);
				BlockExtraMiddle[1] = _mm_xor_si128(BlockExtraMiddle[1], plaintext_buffer[1]);
				BlockExtraMiddle[2] = _mm_xor_si128(BlockExtraMiddle[2], plaintext_buffer[2]);
				BlockMiddle[0] = _mm_xor_si128(BlockMiddle[0], plaintext_buffer[3]);
				BlockMiddle[1] = _mm_xor_si128(BlockMiddle[1], plaintext_buffer[4]);
				BlockMiddle[2] = _mm_xor_si128(BlockMiddle[2], plaintext_buffer[5]);

				//6. Extracting ciphertext
				memcpy(c + encrypted_bytes, ((char*)BlockExtraMiddle) + 2, CRYPTO_MBLOCK);
				memcpy(c + encrypted_bytes + 46, ((char*)BlockMiddle) + 2, CRYPTO_MBLOCK);

				//7. Second layer permutation
				DoubleFPermAsm(BlockExtraMiddle, BlockMiddle, BlockExtraOutput, BlockOutput); //Second layer call to F

				//8. Buffer update: Adding the output to tag preparation buffer
				BlockLastInput[0] = _mm_xor_si128(BlockOutput[0], BlockLastInput[0]);
				BlockLastInput[1] = _mm_xor_si128(BlockOutput[1], BlockLastInput[1]);
				BlockLastInput[2] = _mm_xor_si128(BlockOutput[2], BlockLastInput[2]);
				BlockLastInput[0] = _mm_xor_si128(BlockExtraOutput[0], BlockLastInput[0]);
				BlockLastInput[1] = _mm_xor_si128(BlockExtraOutput[1], BlockLastInput[1]);
				BlockLastInput[2] = _mm_xor_si128(BlockExtraOutput[2], BlockLastInput[2]);


				//9.Counter update
				encrypted_bytes += 2 * CRYPTO_MBLOCK;
				mlen -= 2 * CRYPTO_MBLOCK;
				(*clen) = encrypted_bytes;
			}


		}//end of encryption loop
	}//end of encryption part

	//Clearing variables
	for (unsigned i = 0; i < 4; ++i)
	{
		BlockInput[i] = _mm_xor_si128(BlockInput[i], BlockInput[i]);
		BlockMiddle[i] = _mm_xor_si128(BlockMiddle[i], BlockMiddle[i]);
		BlockOutput[i] = _mm_xor_si128(BlockOutput[i], BlockOutput[i]);

		BlockExtraInput[i] = _mm_xor_si128(BlockExtraInput[i], BlockExtraInput[i]);
		BlockExtraMiddle[i] = _mm_xor_si128(BlockExtraMiddle[i], BlockExtraMiddle[i]);
		BlockExtraOutput[i] = _mm_xor_si128(BlockExtraOutput[i], BlockExtraOutput[i]);
	}



	//Associated data part	  
	if (adlen != 0)
	{
		if (ad == NULL)
		{
			for (unsigned i = 0; i < 4; ++i)
				BlockLastInput[i] = _mm_xor_si128(BlockLastInput[i], BlockLastInput[i]);
			Key = _mm_xor_si128(Key, Key);
			return -4;
		}

		unsigned long long adblock_counter = 1;   //AD block counter
		unsigned long long auth_bytes = 0;

		//Preparing the block
		BlockInput[0] = _mm_add_epi64(D0, four128);
		BlockInput[3] = Key;
		while (adlen>0)
		{
			if ((adlen <= (2 * CRYPTO_ADBLOCK)) || (auth_bytes == 0))
			{

				//1. Constant
				if (adlen < CRYPTO_ADBLOCK)
					BlockInput[0] = _mm_add_epi64(BlockInput[0], one128);


				//2. Counter
				BlockInput[0] = _mm_add_epi64(BlockInput[0], counter_one128);

				//3. AD block

				//3.1 Filling AD buffers
				uint64_t ad_buffer[4];
				ad_buffer[0] = 0;
				if (adlen >= CRYPTO_ADBLOCK)//Full block encryption
					memcpy(((char*)ad_buffer) + 2, ad + auth_bytes, CRYPTO_ADBLOCK);
				else
				{
					//Filling buffers with adlen
					ad_buffer[0] = ((uint64_t)adlen * 0x01010000)^ (((uint64_t)adlen * 0x01010101) << 32);
					for (unsigned i = 1; i < 4; ++i)
						ad_buffer[i] = (((uint64_t)adlen * 0x01010101) << 32) ^ ((uint64_t)adlen * 0x01010101);
					memcpy(((char*)ad_buffer) + 2, ad + auth_bytes, adlen);
				}

				//3.2 Working with BlockInput
				BlockInput[1] = _mm_set_epi64x(ad_buffer[1], ad_buffer[0]);
				BlockInput[2] = _mm_set_epi64x(ad_buffer[3], ad_buffer[2]);


				//4.Call to the F permutation
				FPermAsm(BlockInput, BlockOutput);//Call to the F permutation

				//Adding the output to tag preparation buffer
				BlockLastInput[0] = _mm_xor_si128(BlockOutput[0], BlockLastInput[0]);
				BlockLastInput[1] = _mm_xor_si128(BlockOutput[1], BlockLastInput[1]);
				BlockLastInput[2] = _mm_xor_si128(BlockOutput[2], BlockLastInput[2]);


				//Counters increment
				adblock_counter++;
				if (adlen >= CRYPTO_ADBLOCK)
				{
					auth_bytes += CRYPTO_ADBLOCK;
					adlen -= CRYPTO_ADBLOCK;
				}
				else
				{
					auth_bytes += adlen;
					adlen = 0;
				}
			}//end of 60-byte condition
			else //We authenticate 60-byte chunks
			{

				//1.Preparing input
				BlockExtraInput[0] = _mm_add_epi64(BlockInput[0], counter_one128);
				BlockInput[0] = _mm_add_epi64(BlockExtraInput[0], counter_one128);
				BlockExtraInput[3] = BlockInput[3]; //Key is constant

				//2. Loading AD
				BlockExtraInput[1] = _mm_loadu_si128((__m128i*)(ad + auth_bytes - 2));   //Bytes [0:13]
				BlockExtraInput[1] = _mm_and_si128(BlockExtraInput[1], Dmask); //Clearing first two bytes
				BlockExtraInput[2] = _mm_loadu_si128((__m128i*)(ad + auth_bytes + 14));  //Bytes [14:29]
				BlockInput[1] = _mm_loadu_si128((__m128i*)(ad + auth_bytes + 28));  //Bytes [0:13]
				BlockInput[1] = _mm_and_si128(BlockInput[1], Dmask); //Clearing first two bytes
				BlockInput[2] = _mm_loadu_si128((__m128i*)(ad + auth_bytes + 44));  //Bytes [14:29]

				//3. Call to the permutation
				DoubleFPermAsm(BlockExtraInput, BlockInput, BlockExtraOutput, BlockOutput);

				//4. Buffer update: Adding the output to tag preparation buffer
				BlockLastInput[0] = _mm_xor_si128(BlockOutput[0], BlockLastInput[0]);
				BlockLastInput[1] = _mm_xor_si128(BlockOutput[1], BlockLastInput[1]);
				BlockLastInput[2] = _mm_xor_si128(BlockOutput[2], BlockLastInput[2]);
				BlockLastInput[0] = _mm_xor_si128(BlockExtraOutput[0], BlockLastInput[0]);
				BlockLastInput[1] = _mm_xor_si128(BlockExtraOutput[1], BlockLastInput[1]);
				BlockLastInput[2] = _mm_xor_si128(BlockExtraOutput[2], BlockLastInput[2]);

				//5. Counter update
				auth_bytes += 2 * CRYPTO_ADBLOCK;
				adlen -= 2 * CRYPTO_ADBLOCK;
			}
		}//end of AD loop
	}//end of AD part

	// Tag production 
	BlockLastInput[3] = Key;
	BlockLastInput[0] = _mm_and_si128(BlockLastInput[0], Dmask); //Clearing first two bytes
	BlockLastInput[0] = _mm_add_epi64(BlockLastInput[0], six128);
	BlockLastInput[0] = _mm_add_epi64(BlockLastInput[0], D0);

	//1. Permutation call
	FPermAsm(BlockLastInput, Tag);
	//2. Key injection

	Tag[3] = _mm_xor_si128(Tag[3], Key);

	//3. Truncation
	memcpy(c + (*clen), Tag, CRYPTO_ABYTES);
	*clen += CRYPTO_ABYTES;


	//Clearing variables
	for (unsigned i = 0; i < 4; ++i)
	{
		BlockInput[i] = _mm_xor_si128(BlockInput[i], BlockInput[i]);
		BlockMiddle[i] = _mm_xor_si128(BlockMiddle[i], BlockMiddle[i]);
		BlockOutput[i] = _mm_xor_si128(BlockOutput[i], BlockOutput[i]);

		BlockExtraInput[i] = _mm_xor_si128(BlockExtraInput[i], BlockExtraInput[i]);
		BlockExtraMiddle[i] = _mm_xor_si128(BlockExtraMiddle[i], BlockExtraMiddle[i]);
		BlockExtraOutput[i] = _mm_xor_si128(BlockExtraOutput[i], BlockExtraOutput[i]);
		BlockLastInput[i] = _mm_xor_si128(BlockLastInput[i], BlockLastInput[i]);
	}
	Key = _mm_xor_si128(Key, Key);



	return 0;
}

// Assembly:
testq %rsi, %rsi
je 0x29d4
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %r9, %r15
movq %rcx, %r13
movq %r9, %rax
orq %rcx, %rax
je 0x29da
movq %rdx, %rbp
movq %rdi, %r14
movq 0x188(%rsp), %rcx
testq %rcx, %rcx
sete %al
testq %rdi, %rdi
sete %dl
orb %al, %dl
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jne 0x2e27
movq 0x180(%rsp), %rax
testq %rax, %rax
je 0x29e6
movq $0x0, (%rsi)
vmovdqu (%rcx), %xmm14
testq %r13, %r13
movq %rsi, 0x8(%rsp)
vmovdqa %xmm14, 0xb0(%rsp)
movq %r8, (%rsp)
je 0x29f0
testq %rbp, %rbp
je 0x2e3c
movq (%rax), %rcx
vmovq 0x4(%rax), %xmm0
shlq $0x20, %rcx
vmovq %rcx, %xmm1
vpunpcklqdq %xmm0, %xmm1, %xmm18 # xmm18 = xmm1[0],xmm0[0]
movabsq $0x101010101010000, %rax # imm = 0x101010101010000
leaq 0x12(%rsp), %rbx
vmovd 0xeff(%rip), %xmm19     # 0x31d0
xorl %r12d, %r12d
vmovd 0xef6(%rip), %xmm20     # 0x31d4
vpbroadcastq 0xe30(%rip), %xmm21 # 0x3118
vpbroadcastq 0xe1e(%rip), %xmm22 # 0x3110
vpbroadcastq 0xe24(%rip), %xmm23 # 0x3120
vpbroadcastq 0xe22(%rip), %xmm24 # 0x3128
addq $0x101, %rax            # imm = 0x101
movq %rax, 0xc8(%rsp)
vpxor %xmm15, %xmm15, %xmm15
vpxor %xmm10, %xmm10, %xmm10
vpxor %xmm11, %xmm11, %xmm11
vmovdqa64 %xmm18, 0xd0(%rsp)
cmpq $0x5c, %r13
setb %al
testq %r12, %r12
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x243b
cmpq $0x2e, %r13
jae 0x2353
vpaddq 0xe2d(%rip), %xmm19, %xmm19 # 0x3180
vpaddq %xmm20, %xmm19, %xmm19
vpxor %xmm5, %xmm5, %xmm5
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm0
vmovdqa %xmm14, %xmm8
vmovdqa64 %xmm18, %xmm7
vmovdqa64 %xmm19, %xmm9
vmovdqa64 %xmm23, %xmm1
vmovdqa64 %xmm22, %xmm2
vmovdqa64 %xmm21, %xmm3
movb $0x1, %cl
vaesenc %xmm0, %xmm9, %xmm9
vaesenc %xmm1, %xmm5, %xmm5
vaesenc %xmm3, %xmm7, %xmm7
vaesenc %xmm2, %xmm8, %xmm8
vpaddq %xmm22, %xmm0, %xmm0
vpaddq %xmm22, %xmm1, %xmm1
vpaddq %xmm22, %xmm3, %xmm3
vpaddq %xmm22, %xmm2, %xmm2
testb $0x1, %cl
movl $0x0, %ecx
jne 0x238a
vpunpckhdq %xmm9, %xmm5, %xmm4 # xmm4 = xmm5[2],xmm9[2],xmm5[3],xmm9[3]
vpunpckldq %xmm9, %xmm5, %xmm5 # xmm5 = xmm5[0],xmm9[0],xmm5[1],xmm9[1]
vpunpckhdq %xmm7, %xmm8, %xmm6 # xmm6 = xmm8[2],xmm7[2],xmm8[3],xmm7[3]
vpunpckldq %xmm7, %xmm8, %xmm7 # xmm7 = xmm8[0],xmm7[0],xmm8[1],xmm7[1]
vpunpckhdq %xmm5, %xmm7, %xmm8 # xmm8 = xmm7[2],xmm5[2],xmm7[3],xmm5[3]
vpunpckldq %xmm5, %xmm7, %xmm9 # xmm9 = xmm7[0],xmm5[0],xmm7[1],xmm5[1]
vpunpckldq %xmm6, %xmm4, %xmm7 # xmm7 = xmm4[0],xmm6[0],xmm4[1],xmm6[1]
vpunpckhdq %xmm6, %xmm4, %xmm5 # xmm5 = xmm4[2],xmm6[2],xmm4[3],xmm6[3]
incl %eax
cmpl $0xa, %eax
jne 0x2388
movq $0x8062, 0x10(%rsp)     # imm = 0x8062
cmpq $0x2e, %r13
vmovdqa %xmm15, 0x70(%rsp)
vmovdqa %xmm10, 0x60(%rsp)
vmovdqa %xmm11, 0x50(%rsp)
vmovdqa64 %xmm19, 0x40(%rsp)
vmovdqa %xmm8, 0xe0(%rsp)
jb 0x26c2
vmovdqu (%rbp,%r12), %ymm0
vmovdqu 0xe(%rbp,%r12), %ymm1
vmovdqu %ymm1, 0xe(%rbx)
vmovdqu %ymm0, (%rbx)
jmp 0x27e1
vmovdqa64 %xmm11, %xmm17
vmovdqa64 %xmm10, %xmm16
vpaddq %xmm20, %xmm19, %xmm2
vpaddq 0xd09(%rip), %xmm19, %xmm19 # 0x3160
vpxor %xmm3, %xmm3, %xmm3
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm4
vmovdqa64 %xmm23, %xmm5
vmovdqa %xmm14, %xmm0
vmovdqa64 %xmm18, %xmm7
vmovdqa64 %xmm19, %xmm6
vmovdqa %xmm14, %xmm1
vmovdqa64 %xmm18, %xmm8
vpxor %xmm9, %xmm9, %xmm9
vmovdqa64 %xmm21, %xmm10
vmovdqa64 %xmm22, %xmm11
movb $0x1, %cl
vaesenc %xmm4, %xmm2, %xmm2
vaesenc %xmm5, %xmm9, %xmm9
vaesenc %xmm10, %xmm8, %xmm8
vaesenc %xmm11, %xmm1, %xmm1
vaesenc %xmm4, %xmm6, %xmm6
vaesenc %xmm5, %xmm3, %xmm3
vaesenc %xmm10, %xmm7, %xmm7
vaesenc %xmm11, %xmm0, %xmm0
vpaddq %xmm22, %xmm4, %xmm4
vpaddq %xmm22, %xmm5, %xmm5
vpaddq %xmm22, %xmm10, %xmm10
vpaddq %xmm22, %xmm11, %xmm11
testb $0x1, %cl
movl $0x0, %ecx
jne 0x2496
vpunpckhdq %xmm2, %xmm9, %xmm12 # xmm12 = xmm9[2],xmm2[2],xmm9[3],xmm2[3]
vpunpckldq %xmm2, %xmm9, %xmm2 # xmm2 = xmm9[0],xmm2[0],xmm9[1],xmm2[1]
vpunpckhdq %xmm8, %xmm1, %xmm9 # xmm9 = xmm1[2],xmm8[2],xmm1[3],xmm8[3]
vpunpckldq %xmm8, %xmm1, %xmm8 # xmm8 = xmm1[0],xmm8[0],xmm1[1],xmm8[1]
vpunpckhdq %xmm2, %xmm8, %xmm1 # xmm1 = xmm8[2],xmm2[2],xmm8[3],xmm2[3]
vpunpckldq %xmm2, %xmm8, %xmm2 # xmm2 = xmm8[0],xmm2[0],xmm8[1],xmm2[1]
vpunpckldq %xmm9, %xmm12, %xmm8 # xmm8 = xmm12[0],xmm9[0],xmm12[1],xmm9[1]
vpunpckhdq %xmm9, %xmm12, %xmm9 # xmm9 = xmm12[2],xmm9[2],xmm12[3],xmm9[3]
vpunpckhdq %xmm6, %xmm3, %xmm12 # xmm12 = xmm3[2],xmm6[2],xmm3[3],xmm6[3]
vpunpckldq %xmm6, %xmm3, %xmm3 # xmm3 = xmm3[0],xmm6[0],xmm3[1],xmm6[1]
vpunpckhdq %xmm7, %xmm0, %xmm13 # xmm13 = xmm0[2],xmm7[2],xmm0[3],xmm7[3]
vpunpckldq %xmm7, %xmm0, %xmm6 # xmm6 = xmm0[0],xmm7[0],xmm0[1],xmm7[1]
vpunpckhdq %xmm3, %xmm6, %xmm0 # xmm0 = xmm6[2],xmm3[2],xmm6[3],xmm3[3]
vpunpckldq %xmm3, %xmm6, %xmm6 # xmm6 = xmm6[0],xmm3[0],xmm6[1],xmm3[1]
vpunpckldq %xmm13, %xmm12, %xmm7 # xmm7 = xmm12[0],xmm13[0],xmm12[1],xmm13[1]
vpunpckhdq %xmm13, %xmm12, %xmm3 # xmm3 = xmm12[2],xmm13[2],xmm12[3],xmm13[3]
incl %eax
cmpl $0xa, %eax
jne 0x2494
vpxor -0x2(%rbp,%r12), %xmm2, %xmm2
vpxor %xmm10, %xmm10, %xmm10
vpblendw $0x1, %xmm10, %xmm2, %xmm2 # xmm2 = xmm10[0],xmm2[1,2,3,4,5,6,7]
vmovd 0xc8d(%rip), %xmm11     # 0x31d8
vpxor %xmm2, %xmm11, %xmm4
vpxor 0xe(%rbp,%r12), %xmm9, %xmm5
vpxor 0x1e(%rbp,%r12), %xmm8, %xmm2
vpxor 0x2c(%rbp,%r12), %xmm6, %xmm8
vpxor 0x3c(%rbp,%r12), %xmm3, %xmm6
vpxor 0x4c(%rbp,%r12), %xmm7, %xmm3
vmovdqa %xmm4, 0x100(%rsp)
vpblendw $0x1, %xmm10, %xmm8, %xmm7 # xmm7 = xmm10[0],xmm8[1,2,3,4,5,6,7]
vpxor %xmm7, %xmm11, %xmm7
vmovdqa %xmm7, 0xf0(%rsp)
leaq 0x102(%rsp), %rcx
movq (%rcx), %rax
movq 0x6(%rcx), %rcx
movq %rcx, 0x6(%r14,%r12)
movq %rax, (%r14,%r12)
vmovdqu %xmm5, 0xe(%r14,%r12)
vmovdqu %xmm2, 0x1e(%r14,%r12)
leaq 0xf2(%rsp), %rcx
movq (%rcx), %rax
movq 0x6(%rcx), %rcx
movq %rax, 0x2e(%r14,%r12)
movq %rcx, 0x34(%r14,%r12)
vmovdqu %xmm6, 0x3c(%r14,%r12)
vmovdqu %xmm3, 0x4c(%r14,%r12)
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm8
vmovdqa64 %xmm23, %xmm9
vmovdqa64 %xmm21, %xmm10
vmovdqa64 %xmm22, %xmm11
movb $0x1, %cl
vaesenc %xmm8, %xmm4, %xmm4
vaesenc %xmm9, %xmm5, %xmm5
vaesenc %xmm10, %xmm2, %xmm2
vaesenc %xmm11, %xmm1, %xmm1
vaesenc %xmm8, %xmm7, %xmm7
vaesenc %xmm9, %xmm6, %xmm6
vaesenc %xmm10, %xmm3, %xmm3
vaesenc %xmm11, %xmm0, %xmm0
vpaddq %xmm22, %xmm8, %xmm8
vpaddq %xmm22, %xmm9, %xmm9
vpaddq %xmm22, %xmm10, %xmm10
vpaddq %xmm22, %xmm11, %xmm11
testb $0x1, %cl
movl $0x0, %ecx
jne 0x25f7
vpunpckhdq %xmm4, %xmm5, %xmm12 # xmm12 = xmm5[2],xmm4[2],xmm5[3],xmm4[3]
vpunpckldq %xmm4, %xmm5, %xmm4 # xmm4 = xmm5[0],xmm4[0],xmm5[1],xmm4[1]
vpunpckhdq %xmm2, %xmm1, %xmm5 # xmm5 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
vpunpckldq %xmm2, %xmm1, %xmm2 # xmm2 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
vpunpckhdq %xmm4, %xmm2, %xmm1 # xmm1 = xmm2[2],xmm4[2],xmm2[3],xmm4[3]
vpunpckldq %xmm4, %xmm2, %xmm4 # xmm4 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
vpunpckldq %xmm5, %xmm12, %xmm2 # xmm2 = xmm12[0],xmm5[0],xmm12[1],xmm5[1]
vpunpckhdq %xmm5, %xmm12, %xmm5 # xmm5 = xmm12[2],xmm5[2],xmm12[3],xmm5[3]
vpunpckhdq %xmm7, %xmm6, %xmm12 # xmm12 = xmm6[2],xmm7[2],xmm6[3],xmm7[3]
vpunpckldq %xmm7, %xmm6, %xmm6 # xmm6 = xmm6[0],xmm7[0],xmm6[1],xmm7[1]
vpunpckhdq %xmm3, %xmm0, %xmm13 # xmm13 = xmm0[2],xmm3[2],xmm0[3],xmm3[3]
vpunpckldq %xmm3, %xmm0, %xmm3 # xmm3 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
vpunpckhdq %xmm6, %xmm3, %xmm0 # xmm0 = xmm3[2],xmm6[2],xmm3[3],xmm6[3]
vpunpckldq %xmm6, %xmm3, %xmm7 # xmm7 = xmm3[0],xmm6[0],xmm3[1],xmm6[1]
vpunpckldq %xmm13, %xmm12, %xmm3 # xmm3 = xmm12[0],xmm13[0],xmm12[1],xmm13[1]
vpunpckhdq %xmm13, %xmm12, %xmm6 # xmm6 = xmm12[2],xmm13[2],xmm12[3],xmm13[3]
incl %eax
cmpl $0xa, %eax
jne 0x25f5
vmovdqa64 %xmm17, %xmm11
vpternlogq $0x96, %xmm7, %xmm4, %xmm11
vmovdqa64 %xmm16, %xmm10
vpternlogq $0x96, %xmm6, %xmm5, %xmm10
vpternlogq $0x96, %xmm3, %xmm2, %xmm15
addq $0x5c, %r12
addq $-0x5c, %r13
movq %r12, (%rsi)
movq %r12, %rdx
jmp 0x29c9
vmovdqa %xmm9, 0x80(%rsp)
vmovdqa %xmm5, 0x90(%rsp)
vmovdqa %xmm7, 0xa0(%rsp)
movq %r13, %rax
movabsq $0x101010101010000, %rcx # imm = 0x101010101010000
imulq %rcx, %rax
orq $0x8063, %rax           # imm = 0x8063
movq %rax, 0x10(%rsp)
movq %r13, %rax
imulq 0xc8(%rsp), %rax
vpbroadcastq %rax, %ymm0
xorl %eax, %eax
vpmovsxbq 0xad2(%rip), %ymm2 # 0x31e8
vpbroadcastq 0xa11(%rip), %ymm3 # 0x3130
vpbroadcastq %rax, %ymm1
vpor %ymm2, %ymm1, %ymm1
vpcmpltuq %ymm3, %ymm1, %k1
vmovdqu64 %ymm0, 0x6(%rbx,%rax,8) {%k1}
addq $0x4, %rax
cmpq $0x8, %rax
jne 0x271f
leaq (%r12,%rbp), %rsi
movq %rbx, %rdi
movq %r13, %rdx
vzeroupper
callq 0x1090
movq 0x8(%rsp), %rsi
vmovdqa 0xb0(%rsp), %xmm14
vmovdqa 0x70(%rsp), %xmm15
vmovdqa 0x60(%rsp), %xmm10
movq (%rsp), %r8
vmovdqa 0x50(%rsp), %xmm11
vmovdqa64 0xd0(%rsp), %xmm18
vmovdqa64 0x40(%rsp), %xmm19
vmovd 0xa3f(%rip), %xmm20     # 0x31d4
vpbroadcastq 0x979(%rip), %xmm21 # 0x3118
vpbroadcastq 0x967(%rip), %xmm22 # 0x3110
vpbroadcastq 0x96d(%rip), %xmm23 # 0x3120
vpbroadcastq 0x96b(%rip), %xmm24 # 0x3128
vmovdqa 0xe0(%rsp), %xmm8
vmovdqa 0xa0(%rsp), %xmm7
vmovdqa 0x90(%rsp), %xmm5
vmovdqa 0x80(%rsp), %xmm9
vmovdqa 0x10(%rsp), %xmm0
vmovdqa 0x20(%rsp), %xmm1
vmovdqa 0x30(%rsp), %xmm2
vpinsrq $0x1, 0x18(%rsp), %xmm0, %xmm0
leaq (%r14,%r12), %rdi
vpinsrq $0x1, 0x28(%rsp), %xmm1, %xmm1
vpinsrq $0x1, 0x38(%rsp), %xmm2, %xmm2
vpxor %xmm3, %xmm3, %xmm3
vpblendw $0x1, %xmm3, %xmm9, %xmm3 # xmm3 = xmm3[0],xmm9[1,2,3,4,5,6,7]
vpxor %xmm0, %xmm3, %xmm9
vmovdqa %xmm9, 0xf0(%rsp)
vpxor %xmm5, %xmm1, %xmm5
vmovdqa %xmm9, 0x110(%rsp)
vpxor %xmm7, %xmm2, %xmm7
vmovdqa %xmm5, 0x120(%rsp)
vmovdqa %xmm7, 0x130(%rsp)
cmpq $0x2e, %r13
jb 0x2873
leaq 0x112(%rsp), %rax
vmovdqu (%rax), %ymm0
vmovdqu 0xe(%rax), %ymm1
vmovdqu %ymm1, 0xe(%rdi)
vmovdqu %ymm0, (%rdi)
movl $0x2e, %edx
jmp 0x292e
leaq 0x112(%rsp), %rsi
movq %r13, %rdx
vmovdqa %xmm9, 0xa0(%rsp)
vmovdqa %xmm7, 0x90(%rsp)
vmovdqa %xmm5, 0x80(%rsp)
vzeroupper
callq 0x1090
vmovdqa 0x80(%rsp), %xmm5
vmovdqa 0x90(%rsp), %xmm7
vmovdqa 0xa0(%rsp), %xmm9
vmovdqa 0xe0(%rsp), %xmm8
vpbroadcastq 0x859(%rip), %xmm24 # 0x3128
vpbroadcastq 0x847(%rip), %xmm23 # 0x3120
vpbroadcastq 0x82d(%rip), %xmm22 # 0x3110
vpbroadcastq 0x82b(%rip), %xmm21 # 0x3118
vmovd 0x8dd(%rip), %xmm20     # 0x31d4
vmovdqa64 0x40(%rsp), %xmm19
vmovdqa64 0xd0(%rsp), %xmm18
vmovdqa 0x50(%rsp), %xmm11
movq (%rsp), %r8
vmovdqa 0x60(%rsp), %xmm10
vmovdqa 0x70(%rsp), %xmm15
vmovdqa 0xb0(%rsp), %xmm14
movq 0x8(%rsp), %rsi
movq %r13, %rdx
addq %r12, %rdx
movq %rdx, (%rsi)
xorl %eax, %eax
vmovdqa64 %xmm24, %xmm0
vmovdqa64 %xmm23, %xmm1
vmovdqa64 %xmm22, %xmm2
vmovdqa64 %xmm21, %xmm3
movb $0x1, %cl
vaesenc %xmm0, %xmm9, %xmm9
vaesenc %xmm1, %xmm5, %xmm5
vaesenc %xmm3, %xmm7, %xmm7
vaesenc %xmm2, %xmm8, %xmm8
vpaddq %xmm22, %xmm0, %xmm0
vpaddq %xmm22, %xmm1, %xmm1
vpaddq %xmm22, %xmm3, %xmm3
vpaddq %xmm22, %xmm2, %xmm2
testb $0x1, %cl
movl $0x0, %ecx
jne 0x2950
vpunpckhdq %xmm9, %xmm5, %xmm4 # xmm4 = xmm5[2],xmm9[2],xmm5[3],xmm9[3]
vpunpckldq %xmm9, %xmm5, %xmm5 # xmm5 = xmm5[0],xmm9[0],xmm5[1],xmm9[1]
vpunpckhdq %xmm7, %xmm8, %xmm6 # xmm6 = xmm8[2],xmm7[2],xmm8[3],xmm7[3]
vpunpckldq %xmm7, %xmm8, %xmm7 # xmm7 = xmm8[0],xmm7[0],xmm8[1],xmm7[1]
vpunpckhdq %xmm5, %xmm7, %xmm8 # xmm8 = xmm7[2],xmm5[2],xmm7[3],xmm5[3]
vpunpckldq %xmm5, %xmm7, %xmm9 # xmm9 = xmm7[0],xmm5[0],xmm7[1],xmm5[1]
vpunpckldq %xmm6, %xmm4, %xmm7 # xmm7 = xmm4[0],xmm6[0],xmm4[1],xmm6[1]
vpunpckhdq %xmm6, %xmm4, %xmm5 # xmm5 = xmm4[2],xmm6[2],xmm4[3],xmm6[3]
incl %eax
cmpl $0xa, %eax
jne 0x294e
vpxor %xmm9, %xmm11, %xmm11
vpxor %xmm5, %xmm10, %xmm10
vpxor %xmm7, %xmm15, %xmm15
cmpq $0x2d, %r13
jbe 0x2a01
addq $-0x2e, %r13
movq %rdx, %r12
testq %r13, %r13
jne 0x232b
jmp 0x2a01
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movq $0x0, (%rsi)
jmp 0x2e25
movl $0xfffffff9, %eax       # imm = 0xFFFFFFF9
jmp 0x2e27
vpxor %xmm15, %xmm15, %xmm15
xorl %edx, %edx
vpxor %xmm10, %xmm10, %xmm10
vpxor %xmm11, %xmm11, %xmm11
testq %r15, %r15
je 0x2d86
testq %r8, %r8
je 0x2e43
movabsq $0x101010101010000, %rax # imm = 0x101010101010000
leaq 0x12(%rsp), %rbx
vmovd 0x7b4(%rip), %xmm18     # 0x31e0
vmovd 0x79e(%rip), %xmm19     # 0x31d4
vpbroadcastq 0x6d8(%rip), %xmm20 # 0x3118
vpbroadcastq 0x6c6(%rip), %xmm21 # 0x3110
xorl %r13d, %r13d
vpbroadcastq 0x6c9(%rip), %xmm22 # 0x3120
vpbroadcastq 0x6c7(%rip), %xmm23 # 0x3128
leaq 0x101(%rax), %rbp
vmovd 0x772(%rip), %xmm24     # 0x31e4
cmpq $0x3d, %r15
setb %al
testq %r13, %r13
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x2aba
cmpq $0x1e, %r15
jb 0x2be7
vpaddq %xmm19, %xmm18, %xmm18
movq $0x0, 0x10(%rsp)
vmovdqu (%r8,%r13), %xmm0
vmovdqu 0xe(%r8,%r13), %xmm1
vmovdqu %xmm1, 0xe(%rbx)
vmovdqu %xmm0, (%rbx)
jmp 0x2cbe
vmovdqa64 %xmm11, %xmm17
vmovdqa64 %xmm10, %xmm16
vpaddq %xmm19, %xmm18, %xmm1
vpxor %xmm4, %xmm4, %xmm4
vpblendw $0xfe, -0x2(%r8,%r13), %xmm4, %xmm3 # xmm3 = xmm4[0],mem[1,2,3,4,5,6,7]
vmovdqu 0xe(%r8,%r13), %xmm0
vpaddq %xmm24, %xmm18, %xmm18
vmovdqu 0x2c(%r8,%r13), %xmm2
vpblendw $0xfe, 0x1c(%r8,%r13), %xmm4, %xmm4 # xmm4 = xmm4[0],mem[1,2,3,4,5,6,7]
xorl %eax, %eax
vmovdqa64 %xmm23, %xmm5
vmovdqa64 %xmm22, %xmm6
vmovdqa %xmm14, %xmm7
vmovdqa64 %xmm18, %xmm8
vmovdqa %xmm14, %xmm9
vmovdqa64 %xmm20, %xmm10
vmovdqa64 %xmm21, %xmm11
movb $0x1, %cl
vaesenc %xmm5, %xmm1, %xmm1
vaesenc %xmm6, %xmm3, %xmm3
vaesenc %xmm10, %xmm0, %xmm0
vaesenc %xmm11, %xmm9, %xmm9
vaesenc %xmm5, %xmm8, %xmm8
vaesenc %xmm6, %xmm4, %xmm4
vaesenc %xmm10, %xmm2, %xmm2
vaesenc %xmm11, %xmm7, %xmm7
vpaddq %xmm21, %xmm5, %xmm5
vpaddq %xmm21, %xmm6, %xmm6
vpaddq %xmm21, %xmm10, %xmm10
vpaddq %xmm21, %xmm11, %xmm11
testb $0x1, %cl
movl $0x0, %ecx
jne 0x2b1f
vpunpckhdq %xmm1, %xmm3, %xmm12 # xmm12 = xmm3[2],xmm1[2],xmm3[3],xmm1[3]
vpunpckldq %xmm1, %xmm3, %xmm1 # xmm1 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
vpunpckhdq %xmm0, %xmm9, %xmm3 # xmm3 = xmm9[2],xmm0[2],xmm9[3],xmm0[3]
vpunpckldq %xmm0, %xmm9, %xmm0 # xmm0 = xmm9[0],xmm0[0],xmm9[1],xmm0[1]
vpunpckhdq %xmm1, %xmm0, %xmm9 # xmm9 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
vpunpckldq %xmm1, %xmm0, %xmm1 # xmm1 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
vpunpckldq %xmm3, %xmm12, %xmm0 # xmm0 = xmm12[0],xmm3[0],xmm12[1],xmm3[1]
vpunpckhdq %xmm3, %xmm12, %xmm3 # xmm3 = xmm12[2],xmm3[2],xmm12[3],xmm3[3]
vpunpckhdq %xmm8, %xmm4, %xmm12 # xmm12 = xmm4[2],xmm8[2],xmm4[3],xmm8[3]
vpunpckldq %xmm8, %xmm4, %xmm4 # xmm4 = xmm4[0],xmm8[0],xmm4[1],xmm8[1]
vpunpckhdq %xmm2, %xmm7, %xmm13 # xmm13 = xmm7[2],xmm2[2],xmm7[3],xmm2[3]
vpunpckldq %xmm2, %xmm7, %xmm2 # xmm2 = xmm7[0],xmm2[0],xmm7[1],xmm2[1]
vpunpckhdq %xmm4, %xmm2, %xmm7 # xmm7 = xmm2[2],xmm4[2],xmm2[3],xmm4[3]
vpunpckldq %xmm4, %xmm2, %xmm8 # xmm8 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
vpunpckldq %xmm13, %xmm12, %xmm2 # xmm2 = xmm12[0],xmm13[0],xmm12[1],xmm13[1]
vpunpckhdq %xmm13, %xmm12, %xmm4 # xmm4 = xmm12[2],xmm13[2],xmm12[3],xmm13[3]
incl %eax
cmpl $0xa, %eax
jne 0x2b1d
vmovdqa64 %xmm17, %xmm11
vpternlogq $0x96, %xmm8, %xmm1, %xmm11
vmovdqa64 %xmm16, %xmm10
vpternlogq $0x96, %xmm4, %xmm3, %xmm10
vpternlogq $0x96, %xmm2, %xmm0, %xmm15
addq $-0x3c, %r15
movl $0x3c, %eax
jmp 0x2d7a
movq %r15, %rax
movabsq $0x101010101010000, %rcx # imm = 0x101010101010000
imulq %rcx, %rax
movq %rax, 0x10(%rsp)
movq %r15, %rax
imulq %rbp, %rax
vpbroadcastq %rax, %ymm0
movb $0x7, %al
kmovd %eax, %k1
vmovdqu64 %ymm0, 0x6(%rbx) {%k1}
vpaddq 0x58c(%rip), %xmm18, %xmm18 # 0x31b0
vmovdqa64 %xmm18, 0x40(%rsp)
leaq (%r8,%r13), %rsi
movq %rbx, %rdi
movq %rdx, %r12
movq %r15, %rdx
vmovdqa %xmm15, 0x70(%rsp)
vmovdqa %xmm10, 0x60(%rsp)
vmovdqa %xmm11, 0x50(%rsp)
vzeroupper
callq 0x1090
vmovd 0x587(%rip), %xmm24     # 0x31e4
vpbroadcastq 0x4c1(%rip), %xmm23 # 0x3128
vpbroadcastq 0x4af(%rip), %xmm22 # 0x3120
vpbroadcastq 0x495(%rip), %xmm21 # 0x3110
vpbroadcastq 0x493(%rip), %xmm20 # 0x3118
vmovd 0x545(%rip), %xmm19     # 0x31d4
vmovdqa64 0x40(%rsp), %xmm18
movq %r12, %rdx
vmovdqa 0x50(%rsp), %xmm11
movq (%rsp), %r8
vmovdqa 0x60(%rsp), %xmm10
vmovdqa 0x70(%rsp), %xmm15
vmovdqa 0xb0(%rsp), %xmm14
movq 0x8(%rsp), %rsi
vmovdqa 0x10(%rsp), %xmm0
vmovdqa 0x20(%rsp), %xmm2
vpinsrq $0x1, 0x18(%rsp), %xmm0, %xmm1
vpinsrq $0x1, 0x28(%rsp), %xmm2, %xmm0
xorl %eax, %eax
vmovdqa64 %xmm23, %xmm2
vmovdqa %xmm14, %xmm3
vmovdqa64 %xmm18, %xmm5
vmovdqa64 %xmm22, %xmm4
vmovdqa64 %xmm21, %xmm6
vmovdqa64 %xmm20, %xmm7
movb $0x1, %cl
vaesenc %xmm2, %xmm5, %xmm5
vaesenc %xmm4, %xmm1, %xmm1
vaesenc %xmm7, %xmm0, %xmm0
vaesenc %xmm6, %xmm3, %xmm3
vpaddq %xmm21, %xmm2, %xmm2
vpaddq %xmm21, %xmm4, %xmm4
vpaddq %xmm21, %xmm7, %xmm7
vpaddq %xmm21, %xmm6, %xmm6
testb $0x1, %cl
movl $0x0, %ecx
jne 0x2d00
vpunpckhdq %xmm5, %xmm1, %xmm8 # xmm8 = xmm1[2],xmm5[2],xmm1[3],xmm5[3]
vpunpckldq %xmm5, %xmm1, %xmm1 # xmm1 = xmm1[0],xmm5[0],xmm1[1],xmm5[1]
vpunpckhdq %xmm0, %xmm3, %xmm9 # xmm9 = xmm3[2],xmm0[2],xmm3[3],xmm0[3]
vpunpckldq %xmm0, %xmm3, %xmm0 # xmm0 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
vpunpckhdq %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
vpunpckldq %xmm1, %xmm0, %xmm5 # xmm5 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
vpunpckldq %xmm9, %xmm8, %xmm0 # xmm0 = xmm8[0],xmm9[0],xmm8[1],xmm9[1]
vpunpckhdq %xmm9, %xmm8, %xmm1 # xmm1 = xmm8[2],xmm9[2],xmm8[3],xmm9[3]
incl %eax
cmpl $0xa, %eax
jne 0x2cfe
vpxor %xmm5, %xmm11, %xmm11
vpxor %xmm1, %xmm10, %xmm10
vpxor %xmm0, %xmm15, %xmm15
cmpq $0x1d, %r15
jbe 0x2d86
addq $-0x1e, %r15
movl $0x1e, %eax
addq %rax, %r13
testq %r15, %r15
jne 0x2a72
vpxor %xmm0, %xmm0, %xmm0
vpblendw $0x1, %xmm0, %xmm11, %xmm0 # xmm0 = xmm0[0],xmm11[1,2,3,4,5,6,7]
vpaddq 0x428(%rip), %xmm0, %xmm1 # 0x31c0
vpbroadcastq 0x377(%rip), %xmm0 # 0x3118
vpbroadcastq 0x366(%rip), %xmm2 # 0x3110
vpbroadcastq 0x36d(%rip), %xmm3 # 0x3120
vpbroadcastq 0x36c(%rip), %xmm4 # 0x3128
xorl %eax, %eax
vmovdqa %xmm2, %xmm5
movb $0x1, %cl
vaesenc %xmm4, %xmm1, %xmm1
vaesenc %xmm3, %xmm10, %xmm10
vaesenc %xmm0, %xmm15, %xmm15
vaesenc %xmm5, %xmm14, %xmm14
vpaddq %xmm2, %xmm4, %xmm4
vpaddq %xmm2, %xmm3, %xmm3
vpaddq %xmm2, %xmm0, %xmm0
vpaddq %xmm2, %xmm5, %xmm5
testb $0x1, %cl
movl $0x0, %ecx
jne 0x2dc4
vpunpckhdq %xmm1, %xmm10, %xmm6 # xmm6 = xmm10[2],xmm1[2],xmm10[3],xmm1[3]
vpunpckldq %xmm1, %xmm10, %xmm1 # xmm1 = xmm10[0],xmm1[0],xmm10[1],xmm1[1]
vpunpckhdq %xmm15, %xmm14, %xmm7 # xmm7 = xmm14[2],xmm15[2],xmm14[3],xmm15[3]
vpunpckldq %xmm15, %xmm14, %xmm8 # xmm8 = xmm14[0],xmm15[0],xmm14[1],xmm15[1]
vpunpckhdq %xmm1, %xmm8, %xmm14 # xmm14 = xmm8[2],xmm1[2],xmm8[3],xmm1[3]
vpunpckldq %xmm1, %xmm8, %xmm1 # xmm1 = xmm8[0],xmm1[0],xmm8[1],xmm1[1]
vpunpckldq %xmm7, %xmm6, %xmm15 # xmm15 = xmm6[0],xmm7[0],xmm6[1],xmm7[1]
vpunpckhdq %xmm7, %xmm6, %xmm10 # xmm10 = xmm6[2],xmm7[2],xmm6[3],xmm7[3]
incl %eax
cmpl $0xa, %eax
jne 0x2dc2
vmovdqu %xmm1, (%r14,%rdx)
addq $0x10, (%rsi)
xorl %eax, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
vzeroupper
retq
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jmp 0x2e27
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
jmp 0x2e27