// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/primatesv1ape80/ref/encrypt.cpp
// Function: crypto_aead_decrypt
int crypto_aead_decrypt(
    unsigned char *m,unsigned long long *mlen,
    unsigned char *nsec,
    const unsigned char *c,unsigned long long clen,
    const unsigned char *ad,unsigned long long adlen,
    const unsigned char *npub,
    const unsigned char *k
)
{
	/*
    ... generating a plaintext m[0],m[1],...,m[*mlen-1]
    ... and secret message number nsec[0],nsec[1],...
    ... from a ciphertext c[0],c[1],...,c[clen-1]
    ... and associated data ad[0],ad[1],...,ad[adlen-1]
    ... and public message number npub[0],npub[1],...
    ... and secret key k[0],k[1],...
    ...
	*/
	unsigned char V[StateSize]; //the state represented in Elements
	//Temp variables represented as elements
	unsigned char key[KeySizeElements];
	unsigned char nonce[NonceSizeElements];
	unsigned char tag[TagSizeElements];
	unsigned char data[RateSizeElements];
	unsigned char cipher[RateSizeElements];
	unsigned char IV[StateSize]; //temp state represented in Elements
	
	if((clen<(TagSizeBytes+RateSizeBytes))&&(clen!=TagSizeBytes)) return -1; //invalid ciphertext
   
	//a temporary array for message
	unsigned char *mT = (unsigned char*) malloc(clen-TagSizeBytes);
    if (mT == NULL) return -2; // memory allocation failure
	
	Bytes2Element(key,k,0,KeySizeElements); //representing k as elements
	Bytes2Element(nonce,npub,0,NonceSizeElements); //representing npub as elements

	// IV <-- O||K
	InitializeState(IV,key);
	// Treating the nonce as the first part of the associated data
	for(int i=0; i<(NonceSizeElements/RateSizeElements); i++)
	{
		// IV <-- p_1 (N[i]^IV_r || IV_c)
		for(int j=0; j<RateSizeElements; j++)
			IV[j]^=nonce[RateSizeElements*i+j];
		p_1(IV);
	}
	if(adlen!=0)
	{ 
		// for i=1 to u-1 (except the last block which needs padding)
		if(adlen>RateSizeBytes)
		{ 
			for(unsigned long long i=0; i<adlen-RateSizeBytes; i=i+RateSizeBytes)
			{
				Bytes2Element(data,ad,i,RateSizeElements); // representing a block of ad as elements
				// IV <-- p_1 (A[i]^IV_r || IV_c)
				for(int j=0; j<RateSizeElements; j++)
					IV[j]^=data[j];
				p_1(IV);
			}
		}
		// IV <-- A[u]^IV_r || IV_c
		int l = adlen%RateSizeBytes;
		if(l==0){ //do padding with spill over			
			Bytes2Element(data,ad,adlen-RateSizeBytes,RateSizeElements); // representing last block of ad as elements
			for(int i=0; i<RateSizeElements; i++)
				IV[i]^=data[i];
			IV[RateSizeElements]^=16; //padding spills over to capacity
		}
		else{ //do standard padding
			unsigned char dataP[RateSizeBytes];
			for(int i=0; i< l; i++)
				dataP[i]=ad[adlen-l+i];
			dataP[l]=128; //padding over bytes
			for(int i=l+1; i<RateSizeBytes; i++)
				dataP[i]=0;
			Bytes2Element(data,dataP,0,RateSizeElements); // representing last padded block of ad as elements
			for(int i=0; i<RateSizeElements; i++)
				IV[i]^=data[i];
		}
		// IV <-- p_1(IV)
		p_1(IV);	
	}
	// IV <-- IV ^ (0..01)
	IV[StateSize-1]^=1;
	unsigned char tagT[TagSizeBytes];
	if(clen==TagSizeBytes){ //ciphertext length and hence the message length is 0
		*mlen=0;
		//do standard padding
		unsigned char dataP[RateSizeBytes];
		dataP[0]=128; //padding over bytes
		for(int i=1; i<RateSizeBytes; i++)
			dataP[i]=0;
		Bytes2Element(data,dataP,0,RateSizeElements);  // representing last block of m as elements
		// V <-- p_1 (M[1]^V_r || V_c)
		for(int i=0; i<RateSizeElements; i++)
			IV[i]^=data[i];
		p_1(IV);
		// T <-- (V_c)_c/2 ^ K 
		for(int i=0; i<TagSizeElements; i++)
			tag[i]=IV[RateSizeElements+i]^key[i]; 
		Element2Bytes(tagT,tag,0,TagSizeBytes) ;

		unsigned char cor=0;
		for(int i=0; i<TagSizeBytes; i++) //check if tags match
			cor = cor || (tagT[i]^c[i]);
		free(mT);
		if(cor==0) return 0;
		else return -1;
	}
	else{
		// V <-- p_1_inv(C[w] || K^T)
		Bytes2Element(cipher,c,clen-(TagSizeBytes+RateSizeBytes),RateSizeElements);
		Bytes2Element(tag,c,clen-(TagSizeBytes),TagSizeElements);
		for(int i=0; i<RateSizeElements; i++)
			V[i]=cipher[i];
		for(int i=0; i<CapacitySize; i++)
			V[RateSizeElements+i]=key[i]^tag[i];
		p_1_inv(V);
		
		if(clen==(TagSizeBytes+RateSizeBytes)){ //ciphertext is one block only hence plaintext length is less then or equal to RateSize
			// V <-- V ^ IV
			for(int i=0; i<StateSize; i++)
				V[i] ^= IV[i]; 
			unsigned char cor=0;
			for(int i=RateSizeElements+1; i<StateSize; i++) //check if IV_c matches with V_c
				cor = cor || V[i];
			cor = cor || (!((V[RateSizeElements]==0) || (V[RateSizeElements]==16)));
			if (cor==0)
			{
				for(int i=0; i<RateSizeElements; i++)
					data[i]=V[i];
				Element2Bytes(mT,data,0,RateSizeBytes); //representing m as bytes
				if(V[RateSizeElements]==16) *mlen=(unsigned long long) RateSizeBytes;
				else{ 
					unsigned char match=0;
					for(int i=0; i<RateSizeBytes; i++) {
						match |= (mT[i]==128);
					}
					if(match==0) { free(mT); return -1; }
					for(int i=RateSizeBytes-1; i>=0; i--)
						if(mT[i]==128) { *mlen=(unsigned long long) i; break;}
				}
				for(unsigned long long i=0; i<*mlen; i++)
					m[i]=mT[i];
				free(mT);
				return 0;
			}
			else { free(mT); return -1; }
		}
		else{
			*mlen=clen-TagSizeBytes;
			//for i=w (tha last block)
			int l = clen%RateSizeBytes;
			if (l==0){
				//M[w] <-- |V_r|_l^C[w-1]
				Bytes2Element(cipher,c,clen-(TagSizeBytes+2*RateSizeBytes),RateSizeElements);
				for(int i=0; i<RateSizeElements; i++)
					data[i]=V[i]^cipher[i];
				Element2Bytes(mT,data,clen-(TagSizeBytes+RateSizeBytes),RateSizeBytes); //representing last block m as bytes
				//V <-- V^M[w]10*
				for(int i=0; i<(RateSizeElements); i++)
					V[i]^=data[i];
				V[RateSizeElements]^=16;
			}
			else{
				//M[w] <-- |V_r|_l^C[w-1]
				unsigned char cipherP[RateSizeBytes];
				unsigned char mtmp[RateSizeBytes];
				Element2Bytes(cipherP,V,0,RateSizeBytes); //representing last block m as bytes
				for(int i=0; i<l; i++){
					mT[(clen-TagSizeBytes)-l+i]=cipherP[i]^c[clen-(TagSizeBytes+RateSizeBytes+l)+i];
					mtmp[i]=mT[(clen-TagSizeBytes)-l+i];
				}
				mtmp[l]=128;
				for(int i=l+1; i<RateSizeBytes; i++)
					mtmp[i]=0;
				Bytes2Element(data,mtmp,0,RateSizeElements);
				//V <-- V^M[w]10*
				for(int i=0; i<RateSizeElements; i++)
					V[i]^=data[i];	
			}
			l = (l==0) ? RateSizeBytes : l;
			//for i=w-1 to 2
			for(unsigned long long i=((clen-TagSizeBytes)-l); i>RateSizeBytes; i=i-5){
				// V <-- p_1_inv(V)
				p_1_inv(V);
				// M[i] <-- C[i-1]^V_r
				unsigned char mtmp[RateSizeElements];
				Bytes2Element(data,c,i-2*RateSizeBytes,RateSizeElements);
				for(int j=0; j<RateSizeElements; j++)
					mtmp[j]=data[j]^V[j];
				Element2Bytes(mT,mtmp,i-RateSizeBytes,RateSizeBytes); //representing last block m as bytes
				
				// V <-- C[i-1] || V_c
				for(int j=0; j<RateSizeElements; j++)
					V[j]=data[j];
			}
			//for i=1
			// V <-- p_1_inv(V)
			p_1_inv(V);
			// M[i] <-- C[i-1]^V_r
			for(int i=0; i<RateSizeElements; i++)
				data[i]=IV[i]^V[i];
			Element2Bytes(mT,data,0,RateSizeBytes); //representing last block m as bytes
			 //check if IV_c matches with V_c
			for(int j=0; j<RateSizeElements; j++)
				V[j]^=data[j];
			unsigned char cor=0;
			for(int i=RateSizeElements; i<StateSize; i++) 
				cor = cor || (V[i]^IV[i]);
			if(cor==0) {
				for(unsigned long long i=0; i<*mlen; i++)
					m[i]=mT[i];
			}
			free(mT);
			if (cor == 0) return 0;
			else return -1;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rcx, %rbx
cmpq $0x19, %r8
setb %al
cmpq $0x14, %r8
setne %cl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %cl, %al
jne 0x2e93
movq %r9, %r15
movq %r8, %r13
movq %rsi, %r14
movq %rdi, 0x48(%rsp)
leaq -0x14(%r8), %r12
movq %r12, %rdi
callq 0x20a0
testq %rax, %rax
je 0x27b4
movq %r12, 0x58(%rsp)
movq %rbx, 0x60(%rsp)
movq %rax, 0x10(%rsp)
movq 0x140(%rsp), %rsi
movq 0x138(%rsp), %rbx
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
xorl %edx, %edx
movl $0x20, %ecx
callq 0x2150
leaq 0xe0(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movl $0x10, %ecx
callq 0x2150
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x20b0
movq (%rbp), %rax
xorq %rax, (%rbx)
movq %rbx, %rdi
callq 0x2070
movq 0x8(%rbp), %rax
movq 0x130(%rsp), %r12
xorq %rax, (%rbx)
movq %rbx, %rdi
callq 0x2070
testq %r12, %r12
movq %r14, 0x18(%rsp)
je 0x27f4
cmpq $0x6, %r12
jb 0x2722
movq 0x130(%rsp), %rax
leaq -0x5(%rax), %r14
xorl %ebp, %ebp
movq %rsp, %rbx
leaq 0x70(%rsp), %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movl $0x8, %ecx
callq 0x2150
movq (%rsp), %rax
xorq %rax, 0x70(%rsp)
movq %r12, %rdi
callq 0x2070
addq $0x5, %rbp
cmpq %r14, %rbp
jb 0x26f5
movabsq $-0x3333333333333333, %rax # imm = 0xCCCCCCCCCCCCCCCD
movq 0x130(%rsp), %r14
movq %r14, %rdx
mulxq %rax, %r12, %r12
shrq $0x2, %r12
leaq (%r12,%r12,4), %rax
movq %r14, %rbx
subq %rax, %rbx
je 0x27be
movq %r14, %rax
subq %rbx, %rax
addq %rax, %r15
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2160
movb $-0x80, 0x20(%rsp,%rbx)
cmpq $0x3, %rbx
ja 0x2793
leal (%r12,%r12,4), %edx
movl %r14d, %eax
subl %edx, %eax
incl %eax
leaq (%rsp,%rax), %rdi
addq $0x20, %rdi
subl %r14d, %edx
addl $0x3, %edx
incq %rdx
xorl %esi, %esi
callq 0x2040
movq %rsp, %rbx
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
movl $0x8, %ecx
callq 0x2150
movq (%rbx), %rax
xorq %rax, 0x70(%rsp)
jmp 0x27e5
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x2e93
addq $-0x5, %r14
movq %rsp, %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl $0x8, %ecx
callq 0x2150
movq (%rbx), %rax
xorq %rax, 0x70(%rsp)
xorb $0x10, 0x78(%rsp)
movq 0x18(%rsp), %r14
leaq 0x70(%rsp), %rdi
callq 0x2070
xorb $0x1, 0x97(%rsp)
cmpq $0x14, %r13
movq 0x60(%rsp), %r12
movq 0x58(%rsp), %rbp
jne 0x28ad
movq $0x0, (%r14)
leaq 0x68(%rsp), %rsi
movb $-0x80, (%rsi)
movl $0x0, 0x1(%rsi)
xorl %r14d, %r14d
movq %rsp, %rbx
movq %rbx, %rdi
xorl %edx, %edx
movl $0x8, %ecx
callq 0x2150
movq (%rbx), %rax
leaq 0x70(%rsp), %rbx
xorq %rax, (%rbx)
movq %rbx, %rdi
callq 0x2070
vmovdqu 0xa0(%rsp), %ymm0
vpxor 0x8(%rbx), %ymm0, %ymm0
leaq 0xc0(%rsp), %rsi
vmovdqu %ymm0, (%rsi)
leaq 0x20(%rsp), %rdi
xorl %edx, %edx
movl $0x14, %ecx
vzeroupper
callq 0x2090
xorl %ebx, %ebx
movq 0x10(%rsp), %rdi
testb %bl, %bl
movb $0x1, %bl
jne 0x2895
movb 0x20(%rsp,%r14), %al
cmpb (%r12,%r14), %al
setne %bl
incq %r14
cmpq $0x14, %r14
jne 0x2883
callq 0x20e0
negb %bl
movsbl %bl, %ebp
jmp 0x2e93
leaq -0x19(%r13), %r15
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0x8, %ecx
callq 0x2150
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movl $0x20, %ecx
callq 0x2150
movq (%rbx), %rax
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
vmovdqu (%r14), %ymm0
vpxor 0xa0(%rsp), %ymm0, %ymm0
vmovdqu %ymm0, 0x8(%rdi)
vzeroupper
callq 0x2100
cmpq $0x19, %r13
jne 0x2a99
xorl %eax, %eax
vpmovsxbq 0x1801(%rip), %ymm0 # 0x4120
vpmovsxbq 0x17fc(%rip), %ymm1 # 0x4124
vpmovsxbq 0x17f7(%rip), %ymm2 # 0x4128
vpmovsxbq 0x17f2(%rip), %ymm3 # 0x412c
vpmovsxbq 0x17ed(%rip), %ymm4 # 0x4130
vpmovsxbq 0x17e8(%rip), %ymm5 # 0x4134
vpmovsxbq 0x17e3(%rip), %ymm6 # 0x4138
vpmovsxbq 0x17de(%rip), %ymm7 # 0x413c
vpbroadcastq 0x1799(%rip), %ymm8 # 0x4100
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
vpbroadcastq %rax, %ymm9
vpor %ymm0, %ymm9, %ymm10
vpor %ymm1, %ymm9, %ymm11
vpor %ymm2, %ymm9, %ymm12
vpor %ymm3, %ymm9, %ymm13
vpor %ymm4, %ymm9, %ymm14
vpor %ymm5, %ymm9, %ymm15
vporq %ymm6, %ymm9, %ymm16
vpor %ymm7, %ymm9, %ymm9
vpcmpltuq %ymm8, %ymm9, %k0
vpcmpltuq %ymm8, %ymm16, %k1
kshiftlb $0x4, %k1, %k1
korb %k1, %k0, %k0
vpcmpltuq %ymm8, %ymm15, %k1
vpcmpltuq %ymm8, %ymm14, %k2
kshiftlb $0x4, %k2, %k2
korb %k2, %k1, %k1
kunpckbw %k0, %k1, %k0
vpcmpltuq %ymm8, %ymm13, %k1
vpcmpltuq %ymm8, %ymm12, %k2
kshiftlb $0x4, %k2, %k2
korb %k2, %k1, %k1
vpcmpltuq %ymm8, %ymm11, %k2
vpcmpltuq %ymm8, %ymm10, %k3
kshiftlb $0x4, %k3, %k3
korb %k3, %k2, %k2
kunpckbw %k1, %k2, %k1
kunpckwd %k0, %k1, %k1
vmovdqu8 0x70(%rsp,%rax), %ymm9 {%k1} {z}
vmovdqu8 0x20(%rsp,%rax), %ymm10 {%k1} {z}
vpxor %ymm9, %ymm10, %ymm9
vmovdqu8 %ymm9, 0x20(%rsp,%rax) {%k1}
addq $0x20, %rax
cmpq $0x40, %rax
jne 0x2971
movl $0x9, %ecx
xorl %eax, %eax
testb %al, %al
movb $0x1, %al
jne 0x2a48
cmpb $0x0, 0x20(%rsp,%rcx)
setne %al
incq %rcx
cmpq $0x28, %rcx
jne 0x2a3a
movb 0x28(%rsp), %cl
andb $-0x11, %cl
orb %cl, %al
jne 0x2e5f
movq 0x20(%rsp), %rax
movq %rsp, %rsi
movq %rax, (%rsi)
movq %rbx, %rdi
xorl %edx, %edx
movl $0x5, %ecx
vzeroupper
callq 0x2090
cmpb $0x10, 0x28(%rsp)
jne 0x2df0
movq $0x5, (%r14)
movq 0x48(%rsp), %rdx
jmp 0x2e79
movq 0x18(%rsp), %rax
movq %rbp, (%rax)
movabsq $-0x3333333333333333, %rax # imm = 0xCCCCCCCCCCCCCCCD
movq %r13, %rdx
mulxq %rax, %r14, %r14
shrq $0x2, %r14
leaq (%r14,%r14,4), %rax
movq %r13, %rbx
subq %rax, %rbx
je 0x2c79
movq %r12, %rbp
xorl %r12d, %r12d
leaq 0x50(%rsp), %rdi
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
movl $0x5, %ecx
callq 0x2090
subq %rbx, %r15
addq %rbp, %r15
movq 0x58(%rsp), %rbp
movq %rbp, %rcx
subq %rbx, %rcx
movq 0x10(%rsp), %rax
addq %rcx, %rax
leal 0x1f(%rbx), %ecx
andl $0x20, %ecx
leaq -0x1(%rbx), %rdx
vpbroadcastq %rdx, %ymm0
vpmovsxbq 0x160b(%rip), %ymm1 # 0x4120
vpmovsxbq 0x1606(%rip), %ymm2 # 0x4124
vpmovsxbq 0x1601(%rip), %ymm3 # 0x4128
vpmovsxbq 0x15fc(%rip), %ymm4 # 0x412c
vpmovsxbq 0x15f7(%rip), %ymm5 # 0x4130
vpmovsxbq 0x15f2(%rip), %ymm6 # 0x4134
vpmovsxbq 0x15ed(%rip), %ymm7 # 0x4138
vpmovsxbq 0x15e8(%rip), %ymm8 # 0x413c
vpbroadcastq %r12, %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 0x50(%rsp,%r12), %ymm9 {%k1} {z}
vmovdqu8 (%r15,%r12), %ymm10 {%k1} {z}
vpxor %ymm9, %ymm10, %ymm9
vmovdqu8 %ymm9, (%rax,%r12) {%k1}
vmovdqu8 %ymm9, 0xb(%rsp,%r12) {%k1}
addq $0x20, %r12
cmpq %r12, %rcx
jne 0x2b54
movb $-0x80, 0xb(%rsp,%rbx)
cmpq $0x3, %rbx
ja 0x2c50
leal (%r14,%r14,4), %edx
movl %r13d, %eax
subl %edx, %eax
incl %eax
leaq (%rsp,%rax), %rdi
addq $0xb, %rdi
subl %r13d, %edx
addl $0x3, %edx
incq %rdx
xorl %esi, %esi
vzeroupper
callq 0x2040
movq %rsp, %r14
leaq 0xb(%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
movl $0x8, %ecx
vzeroupper
callq 0x2150
movq (%r14), %rax
xorq %rax, 0x20(%rsp)
movq 0x10(%rsp), %r14
jmp 0x2cca
leaq -0x1e(%r13), %rdx
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movl $0x8, %ecx
callq 0x2150
movq (%rbx), %rax
xorq 0x20(%rsp), %rax
movq %rsp, %rbx
movq %rax, (%rbx)
movq 0x10(%rsp), %rdi
movq %rdi, %r14
movq %rbx, %rsi
movq %r15, %rdx
movl $0x5, %ecx
callq 0x2090
movq (%rbx), %rax
xorq %rax, 0x20(%rsp)
xorb $0x10, 0x28(%rsp)
movl $0x5, %ebx
subq %rbx, %rbp
cmpq $0x6, %rbp
movq 0x60(%rsp), %r12
jb 0x2d3c
subq %rbx, %r13
addq $-0x1e, %r13
movq %rsp, %r15
leaq 0x50(%rsp), %rbp
leaq 0x20(%rsp), %rdi
callq 0x2100
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movl $0x8, %ecx
callq 0x2150
movq 0x20(%rsp), %rax
xorq (%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x5(%r13), %rbx
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movl $0x5, %ecx
callq 0x2090
movq (%rsp), %rax
movq %rax, 0x20(%rsp)
addq $-0x5, %r13
cmpq $0x5, %rbx
ja 0x2ce7
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x2100
movq (%rbx), %rax
xorq 0x70(%rsp), %rax
movq %rsp, %r12
movq %rax, (%r12)
xorl %r15d, %r15d
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl $0x5, %ecx
callq 0x2090
movq (%r12), %rax
xorq %rax, (%rbx)
movl $0x8, %edx
movq 0x18(%rsp), %rdi
movq 0x48(%rsp), %r8
testb %r15b, %r15b
je 0x2d96
incq %rdx
movb $0x1, %r15b
cmpq $0x28, %rdx
jne 0x2d83
jmp 0x2dde
movb 0x20(%rsp,%rdx), %al
movb 0x70(%rsp,%rdx), %cl
cmpb %cl, %al
setne %r15b
incq %rdx
cmpq $0x28, %rdx
jne 0x2d83
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb %cl, %al
jne 0x2de3
cmpq $0x0, (%rdi)
je 0x2ea7
xorl %edx, %edx
movb (%r14,%rdx), %sil
movb %sil, (%r8,%rdx)
incq %rdx
cmpq (%rdi), %rdx
jb 0x2dc2
xorl %ebp, %ebp
cmpb %cl, %al
setne %bpl
negl %ebp
jmp 0x2de3
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %r14, %rdi
callq 0x20e0
jmp 0x2e93
movw $0x1f, %ax
kmovd %eax, %k1
vmovdqu8 (%rbx), %xmm0 {%k1} {z}
vpbroadcastb 0x1301(%rip), %xmm1 # 0x4108
vpcmpeqb %xmm1, %xmm0, %xmm0
vpbroadcastb 0x12f5(%rip), %xmm1 # 0x4109
vpternlogq $0x80, 0x12f1(%rip), %xmm0, %xmm1 # 0x4110
vpsrlq $0x20, %xmm1, %xmm0
vpor %xmm0, %xmm1, %xmm0
vpsrld $0x10, %xmm0, %xmm1
vpor %xmm1, %xmm0, %xmm0
vpsrlw $0x8, %xmm0, %xmm1
vpor %xmm1, %xmm0, %xmm0
vmovd %xmm0, %eax
testb %al, %al
movq 0x48(%rsp), %rdx
je 0x2e5f
movl $0x4, %eax
xorl %ecx, %ecx
movl %eax, %eax
cmpb (%rbx,%rax), %cl
jo 0x2e71
addl $-0x1, %eax
jb 0x2e4e
movq (%r14), %rax
jmp 0x2e74
movq %rbx, %rdi
vzeroupper
callq 0x20e0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x2e93
movq %rax, (%r14)
testq %rax, %rax
je 0x2e89
xorl %eax, %eax
movb (%rbx,%rax), %cl
movb %cl, (%rdx,%rax)
incq %rax
cmpq (%r14), %rax
jb 0x2e7b
movq %rbx, %rdi
callq 0x20e0
xorl %ebp, %ebp
movl %ebp, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x2de3
nop