#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <sys/time.h>

typedef int32_t Int;


#define NUM_BYTES(n) ((n) * (sizeof(Int)))

__global__ void compressedRow(Int* matrix, Int* rowIndex, Int* nums, Int* cols, Int* rows, Int width) {
	Int* row = ((matrix + (blockIdx.x * width)));
	Int offset = *(rowIndex + blockIdx.x);

	Int i = 0;
	for (; i < width; i++) {
		if (*(row + i) != 0) {
			*(nums + offset) = *(row + i);
			*(cols + offset) = i;
			*(rows + offset) = blockIdx.x;
			offset++;
		}
	}
}

__global__ void decompressRow(Int* matrix, Int* nums, Int* cols, Int* rows, Int count, Int width) {
	Int* row = ((matrix + (blockIdx.x * width)));
	Int i;

    *(row + threadIdx.x) = 0;
	for (i = 0; i < count; i++) {
		if (*(rows + i) == blockIdx.x) {
			if (*(cols + i) == threadIdx.x) {
				*(row + threadIdx.x) = *(nums + i);
			}
		}
	}

}

bool fileExists (char* name) {
   FILE* tmp   = fopen (name, "rb");
   bool exists = (tmp != NULL);
   if (tmp != NULL) fclose (tmp);
   return exists;
}

void compress(char* infile) {
	
	FILE* time_results = fopen("sectionResultsCompress.csv", "a+");
	struct timeval stop, start;

	gettimeofday(&start, NULL); //BEGIN READ-IN SECTION
	Int height, width;
	Int count = 0, rowCount = 0;
	Int i, j;
	Int temp;

	FILE* in = fopen(infile, "rb");

	Int result = fread((void*)&height, NUM_BYTES(1), 1, in);
	if (result != 1) {
		fprintf(stderr, "Reading Error\n");
		exit(1);
	}
	result = fread((void*)&width, NUM_BYTES(1), 1, in);
	if (result != 1) {
		fprintf(stderr, "Reading Error\n");
		exit(1);
	}
	Int rowIndex[height];
	Int* matrix = (Int*)malloc(NUM_BYTES(height * width));
	for (i = 0; i < height; i++) {

		if (i == 0)
			rowIndex[i] = 0;
		else 
			rowIndex[i] = rowIndex[i-1] + rowCount;
		rowCount = 0;

		for (j = 0; j < width; j++) {
			result = fread((void*)&temp, NUM_BYTES(1), 1, in);
			*(matrix + (i * width) + j) = temp;
			if (result != 1) {
				fprintf(stderr, "Reading Error\n");
				exit(1);
			}
			if (*(matrix + (i * width) + j) != 0) {
				count++;
				rowCount++;
			}
		}
	}
	fclose(in);
	
	gettimeofday(&stop, NULL); //END READ-IN SECTION
	long timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN CPU-TO-GPU SECTION
	Int* cRowIndex;
	Int* cnums;
	Int* nums;
	Int* cRow; 
	Int* row;
	Int* cCol; 
	Int* col;
	Int* cMatrix;
	//size_t pitch;

	//cudaError_t cerr;
	cudaMalloc((void**)&cRowIndex, NUM_BYTES(height));
	cudaMalloc((void**)&cnums, NUM_BYTES(count));
	cudaMalloc((void**)&cRow, NUM_BYTES(count));
	cudaMalloc((void**)&cCol, NUM_BYTES(count));
	//if (cerr != cudaSuccess)
	//	fprintf(stderr, "Error with cCol malloc: %s", cudaGetErrorString(cerr));
	//cudaMallocPitch((void**)&cMatrix, &pitch, (size_t)NUM_BYTES(width), (size_t)NUM_BYTES(height));
	cudaMalloc((void**)&cMatrix, NUM_BYTES(width * height));
	//if (cerr != cudaSuccess)
	//	fprintf(stderr, "Error with cCol malloc: %s", cudaGetErrorString(cerr));

	cudaMemcpy(cRowIndex, rowIndex, NUM_BYTES(height), cudaMemcpyHostToDevice);
	//cudaMemcpy2D((void*)cMatrix, pitch, matrix, NUM_BYTES(width), NUM_BYTES(width), NUM_BYTES(height), cudaMemcpyHostToDevice);
	cudaMemcpy(cMatrix, matrix, NUM_BYTES(width * height), cudaMemcpyHostToDevice);
	cudaDeviceSynchronize();

	gettimeofday(&stop, NULL); //END CPU-TO-GPU SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);\

	gettimeofday(&start, NULL); //BEGIN GPU-COMPRESSION SECTION
	compressedRow<<<height, 1>>>(cMatrix, cRowIndex, cnums, cCol, cRow, width);
	cudaDeviceSynchronize();
	gettimeofday(&stop, NULL); //END GPU-COMPRESSION SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN GPU-TO-CPU SECTION
	nums = (Int*)malloc(NUM_BYTES(count));
	row = (Int*)malloc(NUM_BYTES(count));
	col = (Int*)malloc(NUM_BYTES(count));

	cudaMemcpy(nums, cnums, NUM_BYTES(count), cudaMemcpyDeviceToHost);
	cudaMemcpy(col, cCol, NUM_BYTES(count), cudaMemcpyDeviceToHost);
	cudaMemcpy(row, cRow, NUM_BYTES(count), cudaMemcpyDeviceToHost);

	cudaFree(cRowIndex);
	cudaFree(cnums);
	cudaFree(cRow);
	cudaFree(cCol);	
	cudaFree(cMatrix);
	cudaDeviceSynchronize();

	gettimeofday(&stop, NULL); //END GPU-TO-CPU SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN WRITE-OUT SECTION
	char name[64];
	sprintf(name, "%s.crs", infile);
	FILE* file = fopen(name, "ab+");
	fwrite((void*)&height, NUM_BYTES(1), 1, file);
	fwrite((void*)&width, NUM_BYTES(1), 1, file);
	fwrite((void*)&count, NUM_BYTES(1), 1, file);

	fwrite((void*)&nums[0], NUM_BYTES(1), count, file);
	fwrite((void*)&col[0], NUM_BYTES(1), count, file);
	fwrite((void*)&row[0], NUM_BYTES(1), count, file);

	fclose(file);

	free(nums);
	free(row);
	free(col);
	free(matrix);
	gettimeofday(&stop, NULL); //END WRITE-OUT-SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li\n", timeMillies);
	fclose(time_results);	
}

void uncompress(char* infile) {

	FILE* time_results = fopen("sectionResultsUncompress.csv", "a+");

	struct timeval start, stop;

	gettimeofday(&start, NULL); //BEGIN READ-IN SECTION
	Int height, width;
	Int count = 0;
	Int i;
	Int temp;

	FILE* in = fopen(infile, "r");

	Int result = fread((void*)&height, NUM_BYTES(1), 1, in);
	if (result != 1) {
		fprintf(stderr, "Reading Error\n");
		exit(1);
	}
	result = fread((void*)&width, NUM_BYTES(1), 1, in);
	if (result != 1) {
		fprintf(stderr, "Reading Error\n");
		exit(1);
	}

	result = fread((void*)&count, NUM_BYTES(1), 1, in);
	if (result != 1) {
		fprintf(stderr, "Reading Error\n");
		exit(1);
	}
	Int nums[count];
	Int rows[count];
	Int cols[count];

	for (i = 0; i < count; i++) {
		result = fread((void*)&temp, NUM_BYTES(1), 1, in);
		nums[i] = temp;
		if (result != 1) {
			fprintf(stderr, "Reading Error\n");
			exit(1);
		}
	}
	for (i = 0; i < count; i++) {
		result = fread((void*)&temp, NUM_BYTES(1), 1, in);
		cols[i] = temp;
		if (result != 1) {
			fprintf(stderr, "Reading Error\n");
			exit(1);
		}
	}
	for (i = 0; i < count; i++) {
		result = fread((void*)&temp, NUM_BYTES(1), 1, in);
		rows[i] = temp;
		if (result != 1) {
			fprintf(stderr, "Reading Error\n");
			exit(1);
		}
	}
	fclose(in);

	gettimeofday(&stop, NULL); //END READ-IN SECTION
	long timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN CPU-TO-GPU SECTION
	Int* cNums;
	Int* cRows;
	Int* cCols;
	Int* matrix = (Int*)malloc(NUM_BYTES(height * width));
	Int* cMatrix;
	//size_t pitch;

	//cudaError_t cerr;
	cudaMalloc((void**)&cNums, NUM_BYTES(count));
	cudaMalloc((void**)&cRows, NUM_BYTES(count));
	cudaMalloc((void**)&cCols, NUM_BYTES(count));
	//cudaMallocPitch((void**)&cMatrix, &pitch, NUM_BYTES(width), NUM_BYTES(height));
	cudaMalloc((void**)&cMatrix, NUM_BYTES(width * height));

	cudaMemcpy(cNums, nums, NUM_BYTES(count), cudaMemcpyHostToDevice);
	cudaMemcpy(cCols, cols, NUM_BYTES(count), cudaMemcpyHostToDevice);
	cudaMemcpy(cRows, rows, NUM_BYTES(count), cudaMemcpyHostToDevice);
	cudaDeviceSynchronize();

	gettimeofday(&stop, NULL); //END CPU-TO-GPU SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN GPU-COMPRESSION SECTION

	decompressRow<<<height, width>>>(cMatrix, cNums, cCols, cRows, count, width);
	cudaDeviceSynchronize();

	gettimeofday(&stop, NULL); //END GPU-COMPRESSION SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN GPU-TO-CPU SECTION

	//cudaMemcpy2D((void*)matrix, NUM_BYTES(width), cMatrix, pitch, NUM_BYTES(width), NUM_BYTES(height), cudaMemcpyDeviceToHost);
	cudaMemcpy((void*)matrix, cMatrix, NUM_BYTES(width * height), cudaMemcpyDeviceToHost);
	//cudaMemcpy(row, cRow, NUM_BYTES(count), cudaMemcpyDeviceToHost);
	cudaFree(cNums);
	cudaFree(cRows);
	//if (cerr != cudaSuccess)
	//	fprintf(stderr, "Error with cRows free: %s\n", cudaGetErrorString(cerr));
	cudaFree(cCols);
	//if (cerr != cudaSuccess)
	//	fprintf(stderr, "Error with cCols free: %s\n", cudaGetErrorString(cerr));
	cudaFree(cMatrix);

	cudaDeviceSynchronize();

	gettimeofday(&stop, NULL); //END GPU-TO-CPU SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN WRITE-OUT SECTION

	char name[64];
	sprintf(name, "%s.out", infile);
	FILE* newfile = fopen(name, "ab+");
	fwrite((void*)&height, NUM_BYTES(1), 1, newfile);
	fwrite((void*)&width, NUM_BYTES(1), 1, newfile);

	//this section could be done without the nested fors, but I already got test results
	//for the end-to-end time tests, and I have to keep it this way for research integrity
	Int j;
	for (i = 0; i < height; i++) {
		for (j = 0; j < width; j++) {
			fwrite((void*)(matrix + (i * width) + j), NUM_BYTES(1), 1, newfile);
		}
	}
	fclose(newfile);
	//free(matrix);

	gettimeofday(&stop, NULL); //END WRITE-OUT-SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li\n", timeMillies);
	fclose(time_results);

}


int main(int argc, char* argv[]) {

	if (argc != 3 || (strcmp(argv[1], "-c") != 0 && strcmp(argv[1], "-u") != 0)) {
		fprintf(stderr, "Usage:\n%s -c filename ....... to compress\n%s -u filename ....... to uncompress\n", argv[0], argv[0]);
		exit(1);
	}
	else if (!fileExists(argv[2])) {
		fprintf(stderr, "File %s does not exist.\n", argv[2]);
		exit(1);
	}

	if (strcmp(argv[1], "-c") == 0) {
		compress(argv[2]);
	}
	else {
		uncompress(argv[2]);
	}


	exit(0);
}


	.file	"tmpxft_002d0bdd_00000000-6_compressesRowSteps.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2033:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2033:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"rb"
	.text
	.globl	_Z10fileExistsPc
	.type	_Z10fileExistsPc, @function
_Z10fileExistsPc:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rsi
	call	fopen@PLT
	testq	%rax, %rax
	setne	%bl
	je	.L2
	movq	%rax, %rdi
	call	fclose@PLT
.L2:
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z10fileExistsPc, .-_Z10fileExistsPc
	.globl	_Z42__device_stub__Z13compressedRowPiS_S_S_S_iPiS_S_S_S_i
	.type	_Z42__device_stub__Z13compressedRowPiS_S_S_S_iPiS_S_S_S_i, @function
_Z42__device_stub__Z13compressedRowPiS_S_S_S_iPiS_S_S_S_i:
.LFB2055:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movl	%r9d, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L9
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z13compressedRowPiS_S_S_S_i(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L9:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2055:
	.size	_Z42__device_stub__Z13compressedRowPiS_S_S_S_iPiS_S_S_S_i, .-_Z42__device_stub__Z13compressedRowPiS_S_S_S_iPiS_S_S_S_i
	.globl	_Z13compressedRowPiS_S_S_S_i
	.type	_Z13compressedRowPiS_S_S_S_i, @function
_Z13compressedRowPiS_S_S_S_i:
.LFB2056:
	.cfi_startproc
	endbr64
	jmp	_Z42__device_stub__Z13compressedRowPiS_S_S_S_iPiS_S_S_S_i
	.cfi_endproc
.LFE2056:
	.size	_Z13compressedRowPiS_S_S_S_i, .-_Z13compressedRowPiS_S_S_S_i
	.section	.rodata.str1.1
.LC1:
	.string	"a+"
.LC2:
	.string	"sectionResultsCompress.csv"
.LC3:
	.string	"Reading Error\n"
.LC4:
	.string	"%li,"
.LC5:
	.string	"%s.crs"
.LC6:
	.string	"ab+"
.LC7:
	.string	"%li\n"
	.text
	.globl	_Z8compressPc
	.type	_Z8compressPc, @function
_Z8compressPc:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC1(%rip), %rsi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$264, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%rdi, -280(%rbp)
	leaq	.LC2(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	fopen@PLT
	xorl	%esi, %esi
	movq	%rax, -248(%rbp)
	leaq	-136(%rbp), %rax
	movq	%rax, %rdi
	movq	%rax, -256(%rbp)
	call	gettimeofday@PLT
	movq	-280(%rbp), %rdi
	xorl	%edx, %edx
	leaq	.LC0(%rip), %rsi
	movl	%edx, -224(%rbp)
	call	fopen@PLT
	movl	$1, %ecx
	movl	$4, %edx
	movl	$4, %esi
	movq	%rax, -264(%rbp)
	leaq	-232(%rbp), %rax
	movq	-264(%rbp), %r8
	movq	%rax, %rdi
	movq	%rax, -288(%rbp)
	call	__fread_chk@PLT
	decl	%eax
	jne	.L38
	movl	$1, %ecx
	movl	$4, %edx
	movl	$4, %esi
	movq	-264(%rbp), %r8
	leaq	-228(%rbp), %rdi
	call	__fread_chk@PLT
	decl	%eax
	jne	.L38
	movslq	-232(%rbp), %rax
	movq	%rsp, %rcx
	leaq	15(,%rax,4), %rdx
	movq	%rax, %rdi
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L17:
	cmpq	%rcx, %rsp
	je	.L18
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L17
.L18:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L19
	orq	$0, -8(%rsp,%rax)
.L19:
	imull	-228(%rbp), %edi
	movq	%rsp, %r12
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, -272(%rbp)
	leaq	-220(%rbp), %rax
	movq	%rax, -296(%rbp)
	jmp	.L20
.L40:
	incq	%rbx
.L20:
	movl	%ebx, %r13d
	cmpl	%ebx, -232(%rbp)
	jle	.L39
	testq	%rbx, %rbx
	jne	.L21
	xorl	%eax, %eax
	movl	%eax, (%r12)
.L23:
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
.L22:
	cmpl	%r15d, -228(%rbp)
	jle	.L40
	movl	$1, %ecx
	movl	$4, %edx
	movl	$4, %esi
	movq	-264(%rbp), %r8
	movq	-296(%rbp), %rdi
	call	__fread_chk@PLT
	movl	-220(%rbp), %edx
	movq	-272(%rbp), %rsi
	movq	%rax, %rcx
	movl	-228(%rbp), %eax
	imull	%r13d, %eax
	cltq
	addq	%r15, %rax
	decl	%ecx
	movl	%edx, (%rsi,%rax,4)
	je	.L24
.L38:
	movq	stderr(%rip), %rdi
	leaq	.LC3(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L21:
	addl	-4(%r12,%rbx,4), %r14d
	movl	%r14d, (%r12,%rbx,4)
	jmp	.L23
.L24:
	testl	%edx, %edx
	je	.L25
	incl	-224(%rbp)
	incl	%r14d
.L25:
	incq	%r15
	jmp	.L22
.L39:
	movq	-264(%rbp), %rdi
	leaq	-152(%rbp), %rbx
	leaq	.LC4(%rip), %r13
	call	fclose@PLT
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	gettimeofday@PLT
	movq	-248(%rbp), %rdi
	movq	%r13, %rdx
	imulq	$1000000, -152(%rbp), %rcx
	imulq	$1000000, -136(%rbp), %rax
	addq	-128(%rbp), %rax
	movl	$2, %esi
	addq	-144(%rbp), %rcx
	subq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	-256(%rbp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	movslq	-232(%rbp), %rsi
	leaq	-216(%rbp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	-224(%rbp), %rsi
	leaq	-208(%rbp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	-224(%rbp), %rsi
	leaq	-200(%rbp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	-224(%rbp), %rsi
	leaq	-192(%rbp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movl	-228(%rbp), %esi
	imull	-232(%rbp), %esi
	leaq	-184(%rbp), %rdi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	-232(%rbp), %rdx
	movl	$1, %ecx
	movq	%r12, %rsi
	movq	-216(%rbp), %rdi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	-228(%rbp), %edx
	movl	$1, %ecx
	imull	-232(%rbp), %edx
	movq	-272(%rbp), %rsi
	movq	-184(%rbp), %rdi
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	call	cudaDeviceSynchronize@PLT
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	gettimeofday@PLT
	movq	-248(%rbp), %rdi
	movq	%r13, %rdx
	imulq	$1000000, -152(%rbp), %rcx
	addq	-144(%rbp), %rcx
	movl	$2, %esi
	imulq	$1000000, -136(%rbp), %rax
	addq	-128(%rbp), %rax
	subq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	-256(%rbp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movabsq	$4294967297, %rdx
	movl	-232(%rbp), %eax
	movq	%rdx, -172(%rbp)
	movl	-168(%rbp), %esi
	movl	%eax, -176(%rbp)
	movq	-176(%rbp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L28
	movl	-228(%rbp), %r9d
	movq	-200(%rbp), %r8
	movq	-192(%rbp), %rcx
	movq	-208(%rbp), %rdx
	movq	-216(%rbp), %rsi
	movq	-184(%rbp), %rdi
	call	_Z42__device_stub__Z13compressedRowPiS_S_S_S_iPiS_S_S_S_i
.L28:
	call	cudaDeviceSynchronize@PLT
	xorl	%esi, %esi
	movq	%rbx, %rdi
	leaq	.LC4(%rip), %r15
	call	gettimeofday@PLT
	movq	-248(%rbp), %rdi
	movq	%r15, %rdx
	imulq	$1000000, -152(%rbp), %rcx
	imulq	$1000000, -136(%rbp), %rax
	addq	-128(%rbp), %rax
	movl	$2, %esi
	addq	-144(%rbp), %rcx
	subq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	-256(%rbp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	movslq	-224(%rbp), %rax
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, -264(%rbp)
	call	malloc@PLT
	movq	-264(%rbp), %rdi
	movq	%rax, %r14
	call	malloc@PLT
	movq	-264(%rbp), %rdi
	movq	%rax, %r13
	call	malloc@PLT
	movq	-264(%rbp), %rdx
	movl	$2, %ecx
	movq	%r14, %rdi
	movq	-208(%rbp), %rsi
	movq	%rax, %r12
	call	cudaMemcpy@PLT
	movslq	-224(%rbp), %rdx
	movl	$2, %ecx
	movq	%r12, %rdi
	movq	-192(%rbp), %rsi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movslq	-224(%rbp), %rdx
	movl	$2, %ecx
	movq	%r13, %rdi
	movq	-200(%rbp), %rsi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movq	-216(%rbp), %rdi
	call	cudaFree@PLT
	movq	-208(%rbp), %rdi
	call	cudaFree@PLT
	movq	-200(%rbp), %rdi
	call	cudaFree@PLT
	movq	-192(%rbp), %rdi
	call	cudaFree@PLT
	movq	-184(%rbp), %rdi
	call	cudaFree@PLT
	call	cudaDeviceSynchronize@PLT
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	gettimeofday@PLT
	movq	-248(%rbp), %rdi
	movq	%r15, %rdx
	imulq	$1000000, -152(%rbp), %rcx
	addq	-144(%rbp), %rcx
	movl	$2, %esi
	leaq	-120(%rbp), %r15
	imulq	$1000000, -136(%rbp), %rax
	addq	-128(%rbp), %rax
	subq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	-256(%rbp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	movl	$64, %edx
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	-280(%rbp), %r8
	leaq	.LC5(%rip), %rcx
	movl	$2, %esi
	call	__sprintf_chk@PLT
	movq	%r15, %rdi
	leaq	.LC6(%rip), %rsi
	call	fopen@PLT
	movl	$1, %edx
	movl	$4, %esi
	movq	-288(%rbp), %rdi
	movq	%rax, %r15
	movq	%rax, %rcx
	call	fwrite@PLT
	leaq	-228(%rbp), %rdi
	movq	%r15, %rcx
	movl	$1, %edx
	movl	$4, %esi
	call	fwrite@PLT
	leaq	-224(%rbp), %rdi
	movq	%r15, %rcx
	movl	$1, %edx
	movl	$4, %esi
	call	fwrite@PLT
	movq	%r15, %rcx
	movl	$4, %esi
	movq	%r14, %rdi
	movslq	-224(%rbp), %rdx
	call	fwrite@PLT
	movq	%r15, %rcx
	movl	$4, %esi
	movq	%r12, %rdi
	movslq	-224(%rbp), %rdx
	call	fwrite@PLT
	movq	%r15, %rcx
	movl	$4, %esi
	movq	%r13, %rdi
	movslq	-224(%rbp), %rdx
	call	fwrite@PLT
	movq	%r15, %rdi
	call	fclose@PLT
	movq	%r14, %rdi
	call	free@PLT
	movq	%r13, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	-272(%rbp), %rdi
	call	free@PLT
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	gettimeofday@PLT
	movq	-248(%rbp), %rdi
	movl	$2, %esi
	imulq	$1000000, -152(%rbp), %rcx
	addq	-144(%rbp), %rcx
	leaq	.LC7(%rip), %rdx
	imulq	$1000000, -136(%rbp), %rax
	addq	-128(%rbp), %rax
	subq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	-248(%rbp), %rdi
	call	fclose@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	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	_Z8compressPc, .-_Z8compressPc
	.globl	_Z41__device_stub__Z13decompressRowPiS_S_S_iiPiS_S_S_ii
	.type	_Z41__device_stub__Z13decompressRowPiS_S_S_iiPiS_S_S_ii, @function
_Z41__device_stub__Z13decompressRowPiS_S_S_iiPiS_S_S_ii:
.LFB2057:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movl	%r8d, 12(%rsp)
	movl	%r9d, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L41
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z13decompressRowPiS_S_S_ii(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L41:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L43
	call	__stack_chk_fail@PLT
.L43:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2057:
	.size	_Z41__device_stub__Z13decompressRowPiS_S_S_iiPiS_S_S_ii, .-_Z41__device_stub__Z13decompressRowPiS_S_S_iiPiS_S_S_ii
	.globl	_Z13decompressRowPiS_S_S_ii
	.type	_Z13decompressRowPiS_S_S_ii, @function
_Z13decompressRowPiS_S_S_ii:
.LFB2058:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z13decompressRowPiS_S_S_iiPiS_S_S_ii
	.cfi_endproc
.LFE2058:
	.size	_Z13decompressRowPiS_S_S_ii, .-_Z13decompressRowPiS_S_S_ii
	.section	.rodata.str1.1
.LC8:
	.string	"sectionResultsUncompress.csv"
.LC9:
	.string	"r"
.LC10:
	.string	"%s.out"
	.text
	.globl	_Z10uncompressPc
	.type	_Z10uncompressPc, @function
_Z10uncompressPc:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC1(%rip), %rsi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	movq	%rdi, %r13
	leaq	.LC8(%rip), %rdi
	pushq	%r12
	pushq	%rbx
	subq	$232, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	fopen@PLT
	xorl	%esi, %esi
	movq	%rax, -232(%rbp)
	leaq	-152(%rbp), %rax
	movq	%rax, %rdi
	movq	%rax, -240(%rbp)
	call	gettimeofday@PLT
	xorl	%eax, %eax
	leaq	.LC9(%rip), %rsi
	movq	%r13, %rdi
	movl	%eax, -216(%rbp)
	call	fopen@PLT
	movl	$1, %ecx
	movl	$4, %edx
	movl	$4, %esi
	movq	%rax, %rbx
	leaq	-224(%rbp), %rax
	movq	%rbx, %r8
	movq	%rax, %rdi
	movq	%rax, -248(%rbp)
	call	__fread_chk@PLT
	decl	%eax
	jne	.L86
	leaq	-220(%rbp), %rax
	movq	%rbx, %r8
	movl	$1, %ecx
	movl	$4, %edx
	movl	$4, %esi
	movq	%rax, %rdi
	movq	%rax, -256(%rbp)
	call	__fread_chk@PLT
	decl	%eax
	jne	.L86
	leaq	-216(%rbp), %rdi
	movq	%rbx, %r8
	movl	$1, %ecx
	movl	$4, %edx
	movl	$4, %esi
	call	__fread_chk@PLT
	decl	%eax
	jne	.L86
	movslq	-216(%rbp), %rax
	movq	%rsp, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
.L50:
	cmpq	%rcx, %rsp
	je	.L51
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L50
.L51:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L52
	orq	$0, -8(%rsp,%rdx)
.L52:
	movq	%rax, %rsi
	movq	%rax, %rdx
	movq	%rsp, %rcx
	movq	%rsp, %r15
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
.L53:
	cmpq	%rcx, %rsp
	je	.L54
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L53
.L54:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L55
	orq	$0, -8(%rsp,%rdx)
.L55:
	movq	%rsp, -264(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L56:
	cmpq	%rcx, %rsp
	je	.L57
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L56
.L57:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L58
	orq	$0, -8(%rsp,%rax)
.L58:
	movq	%rsp, -272(%rbp)
	xorl	%r14d, %r14d
	leaq	-212(%rbp), %r12
.L59:
	cmpl	%r14d, -216(%rbp)
	jle	.L87
	movl	$4, %edx
	movq	%rbx, %r8
	movl	$1, %ecx
	movq	%r12, %rdi
	movl	$4, %esi
	call	__fread_chk@PLT
	movl	-212(%rbp), %edx
	movl	%edx, (%r15,%r14,4)
	incq	%r14
	decl	%eax
	je	.L59
	jmp	.L86
.L87:
	xorl	%r14d, %r14d
	leaq	-212(%rbp), %r12
.L61:
	cmpl	%r14d, -216(%rbp)
	jle	.L88
	movl	$1, %ecx
	movl	$4, %edx
	movq	%rbx, %r8
	movq	%r12, %rdi
	movl	$4, %esi
	call	__fread_chk@PLT
	movl	-212(%rbp), %edx
	movq	-272(%rbp), %rcx
	movl	%edx, (%rcx,%r14,4)
	incq	%r14
	decl	%eax
	je	.L61
	jmp	.L86
.L88:
	xorl	%r14d, %r14d
	leaq	-212(%rbp), %r12
.L63:
	cmpl	%r14d, -216(%rbp)
	jle	.L89
	movl	$1, %ecx
	movl	$4, %edx
	movq	%rbx, %r8
	movq	%r12, %rdi
	movl	$4, %esi
	call	__fread_chk@PLT
	movl	-212(%rbp), %edx
	movq	-264(%rbp), %rcx
	movl	%edx, (%rcx,%r14,4)
	incq	%r14
	decl	%eax
	je	.L63
.L86:
	movq	stderr(%rip), %rdi
	leaq	.LC3(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L89:
	movq	%rbx, %rdi
	leaq	-136(%rbp), %rbx
	leaq	.LC4(%rip), %r14
	call	fclose@PLT
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	gettimeofday@PLT
	movq	-232(%rbp), %rdi
	movq	%r14, %rdx
	imulq	$1000000, -136(%rbp), %rcx
	imulq	$1000000, -152(%rbp), %rax
	addq	-128(%rbp), %rcx
	movl	$2, %esi
	addq	-144(%rbp), %rax
	subq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	-240(%rbp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	movl	-224(%rbp), %edi
	imull	-220(%rbp), %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movslq	-216(%rbp), %rsi
	leaq	-208(%rbp), %rdi
	movq	%rax, %r12
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	-216(%rbp), %rsi
	leaq	-200(%rbp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	-216(%rbp), %rsi
	leaq	-192(%rbp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movl	-220(%rbp), %esi
	imull	-224(%rbp), %esi
	leaq	-184(%rbp), %rdi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	-216(%rbp), %rdx
	movl	$1, %ecx
	movq	%r15, %rsi
	movq	-208(%rbp), %rdi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movslq	-216(%rbp), %rdx
	movl	$1, %ecx
	movq	-272(%rbp), %rsi
	movq	-192(%rbp), %rdi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movslq	-216(%rbp), %rdx
	movl	$1, %ecx
	movq	-264(%rbp), %rsi
	movq	-200(%rbp), %rdi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	call	cudaDeviceSynchronize@PLT
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	gettimeofday@PLT
	movq	-232(%rbp), %rdi
	movq	%r14, %rdx
	imulq	$1000000, -136(%rbp), %rcx
	imulq	$1000000, -152(%rbp), %rax
	addq	-128(%rbp), %rcx
	movl	$2, %esi
	addq	-144(%rbp), %rax
	subq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	-240(%rbp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	movl	-220(%rbp), %eax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	-224(%rbp), %edx
	movl	%eax, -164(%rbp)
	movabsq	$4294967297, %rax
	movq	%rax, -160(%rbp)
	movl	-156(%rbp), %ecx
	movl	%edx, -176(%rbp)
	movq	-164(%rbp), %rdx
	movq	%rax, -172(%rbp)
	movq	-176(%rbp), %rdi
	movl	-168(%rbp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L65
	movl	-220(%rbp), %r9d
	movl	-216(%rbp), %r8d
	movq	-200(%rbp), %rcx
	movq	-192(%rbp), %rdx
	movq	-208(%rbp), %rsi
	movq	-184(%rbp), %rdi
	call	_Z41__device_stub__Z13decompressRowPiS_S_S_iiPiS_S_S_ii
.L65:
	call	cudaDeviceSynchronize@PLT
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	gettimeofday@PLT
	movq	-232(%rbp), %rdi
	movq	%r14, %rdx
	imulq	$1000000, -136(%rbp), %rcx
	imulq	$1000000, -152(%rbp), %rax
	addq	-128(%rbp), %rcx
	movl	$2, %esi
	addq	-144(%rbp), %rax
	subq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	-240(%rbp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	movl	-220(%rbp), %edx
	movl	$2, %ecx
	movq	%r12, %rdi
	imull	-224(%rbp), %edx
	movq	-184(%rbp), %rsi
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movq	-208(%rbp), %rdi
	call	cudaFree@PLT
	movq	-200(%rbp), %rdi
	call	cudaFree@PLT
	movq	-192(%rbp), %rdi
	call	cudaFree@PLT
	movq	-184(%rbp), %rdi
	call	cudaFree@PLT
	call	cudaDeviceSynchronize@PLT
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	gettimeofday@PLT
	movq	-232(%rbp), %rdi
	movq	%r14, %rdx
	imulq	$1000000, -136(%rbp), %rcx
	addq	-128(%rbp), %rcx
	movl	$2, %esi
	leaq	-120(%rbp), %r14
	imulq	$1000000, -152(%rbp), %rax
	addq	-144(%rbp), %rax
	subq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	-240(%rbp), %rdi
	xorl	%esi, %esi
	call	gettimeofday@PLT
	movq	%r13, %r8
	movl	$64, %edx
	movq	%r14, %rdi
	leaq	.LC10(%rip), %rcx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	movq	%r14, %rdi
	leaq	.LC6(%rip), %rsi
	xorl	%r14d, %r14d
	call	fopen@PLT
	movl	$1, %edx
	movl	$4, %esi
	movq	-248(%rbp), %rdi
	movq	%rax, %rcx
	movq	%rax, %r13
	call	fwrite@PLT
	movq	-256(%rbp), %rdi
	movq	%r13, %rcx
	movl	$1, %edx
	movl	$4, %esi
	call	fwrite@PLT
.L66:
	cmpl	%r14d, -224(%rbp)
	jle	.L90
	xorl	%r15d, %r15d
.L68:
	movl	-220(%rbp), %eax
	cmpl	%r15d, %eax
	jle	.L91
	imull	%r14d, %eax
	movq	%r13, %rcx
	movl	$1, %edx
	movl	$4, %esi
	cltq
	addq	%r15, %rax
	incq	%r15
	leaq	(%r12,%rax,4), %rdi
	call	fwrite@PLT
	jmp	.L68
.L91:
	incl	%r14d
	jmp	.L66
.L90:
	movq	%r13, %rdi
	call	fclose@PLT
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	gettimeofday@PLT
	movq	-232(%rbp), %rdi
	movl	$2, %esi
	imulq	$1000000, -136(%rbp), %rcx
	imulq	$1000000, -152(%rbp), %rax
	addq	-128(%rbp), %rcx
	leaq	.LC7(%rip), %rdx
	addq	-144(%rbp), %rax
	subq	%rax, %rcx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	-232(%rbp), %rdi
	call	fclose@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L69
	call	__stack_chk_fail@PLT
.L69:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z10uncompressPc, .-_Z10uncompressPc
	.section	.rodata.str1.1
.LC11:
	.string	"-c"
.LC12:
	.string	"-u"
.LC13:
	.string	"Usage:\n%s -c filename ....... to compress\n%s -u filename ....... to uncompress\n"
.LC14:
	.string	"File %s does not exist.\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2030:
	.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
	movq	%rsi, %rbx
	cmpl	$3, %edi
	jne	.L93
	movq	8(%rsi), %rbp
	leaq	.LC11(%rip), %r12
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L94
	leaq	.LC12(%rip), %rsi
	movq	%rbp, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L94
.L93:
	movq	(%rbx), %rcx
	movq	stderr(%rip), %rdi
	leaq	.LC13(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	movq	%rcx, %r8
	call	__fprintf_chk@PLT
	jmp	.L105
.L94:
	movq	16(%rbx), %rdi
	call	_Z10fileExistsPc
	movq	16(%rbx), %rbp
	testb	%al, %al
	jne	.L95
	movq	stderr(%rip), %rdi
	movq	%rbp, %rcx
	movl	$2, %esi
	leaq	.LC14(%rip), %rdx
	call	__fprintf_chk@PLT
.L105:
	movl	$1, %edi
.L106:
	call	exit@PLT
.L95:
	movq	8(%rbx), %rdi
	movq	%r12, %rsi
	call	strcmp@PLT
	movq	%rbp, %rdi
	testl	%eax, %eax
	jne	.L96
	call	_Z8compressPc
	jmp	.L97
.L96:
	call	_Z10uncompressPc
.L97:
	xorl	%edi, %edi
	jmp	.L106
	.cfi_endproc
.LFE2030:
	.size	main, .-main
	.section	.rodata.str1.1
.LC15:
	.string	"_Z13decompressRowPiS_S_S_ii"
.LC16:
	.string	"_Z13compressedRowPiS_S_S_S_i"
	.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	.LC15(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z13decompressRowPiS_S_S_ii(%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	.LC16(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z13compressedRowPiS_S_S_S_i(%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
	.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 <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <sys/time.h>

typedef int32_t Int;


#define NUM_BYTES(n) ((n) * (sizeof(Int)))

__global__ void compressedRow(Int* matrix, Int* rowIndex, Int* nums, Int* cols, Int* rows, Int width) {
	Int* row = ((matrix + (blockIdx.x * width)));
	Int offset = *(rowIndex + blockIdx.x);

	Int i = 0;
	for (; i < width; i++) {
		if (*(row + i) != 0) {
			*(nums + offset) = *(row + i);
			*(cols + offset) = i;
			*(rows + offset) = blockIdx.x;
			offset++;
		}
	}
}

__global__ void decompressRow(Int* matrix, Int* nums, Int* cols, Int* rows, Int count, Int width) {
	Int* row = ((matrix + (blockIdx.x * width)));
	Int i;

    *(row + threadIdx.x) = 0;
	for (i = 0; i < count; i++) {
		if (*(rows + i) == blockIdx.x) {
			if (*(cols + i) == threadIdx.x) {
				*(row + threadIdx.x) = *(nums + i);
			}
		}
	}

}

bool fileExists (char* name) {
   FILE* tmp   = fopen (name, "rb");
   bool exists = (tmp != NULL);
   if (tmp != NULL) fclose (tmp);
   return exists;
}

void compress(char* infile) {
	
	FILE* time_results = fopen("sectionResultsCompress.csv", "a+");
	struct timeval stop, start;

	gettimeofday(&start, NULL); //BEGIN READ-IN SECTION
	Int height, width;
	Int count = 0, rowCount = 0;
	Int i, j;
	Int temp;

	FILE* in = fopen(infile, "rb");

	Int result = fread((void*)&height, NUM_BYTES(1), 1, in);
	if (result != 1) {
		fprintf(stderr, "Reading Error\n");
		exit(1);
	}
	result = fread((void*)&width, NUM_BYTES(1), 1, in);
	if (result != 1) {
		fprintf(stderr, "Reading Error\n");
		exit(1);
	}
	Int rowIndex[height];
	Int* matrix = (Int*)malloc(NUM_BYTES(height * width));
	for (i = 0; i < height; i++) {

		if (i == 0)
			rowIndex[i] = 0;
		else 
			rowIndex[i] = rowIndex[i-1] + rowCount;
		rowCount = 0;

		for (j = 0; j < width; j++) {
			result = fread((void*)&temp, NUM_BYTES(1), 1, in);
			*(matrix + (i * width) + j) = temp;
			if (result != 1) {
				fprintf(stderr, "Reading Error\n");
				exit(1);
			}
			if (*(matrix + (i * width) + j) != 0) {
				count++;
				rowCount++;
			}
		}
	}
	fclose(in);
	
	gettimeofday(&stop, NULL); //END READ-IN SECTION
	long timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN CPU-TO-GPU SECTION
	Int* cRowIndex;
	Int* cnums;
	Int* nums;
	Int* cRow; 
	Int* row;
	Int* cCol; 
	Int* col;
	Int* cMatrix;
	//size_t pitch;

	//cudaError_t cerr;
	hipMalloc((void**)&cRowIndex, NUM_BYTES(height));
	hipMalloc((void**)&cnums, NUM_BYTES(count));
	hipMalloc((void**)&cRow, NUM_BYTES(count));
	hipMalloc((void**)&cCol, NUM_BYTES(count));
	//if (cerr != cudaSuccess)
	//	fprintf(stderr, "Error with cCol malloc: %s", cudaGetErrorString(cerr));
	//cudaMallocPitch((void**)&cMatrix, &pitch, (size_t)NUM_BYTES(width), (size_t)NUM_BYTES(height));
	hipMalloc((void**)&cMatrix, NUM_BYTES(width * height));
	//if (cerr != cudaSuccess)
	//	fprintf(stderr, "Error with cCol malloc: %s", cudaGetErrorString(cerr));

	hipMemcpy(cRowIndex, rowIndex, NUM_BYTES(height), hipMemcpyHostToDevice);
	//cudaMemcpy2D((void*)cMatrix, pitch, matrix, NUM_BYTES(width), NUM_BYTES(width), NUM_BYTES(height), cudaMemcpyHostToDevice);
	hipMemcpy(cMatrix, matrix, NUM_BYTES(width * height), hipMemcpyHostToDevice);
	hipDeviceSynchronize();

	gettimeofday(&stop, NULL); //END CPU-TO-GPU SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);\

	gettimeofday(&start, NULL); //BEGIN GPU-COMPRESSION SECTION
	compressedRow<<<height, 1>>>(cMatrix, cRowIndex, cnums, cCol, cRow, width);
	hipDeviceSynchronize();
	gettimeofday(&stop, NULL); //END GPU-COMPRESSION SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN GPU-TO-CPU SECTION
	nums = (Int*)malloc(NUM_BYTES(count));
	row = (Int*)malloc(NUM_BYTES(count));
	col = (Int*)malloc(NUM_BYTES(count));

	hipMemcpy(nums, cnums, NUM_BYTES(count), hipMemcpyDeviceToHost);
	hipMemcpy(col, cCol, NUM_BYTES(count), hipMemcpyDeviceToHost);
	hipMemcpy(row, cRow, NUM_BYTES(count), hipMemcpyDeviceToHost);

	hipFree(cRowIndex);
	hipFree(cnums);
	hipFree(cRow);
	hipFree(cCol);	
	hipFree(cMatrix);
	hipDeviceSynchronize();

	gettimeofday(&stop, NULL); //END GPU-TO-CPU SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN WRITE-OUT SECTION
	char name[64];
	sprintf(name, "%s.crs", infile);
	FILE* file = fopen(name, "ab+");
	fwrite((void*)&height, NUM_BYTES(1), 1, file);
	fwrite((void*)&width, NUM_BYTES(1), 1, file);
	fwrite((void*)&count, NUM_BYTES(1), 1, file);

	fwrite((void*)&nums[0], NUM_BYTES(1), count, file);
	fwrite((void*)&col[0], NUM_BYTES(1), count, file);
	fwrite((void*)&row[0], NUM_BYTES(1), count, file);

	fclose(file);

	free(nums);
	free(row);
	free(col);
	free(matrix);
	gettimeofday(&stop, NULL); //END WRITE-OUT-SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li\n", timeMillies);
	fclose(time_results);	
}

void uncompress(char* infile) {

	FILE* time_results = fopen("sectionResultsUncompress.csv", "a+");

	struct timeval start, stop;

	gettimeofday(&start, NULL); //BEGIN READ-IN SECTION
	Int height, width;
	Int count = 0;
	Int i;
	Int temp;

	FILE* in = fopen(infile, "r");

	Int result = fread((void*)&height, NUM_BYTES(1), 1, in);
	if (result != 1) {
		fprintf(stderr, "Reading Error\n");
		exit(1);
	}
	result = fread((void*)&width, NUM_BYTES(1), 1, in);
	if (result != 1) {
		fprintf(stderr, "Reading Error\n");
		exit(1);
	}

	result = fread((void*)&count, NUM_BYTES(1), 1, in);
	if (result != 1) {
		fprintf(stderr, "Reading Error\n");
		exit(1);
	}
	Int nums[count];
	Int rows[count];
	Int cols[count];

	for (i = 0; i < count; i++) {
		result = fread((void*)&temp, NUM_BYTES(1), 1, in);
		nums[i] = temp;
		if (result != 1) {
			fprintf(stderr, "Reading Error\n");
			exit(1);
		}
	}
	for (i = 0; i < count; i++) {
		result = fread((void*)&temp, NUM_BYTES(1), 1, in);
		cols[i] = temp;
		if (result != 1) {
			fprintf(stderr, "Reading Error\n");
			exit(1);
		}
	}
	for (i = 0; i < count; i++) {
		result = fread((void*)&temp, NUM_BYTES(1), 1, in);
		rows[i] = temp;
		if (result != 1) {
			fprintf(stderr, "Reading Error\n");
			exit(1);
		}
	}
	fclose(in);

	gettimeofday(&stop, NULL); //END READ-IN SECTION
	long timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN CPU-TO-GPU SECTION
	Int* cNums;
	Int* cRows;
	Int* cCols;
	Int* matrix = (Int*)malloc(NUM_BYTES(height * width));
	Int* cMatrix;
	//size_t pitch;

	//cudaError_t cerr;
	hipMalloc((void**)&cNums, NUM_BYTES(count));
	hipMalloc((void**)&cRows, NUM_BYTES(count));
	hipMalloc((void**)&cCols, NUM_BYTES(count));
	//cudaMallocPitch((void**)&cMatrix, &pitch, NUM_BYTES(width), NUM_BYTES(height));
	hipMalloc((void**)&cMatrix, NUM_BYTES(width * height));

	hipMemcpy(cNums, nums, NUM_BYTES(count), hipMemcpyHostToDevice);
	hipMemcpy(cCols, cols, NUM_BYTES(count), hipMemcpyHostToDevice);
	hipMemcpy(cRows, rows, NUM_BYTES(count), hipMemcpyHostToDevice);
	hipDeviceSynchronize();

	gettimeofday(&stop, NULL); //END CPU-TO-GPU SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN GPU-COMPRESSION SECTION

	decompressRow<<<height, width>>>(cMatrix, cNums, cCols, cRows, count, width);
	hipDeviceSynchronize();

	gettimeofday(&stop, NULL); //END GPU-COMPRESSION SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN GPU-TO-CPU SECTION

	//cudaMemcpy2D((void*)matrix, NUM_BYTES(width), cMatrix, pitch, NUM_BYTES(width), NUM_BYTES(height), cudaMemcpyDeviceToHost);
	hipMemcpy((void*)matrix, cMatrix, NUM_BYTES(width * height), hipMemcpyDeviceToHost);
	//cudaMemcpy(row, cRow, NUM_BYTES(count), cudaMemcpyDeviceToHost);
	hipFree(cNums);
	hipFree(cRows);
	//if (cerr != cudaSuccess)
	//	fprintf(stderr, "Error with cRows free: %s\n", cudaGetErrorString(cerr));
	hipFree(cCols);
	//if (cerr != cudaSuccess)
	//	fprintf(stderr, "Error with cCols free: %s\n", cudaGetErrorString(cerr));
	hipFree(cMatrix);

	hipDeviceSynchronize();

	gettimeofday(&stop, NULL); //END GPU-TO-CPU SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li,", timeMillies);

	gettimeofday(&start, NULL); //BEGIN WRITE-OUT SECTION

	char name[64];
	sprintf(name, "%s.out", infile);
	FILE* newfile = fopen(name, "ab+");
	fwrite((void*)&height, NUM_BYTES(1), 1, newfile);
	fwrite((void*)&width, NUM_BYTES(1), 1, newfile);

	//this section could be done without the nested fors, but I already got test results
	//for the end-to-end time tests, and I have to keep it this way for research integrity
	Int j;
	for (i = 0; i < height; i++) {
		for (j = 0; j < width; j++) {
			fwrite((void*)(matrix + (i * width) + j), NUM_BYTES(1), 1, newfile);
		}
	}
	fclose(newfile);
	//free(matrix);

	gettimeofday(&stop, NULL); //END WRITE-OUT-SECTION
	timeMillies = ((stop.tv_usec) + (stop.tv_sec * 1000000)) - ((start.tv_usec) + (start.tv_sec * 1000000));
	fprintf(time_results, "%li\n", timeMillies);
	fclose(time_results);

}


int main(int argc, char* argv[]) {

	if (argc != 3 || (strcmp(argv[1], "-c") != 0 && strcmp(argv[1], "-u") != 0)) {
		fprintf(stderr, "Usage:\n%s -c filename ....... to compress\n%s -u filename ....... to uncompress\n", argv[0], argv[0]);
		exit(1);
	}
	else if (!fileExists(argv[2])) {
		fprintf(stderr, "File %s does not exist.\n", argv[2]);
		exit(1);
	}

	if (strcmp(argv[1], "-c") == 0) {
		compress(argv[2]);
	}
	else {
		uncompress(argv[2]);
	}


	exit(0);
}


	.text
	.file	"compressesRowSteps.hip"
	.globl	_Z28__device_stub__compressedRowPiS_S_S_S_i # -- Begin function _Z28__device_stub__compressedRowPiS_S_S_S_i
	.type	_Z28__device_stub__compressedRowPiS_S_S_S_i,@function
_Z28__device_stub__compressedRowPiS_S_S_S_i: # @_Z28__device_stub__compressedRowPiS_S_S_S_i
	.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	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	4(%rsp), %r8
	movl	%r9d, (%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	80(%rsp), %r14
	leaq	64(%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	$_Z13compressedRowPiS_S_S_S_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	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	_Z28__device_stub__compressedRowPiS_S_S_S_i, .Lfunc_end0-_Z28__device_stub__compressedRowPiS_S_S_S_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z28__device_stub__decompressRowPiS_S_S_ii # -- Begin function _Z28__device_stub__decompressRowPiS_S_S_ii
	.type	_Z28__device_stub__decompressRowPiS_S_S_ii,@function
_Z28__device_stub__decompressRowPiS_S_S_ii: # @_Z28__device_stub__decompressRowPiS_S_S_ii
	.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	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	12(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	8(%rsp), %r8
	movl	%r9d, (%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	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	$_Z13decompressRowPiS_S_S_ii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	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	_Z28__device_stub__decompressRowPiS_S_S_ii, .Lfunc_end1-_Z28__device_stub__decompressRowPiS_S_S_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z10fileExistsPc                # -- Begin function _Z10fileExistsPc
	.type	_Z10fileExistsPc,@function
_Z10fileExistsPc:                       # @_Z10fileExistsPc
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movl	$.L.str, %esi
	callq	fopen
	movq	%rax, %rbx
	testq	%rax, %rax
	je	.LBB2_2
# %bb.1:
	movq	%rbx, %rdi
	callq	fclose
.LBB2_2:
	testq	%rbx, %rbx
	setne	%al
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z10fileExistsPc, .Lfunc_end2-_Z10fileExistsPc
	.cfi_endproc
                                        # -- End function
	.globl	_Z8compressPc                   # -- Begin function _Z8compressPc
	.type	_Z8compressPc,@function
_Z8compressPc:                          # @_Z8compressPc
	.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	$248, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	$.L.str.1, %edi
	movl	$.L.str.2, %esi
	callq	fopen
	movq	%rax, %r14
	leaq	-152(%rbp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movl	$.L.str, %esi
	movq	%r15, %rdi
	callq	fopen
	movq	%rax, %rbx
	leaq	-48(%rbp), %rdi
	movl	$4, %esi
	movl	$1, %edx
	movq	%rax, %rcx
	callq	fread
	cmpl	$1, %eax
	jne	.LBB3_17
# %bb.1:
	leaq	-44(%rbp), %rdi
	movl	$4, %esi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	fread
	cmpl	$1, %eax
	jne	.LBB3_17
# %bb.2:
	movq	%r15, -184(%rbp)                # 8-byte Spill
	movq	%r14, -128(%rbp)                # 8-byte Spill
	movq	%rsp, -192(%rbp)                # 8-byte Spill
	movl	-48(%rbp), %r14d
	movq	%rsp, %rcx
	leaq	15(,%r14,4), %rax
	andq	$-16, %rax
	subq	%rax, %rcx
	movq	%rcx, -64(%rbp)                 # 8-byte Spill
	movq	%rcx, %rsp
	movslq	-44(%rbp), %r15
	movl	%r15d, %eax
	movq	%rax, -56(%rbp)                 # 8-byte Spill
	movl	%r15d, %eax
	imull	%r14d, %eax
	movslq	%eax, %rdi
	shlq	$2, %rdi
	movq	%rdi, -176(%rbp)                # 8-byte Spill
	callq	malloc
	movq	%r14, -136(%rbp)                # 8-byte Spill
	testl	%r14d, %r14d
	movq	%rax, -120(%rbp)                # 8-byte Spill
	jle	.LBB3_3
# %bb.4:                                # %.lr.ph103
	leaq	(,%r15,4), %rcx
	movq	%rcx, -200(%rbp)                # 8-byte Spill
	xorl	%ecx, %ecx
	movq	%rax, %r12
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	movq	%r15, -208(%rbp)                # 8-byte Spill
.LBB3_5:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_11 Depth 2
	testq	%rcx, %rcx
	je	.LBB3_6
# %bb.7:                                #   in Loop: Header=BB3_5 Depth=1
	movq	-64(%rbp), %rax                 # 8-byte Reload
	addl	-4(%rax,%rcx,4), %r14d
	movl	%r14d, (%rax,%rcx,4)
	jmp	.LBB3_8
.LBB3_6:                                #   in Loop: Header=BB3_5 Depth=1
	movq	-64(%rbp), %rax                 # 8-byte Reload
	movl	$0, (%rax)
.LBB3_8:                                #   in Loop: Header=BB3_5 Depth=1
	movq	%rcx, -216(%rbp)                # 8-byte Spill
	testl	%r15d, %r15d
	jle	.LBB3_9
# %bb.10:                               # %.lr.ph
                                        #   in Loop: Header=BB3_5 Depth=1
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
.LBB3_11:                               #   Parent Loop BB3_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$4, %esi
	movl	$1, %edx
	leaq	-108(%rbp), %rdi
	movq	%rbx, %rcx
	callq	fread
	movl	-108(%rbp), %ecx
	movl	%ecx, (%r12,%r15,4)
	cmpl	$1, %eax
	jne	.LBB3_17
# %bb.12:                               #   in Loop: Header=BB3_11 Depth=2
	xorl	%eax, %eax
	testl	%ecx, %ecx
	setne	%al
	addl	%eax, %r13d
	addl	%eax, %r14d
	incq	%r15
	cmpq	%r15, -56(%rbp)                 # 8-byte Folded Reload
	jne	.LBB3_11
	jmp	.LBB3_13
.LBB3_9:                                #   in Loop: Header=BB3_5 Depth=1
	xorl	%r14d, %r14d
.LBB3_13:                               # %._crit_edge
                                        #   in Loop: Header=BB3_5 Depth=1
	movq	-216(%rbp), %rcx                # 8-byte Reload
	incq	%rcx
	addq	-200(%rbp), %r12                # 8-byte Folded Reload
	cmpq	-136(%rbp), %rcx                # 8-byte Folded Reload
	movq	-208(%rbp), %r15                # 8-byte Reload
	jne	.LBB3_5
	jmp	.LBB3_14
.LBB3_3:
	xorl	%r13d, %r13d
.LBB3_14:                               # %._crit_edge104
	movl	%r13d, -112(%rbp)
	movq	%rbx, %rdi
	callq	fclose
	leaq	-168(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbx), %rax
	movq	8(%rbx), %rdx
	leaq	-152(%rbp), %rbx
	subq	(%rbx), %rax
	imulq	$1000000, %rax, %rax            # imm = 0xF4240
	subq	8(%rbx), %rdx
	addq	%rax, %rdx
	movl	$.L.str.4, %esi
	movq	-128(%rbp), %r14                # 8-byte Reload
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	-136(%rbp), %r12                # 8-byte Reload
	movslq	%r12d, %r15
	shlq	$2, %r15
	leaq	-104(%rbp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	movslq	%r13d, %rbx
	shlq	$2, %rbx
	leaq	-96(%rbp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	leaq	-88(%rbp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	leaq	-80(%rbp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	leaq	-72(%rbp), %rdi
	movq	-176(%rbp), %r13                # 8-byte Reload
	movq	%r13, %rsi
	callq	hipMalloc
	leaq	-104(%rbp), %rax
	movq	(%rax), %rdi
	movq	-64(%rbp), %rsi                 # 8-byte Reload
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	-72(%rbp), %rax
	movq	(%rax), %rdi
	movq	-120(%rbp), %rsi                # 8-byte Reload
	movq	%r13, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	callq	hipDeviceSynchronize
	leaq	-168(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r15), %rax
	movq	8(%r15), %rdx
	leaq	-152(%rbp), %r15
	subq	(%r15), %rax
	imulq	$1000000, %rax, %rax            # imm = 0xF4240
	subq	8(%r15), %rdx
	addq	%rax, %rdx
	movl	$.L.str.4, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	btsq	$32, %r12
	movabsq	$4294967296, %rdx               # imm = 0x100000000
	orq	$1, %rdx
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_16
# %bb.15:
	movq	-72(%rbp), %rdi
	movq	-104(%rbp), %rsi
	movq	-96(%rbp), %rdx
	movq	-80(%rbp), %rcx
	movq	-88(%rbp), %r8
	movq	-56(%rbp), %r9                  # 8-byte Reload
                                        # kill: def $r9d killed $r9d killed $r9
	callq	_Z28__device_stub__compressedRowPiS_S_S_S_i
.LBB3_16:
	callq	hipDeviceSynchronize
	leaq	-168(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r15), %rax
	movq	8(%r15), %rdx
	leaq	-152(%rbp), %r15
	subq	(%r15), %rax
	imulq	$1000000, %rax, %rax            # imm = 0xF4240
	subq	8(%r15), %rdx
	addq	%rax, %rdx
	movl	$.L.str.4, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, %r12
	movq	%rax, -56(%rbp)                 # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, %r13
	movq	-96(%rbp), %rsi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	-80(%rbp), %rsi
	movq	%r13, %rdi
	movq	%rbx, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	-88(%rbp), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	-104(%rbp), %rdi
	callq	hipFree
	movq	-96(%rbp), %rdi
	callq	hipFree
	movq	-88(%rbp), %rdi
	callq	hipFree
	movq	-80(%rbp), %rdi
	callq	hipFree
	movq	-72(%rbp), %rdi
	callq	hipFree
	callq	hipDeviceSynchronize
	leaq	-168(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbx), %rax
	movq	8(%rbx), %rdx
	leaq	-152(%rbp), %r12
	subq	(%r12), %rax
	imulq	$1000000, %rax, %rax            # imm = 0xF4240
	subq	8(%r12), %rdx
	addq	%rax, %rdx
	movl	$.L.str.4, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	leaq	-288(%rbp), %rbx
	movl	$.L.str.5, %esi
	movq	%rbx, %rdi
	movq	-184(%rbp), %rdx                # 8-byte Reload
	xorl	%eax, %eax
	callq	sprintf
	movl	$.L.str.6, %esi
	movq	%rbx, %rdi
	callq	fopen
	movq	%rax, %rbx
	leaq	-48(%rbp), %rdi
	movl	$4, %esi
	movl	$1, %edx
	movq	%rax, %rcx
	callq	fwrite
	leaq	-44(%rbp), %rdi
	movl	$4, %esi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	fwrite
	leaq	-112(%rbp), %r12
	movl	$4, %esi
	movl	$1, %edx
	movq	%r12, %rdi
	movq	%rbx, %rcx
	callq	fwrite
	movslq	(%r12), %r12
	movl	$4, %esi
	movq	-56(%rbp), %r14                 # 8-byte Reload
	movq	%r14, %rdi
	movq	%r12, %rdx
	movq	%rbx, %rcx
	callq	fwrite
	movl	$4, %esi
	movq	%r13, %rdi
	movq	%r12, %rdx
	movq	%rbx, %rcx
	callq	fwrite
	movl	$4, %esi
	movq	%r15, %rdi
	movq	%r12, %rdx
	movq	%rbx, %rcx
	callq	fwrite
	movq	%rbx, %rdi
	callq	fclose
	movq	%r14, %rdi
	callq	free
	movq	%r15, %rdi
	callq	free
	movq	%r13, %rdi
	callq	free
	movq	-120(%rbp), %rdi                # 8-byte Reload
	callq	free
	leaq	-168(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbx), %rax
	movq	8(%rbx), %rdx
	leaq	-152(%rbp), %rcx
	subq	(%rcx), %rax
	imulq	$1000000, %rax, %rax            # imm = 0xF4240
	subq	8(%rcx), %rdx
	addq	%rax, %rdx
	movl	$.L.str.7, %esi
	movq	-128(%rbp), %rbx                # 8-byte Reload
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movq	%rbx, %rdi
	callq	fclose
	movq	-192(%rbp), %rsp                # 8-byte Reload
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.LBB3_17:
	.cfi_def_cfa %rbp, 16
	movq	stderr(%rip), %rcx
	movl	$.L.str.3, %edi
	movl	$14, %esi
	movl	$1, %edx
	callq	fwrite
	movl	$1, %edi
	callq	exit
.Lfunc_end3:
	.size	_Z8compressPc, .Lfunc_end3-_Z8compressPc
	.cfi_endproc
                                        # -- End function
	.globl	_Z10uncompressPc                # -- Begin function _Z10uncompressPc
	.type	_Z10uncompressPc,@function
_Z10uncompressPc:                       # @_Z10uncompressPc
	.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	$216, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	$.L.str.8, %edi
	movl	$.L.str.2, %esi
	callq	fopen
	movq	%rax, %rbx
	leaq	-144(%rbp), %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movl	$0, -76(%rbp)
	movl	$.L.str.9, %esi
	movq	%r14, %rdi
	callq	fopen
	movq	%rax, %r15
	leaq	-80(%rbp), %rdi
	movl	$4, %esi
	movl	$1, %edx
	movq	%rax, %rcx
	callq	fread
	cmpl	$1, %eax
	jne	.LBB4_15
# %bb.1:
	leaq	-60(%rbp), %rdi
	movl	$4, %esi
	movl	$1, %edx
	movq	%r15, %rcx
	callq	fread
	cmpl	$1, %eax
	jne	.LBB4_15
# %bb.2:
	movq	%r14, -176(%rbp)                # 8-byte Spill
	movq	%rbx, -96(%rbp)                 # 8-byte Spill
	leaq	-76(%rbp), %rdi
	movl	$4, %esi
	movl	$1, %edx
	movq	%r15, %rcx
	callq	fread
	cmpl	$1, %eax
	jne	.LBB4_15
# %bb.3:
	movq	%rsp, -168(%rbp)                # 8-byte Spill
	movslq	-76(%rbp), %rcx
	movl	%ecx, %r12d
	movq	%rsp, %rbx
	leaq	15(,%r12,4), %rax
	andq	$-16, %rax
	subq	%rax, %rbx
	movq	%rbx, %rsp
	movq	%rsp, %rdx
	subq	%rax, %rdx
	movq	%rdx, -88(%rbp)                 # 8-byte Spill
	movq	%rdx, %rsp
	movq	%rsp, %rdx
	subq	%rax, %rdx
	movq	%rdx, -72(%rbp)                 # 8-byte Spill
	movq	%rdx, %rsp
	movq	%rcx, -56(%rbp)                 # 8-byte Spill
	testq	%rcx, %rcx
	jle	.LBB4_16
# %bb.4:                                # %.lr.ph.preheader
	xorl	%r13d, %r13d
	leaq	-44(%rbp), %r14
.LBB4_5:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	$4, %esi
	movl	$1, %edx
	movq	%r14, %rdi
	movq	%r15, %rcx
	callq	fread
	movl	-44(%rbp), %ecx
	movl	%ecx, (%rbx,%r13,4)
	cmpl	$1, %eax
	jne	.LBB4_15
# %bb.6:                                #   in Loop: Header=BB4_5 Depth=1
	incq	%r13
	cmpq	%r13, %r12
	jne	.LBB4_5
# %bb.7:                                # %.preheader87
	cmpl	$0, -56(%rbp)                   # 4-byte Folded Reload
	jle	.LBB4_16
# %bb.8:                                # %.lr.ph90.preheader
	xorl	%r13d, %r13d
	leaq	-44(%rbp), %r14
.LBB4_9:                                # %.lr.ph90
                                        # =>This Inner Loop Header: Depth=1
	movl	$4, %esi
	movl	$1, %edx
	movq	%r14, %rdi
	movq	%r15, %rcx
	callq	fread
	movl	-44(%rbp), %ecx
	movq	-72(%rbp), %rdx                 # 8-byte Reload
	movl	%ecx, (%rdx,%r13,4)
	cmpl	$1, %eax
	jne	.LBB4_15
# %bb.10:                               #   in Loop: Header=BB4_9 Depth=1
	incq	%r13
	cmpq	%r13, %r12
	jne	.LBB4_9
# %bb.11:                               # %.preheader86
	cmpl	$0, -56(%rbp)                   # 4-byte Folded Reload
	jle	.LBB4_16
# %bb.12:                               # %.lr.ph92.preheader
	xorl	%r13d, %r13d
	leaq	-44(%rbp), %r14
.LBB4_14:                               # %.lr.ph92
                                        # =>This Inner Loop Header: Depth=1
	movl	$4, %esi
	movl	$1, %edx
	movq	%r14, %rdi
	movq	%r15, %rcx
	callq	fread
	movl	-44(%rbp), %ecx
	movq	-88(%rbp), %rdx                 # 8-byte Reload
	movl	%ecx, (%rdx,%r13,4)
	cmpl	$1, %eax
	jne	.LBB4_15
# %bb.13:                               #   in Loop: Header=BB4_14 Depth=1
	incq	%r13
	cmpq	%r13, %r12
	jne	.LBB4_14
.LBB4_16:                               # %._crit_edge
	movq	%r15, %rdi
	callq	fclose
	leaq	-192(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r14), %rax
	movq	8(%r14), %rdx
	leaq	-144(%rbp), %r14
	subq	(%r14), %rax
	imulq	$1000000, %rax, %rax            # imm = 0xF4240
	subq	8(%r14), %rdx
	addq	%rax, %rdx
	movl	$.L.str.4, %esi
	movq	-96(%rbp), %rdi                 # 8-byte Reload
	xorl	%eax, %eax
	callq	fprintf
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movl	-80(%rbp), %ecx
	movq	%rcx, -160(%rbp)                # 8-byte Spill
	movl	-60(%rbp), %eax
	movq	%rax, -152(%rbp)                # 8-byte Spill
                                        # kill: def $eax killed $eax killed $rax
	imull	%ecx, %eax
	movslq	%eax, %r14
	shlq	$2, %r14
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, %r13
	movq	-56(%rbp), %r15                 # 8-byte Reload
	shlq	$2, %r15
	leaq	-128(%rbp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	leaq	-120(%rbp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	leaq	-112(%rbp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	leaq	-104(%rbp), %rdi
	movq	%r14, -56(%rbp)                 # 8-byte Spill
	movq	%r14, %rsi
	callq	hipMalloc
	leaq	-128(%rbp), %rax
	movq	(%rax), %rdi
	movq	%rbx, %rsi
	movq	-152(%rbp), %rbx                # 8-byte Reload
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	-112(%rbp), %rax
	movq	(%rax), %rdi
	movq	-72(%rbp), %rsi                 # 8-byte Reload
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	-120(%rbp), %rax
	movq	(%rax), %rdi
	movq	-88(%rbp), %rsi                 # 8-byte Reload
	movq	%r15, %rdx
	movq	-96(%rbp), %r15                 # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	callq	hipDeviceSynchronize
	leaq	-192(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r14), %rax
	movq	8(%r14), %rdx
	leaq	-144(%rbp), %r14
	subq	(%r14), %rax
	imulq	$1000000, %rax, %rax            # imm = 0xF4240
	subq	8(%r14), %rdx
	addq	%rax, %rdx
	movl	$.L.str.4, %esi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	-160(%rbp), %rdi                # 8-byte Reload
	btsq	$32, %rdi
	movq	%rbx, %rdx
	btsq	$32, %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_18
# %bb.17:
	movq	-104(%rbp), %rdi
	movq	-128(%rbp), %rsi
	movq	-112(%rbp), %rdx
	movq	-120(%rbp), %rcx
	movl	%r12d, %r8d
	movl	%ebx, %r9d
	callq	_Z28__device_stub__decompressRowPiS_S_S_ii
.LBB4_18:
	callq	hipDeviceSynchronize
	leaq	-192(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r14), %rax
	movq	8(%r14), %rdx
	leaq	-144(%rbp), %rbx
	subq	(%rbx), %rax
	imulq	$1000000, %rax, %rax            # imm = 0xF4240
	subq	8(%rbx), %rdx
	addq	%rax, %rdx
	movl	$.L.str.4, %esi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	-104(%rbp), %rsi
	movq	%r13, %rdi
	movq	-56(%rbp), %rdx                 # 8-byte Reload
	movl	$2, %ecx
	callq	hipMemcpy
	movq	-128(%rbp), %rdi
	callq	hipFree
	movq	-120(%rbp), %rdi
	callq	hipFree
	movq	-112(%rbp), %rdi
	callq	hipFree
	movq	-104(%rbp), %rdi
	callq	hipFree
	callq	hipDeviceSynchronize
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r14), %rax
	movq	8(%r14), %rdx
	subq	(%rbx), %rax
	imulq	$1000000, %rax, %rax            # imm = 0xF4240
	subq	8(%rbx), %rdx
	addq	%rax, %rdx
	movl	$.L.str.4, %esi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	leaq	-256(%rbp), %rbx
	movl	$.L.str.10, %esi
	movq	%rbx, %rdi
	movq	-176(%rbp), %rdx                # 8-byte Reload
	xorl	%eax, %eax
	callq	sprintf
	movl	$.L.str.6, %esi
	movq	%rbx, %rdi
	callq	fopen
	movq	%rax, %rbx
	leaq	-80(%rbp), %r14
	movl	$4, %esi
	movl	$1, %edx
	movq	%r14, %rdi
	movq	%rax, %rcx
	callq	fwrite
	leaq	-60(%rbp), %rdi
	movl	$4, %esi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	fwrite
	movl	(%r14), %eax
	movq	%rax, -88(%rbp)                 # 8-byte Spill
	testl	%eax, %eax
	jle	.LBB4_24
# %bb.19:                               # %.preheader.lr.ph
	movl	-60(%rbp), %eax
	movq	%rax, -72(%rbp)                 # 8-byte Spill
	cltq
	shlq	$2, %rax
	movq	%rax, -56(%rbp)                 # 8-byte Spill
	xorl	%r12d, %r12d
.LBB4_20:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_22 Depth 2
	movq	%r13, %r15
	cmpl	$0, -72(%rbp)                   # 4-byte Folded Reload
	jle	.LBB4_23
# %bb.21:                               # %.lr.ph94
                                        #   in Loop: Header=BB4_20 Depth=1
	movq	-72(%rbp), %r13                 # 8-byte Reload
	movq	%r15, %r14
.LBB4_22:                               #   Parent Loop BB4_20 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	$4, %esi
	movl	$1, %edx
	movq	%r14, %rdi
	movq	%rbx, %rcx
	callq	fwrite
	addq	$4, %r14
	decq	%r13
	jne	.LBB4_22
.LBB4_23:                               # %._crit_edge95
                                        #   in Loop: Header=BB4_20 Depth=1
	incq	%r12
	movq	%r15, %r13
	addq	-56(%rbp), %r13                 # 8-byte Folded Reload
	cmpq	-88(%rbp), %r12                 # 8-byte Folded Reload
	jne	.LBB4_20
.LBB4_24:                               # %._crit_edge97
	movq	%rbx, %rdi
	callq	fclose
	leaq	-192(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%rbx), %rax
	movq	8(%rbx), %rdx
	subq	-144(%rbp), %rax
	imulq	$1000000, %rax, %rax            # imm = 0xF4240
	subq	-136(%rbp), %rdx
	addq	%rax, %rdx
	movl	$.L.str.7, %esi
	movq	-96(%rbp), %rbx                 # 8-byte Reload
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movq	%rbx, %rdi
	callq	fclose
	movq	-168(%rbp), %rsp                # 8-byte Reload
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.LBB4_15:
	.cfi_def_cfa %rbp, 16
	movq	stderr(%rip), %rcx
	movl	$.L.str.3, %edi
	movl	$14, %esi
	movl	$1, %edx
	callq	fwrite
	movl	$1, %edi
	callq	exit
.Lfunc_end4:
	.size	_Z10uncompressPc, .Lfunc_end4-_Z10uncompressPc
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.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
	movq	%rsi, %rbx
	cmpl	$3, %edi
	jne	.LBB5_6
# %bb.1:
	movq	8(%rbx), %r14
	movl	$.L.str.11, %esi
	movq	%r14, %rdi
	callq	strcmp
	testl	%eax, %eax
	je	.LBB5_3
# %bb.2:
	movl	$.L.str.12, %esi
	movq	%r14, %rdi
	callq	strcmp
	testl	%eax, %eax
	jne	.LBB5_6
.LBB5_3:
	movq	16(%rbx), %rdi
	callq	_Z10fileExistsPc
	testb	%al, %al
	je	.LBB5_7
# %bb.4:
	movq	8(%rbx), %rdi
	movl	$.L.str.11, %esi
	callq	strcmp
	movq	16(%rbx), %rdi
	testl	%eax, %eax
	jne	.LBB5_9
# %bb.5:
	callq	_Z8compressPc
	jmp	.LBB5_10
.LBB5_6:
	movq	stderr(%rip), %rdi
	movq	(%rbx), %rcx
	movl	$.L.str.13, %esi
	movq	%rcx, %rdx
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB5_8
.LBB5_7:
	movq	stderr(%rip), %rdi
	movq	16(%rbx), %rdx
	movl	$.L.str.14, %esi
	xorl	%eax, %eax
	callq	fprintf
.LBB5_8:
	movl	$1, %edi
	callq	exit
.LBB5_9:
	callq	_Z10uncompressPc
.LBB5_10:
	xorl	%edi, %edi
	callq	exit
.Lfunc_end5:
	.size	main, .Lfunc_end5-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	.LBB6_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB6_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z13compressedRowPiS_S_S_S_i, %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	$_Z13decompressRowPiS_S_S_ii, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %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_end6:
	.size	__hip_module_ctor, .Lfunc_end6-__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	.LBB7_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
.LBB7_2:
	retq
.Lfunc_end7:
	.size	__hip_module_dtor, .Lfunc_end7-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z13compressedRowPiS_S_S_S_i,@object # @_Z13compressedRowPiS_S_S_S_i
	.section	.rodata,"a",@progbits
	.globl	_Z13compressedRowPiS_S_S_S_i
	.p2align	3, 0x0
_Z13compressedRowPiS_S_S_S_i:
	.quad	_Z28__device_stub__compressedRowPiS_S_S_S_i
	.size	_Z13compressedRowPiS_S_S_S_i, 8

	.type	_Z13decompressRowPiS_S_S_ii,@object # @_Z13decompressRowPiS_S_S_ii
	.globl	_Z13decompressRowPiS_S_S_ii
	.p2align	3, 0x0
_Z13decompressRowPiS_S_S_ii:
	.quad	_Z28__device_stub__decompressRowPiS_S_S_ii
	.size	_Z13decompressRowPiS_S_S_ii, 8

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

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"sectionResultsCompress.csv"
	.size	.L.str.1, 27

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"a+"
	.size	.L.str.2, 3

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Reading Error\n"
	.size	.L.str.3, 15

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"%li,"
	.size	.L.str.4, 5

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"%s.crs"
	.size	.L.str.5, 7

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"ab+"
	.size	.L.str.6, 4

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"%li\n"
	.size	.L.str.7, 5

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"sectionResultsUncompress.csv"
	.size	.L.str.8, 29

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

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"%s.out"
	.size	.L.str.10, 7

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"-c"
	.size	.L.str.11, 3

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"-u"
	.size	.L.str.12, 3

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"Usage:\n%s -c filename ....... to compress\n%s -u filename ....... to uncompress\n"
	.size	.L.str.13, 80

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"File %s does not exist.\n"
	.size	.L.str.14, 25

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z13compressedRowPiS_S_S_S_i"
	.size	.L__unnamed_1, 29

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z13decompressRowPiS_S_S_ii"
	.size	.L__unnamed_2, 28

	.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 _Z28__device_stub__compressedRowPiS_S_S_S_i
	.addrsig_sym _Z28__device_stub__decompressRowPiS_S_S_ii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z13compressedRowPiS_S_S_S_i
	.addrsig_sym _Z13decompressRowPiS_S_S_ii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z13compressedRowPiS_S_S_S_i ; -- Begin function _Z13compressedRowPiS_S_S_S_i
	.globl	_Z13compressedRowPiS_S_S_S_i
	.p2align	8
	.type	_Z13compressedRowPiS_S_S_S_i,@function
_Z13compressedRowPiS_S_S_S_i:           ; @_Z13compressedRowPiS_S_S_S_i
; %bb.0:
	s_load_b32 s14, s[0:1], 0x28
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s14, 1
	s_cbranch_scc1 .LBB0_5
; %bb.1:                                ; %.lr.ph.preheader
	s_load_b256 s[4:11], s[0:1], 0x0
	s_mul_i32 s12, s15, s14
	s_mov_b32 s13, 0
	s_mov_b32 s2, s15
	s_lshl_b64 s[16:17], s[12:13], 2
	s_mov_b32 s3, s13
	v_mov_b32_e32 v0, 0
	s_waitcnt lgkmcnt(0)
	s_add_u32 s4, s4, s16
	s_addc_u32 s5, s5, s17
	s_lshl_b64 s[16:17], s[2:3], 2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s6, s6, s16
	s_addc_u32 s7, s7, s17
	s_load_b64 s[0:1], s[0:1], 0x20
	s_load_b32 s6, s[6:7], 0x0
.LBB0_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b32 v1, v0, s[4:5]
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, 0, v1
	s_cbranch_vccnz .LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	s_waitcnt lgkmcnt(0)
	s_ashr_i32 s7, s6, 31
	s_add_i32 s3, s6, 1
	s_lshl_b64 s[6:7], s[6:7], 2
	v_dual_mov_b32 v2, s13 :: v_dual_mov_b32 v3, s2
	s_add_u32 s16, s0, s6
	s_addc_u32 s17, s1, s7
	s_add_u32 s18, s10, s6
	s_addc_u32 s19, s11, s7
	s_add_u32 s6, s8, s6
	s_addc_u32 s7, s9, s7
	s_clause 0x1
	global_store_b32 v0, v1, s[6:7]
	global_store_b32 v0, v2, s[18:19]
	s_mov_b32 s6, s3
	global_store_b32 v0, v3, s[16:17]
.LBB0_4:                                ;   in Loop: Header=BB0_2 Depth=1
	s_add_i32 s13, s13, 1
	s_add_u32 s4, s4, 4
	s_addc_u32 s5, s5, 0
	s_cmp_lg_u32 s14, s13
	s_cbranch_scc1 .LBB0_2
.LBB0_5:                                ; %._crit_edge
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z13compressedRowPiS_S_S_S_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 44
		.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 4
		.amdhsa_next_free_sgpr 20
		.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	_Z13compressedRowPiS_S_S_S_i, .Lfunc_end0-_Z13compressedRowPiS_S_S_S_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 228
; NumSgprs: 22
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 22
; NumVGPRsForWavesPerEU: 4
; 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	_Z13decompressRowPiS_S_S_ii ; -- Begin function _Z13decompressRowPiS_S_S_ii
	.globl	_Z13decompressRowPiS_S_S_ii
	.p2align	8
	.type	_Z13decompressRowPiS_S_S_ii,@function
_Z13decompressRowPiS_S_S_ii:            ; @_Z13decompressRowPiS_S_S_ii
; %bb.0:
	s_clause 0x1
	s_load_b64 s[8:9], s[0:1], 0x20
	s_load_b256 s[0:7], s[0:1], 0x0
	s_mov_b32 s11, 0
	v_lshlrev_b32_e32 v1, 2, v0
	v_mov_b32_e32 v3, 0
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s10, s15, s9
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[10:11], s[10:11], 2
	s_add_u32 s0, s0, s10
	s_addc_u32 s1, s1, s11
	s_cmp_lt_i32 s8, 1
	global_store_b32 v1, v3, s[0:1]
	s_cbranch_scc1 .LBB1_7
; %bb.1:                                ; %.lr.ph.preheader
	v_add_co_u32 v1, s0, s0, v1
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v2, null, s1, 0, s0
.LBB1_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b32 v4, v3, s[6:7]
	s_waitcnt vmcnt(0)
	v_cmp_ne_u32_e32 vcc_lo, s15, v4
	s_cbranch_vccnz .LBB1_6
; %bb.3:                                ;   in Loop: Header=BB1_2 Depth=1
	global_load_b32 v4, v3, s[4:5]
	s_mov_b32 s0, exec_lo
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u32_e64 v4, v0
	s_cbranch_execz .LBB1_5
; %bb.4:                                ;   in Loop: Header=BB1_2 Depth=1
	global_load_b32 v4, v3, s[2:3]
	s_waitcnt vmcnt(0)
	global_store_b32 v[1:2], v4, off
.LBB1_5:                                ; %Flow
                                        ;   in Loop: Header=BB1_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s0
.LBB1_6:                                ;   in Loop: Header=BB1_2 Depth=1
	s_add_i32 s8, s8, -1
	s_add_u32 s6, s6, 4
	s_addc_u32 s7, s7, 0
	s_add_u32 s4, s4, 4
	s_addc_u32 s5, s5, 0
	s_add_u32 s2, s2, 4
	s_addc_u32 s3, s3, 0
	s_cmp_lg_u32 s8, 0
	s_cbranch_scc1 .LBB1_2
.LBB1_7:                                ; %._crit_edge
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z13decompressRowPiS_S_S_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 40
		.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	_Z13decompressRowPiS_S_S_ii, .Lfunc_end1-_Z13decompressRowPiS_S_S_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 212
; 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
      - .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
      - .offset:         40
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 44
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z13compressedRowPiS_S_S_S_i
    .private_segment_fixed_size: 0
    .sgpr_count:     22
    .sgpr_spill_count: 0
    .symbol:         _Z13compressedRowPiS_S_S_S_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .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
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         36
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 40
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z13decompressRowPiS_S_S_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z13decompressRowPiS_S_S_ii.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
