#include <iostream>
#include <string>
#include <stdlib.h>
#include <time.h> 
#include <algorithm>
#include <utility>
#include <vector>
#include <ctime>
using namespace std;


int N = 26; //Size of the alphabet to encrypt, N has to be even.
int THREADS = 64;

__device__ int dmod(int k, int n){
	 return ((k %= n) < 0) ? k+n : k;
}

int mod(int k, int n) {
    return ((k %= n) < 0) ? k+n : k;
}

//GPU encrypt
__global__ void crypt_gpu(int msg_length, int N,char *dmessage_encrypted, 
							int *disk3, 
							int *disk2, 
							int *disk1, 
							int *mirror, int offset, int *keyboard){

	int i = blockIdx.x * blockDim.x + threadIdx.x;
	if (i<msg_length){
		int M = N*2;
		offset = (offset + i)*2;
		int esymbol = keyboard[(dmessage_encrypted[i]-'a')*2];
		//Forward pass
		esymbol = dmod(disk1[dmod(esymbol+offset,M)] - offset,M);
		esymbol = dmod(disk2[dmod(esymbol+offset/M,M)] - offset/M,M);
		esymbol = dmod(disk3[dmod(esymbol+offset/M*M,M)] - offset/M,M);
		esymbol = mirror[esymbol];
		//Reflect pass
		esymbol = dmod(mirror[dmod(esymbol+offset/M*M,M) + 1] - offset/M*M,M);
		esymbol = dmod(disk3[dmod(esymbol+offset/M,M) + 1] - offset/M,M);
		esymbol = dmod(disk2[dmod(esymbol+offset,M) + 1] - offset,M);
		esymbol = keyboard[esymbol];
		dmessage_encrypted[i] = esymbol/2 + 'a';
	}
}


string crypt_cpu(string message,int *mirror
						   ,int *disk3
						   ,int *disk2
						   ,int *disk1
						   ,int *keyboard
						   ,int offset){		   
		string res = "";
		int M = N*2;
		for(int i = 0; i<message.size(); ++i){
			int esymbol = keyboard[(message.at(i)-'a')*2];
			//Forward pass
			esymbol = mod(disk1[mod(esymbol+offset,M)] - offset,M);
			esymbol = mod(disk2[mod(esymbol+offset/M,M)] - offset/M,M);
			esymbol = mod(disk3[mod(esymbol+offset/M*M,M)] - offset/M,M);
			esymbol = mirror[esymbol];
			//Reflect pass
			esymbol = mod(mirror[mod(esymbol+offset/M*M,M) + 1] - offset/M*M,M);
			esymbol = mod(disk3[mod(esymbol+offset/M,M) + 1] - offset/M,M);
			esymbol = mod(disk2[mod(esymbol+offset,M) + 1] - offset,M);
			esymbol = keyboard[esymbol];
			char encrypted = esymbol/2 + 'a';
			res+=encrypted;
			offset+=2;
		}	
		return res;
}



void configureDisk(int* disk){
	vector<int> aux(N);
	for(int i=0; i<N;++i) aux[i] = i*2;
	random_shuffle(aux.begin(),aux.end());
	for(int i=0; i<N; i+=1) {
		disk[i*2] = aux[i];
	}
}
void randomPairs(int* mirror, int i){ 
	if(i<N*2){
		if(mirror[i] == -1){
			bool foundPair = false;
			int j = 0;
			while(!foundPair){
				foundPair = (mirror[j] == -1 && rand()%N == 0 && i!=j);
				if(foundPair){
					mirror[j] = i;
					mirror[i] = j;
				}
				j = (j+2)%(2*N);
			}
		}
		randomPairs(mirror,i+2);
	}
}
void join(int* diskTop, int* diskUnder){
	for (int i = 0; i<2*N;i+=2){
		diskTop[diskUnder[i]+1] = i;
	}
}
void CheckCudaError(char sms[], int line);
float GetTime(void);


int main(){

	char message[] = "supercalifragilispicoespialidos";
	srand (time(NULL));
	int numBytes = N*2*sizeof(int);

	cudaEvent_t E0, E1;
	float TiempoTotal;
	float t1,t2;

	cudaEventCreate(&E0);
	cudaEventCreate(&E1);

	//HOST DATA:
	int *hdisk1, *hdisk2, *hdisk3, *hmirror, *hkeyboard;
	char* hmessage_encrypted;
	//host space allocation:
	hdisk1 = (int*) malloc(numBytes);
	hdisk2 = (int*) malloc(numBytes);
	hdisk3 = (int*) malloc(numBytes);
	hmirror = (int*) malloc(numBytes);
	hkeyboard = (int*) malloc(numBytes);
	hmessage_encrypted = (char*) malloc(strlen(message)*sizeof(char));
	//initialization:
	for(int i = 0; i<N*2;++i) hmirror[i] = hdisk3[i] = hdisk2[i] = hdisk1[i] = hkeyboard[i] = -1;
	configureDisk(hdisk3);configureDisk(hdisk2);configureDisk(hdisk1);
	randomPairs(hmirror,0);randomPairs(hkeyboard,0);	
	join(hmirror,hdisk3);
	join(hdisk3,hdisk2);
	join(hdisk2,hdisk1);

	//DEVICE DATA:
	int *ddisk1,*ddisk2,*ddisk3,*dmirror,*dkeyboard;
	char *dmessage_encrypted;

	cudaEventRecord(E0, 0);
	cudaEventSynchronize(E0);

	//device space allocation
	cudaMalloc((int**)&ddisk3, numBytes); 
	cudaMalloc((int**)&ddisk2, numBytes); 
	cudaMalloc((int**)&ddisk1, numBytes); 
	cudaMalloc((int**)&dmirror, numBytes);
	cudaMalloc((int**)&dkeyboard, numBytes);
	cudaMalloc((char**)&dmessage_encrypted,strlen(message)*sizeof(char));
	CheckCudaError((char *) "Obtener Memoria en el device", __LINE__);
	//Copy data host --> device
	cudaMemcpy(ddisk1, hdisk1, numBytes, cudaMemcpyHostToDevice);
	cudaMemcpy(ddisk2, hdisk2, numBytes, cudaMemcpyHostToDevice);
	cudaMemcpy(ddisk3, hdisk3, numBytes, cudaMemcpyHostToDevice);
	cudaMemcpy(dmirror, hmirror, numBytes, cudaMemcpyHostToDevice);
	cudaMemcpy(dkeyboard, hkeyboard, numBytes, cudaMemcpyHostToDevice);
	cudaMemcpy(dmessage_encrypted, message, strlen(message)*sizeof(char),cudaMemcpyHostToDevice);
	CheckCudaError((char *) "Copiar Datos Host --> Device", __LINE__); 
	

	int nBlocks = (strlen(message) + THREADS - 1)/THREADS;
	dim3 dimGrid(nBlocks, 1, 1);
	dim3 dimBlock(THREADS, 1, 1);

    int disk_offset = 0;

	// Ejecutar el kernel 
	crypt_gpu<<<dimGrid, dimBlock>>>(strlen(message),N,dmessage_encrypted, ddisk3, ddisk2, ddisk1, dmirror, disk_offset, dkeyboard);
	CheckCudaError((char *) "Invocar Kernel", __LINE__);

	cudaMemcpy(hmessage_encrypted,dmessage_encrypted,strlen(message)*sizeof(char),cudaMemcpyDeviceToHost);
	CheckCudaError((char *) "Copiar Datos Device --> Host", __LINE__);

	cudaEventRecord(E1, 0);
	cudaEventSynchronize(E1);

	cudaEventElapsedTime(&TiempoTotal,  E0, E1);

  	cudaFree(ddisk1); cudaFree(ddisk2); cudaFree(ddisk3); cudaFree(dmirror); cudaFree(dkeyboard); cudaFree(dmessage_encrypted);

  	clock_t begin = clock();
	string res = crypt_cpu(message,hmirror,hdisk3,hdisk2,hdisk1,hkeyboard,disk_offset);
  	clock_t end = clock();
  	t2 = double(end - begin) / CLOCKS_PER_SEC;

    
    string rec = crypt_cpu(res,hmirror,hdisk3,hdisk2,hdisk1,hkeyboard,disk_offset);
  	cout << "Original message: " << message << endl;
  	cout << "Encrypted message CPU: " << res << endl;
  	cout << "Encrypted message GPU: " << hmessage_encrypted << endl;
  	cout << "GPU time to encrypt: " << TiempoTotal << endl;
  	cout << "CPU time to encrypt: " << t2 << endl;

}




void CheckCudaError(char sms[], int line) {
  cudaError_t error;
  error = cudaGetLastError();
  if (error) {
    printf("(ERROR) %s - %s in %s at line %d\n", sms, cudaGetErrorString(error), __FILE__, line);
    exit(EXIT_FAILURE);
  }
}

	.file	"tmpxft_003a3aff_00000000-6_cuda_enigma.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4262:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4262:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB5023:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE5023:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z4dmodii
	.type	_Z4dmodii, @function
_Z4dmodii:
.LFB4252:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE4252:
	.size	_Z4dmodii, .-_Z4dmodii
	.globl	_Z3modii
	.type	_Z3modii, @function
_Z3modii:
.LFB4253:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	cltd
	idivl	%esi
	testl	%edx, %edx
	jns	.L5
	addl	%esi, %edx
.L5:
	movl	%edx, %eax
	ret
	.cfi_endproc
.LFE4253:
	.size	_Z3modii, .-_Z3modii
	.globl	_Z11randomPairsPii
	.type	_Z11randomPairsPii, @function
_Z11randomPairsPii:
.LFB4256:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movslq	%esi, %rbx
	pushq	%rdx
	.cfi_def_cfa_offset 64
.L15:
	movl	N(%rip), %eax
	movl	%ebx, %r14d
	addl	%eax, %eax
	cmpl	%ebx, %eax
	jle	.L8
	cmpl	$-1, 0(%rbp,%rbx,4)
	jne	.L10
	movl	%ebx, %r15d
	xorl	%r12d, %r12d
.L14:
	movslq	%r12d, %rax
	leaq	0(%rbp,%rax,4), %r13
	cmpl	$-1, 0(%r13)
	je	.L11
.L13:
	xorl	%ecx, %ecx
	jmp	.L12
.L11:
	call	rand@PLT
	cltd
	idivl	N(%rip)
	testl	%edx, %edx
	sete	%cl
	cmpl	%r14d, %r12d
	setne	%al
	andb	%al, %cl
	je	.L13
	movl	%r15d, 0(%r13)
	movl	%r12d, 0(%rbp,%rbx,4)
.L12:
	movl	N(%rip), %esi
	leal	2(%r12), %eax
	cltd
	leal	(%rsi,%rsi), %edi
	idivl	%edi
	movl	%edx, %r12d
	testb	%cl, %cl
	je	.L14
.L10:
	addq	$2, %rbx
	jmp	.L15
.L8:
	popq	%rax
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4256:
	.size	_Z11randomPairsPii, .-_Z11randomPairsPii
	.globl	_Z4joinPiS_
	.type	_Z4joinPiS_, @function
_Z4joinPiS_:
.LFB4257:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
.L23:
	movl	N(%rip), %ecx
	leal	(%rcx,%rcx), %edx
	cmpl	%eax, %edx
	jle	.L25
	movslq	(%rsi,%rax,4), %rdx
	movl	%eax, 4(%rdi,%rdx,4)
	addq	$2, %rax
	jmp	.L23
.L25:
	ret
	.cfi_endproc
.LFE4257:
	.size	_Z4joinPiS_, .-_Z4joinPiS_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/marcortiz11/EnigmaGPU/master/cuda_enigma.cu"
.LC1:
	.string	"(ERROR) %s - %s in %s at line %d\n"
	.text
	.globl	_Z14CheckCudaErrorPci
	.type	_Z14CheckCudaErrorPci, @function
_Z14CheckCudaErrorPci:
.LFB4259:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	pushq	%rdx
	.cfi_def_cfa_offset 32
	call	cudaGetLastError@PLT
	testl	%eax, %eax
	je	.L26
	movl	%eax, %edi
	call	cudaGetErrorString@PLT
	movl	$2, %edi
	movl	%ebp, %r9d
	movq	%rbx, %rdx
	movq	%rax, %rcx
	leaq	.LC0(%rip), %r8
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L26:
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4259:
	.size	_Z14CheckCudaErrorPci, .-_Z14CheckCudaErrorPci
	.globl	_Z45__device_stub__Z9crypt_gpuiiPcPiS0_S0_S0_iS0_iiPcPiS0_S0_S0_iS0_
	.type	_Z45__device_stub__Z9crypt_gpuiiPcPiS0_S0_S0_iS0_iiPcPiS0_S0_S0_iS0_, @function
_Z45__device_stub__Z9crypt_gpuiiPcPiS0_S0_S0_iS0_iiPcPiS0_S0_S0_iS0_:
.LFB4284:
	.cfi_startproc
	endbr64
	subq	$216, %rsp
	.cfi_def_cfa_offset 224
	movq	224(%rsp), %rax
	movl	%edi, 60(%rsp)
	leaq	80(%rsp), %rdi
	movl	%esi, 56(%rsp)
	leaq	92(%rsp), %rsi
	movq	%rax, 16(%rsp)
	movq	240(%rsp), %rax
	movq	%rdx, 48(%rsp)
	leaq	64(%rsp), %rdx
	movq	%rcx, 40(%rsp)
	leaq	72(%rsp), %rcx
	movq	%r8, 32(%rsp)
	movq	%r9, 24(%rsp)
	movq	%rax, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rax
	movl	$1, 88(%rsp)
	movq	%rax, 128(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	232(%rsp), %rax
	movq	%rax, 184(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 192(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 80(%rsp)
	movq	%rax, 92(%rsp)
	movl	$1, 100(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L29
	pushq	72(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_(%rip), %rdi
	pushq	72(%rsp)
	.cfi_def_cfa_offset 240
	movq	108(%rsp), %rcx
	movl	116(%rsp), %r8d
	movq	96(%rsp), %rsi
	movl	104(%rsp), %edx
	leaq	144(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 232
	popq	%rdx
	.cfi_def_cfa_offset 224
.L29:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4284:
	.size	_Z45__device_stub__Z9crypt_gpuiiPcPiS0_S0_S0_iS0_iiPcPiS0_S0_S0_iS0_, .-_Z45__device_stub__Z9crypt_gpuiiPcPiS0_S0_S0_iS0_iiPcPiS0_S0_S0_iS0_
	.globl	_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_
	.type	_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_, @function
_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_:
.LFB4285:
	.cfi_startproc
	endbr64
	jmp	_Z45__device_stub__Z9crypt_gpuiiPcPiS0_S0_S0_iS0_iiPcPiS0_S0_S0_iS0_
	.cfi_endproc
.LFE4285:
	.size	_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_, .-_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_
	.section	.rodata.str1.1
.LC2:
	.string	"_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4287:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC2(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4287:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.str1.1,"aMS",@progbits,1
.LC3:
	.string	"basic_string: construction from null is not valid"
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC5IS3_EEPKcRKS3_,comdat
	.align 2
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_:
.LFB4588:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	16(%rdi), %rax
	movq	%rax, (%rdi)
	testq	%rsi, %rsi
	jne	.L37
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	leaq	.LC3(%rip), %rdi
	call	_ZSt19__throw_logic_errorPKc@PLT
.L37:
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movq	%rsi, %rbp
	call	strlen@PLT
	movq	%rax, (%rsp)
	leaq	0(%rbp,%rax), %r12
	cmpq	$15, %rax
	jbe	.L39
	movq	%rsp, %rsi
	xorl	%edx, %edx
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
	movq	%rax, (%rbx)
	movq	(%rsp), %rax
	movq	%rax, 16(%rbx)
.L39:
	movq	(%rbx), %rdi
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	(%rsp), %rax
	movq	(%rbx), %rdx
	movq	%rax, 8(%rbx)
	movb	$0, (%rdx,%rax)
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L40
.L42:
	call	__stack_chk_fail@PLT
.L40:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4588:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
	.set	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.section	.rodata.str1.1
.LC4:
	.string	""
	.text
	.globl	_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i
	.type	_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i, @function
_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i:
.LFB4254:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4254
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r8, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rcx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%rsi, 8(%rsp)
	leaq	.LC4(%rip), %rsi
	movq	112(%rsp), %r15
	movq	%rdx, 16(%rsp)
	leaq	39(%rsp), %rdx
	movq	%rdi, (%rsp)
	movq	%r9, 24(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
.LEHB0:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE0:
	movl	N(%rip), %eax
	leal	(%rax,%rax), %ebx
.L44:
	movl	120(%rsp), %eax
	leal	(%rax,%r12,2), %ebp
	movq	8(%rsp), %rax
	cmpq	8(%rax), %r12
	jnb	.L65
	movq	8(%rsp), %rdi
	movq	%r12, %rsi
.LEHB1:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE2atEm@PLT
	movsbl	(%rax), %eax
	leal	-194(%rax,%rax), %eax
	cltq
	movl	(%r15,%rax,4), %edi
	addl	%ebp, %edi
	movl	%edi, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	jns	.L45
	addl	%ebx, %edx
.L45:
	movq	24(%rsp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	subl	%ebp, %eax
	cltd
	idivl	%ebx
	movl	%edx, %esi
	testl	%edx, %edx
	jns	.L46
	addl	%ebx, %esi
.L46:
	movl	%ebp, %eax
	cltd
	idivl	%ebx
	movl	%eax, %ecx
	leal	(%rax,%rsi), %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	jns	.L47
	addl	%ebx, %edx
.L47:
	movslq	%edx, %rdx
	movl	(%r14,%rdx,4), %eax
	subl	%ecx, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	jns	.L48
	addl	%ebx, %edx
.L48:
	movl	%ecx, %esi
	imull	%ebx, %esi
	leal	(%rsi,%rdx), %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	jns	.L49
	addl	%ebx, %edx
.L49:
	movslq	%edx, %rdx
	movl	0(%r13,%rdx,4), %eax
	subl	%ecx, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	jns	.L50
	addl	%ebx, %edx
.L50:
	movq	16(%rsp), %rdi
	movslq	%edx, %rdx
	movl	(%rdi,%rdx,4), %eax
	addl	%esi, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	jns	.L51
	addl	%ebx, %edx
.L51:
	movq	16(%rsp), %rax
	movslq	%edx, %rdx
	movl	4(%rax,%rdx,4), %eax
	subl	%esi, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	jns	.L52
	addl	%ebx, %edx
.L52:
	leal	(%rcx,%rdx), %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	jns	.L53
	addl	%ebx, %edx
.L53:
	movslq	%edx, %rdx
	movl	4(%r13,%rdx,4), %eax
	subl	%ecx, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	jns	.L54
	addl	%ebx, %edx
.L54:
	leal	0(%rbp,%rdx), %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	jns	.L55
	addl	%ebx, %edx
.L55:
	movslq	%edx, %rdx
	movl	4(%r14,%rdx,4), %eax
	subl	%ebp, %eax
	cltd
	idivl	%ebx
	testl	%edx, %edx
	jns	.L56
	addl	%ebx, %edx
.L56:
	movslq	%edx, %rdx
	movl	$2, %ecx
	movq	(%rsp), %rdi
	movl	(%r15,%rdx,4), %eax
	cltd
	idivl	%ecx
	addl	$97, %eax
	movsbl	%al, %esi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc@PLT
.LEHE1:
	incq	%r12
	jmp	.L44
.L61:
	endbr64
	movq	%rax, %rbx
.L58:
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L64
	movq	%rbx, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L65:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L60
.L64:
	call	__stack_chk_fail@PLT
.L60:
	movq	(%rsp), %rax
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4254:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4254:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4254-.LLSDACSB4254
.LLSDACSB4254:
	.uleb128 .LEHB0-.LFB4254
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4254
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L61-.LFB4254
	.uleb128 0
	.uleb128 .LEHB2-.LFB4254
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE4254:
	.text
	.size	_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i, .-_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i
	.section	.rodata._ZNSt6vectorIiSaIiEEC2EmRKS0_.str1.1,"aMS",@progbits,1
.LC5:
	.string	"cannot create std::vector larger than max_size()"
	.section	.text._ZNSt6vectorIiSaIiEEC2EmRKS0_,"axG",@progbits,_ZNSt6vectorIiSaIiEEC5EmRKS0_,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEEC2EmRKS0_
	.type	_ZNSt6vectorIiSaIiEEC2EmRKS0_, @function
_ZNSt6vectorIiSaIiEEC2EmRKS0_:
.LFB4599:
	.cfi_startproc
	endbr64
	movabsq	$2305843009213693951, %rax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	cmpq	%rsi, %rax
	jnb	.L67
	leaq	.LC5(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L67:
	movq	%rsi, %rbp
	xorl	%esi, %esi
	movq	%rdi, %rbx
	xorl	%eax, %eax
	movq	%rsi, (%rdi)
	leaq	0(,%rbp,4), %r12
	movq	%rsi, 8(%rdi)
	movq	%rsi, 16(%rdi)
	testq	%rbp, %rbp
	je	.L68
	movq	%r12, %rdi
	call	_Znwm@PLT
.L68:
	addq	%rax, %r12
	movq	%rax, (%rbx)
	movq	%rax, 8(%rbx)
	movq	%r12, 16(%rbx)
	testq	%rbp, %rbp
	je	.L69
	xorl	%ecx, %ecx
	addq	$4, %rax
	movl	%ecx, -4(%rax)
	decq	%rbp
	je	.L69
.L70:
	cmpq	%rax, %r12
	je	.L69
	xorl	%edx, %edx
	addq	$4, %rax
	movl	%edx, -4(%rax)
	jmp	.L70
.L69:
	movq	%rax, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4599:
	.size	_ZNSt6vectorIiSaIiEEC2EmRKS0_, .-_ZNSt6vectorIiSaIiEEC2EmRKS0_
	.weak	_ZNSt6vectorIiSaIiEEC1EmRKS0_
	.set	_ZNSt6vectorIiSaIiEEC1EmRKS0_,_ZNSt6vectorIiSaIiEEC2EmRKS0_
	.text
	.globl	_Z13configureDiskPi
	.type	_Z13configureDiskPi, @function
_Z13configureDiskPi:
.LFB4255:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movslq	N(%rip), %rsi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	15(%rsp), %rdx
	leaq	16(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEEC1EmRKS0_
	movq	16(%rsp), %rbx
	xorl	%eax, %eax
.L82:
	cmpl	%eax, N(%rip)
	jle	.L97
	leal	(%rax,%rax), %edx
	movl	%edx, (%rbx,%rax,4)
	incq	%rax
	jmp	.L82
.L97:
	movq	24(%rsp), %r13
	leaq	4(%rbx), %rbp
	cmpq	%r13, %rbx
	jne	.L86
.L89:
	xorl	%eax, %eax
	jmp	.L85
.L88:
	call	rand@PLT
	movq	%rbp, %rcx
	subq	%rbx, %rcx
	cltq
	sarq	$2, %rcx
	cqto
	incq	%rcx
	idivq	%rcx
	leaq	(%rbx,%rdx,4), %rax
	cmpq	%rax, %rbp
	je	.L87
	movl	0(%rbp), %edx
	movl	(%rax), %ecx
	movl	%ecx, 0(%rbp)
	movl	%edx, (%rax)
.L87:
	addq	$4, %rbp
.L86:
	cmpq	%rbp, %r13
	jne	.L88
	jmp	.L89
.L85:
	cmpl	%eax, N(%rip)
	jle	.L98
	movl	(%rbx,%rax,4), %edx
	movl	%edx, (%r12,%rax,8)
	incq	%rax
	jmp	.L85
.L98:
	testq	%rbx, %rbx
	je	.L81
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L96
	movq	32(%rsp), %rsi
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%rbx, %rdi
	subq	%rbx, %rsi
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	_ZdlPvm@PLT
.L81:
	.cfi_restore_state
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L93
.L96:
	call	__stack_chk_fail@PLT
.L93:
	addq	$56, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4255:
	.size	_Z13configureDiskPi, .-_Z13configureDiskPi
	.section	.rodata.str1.1
.LC6:
	.string	"Obtener Memoria en el device"
.LC7:
	.string	"Copiar Datos Host --> Device"
.LC8:
	.string	"Invocar Kernel"
.LC9:
	.string	"Copiar Datos Device --> Host"
.LC11:
	.string	"Original message: "
.LC12:
	.string	"Encrypted message CPU: "
.LC13:
	.string	"Encrypted message GPU: "
.LC14:
	.string	"GPU time to encrypt: "
.LC15:
	.string	"CPU time to encrypt: "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4258:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4258
	endbr64
	movabsq	$7596562564204619369, %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%edi, %edi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$296, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	movabsq	$7809632571816441203, %rax
	movq	%rdx, -80(%rbp)
	movabsq	$32492099377848681, %rdx
	movq	%rdx, -64(%rbp)
	movq	%rax, -88(%rbp)
	movabsq	$8102931683653283955, %rax
	movq	%rax, -72(%rbp)
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
	movl	N(%rip), %eax
	leaq	-272(%rbp), %rdi
	leal	0(,%rax,8), %ebx
.LEHB3:
	call	cudaEventCreate@PLT
	movslq	%ebx, %rbx
	leaq	-264(%rbp), %rdi
	call	cudaEventCreate@PLT
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, %r14
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, %r12
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, -312(%rbp)
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, %r13
	call	malloc@PLT
	movq	%rax, %r15
	leaq	-88(%rbp), %rax
	movq	%rax, %rdi
	movq	%rax, -296(%rbp)
	call	strlen@PLT
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -328(%rbp)
	movl	N(%rip), %eax
	leal	(%rax,%rax), %edx
	xorl	%eax, %eax
.L100:
	cmpl	%eax, %edx
	jle	.L118
	movq	-312(%rbp), %rcx
	movl	$-1, (%r15,%rax,4)
	movl	$-1, (%r14,%rax,4)
	movl	$-1, (%r12,%rax,4)
	movl	$-1, (%rcx,%rax,4)
	movl	$-1, 0(%r13,%rax,4)
	incq	%rax
	jmp	.L100
.L118:
	movq	-312(%rbp), %rdi
	call	_Z13configureDiskPi
	movq	%r12, %rdi
	call	_Z13configureDiskPi
	movq	%r14, %rdi
	call	_Z13configureDiskPi
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	_Z11randomPairsPii
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	_Z11randomPairsPii
	movq	-312(%rbp), %rsi
	movq	%r13, %rdi
	call	_Z4joinPiS_
	movq	-312(%rbp), %rdi
	movq	%r12, %rsi
	call	_Z4joinPiS_
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	_Z4joinPiS_
	movq	-272(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	-272(%rbp), %rdi
	call	cudaEventSynchronize@PLT
	leaq	-240(%rbp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	leaq	-248(%rbp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	leaq	-256(%rbp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	leaq	-232(%rbp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	%rbx, %rsi
	leaq	-224(%rbp), %rdi
	call	cudaMalloc@PLT
	movq	-296(%rbp), %rdi
	call	strlen@PLT
	leaq	-216(%rbp), %rdi
	movq	%rax, %rsi
	call	cudaMalloc@PLT
	movl	$158, %esi
	leaq	.LC6(%rip), %rdi
	call	_Z14CheckCudaErrorPci
	movl	$1, %ecx
	movq	%rbx, %rdx
	movq	%r14, %rsi
	movq	-256(%rbp), %rdi
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movq	%rbx, %rdx
	movq	%r12, %rsi
	movq	-248(%rbp), %rdi
	call	cudaMemcpy@PLT
	movq	-312(%rbp), %rsi
	movl	$1, %ecx
	movq	%rbx, %rdx
	movq	-240(%rbp), %rdi
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movq	%rbx, %rdx
	movq	%r13, %rsi
	movq	-232(%rbp), %rdi
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movq	%rbx, %rdx
	movq	%r15, %rsi
	movq	-224(%rbp), %rdi
	call	cudaMemcpy@PLT
	movq	-296(%rbp), %rdi
	call	strlen@PLT
	movq	-296(%rbp), %rsi
	movl	$1, %ecx
	movq	-216(%rbp), %rdi
	movq	%rax, %rdx
	call	cudaMemcpy@PLT
	movl	$166, %esi
	leaq	.LC7(%rip), %rdi
	call	_Z14CheckCudaErrorPci
	movq	-296(%rbp), %rdi
	call	strlen@PLT
	movslq	THREADS(%rip), %rcx
	xorl	%edx, %edx
	leaq	-1(%rcx,%rax), %rax
	movl	%ecx, -196(%rbp)
	divq	%rcx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	%eax, -208(%rbp)
	movabsq	$4294967297, %rax
	movq	%rax, -204(%rbp)
	movq	-208(%rbp), %rdi
	movq	%rax, -192(%rbp)
	movl	-200(%rbp), %esi
	movl	-188(%rbp), %ecx
	movq	-196(%rbp), %rdx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L102
	movq	-296(%rbp), %rdi
	call	strlen@PLT
	pushq	%rdi
	movq	-216(%rbp), %rdx
	movl	%eax, %edi
	pushq	-224(%rbp)
	pushq	$0
	pushq	-232(%rbp)
	movl	N(%rip), %esi
	movq	-256(%rbp), %r9
	movq	-248(%rbp), %r8
	movq	-240(%rbp), %rcx
	call	_Z45__device_stub__Z9crypt_gpuiiPcPiS0_S0_S0_iS0_iiPcPiS0_S0_S0_iS0_
	addq	$32, %rsp
.L102:
	movl	$177, %esi
	leaq	.LC8(%rip), %rdi
	call	_Z14CheckCudaErrorPci
	movq	-296(%rbp), %rdi
	call	strlen@PLT
	movq	-216(%rbp), %rsi
	movl	$2, %ecx
	movq	-328(%rbp), %rdi
	movq	%rax, %rdx
	call	cudaMemcpy@PLT
	movl	$180, %esi
	leaq	.LC9(%rip), %rdi
	call	_Z14CheckCudaErrorPci
	movq	-264(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	-264(%rbp), %rdi
	call	cudaEventSynchronize@PLT
	movq	-264(%rbp), %rdx
	movq	-272(%rbp), %rsi
	leaq	-276(%rbp), %rdi
	call	cudaEventElapsedTime@PLT
	movq	-256(%rbp), %rdi
	call	cudaFree@PLT
	movq	-248(%rbp), %rdi
	call	cudaFree@PLT
	movq	-240(%rbp), %rdi
	call	cudaFree@PLT
	movq	-232(%rbp), %rdi
	call	cudaFree@PLT
	movq	-224(%rbp), %rdi
	call	cudaFree@PLT
	movq	-216(%rbp), %rdi
	call	cudaFree@PLT
	call	clock@PLT
	movq	-296(%rbp), %rsi
	leaq	-277(%rbp), %rdx
	movq	%rax, %rbx
	leaq	-120(%rbp), %rax
	movq	%rax, %rdi
	movq	%rax, -304(%rbp)
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE3:
	movq	%r14, %r9
	movq	%r12, %r8
	movq	%r13, %rdx
	leaq	-184(%rbp), %rax
	movq	-312(%rbp), %rcx
	movq	-304(%rbp), %rsi
	movq	%rax, -320(%rbp)
	movq	%rax, %rdi
	pushq	$0
	pushq	%r15
.LEHB4:
	.cfi_escape 0x2e,0x10
	call	_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i
.LEHE4:
	movq	-304(%rbp), %rdi
	popq	%rcx
	popq	%rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	call	clock@PLT
	movq	-320(%rbp), %rsi
	movq	-304(%rbp), %rdi
	subq	%rbx, %rax
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC10(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm1
	movss	%xmm1, -332(%rbp)
.LEHB5:
	.cfi_escape 0x2e,0
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_@PLT
.LEHE5:
	pushq	$0
	leaq	-152(%rbp), %rbx
	movq	%r14, %r9
	movq	%r12, %r8
	pushq	%r15
	movq	-312(%rbp), %rcx
	movq	%r13, %rdx
	movq	%rbx, %rdi
	movq	-304(%rbp), %rsi
.LEHB6:
	.cfi_escape 0x2e,0x10
	call	_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i
.LEHE6:
	movq	-304(%rbp), %rdi
	popq	%rax
	popq	%rdx
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	leaq	.LC11(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
.LEHB7:
	.cfi_escape 0x2e,0
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	-296(%rbp), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC12(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	-320(%rbp), %rsi
	movq	%rax, %rdi
	call	_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC13(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	-328(%rbp), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC14(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	cvtss2sd	-276(%rbp), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC15(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	cvtss2sd	-332(%rbp), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.LEHE7:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	-320(%rbp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L109
	jmp	.L114
.L110:
	endbr64
	movq	%rax, %rbx
.L103:
	movq	-304(%rbp), %rdi
	jmp	.L117
.L111:
	endbr64
	movq	%rax, %rbx
.L105:
	movq	-304(%rbp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L106
.L113:
	endbr64
	movq	%rax, %r15
.L107:
	movq	%rbx, %rdi
	movq	%r15, %rbx
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L106
.L112:
	endbr64
	movq	%rax, %rbx
.L106:
	movq	-320(%rbp), %rdi
.L117:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L114
	movq	%rbx, %rdi
.LEHB8:
	call	_Unwind_Resume@PLT
.LEHE8:
.L114:
	call	__stack_chk_fail@PLT
.L109:
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4258:
	.section	.gcc_except_table
.LLSDA4258:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4258-.LLSDACSB4258
.LLSDACSB4258:
	.uleb128 .LEHB3-.LFB4258
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB4-.LFB4258
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L110-.LFB4258
	.uleb128 0
	.uleb128 .LEHB5-.LFB4258
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L112-.LFB4258
	.uleb128 0
	.uleb128 .LEHB6-.LFB4258
	.uleb128 .LEHE6-.LEHB6
	.uleb128 .L111-.LFB4258
	.uleb128 0
	.uleb128 .LEHB7-.LFB4258
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L113-.LFB4258
	.uleb128 0
	.uleb128 .LEHB8-.LFB4258
	.uleb128 .LEHE8-.LEHB8
	.uleb128 0
	.uleb128 0
.LLSDACSE4258:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.globl	THREADS
	.data
	.align 4
	.type	THREADS, @object
	.size	THREADS, 4
THREADS:
	.long	64
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.long	26
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC10:
	.long	0
	.long	1093567616
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <iostream>
#include <string>
#include <stdlib.h>
#include <time.h> 
#include <algorithm>
#include <utility>
#include <vector>
#include <ctime>
using namespace std;


int N = 26; //Size of the alphabet to encrypt, N has to be even.
int THREADS = 64;

__device__ int dmod(int k, int n){
	 return ((k %= n) < 0) ? k+n : k;
}

int mod(int k, int n) {
    return ((k %= n) < 0) ? k+n : k;
}

//GPU encrypt
__global__ void crypt_gpu(int msg_length, int N,char *dmessage_encrypted, 
							int *disk3, 
							int *disk2, 
							int *disk1, 
							int *mirror, int offset, int *keyboard){

	int i = blockIdx.x * blockDim.x + threadIdx.x;
	if (i<msg_length){
		int M = N*2;
		offset = (offset + i)*2;
		int esymbol = keyboard[(dmessage_encrypted[i]-'a')*2];
		//Forward pass
		esymbol = dmod(disk1[dmod(esymbol+offset,M)] - offset,M);
		esymbol = dmod(disk2[dmod(esymbol+offset/M,M)] - offset/M,M);
		esymbol = dmod(disk3[dmod(esymbol+offset/M*M,M)] - offset/M,M);
		esymbol = mirror[esymbol];
		//Reflect pass
		esymbol = dmod(mirror[dmod(esymbol+offset/M*M,M) + 1] - offset/M*M,M);
		esymbol = dmod(disk3[dmod(esymbol+offset/M,M) + 1] - offset/M,M);
		esymbol = dmod(disk2[dmod(esymbol+offset,M) + 1] - offset,M);
		esymbol = keyboard[esymbol];
		dmessage_encrypted[i] = esymbol/2 + 'a';
	}
}


string crypt_cpu(string message,int *mirror
						   ,int *disk3
						   ,int *disk2
						   ,int *disk1
						   ,int *keyboard
						   ,int offset){		   
		string res = "";
		int M = N*2;
		for(int i = 0; i<message.size(); ++i){
			int esymbol = keyboard[(message.at(i)-'a')*2];
			//Forward pass
			esymbol = mod(disk1[mod(esymbol+offset,M)] - offset,M);
			esymbol = mod(disk2[mod(esymbol+offset/M,M)] - offset/M,M);
			esymbol = mod(disk3[mod(esymbol+offset/M*M,M)] - offset/M,M);
			esymbol = mirror[esymbol];
			//Reflect pass
			esymbol = mod(mirror[mod(esymbol+offset/M*M,M) + 1] - offset/M*M,M);
			esymbol = mod(disk3[mod(esymbol+offset/M,M) + 1] - offset/M,M);
			esymbol = mod(disk2[mod(esymbol+offset,M) + 1] - offset,M);
			esymbol = keyboard[esymbol];
			char encrypted = esymbol/2 + 'a';
			res+=encrypted;
			offset+=2;
		}	
		return res;
}



void configureDisk(int* disk){
	vector<int> aux(N);
	for(int i=0; i<N;++i) aux[i] = i*2;
	random_shuffle(aux.begin(),aux.end());
	for(int i=0; i<N; i+=1) {
		disk[i*2] = aux[i];
	}
}
void randomPairs(int* mirror, int i){ 
	if(i<N*2){
		if(mirror[i] == -1){
			bool foundPair = false;
			int j = 0;
			while(!foundPair){
				foundPair = (mirror[j] == -1 && rand()%N == 0 && i!=j);
				if(foundPair){
					mirror[j] = i;
					mirror[i] = j;
				}
				j = (j+2)%(2*N);
			}
		}
		randomPairs(mirror,i+2);
	}
}
void join(int* diskTop, int* diskUnder){
	for (int i = 0; i<2*N;i+=2){
		diskTop[diskUnder[i]+1] = i;
	}
}
void CheckCudaError(char sms[], int line);
float GetTime(void);


int main(){

	char message[] = "supercalifragilispicoespialidos";
	srand (time(NULL));
	int numBytes = N*2*sizeof(int);

	hipEvent_t E0, E1;
	float TiempoTotal;
	float t1,t2;

	hipEventCreate(&E0);
	hipEventCreate(&E1);

	//HOST DATA:
	int *hdisk1, *hdisk2, *hdisk3, *hmirror, *hkeyboard;
	char* hmessage_encrypted;
	//host space allocation:
	hdisk1 = (int*) malloc(numBytes);
	hdisk2 = (int*) malloc(numBytes);
	hdisk3 = (int*) malloc(numBytes);
	hmirror = (int*) malloc(numBytes);
	hkeyboard = (int*) malloc(numBytes);
	hmessage_encrypted = (char*) malloc(strlen(message)*sizeof(char));
	//initialization:
	for(int i = 0; i<N*2;++i) hmirror[i] = hdisk3[i] = hdisk2[i] = hdisk1[i] = hkeyboard[i] = -1;
	configureDisk(hdisk3);configureDisk(hdisk2);configureDisk(hdisk1);
	randomPairs(hmirror,0);randomPairs(hkeyboard,0);	
	join(hmirror,hdisk3);
	join(hdisk3,hdisk2);
	join(hdisk2,hdisk1);

	//DEVICE DATA:
	int *ddisk1,*ddisk2,*ddisk3,*dmirror,*dkeyboard;
	char *dmessage_encrypted;

	hipEventRecord(E0, 0);
	hipEventSynchronize(E0);

	//device space allocation
	hipMalloc((int**)&ddisk3, numBytes); 
	hipMalloc((int**)&ddisk2, numBytes); 
	hipMalloc((int**)&ddisk1, numBytes); 
	hipMalloc((int**)&dmirror, numBytes);
	hipMalloc((int**)&dkeyboard, numBytes);
	hipMalloc((char**)&dmessage_encrypted,strlen(message)*sizeof(char));
	CheckCudaError((char *) "Obtener Memoria en el device", __LINE__);
	//Copy data host --> device
	hipMemcpy(ddisk1, hdisk1, numBytes, hipMemcpyHostToDevice);
	hipMemcpy(ddisk2, hdisk2, numBytes, hipMemcpyHostToDevice);
	hipMemcpy(ddisk3, hdisk3, numBytes, hipMemcpyHostToDevice);
	hipMemcpy(dmirror, hmirror, numBytes, hipMemcpyHostToDevice);
	hipMemcpy(dkeyboard, hkeyboard, numBytes, hipMemcpyHostToDevice);
	hipMemcpy(dmessage_encrypted, message, strlen(message)*sizeof(char),hipMemcpyHostToDevice);
	CheckCudaError((char *) "Copiar Datos Host --> Device", __LINE__); 
	

	int nBlocks = (strlen(message) + THREADS - 1)/THREADS;
	dim3 dimGrid(nBlocks, 1, 1);
	dim3 dimBlock(THREADS, 1, 1);

    int disk_offset = 0;

	// Ejecutar el kernel 
	crypt_gpu<<<dimGrid, dimBlock>>>(strlen(message),N,dmessage_encrypted, ddisk3, ddisk2, ddisk1, dmirror, disk_offset, dkeyboard);
	CheckCudaError((char *) "Invocar Kernel", __LINE__);

	hipMemcpy(hmessage_encrypted,dmessage_encrypted,strlen(message)*sizeof(char),hipMemcpyDeviceToHost);
	CheckCudaError((char *) "Copiar Datos Device --> Host", __LINE__);

	hipEventRecord(E1, 0);
	hipEventSynchronize(E1);

	hipEventElapsedTime(&TiempoTotal,  E0, E1);

  	hipFree(ddisk1); hipFree(ddisk2); hipFree(ddisk3); hipFree(dmirror); hipFree(dkeyboard); hipFree(dmessage_encrypted);

  	clock_t begin = clock();
	string res = crypt_cpu(message,hmirror,hdisk3,hdisk2,hdisk1,hkeyboard,disk_offset);
  	clock_t end = clock();
  	t2 = double(end - begin) / CLOCKS_PER_SEC;

    
    string rec = crypt_cpu(res,hmirror,hdisk3,hdisk2,hdisk1,hkeyboard,disk_offset);
  	cout << "Original message: " << message << endl;
  	cout << "Encrypted message CPU: " << res << endl;
  	cout << "Encrypted message GPU: " << hmessage_encrypted << endl;
  	cout << "GPU time to encrypt: " << TiempoTotal << endl;
  	cout << "CPU time to encrypt: " << t2 << endl;

}




void CheckCudaError(char sms[], int line) {
  hipError_t error;
  error = hipGetLastError();
  if (error) {
    printf("(ERROR) %s - %s in %s at line %d\n", sms, hipGetErrorString(error), __FILE__, line);
    exit(EXIT_FAILURE);
  }
}

	.text
	.file	"cuda_enigma.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z3modii                        # -- Begin function _Z3modii
	.type	_Z3modii,@function
_Z3modii:                               # @_Z3modii
	.cfi_startproc
# %bb.0:
	movl	%edi, %eax
	cltd
	idivl	%esi
	movl	%edx, %eax
	sarl	$31, %eax
	andl	%esi, %eax
	addl	%edx, %eax
	retq
.Lfunc_end0:
	.size	_Z3modii, .Lfunc_end0-_Z3modii
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__crypt_gpuiiPcPiS0_S0_S0_iS0_ # -- Begin function _Z24__device_stub__crypt_gpuiiPcPiS0_S0_S0_iS0_
	.type	_Z24__device_stub__crypt_gpuiiPcPiS0_S0_S0_iS0_,@function
_Z24__device_stub__crypt_gpuiiPcPiS0_S0_S0_iS0_: # @_Z24__device_stub__crypt_gpuiiPcPiS0_S0_S0_iS0_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$176, %rsp
	.cfi_def_cfa_offset 224
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	12(%rsp), %rax
	movl	%edi, (%rax)
	leaq	8(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	56(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	48(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	40(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	32(%rsp), %r8
	movq	%r9, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	224(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	232(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	240(%rsp), %rax
	movq	%rax, 64(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$192, %rsp
	.cfi_adjust_cfa_offset -192
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z24__device_stub__crypt_gpuiiPcPiS0_S0_S0_iS0_, .Lfunc_end1-_Z24__device_stub__crypt_gpuiiPcPiS0_S0_S0_iS0_
	.cfi_endproc
                                        # -- End function
	.globl	_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i # -- Begin function _Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i
	.type	_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i,@function
_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i: # @_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, 32(%rsp)                   # 8-byte Spill
	movq	%r8, 24(%rsp)                   # 8-byte Spill
	movq	%rcx, 16(%rsp)                  # 8-byte Spill
	movq	%rdx, %r13
	movq	%rsi, %rbp
	leaq	16(%rdi), %rax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movq	%rax, (%rdi)
	movl	$.L.str, %esi
	movl	$.L.str, %edx
	movq	%rdi, (%rsp)                    # 8-byte Spill
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	cmpq	$0, 8(%rbp)
	je	.LBB2_4
# %bb.1:                                # %.lr.ph.preheader
	movl	104(%rsp), %r14d
	movl	N(%rip), %ebx
	addl	%ebx, %ebx
	movl	%r14d, %r15d
	negl	%r15d
	xorl	%r12d, %r12d
.LBB2_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rbp), %rax
	movsbq	(%rax,%r12), %rax
	movq	96(%rsp), %r9
	movl	-776(%r9,%rax,8), %eax
	addl	%r14d, %eax
	cltd
	idivl	%ebx
	movl	%edx, %eax
	sarl	$31, %eax
	andl	%ebx, %eax
	addl	%edx, %eax
	cltq
	movq	32(%rsp), %rcx                  # 8-byte Reload
	movl	(%rcx,%rax,4), %eax
	addl	%r15d, %eax
	cltd
	idivl	%ebx
	movl	%edx, %esi
	movl	%edx, %edi
	sarl	$31, %edi
	andl	%ebx, %edi
	movl	%r14d, %eax
	cltd
	idivl	%ebx
	movl	%eax, %ecx
	addl	%eax, %esi
	addl	%edi, %esi
	movl	%esi, %eax
	cltd
	idivl	%ebx
	movl	%edx, %eax
	sarl	$31, %eax
	andl	%ebx, %eax
	addl	%edx, %eax
	cltq
	movq	24(%rsp), %r8                   # 8-byte Reload
	movl	(%r8,%rax,4), %eax
	subl	%ecx, %eax
	cltd
	idivl	%ebx
                                        # kill: def $edx killed $edx def $rdx
	movl	%ecx, %esi
	imull	%ebx, %esi
	movl	%edx, %eax
	sarl	$31, %eax
	andl	%ebx, %eax
	addl	%edx, %eax
	addl	%esi, %eax
	cltd
	idivl	%ebx
	movl	%edx, %eax
	sarl	$31, %eax
	andl	%ebx, %eax
	addl	%edx, %eax
	cltq
	movq	16(%rsp), %rdi                  # 8-byte Reload
	movl	(%rdi,%rax,4), %eax
	subl	%ecx, %eax
	cltd
	idivl	%ebx
	movl	%edx, %eax
	sarl	$31, %eax
	andl	%ebx, %eax
	addl	%edx, %eax
	cltq
	movl	(%r13,%rax,4), %eax
	addl	%esi, %eax
	cltd
	idivl	%ebx
	movl	%edx, %eax
	sarl	$31, %eax
	andl	%ebx, %eax
	addl	%edx, %eax
	cltq
	movl	4(%r13,%rax,4), %eax
	subl	%esi, %eax
	cltd
	idivl	%ebx
                                        # kill: def $edx killed $edx def $rdx
	movl	%edx, %eax
	sarl	$31, %eax
	andl	%ebx, %eax
	addl	%edx, %eax
	addl	%ecx, %eax
	cltd
	idivl	%ebx
	movl	%edx, %eax
	sarl	$31, %eax
	andl	%ebx, %eax
	addl	%edx, %eax
	cltq
	movl	4(%rdi,%rax,4), %eax
	subl	%ecx, %eax
	cltd
	idivl	%ebx
                                        # kill: def $edx killed $edx def $rdx
	leal	(%r14,%rdx), %eax
	sarl	$31, %edx
	andl	%ebx, %edx
	addl	%edx, %eax
	cltd
	idivl	%ebx
	movl	%edx, %eax
	sarl	$31, %eax
	andl	%ebx, %eax
	addl	%edx, %eax
	cltq
	movl	4(%r8,%rax,4), %eax
	addl	%r15d, %eax
	cltd
	idivl	%ebx
	movl	%edx, %eax
	sarl	$31, %eax
	andl	%ebx, %eax
	addl	%edx, %eax
	cltq
	movl	(%r9,%rax,4), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	shrl	%ecx
	addb	$97, %cl
	movsbl	%cl, %esi
.Ltmp0:
	movq	(%rsp), %rdi                    # 8-byte Reload
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc
.Ltmp1:
# %bb.3:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc.exit
                                        #   in Loop: Header=BB2_2 Depth=1
	addl	$2, %r14d
	incq	%r12
	addl	$-2, %r15d
	cmpq	%r12, 8(%rbp)
	ja	.LBB2_2
.LBB2_4:                                # %._crit_edge
	movq	(%rsp), %rax                    # 8-byte Reload
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB2_5:
	.cfi_def_cfa_offset 96
.Ltmp2:
	movq	%rax, %r14
	movq	(%rsp), %rax                    # 8-byte Reload
	movq	(%rax), %rdi
	cmpq	8(%rsp), %rdi                   # 8-byte Folded Reload
	je	.LBB2_7
# %bb.6:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB2_7:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i, .Lfunc_end2-_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp1-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Lfunc_end2-.Ltmp1             #   Call between .Ltmp1 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z13configureDiskPi             # -- Begin function _Z13configureDiskPi
	.type	_Z13configureDiskPi,@function
_Z13configureDiskPi:                    # @_Z13configureDiskPi
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movslq	N(%rip), %rsi
	leaq	16(%rsp), %rdi
	leaq	15(%rsp), %rdx
	callq	_ZNSt6vectorIiSaIiEEC2EmRKS0_
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.LBB3_3
# %bb.1:                                # %.lr.ph
	xorl	%ecx, %ecx
	movq	16(%rsp), %rdx
	xorl	%esi, %esi
.LBB3_2:                                # =>This Inner Loop Header: Depth=1
	movl	%ecx, (%rdx,%rsi,4)
	incq	%rsi
	movslq	N(%rip), %rax
	addl	$2, %ecx
	cmpq	%rax, %rsi
	jl	.LBB3_2
.LBB3_3:                                # %._crit_edge
	movq	16(%rsp), %r14
	movq	24(%rsp), %r15
	cmpq	%r15, %r14
	je	.LBB3_10
# %bb.4:                                # %.preheader.i
	leaq	4(%r14), %rcx
	cmpq	%r15, %rcx
	je	.LBB3_10
# %bb.5:                                # %.lr.ph.i
	movl	$4, %r12d
.LBB3_6:                                # =>This Inner Loop Header: Depth=1
	callq	rand
	cltq
	movq	%r12, %rcx
	sarq	$2, %rcx
	incq	%rcx
	cqto
	idivq	%rcx
	leaq	(,%rdx,4), %rax
	cmpq	%rax, %r12
	je	.LBB3_8
# %bb.7:                                #   in Loop: Header=BB3_6 Depth=1
	leaq	(%r14,%r12), %rax
	leaq	(%r14,%rdx,4), %rcx
	movl	(%rax), %edx
	movl	(%rcx), %esi
	movl	%esi, (%rax)
	movl	%edx, (%rcx)
.LBB3_8:                                #   in Loop: Header=BB3_6 Depth=1
	leaq	(%r14,%r12), %rax
	addq	$4, %rax
	addq	$4, %r12
	cmpq	%r15, %rax
	jne	.LBB3_6
# %bb.9:                                # %_ZSt14random_shuffleIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_.exit.loopexit
	movl	N(%rip), %eax
	movq	16(%rsp), %r14
.LBB3_10:                               # %_ZSt14random_shuffleIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_.exit
	testl	%eax, %eax
	jle	.LBB3_13
# %bb.11:                               # %.lr.ph19.preheader
	xorl	%eax, %eax
.LBB3_12:                               # %.lr.ph19
                                        # =>This Inner Loop Header: Depth=1
	movl	(%r14,%rax,4), %ecx
	movl	%ecx, (%rbx,%rax,8)
	incq	%rax
	movslq	N(%rip), %rcx
	cmpq	%rcx, %rax
	jl	.LBB3_12
	jmp	.LBB3_14
.LBB3_13:                               # %._crit_edge20
	testq	%r14, %r14
	je	.LBB3_15
.LBB3_14:                               # %._crit_edge20.thread
	movq	%r14, %rdi
	callq	_ZdlPv
.LBB3_15:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit
	addq	$40, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z13configureDiskPi, .Lfunc_end3-_Z13configureDiskPi
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIiSaIiEEC2EmRKS0_,"axG",@progbits,_ZNSt6vectorIiSaIiEEC2EmRKS0_,comdat
	.weak	_ZNSt6vectorIiSaIiEEC2EmRKS0_   # -- Begin function _ZNSt6vectorIiSaIiEEC2EmRKS0_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIiSaIiEEC2EmRKS0_,@function
_ZNSt6vectorIiSaIiEEC2EmRKS0_:          # @_ZNSt6vectorIiSaIiEEC2EmRKS0_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB4_7
# %bb.1:                                # %_ZNSt6vectorIiSaIiEE17_S_check_init_lenEmRKS0_.exit
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	testq	%rsi, %rsi
	je	.LBB4_2
# %bb.3:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIiE8allocateEmPKv
	movq	%rax, (%rbx)
	leaq	(%rax,%r14,4), %r15
	movq	%r15, 16(%rbx)
	movl	$0, (%rax)
	addq	$4, %rax
	cmpq	$1, %r14
	jne	.LBB4_5
# %bb.4:
	movq	%rax, %r15
	jmp	.LBB4_6
.LBB4_2:                                # %_ZNSt12_Vector_baseIiSaIiEEC2EmRKS0_.exit.thread
	movups	%xmm0, (%rbx)
	movq	$0, 16(%rbx)
	xorl	%r15d, %r15d
	jmp	.LBB4_6
.LBB4_5:                                # %_ZSt6fill_nIPimiET_S1_T0_RKT1_.exit.loopexit.i.i.i.i
	leaq	-4(,%r14,4), %rdx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.LBB4_6:
	movq	%r15, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB4_7:
	.cfi_def_cfa_offset 32
	movl	$.L.str.14, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end4:
	.size	_ZNSt6vectorIiSaIiEEC2EmRKS0_, .Lfunc_end4-_ZNSt6vectorIiSaIiEEC2EmRKS0_
	.cfi_endproc
                                        # -- End function
	.text
	.globl	_Z11randomPairsPii              # -- Begin function _Z11randomPairsPii
	.type	_Z11randomPairsPii,@function
_Z11randomPairsPii:                     # @_Z11randomPairsPii
	.cfi_startproc
# %bb.0:
	movl	N(%rip), %ecx
	leal	(%rcx,%rcx), %eax
	cmpl	%esi, %eax
	jle	.LBB5_11
# %bb.1:                                # %.lr.ph.preheader
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, %rbx
	movslq	%esi, %r14
.LBB5_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_4 Depth 2
	cmpl	$-1, (%rbx,%r14,4)
	jne	.LBB5_9
# %bb.3:                                # %.preheader.preheader
                                        #   in Loop: Header=BB5_2 Depth=1
	xorl	%ebp, %ebp
.LBB5_4:                                # %.preheader
                                        #   Parent Loop BB5_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movslq	%ebp, %r15
	cmpl	$-1, (%rbx,%r15,4)
	jne	.LBB5_7
# %bb.5:                                #   in Loop: Header=BB5_4 Depth=2
	callq	rand
	movl	N(%rip), %ecx
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	.LBB5_7
# %bb.6:                                #   in Loop: Header=BB5_4 Depth=2
	cmpl	%r14d, %ebp
	jne	.LBB5_8
.LBB5_7:                                # %.thread
                                        #   in Loop: Header=BB5_4 Depth=2
	addl	$2, %ebp
	leal	(%rcx,%rcx), %esi
	movl	%ebp, %eax
	cltd
	idivl	%esi
	movl	%edx, %ebp
	jmp	.LBB5_4
.LBB5_8:                                # %tailrecurse.loopexit
                                        #   in Loop: Header=BB5_2 Depth=1
	movl	%r14d, (%rbx,%r15,4)
	movl	%ebp, (%rbx,%r14,4)
	movl	N(%rip), %ecx
.LBB5_9:                                # %tailrecurse
                                        #   in Loop: Header=BB5_2 Depth=1
	addq	$2, %r14
	leal	(%rcx,%rcx), %eax
	cltq
	cmpq	%rax, %r14
	jl	.LBB5_2
# %bb.10:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB5_11:                               # %tailrecurse._crit_edge
	retq
.Lfunc_end5:
	.size	_Z11randomPairsPii, .Lfunc_end5-_Z11randomPairsPii
	.cfi_endproc
                                        # -- End function
	.globl	_Z4joinPiS_                     # -- Begin function _Z4joinPiS_
	.type	_Z4joinPiS_,@function
_Z4joinPiS_:                            # @_Z4joinPiS_
	.cfi_startproc
# %bb.0:
	cmpl	$0, N(%rip)
	jle	.LBB6_3
# %bb.1:                                # %.lr.ph.preheader
	xorl	%eax, %eax
.LBB6_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movslq	(%rsi,%rax,4), %rcx
	movl	%eax, 4(%rdi,%rcx,4)
	addq	$2, %rax
	movslq	N(%rip), %rcx
	addq	%rcx, %rcx
	cmpq	%rcx, %rax
	jl	.LBB6_2
.LBB6_3:                                # %._crit_edge
	retq
.Lfunc_end6:
	.size	_Z4joinPiS_, .Lfunc_end6-_Z4joinPiS_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function main
.LCPI7_0:
	.byte	115                             # 0x73
	.byte	117                             # 0x75
	.byte	112                             # 0x70
	.byte	101                             # 0x65
	.byte	114                             # 0x72
	.byte	99                              # 0x63
	.byte	97                              # 0x61
	.byte	108                             # 0x6c
	.byte	105                             # 0x69
	.byte	102                             # 0x66
	.byte	114                             # 0x72
	.byte	97                              # 0x61
	.byte	103                             # 0x67
	.byte	105                             # 0x69
	.byte	108                             # 0x6c
	.byte	105                             # 0x69
.LCPI7_1:
	.byte	115                             # 0x73
	.byte	112                             # 0x70
	.byte	105                             # 0x69
	.byte	99                              # 0x63
	.byte	111                             # 0x6f
	.byte	101                             # 0x65
	.byte	115                             # 0x73
	.byte	112                             # 0x70
	.byte	105                             # 0x69
	.byte	97                              # 0x61
	.byte	108                             # 0x6c
	.byte	105                             # 0x69
	.byte	100                             # 0x64
	.byte	111                             # 0x6f
	.byte	115                             # 0x73
	.byte	0                               # 0x0
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI7_2:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$264, %rsp                      # imm = 0x108
	.cfi_def_cfa_offset 320
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movaps	.LCPI7_0(%rip), %xmm0           # xmm0 = [115,117,112,101,114,99,97,108,105,102,114,97,103,105,108,105]
	leaq	96(%rsp), %rbp
	movaps	%xmm0, (%rbp)
	movaps	.LCPI7_1(%rip), %xmm0           # xmm0 = [115,112,105,99,111,101,115,112,105,97,108,105,100,111,115,0]
	movaps	%xmm0, 16(%rbp)
	.cfi_escape 0x2e, 0x00
	xorl	%edi, %edi
	callq	time
	.cfi_escape 0x2e, 0x00
	movl	%eax, %edi
	callq	srand
	movl	N(%rip), %ebx
	shll	$3, %ebx
	.cfi_escape 0x2e, 0x00
	leaq	56(%rsp), %rdi
	callq	hipEventCreate
	.cfi_escape 0x2e, 0x00
	leaq	48(%rsp), %rdi
	callq	hipEventCreate
	movslq	%ebx, %rbx
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, %r14
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, %r15
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, %r12
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, %r13
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, (%rsp)                    # 8-byte Spill
	.cfi_escape 0x2e, 0x00
	movq	%rbp, %rdi
	callq	strlen
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	malloc
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.LBB7_2
# %bb.1:                                # %.lr.ph.preheader
	addl	%eax, %eax
	cmpl	$2, %eax
	movl	$1, %ebp
	cmovgel	%eax, %ebp
	shlq	$2, %rbp
	.cfi_escape 0x2e, 0x00
	movq	(%rsp), %rdi                    # 8-byte Reload
	movl	$255, %esi
	movq	%rbp, %rdx
	callq	memset@PLT
	.cfi_escape 0x2e, 0x00
	movq	%r14, %rdi
	movl	$255, %esi
	movq	%rbp, %rdx
	callq	memset@PLT
	.cfi_escape 0x2e, 0x00
	movq	%r15, %rdi
	movl	$255, %esi
	movq	%rbp, %rdx
	callq	memset@PLT
	.cfi_escape 0x2e, 0x00
	movq	%r12, %rdi
	movl	$255, %esi
	movq	%rbp, %rdx
	callq	memset@PLT
	.cfi_escape 0x2e, 0x00
	movq	%r13, %rdi
	movl	$255, %esi
	movq	%rbp, %rdx
	callq	memset@PLT
.LBB7_2:                                # %._crit_edge
	.cfi_escape 0x2e, 0x00
	movq	%r12, %rdi
	callq	_Z13configureDiskPi
	.cfi_escape 0x2e, 0x00
	movq	%r15, %rdi
	callq	_Z13configureDiskPi
	.cfi_escape 0x2e, 0x00
	movq	%r14, %rdi
	callq	_Z13configureDiskPi
	.cfi_escape 0x2e, 0x00
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_Z11randomPairsPii
	.cfi_escape 0x2e, 0x00
	movq	(%rsp), %rdi                    # 8-byte Reload
	xorl	%esi, %esi
	callq	_Z11randomPairsPii
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.LBB7_9
# %bb.3:                                # %.lr.ph.i.preheader
	addq	%rax, %rax
	xorl	%ecx, %ecx
.LBB7_4:                                # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movslq	(%r12,%rcx,4), %rdx
	movl	%ecx, 4(%r13,%rdx,4)
	addq	$2, %rcx
	cmpq	%rax, %rcx
	jb	.LBB7_4
# %bb.5:                                # %_Z4joinPiS_.exit
	xorl	%ecx, %ecx
.LBB7_6:                                # %.lr.ph.i79
                                        # =>This Inner Loop Header: Depth=1
	movslq	(%r15,%rcx,4), %rdx
	movl	%ecx, 4(%r12,%rdx,4)
	addq	$2, %rcx
	cmpq	%rax, %rcx
	jb	.LBB7_6
# %bb.7:                                # %_Z4joinPiS_.exit83
	xorl	%ecx, %ecx
.LBB7_8:                                # %.lr.ph.i85
                                        # =>This Inner Loop Header: Depth=1
	movslq	(%r14,%rcx,4), %rdx
	movl	%ecx, 4(%r15,%rdx,4)
	addq	$2, %rcx
	cmpq	%rax, %rcx
	jb	.LBB7_8
.LBB7_9:                                # %_Z4joinPiS_.exit89
	movq	56(%rsp), %rdi
	.cfi_escape 0x2e, 0x00
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	56(%rsp), %rdi
	.cfi_escape 0x2e, 0x00
	callq	hipEventSynchronize
	.cfi_escape 0x2e, 0x00
	leaq	32(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	.cfi_escape 0x2e, 0x00
	leaq	40(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	.cfi_escape 0x2e, 0x00
	leaq	80(%rsp), %rbp
	movq	%rbp, %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	.cfi_escape 0x2e, 0x00
	leaq	24(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	.cfi_escape 0x2e, 0x00
	leaq	16(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	.cfi_escape 0x2e, 0x00
	leaq	96(%rsp), %rdi
	callq	strlen
	.cfi_escape 0x2e, 0x00
	leaq	8(%rsp), %rdi
	movq	%rax, %rsi
	callq	hipMalloc
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.1, %edi
	movl	$160, %esi
	callq	_Z14CheckCudaErrorPci
	movq	(%rbp), %rdi
	.cfi_escape 0x2e, 0x00
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	40(%rsp), %rax
	movq	(%rax), %rdi
	.cfi_escape 0x2e, 0x00
	movq	%r15, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	32(%rsp), %rax
	movq	(%rax), %rdi
	.cfi_escape 0x2e, 0x00
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	24(%rsp), %rax
	movq	(%rax), %rdi
	.cfi_escape 0x2e, 0x00
	movq	%r13, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	16(%rsp), %rax
	movq	(%rax), %rdi
	.cfi_escape 0x2e, 0x00
	movq	(%rsp), %rsi                    # 8-byte Reload
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	8(%rsp), %rax
	movq	(%rax), %rbx
	.cfi_escape 0x2e, 0x00
	leaq	96(%rsp), %rbp
	movq	%rbp, %rdi
	callq	strlen
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	movq	%rax, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.2, %edi
	movl	$168, %esi
	callq	_Z14CheckCudaErrorPci
	.cfi_escape 0x2e, 0x00
	movq	%rbp, %rdi
	callq	strlen
	movl	THREADS(%rip), %ecx
	movslq	%ecx, %rsi
	addq	%rsi, %rax
	decq	%rax
	xorl	%edx, %edx
	divq	%rsi
	movl	%eax, %edi
	btsq	$32, %rdi
	btsq	$32, %rcx
	.cfi_escape 0x2e, 0x00
	movl	$1, %esi
	movq	%rcx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_11
# %bb.10:
	.cfi_escape 0x2e, 0x00
	leaq	96(%rsp), %rdi
	callq	strlen
	movl	N(%rip), %esi
	movq	8(%rsp), %rdx
	movq	32(%rsp), %rcx
	movq	40(%rsp), %r8
	movq	80(%rsp), %r9
	.cfi_escape 0x2e, 0x20
	subq	$8, %rsp
	.cfi_adjust_cfa_offset 8
	movl	%eax, %edi
	pushq	24(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	48(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	_Z24__device_stub__crypt_gpuiiPcPiS0_S0_S0_iS0_
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
.LBB7_11:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.3, %edi
	movl	$179, %esi
	callq	_Z14CheckCudaErrorPci
	movq	8(%rsp), %rbp
	.cfi_escape 0x2e, 0x00
	leaq	96(%rsp), %rbx
	movq	%rbx, %rdi
	callq	strlen
	.cfi_escape 0x2e, 0x00
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movq	%rbp, %rsi
	movq	%rax, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.4, %edi
	movl	$182, %esi
	callq	_Z14CheckCudaErrorPci
	movq	48(%rsp), %rdi
	.cfi_escape 0x2e, 0x00
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	48(%rsp), %rdi
	.cfi_escape 0x2e, 0x00
	callq	hipEventSynchronize
	movq	56(%rsp), %rsi
	movq	48(%rsp), %rdx
	.cfi_escape 0x2e, 0x00
	leaq	68(%rsp), %rdi
	callq	hipEventElapsedTime
	movq	80(%rsp), %rdi
	.cfi_escape 0x2e, 0x00
	callq	hipFree
	movq	40(%rsp), %rdi
	.cfi_escape 0x2e, 0x00
	callq	hipFree
	movq	32(%rsp), %rdi
	.cfi_escape 0x2e, 0x00
	callq	hipFree
	movq	24(%rsp), %rdi
	.cfi_escape 0x2e, 0x00
	callq	hipFree
	movq	16(%rsp), %rdi
	.cfi_escape 0x2e, 0x00
	callq	hipFree
	movq	8(%rsp), %rdi
	.cfi_escape 0x2e, 0x00
	callq	hipFree
	.cfi_escape 0x2e, 0x00
	callq	clock
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	leaq	184(%rsp), %rax
	movq	%rax, -16(%rax)
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	callq	strlen
	leaq	(%rsp,%rax), %rdx
	addq	$96, %rdx
	.cfi_escape 0x2e, 0x00
	leaq	168(%rsp), %rbp
	movq	%rbp, %rdi
	movq	%rbx, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
.Ltmp3:
	.cfi_escape 0x2e, 0x10
	leaq	136(%rsp), %rdi
	movq	%rbp, %rsi
	movq	%r13, %rdx
	movq	%r12, %rcx
	movq	%r15, %r8
	movq	%r14, %r9
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	8(%rsp)                         # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	callq	_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
.Ltmp4:
# %bb.12:
	movq	168(%rsp), %rdi
	leaq	184(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB7_14
# %bb.13:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	.cfi_escape 0x2e, 0x00
	callq	_ZdlPv
.LBB7_14:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	.cfi_escape 0x2e, 0x00
	callq	clock
	movq	%rax, %rbx
	leaq	216(%rsp), %rbp
	movq	%rbp, -16(%rbp)
	movq	136(%rsp), %rsi
	movq	144(%rsp), %rdx
	addq	%rsi, %rdx
.Ltmp6:
	.cfi_escape 0x2e, 0x00
	leaq	200(%rsp), %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
.Ltmp7:
# %bb.15:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2ERKS4_.exit
.Ltmp9:
	.cfi_escape 0x2e, 0x10
	leaq	232(%rsp), %rdi
	leaq	200(%rsp), %rsi
	movq	%r13, %rdx
	movq	%r12, %rcx
	movq	%r15, %r8
	movq	%r14, %r9
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	8(%rsp)                         # 8-byte Folded Reload
	.cfi_adjust_cfa_offset 8
	callq	_Z9crypt_cpuNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiS5_S5_S5_S5_i
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
.Ltmp10:
# %bb.16:
	movq	200(%rsp), %rdi
	cmpq	%rbp, %rdi
	je	.LBB7_18
# %bb.17:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i90
	.cfi_escape 0x2e, 0x00
	callq	_ZdlPv
.LBB7_18:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit92
.Ltmp12:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$18, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp13:
# %bb.19:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	.cfi_escape 0x2e, 0x00
	leaq	96(%rsp), %r15
	movq	%r15, %rdi
	callq	strlen
.Ltmp14:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp15:
# %bb.20:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit93
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %r14
.Ltmp16:
	.cfi_escape 0x2e, 0x00
	movq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp17:
# %bb.21:                               # %.noexc130
.Ltmp18:
	.cfi_escape 0x2e, 0x00
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp19:
# %bb.22:                               # %.noexc131
.Ltmp20:
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp21:
# %bb.23:                               # %_ZNSolsEPFRSoS_E.exit
.Ltmp22:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$23, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp23:
# %bb.24:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit94
	movq	136(%rsp), %rsi
	movq	144(%rsp), %rdx
.Ltmp24:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp25:
# %bb.25:                               # %_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
.Ltmp26:
	.cfi_escape 0x2e, 0x00
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp27:
# %bb.26:                               # %.noexc133
.Ltmp28:
	.cfi_escape 0x2e, 0x00
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
.Ltmp29:
# %bb.27:                               # %.noexc134
.Ltmp30:
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp31:
# %bb.28:                               # %_ZNSolsEPFRSoS_E.exit95
.Ltmp32:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$23, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp33:
# %bb.29:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit96
	movq	72(%rsp), %r14                  # 8-byte Reload
	testq	%r14, %r14
	je	.LBB7_30
# %bb.31:
	.cfi_escape 0x2e, 0x00
	movq	%r14, %rdi
	callq	strlen
.Ltmp34:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp35:
	jmp	.LBB7_32
.LBB7_30:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp36:
	.cfi_escape 0x2e, 0x00
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp37:
.LBB7_32:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit98
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp38:
	.cfi_escape 0x2e, 0x00
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp39:
# %bb.33:                               # %.noexc137
.Ltmp40:
	.cfi_escape 0x2e, 0x00
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp41:
# %bb.34:                               # %.noexc138
.Ltmp42:
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp43:
# %bb.35:                               # %_ZNSolsEPFRSoS_E.exit100
.Ltmp44:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	movl	$.L.str.8, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp45:
# %bb.36:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit102
	cvtss2sd	68(%rsp), %xmm0
.Ltmp46:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp47:
# %bb.37:                               # %_ZNSolsEf.exit
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
.Ltmp48:
	.cfi_escape 0x2e, 0x00
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp49:
# %bb.38:                               # %.noexc141
.Ltmp50:
	.cfi_escape 0x2e, 0x00
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
.Ltmp51:
# %bb.39:                               # %.noexc142
.Ltmp52:
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp53:
# %bb.40:                               # %_ZNSolsEPFRSoS_E.exit105
.Ltmp54:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	movl	$.L.str.9, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp55:
# %bb.41:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit107
	subq	88(%rsp), %rbx                  # 8-byte Folded Reload
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rbx, %xmm0
	divsd	.LCPI7_2(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	cvtss2sd	%xmm0, %xmm0
.Ltmp56:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp57:
# %bb.42:                               # %_ZNSolsEf.exit109
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp58:
	.cfi_escape 0x2e, 0x00
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp59:
# %bb.43:                               # %.noexc145
.Ltmp60:
	.cfi_escape 0x2e, 0x00
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp61:
# %bb.44:                               # %.noexc146
.Ltmp62:
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp63:
# %bb.45:                               # %_ZNSolsEPFRSoS_E.exit111
	leaq	248(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB7_47
# %bb.46:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i112
	.cfi_escape 0x2e, 0x00
	callq	_ZdlPv
.LBB7_47:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit114
	leaq	152(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB7_49
# %bb.48:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i115
	.cfi_escape 0x2e, 0x00
	callq	_ZdlPv
.LBB7_49:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit117
	xorl	%eax, %eax
	addq	$264, %rsp                      # imm = 0x108
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB7_53:
	.cfi_def_cfa_offset 320
.Ltmp11:
	movq	%rax, %r14
	movq	200(%rsp), %rdi
	cmpq	%rbp, %rdi
	je	.LBB7_58
# %bb.54:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i121
	.cfi_escape 0x2e, 0x00
	jmp	.LBB7_57
.LBB7_52:
.Ltmp8:
	movq	%rax, %r14
	jmp	.LBB7_58
.LBB7_50:
.Ltmp5:
	movq	%rax, %r14
	movq	168(%rsp), %rdi
	leaq	184(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB7_61
# %bb.51:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i118
	.cfi_escape 0x2e, 0x00
	jmp	.LBB7_60
.LBB7_55:
.Ltmp64:
	movq	%rax, %r14
	leaq	248(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB7_58
# %bb.56:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i124
	.cfi_escape 0x2e, 0x00
.LBB7_57:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit123
	callq	_ZdlPv
.LBB7_58:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit123
	leaq	152(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB7_61
# %bb.59:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i127
	.cfi_escape 0x2e, 0x00
.LBB7_60:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit120
	callq	_ZdlPv
.LBB7_61:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit120
	.cfi_escape 0x2e, 0x00
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end7:
	.size	main, .Lfunc_end7-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table7:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp3-.Lfunc_begin1           #   Call between .Lfunc_begin1 and .Ltmp3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin1           # >> Call Site 2 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin1           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin1           # >> Call Site 3 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin1           #     jumps to .Ltmp8
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin1           # >> Call Site 4 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-.Lfunc_begin1          #     jumps to .Ltmp11
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp63-.Ltmp12                #   Call between .Ltmp12 and .Ltmp63
	.uleb128 .Ltmp64-.Lfunc_begin1          #     jumps to .Ltmp64
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp63-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Lfunc_end7-.Ltmp63            #   Call between .Ltmp63 and .Lfunc_end7
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z14CheckCudaErrorPci           # -- Begin function _Z14CheckCudaErrorPci
	.type	_Z14CheckCudaErrorPci,@function
_Z14CheckCudaErrorPci:                  # @_Z14CheckCudaErrorPci
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	hipGetLastError
	testl	%eax, %eax
	jne	.LBB8_2
# %bb.1:
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB8_2:
	.cfi_def_cfa_offset 32
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.10, %edi
	movl	$.L.str.11, %ecx
	movq	%r14, %rsi
	movq	%rax, %rdx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	printf
	movl	$1, %edi
	callq	exit
.Lfunc_end8:
	.size	_Z14CheckCudaErrorPci, .Lfunc_end8-_Z14CheckCudaErrorPci
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	subq	%rsi, %r14
	movq	%r14, (%rsp)
	cmpq	$15, %r14
	jbe	.LBB9_1
# %bb.2:
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, (%rbx)
	movq	(%r12), %rcx
	movq	%rcx, 16(%rbx)
	jmp	.LBB9_3
.LBB9_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB9_3:
	testq	%r14, %r14
	je	.LBB9_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB9_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB9_7
.LBB9_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB9_7:                                # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end9-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIiE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIiE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIiE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIiE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIiE8allocateEmPKv,@function
_ZNSt15__new_allocatorIiE8allocateEmPKv: # @_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB10_1
# %bb.3:
	shlq	$2, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB10_1:
	.cfi_def_cfa_offset 16
	shrq	$62, %rsi
	je	.LBB10_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB10_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end10:
	.size	_ZNSt15__new_allocatorIiE8allocateEmPKv, .Lfunc_end10-_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	subq	%rsi, %r14
	movq	%r14, (%rsp)
	cmpq	$15, %r14
	jbe	.LBB11_1
# %bb.2:
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, (%rbx)
	movq	(%r12), %rcx
	movq	%rcx, 16(%rbx)
	jmp	.LBB11_3
.LBB11_1:                               # %._crit_edge
	movq	(%rbx), %rax
.LBB11_3:
	testq	%r14, %r14
	je	.LBB11_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB11_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB11_7
.LBB11_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB11_7:                               # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end11:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag, .Lfunc_end11-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB12_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB12_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end12:
	.size	__hip_module_ctor, .Lfunc_end12-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB13_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB13_2:
	retq
.Lfunc_end13:
	.size	__hip_module_dtor, .Lfunc_end13-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	N,@object                       # @N
	.data
	.globl	N
	.p2align	2, 0x0
N:
	.long	26                              # 0x1a
	.size	N, 4

	.type	THREADS,@object                 # @THREADS
	.globl	THREADS
	.p2align	2, 0x0
THREADS:
	.long	64                              # 0x40
	.size	THREADS, 4

	.type	_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_,@object # @_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_
	.section	.rodata,"a",@progbits
	.globl	_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_
	.p2align	3, 0x0
_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_:
	.quad	_Z24__device_stub__crypt_gpuiiPcPiS0_S0_S0_iS0_
	.size	_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.zero	1
	.size	.L.str, 1

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Obtener Memoria en el device"
	.size	.L.str.1, 29

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Copiar Datos Host --> Device"
	.size	.L.str.2, 29

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Invocar Kernel"
	.size	.L.str.3, 15

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Copiar Datos Device --> Host"
	.size	.L.str.4, 29

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Original message: "
	.size	.L.str.5, 19

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Encrypted message CPU: "
	.size	.L.str.6, 24

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Encrypted message GPU: "
	.size	.L.str.7, 24

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"GPU time to encrypt: "
	.size	.L.str.8, 22

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"CPU time to encrypt: "
	.size	.L.str.9, 22

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"(ERROR) %s - %s in %s at line %d\n"
	.size	.L.str.10, 34

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/marcortiz11/EnigmaGPU/master/cuda_enigma.hip"
	.size	.L.str.11, 107

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"cannot create std::vector larger than max_size()"
	.size	.L.str.14, 49

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_"
	.size	.L__unnamed_1, 32

	.type	__hip_fatbin_wrapper,@object    # @__hip_fatbin_wrapper
	.section	.hipFatBinSegment,"a",@progbits
	.p2align	3, 0x0
__hip_fatbin_wrapper:
	.long	1212764230                      # 0x48495046
	.long	1                               # 0x1
	.quad	__hip_fatbin
	.quad	0
	.size	__hip_fatbin_wrapper, 24

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z24__device_stub__crypt_gpuiiPcPiS0_S0_S0_iS0_
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z9crypt_gpuiiPcPiS0_S0_S0_iS0_
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_ ; -- Begin function _Z9crypt_gpuiiPcPiS0_S0_S0_iS0_
	.globl	_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_
	.p2align	8
	.type	_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_,@function
_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_:        ; @_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x4c
	s_load_b64 s[2:3], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s4, s4, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s4, v[0:1]
	v_cmp_gt_i32_e32 vcc_lo, s2, v1
	s_and_saveexec_b32 s2, vcc_lo
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b256 s[4:11], s[0:1], 0x8
	v_ashrrev_i32_e32 v0, 31, v1
	s_lshl_b32 s12, s3, 1
	s_bfe_i32 s13, s3, 0x1001e
	s_load_b32 s14, s[0:1], 0x30
	s_add_i32 s2, s12, s13
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_xor_b32 s3, s2, s13
	s_sub_i32 s2, 0, s3
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s4, v1
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v0, vcc_lo
	s_clause 0x1
	s_load_b64 s[4:5], s[0:1], 0x38
	s_load_b64 s[0:1], s[0:1], 0x28
	global_load_i8 v0, v[2:3], off
	s_waitcnt vmcnt(0)
	v_lshlrev_b32_e32 v4, 1, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v5, 31, v4
	v_lshlrev_b64 v[4:5], 2, v[4:5]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, s4, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v5, vcc_lo
	global_load_b32 v0, v[4:5], off offset:-776
	v_cvt_f32_u32_e32 v4, s3
	v_add_nc_u32_e32 v5, s14, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_iflag_f32_e32 v4, v4
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v4, 0x4f7ffffe, v4
	v_cvt_u32_f32_e32 v1, v4
	v_lshlrev_b32_e32 v4, 1, v5
	v_bfe_i32 v5, v5, 30, 1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_lo_u32 v6, s2, v1
	v_add_nc_u32_e32 v8, v4, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_xor_b32_e32 v8, v8, v5
	v_mul_hi_u32 v6, v1, v6
	v_xor_b32_e32 v5, s13, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v6, v1, v6
	v_mul_hi_u32 v9, v8, v6
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v0, v0, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v7, 31, v0
	v_add_nc_u32_e32 v0, v0, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v0, v0, v7
	v_mul_hi_u32 v1, v0, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v1, v1, s3
	v_sub_nc_u32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v1, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	v_cndmask_b32_e32 v0, v0, v1, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v1, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	v_cndmask_b32_e32 v0, v0, v1, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v0, v0, v7
	v_sub_nc_u32_e32 v0, v0, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_and_b32_e32 v1, s12, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v1, v0
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	v_add_co_u32 v0, vcc_lo, s10, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v1, vcc_lo, s11, v1, vcc_lo
	global_load_b32 v0, v[0:1], off
	s_waitcnt vmcnt(0)
	v_sub_nc_u32_e32 v0, v0, v4
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v0, v1
	v_xor_b32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_hi_u32 v7, v0, v6
	v_mul_lo_u32 v7, v7, s3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_sub_nc_u32_e32 v0, v0, v7
	v_mul_lo_u32 v7, v9, s3
	v_subrev_nc_u32_e32 v10, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_sub_nc_u32_e32 v7, v8, v7
	v_add_nc_u32_e32 v8, 1, v9
	v_cndmask_b32_e32 v0, v0, v10, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_le_u32_e32 vcc_lo, s3, v7
	v_subrev_nc_u32_e32 v10, s3, v0
	v_cmp_le_u32_e64 s2, s3, v0
	v_cndmask_b32_e32 v8, v9, v8, vcc_lo
	v_subrev_nc_u32_e32 v9, s3, v7
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e64 v0, v0, v10, s2
	v_cndmask_b32_e32 v7, v7, v9, vcc_lo
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_nc_u32_e32 v9, 1, v8
	v_xor_b32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_le_u32_e32 vcc_lo, s3, v7
	v_sub_nc_u32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v7, v8, v9, vcc_lo
	v_xor_b32_e32 v1, v7, v5
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v7, 31, v0
	v_sub_nc_u32_e32 v5, v1, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v1, s12, v7
	v_add3_u32 v0, v5, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_add_nc_u32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v0, v0, v1
	v_mul_hi_u32 v7, v0, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v7, v7, s3
	v_sub_nc_u32_e32 v0, v0, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v7, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	v_cndmask_b32_e32 v0, v0, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v7, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	v_cndmask_b32_e32 v0, v0, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v0, v0, v1
	v_sub_nc_u32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_and_b32_e32 v1, s12, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v1, v0
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	v_add_co_u32 v0, vcc_lo, s8, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v1, vcc_lo, s9, v1, vcc_lo
	global_load_b32 v0, v[0:1], off
	s_waitcnt vmcnt(0)
	v_sub_nc_u32_e32 v0, v0, v5
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v0, v1
	v_xor_b32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_hi_u32 v7, v0, v6
	v_mul_lo_u32 v7, v7, s3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v0, v0, v7
	v_subrev_nc_u32_e32 v7, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v7, vcc_lo
	v_subrev_nc_u32_e32 v7, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v0, v0, v7, vcc_lo
	v_mul_lo_u32 v7, v5, s12
	v_xor_b32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v0, v0, v1
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v1, s12, v1
	v_add3_u32 v0, v0, v7, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_add_nc_u32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v0, v0, v1
	v_mul_hi_u32 v8, v0, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v8, v8, s3
	v_sub_nc_u32_e32 v0, v0, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v8, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	v_cndmask_b32_e32 v0, v0, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v8, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	v_cndmask_b32_e32 v0, v0, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v0, v0, v1
	v_sub_nc_u32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_and_b32_e32 v1, s12, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v1, v0
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	v_add_co_u32 v0, vcc_lo, s6, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	global_load_b32 v0, v[0:1], off
	s_waitcnt vmcnt(0)
	v_sub_nc_u32_e32 v0, v0, v5
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v0, v1
	v_xor_b32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_hi_u32 v8, v0, v6
	v_mul_lo_u32 v8, v8, s3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v0, v0, v8
	v_subrev_nc_u32_e32 v8, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v8, vcc_lo
	v_subrev_nc_u32_e32 v8, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v8, vcc_lo
	v_xor_b32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v0, v0, v1
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v1, s12, v1
	v_add_nc_u32_e32 v0, v1, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_load_b32 v0, v[0:1], off
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v0, v0, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_add_nc_u32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v0, v0, v1
	v_mul_hi_u32 v8, v0, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v8, v8, s3
	v_sub_nc_u32_e32 v0, v0, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v8, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	v_cndmask_b32_e32 v0, v0, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v8, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	v_cndmask_b32_e32 v0, v0, v8, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v0, v0, v1
	v_sub_nc_u32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_and_b32_e32 v1, s12, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v1, v0
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	v_add_co_u32 v0, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_load_b32 v0, v[0:1], off offset:4
	s_waitcnt vmcnt(0)
	v_sub_nc_u32_e32 v0, v0, v7
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v0, v1
	v_xor_b32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_hi_u32 v7, v0, v6
	v_mul_lo_u32 v7, v7, s3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v0, v0, v7
	v_subrev_nc_u32_e32 v7, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v7, vcc_lo
	v_subrev_nc_u32_e32 v7, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v7, vcc_lo
	v_xor_b32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v0, v0, v1
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v1, s12, v1
	v_add3_u32 v0, v0, v5, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_add_nc_u32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v0, v0, v1
	v_mul_hi_u32 v7, v0, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v7, v7, s3
	v_sub_nc_u32_e32 v0, v0, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v7, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	v_cndmask_b32_e32 v0, v0, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v7, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	v_cndmask_b32_e32 v0, v0, v7, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v0, v0, v1
	v_sub_nc_u32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_and_b32_e32 v1, s12, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v1, v0
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	v_add_co_u32 v0, vcc_lo, s6, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	global_load_b32 v0, v[0:1], off offset:4
	s_waitcnt vmcnt(0)
	v_sub_nc_u32_e32 v0, v0, v5
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v0, v1
	v_xor_b32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_hi_u32 v5, v0, v6
	v_mul_lo_u32 v5, v5, s3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v0, v0, v5
	v_subrev_nc_u32_e32 v5, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v5, vcc_lo
	v_subrev_nc_u32_e32 v5, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v5, vcc_lo
	v_xor_b32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v0, v0, v1
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v1, s12, v1
	v_add3_u32 v0, v0, v4, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_add_nc_u32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v0, v0, v1
	v_mul_hi_u32 v5, v0, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v5, v5, s3
	v_sub_nc_u32_e32 v0, v0, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v5, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	v_cndmask_b32_e32 v0, v0, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v5, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	v_cndmask_b32_e32 v0, v0, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_xor_b32_e32 v0, v0, v1
	v_sub_nc_u32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_and_b32_e32 v1, s12, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v1, v0
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	v_add_co_u32 v0, vcc_lo, s8, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v1, vcc_lo, s9, v1, vcc_lo
	global_load_b32 v0, v[0:1], off offset:4
	s_waitcnt vmcnt(0)
	v_sub_nc_u32_e32 v0, v0, v4
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v0, v1
	v_xor_b32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_hi_u32 v4, v0, v6
	v_mul_lo_u32 v4, v4, s3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v0, v0, v4
	v_subrev_nc_u32_e32 v4, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v4, vcc_lo
	v_subrev_nc_u32_e32 v4, s3, v0
	v_cmp_le_u32_e32 vcc_lo, s3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v4, vcc_lo
	v_xor_b32_e32 v0, v0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v0, v0, v1
	v_ashrrev_i32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v1, s12, v1
	v_add_nc_u32_e32 v0, v1, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	global_load_b32 v0, v[0:1], off
	s_waitcnt vmcnt(0)
	v_lshrrev_b32_e32 v1, 31, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, v0, v1
	v_lshrrev_b32_e32 v0, 1, v0
	s_delay_alu instid0(VALU_DEP_1)
	v_add_nc_u16 v0, v0, 0x61
	global_store_b8 v[2:3], v0, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9crypt_gpuiiPcPiS0_S0_S0_iS0_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 320
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 11
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_, .Lfunc_end0-_Z9crypt_gpuiiPcPiS0_S0_S0_iS0_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 2108
; NumSgprs: 18
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 11
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .offset:         4
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .offset:         48
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         56
        .size:           8
        .value_kind:     global_buffer
      - .offset:         64
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         68
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         72
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         76
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         78
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         80
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         82
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         84
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         86
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         112
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         120
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         128
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 320
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9crypt_gpuiiPcPiS0_S0_S0_iS0_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z9crypt_gpuiiPcPiS0_S0_S0_iS0_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     11
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
