#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <cuda.h>

/**
 * Encrypt Program Cuda
 *
 * This program encrypts a file using a degree 2 formula using Cuda
 * Parallelization and then decrypts the file using another degree 2
 * formula.
 *
 * @Author: Clayton Chase Glenn
 */

#define MAX 20
#define DEBUG 0

/** Kernel Function
  * First finds the Thread ID within the block of GPU Threads
  * and if the Thread is Correct, it Encrypts the corresponding
  * Character in the String.
 **/
__global__
void encrypt(char *p, char *c, int a, int b, int n) {
  int tid = blockIdx.x * blockDim.x + threadIdx.x;
  if(tid < n) c[tid] = (a*p[tid] + b) % 256;
}

/** Kernel Function
  * First finds the Thread ID within the block of GPU Threads
  * and if the Thread is Correct, it Encrypts the corresponding
  * Character in the String.
 **/
__global__
void decrypt(char *p, char *c, int a, int b, int n) {
  int tid = blockIdx.x * blockDim.x + threadIdx.x;
  if(tid < n) c[tid] = (a*p[tid] + b) % 256;
}

/** Kernel Function
  * First finds the Thread ID within the block of GPU Threads
  * and if the Thread is Correct, it checks if the corresponding
  * character in array a matches b.
 **/
__global__
void isMatch(char *p, char *c, int *a, int n) {
  int tid = blockIdx.x * blockDim.x + threadIdx.x;
  if(tid < n) {
    if (c[tid] != p[tid]) {
      *a = 1;
    }
  }
}

/**
  * Helper Function
  * Prints an string to standard error showing help
  * for valid arguments in the executable
 **/
void printerror(){
  fprintf(stderr, "Invalid Arguments\n");
  fprintf(stderr, "Correct Form: ./encrypt [File to Encrypt]\n");
  fprintf(stderr, "              or\n");
  fprintf(stderr, "              ./encrypt -n [2^(1:20)]\n");
  exit(0);
}
/**
  * Main Program
  * This Program is for Homework 6 to encrypt some text or show
  * the encryption method of text that is 2 to the power of N
  * characters long all initialized to zero.
 **/
int main(int argc, char **argv) {

  // Declare a buffer of max size to start
  int     N = MAX;
  char *buf;

  // Check for immediate errors in args
  if (argc < 2)                           printerror();
  if (argc == 3 && strcmp(argv[1], "-n")) printerror();

  // If args match for testing, Initiallize the program
  if(!strcmp(argv[1], "-n") && argc == 3){

    // Get total characters from args
    N = strtol(argv[2], NULL, 10);

    // Show error if N isn't within constraints
    if(N < 1 || N > 20) printerror();

    // N <- calc to 2^N as size and allocate space
    N   = (int)pow(2, N);
    buf = (char*)malloc(N*sizeof(char));

    //Initiallize the buffer to Zero
    int i = 0;
    while (i < N) buf[i++] = 48;
  }

  // If 2 args, this means file
  if(argc == 2) {

    // Declare a file pointer, character array, and single character for reading
    FILE *fp;
    char c;
    char chars[1048576];
    int i = 0;

    // Open the file for reading
    fp = fopen(argv[1], "r");

    // If file is null, file does not exist or error
    if (fp == NULL) {
      fprintf(stderr, "Not a Valid File\n");
      return (-1);
    }

    // Read each character and keep within 2^20, add to array
    while((c = fgetc(fp)) != EOF) {
      if (i >= 1048576) {
        fprintf(stderr, "File Too Large\n");
        return (-1);
      }
      chars[i++] = c;
    }

    // Increment i for space and allocate space for buffer
    N = i + 1;
    buf = (char*)malloc(N*sizeof(char));

    // Copy read elements into buffer
    i = 0;
    while(i < N) buf[i] = chars[i++];

    // Close File, not needed anymore
    fclose(fp);
  }

  // Initiallize Character Arrays for Encrypting and manual memset
  char h_p[N];
  char h_c[N];
  char h_r[N];
  int i = 0;
  while (i < N) {
    h_p[i] = buf[i];
    h_c[i] = 32;
    h_r[i++] = 32;
  }

  // Init all other variables
  char *dev_p, *dev_c, *dev_r;
  int *match;
  int h_match = 0;
  int h_a = 171, h_b = 55;
  int r_a = 3,   r_b = 91;
  cudaEvent_t start1, start2, start3, startf, stop1, stop2, stop3, stopf;
  cudaEventCreate(&start1);
  cudaEventCreate(&stop1);
  cudaEventCreate(&start2);
  cudaEventCreate(&stop2);
  cudaEventCreate(&start3);
  cudaEventCreate(&stop3);
  cudaEventCreate(&startf);
  cudaEventCreate(&stopf);
  float final_time1 = 0.0, final_time2 = 0.0, final_time3 = 0.0, final_timef = 0.0;

  // Allocate Memory for match flag
  match = (int*)malloc(sizeof(int));
  *match = 0;

  // Allocate memory in the GPU for the character arrays
  cudaMalloc(&dev_p, N*sizeof(char));
  cudaMalloc(&dev_c, N*sizeof(char));
  cudaMalloc(&dev_r, N*sizeof(char));
  cudaMalloc(&match, sizeof(int));

  // Print N for distinguish
  printf("N: %d\n", N);

  // If debug on, show plain text
  if(DEBUG) {
    printf("Plain Text:     ");
    i = 0;
    while(i < N) printf("%c", h_p[i++]);
    printf("\n");
  }

  // Copy the Memory from the arrays to the array pointers
  cudaMemcpy(dev_p, h_p, N*sizeof(char), cudaMemcpyHostToDevice);
  cudaMemcpy(dev_c, h_c, N*sizeof(char), cudaMemcpyHostToDevice);
  cudaMemcpy(dev_r, h_r, N*sizeof(char), cudaMemcpyHostToDevice);

  // Start Total Time Record
  cudaEventRecord(startf);

  // Encrypt the Plain Text and Record Start and Finish
  cudaEventRecord(start1);
  encrypt<<<128, 128>>>(dev_p, dev_c, h_a, h_b, N);
  cudaEventRecord(stop1);

  // Copy the results from GPU to the CPU
  cudaMemcpy(h_c, dev_c, N*sizeof(char), cudaMemcpyDeviceToHost);

  // If debug on, show encrypted text
  if(DEBUG) {
    printf("Encrypted Text: ");
    i = 0;
    while(i < N) printf("%c", h_c[i++]);
    printf("\n");
  }

  // Syncronize all blocks and threads in GPU and get time
  cudaEventSynchronize(stop1);
  cudaEventElapsedTime(&final_time1, start1, stop1);

  // Decrypt the Encrypted Text
  cudaEventRecord(stop2);
  decrypt<<<128, 128>>>(dev_c, dev_r, r_a, r_b, N);
  cudaEventRecord(stop2);

  // Copy the results from GPU to CPU
  cudaMemcpy(h_r, dev_r, N*sizeof(char), cudaMemcpyDeviceToHost);

  // If debug on, show decrypted text
  if(DEBUG) {
    printf("Decrypted Text: ", h_r);
    i = 0;
    while(i < N) printf("%c", h_r[i++]);
    printf("\n");
  }

  // Syncronize all blocks and threads in GPU and get time
  cudaEventSynchronize(stop2);
  cudaEventElapsedTime(&final_time2, start2, stop2);

  // Check if Plain Text and Encrypt<-->Decrypt Text is matching by GPU
  cudaEventRecord(start3);
  isMatch<<<128, 128>>>(dev_r, dev_p, match, N);
  cudaEventRecord(stop3);

  // Copy the Match Result from GPU to CPU
  cudaMemcpy(&h_match, match, sizeof(int), cudaMemcpyDeviceToHost);

  // If match is zero, success, else, no success
  if (h_match) fprintf(stdout, "Does not Match\n");
  else         fprintf(stdout, "Does Match\n");

  // Syncronize all blocks and threads in GPU and get time
  cudaEventSynchronize(stop3);
  cudaEventElapsedTime(&final_time3, start3, stop3);

  // Syncronize all blocks and threads in GPU and get time
  cudaEventRecord(stopf);
  cudaEventSynchronize(stopf);
  cudaEventElapsedTime(&final_timef, startf, stopf);

  // Print Times
  printf("Encrypt Time:   %4.10f seconds\n",   final_time1/1000);
  printf("Decrypt Time:   %4.10f seconds\n",   final_time2/1000);
  printf("Match Time:     %4.10f seconds\n",   final_time3/1000);
  printf("Total Time:     %4.10f seconds\n\n", final_timef/1000);

  // Free the GPU memory
  cudaFree(dev_p);
  cudaFree(dev_c);
  cudaFree(dev_r);
}

	.file	"tmpxft_00296a99_00000000-6_Encrypt_CUDA.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2031:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2031:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Invalid Arguments\n"
.LC1:
	.string	"Correct Form: ./encrypt [File to Encrypt]\n"
.LC2:
	.string	"              or\n"
.LC3:
	.string	"              ./encrypt -n [2^(1:20)]\n"
	.text
	.globl	_Z10printerrorv
	.type	_Z10printerrorv, @function
_Z10printerrorv:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	leaq	.LC0(%rip), %rdx
	movl	$2, %esi
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	stderr(%rip), %rdi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	stderr(%rip), %rdi
	leaq	.LC1(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movq	stderr(%rip), %rdi
	leaq	.LC2(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movq	stderr(%rip), %rdi
	leaq	.LC3(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	call	__fprintf_chk@PLT
	xorl	%edi, %edi
	call	exit@PLT
	.cfi_endproc
.LFE2027:
	.size	_Z10printerrorv, .-_Z10printerrorv
	.globl	_Z31__device_stub__Z7encryptPcS_iiiPcS_iii
	.type	_Z31__device_stub__Z7encryptPcS_iiiPcS_iii, @function
_Z31__device_stub__Z7encryptPcS_iiiPcS_iii:
.LFB2053:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L4
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z7encryptPcS_iii(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L4:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2053:
	.size	_Z31__device_stub__Z7encryptPcS_iiiPcS_iii, .-_Z31__device_stub__Z7encryptPcS_iiiPcS_iii
	.globl	_Z7encryptPcS_iii
	.type	_Z7encryptPcS_iii, @function
_Z7encryptPcS_iii:
.LFB2054:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z7encryptPcS_iiiPcS_iii
	.cfi_endproc
.LFE2054:
	.size	_Z7encryptPcS_iii, .-_Z7encryptPcS_iii
	.globl	_Z31__device_stub__Z7decryptPcS_iiiPcS_iii
	.type	_Z31__device_stub__Z7decryptPcS_iiiPcS_iii, @function
_Z31__device_stub__Z7decryptPcS_iiiPcS_iii:
.LFB2055:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L10
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z7decryptPcS_iii(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L10:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2055:
	.size	_Z31__device_stub__Z7decryptPcS_iiiPcS_iii, .-_Z31__device_stub__Z7decryptPcS_iiiPcS_iii
	.globl	_Z7decryptPcS_iii
	.type	_Z7decryptPcS_iii, @function
_Z7decryptPcS_iii:
.LFB2056:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z7decryptPcS_iiiPcS_iii
	.cfi_endproc
.LFE2056:
	.size	_Z7decryptPcS_iii, .-_Z7decryptPcS_iii
	.globl	_Z31__device_stub__Z7isMatchPcS_PiiPcS_Pii
	.type	_Z31__device_stub__Z7isMatchPcS_PiiPcS_Pii, @function
_Z31__device_stub__Z7isMatchPcS_PiiPcS_Pii:
.LFB2057:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L15
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z7isMatchPcS_Pii(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L15:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2057:
	.size	_Z31__device_stub__Z7isMatchPcS_PiiPcS_Pii, .-_Z31__device_stub__Z7isMatchPcS_PiiPcS_Pii
	.globl	_Z7isMatchPcS_Pii
	.type	_Z7isMatchPcS_Pii, @function
_Z7isMatchPcS_Pii:
.LFB2058:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z7isMatchPcS_PiiPcS_Pii
	.cfi_endproc
.LFE2058:
	.size	_Z7isMatchPcS_Pii, .-_Z7isMatchPcS_Pii
	.section	.rodata.str1.1
.LC4:
	.string	"-n"
.LC6:
	.string	"r"
.LC7:
	.string	"Not a Valid File\n"
.LC8:
	.string	"File Too Large\n"
.LC10:
	.string	"N: %d\n"
.LC11:
	.string	"Does not Match\n"
.LC12:
	.string	"Does Match\n"
.LC14:
	.string	"Encrypt Time:   %4.10f seconds\n"
.LC15:
	.string	"Decrypt Time:   %4.10f seconds\n"
.LC16:
	.string	"Match Time:     %4.10f seconds\n"
.LC17:
	.string	"Total Time:     %4.10f seconds\n\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-1048576(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$184, %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)
	xorl	%eax, %eax
	cmpl	$1, %edi
	jg	.L21
.L24:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L69
	call	_Z10printerrorv
.L21:
	movq	%rsi, %r12
	cmpl	$3, %edi
	jne	.L23
	movq	8(%rsi), %rdi
	leaq	.LC4(%rip), %rsi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L64
	jmp	.L24
.L23:
	movl	$20, %ebx
	cmpl	$2, %edi
	jne	.L28
	movq	8(%rsi), %rdi
	leaq	.LC6(%rip), %rsi
	xorl	%r12d, %r12d
	call	fopen@PLT
	leaq	.LC7(%rip), %rdx
	movq	%rax, %r13
	testq	%rax, %rax
	jne	.L29
	jmp	.L67
.L31:
	movb	%al, -1048632(%rbp,%r12)
	incq	%r12
.L29:
	movq	%r13, %rdi
	call	fgetc@PLT
	cmpb	$-1, %al
	je	.L70
	cmpq	$1048576, %r12
	jne	.L31
	leaq	.LC8(%rip), %rdx
.L67:
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	orl	$-1, %eax
	jmp	.L20
.L70:
	leal	1(%r12), %ebx
	movslq	%ebx, %rdi
	call	malloc@PLT
	leaq	-1048632(%rbp), %rsi
	leal	1(%r12), %ecx
	movq	%rax, %r14
	leaq	1(%rax), %rax
	movq	%rax, %rdi
	rep movsb
	movq	%r13, %rdi
	call	fclose@PLT
.L28:
	movslq	%ebx, %r12
	movq	%rsp, %rsi
	leaq	15(%r12), %rax
	movq	%rax, %rdi
	movq	%rax, %rcx
	andq	$-4096, %rdi
	andq	$-16, %rcx
	subq	%rdi, %rsi
.L34:
	cmpq	%rsi, %rsp
	je	.L35
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L34
.L35:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	je	.L36
	orq	$0, -8(%rsp,%rcx)
.L36:
	movq	%rax, %rdi
	movq	%rax, %rcx
	movq	%rsp, %rsi
	movq	%rsp, %r15
	andq	$-4096, %rdi
	andq	$-16, %rcx
	subq	%rdi, %rsi
.L37:
	cmpq	%rsi, %rsp
	je	.L38
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L37
.L38:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	je	.L39
	orq	$0, -8(%rsp,%rcx)
.L39:
	movq	%rsp, -1048792(%rbp)
	movq	%rax, %rcx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	andq	$-16, %rcx
	subq	%rax, %rsi
.L40:
	cmpq	%rsi, %rsp
	je	.L41
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L40
.L41:
	movq	%rcx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L42
	orq	$0, -8(%rsp,%rax)
.L42:
	movq	%rsp, %r13
	xorl	%eax, %eax
.L43:
	cmpl	%eax, %ebx
	jle	.L71
	movb	(%r14,%rax), %cl
	movq	-1048792(%rbp), %rdx
	movb	$32, 0(%r13,%rax)
	movb	%cl, (%r15,%rax)
	movb	$32, (%rdx,%rax)
	incq	%rax
	jmp	.L43
.L71:
	xorl	%eax, %eax
	leaq	-1048720(%rbp), %rdi
	movl	%eax, -1048772(%rbp)
	call	cudaEventCreate@PLT
	leaq	-1048688(%rbp), %rdi
	call	cudaEventCreate@PLT
	leaq	-1048712(%rbp), %rdi
	call	cudaEventCreate@PLT
	leaq	-1048680(%rbp), %rdi
	call	cudaEventCreate@PLT
	leaq	-1048704(%rbp), %rdi
	call	cudaEventCreate@PLT
	leaq	-1048672(%rbp), %rdi
	call	cudaEventCreate@PLT
	leaq	-1048696(%rbp), %rdi
	call	cudaEventCreate@PLT
	leaq	-1048664(%rbp), %rdi
	call	cudaEventCreate@PLT
	movl	$4, %edi
	movl	$0x00000000, -1048768(%rbp)
	movl	$0x00000000, -1048764(%rbp)
	movl	$0x00000000, -1048760(%rbp)
	movl	$0x00000000, -1048756(%rbp)
	call	malloc@PLT
	xorl	%edx, %edx
	leaq	-1048752(%rbp), %rdi
	movq	%r12, %rsi
	movl	%edx, (%rax)
	movq	%rax, -1048728(%rbp)
	call	cudaMalloc@PLT
	leaq	-1048744(%rbp), %rdi
	movq	%r12, %rsi
	call	cudaMalloc@PLT
	leaq	-1048736(%rbp), %rdi
	movq	%r12, %rsi
	call	cudaMalloc@PLT
	leaq	-1048728(%rbp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	movl	%ebx, %edx
	leaq	.LC10(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	$1, %ecx
	movq	%r12, %rdx
	movq	%r15, %rsi
	movq	-1048752(%rbp), %rdi
	call	cudaMemcpy@PLT
	movq	-1048792(%rbp), %rsi
	movl	$1, %ecx
	movq	%r12, %rdx
	movq	-1048744(%rbp), %rdi
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movq	%r12, %rdx
	movq	%r13, %rsi
	movq	-1048736(%rbp), %rdi
	call	cudaMemcpy@PLT
	movq	-1048696(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	-1048720(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	$33554433, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$7, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movl	$1, -1048636(%rbp)
	movq	%rdi, %rdx
	movq	%rdi, -1048644(%rbp)
	movq	%rdi, -1048656(%rbp)
	movl	$1, -1048648(%rbp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L45
	movq	-1048744(%rbp), %rsi
	movq	-1048752(%rbp), %rdi
	movl	%ebx, %r8d
	movl	$55, %ecx
	movl	$171, %edx
	call	_Z31__device_stub__Z7encryptPcS_iiiPcS_iii
.L45:
	movq	-1048688(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	-1048744(%rbp), %rsi
	movl	$2, %ecx
	movq	%r12, %rdx
	movq	-1048792(%rbp), %rdi
	call	cudaMemcpy@PLT
	movq	-1048688(%rbp), %rdi
	call	cudaEventSynchronize@PLT
	movq	-1048688(%rbp), %rdx
	movq	-1048720(%rbp), %rsi
	leaq	-1048768(%rbp), %rdi
	call	cudaEventElapsedTime@PLT
	movq	-1048680(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	$33554433, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$7, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movl	$1, -1048636(%rbp)
	movq	%rdi, %rdx
	movq	%rdi, -1048644(%rbp)
	movq	%rdi, -1048656(%rbp)
	movl	$1, -1048648(%rbp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L46
	movq	-1048736(%rbp), %rsi
	movq	-1048744(%rbp), %rdi
	movl	%ebx, %r8d
	movl	$91, %ecx
	movl	$3, %edx
	call	_Z31__device_stub__Z7decryptPcS_iiiPcS_iii
.L46:
	movq	-1048680(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	$2, %ecx
	movq	%r12, %rdx
	movq	%r13, %rdi
	movq	-1048736(%rbp), %rsi
	call	cudaMemcpy@PLT
	movq	-1048680(%rbp), %rdi
	call	cudaEventSynchronize@PLT
	movq	-1048680(%rbp), %rdx
	movq	-1048712(%rbp), %rsi
	leaq	-1048764(%rbp), %rdi
	call	cudaEventElapsedTime@PLT
	movq	-1048704(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	$33554433, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$7, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movl	$1, -1048636(%rbp)
	movq	%rdi, %rdx
	movq	%rdi, -1048644(%rbp)
	movq	%rdi, -1048656(%rbp)
	movl	$1, -1048648(%rbp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L47
	movq	-1048728(%rbp), %rdx
	movq	-1048752(%rbp), %rsi
	movl	%ebx, %ecx
	movq	-1048736(%rbp), %rdi
	call	_Z31__device_stub__Z7isMatchPcS_PiiPcS_Pii
.L47:
	movq	-1048672(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	$4, %edx
	movl	$2, %ecx
	movq	-1048728(%rbp), %rsi
	leaq	-1048772(%rbp), %rdi
	call	cudaMemcpy@PLT
	cmpl	$0, -1048772(%rbp)
	movq	stdout(%rip), %rdi
	leaq	.LC11(%rip), %rdx
	jne	.L68
	leaq	.LC12(%rip), %rdx
.L68:
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	-1048672(%rbp), %rdi
	call	cudaEventSynchronize@PLT
	movq	-1048672(%rbp), %rdx
	movq	-1048704(%rbp), %rsi
	leaq	-1048760(%rbp), %rdi
	call	cudaEventElapsedTime@PLT
	movq	-1048664(%rbp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	-1048664(%rbp), %rdi
	call	cudaEventSynchronize@PLT
	movq	-1048664(%rbp), %rdx
	movq	-1048696(%rbp), %rsi
	leaq	-1048756(%rbp), %rdi
	call	cudaEventElapsedTime@PLT
	leaq	.LC14(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	movss	-1048768(%rbp), %xmm0
	divss	.LC13(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	leaq	.LC15(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	movss	-1048764(%rbp), %xmm0
	divss	.LC13(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	leaq	.LC16(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	movss	-1048760(%rbp), %xmm0
	divss	.LC13(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	leaq	.LC17(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	movss	-1048756(%rbp), %xmm0
	divss	.LC13(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	movq	-1048752(%rbp), %rdi
	call	cudaFree@PLT
	movq	-1048744(%rbp), %rdi
	call	cudaFree@PLT
	movq	-1048736(%rbp), %rdi
	call	cudaFree@PLT
	xorl	%eax, %eax
	jmp	.L20
.L64:
	movq	16(%r12), %rdi
	movl	$10, %edx
	xorl	%esi, %esi
	call	__isoc23_strtol@PLT
	leal	-1(%rax), %edx
	cmpl	$19, %edx
	ja	.L24
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC5(%rip), %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %ebx
	movslq	%ebx, %rdi
	call	malloc@PLT
	movq	%rax, %r14
	xorl	%eax, %eax
.L26:
	cmpl	%eax, %ebx
	jle	.L28
	movb	$48, (%r14,%rax)
	incq	%rax
	jmp	.L26
.L20:
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L51
.L69:
	call	__stack_chk_fail@PLT
.L51:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2028:
	.size	main, .-main
	.section	.rodata.str1.1
.LC18:
	.string	"_Z7isMatchPcS_Pii"
.LC19:
	.string	"_Z7decryptPcS_iii"
.LC20:
	.string	"_Z7encryptPcS_iii"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2060:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -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	.LC18(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z7isMatchPcS_Pii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC19(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z7decryptPcS_iii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC20(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z7encryptPcS_iii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	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	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2060:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.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
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC5:
	.long	0
	.long	1073741824
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC13:
	.long	1148846080
	.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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <hip/hip_runtime.h>

/**
 * Encrypt Program Cuda
 *
 * This program encrypts a file using a degree 2 formula using Cuda
 * Parallelization and then decrypts the file using another degree 2
 * formula.
 *
 * @Author: Clayton Chase Glenn
 */

#define MAX 20
#define DEBUG 0

/** Kernel Function
  * First finds the Thread ID within the block of GPU Threads
  * and if the Thread is Correct, it Encrypts the corresponding
  * Character in the String.
 **/
__global__
void encrypt(char *p, char *c, int a, int b, int n) {
  int tid = blockIdx.x * blockDim.x + threadIdx.x;
  if(tid < n) c[tid] = (a*p[tid] + b) % 256;
}

/** Kernel Function
  * First finds the Thread ID within the block of GPU Threads
  * and if the Thread is Correct, it Encrypts the corresponding
  * Character in the String.
 **/
__global__
void decrypt(char *p, char *c, int a, int b, int n) {
  int tid = blockIdx.x * blockDim.x + threadIdx.x;
  if(tid < n) c[tid] = (a*p[tid] + b) % 256;
}

/** Kernel Function
  * First finds the Thread ID within the block of GPU Threads
  * and if the Thread is Correct, it checks if the corresponding
  * character in array a matches b.
 **/
__global__
void isMatch(char *p, char *c, int *a, int n) {
  int tid = blockIdx.x * blockDim.x + threadIdx.x;
  if(tid < n) {
    if (c[tid] != p[tid]) {
      *a = 1;
    }
  }
}

/**
  * Helper Function
  * Prints an string to standard error showing help
  * for valid arguments in the executable
 **/
void printerror(){
  fprintf(stderr, "Invalid Arguments\n");
  fprintf(stderr, "Correct Form: ./encrypt [File to Encrypt]\n");
  fprintf(stderr, "              or\n");
  fprintf(stderr, "              ./encrypt -n [2^(1:20)]\n");
  exit(0);
}
/**
  * Main Program
  * This Program is for Homework 6 to encrypt some text or show
  * the encryption method of text that is 2 to the power of N
  * characters long all initialized to zero.
 **/
int main(int argc, char **argv) {

  // Declare a buffer of max size to start
  int     N = MAX;
  char *buf;

  // Check for immediate errors in args
  if (argc < 2)                           printerror();
  if (argc == 3 && strcmp(argv[1], "-n")) printerror();

  // If args match for testing, Initiallize the program
  if(!strcmp(argv[1], "-n") && argc == 3){

    // Get total characters from args
    N = strtol(argv[2], NULL, 10);

    // Show error if N isn't within constraints
    if(N < 1 || N > 20) printerror();

    // N <- calc to 2^N as size and allocate space
    N   = (int)pow(2, N);
    buf = (char*)malloc(N*sizeof(char));

    //Initiallize the buffer to Zero
    int i = 0;
    while (i < N) buf[i++] = 48;
  }

  // If 2 args, this means file
  if(argc == 2) {

    // Declare a file pointer, character array, and single character for reading
    FILE *fp;
    char c;
    char chars[1048576];
    int i = 0;

    // Open the file for reading
    fp = fopen(argv[1], "r");

    // If file is null, file does not exist or error
    if (fp == NULL) {
      fprintf(stderr, "Not a Valid File\n");
      return (-1);
    }

    // Read each character and keep within 2^20, add to array
    while((c = fgetc(fp)) != EOF) {
      if (i >= 1048576) {
        fprintf(stderr, "File Too Large\n");
        return (-1);
      }
      chars[i++] = c;
    }

    // Increment i for space and allocate space for buffer
    N = i + 1;
    buf = (char*)malloc(N*sizeof(char));

    // Copy read elements into buffer
    i = 0;
    while(i < N) buf[i] = chars[i++];

    // Close File, not needed anymore
    fclose(fp);
  }

  // Initiallize Character Arrays for Encrypting and manual memset
  char h_p[N];
  char h_c[N];
  char h_r[N];
  int i = 0;
  while (i < N) {
    h_p[i] = buf[i];
    h_c[i] = 32;
    h_r[i++] = 32;
  }

  // Init all other variables
  char *dev_p, *dev_c, *dev_r;
  int *match;
  int h_match = 0;
  int h_a = 171, h_b = 55;
  int r_a = 3,   r_b = 91;
  hipEvent_t start1, start2, start3, startf, stop1, stop2, stop3, stopf;
  hipEventCreate(&start1);
  hipEventCreate(&stop1);
  hipEventCreate(&start2);
  hipEventCreate(&stop2);
  hipEventCreate(&start3);
  hipEventCreate(&stop3);
  hipEventCreate(&startf);
  hipEventCreate(&stopf);
  float final_time1 = 0.0, final_time2 = 0.0, final_time3 = 0.0, final_timef = 0.0;

  // Allocate Memory for match flag
  match = (int*)malloc(sizeof(int));
  *match = 0;

  // Allocate memory in the GPU for the character arrays
  hipMalloc(&dev_p, N*sizeof(char));
  hipMalloc(&dev_c, N*sizeof(char));
  hipMalloc(&dev_r, N*sizeof(char));
  hipMalloc(&match, sizeof(int));

  // Print N for distinguish
  printf("N: %d\n", N);

  // If debug on, show plain text
  if(DEBUG) {
    printf("Plain Text:     ");
    i = 0;
    while(i < N) printf("%c", h_p[i++]);
    printf("\n");
  }

  // Copy the Memory from the arrays to the array pointers
  hipMemcpy(dev_p, h_p, N*sizeof(char), hipMemcpyHostToDevice);
  hipMemcpy(dev_c, h_c, N*sizeof(char), hipMemcpyHostToDevice);
  hipMemcpy(dev_r, h_r, N*sizeof(char), hipMemcpyHostToDevice);

  // Start Total Time Record
  hipEventRecord(startf);

  // Encrypt the Plain Text and Record Start and Finish
  hipEventRecord(start1);
  encrypt<<<128, 128>>>(dev_p, dev_c, h_a, h_b, N);
  hipEventRecord(stop1);

  // Copy the results from GPU to the CPU
  hipMemcpy(h_c, dev_c, N*sizeof(char), hipMemcpyDeviceToHost);

  // If debug on, show encrypted text
  if(DEBUG) {
    printf("Encrypted Text: ");
    i = 0;
    while(i < N) printf("%c", h_c[i++]);
    printf("\n");
  }

  // Syncronize all blocks and threads in GPU and get time
  hipEventSynchronize(stop1);
  hipEventElapsedTime(&final_time1, start1, stop1);

  // Decrypt the Encrypted Text
  hipEventRecord(stop2);
  decrypt<<<128, 128>>>(dev_c, dev_r, r_a, r_b, N);
  hipEventRecord(stop2);

  // Copy the results from GPU to CPU
  hipMemcpy(h_r, dev_r, N*sizeof(char), hipMemcpyDeviceToHost);

  // If debug on, show decrypted text
  if(DEBUG) {
    printf("Decrypted Text: ", h_r);
    i = 0;
    while(i < N) printf("%c", h_r[i++]);
    printf("\n");
  }

  // Syncronize all blocks and threads in GPU and get time
  hipEventSynchronize(stop2);
  hipEventElapsedTime(&final_time2, start2, stop2);

  // Check if Plain Text and Encrypt<-->Decrypt Text is matching by GPU
  hipEventRecord(start3);
  isMatch<<<128, 128>>>(dev_r, dev_p, match, N);
  hipEventRecord(stop3);

  // Copy the Match Result from GPU to CPU
  hipMemcpy(&h_match, match, sizeof(int), hipMemcpyDeviceToHost);

  // If match is zero, success, else, no success
  if (h_match) fprintf(stdout, "Does not Match\n");
  else         fprintf(stdout, "Does Match\n");

  // Syncronize all blocks and threads in GPU and get time
  hipEventSynchronize(stop3);
  hipEventElapsedTime(&final_time3, start3, stop3);

  // Syncronize all blocks and threads in GPU and get time
  hipEventRecord(stopf);
  hipEventSynchronize(stopf);
  hipEventElapsedTime(&final_timef, startf, stopf);

  // Print Times
  printf("Encrypt Time:   %4.10f seconds\n",   final_time1/1000);
  printf("Decrypt Time:   %4.10f seconds\n",   final_time2/1000);
  printf("Match Time:     %4.10f seconds\n",   final_time3/1000);
  printf("Total Time:     %4.10f seconds\n\n", final_timef/1000);

  // Free the GPU memory
  hipFree(dev_p);
  hipFree(dev_c);
  hipFree(dev_r);
}

	.text
	.file	"Encrypt_CUDA.hip"
	.globl	_Z22__device_stub__encryptPcS_iii # -- Begin function _Z22__device_stub__encryptPcS_iii
	.type	_Z22__device_stub__encryptPcS_iii,@function
_Z22__device_stub__encryptPcS_iii:      # @_Z22__device_stub__encryptPcS_iii
	.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	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	4(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%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	$_Z7encryptPcS_iii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	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_end0:
	.size	_Z22__device_stub__encryptPcS_iii, .Lfunc_end0-_Z22__device_stub__encryptPcS_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__decryptPcS_iii # -- Begin function _Z22__device_stub__decryptPcS_iii
	.type	_Z22__device_stub__decryptPcS_iii,@function
_Z22__device_stub__decryptPcS_iii:      # @_Z22__device_stub__decryptPcS_iii
	.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	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	4(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%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	$_Z7decryptPcS_iii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	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	_Z22__device_stub__decryptPcS_iii, .Lfunc_end1-_Z22__device_stub__decryptPcS_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__isMatchPcS_Pii # -- Begin function _Z22__device_stub__isMatchPcS_Pii
	.type	_Z22__device_stub__isMatchPcS_Pii,@function
_Z22__device_stub__isMatchPcS_Pii:      # @_Z22__device_stub__isMatchPcS_Pii
	.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	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	4(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%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	$_Z7isMatchPcS_Pii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	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_end2:
	.size	_Z22__device_stub__isMatchPcS_Pii, .Lfunc_end2-_Z22__device_stub__isMatchPcS_Pii
	.cfi_endproc
                                        # -- End function
	.globl	_Z10printerrorv                 # -- Begin function _Z10printerrorv
	.type	_Z10printerrorv,@function
_Z10printerrorv:                        # @_Z10printerrorv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	stderr(%rip), %rcx
	movl	$.L.str, %edi
	movl	$18, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movq	stderr(%rip), %rcx
	movl	$.L.str.1, %edi
	movl	$42, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movq	stderr(%rip), %rcx
	movl	$.L.str.2, %edi
	movl	$17, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movq	stderr(%rip), %rcx
	movl	$.L.str.3, %edi
	movl	$38, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	xorl	%edi, %edi
	callq	exit
.Lfunc_end3:
	.size	_Z10printerrorv, .Lfunc_end3-_Z10printerrorv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI4_0:
	.quad	0x3ff0000000000000              # double 1
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI4_1:
	.long	0x447a0000                      # float 1000
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$1048712, %rsp                  # imm = 0x100088
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$1, %edi
	jle	.LBB4_36
# %bb.1:
	movq	%rsi, %rbx
	movl	%edi, %r14d
	cmpl	$3, %edi
	jne	.LBB4_9
# %bb.2:
	movq	8(%rbx), %r15
	movl	$.L.str.4, %esi
	movq	%r15, %rdi
	callq	strcmp
	testl	%eax, %eax
	jne	.LBB4_36
# %bb.3:
	movl	$.L.str.4, %esi
	movq	%r15, %rdi
	callq	strcmp
	movl	$20, %ecx
	cmpl	$3, %r14d
	jne	.LBB4_11
# %bb.4:
                                        # implicit-def: $r13
	testl	%eax, %eax
	jne	.LBB4_12
# %bb.5:
	movq	16(%rbx), %rdi
	xorl	%esi, %esi
	movl	$10, %edx
	callq	__isoc23_strtol
	leal	-21(%rax), %ecx
	cmpl	$-21, %ecx
	jbe	.LBB4_36
# %bb.6:
	movsd	.LCPI4_0(%rip), %xmm0           # xmm0 = mem[0],zero
	movl	%eax, %edi
	callq	ldexp@PLT
	cvttsd2si	%xmm0, %r14d
	movslq	%r14d, %rbx
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, %r13
	testl	%ebx, %ebx
	jle	.LBB4_7
# %bb.8:                                # %.lr.ph.preheader
	movl	%r14d, %edx
	movq	%r13, %rdi
	movl	$48, %esi
	callq	memset@PLT
.LBB4_7:
	movl	%r14d, %ecx
	jmp	.LBB4_12
.LBB4_9:                                # %.loopexit
	cmpl	$2, %r14d
	jne	.LBB4_10
# %bb.13:
	movq	8(%rbx), %rdi
	movl	$.L.str.5, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB4_18
# %bb.14:                               # %.preheader
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	fgetc
	xorl	%r15d, %r15d
	cmpb	$-1, %al
	je	.LBB4_21
# %bb.15:                               # %.lr.ph114.preheader
	xorl	%r15d, %r15d
.LBB4_16:                               # %.lr.ph114
                                        # =>This Inner Loop Header: Depth=1
	cmpq	$1048576, %r15                  # imm = 0x100000
	je	.LBB4_17
# %bb.20:                               #   in Loop: Header=BB4_16 Depth=1
	movb	%al, -1048752(%rbp,%r15)
	incq	%r15
	movq	%r14, %rdi
	callq	fgetc
	cmpb	$-1, %al
	jne	.LBB4_16
.LBB4_21:                               # %._crit_edge
	leal	1(%r15), %ebx
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, %r13
	leaq	1(%rax), %rdi
	movl	%r15d, %edx
	incq	%rdx
	leaq	-1048752(%rbp), %rsi
	callq	memcpy@PLT
	movq	%r14, %rdi
	callq	fclose
	movl	%ebx, %ecx
	jmp	.LBB4_22
.LBB4_10:
	movl	$20, %ecx
.LBB4_11:                               # %.loopexit._crit_edge
                                        # implicit-def: $r13
.LBB4_12:                               # %.loopexit._crit_edge
	movl	%ecx, %ebx
.LBB4_22:
	movq	%rsp, -160(%rbp)                # 8-byte Spill
	movq	%rsp, %r14
	leaq	15(%rbx), %rax
	andq	$-16, %rax
	subq	%rax, %r14
	movq	%r14, %rsp
	movq	%rsp, %r12
	subq	%rax, %r12
	movq	%r12, %rsp
	movq	%rsp, %r15
	subq	%rax, %r15
	movq	%r15, %rsp
	movl	%ecx, -44(%rbp)                 # 4-byte Spill
	testl	%ecx, %ecx
	jle	.LBB4_25
# %bb.23:                               # %.lr.ph118.preheader
	xorl	%eax, %eax
	movb	$32, %cl
.LBB4_24:                               # %.lr.ph118
                                        # =>This Inner Loop Header: Depth=1
	movb	(%r13,%rax), %dl
	movb	%dl, (%r14,%rax)
	movb	%cl, (%r12,%rax)
	movb	%cl, (%r15,%rax)
	incq	%rax
	cmpq	%rax, %rbx
	jne	.LBB4_24
.LBB4_25:                               # %._crit_edge119
	xorl	%r13d, %r13d
	movl	%r13d, -124(%rbp)
	leaq	-152(%rbp), %rdi
	callq	hipEventCreate
	leaq	-104(%rbp), %rdi
	callq	hipEventCreate
	leaq	-168(%rbp), %rdi
	callq	hipEventCreate
	leaq	-80(%rbp), %rdi
	callq	hipEventCreate
	leaq	-144(%rbp), %rdi
	callq	hipEventCreate
	leaq	-96(%rbp), %rdi
	callq	hipEventCreate
	leaq	-136(%rbp), %rdi
	callq	hipEventCreate
	leaq	-88(%rbp), %rdi
	callq	hipEventCreate
	movl	%r13d, -72(%rbp)
	movl	%r13d, -68(%rbp)
	movl	%r13d, -120(%rbp)
	movl	%r13d, -116(%rbp)
	movl	$4, %edi
	callq	malloc
	leaq	-112(%rbp), %rcx
	movq	%rax, (%rcx)
	movl	%r13d, (%rax)
	movl	-44(%rbp), %ebx                 # 4-byte Reload
	movslq	%ebx, %r13
	leaq	-1048752(%rbp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	leaq	-64(%rbp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	leaq	-56(%rbp), %rdi
	movq	%r13, %rsi
	callq	hipMalloc
	movl	$4, %esi
	leaq	-112(%rbp), %rdi
	callq	hipMalloc
	movl	$.L.str.8, %edi
	movl	%ebx, %esi
	movabsq	$4294967424, %rbx               # imm = 0x100000080
	xorl	%eax, %eax
	callq	printf
	leaq	-1048752(%rbp), %rax
	movq	(%rax), %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	-64(%rbp), %rax
	movq	(%rax), %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	-56(%rbp), %rax
	movq	(%rax), %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	-136(%rbp), %rax
	movq	(%rax), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	leaq	-152(%rbp), %rax
	movq	(%rax), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_27
# %bb.26:
	movq	-1048752(%rbp), %rdi
	movq	-64(%rbp), %rsi
	movl	$171, %edx
	movl	$55, %ecx
	movl	-44(%rbp), %r8d                 # 4-byte Reload
	callq	_Z22__device_stub__encryptPcS_iii
.LBB4_27:
	movq	-104(%rbp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	-64(%rbp), %rsi
	movq	%r12, %rdi
	movq	%r13, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	-104(%rbp), %rdi
	callq	hipEventSynchronize
	movq	-152(%rbp), %rsi
	movq	-104(%rbp), %rdx
	leaq	-72(%rbp), %rdi
	callq	hipEventElapsedTime
	movq	-80(%rbp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_29
# %bb.28:
	movq	-64(%rbp), %rdi
	movq	-56(%rbp), %rsi
	movl	$3, %edx
	movl	$91, %ecx
	movl	-44(%rbp), %r8d                 # 4-byte Reload
	callq	_Z22__device_stub__decryptPcS_iii
.LBB4_29:
	movq	-80(%rbp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	-56(%rbp), %rsi
	movq	%r15, %rdi
	movq	%r13, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	-80(%rbp), %rdi
	callq	hipEventSynchronize
	movq	-168(%rbp), %rsi
	movq	-80(%rbp), %rdx
	leaq	-68(%rbp), %rdi
	callq	hipEventElapsedTime
	movq	-144(%rbp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_31
# %bb.30:
	movq	-56(%rbp), %rdi
	movq	-1048752(%rbp), %rsi
	movq	-112(%rbp), %rdx
	movl	-44(%rbp), %ecx                 # 4-byte Reload
	callq	_Z22__device_stub__isMatchPcS_Pii
.LBB4_31:
	movq	-96(%rbp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	-112(%rbp), %rsi
	leaq	-124(%rbp), %rbx
	movl	$4, %edx
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	cmpl	$0, (%rbx)
	movq	stdout(%rip), %rcx
	je	.LBB4_33
# %bb.32:
	movl	$.L.str.9, %edi
	movl	$15, %esi
	jmp	.LBB4_34
.LBB4_33:
	movl	$.L.str.10, %edi
	movl	$11, %esi
.LBB4_34:
	movl	$1, %edx
	callq	fwrite@PLT
	movq	-96(%rbp), %rdi
	callq	hipEventSynchronize
	movq	-144(%rbp), %rsi
	movq	-96(%rbp), %rdx
	leaq	-120(%rbp), %r14
	movq	%r14, %rdi
	callq	hipEventElapsedTime
	movq	-88(%rbp), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	-88(%rbp), %rdi
	callq	hipEventSynchronize
	movq	-136(%rbp), %rsi
	movq	-88(%rbp), %rdx
	leaq	-116(%rbp), %r15
	movq	%r15, %rdi
	callq	hipEventElapsedTime
	movss	-72(%rbp), %xmm0                # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI4_1(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.11, %edi
	movb	$1, %al
	callq	printf
	movss	-68(%rbp), %xmm0                # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI4_1(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.12, %edi
	movb	$1, %al
	callq	printf
	movss	(%r14), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI4_1(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.13, %edi
	movb	$1, %al
	callq	printf
	movss	(%r15), %xmm0                   # xmm0 = mem[0],zero,zero,zero
	divss	.LCPI4_1(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.14, %edi
	movb	$1, %al
	callq	printf
	movq	-1048752(%rbp), %rdi
	callq	hipFree
	movq	-64(%rbp), %rdi
	callq	hipFree
	movq	-56(%rbp), %rdi
	callq	hipFree
	movq	-160(%rbp), %rsp                # 8-byte Reload
.LBB4_35:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.LBB4_18:
	.cfi_def_cfa %rbp, 16
	movq	stderr(%rip), %rcx
	movl	$.L.str.6, %edi
	movl	$17, %esi
	jmp	.LBB4_19
.LBB4_17:
	movq	stderr(%rip), %rcx
	movl	$.L.str.7, %edi
	movl	$15, %esi
.LBB4_19:                               # %.thread104
	movl	$1, %edx
	callq	fwrite@PLT
	movl	$-1, %ebx
	jmp	.LBB4_35
.LBB4_36:                               # %.thread
	callq	_Z10printerrorv
.Lfunc_end4:
	.size	main, .Lfunc_end4-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB5_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB5_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7encryptPcS_iii, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7decryptPcS_iii, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7isMatchPcS_Pii, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end5:
	.size	__hip_module_ctor, .Lfunc_end5-__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	.LBB6_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
.LBB6_2:
	retq
.Lfunc_end6:
	.size	__hip_module_dtor, .Lfunc_end6-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z7encryptPcS_iii,@object       # @_Z7encryptPcS_iii
	.section	.rodata,"a",@progbits
	.globl	_Z7encryptPcS_iii
	.p2align	3, 0x0
_Z7encryptPcS_iii:
	.quad	_Z22__device_stub__encryptPcS_iii
	.size	_Z7encryptPcS_iii, 8

	.type	_Z7decryptPcS_iii,@object       # @_Z7decryptPcS_iii
	.globl	_Z7decryptPcS_iii
	.p2align	3, 0x0
_Z7decryptPcS_iii:
	.quad	_Z22__device_stub__decryptPcS_iii
	.size	_Z7decryptPcS_iii, 8

	.type	_Z7isMatchPcS_Pii,@object       # @_Z7isMatchPcS_Pii
	.globl	_Z7isMatchPcS_Pii
	.p2align	3, 0x0
_Z7isMatchPcS_Pii:
	.quad	_Z22__device_stub__isMatchPcS_Pii
	.size	_Z7isMatchPcS_Pii, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Invalid Arguments\n"
	.size	.L.str, 19

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Correct Form: ./encrypt [File to Encrypt]\n"
	.size	.L.str.1, 43

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"              or\n"
	.size	.L.str.2, 18

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"              ./encrypt -n [2^(1:20)]\n"
	.size	.L.str.3, 39

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"-n"
	.size	.L.str.4, 3

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"r"
	.size	.L.str.5, 2

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Not a Valid File\n"
	.size	.L.str.6, 18

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"File Too Large\n"
	.size	.L.str.7, 16

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"N: %d\n"
	.size	.L.str.8, 7

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Does not Match\n"
	.size	.L.str.9, 16

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Does Match\n"
	.size	.L.str.10, 12

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"Encrypt Time:   %4.10f seconds\n"
	.size	.L.str.11, 32

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Decrypt Time:   %4.10f seconds\n"
	.size	.L.str.12, 32

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"Match Time:     %4.10f seconds\n"
	.size	.L.str.13, 32

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"Total Time:     %4.10f seconds\n\n"
	.size	.L.str.14, 33

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z7encryptPcS_iii"
	.size	.L__unnamed_1, 18

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z7decryptPcS_iii"
	.size	.L__unnamed_2, 18

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z7isMatchPcS_Pii"
	.size	.L__unnamed_3, 18

	.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 _Z22__device_stub__encryptPcS_iii
	.addrsig_sym _Z22__device_stub__decryptPcS_iii
	.addrsig_sym _Z22__device_stub__isMatchPcS_Pii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z7encryptPcS_iii
	.addrsig_sym _Z7decryptPcS_iii
	.addrsig_sym _Z7isMatchPcS_Pii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z7encryptPcS_iii       ; -- Begin function _Z7encryptPcS_iii
	.globl	_Z7encryptPcS_iii
	.p2align	8
	.type	_Z7encryptPcS_iii,@function
_Z7encryptPcS_iii:                      ; @_Z7encryptPcS_iii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b128 s[4:7], s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s6, v1
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b128 s[0:3], s[0:1], 0x0
	v_ashrrev_i32_e32 v4, 31, v1
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s0, v1
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v4, vcc_lo
	s_mov_b32 s0, s5
	global_load_u8 v0, v[2:3], off
	s_waitcnt vmcnt(0)
	v_mad_u64_u32 v[2:3], null, v0, s4, s[0:1]
	v_add_co_u32 v0, vcc_lo, s2, v1
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v4, vcc_lo
	global_store_b8 v[0:1], v2, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7encryptPcS_iii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 5
		.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	_Z7encryptPcS_iii, .Lfunc_end0-_Z7encryptPcS_iii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 148
; NumSgprs: 18
; NumVgprs: 5
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 5
; Occupancy: 16
; WaveLimiterHint : 0
; 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
	.protected	_Z7decryptPcS_iii       ; -- Begin function _Z7decryptPcS_iii
	.globl	_Z7decryptPcS_iii
	.p2align	8
	.type	_Z7decryptPcS_iii,@function
_Z7decryptPcS_iii:                      ; @_Z7decryptPcS_iii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b128 s[4:7], s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s6, v1
	s_cbranch_execz .LBB1_2
; %bb.1:
	s_load_b128 s[0:3], s[0:1], 0x0
	v_ashrrev_i32_e32 v4, 31, v1
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s0, v1
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v4, vcc_lo
	s_mov_b32 s0, s5
	global_load_u8 v0, v[2:3], off
	s_waitcnt vmcnt(0)
	v_mad_u64_u32 v[2:3], null, v0, s4, s[0:1]
	v_add_co_u32 v0, vcc_lo, s2, v1
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v4, vcc_lo
	global_store_b8 v[0:1], v2, off
.LBB1_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7decryptPcS_iii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 5
		.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_end1:
	.size	_Z7decryptPcS_iii, .Lfunc_end1-_Z7decryptPcS_iii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 148
; NumSgprs: 18
; NumVgprs: 5
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 5
; Occupancy: 16
; WaveLimiterHint : 0
; 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
	.protected	_Z7isMatchPcS_Pii       ; -- Begin function _Z7isMatchPcS_Pii
	.globl	_Z7isMatchPcS_Pii
	.p2align	8
	.type	_Z7isMatchPcS_Pii,@function
_Z7isMatchPcS_Pii:                      ; @_Z7isMatchPcS_Pii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b32 s3, s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB2_3
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x0
	v_ashrrev_i32_e32 v4, 31, v1
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s6, v1
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s7, v4, vcc_lo
	v_add_co_u32 v0, vcc_lo, s4, v1
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v4, vcc_lo
	global_load_u8 v2, v[2:3], off
	global_load_u8 v0, v[0:1], off
	s_waitcnt vmcnt(0)
	v_cmp_ne_u16_e32 vcc_lo, v2, v0
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB2_3
; %bb.2:
	s_load_b64 s[0:1], s[0:1], 0x10
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 1
	s_waitcnt lgkmcnt(0)
	global_store_b32 v0, v1, s[0:1]
.LBB2_3:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7isMatchPcS_Pii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 5
		.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_end2:
	.size	_Z7isMatchPcS_Pii, .Lfunc_end2-_Z7isMatchPcS_Pii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 176
; NumSgprs: 18
; NumVgprs: 5
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 5
; Occupancy: 16
; WaveLimiterHint : 0
; 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:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z7encryptPcS_iii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z7encryptPcS_iii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     5
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z7decryptPcS_iii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z7decryptPcS_iii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     5
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z7isMatchPcS_Pii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z7isMatchPcS_Pii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     5
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
