#include <cstdio>
#include <random>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <algorithm>
#include <chrono>
#include <iostream>
#include <limits>
#include <cctype>

__device__ int cost_index[16] = { 1,-1,-1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,-1,-1,1 };
#define LENGTH_REFERENCE 40000
#define LENGTH_SEQUENCE 500
#define NUM_SEQUENCES 2

__device__
int ascii_2_index[128];
int ascii_to_index[128];
char index_to_ascii[4];

char* reference_string;
char* sequence_strings;
int* offset_cost;
int* matrix;
int seq_length[NUM_SEQUENCES];

__device__
int max(int a, int b, int c) {
	return a > b ? (a > c ? a : c) : (b > c ? b : c);
}

int get1Dindex(int i, int j) {
	return j * LENGTH_SEQUENCE + i;
}

__device__
int get1Dindex(int seq_pos, int ref_pos, int len_seq) {
	return ref_pos * len_seq + seq_pos;
}

__device__
int getCost(char a, char b) {
	return cost_index[ascii_2_index[a] + ascii_2_index[b] * 4];
}

void initIndexes()
{
	ascii_to_index[(int)'C'] = 0;
	ascii_to_index[(int)'G'] = 1;
	ascii_to_index[(int)'A'] = 2;
	ascii_to_index[(int)'T'] = 3;
}

__global__
void initIndexes_device()
{
	ascii_2_index[(int)'C'] = 0;
	ascii_2_index[(int)'G'] = 1;
	ascii_2_index[(int)'A'] = 2;
	ascii_2_index[(int)'T'] = 3;
}

void initReference()
{
	cudaMallocManaged(&reference_string, (LENGTH_REFERENCE + 1) * sizeof(char));

	index_to_ascii[0] = 'C';
	index_to_ascii[1] = 'G';
	index_to_ascii[2] = 'A';
	index_to_ascii[3] = 'T';

	initIndexes_device<<<1,1>>>();

	/* Random string */
	for (int i = 0; i < LENGTH_REFERENCE; i++)
	{
		int ir = rand() % 4;
		reference_string[i] = index_to_ascii[ir];
	}
	reference_string[LENGTH_REFERENCE] = '\0';
}

void initSequences()
{
	long total_offset = 0;
	long total_matrix_size = 0;
	std::vector<char> ref;
	std::vector<char> seq;
	char sequences[LENGTH_SEQUENCE * NUM_SEQUENCES * 2];

	for (int ix = 0; ix < NUM_SEQUENCES; ix++)
	{
		int ref_offset = rand() % (LENGTH_REFERENCE - LENGTH_SEQUENCE);
		int subs = 0;
		int ins = 0;
		int dels = 0;
		int length = 0;

		std::cout << "Offset for sequence " << ix + 1 << " = " << ref_offset << "\n";

		for (int i = ref_offset; i < ref_offset + LENGTH_SEQUENCE; i++)
		{
			int i_rand = rand() % 1000;

			if (i_rand < 22)
			{
				/* insertion of random length < 5 */
				int i_len = rand() % 4 + 1;
				for (int j = 0; j < i_len; j++)
				{
					sequences[length + total_offset] = index_to_ascii[rand() % 4];
					ref.push_back('+');
					seq.push_back(sequences[length + total_offset]);
					length++;
					ins++;
				}
				sequences[length + total_offset] = reference_string[i];
				ref.push_back(reference_string[i]);
				seq.push_back(reference_string[i]);
				length++;
			}
			else if (i_rand < 44)
			{
				/* substitution */

				int inew = rand() % 3;

				/* Lower case denotes substitution */
				ref.push_back(std::tolower(reference_string[i]));

				switch (reference_string[i])
				{
				case 'A':
					sequences[length + total_offset] = index_to_ascii[inew == 2 ? 3 : inew];
					break;
				case 'T':
					sequences[length + total_offset] = index_to_ascii[inew];
					break;
				case 'C':
					sequences[length + total_offset] = index_to_ascii[inew + 1];
					break;
				case 'G':
					sequences[length + total_offset] = index_to_ascii[inew == 1 ? 0 : inew];
					break;
				}

				seq.push_back(std::tolower(sequences[length + total_offset]));

				length++;
				subs++;
			}
			else if (i_rand < 66)
			{
				/* deletion */
				ref.push_back(reference_string[i]);
				seq.push_back('_');
				dels++;
			}
			else
			{
				sequences[length + total_offset] = reference_string[i];
				ref.push_back(reference_string[i]);
				seq.push_back(reference_string[i]);
				length++;
			}


		}

		seq_length[ix] = length;
		total_offset += length;
		total_matrix_size += (length + 1) * (LENGTH_REFERENCE - length) * 2;

		ref.push_back('\0');
		seq.push_back('\0');


		std::cout << "Sequence " << ix + 1 << ": ";
		std::cout << subs << " subs, ";
		std::cout << dels << " dels, ";
		std::cout << ins << " ins" << "\n";

		std::cout << ref.data() << "\n";
		std::cout << seq.data() << "\n";
		ref.clear();
		seq.clear();
	}


	cudaMallocManaged(&sequence_strings, sizeof(char) * total_offset);
	::memcpy(sequence_strings, sequences, total_offset);

}


//innermost function - executed by one thread
__device__
void calculate_column(int* column_values, int col_height, char ref, char* seq, int col)
{
	int cost_del = -1;
	int tr = -col - 1;
	int tl = -col;

	for (int i = 0; i < col_height; i++)
	{
		char s = seq[i];
		int cost_m = getCost(s, ref) + tl;
		tl = column_values[i];
		column_values[i] = max(tr + cost_del, cost_m , column_values[i] + cost_del);
		tr = column_values[i];

	}
}

__device__
void calculate_offset_cost(int* column_values, int col_height, char* ref, char* seq, int ref_offset)
{
	for (int i = 0; i < col_height; i++)
	{
		calculate_column(column_values, col_height, ref[ref_offset + i], seq, i);
	}

}

__global__
void init_matrix(int* matrix, char* seq, int len_seq)
{
	int ref_pos = threadIdx.x + blockDim.x * blockIdx.x;

	if (ref_pos < LENGTH_REFERENCE - len_seq)
	{
		//initialise whole grid (in parallel)
		for (int seq_pos = 0; seq_pos < len_seq; seq_pos++)
		{
			// set each colum to 0, -1, -2, etc...
			int index = get1Dindex(seq_pos, ref_pos, len_seq);
			matrix[index] = -(seq_pos + 1);
		}
	}

}

__global__
void calculate_cost_per_offset(int* matrix, char* ref, char* seq, int len_seq)
{
	int ref_pos = threadIdx.x + blockDim.x * blockIdx.x;

	if (ref_pos < LENGTH_REFERENCE - len_seq)
	{
		//for each possible alignment compute the cost for the current column
		int matrix_offset = get1Dindex(0, ref_pos, len_seq);
		calculate_offset_cost(matrix + matrix_offset, len_seq, ref, seq, ref_pos);

	}

}

//outermost function that computes the optimal alignment
int calculate_alignment(char* ref, char* seq, int len_seq)
{
	int num_blocks = 256;
	int num_threads = 256;
	int matrix_size = (LENGTH_REFERENCE - len_seq) * (len_seq + 1);

	int* matrix;

	cudaMallocManaged(&matrix, sizeof(int) * matrix_size);

	init_matrix<<<num_blocks, num_threads>>>(matrix, seq, len_seq);

	calculate_cost_per_offset<<<num_blocks, num_threads>>>(matrix, ref, seq, len_seq);

	cudaDeviceSynchronize();

	int max_cost = matrix[len_seq - 1];
	int offset = 0;

	for (int ref_pos = 1; ref_pos < LENGTH_REFERENCE - len_seq; ref_pos++)
	{
		const int index = ref_pos * len_seq + len_seq - 1;
		const int cost = matrix[index];
		if (cost > max_cost) {
			max_cost = cost;
			offset = ref_pos;
		}
	}

	cudaFree(matrix);
	return offset;

}


int main()
{
	std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();

	long offset = 0;
	int seq_offset = 0;

	initIndexes();
	initReference();
	initSequences();

	cudaDeviceSynchronize();

	for (int i = 0; i < NUM_SEQUENCES; i++)
	{
		offset = calculate_alignment(reference_string, sequence_strings + seq_offset, seq_length[i]);
		seq_offset += seq_length[i];

		std::cout << "Optimal cost of " << 0 << " found at offset " << offset << "\n";
	}

	cudaFree(sequence_strings);
	cudaFree(reference_string);

	std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now();


	std::chrono::duration<double, std::milli> time_span = t2 - t1;

	std::cout << "It took " << time_span.count() << " milliseconds.\n";


	return 0;
}

	.file	"tmpxft_00392bf2_00000000-6_cuda_inline_nw.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB5062:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE5062:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z3maxiii
	.type	_Z3maxiii, @function
_Z3maxiii:
.LFB5035:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE5035:
	.size	_Z3maxiii, .-_Z3maxiii
	.globl	_Z10get1Dindexii
	.type	_Z10get1Dindexii, @function
_Z10get1Dindexii:
.LFB5036:
	.cfi_startproc
	endbr64
	imull	$500, %esi, %eax
	addl	%edi, %eax
	ret
	.cfi_endproc
.LFE5036:
	.size	_Z10get1Dindexii, .-_Z10get1Dindexii
	.globl	_Z10get1Dindexiii
	.type	_Z10get1Dindexiii, @function
_Z10get1Dindexiii:
.LFB5876:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE5876:
	.size	_Z10get1Dindexiii, .-_Z10get1Dindexiii
	.globl	_Z7getCostcc
	.type	_Z7getCostcc, @function
_Z7getCostcc:
.LFB5038:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE5038:
	.size	_Z7getCostcc, .-_Z7getCostcc
	.globl	_Z11initIndexesv
	.type	_Z11initIndexesv, @function
_Z11initIndexesv:
.LFB5039:
	.cfi_startproc
	endbr64
	movl	$1, 284+ascii_to_index(%rip)
	xorl	%eax, %eax
	movl	%eax, 268+ascii_to_index(%rip)
	movl	$2, 260+ascii_to_index(%rip)
	movl	$3, 336+ascii_to_index(%rip)
	ret
	.cfi_endproc
.LFE5039:
	.size	_Z11initIndexesv, .-_Z11initIndexesv
	.globl	_Z16calculate_columnPiicPci
	.type	_Z16calculate_columnPiicPci, @function
_Z16calculate_columnPiicPci:
.LFB5052:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE5052:
	.size	_Z16calculate_columnPiicPci, .-_Z16calculate_columnPiicPci
	.globl	_Z21calculate_offset_costPiiPcS0_i
	.type	_Z21calculate_offset_costPiiPcS0_i, @function
_Z21calculate_offset_costPiiPcS0_i:
.LFB5053:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE5053:
	.size	_Z21calculate_offset_costPiiPcS0_i, .-_Z21calculate_offset_costPiiPcS0_i
	.globl	_Z37__device_stub__Z18initIndexes_devicevv
	.type	_Z37__device_stub__Z18initIndexes_devicevv, @function
_Z37__device_stub__Z18initIndexes_devicevv:
.LFB5084:
	.cfi_startproc
	endbr64
	subq	$88, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	movabsq	$4294967297, %rax
	leaq	8(%rsp), %rcx
	movq	%rsp, %rdx
	leaq	28(%rsp), %rsi
	leaq	16(%rsp), %rdi
	movl	$1, 24(%rsp)
	movl	$1, 36(%rsp)
	movq	%rax, 16(%rsp)
	movq	%rax, 28(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L14
	pushq	8(%rsp)
	.cfi_def_cfa_offset 104
	leaq	_Z18initIndexes_devicev(%rip), %rdi
	pushq	8(%rsp)
	.cfi_def_cfa_offset 112
	movq	44(%rsp), %rcx
	movl	52(%rsp), %r8d
	movq	32(%rsp), %rsi
	movl	40(%rsp), %edx
	leaq	80(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 104
	popq	%rdx
	.cfi_def_cfa_offset 96
.L14:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	addq	$88, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5084:
	.size	_Z37__device_stub__Z18initIndexes_devicevv, .-_Z37__device_stub__Z18initIndexes_devicevv
	.globl	_Z18initIndexes_devicev
	.type	_Z18initIndexes_devicev, @function
_Z18initIndexes_devicev:
.LFB5085:
	.cfi_startproc
	endbr64
	jmp	_Z37__device_stub__Z18initIndexes_devicevv
	.cfi_endproc
.LFE5085:
	.size	_Z18initIndexes_devicev, .-_Z18initIndexes_devicev
	.globl	_Z13initReferencev
	.type	_Z13initReferencev, @function
_Z13initReferencev:
.LFB5040:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	$1, %edx
	movl	$40001, %esi
	leaq	reference_string(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	call	cudaMallocManaged@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1413564227, index_to_ascii(%rip)
	movq	%rdi, %rdx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L21
	call	_Z37__device_stub__Z18initIndexes_devicevv
.L21:
	xorl	%ebx, %ebx
	leaq	index_to_ascii(%rip), %rbp
.L22:
	call	rand@PLT
	movl	$4, %ecx
	cltd
	idivl	%ecx
	movq	reference_string(%rip), %rax
	movslq	%edx, %rdx
	movb	0(%rbp,%rdx), %dl
	movb	%dl, (%rax,%rbx)
	incq	%rbx
	cmpq	$40000, %rbx
	jne	.L22
	movq	reference_string(%rip), %rax
	movb	$0, 40000(%rax)
	addq	$40, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5040:
	.size	_Z13initReferencev, .-_Z13initReferencev
	.globl	_Z34__device_stub__Z11init_matrixPiPciPiPci
	.type	_Z34__device_stub__Z11init_matrixPiPciPiPci, @function
_Z34__device_stub__Z11init_matrixPiPciPiPci:
.LFB5086:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%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)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L25
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z11init_matrixPiPci(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	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 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L25:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5086:
	.size	_Z34__device_stub__Z11init_matrixPiPciPiPci, .-_Z34__device_stub__Z11init_matrixPiPciPiPci
	.globl	_Z11init_matrixPiPci
	.type	_Z11init_matrixPiPci, @function
_Z11init_matrixPiPci:
.LFB5087:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z11init_matrixPiPciPiPci
	.cfi_endproc
.LFE5087:
	.size	_Z11init_matrixPiPci, .-_Z11init_matrixPiPci
	.globl	_Z51__device_stub__Z25calculate_cost_per_offsetPiPcS0_iPiPcS0_i
	.type	_Z51__device_stub__Z25calculate_cost_per_offsetPiPcS0_iPiPcS0_i, @function
_Z51__device_stub__Z25calculate_cost_per_offsetPiPcS0_iPiPcS0_i:
.LFB5088:
	.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	.L30
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z25calculate_cost_per_offsetPiPcS0_i(%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
.L30:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5088:
	.size	_Z51__device_stub__Z25calculate_cost_per_offsetPiPcS0_iPiPcS0_i, .-_Z51__device_stub__Z25calculate_cost_per_offsetPiPcS0_iPiPcS0_i
	.globl	_Z25calculate_cost_per_offsetPiPcS0_i
	.type	_Z25calculate_cost_per_offsetPiPcS0_i, @function
_Z25calculate_cost_per_offsetPiPcS0_i:
.LFB5089:
	.cfi_startproc
	endbr64
	jmp	_Z51__device_stub__Z25calculate_cost_per_offsetPiPcS0_iPiPcS0_i
	.cfi_endproc
.LFE5089:
	.size	_Z25calculate_cost_per_offsetPiPcS0_i, .-_Z25calculate_cost_per_offsetPiPcS0_i
	.globl	_Z19calculate_alignmentPcS_i
	.type	_Z19calculate_alignmentPcS_i, @function
_Z19calculate_alignmentPcS_i:
.LFB5054:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rsi, %r12
	leal	1(%rdx), %esi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	$40000, %ebp
	subl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%edx, %ebx
	movl	$1, %edx
	imull	%ebp, %esi
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movslq	%esi, %rsi
	leaq	8(%rsp), %rdi
	salq	$2, %rsi
	call	cudaMallocManaged@PLT
	movl	$16777217, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$8, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movl	$1, 36(%rsp)
	movq	%rdi, %rdx
	movq	%rdi, 28(%rsp)
	movq	%rdi, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L36
	movq	8(%rsp), %rdi
	movl	%ebx, %edx
	movq	%r12, %rsi
	call	_Z34__device_stub__Z11init_matrixPiPciPiPci
.L36:
	movl	$16777217, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$8, %rdi
	movl	$1, %esi
	movl	$1, 36(%rsp)
	movq	%rdi, %rdx
	movq	%rdi, 28(%rsp)
	movq	%rdi, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L37
	movq	8(%rsp), %rdi
	movl	%ebx, %ecx
	movq	%r12, %rdx
	movq	%r13, %rsi
	call	_Z51__device_stub__Z25calculate_cost_per_offsetPiPcS0_iPiPcS0_i
.L37:
	call	cudaDeviceSynchronize@PLT
	movq	8(%rsp), %rdi
	movslq	%ebx, %rdx
	addl	%ebx, %ebx
	salq	$2, %rdx
	movslq	%ebx, %rbx
	movl	$1, %eax
	movl	-4(%rdi,%rdx), %ecx
	leaq	(%rdi,%rbx,4), %rsi
	xorl	%ebx, %ebx
.L38:
	cmpl	%eax, %ebp
	jle	.L43
	movl	-4(%rsi), %r8d
	leal	1(%rax), %r9d
	cmpl	%r8d, %ecx
	jl	.L39
	movl	%ebx, %eax
	movl	%ecx, %r8d
.L39:
	movl	%eax, %ebx
	addq	%rdx, %rsi
	movl	%r9d, %eax
	movl	%r8d, %ecx
	jmp	.L38
.L43:
	call	cudaFree@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	addq	$56, %rsp
	.cfi_def_cfa_offset 40
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5054:
	.size	_Z19calculate_alignmentPcS_i, .-_Z19calculate_alignmentPcS_i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z25calculate_cost_per_offsetPiPcS0_i"
.LC1:
	.string	"_Z11init_matrixPiPci"
.LC2:
	.string	"_Z18initIndexes_devicev"
.LC3:
	.string	"cost_index"
.LC4:
	.string	"ascii_2_index"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB5091:
	.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	.LC0(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z25calculate_cost_per_offsetPiPcS0_i(%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	.LC1(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z11init_matrixPiPci(%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	.LC2(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z18initIndexes_devicev(%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	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC3(%rip), %rdx
	movl	$64, %r9d
	leaq	_ZL10cost_index(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC4(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$512, %r9d
	leaq	_ZL13ascii_2_index(%rip), %rsi
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.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
.LFE5091:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIcSaIcEED2Ev,"axG",@progbits,_ZNSt6vectorIcSaIcEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIcSaIcEED2Ev
	.type	_ZNSt6vectorIcSaIcEED2Ev, @function
_ZNSt6vectorIcSaIcEED2Ev:
.LFB5442:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L46
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L46:
	ret
	.cfi_endproc
.LFE5442:
	.size	_ZNSt6vectorIcSaIcEED2Ev, .-_ZNSt6vectorIcSaIcEED2Ev
	.weak	_ZNSt6vectorIcSaIcEED1Ev
	.set	_ZNSt6vectorIcSaIcEED1Ev,_ZNSt6vectorIcSaIcEED2Ev
	.section	.text._ZNKSt6vectorIcSaIcEE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorIcSaIcEE12_M_check_lenEmPKc,comdat
	.align 2
	.weak	_ZNKSt6vectorIcSaIcEE12_M_check_lenEmPKc
	.type	_ZNKSt6vectorIcSaIcEE12_M_check_lenEmPKc, @function
_ZNKSt6vectorIcSaIcEE12_M_check_lenEmPKc:
.LFB5748:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movq	%rdx, %rdi
	movq	8(%rax), %rcx
	subq	(%rax), %rcx
	movabsq	$9223372036854775807, %rax
	movq	%rax, %rdx
	subq	%rcx, %rdx
	cmpq	%rsi, %rdx
	jnb	.L49
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_ZSt20__throw_length_errorPKc@PLT
.L49:
	.cfi_def_cfa_offset 8
	cmpq	%rcx, %rsi
	cmovb	%rcx, %rsi
	addq	%rsi, %rcx
	jc	.L48
	movabsq	$9223372036854775807, %rax
	cmpq	%rax, %rcx
	cmovbe	%rcx, %rax
.L48:
	ret
	.cfi_endproc
.LFE5748:
	.size	_ZNKSt6vectorIcSaIcEE12_M_check_lenEmPKc, .-_ZNKSt6vectorIcSaIcEE12_M_check_lenEmPKc
	.section	.rodata._ZNSt6vectorIcSaIcEE9push_backERKc.str1.1,"aMS",@progbits,1
.LC5:
	.string	"vector::_M_realloc_insert"
	.section	.text._ZNSt6vectorIcSaIcEE9push_backERKc,"axG",@progbits,_ZNSt6vectorIcSaIcEE9push_backERKc,comdat
	.align 2
	.weak	_ZNSt6vectorIcSaIcEE9push_backERKc
	.type	_ZNSt6vectorIcSaIcEE9push_backERKc, @function
_ZNSt6vectorIcSaIcEE9push_backERKc:
.LFB5446:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	8(%rdi), %r14
	cmpq	16(%rdi), %r14
	je	.L58
	movb	(%rsi), %al
	movb	%al, (%r14)
	incq	8(%rdi)
	jmp	.L57
.L58:
	leaq	.LC5(%rip), %rdx
	movl	$1, %esi
	movq	%r14, %r15
	call	_ZNKSt6vectorIcSaIcEE12_M_check_lenEmPKc
	movq	0(%rbp), %r12
	movq	%rax, (%rsp)
	movq	8(%rbp), %rax
	subq	%r12, %r15
	cmpq	$0, (%rsp)
	movq	%rax, 8(%rsp)
	je	.L65
	jns	.L61
	call	_ZSt17__throw_bad_allocv@PLT
.L61:
	movq	(%rsp), %rdi
	call	_Znwm@PLT
	movq	%rax, %rbx
	jmp	.L60
.L65:
	xorl	%ebx, %ebx
.L60:
	movb	0(%r13), %al
	movb	%al, (%rbx,%r15)
	testq	%r15, %r15
	jle	.L62
	movq	%r15, %rdx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	memmove@PLT
.L62:
	movq	8(%rsp), %r13
	leaq	1(%rbx,%r15), %rdi
	subq	%r14, %r13
	testq	%r13, %r13
	jle	.L63
	movq	%r13, %rdx
	movq	%r14, %rsi
	call	memmove@PLT
	movq	%rax, %rdi
.L63:
	addq	%rdi, %r13
	testq	%r12, %r12
	je	.L64
	movq	16(%rbp), %rsi
	movq	%r12, %rdi
	subq	%r12, %rsi
	call	_ZdlPvm@PLT
.L64:
	movq	(%rsp), %rax
	movq	%rbx, 0(%rbp)
	movq	%r13, 8(%rbp)
	addq	%rax, %rbx
	movq	%rbx, 16(%rbp)
.L57:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5446:
	.size	_ZNSt6vectorIcSaIcEE9push_backERKc, .-_ZNSt6vectorIcSaIcEE9push_backERKc
	.text
	.align 2
	.type	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_.isra.0, @function
_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_.isra.0:
.LFB5888:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	8(%rdi), %r14
	cmpq	16(%rdi), %r14
	je	.L71
	movb	(%rsi), %al
	movb	%al, (%r14)
	incq	8(%rdi)
	jmp	.L70
.L71:
	leaq	.LC5(%rip), %rdx
	movl	$1, %esi
	movq	%r14, %r15
	call	_ZNKSt6vectorIcSaIcEE12_M_check_lenEmPKc
	movq	0(%rbp), %r12
	movq	%rax, (%rsp)
	movq	8(%rbp), %rax
	subq	%r12, %r15
	cmpq	$0, (%rsp)
	movq	%rax, 8(%rsp)
	je	.L78
	jns	.L74
	call	_ZSt17__throw_bad_allocv@PLT
.L74:
	movq	(%rsp), %rdi
	call	_Znwm@PLT
	movq	%rax, %rbx
	jmp	.L73
.L78:
	xorl	%ebx, %ebx
.L73:
	movb	0(%r13), %al
	movb	%al, (%rbx,%r15)
	testq	%r15, %r15
	jle	.L75
	movq	%r15, %rdx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	memmove@PLT
.L75:
	movq	8(%rsp), %r13
	leaq	1(%rbx,%r15), %rdi
	subq	%r14, %r13
	testq	%r13, %r13
	jle	.L76
	movq	%r13, %rdx
	movq	%r14, %rsi
	call	memmove@PLT
	movq	%rax, %rdi
.L76:
	addq	%rdi, %r13
	testq	%r12, %r12
	je	.L77
	movq	16(%rbp), %rsi
	movq	%r12, %rdi
	subq	%r12, %rsi
	call	_ZdlPvm@PLT
.L77:
	movq	(%rsp), %rax
	movq	%rbx, 0(%rbp)
	movq	%r13, 8(%rbp)
	addq	%rax, %rbx
	movq	%rbx, 16(%rbp)
.L70:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5888:
	.size	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_.isra.0, .-_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_.isra.0
	.section	.rodata.str1.1
.LC6:
	.string	"Offset for sequence "
.LC7:
	.string	" = "
.LC8:
	.string	"\n"
.LC9:
	.string	"Sequence "
.LC10:
	.string	": "
.LC11:
	.string	" subs, "
.LC12:
	.string	" dels, "
.LC13:
	.string	" ins"
	.text
	.globl	_Z13initSequencesv
	.type	_Z13initSequencesv, @function
_Z13initSequencesv:
.LFB5041:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA5041
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%edx, %edx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	xorl	%r14d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$2136, %rsp
	.cfi_def_cfa_offset 2192
	movq	%fs:40, %rax
	movq	%rax, 2120(%rsp)
	xorl	%eax, %eax
	movq	%rdx, 72(%rsp)
	movq	%rdx, 80(%rsp)
	movq	%rdx, 88(%rsp)
	movq	%rdx, 96(%rsp)
	movq	%rdx, 104(%rsp)
	movq	%rdx, 112(%rsp)
	movq	$1, 8(%rsp)
.L101:
	call	rand@PLT
	movl	$39500, %ecx
	leaq	.LC6(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	cltd
	idivl	%ecx
	movslq	%edx, %rbp
	movl	%ebp, 32(%rsp)
.LEHB0:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	8(%rsp), %eax
	movl	%eax, %esi
	movl	%eax, 20(%rsp)
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC7(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%ebp, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC8(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leal	499(%rbp), %eax
	xorl	%ebx, %ebx
	leaq	index_to_ascii(%rip), %r15
	movl	%eax, 52(%rsp)
	xorl	%eax, %eax
	movl	%eax, 48(%rsp)
	movl	%eax, 28(%rsp)
	movl	%eax, 24(%rsp)
.L98:
	call	rand@PLT
	movl	$1000, %ecx
	cltd
	idivl	%ecx
	cmpl	$21, %edx
	jg	.L84
	call	rand@PLT
	movl	$4, %ecx
	movslq	%ebx, %r12
	xorl	%r13d, %r13d
	cltd
	addq	%r14, %r12
	idivl	%ecx
	movl	%edx, 40(%rsp)
.L85:
	cmpl	%r13d, 40(%rsp)
	jl	.L114
	call	rand@PLT
	leaq	120(%rsp), %rcx
	leaq	71(%rsp), %rsi
	movb	$43, 71(%rsp)
	movq	%rcx, 56(%rsp)
	cltd
	movl	$4, %ecx
	leaq	72(%rsp), %rdi
	idivl	%ecx
	movslq	%edx, %rdx
	movb	(%r15,%rdx), %al
	movb	%al, 120(%rsp,%r12)
	call	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_.isra.0
	movq	56(%rsp), %rsi
	leaq	96(%rsp), %rdi
	addq	%r12, %rsi
	call	_ZNSt6vectorIcSaIcEE9push_backERKc
	incl	%r13d
	incq	%r12
	jmp	.L85
.L114:
	movq	reference_string(%rip), %rsi
	leaq	72(%rsp), %rdi
	addq	%rbp, %rsi
	movb	(%rsi), %al
	movb	%al, 120(%rsp,%r12)
	call	_ZNSt6vectorIcSaIcEE9push_backERKc
	movq	reference_string(%rip), %rsi
	leaq	96(%rsp), %rdi
	addq	%rbp, %rsi
	call	_ZNSt6vectorIcSaIcEE9push_backERKc
	addl	%r13d, 28(%rsp)
	leal	1(%rbx,%r13), %ebx
	jmp	.L87
.L84:
	cmpl	$43, %edx
	leaq	72(%rsp), %r13
	jg	.L88
	call	rand@PLT
	movl	$3, %ecx
	cltd
	idivl	%ecx
	movq	reference_string(%rip), %rax
	movsbl	(%rax,%rbp), %edi
	movslq	%edx, %r12
	call	tolower@PLT
	movq	%r13, %rdi
	movb	%al, 71(%rsp)
	leaq	71(%rsp), %rax
	movq	%rax, %rsi
	movq	%rax, 40(%rsp)
	call	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_.isra.0
	movq	reference_string(%rip), %rax
	movb	(%rax,%rbp), %dl
	movslq	%ebx, %rax
	addq	%r14, %rax
	cmpb	$71, %dl
	je	.L89
	jg	.L90
	cmpb	$65, %dl
	je	.L91
	cmpb	$67, %dl
	jne	.L93
	incl	%r12d
	movslq	%r12d, %r12
	jmp	.L113
.L90:
	cmpb	$84, %dl
	je	.L113
	jmp	.L93
.L91:
	cmpl	$2, %r12d
	movl	$3, %edx
	jmp	.L112
.L89:
	xorl	%edx, %edx
	cmpl	$1, %r12d
.L112:
	cmove	%rdx, %r12
.L113:
	leaq	index_to_ascii(%rip), %rdx
	movb	(%rdx,%r12), %dl
	movb	%dl, 120(%rsp,%rax)
.L93:
	movsbl	120(%rsp,%rax), %edi
	call	tolower@PLT
	movq	40(%rsp), %rsi
	leaq	96(%rsp), %rdi
	movb	%al, 71(%rsp)
	call	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_.isra.0
	incl	24(%rsp)
	incl	%ebx
	jmp	.L87
.L88:
	movq	reference_string(%rip), %rsi
	leaq	96(%rsp), %r12
	addq	%rbp, %rsi
	cmpl	$65, %edx
	jg	.L97
	movq	%r13, %rdi
	call	_ZNSt6vectorIcSaIcEE9push_backERKc
	leaq	71(%rsp), %rsi
	movq	%r12, %rdi
	movb	$95, 71(%rsp)
	call	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_.isra.0
	incl	48(%rsp)
	jmp	.L87
.L97:
	leaq	2128(%r14), %rcx
	movslq	%ebx, %rax
	movq	%r13, %rdi
	leaq	(%rsp,%rcx), %rdx
	movb	(%rsi), %cl
	movb	%cl, -2008(%rax,%rdx)
	call	_ZNSt6vectorIcSaIcEE9push_backERKc
	movq	reference_string(%rip), %rsi
	movq	%r12, %rdi
	addq	%rbp, %rsi
	call	_ZNSt6vectorIcSaIcEE9push_backERKc
	incl	%ebx
.L87:
	incl	32(%rsp)
	incq	%rbp
	movl	32(%rsp), %ecx
	cmpl	%ecx, 52(%rsp)
	jge	.L98
	movq	8(%rsp), %rcx
	leaq	-4+seq_length(%rip), %rax
	movb	$0, 71(%rsp)
	movl	%ebx, (%rax,%rcx,4)
	movslq	%ebx, %rbx
	leaq	72(%rsp), %rax
	addq	%rbx, %r14
	leaq	71(%rsp), %rbx
	movq	%rax, %rdi
	movq	%rax, 32(%rsp)
	movq	%rbx, %rsi
	call	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_.isra.0
	leaq	96(%rsp), %r15
	movq	%rbx, %rsi
	movb	$0, 71(%rsp)
	movq	%r15, %rdi
	call	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_.isra.0
	leaq	_ZSt4cout(%rip), %rbx
	leaq	.LC9(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	20(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC10(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	24(%rsp), %esi
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	48(%rsp), %esi
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	28(%rsp), %esi
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC13(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC8(%rip), %r13
	movq	%rax, %rdi
	movq	%r13, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	72(%rsp), %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%r13, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	96(%rsp), %rbp
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%r13, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpq	80(%rsp), %r12
	je	.L99
	movq	%r12, 80(%rsp)
.L99:
	cmpq	104(%rsp), %rbp
	je	.L100
	movq	%rbp, 104(%rsp)
.L100:
	cmpq	$1, 8(%rsp)
	jne	.L115
	movq	$2, 8(%rsp)
	jmp	.L101
.L115:
	movl	$1, %edx
	movq	%r14, %rsi
	leaq	sequence_strings(%rip), %rdi
	call	cudaMallocManaged@PLT
.LEHE0:
	movq	sequence_strings(%rip), %rdi
	leaq	120(%rsp), %rsi
	movq	%r14, %rcx
	rep movsb
	movq	%r15, %rdi
	call	_ZNSt6vectorIcSaIcEED1Ev
	movq	32(%rsp), %rdi
	call	_ZNSt6vectorIcSaIcEED1Ev
	movq	2120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L104
	jmp	.L110
.L108:
	endbr64
	movq	%rax, %rbx
.L102:
	leaq	96(%rsp), %rdi
	call	_ZNSt6vectorIcSaIcEED1Ev
	leaq	72(%rsp), %rdi
	call	_ZNSt6vectorIcSaIcEED1Ev
	movq	2120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L110
	movq	%rbx, %rdi
.LEHB1:
	call	_Unwind_Resume@PLT
.LEHE1:
.L110:
	call	__stack_chk_fail@PLT
.L104:
	addq	$2136, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5041:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA5041:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE5041-.LLSDACSB5041
.LLSDACSB5041:
	.uleb128 .LEHB0-.LFB5041
	.uleb128 .LEHE0-.LEHB0
	.uleb128 .L108-.LFB5041
	.uleb128 0
	.uleb128 .LEHB1-.LFB5041
	.uleb128 .LEHE1-.LEHB1
	.uleb128 0
	.uleb128 0
.LLSDACSE5041:
	.text
	.size	_Z13initSequencesv, .-_Z13initSequencesv
	.section	.rodata.str1.1
.LC14:
	.string	"Optimal cost of "
.LC15:
	.string	" found at offset "
.LC17:
	.string	"It took "
.LC18:
	.string	" milliseconds.\n"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB5055:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC14(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	seq_length(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	8(%r13), %r14
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movq	%rax, %rbp
	call	_Z11initIndexesv
	call	_Z13initReferencev
	call	_Z13initSequencesv
	call	cudaDeviceSynchronize@PLT
.L117:
	movl	0(%r13), %edx
	movq	reference_string(%rip), %rdi
	movslq	%r12d, %rsi
	addq	$4, %r13
	addq	sequence_strings(%rip), %rsi
	call	_Z19calculate_alignmentPcS_i
	movq	%r15, %rsi
	leaq	_ZSt4cout(%rip), %rdi
	addl	-4(%r13), %r12d
	movl	%eax, %ebx
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	xorl	%esi, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC15(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movslq	%ebx, %rsi
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	leaq	.LC8(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpq	%r13, %r14
	jne	.L117
	movq	sequence_strings(%rip), %rdi
	call	cudaFree@PLT
	movq	reference_string(%rip), %rdi
	call	cudaFree@PLT
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	leaq	.LC17(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	subq	%rbp, %rax
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC16(%rip), %xmm0
	movsd	%xmm0, 8(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	8(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC18(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5055:
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.globl	seq_length
	.bss
	.align 8
	.type	seq_length, @object
	.size	seq_length, 8
seq_length:
	.zero	8
	.globl	matrix
	.align 8
	.type	matrix, @object
	.size	matrix, 8
matrix:
	.zero	8
	.globl	offset_cost
	.align 8
	.type	offset_cost, @object
	.size	offset_cost, 8
offset_cost:
	.zero	8
	.globl	sequence_strings
	.align 8
	.type	sequence_strings, @object
	.size	sequence_strings, 8
sequence_strings:
	.zero	8
	.globl	reference_string
	.align 8
	.type	reference_string, @object
	.size	reference_string, 8
reference_string:
	.zero	8
	.globl	index_to_ascii
	.type	index_to_ascii, @object
	.size	index_to_ascii, 4
index_to_ascii:
	.zero	4
	.globl	ascii_to_index
	.align 32
	.type	ascii_to_index, @object
	.size	ascii_to_index, 512
ascii_to_index:
	.zero	512
	.local	_ZL13ascii_2_index
	.comm	_ZL13ascii_2_index,512,32
	.local	_ZL10cost_index
	.comm	_ZL10cost_index,64,32
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC16:
	.long	0
	.long	1093567616
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <cstdio>
#include <random>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <algorithm>
#include <chrono>
#include <iostream>
#include <limits>
#include <cctype>

__device__ int cost_index[16] = { 1,-1,-1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,-1,-1,1 };
#define LENGTH_REFERENCE 40000
#define LENGTH_SEQUENCE 500
#define NUM_SEQUENCES 2

__device__
int ascii_2_index[128];
int ascii_to_index[128];
char index_to_ascii[4];

char* reference_string;
char* sequence_strings;
int* offset_cost;
int* matrix;
int seq_length[NUM_SEQUENCES];

__device__
int max(int a, int b, int c) {
	return a > b ? (a > c ? a : c) : (b > c ? b : c);
}

int get1Dindex(int i, int j) {
	return j * LENGTH_SEQUENCE + i;
}

__device__
int get1Dindex(int seq_pos, int ref_pos, int len_seq) {
	return ref_pos * len_seq + seq_pos;
}

__device__
int getCost(char a, char b) {
	return cost_index[ascii_2_index[a] + ascii_2_index[b] * 4];
}

void initIndexes()
{
	ascii_to_index[(int)'C'] = 0;
	ascii_to_index[(int)'G'] = 1;
	ascii_to_index[(int)'A'] = 2;
	ascii_to_index[(int)'T'] = 3;
}

__global__
void initIndexes_device()
{
	ascii_2_index[(int)'C'] = 0;
	ascii_2_index[(int)'G'] = 1;
	ascii_2_index[(int)'A'] = 2;
	ascii_2_index[(int)'T'] = 3;
}

void initReference()
{
	hipMallocManaged(&reference_string, (LENGTH_REFERENCE + 1) * sizeof(char));

	index_to_ascii[0] = 'C';
	index_to_ascii[1] = 'G';
	index_to_ascii[2] = 'A';
	index_to_ascii[3] = 'T';

	initIndexes_device<<<1,1>>>();

	/* Random string */
	for (int i = 0; i < LENGTH_REFERENCE; i++)
	{
		int ir = rand() % 4;
		reference_string[i] = index_to_ascii[ir];
	}
	reference_string[LENGTH_REFERENCE] = '\0';
}

void initSequences()
{
	long total_offset = 0;
	long total_matrix_size = 0;
	std::vector<char> ref;
	std::vector<char> seq;
	char sequences[LENGTH_SEQUENCE * NUM_SEQUENCES * 2];

	for (int ix = 0; ix < NUM_SEQUENCES; ix++)
	{
		int ref_offset = rand() % (LENGTH_REFERENCE - LENGTH_SEQUENCE);
		int subs = 0;
		int ins = 0;
		int dels = 0;
		int length = 0;

		std::cout << "Offset for sequence " << ix + 1 << " = " << ref_offset << "\n";

		for (int i = ref_offset; i < ref_offset + LENGTH_SEQUENCE; i++)
		{
			int i_rand = rand() % 1000;

			if (i_rand < 22)
			{
				/* insertion of random length < 5 */
				int i_len = rand() % 4 + 1;
				for (int j = 0; j < i_len; j++)
				{
					sequences[length + total_offset] = index_to_ascii[rand() % 4];
					ref.push_back('+');
					seq.push_back(sequences[length + total_offset]);
					length++;
					ins++;
				}
				sequences[length + total_offset] = reference_string[i];
				ref.push_back(reference_string[i]);
				seq.push_back(reference_string[i]);
				length++;
			}
			else if (i_rand < 44)
			{
				/* substitution */

				int inew = rand() % 3;

				/* Lower case denotes substitution */
				ref.push_back(std::tolower(reference_string[i]));

				switch (reference_string[i])
				{
				case 'A':
					sequences[length + total_offset] = index_to_ascii[inew == 2 ? 3 : inew];
					break;
				case 'T':
					sequences[length + total_offset] = index_to_ascii[inew];
					break;
				case 'C':
					sequences[length + total_offset] = index_to_ascii[inew + 1];
					break;
				case 'G':
					sequences[length + total_offset] = index_to_ascii[inew == 1 ? 0 : inew];
					break;
				}

				seq.push_back(std::tolower(sequences[length + total_offset]));

				length++;
				subs++;
			}
			else if (i_rand < 66)
			{
				/* deletion */
				ref.push_back(reference_string[i]);
				seq.push_back('_');
				dels++;
			}
			else
			{
				sequences[length + total_offset] = reference_string[i];
				ref.push_back(reference_string[i]);
				seq.push_back(reference_string[i]);
				length++;
			}


		}

		seq_length[ix] = length;
		total_offset += length;
		total_matrix_size += (length + 1) * (LENGTH_REFERENCE - length) * 2;

		ref.push_back('\0');
		seq.push_back('\0');


		std::cout << "Sequence " << ix + 1 << ": ";
		std::cout << subs << " subs, ";
		std::cout << dels << " dels, ";
		std::cout << ins << " ins" << "\n";

		std::cout << ref.data() << "\n";
		std::cout << seq.data() << "\n";
		ref.clear();
		seq.clear();
	}


	hipMallocManaged(&sequence_strings, sizeof(char) * total_offset);
	::memcpy(sequence_strings, sequences, total_offset);

}


//innermost function - executed by one thread
__device__
void calculate_column(int* column_values, int col_height, char ref, char* seq, int col)
{
	int cost_del = -1;
	int tr = -col - 1;
	int tl = -col;

	for (int i = 0; i < col_height; i++)
	{
		char s = seq[i];
		int cost_m = getCost(s, ref) + tl;
		tl = column_values[i];
		column_values[i] = max(tr + cost_del, cost_m , column_values[i] + cost_del);
		tr = column_values[i];

	}
}

__device__
void calculate_offset_cost(int* column_values, int col_height, char* ref, char* seq, int ref_offset)
{
	for (int i = 0; i < col_height; i++)
	{
		calculate_column(column_values, col_height, ref[ref_offset + i], seq, i);
	}

}

__global__
void init_matrix(int* matrix, char* seq, int len_seq)
{
	int ref_pos = threadIdx.x + blockDim.x * blockIdx.x;

	if (ref_pos < LENGTH_REFERENCE - len_seq)
	{
		//initialise whole grid (in parallel)
		for (int seq_pos = 0; seq_pos < len_seq; seq_pos++)
		{
			// set each colum to 0, -1, -2, etc...
			int index = get1Dindex(seq_pos, ref_pos, len_seq);
			matrix[index] = -(seq_pos + 1);
		}
	}

}

__global__
void calculate_cost_per_offset(int* matrix, char* ref, char* seq, int len_seq)
{
	int ref_pos = threadIdx.x + blockDim.x * blockIdx.x;

	if (ref_pos < LENGTH_REFERENCE - len_seq)
	{
		//for each possible alignment compute the cost for the current column
		int matrix_offset = get1Dindex(0, ref_pos, len_seq);
		calculate_offset_cost(matrix + matrix_offset, len_seq, ref, seq, ref_pos);

	}

}

//outermost function that computes the optimal alignment
int calculate_alignment(char* ref, char* seq, int len_seq)
{
	int num_blocks = 256;
	int num_threads = 256;
	int matrix_size = (LENGTH_REFERENCE - len_seq) * (len_seq + 1);

	int* matrix;

	hipMallocManaged(&matrix, sizeof(int) * matrix_size);

	init_matrix<<<num_blocks, num_threads>>>(matrix, seq, len_seq);

	calculate_cost_per_offset<<<num_blocks, num_threads>>>(matrix, ref, seq, len_seq);

	hipDeviceSynchronize();

	int max_cost = matrix[len_seq - 1];
	int offset = 0;

	for (int ref_pos = 1; ref_pos < LENGTH_REFERENCE - len_seq; ref_pos++)
	{
		const int index = ref_pos * len_seq + len_seq - 1;
		const int cost = matrix[index];
		if (cost > max_cost) {
			max_cost = cost;
			offset = ref_pos;
		}
	}

	hipFree(matrix);
	return offset;

}


int main()
{
	std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();

	long offset = 0;
	int seq_offset = 0;

	initIndexes();
	initReference();
	initSequences();

	hipDeviceSynchronize();

	for (int i = 0; i < NUM_SEQUENCES; i++)
	{
		offset = calculate_alignment(reference_string, sequence_strings + seq_offset, seq_length[i]);
		seq_offset += seq_length[i];

		std::cout << "Optimal cost of " << 0 << " found at offset " << offset << "\n";
	}

	hipFree(sequence_strings);
	hipFree(reference_string);

	std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now();


	std::chrono::duration<double, std::milli> time_span = t2 - t1;

	std::cout << "It took " << time_span.count() << " milliseconds.\n";


	return 0;
}

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

                                        # End of file scope inline assembly
	.globl	_Z10get1Dindexii                # -- Begin function _Z10get1Dindexii
	.type	_Z10get1Dindexii,@function
_Z10get1Dindexii:                       # @_Z10get1Dindexii
	.cfi_startproc
# %bb.0:
	imull	$500, %esi, %eax                # imm = 0x1F4
	addl	%edi, %eax
	retq
.Lfunc_end0:
	.size	_Z10get1Dindexii, .Lfunc_end0-_Z10get1Dindexii
	.cfi_endproc
                                        # -- End function
	.globl	_Z11initIndexesv                # -- Begin function _Z11initIndexesv
	.type	_Z11initIndexesv,@function
_Z11initIndexesv:                       # @_Z11initIndexesv
	.cfi_startproc
# %bb.0:
	movl	$0, ascii_to_index+268(%rip)
	movl	$1, ascii_to_index+284(%rip)
	movl	$2, ascii_to_index+260(%rip)
	movl	$3, ascii_to_index+336(%rip)
	retq
.Lfunc_end1:
	.size	_Z11initIndexesv, .Lfunc_end1-_Z11initIndexesv
	.cfi_endproc
                                        # -- End function
	.globl	_Z33__device_stub__initIndexes_devicev # -- Begin function _Z33__device_stub__initIndexes_devicev
	.type	_Z33__device_stub__initIndexes_devicev,@function
_Z33__device_stub__initIndexes_devicev: # @_Z33__device_stub__initIndexes_devicev
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rbx
	leaq	24(%rsp), %r14
	leaq	16(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movq	%r12, %rcx
	callq	__hipPopCallConfiguration
	movq	(%rbx), %rsi
	movl	8(%rbx), %edx
	movq	(%r14), %rcx
	movl	8(%r14), %r8d
	movq	%rsp, %r9
	movl	$_Z18initIndexes_devicev, %edi
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	pushq	(%r15)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$72, %rsp
	.cfi_adjust_cfa_offset -72
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z33__device_stub__initIndexes_devicev, .Lfunc_end2-_Z33__device_stub__initIndexes_devicev
	.cfi_endproc
                                        # -- End function
	.globl	_Z13initReferencev              # -- Begin function _Z13initReferencev
	.type	_Z13initReferencev,@function
_Z13initReferencev:                     # @_Z13initReferencev
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movl	$reference_string, %edi
	movl	$40001, %esi                    # imm = 0x9C41
	movl	$1, %edx
	callq	hipMallocManaged
	movl	$1413564227, index_to_ascii(%rip) # imm = 0x54414743
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movl	$1, %esi
	movq	%rdi, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_1
# %bb.4:
	callq	_Z33__device_stub__initIndexes_devicev
.LBB3_1:                                # %.preheader
	xorl	%ebx, %ebx
.LBB3_2:                                # =>This Inner Loop Header: Depth=1
	callq	rand
                                        # kill: def $eax killed $eax def $rax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	andl	$-4, %ecx
	subl	%ecx, %eax
	cltq
	movb	index_to_ascii(%rax), %al
	movq	reference_string(%rip), %rcx
	movb	%al, (%rcx,%rbx)
	incq	%rbx
	cmpq	$40000, %rbx                    # imm = 0x9C40
	jne	.LBB3_2
# %bb.3:
	movq	reference_string(%rip), %rax
	movb	$0, 40000(%rax)
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z13initReferencev, .Lfunc_end3-_Z13initReferencev
	.cfi_endproc
                                        # -- End function
	.globl	_Z13initSequencesv              # -- Begin function _Z13initSequencesv
	.type	_Z13initSequencesv,@function
_Z13initSequencesv:                     # @_Z13initSequencesv
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$2136, %rsp                     # imm = 0x858
	.cfi_def_cfa_offset 2192
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	xorps	%xmm0, %xmm0
	leaq	48(%rsp), %rcx
	movaps	%xmm0, (%rcx)
	xorl	%eax, %eax
	movq	%rax, 16(%rcx)
	leaq	16(%rsp), %rcx
	movq	%rax, 16(%rcx)
	movaps	%xmm0, (%rcx)
	movb	$1, %al
	leaq	15(%rsp), %r12
	xorl	%ecx, %ecx
	movq	%rcx, 80(%rsp)                  # 8-byte Spill
	xorl	%r14d, %r14d
.LBB4_1:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_7 Depth 2
                                        #       Child Loop BB4_10 Depth 3
	movl	%eax, 96(%rsp)                  # 4-byte Spill
	callq	rand
	movl	%eax, %ebp
.Ltmp0:
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$20, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp1:
# %bb.2:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
                                        #   in Loop: Header=BB4_1 Depth=1
	movq	80(%rsp), %rax                  # 8-byte Reload
	leal	1(%rax), %esi
.Ltmp2:
	movl	$_ZSt4cout, %edi
	movl	%esi, 100(%rsp)                 # 4-byte Spill
	callq	_ZNSolsEi
.Ltmp3:
# %bb.3:                                #   in Loop: Header=BB4_1 Depth=1
.Ltmp4:
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp5:
# %bb.4:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit97
                                        #   in Loop: Header=BB4_1 Depth=1
.Ltmp6:
	movslq	%ebp, %r13
	imulq	$1781487195, %r13, %rax         # imm = 0x6A2F565B
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$46, %rax
	addl	%ecx, %eax
	imull	$39500, %eax, %eax              # imm = 0x9A4C
	subl	%eax, %r13d
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_ZNSolsEi
.Ltmp7:
# %bb.5:                                #   in Loop: Header=BB4_1 Depth=1
.Ltmp8:
	movl	$.L.str.2, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp9:
# %bb.6:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit98.preheader
                                        #   in Loop: Header=BB4_1 Depth=1
	movslq	%r13d, %r15
	addl	$500, %r13d                     # imm = 0x1F4
	movslq	%r13d, %rbx
	leaq	(%rsp,%r14), %rax
	addq	$128, %rax
	movq	%rax, 120(%rsp)                 # 8-byte Spill
	xorl	%r13d, %r13d
	movl	$0, 72(%rsp)                    # 4-byte Folded Spill
	xorl	%eax, %eax
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	movl	$0, 76(%rsp)                    # 4-byte Folded Spill
	movq	%r14, 112(%rsp)                 # 8-byte Spill
	movq	%rbx, 104(%rsp)                 # 8-byte Spill
.LBB4_7:                                #   Parent Loop BB4_1 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB4_10 Depth 3
	callq	rand
	cltq
	imulq	$274877907, %rax, %rcx          # imm = 0x10624DD3
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	imull	$1000, %ecx, %ecx               # imm = 0x3E8
	subl	%ecx, %eax
	cmpl	$21, %eax
	jg	.LBB4_25
# %bb.8:                                #   in Loop: Header=BB4_7 Depth=2
	callq	rand
	movl	%eax, %ebp
	leal	3(%rbp), %eax
	testl	%ebp, %ebp
	cmovnsl	%ebp, %eax
	andl	$-4, %eax
	subl	%eax, %ebp
	js	.LBB4_14
# %bb.9:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB4_7 Depth=2
	movl	%r13d, %ebx
	movslq	%r13d, %r13
	addq	120(%rsp), %r13                 # 8-byte Folded Reload
	movq	88(%rsp), %rax                  # 8-byte Reload
	addl	%ebp, %eax
	incl	%eax
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	notl	%ebp
	xorl	%r14d, %r14d
.LBB4_10:                               # %.lr.ph
                                        #   Parent Loop BB4_1 Depth=1
                                        #     Parent Loop BB4_7 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	callq	rand
                                        # kill: def $eax killed $eax def $rax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	andl	$-4, %ecx
	subl	%ecx, %eax
	cltq
	movb	index_to_ascii(%rax), %al
	movb	%al, (%r13)
	movb	$43, 15(%rsp)
.Ltmp26:
	leaq	48(%rsp), %rdi
	movq	%r12, %rsi
	callq	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_
.Ltmp27:
# %bb.11:                               # %_ZNSt6vectorIcSaIcEE9push_backEOc.exit100
                                        #   in Loop: Header=BB4_10 Depth=3
	movq	24(%rsp), %rsi
	cmpq	32(%rsp), %rsi
	je	.LBB4_16
# %bb.12:                               #   in Loop: Header=BB4_10 Depth=3
	movb	(%r13), %al
	movb	%al, (%rsi)
	incq	24(%rsp)
	jmp	.LBB4_17
.LBB4_16:                               #   in Loop: Header=BB4_10 Depth=3
.Ltmp29:
	leaq	16(%rsp), %rdi
	movq	%r13, %rdx
	callq	_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_
.Ltmp30:
.LBB4_17:                               # %_ZNSt6vectorIcSaIcEE9push_backERKc.exit103
                                        #   in Loop: Header=BB4_10 Depth=3
	incq	%r13
	decl	%r14d
	cmpl	%r14d, %ebp
	jne	.LBB4_10
# %bb.13:                               # %._crit_edge.loopexit
                                        #   in Loop: Header=BB4_7 Depth=2
	movl	%ebx, %r13d
	subl	%r14d, %r13d
	movq	112(%rsp), %r14                 # 8-byte Reload
	movq	104(%rsp), %rbx                 # 8-byte Reload
.LBB4_14:                               # %._crit_edge
                                        #   in Loop: Header=BB4_7 Depth=2
	movq	reference_string(%rip), %rdx
	movb	(%rdx,%r15), %al
	movslq	%r13d, %rcx
	addq	%r14, %rcx
	movb	%al, 128(%rsp,%rcx)
	movq	56(%rsp), %rsi
	cmpq	64(%rsp), %rsi
	je	.LBB4_20
# %bb.15:                               #   in Loop: Header=BB4_7 Depth=2
	movb	%al, (%rsi)
	incq	56(%rsp)
	jmp	.LBB4_21
.LBB4_25:                               #   in Loop: Header=BB4_7 Depth=2
	cmpl	$43, %eax
	ja	.LBB4_42
# %bb.26:                               #   in Loop: Header=BB4_7 Depth=2
	callq	rand
	movl	%eax, %ebp
	movq	reference_string(%rip), %rax
	movsbl	(%rax,%r15), %edi
	callq	tolower
	movb	%al, 15(%rsp)
.Ltmp20:
	leaq	48(%rsp), %rdi
	movq	%r12, %rsi
	callq	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_
.Ltmp21:
# %bb.27:                               # %_ZNSt6vectorIcSaIcEE9push_backEOc.exit108
                                        #   in Loop: Header=BB4_7 Depth=2
	movslq	%ebp, %rax
	imulq	$1431655766, %rax, %rcx         # imm = 0x55555556
	movq	%rcx, %rdx
	shrq	$63, %rdx
	shrq	$32, %rcx
	addl	%edx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %eax
	movq	reference_string(%rip), %rcx
	movzbl	(%rcx,%r15), %ecx
	cmpl	$70, %ecx
	jg	.LBB4_31
# %bb.28:                               # %_ZNSt6vectorIcSaIcEE9push_backEOc.exit108
                                        #   in Loop: Header=BB4_7 Depth=2
	cmpl	$65, %ecx
	je	.LBB4_35
# %bb.29:                               # %_ZNSt6vectorIcSaIcEE9push_backEOc.exit108
                                        #   in Loop: Header=BB4_7 Depth=2
	cmpl	$67, %ecx
	jne	.LBB4_33
# %bb.30:                               #   in Loop: Header=BB4_7 Depth=2
	cltq
	movb	index_to_ascii+1(%rax), %cl
	jmp	.LBB4_38
.LBB4_42:                               #   in Loop: Header=BB4_7 Depth=2
	movq	reference_string(%rip), %rdx
	addq	%r15, %rdx
	cmpl	$65, %eax
	ja	.LBB4_50
# %bb.43:                               #   in Loop: Header=BB4_7 Depth=2
	movq	56(%rsp), %rsi
	cmpq	64(%rsp), %rsi
	je	.LBB4_45
# %bb.44:                               #   in Loop: Header=BB4_7 Depth=2
	movb	(%rdx), %al
	movb	%al, (%rsi)
	incq	56(%rsp)
	jmp	.LBB4_46
.LBB4_20:                               #   in Loop: Header=BB4_7 Depth=2
.Ltmp32:
	addq	%r15, %rdx
	leaq	48(%rsp), %rdi
	callq	_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_
.Ltmp33:
.LBB4_21:                               # %_ZNSt6vectorIcSaIcEE9push_backERKc.exit
                                        #   in Loop: Header=BB4_7 Depth=2
	movq	reference_string(%rip), %rdx
	addq	%r15, %rdx
	movq	24(%rsp), %rsi
	cmpq	32(%rsp), %rsi
	jne	.LBB4_22
# %bb.23:                               #   in Loop: Header=BB4_7 Depth=2
.Ltmp34:
	leaq	16(%rsp), %rdi
	callq	_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_
.Ltmp35:
	jmp	.LBB4_55
.LBB4_50:                               #   in Loop: Header=BB4_7 Depth=2
	movb	(%rdx), %al
	movslq	%r13d, %rcx
	addq	%r14, %rcx
	movb	%al, 128(%rsp,%rcx)
	movq	56(%rsp), %rsi
	cmpq	64(%rsp), %rsi
	je	.LBB4_52
# %bb.51:                               #   in Loop: Header=BB4_7 Depth=2
	movb	%al, (%rsi)
	incq	56(%rsp)
	jmp	.LBB4_53
.LBB4_31:                               # %_ZNSt6vectorIcSaIcEE9push_backEOc.exit108
                                        #   in Loop: Header=BB4_7 Depth=2
	cmpl	$71, %ecx
	je	.LBB4_36
# %bb.32:                               # %_ZNSt6vectorIcSaIcEE9push_backEOc.exit108
                                        #   in Loop: Header=BB4_7 Depth=2
	cmpl	$84, %ecx
	je	.LBB4_37
.LBB4_33:                               # %_ZNSt6vectorIcSaIcEE9push_backEOc.exit108._crit_edge
                                        #   in Loop: Header=BB4_7 Depth=2
	movslq	%r13d, %rax
	addq	%r14, %rax
	jmp	.LBB4_39
.LBB4_35:                               #   in Loop: Header=BB4_7 Depth=2
	cmpl	$2, %eax
	movl	$3, %ecx
	cmovel	%ecx, %eax
	jmp	.LBB4_37
.LBB4_36:                               #   in Loop: Header=BB4_7 Depth=2
	cmpl	$1, %eax
	movl	$0, %ecx
	cmovel	%ecx, %eax
.LBB4_37:                               #   in Loop: Header=BB4_7 Depth=2
	cltq
	movb	index_to_ascii(%rax), %cl
.LBB4_38:                               #   in Loop: Header=BB4_7 Depth=2
	movslq	%r13d, %rax
	addq	%r14, %rax
	movb	%cl, 128(%rsp,%rax)
.LBB4_39:                               #   in Loop: Header=BB4_7 Depth=2
	movsbl	128(%rsp,%rax), %edi
	callq	tolower
	movb	%al, 15(%rsp)
.Ltmp23:
	leaq	16(%rsp), %rdi
	movq	%r12, %rsi
	callq	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_
.Ltmp24:
# %bb.40:                               # %_ZNSt6vectorIcSaIcEE9push_backEOc.exit110
                                        #   in Loop: Header=BB4_7 Depth=2
	incl	%r13d
	incl	76(%rsp)                        # 4-byte Folded Spill
	jmp	.LBB4_56
.LBB4_45:                               #   in Loop: Header=BB4_7 Depth=2
.Ltmp14:
	leaq	48(%rsp), %rdi
	callq	_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_
.Ltmp15:
.LBB4_46:                               # %_ZNSt6vectorIcSaIcEE9push_backERKc.exit113
                                        #   in Loop: Header=BB4_7 Depth=2
	movb	$95, 15(%rsp)
.Ltmp17:
	leaq	16(%rsp), %rdi
	movq	%r12, %rsi
	callq	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_
.Ltmp18:
# %bb.47:                               # %_ZNSt6vectorIcSaIcEE9push_backEOc.exit115
                                        #   in Loop: Header=BB4_7 Depth=2
	incl	72(%rsp)                        # 4-byte Folded Spill
	jmp	.LBB4_56
.LBB4_52:                               #   in Loop: Header=BB4_7 Depth=2
.Ltmp10:
	leaq	48(%rsp), %rdi
	callq	_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_
.Ltmp11:
.LBB4_53:                               # %_ZNSt6vectorIcSaIcEE9push_backERKc.exit118
                                        #   in Loop: Header=BB4_7 Depth=2
	movq	reference_string(%rip), %rdx
	addq	%r15, %rdx
	movq	24(%rsp), %rsi
	cmpq	32(%rsp), %rsi
	je	.LBB4_54
.LBB4_22:                               #   in Loop: Header=BB4_7 Depth=2
	movb	(%rdx), %al
	movb	%al, (%rsi)
	incq	24(%rsp)
.LBB4_55:                               # %_ZNSt6vectorIcSaIcEE9push_backERKc.exit121
                                        #   in Loop: Header=BB4_7 Depth=2
	incl	%r13d
.LBB4_56:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit98
                                        #   in Loop: Header=BB4_7 Depth=2
	incq	%r15
	cmpq	%rbx, %r15
	jne	.LBB4_7
	jmp	.LBB4_57
.LBB4_54:                               #   in Loop: Header=BB4_7 Depth=2
.Ltmp12:
	leaq	16(%rsp), %rdi
	callq	_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_
.Ltmp13:
	jmp	.LBB4_55
.LBB4_57:                               #   in Loop: Header=BB4_1 Depth=1
	movq	80(%rsp), %rax                  # 8-byte Reload
	movl	%r13d, seq_length(,%rax,4)
	movb	$0, 15(%rsp)
.Ltmp37:
	leaq	48(%rsp), %rdi
	movq	%r12, %rsi
	callq	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_
.Ltmp38:
# %bb.58:                               # %_ZNSt6vectorIcSaIcEE9push_backEOc.exit
                                        #   in Loop: Header=BB4_1 Depth=1
	movb	$0, 15(%rsp)
.Ltmp40:
	leaq	16(%rsp), %rdi
	movq	%r12, %rsi
	callq	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_
.Ltmp41:
# %bb.59:                               # %_ZNSt6vectorIcSaIcEE9push_backEOc.exit123
                                        #   in Loop: Header=BB4_1 Depth=1
.Ltmp43:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp44:
# %bb.60:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit125
                                        #   in Loop: Header=BB4_1 Depth=1
.Ltmp45:
	movl	$_ZSt4cout, %edi
	movl	100(%rsp), %esi                 # 4-byte Reload
	callq	_ZNSolsEi
.Ltmp46:
# %bb.61:                               #   in Loop: Header=BB4_1 Depth=1
.Ltmp47:
	movl	$.L.str.4, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp48:
# %bb.62:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit127
                                        #   in Loop: Header=BB4_1 Depth=1
.Ltmp49:
	movl	$_ZSt4cout, %edi
	movl	76(%rsp), %esi                  # 4-byte Reload
	callq	_ZNSolsEi
.Ltmp50:
# %bb.63:                               #   in Loop: Header=BB4_1 Depth=1
.Ltmp51:
	movl	$.L.str.5, %esi
	movl	$7, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp52:
# %bb.64:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit129
                                        #   in Loop: Header=BB4_1 Depth=1
.Ltmp53:
	movl	$_ZSt4cout, %edi
	movl	72(%rsp), %esi                  # 4-byte Reload
	callq	_ZNSolsEi
.Ltmp54:
# %bb.65:                               #   in Loop: Header=BB4_1 Depth=1
.Ltmp55:
	movl	$.L.str.6, %esi
	movl	$7, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp56:
# %bb.66:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit131
                                        #   in Loop: Header=BB4_1 Depth=1
.Ltmp57:
	movl	$_ZSt4cout, %edi
	movq	88(%rsp), %rsi                  # 8-byte Reload
                                        # kill: def $esi killed $esi killed $rsi
	callq	_ZNSolsEi
.Ltmp58:
# %bb.67:                               #   in Loop: Header=BB4_1 Depth=1
.Ltmp59:
	movq	%rax, %r15
	movl	$.L.str.7, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp60:
# %bb.68:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit133
                                        #   in Loop: Header=BB4_1 Depth=1
.Ltmp61:
	movl	$.L.str.2, %esi
	movl	$1, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp62:
# %bb.69:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit135
                                        #   in Loop: Header=BB4_1 Depth=1
	movq	48(%rsp), %r15
	testq	%r15, %r15
	je	.LBB4_70
# %bb.71:                               #   in Loop: Header=BB4_1 Depth=1
	movq	%r15, %rdi
	callq	strlen
.Ltmp63:
	movl	$_ZSt4cout, %edi
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp64:
	jmp	.LBB4_72
.LBB4_70:                               #   in Loop: Header=BB4_1 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp65:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp66:
.LBB4_72:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit139
                                        #   in Loop: Header=BB4_1 Depth=1
.Ltmp67:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp68:
# %bb.73:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit141
                                        #   in Loop: Header=BB4_1 Depth=1
	movq	16(%rsp), %r15
	testq	%r15, %r15
	je	.LBB4_74
# %bb.75:                               #   in Loop: Header=BB4_1 Depth=1
	movq	%r15, %rdi
	callq	strlen
.Ltmp69:
	movl	$_ZSt4cout, %edi
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp70:
	jmp	.LBB4_76
.LBB4_74:                               #   in Loop: Header=BB4_1 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp71:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp72:
.LBB4_76:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit145
                                        #   in Loop: Header=BB4_1 Depth=1
.Ltmp73:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp74:
# %bb.77:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit147
                                        #   in Loop: Header=BB4_1 Depth=1
	movq	48(%rsp), %rax
	cmpq	%rax, 56(%rsp)
	je	.LBB4_79
# %bb.78:                               #   in Loop: Header=BB4_1 Depth=1
	movq	%rax, 56(%rsp)
.LBB4_79:                               # %_ZNSt6vectorIcSaIcEE5clearEv.exit
                                        #   in Loop: Header=BB4_1 Depth=1
	movq	16(%rsp), %rax
	cmpq	%rax, 24(%rsp)
	je	.LBB4_81
# %bb.80:                               #   in Loop: Header=BB4_1 Depth=1
	movq	%rax, 24(%rsp)
.LBB4_81:                               # %_ZNSt6vectorIcSaIcEE5clearEv.exit149
                                        #   in Loop: Header=BB4_1 Depth=1
	movslq	%r13d, %rax
	addq	%rax, %r14
	movl	$1, %eax
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	testb	$1, 96(%rsp)                    # 1-byte Folded Reload
	movl	$0, %eax
	jne	.LBB4_1
# %bb.82:
.Ltmp76:
	movl	$sequence_strings, %edi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	hipMallocManaged
.Ltmp77:
# %bb.83:                               # %_ZL16hipMallocManagedIcE10hipError_tPPT_mj.exit
	movq	sequence_strings(%rip), %rdi
	leaq	128(%rsp), %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
	movq	16(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB4_85
# %bb.84:
	callq	_ZdlPv
.LBB4_85:                               # %_ZNSt6vectorIcSaIcEED2Ev.exit
	movq	48(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB4_87
# %bb.86:
	callq	_ZdlPv
.LBB4_87:                               # %_ZNSt6vectorIcSaIcEED2Ev.exit151
	addq	$2136, %rsp                     # imm = 0x858
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB4_90:
	.cfi_def_cfa_offset 2192
.Ltmp78:
	jmp	.LBB4_91
.LBB4_88:
.Ltmp39:
	jmp	.LBB4_91
.LBB4_89:
.Ltmp42:
	jmp	.LBB4_91
.LBB4_49:
.Ltmp19:
	jmp	.LBB4_91
.LBB4_48:
.Ltmp16:
	jmp	.LBB4_91
.LBB4_41:
.Ltmp25:
	jmp	.LBB4_91
.LBB4_34:
.Ltmp22:
	jmp	.LBB4_91
.LBB4_24:
.Ltmp36:
	jmp	.LBB4_91
.LBB4_96:
.Ltmp75:
	jmp	.LBB4_91
.LBB4_19:
.Ltmp31:
	jmp	.LBB4_91
.LBB4_18:
.Ltmp28:
.LBB4_91:
	movq	%rax, %rbx
	movq	16(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB4_93
# %bb.92:
	callq	_ZdlPv
.LBB4_93:                               # %_ZNSt6vectorIcSaIcEED2Ev.exit153
	movq	48(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB4_95
# %bb.94:
	callq	_ZdlPv
.LBB4_95:                               # %_ZNSt6vectorIcSaIcEED2Ev.exit155
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end4:
	.size	_Z13initSequencesv, .Lfunc_end4-_Z13initSequencesv
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table4:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 1 <<
	.uleb128 .Ltmp9-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp9
	.uleb128 .Ltmp75-.Lfunc_begin0          #     jumps to .Ltmp75
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp26-.Lfunc_begin0          # >> Call Site 2 <<
	.uleb128 .Ltmp27-.Ltmp26                #   Call between .Ltmp26 and .Ltmp27
	.uleb128 .Ltmp28-.Lfunc_begin0          #     jumps to .Ltmp28
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp29-.Lfunc_begin0          # >> Call Site 3 <<
	.uleb128 .Ltmp30-.Ltmp29                #   Call between .Ltmp29 and .Ltmp30
	.uleb128 .Ltmp31-.Lfunc_begin0          #     jumps to .Ltmp31
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp20-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp21-.Ltmp20                #   Call between .Ltmp20 and .Ltmp21
	.uleb128 .Ltmp22-.Lfunc_begin0          #     jumps to .Ltmp22
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp32-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp35-.Ltmp32                #   Call between .Ltmp32 and .Ltmp35
	.uleb128 .Ltmp36-.Lfunc_begin0          #     jumps to .Ltmp36
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp23-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp24-.Ltmp23                #   Call between .Ltmp23 and .Ltmp24
	.uleb128 .Ltmp25-.Lfunc_begin0          #     jumps to .Ltmp25
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp14-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp15-.Ltmp14                #   Call between .Ltmp14 and .Ltmp15
	.uleb128 .Ltmp16-.Lfunc_begin0          #     jumps to .Ltmp16
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp17-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp18-.Ltmp17                #   Call between .Ltmp17 and .Ltmp18
	.uleb128 .Ltmp19-.Lfunc_begin0          #     jumps to .Ltmp19
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp10-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp13-.Ltmp10                #   Call between .Ltmp10 and .Ltmp13
	.uleb128 .Ltmp16-.Lfunc_begin0          #     jumps to .Ltmp16
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp37-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp38-.Ltmp37                #   Call between .Ltmp37 and .Ltmp38
	.uleb128 .Ltmp39-.Lfunc_begin0          #     jumps to .Ltmp39
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp40-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Ltmp41-.Ltmp40                #   Call between .Ltmp40 and .Ltmp41
	.uleb128 .Ltmp42-.Lfunc_begin0          #     jumps to .Ltmp42
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp43-.Lfunc_begin0          # >> Call Site 12 <<
	.uleb128 .Ltmp74-.Ltmp43                #   Call between .Ltmp43 and .Ltmp74
	.uleb128 .Ltmp75-.Lfunc_begin0          #     jumps to .Ltmp75
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp76-.Lfunc_begin0          # >> Call Site 13 <<
	.uleb128 .Ltmp77-.Ltmp76                #   Call between .Ltmp76 and .Ltmp77
	.uleb128 .Ltmp78-.Lfunc_begin0          #     jumps to .Ltmp78
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp77-.Lfunc_begin0          # >> Call Site 14 <<
	.uleb128 .Lfunc_end4-.Ltmp77            #   Call between .Ltmp77 and .Lfunc_end4
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z26__device_stub__init_matrixPiPci # -- Begin function _Z26__device_stub__init_matrixPiPci
	.type	_Z26__device_stub__init_matrixPiPci,@function
_Z26__device_stub__init_matrixPiPci:    # @_Z26__device_stub__init_matrixPiPci
	.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), %rcx
	movq	%rsi, (%rcx)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%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	$_Z11init_matrixPiPci, %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_end5:
	.size	_Z26__device_stub__init_matrixPiPci, .Lfunc_end5-_Z26__device_stub__init_matrixPiPci
	.cfi_endproc
                                        # -- End function
	.globl	_Z40__device_stub__calculate_cost_per_offsetPiPcS0_i # -- Begin function _Z40__device_stub__calculate_cost_per_offsetPiPcS0_i
	.type	_Z40__device_stub__calculate_cost_per_offsetPiPcS0_i,@function
_Z40__device_stub__calculate_cost_per_offsetPiPcS0_i: # @_Z40__device_stub__calculate_cost_per_offsetPiPcS0_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	$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	$_Z25calculate_cost_per_offsetPiPcS0_i, %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_end6:
	.size	_Z40__device_stub__calculate_cost_per_offsetPiPcS0_i, .Lfunc_end6-_Z40__device_stub__calculate_cost_per_offsetPiPcS0_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z19calculate_alignmentPcS_i    # -- Begin function _Z19calculate_alignmentPcS_i
	.type	_Z19calculate_alignmentPcS_i,@function
_Z19calculate_alignmentPcS_i:           # @_Z19calculate_alignmentPcS_i
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r12
	movabsq	$4294967552, %r13               # imm = 0x100000100
	movl	$40000, %ebp                    # imm = 0x9C40
	subl	%edx, %ebp
	leal	1(%rbx), %eax
	imull	%ebp, %eax
	movslq	%eax, %rsi
	shlq	$2, %rsi
	movq	%rsp, %rdi
	movl	$1, %edx
	callq	hipMallocManaged
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_2
# %bb.1:
	movq	(%rsp), %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_Z26__device_stub__init_matrixPiPci
.LBB7_2:
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB7_4
# %bb.3:
	movq	(%rsp), %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movl	%ebx, %ecx
	callq	_Z40__device_stub__calculate_cost_per_offsetPiPcS0_i
.LBB7_4:
	callq	hipDeviceSynchronize
	movq	(%rsp), %rdi
	cmpl	$39998, %ebx                    # imm = 0x9C3E
	jg	.LBB7_7
# %bb.5:                                # %.lr.ph.preheader
	movslq	%ebx, %rcx
	cmpl	$3, %ebp
	movl	$2, %eax
	cmovgel	%ebp, %eax
	movl	-4(%rdi,%rcx,4), %ecx
	leal	(%rbx,%rbx), %edx
	xorl	%r14d, %r14d
	movl	$1, %esi
.LBB7_6:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movslq	%edx, %rdx
	movl	-4(%rdi,%rdx,4), %r8d
	cmpl	%ecx, %r8d
	cmovgl	%esi, %r14d
	cmovgl	%r8d, %ecx
	leaq	1(%rsi), %r8
	addl	%ebx, %edx
	movq	%r8, %rsi
	cmpq	%r8, %rax
	jne	.LBB7_6
.LBB7_7:                                # %._crit_edge
	callq	hipFree
	movl	%r14d, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_Z19calculate_alignmentPcS_i, .Lfunc_end7-_Z19calculate_alignmentPcS_i
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI8_0:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %rbx
	movl	$0, ascii_to_index+268(%rip)
	movl	$1, ascii_to_index+284(%rip)
	movl	$2, ascii_to_index+260(%rip)
	movl	$3, ascii_to_index+336(%rip)
	callq	_Z13initReferencev
	callq	_Z13initSequencesv
	callq	hipDeviceSynchronize
	xorl	%r15d, %r15d
	movb	$1, %bpl
	xorl	%r12d, %r12d
.LBB8_1:                                # =>This Inner Loop Header: Depth=1
	movq	reference_string(%rip), %rdi
	movslq	%r12d, %r12
	movq	sequence_strings(%rip), %rsi
	addq	%r12, %rsi
	movl	seq_length(,%r15,4), %edx
	callq	_Z19calculate_alignmentPcS_i
	movslq	%eax, %r14
	addl	seq_length(,%r15,4), %r12d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.8, %esi
	movl	$16, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	xorl	%esi, %esi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movl	$.L.str.9, %esi
	movl	$17, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ZNSo9_M_insertIlEERSoT_
	movl	$1, %r15d
	movl	$.L.str.2, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	testb	$1, %bpl
	movl	$0, %ebp
	jne	.LBB8_1
# %bb.2:
	movq	sequence_strings(%rip), %rdi
	callq	hipFree
	movq	reference_string(%rip), %rdi
	callq	hipFree
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%rbx, %rax
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI8_0(%rip), %xmm0
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	movl	$_ZSt4cout, %edi
	movl	$.L.str.10, %esi
	movl	$8, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movsd	8(%rsp), %xmm0                  # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.11, %esi
	movl	$15, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorl	%eax, %eax
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	main, .Lfunc_end8-main
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_,"axG",@progbits,_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_,comdat
	.weak	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_ # -- Begin function _ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_,@function
_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_: # @_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rsi, %rdx
	movq	%rdi, %rbx
	movq	8(%rdi), %rsi
	cmpq	16(%rdi), %rsi
	je	.LBB9_2
# %bb.1:
	movb	(%rdx), %al
	movb	%al, (%rsi)
	movq	8(%rbx), %rax
	incq	%rax
	movq	%rax, 8(%rbx)
	jmp	.LBB9_3
.LBB9_2:
	movq	%rbx, %rdi
	callq	_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_
	movq	8(%rbx), %rax
.LBB9_3:
	decq	%rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_, .Lfunc_end9-_ZNSt6vectorIcSaIcEE12emplace_backIJcEEERcDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIcSaIcEE17_M_realloc_insertIJcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_,comdat
	.weak	_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_ # -- Begin function _ZNSt6vectorIcSaIcEE17_M_realloc_insertIJcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_,@function
_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_: # @_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, %rbx
	movabsq	$9223372036854775807, %rax      # imm = 0x7FFFFFFFFFFFFFFF
	movq	(%rdi), %rdi
	movq	8(%rbx), %r14
	movq	%r14, %rcx
	subq	%rdi, %rcx
	cmpq	%rax, %rcx
	je	.LBB10_11
# %bb.1:                                # %_ZNKSt6vectorIcSaIcEE12_M_check_lenEmPKc.exit
	cmpq	$1, %rcx
	movq	%rcx, %r8
	adcq	$0, %r8
	leaq	(%r8,%rcx), %r12
	cmpq	%rax, %r12
	cmovaeq	%rax, %r12
	addq	%rcx, %r8
	cmovbq	%rax, %r12
	movq	%rsi, 16(%rsp)                  # 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	subq	%rdi, %r15
	testq	%r12, %r12
	je	.LBB10_2
# %bb.3:
	movq	%r12, %rdi
	movq	%rdx, %r13
	callq	_Znwm
	movq	%r13, %rdx
	movq	%rax, %rbp
	jmp	.LBB10_4
.LBB10_2:
	xorl	%ebp, %ebp
.LBB10_4:                               # %_ZNSt12_Vector_baseIcSaIcEE11_M_allocateEm.exit
	leaq	(%r15,%rbp), %r13
	movb	(%rdx), %al
	movb	%al, (%rbp,%r15)
	testq	%r15, %r15
	jle	.LBB10_6
# %bb.5:
	movq	%rbp, %rdi
	movq	8(%rsp), %rsi                   # 8-byte Reload
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB10_6:                               # %_ZNSt6vectorIcSaIcEE11_S_relocateEPcS2_S2_RS0_.exit
	incq	%r13
	movq	16(%rsp), %rsi                  # 8-byte Reload
	subq	%rsi, %r14
	testq	%r14, %r14
	jle	.LBB10_8
# %bb.7:
	movq	%r13, %rdi
	movq	%r14, %rdx
	callq	memmove@PLT
.LBB10_8:                               # %_ZNSt6vectorIcSaIcEE11_S_relocateEPcS2_S2_RS0_.exit16
	movq	8(%rsp), %rdi                   # 8-byte Reload
	testq	%rdi, %rdi
	je	.LBB10_10
# %bb.9:
	callq	_ZdlPv
.LBB10_10:                              # %_ZNSt12_Vector_baseIcSaIcEE13_M_deallocateEPcm.exit
	addq	%r14, %r13
	movq	%rbp, (%rbx)
	movq	%r13, 8(%rbx)
	addq	%rbp, %r12
	movq	%r12, 16(%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB10_11:
	.cfi_def_cfa_offset 80
	movl	$.L.str.12, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end10:
	.size	_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_, .Lfunc_end10-_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_,comdat
	.weak	_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_ # -- Begin function _ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_,@function
_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_: # @_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, %rbx
	movabsq	$9223372036854775807, %rax      # imm = 0x7FFFFFFFFFFFFFFF
	movq	(%rdi), %rdi
	movq	8(%rbx), %r14
	movq	%r14, %rcx
	subq	%rdi, %rcx
	cmpq	%rax, %rcx
	je	.LBB11_11
# %bb.1:                                # %_ZNKSt6vectorIcSaIcEE12_M_check_lenEmPKc.exit
	cmpq	$1, %rcx
	movq	%rcx, %r8
	adcq	$0, %r8
	leaq	(%r8,%rcx), %r12
	cmpq	%rax, %r12
	cmovaeq	%rax, %r12
	addq	%rcx, %r8
	cmovbq	%rax, %r12
	movq	%rsi, 16(%rsp)                  # 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	subq	%rdi, %r15
	testq	%r12, %r12
	je	.LBB11_2
# %bb.3:
	movq	%r12, %rdi
	movq	%rdx, %r13
	callq	_Znwm
	movq	%r13, %rdx
	movq	%rax, %rbp
	jmp	.LBB11_4
.LBB11_2:
	xorl	%ebp, %ebp
.LBB11_4:                               # %_ZNSt12_Vector_baseIcSaIcEE11_M_allocateEm.exit
	leaq	(%r15,%rbp), %r13
	movb	(%rdx), %al
	movb	%al, (%rbp,%r15)
	testq	%r15, %r15
	jle	.LBB11_6
# %bb.5:
	movq	%rbp, %rdi
	movq	8(%rsp), %rsi                   # 8-byte Reload
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB11_6:                               # %_ZNSt6vectorIcSaIcEE11_S_relocateEPcS2_S2_RS0_.exit
	incq	%r13
	movq	16(%rsp), %rsi                  # 8-byte Reload
	subq	%rsi, %r14
	testq	%r14, %r14
	jle	.LBB11_8
# %bb.7:
	movq	%r13, %rdi
	movq	%r14, %rdx
	callq	memmove@PLT
.LBB11_8:                               # %_ZNSt6vectorIcSaIcEE11_S_relocateEPcS2_S2_RS0_.exit16
	movq	8(%rsp), %rdi                   # 8-byte Reload
	testq	%rdi, %rdi
	je	.LBB11_10
# %bb.9:
	callq	_ZdlPv
.LBB11_10:                              # %_ZNSt12_Vector_baseIcSaIcEE13_M_deallocateEPcm.exit
	addq	%r14, %r13
	movq	%rbp, (%rbx)
	movq	%r13, 8(%rbx)
	addq	%rbp, %r12
	movq	%r12, 16(%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB11_11:
	.cfi_def_cfa_offset 80
	movl	$.L.str.12, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end11:
	.size	_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_, .Lfunc_end11-_ZNSt6vectorIcSaIcEE17_M_realloc_insertIJRKcEEEvN9__gnu_cxx17__normal_iteratorIPcS1_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	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	.LBB12_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB12_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z18initIndexes_devicev, %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	$_Z11init_matrixPiPci, %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	$_Z25calculate_cost_per_offsetPiPcS0_i, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$0, 8(%rsp)
	movl	$0, (%rsp)
	movl	$cost_index, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movl	$64, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	__hipRegisterVar
	movl	$0, 8(%rsp)
	movl	$0, (%rsp)
	movl	$ascii_2_index, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movl	$512, %r9d                      # imm = 0x200
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	__hipRegisterVar
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end12:
	.size	__hip_module_ctor, .Lfunc_end12-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB13_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB13_2:
	retq
.Lfunc_end13:
	.size	__hip_module_dtor, .Lfunc_end13-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	cost_index,@object              # @cost_index
	.local	cost_index
	.comm	cost_index,64,16
	.type	ascii_2_index,@object           # @ascii_2_index
	.local	ascii_2_index
	.comm	ascii_2_index,512,16
	.type	ascii_to_index,@object          # @ascii_to_index
	.bss
	.globl	ascii_to_index
	.p2align	4, 0x0
ascii_to_index:
	.zero	512
	.size	ascii_to_index, 512

	.type	index_to_ascii,@object          # @index_to_ascii
	.globl	index_to_ascii
index_to_ascii:
	.zero	4
	.size	index_to_ascii, 4

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

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

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

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

	.type	seq_length,@object              # @seq_length
	.globl	seq_length
	.p2align	2, 0x0
seq_length:
	.zero	8
	.size	seq_length, 8

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Offset for sequence "
	.size	.L.str, 21

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	" = "
	.size	.L.str.1, 4

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

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Sequence "
	.size	.L.str.3, 10

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

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	" subs, "
	.size	.L.str.5, 8

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	" dels, "
	.size	.L.str.6, 8

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	" ins"
	.size	.L.str.7, 5

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

	.type	_Z25calculate_cost_per_offsetPiPcS0_i,@object # @_Z25calculate_cost_per_offsetPiPcS0_i
	.globl	_Z25calculate_cost_per_offsetPiPcS0_i
	.p2align	3, 0x0
_Z25calculate_cost_per_offsetPiPcS0_i:
	.quad	_Z40__device_stub__calculate_cost_per_offsetPiPcS0_i
	.size	_Z25calculate_cost_per_offsetPiPcS0_i, 8

	.type	.L.str.8,@object                # @.str.8
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.8:
	.asciz	"Optimal cost of "
	.size	.L.str.8, 17

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	" found at offset "
	.size	.L.str.9, 18

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"It took "
	.size	.L.str.10, 9

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	" milliseconds.\n"
	.size	.L.str.11, 16

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"vector::_M_realloc_insert"
	.size	.L.str.12, 26

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z18initIndexes_devicev"
	.size	.L__unnamed_1, 24

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z11init_matrixPiPci"
	.size	.L__unnamed_2, 21

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z25calculate_cost_per_offsetPiPcS0_i"
	.size	.L__unnamed_3, 38

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"cost_index"
	.size	.L__unnamed_4, 11

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"ascii_2_index"
	.size	.L__unnamed_5, 14

	.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 _Z33__device_stub__initIndexes_devicev
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym _Z26__device_stub__init_matrixPiPci
	.addrsig_sym _Z40__device_stub__calculate_cost_per_offsetPiPcS0_i
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym cost_index
	.addrsig_sym ascii_2_index
	.addrsig_sym reference_string
	.addrsig_sym sequence_strings
	.addrsig_sym _Z18initIndexes_devicev
	.addrsig_sym _ZSt4cout
	.addrsig_sym _Z11init_matrixPiPci
	.addrsig_sym _Z25calculate_cost_per_offsetPiPcS0_i
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z18initIndexes_devicev ; -- Begin function _Z18initIndexes_devicev
	.globl	_Z18initIndexes_devicev
	.p2align	8
	.type	_Z18initIndexes_devicev,@function
_Z18initIndexes_devicev:                ; @_Z18initIndexes_devicev
; %bb.0:
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, ascii_2_index@rel32@lo+272
	s_addc_u32 s1, s1, ascii_2_index@rel32@hi+280
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 1
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, ascii_2_index@rel32@lo+288
	s_addc_u32 s3, s3, ascii_2_index@rel32@hi+296
	s_getpc_b64 s[4:5]
	s_add_u32 s4, s4, ascii_2_index@rel32@lo+264
	s_addc_u32 s5, s5, ascii_2_index@rel32@hi+272
	v_dual_mov_b32 v2, 2 :: v_dual_mov_b32 v3, 3
	s_getpc_b64 s[6:7]
	s_add_u32 s6, s6, ascii_2_index@rel32@lo+340
	s_addc_u32 s7, s7, ascii_2_index@rel32@hi+348
	s_clause 0x3
	global_store_b32 v0, v0, s[0:1]
	global_store_b32 v0, v1, s[2:3]
	global_store_b32 v0, v2, s[4:5]
	global_store_b32 v0, v3, s[6:7]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z18initIndexes_devicev
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 0
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 0
		.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 8
		.amdhsa_reserve_vcc 0
		.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	_Z18initIndexes_devicev, .Lfunc_end0-_Z18initIndexes_devicev
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 144
; NumSgprs: 8
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 1
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 8
; NumVGPRsForWavesPerEU: 4
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z11init_matrixPiPci    ; -- Begin function _Z11init_matrixPiPci
	.globl	_Z11init_matrixPiPci
	.p2align	8
	.type	_Z11init_matrixPiPci,@function
_Z11init_matrixPiPci:                   ; @_Z11init_matrixPiPci
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b32 s3, s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_sub_i32 s2, 0x9c40, s3
	s_cmp_gt_i32 s3, 0
	s_cselect_b32 s4, -1, 0
	v_cmp_gt_i32_e32 vcc_lo, s2, v1
	s_mov_b32 s2, 0
	s_and_b32 s4, vcc_lo, s4
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s5, s4
	s_cbranch_execz .LBB1_3
; %bb.1:                                ; %.lr.ph
	s_load_b64 s[0:1], s[0:1], 0x0
	v_mul_lo_u32 v0, v1, s3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	s_sub_i32 s0, 0, s3
.LBB1_2:                                ; =>This Inner Loop Header: Depth=1
	s_add_i32 s2, s2, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mov_b32_e32 v2, s2
	s_cmp_lg_u32 s0, s2
	global_store_b32 v[0:1], v2, off
	v_add_co_u32 v0, vcc_lo, v0, 4
	v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
	s_cbranch_scc1 .LBB1_2
.LBB1_3:                                ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11init_matrixPiPci
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.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 3
		.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	_Z11init_matrixPiPci, .Lfunc_end1-_Z11init_matrixPiPci
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 192
; NumSgprs: 18
; NumVgprs: 3
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 3
; 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	_Z25calculate_cost_per_offsetPiPcS0_i ; -- Begin function _Z25calculate_cost_per_offsetPiPcS0_i
	.globl	_Z25calculate_cost_per_offsetPiPcS0_i
	.p2align	8
	.type	_Z25calculate_cost_per_offsetPiPcS0_i,@function
_Z25calculate_cost_per_offsetPiPcS0_i:  ; @_Z25calculate_cost_per_offsetPiPcS0_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b32 s8, s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_sub_i32 s2, 0x9c40, s8
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_cmp_gt_i32_e32 vcc_lo, s2, v1
	s_and_saveexec_b32 s2, vcc_lo
	s_cbranch_execz .LBB2_6
; %bb.1:
	s_cmp_lt_i32 s8, 1
	s_cbranch_scc1 .LBB2_6
; %bb.2:                                ; %.lr.ph.i.preheader
	s_load_b128 s[4:7], s[0:1], 0x0
	v_mul_lo_u32 v2, v1, s8
	s_load_b64 s[0:1], s[0:1], 0x10
	v_mov_b32_e32 v0, 0
	s_mov_b32 s9, 0
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, ascii_2_index@rel32@lo+4
	s_addc_u32 s3, s3, ascii_2_index@rel32@hi+12
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[2:3], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v3, vcc_lo
.LBB2_3:                                ; %.lr.ph.i
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB2_4 Depth 2
	s_not_b32 s4, s9
	s_delay_alu instid0(SALU_CYCLE_1)
	v_dual_mov_b32 v9, s4 :: v_dual_add_nc_u32 v4, s9, v1
	s_sub_i32 s5, 0, s9
	s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)
	v_dual_mov_b32 v7, v3 :: v_dual_mov_b32 v8, s5
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_ashrrev_i32_e32 v5, 31, v4
	v_add_co_u32 v4, vcc_lo, s6, v4
	v_mov_b32_e32 v6, v2
	s_mov_b64 s[4:5], 0
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v5, vcc_lo
	global_load_i8 v4, v[4:5], off
	s_waitcnt vmcnt(0)
	v_bfe_i32 v4, v4, 0, 16
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v5, 31, v4
	v_lshlrev_b64 v[4:5], 2, v[4:5]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, v4, s2
	v_add_co_ci_u32_e32 v5, vcc_lo, s3, v5, vcc_lo
.LBB2_4:                                ;   Parent Loop BB2_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_add_u32 s10, s0, s4
	s_addc_u32 s11, s1, s5
	v_add_nc_u32_e32 v9, -1, v9
	global_load_i8 v10, v0, s[10:11]
	global_load_b32 v11, v[4:5], off
	s_waitcnt vmcnt(1)
	v_readfirstlane_b32 s10, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_sext_i32_i16 s10, s10
	s_ashr_i32 s11, s10, 31
	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 s10, s10, s2
	s_addc_u32 s11, s11, s3
	global_load_b32 v10, v0, s[10:11]
	s_getpc_b64 s[10:11]
	s_add_u32 s10, s10, cost_index@rel32@lo+4
	s_addc_u32 s11, s11, cost_index@rel32@hi+12
	s_add_u32 s4, s4, 1
	s_addc_u32 s5, s5, 0
	s_cmp_lg_u32 s8, s4
	s_waitcnt vmcnt(0)
	v_lshl_add_u32 v10, v11, 2, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v11, 31, v10
	v_lshlrev_b64 v[10:11], 2, v[10:11]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v10, vcc_lo, v10, s10
	v_add_co_ci_u32_e32 v11, vcc_lo, s11, v11, vcc_lo
	global_load_b32 v10, v[10:11], off
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v10, v10, v8
	global_load_b32 v8, v[6:7], off
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v11, -1, v8
	s_delay_alu instid0(VALU_DEP_1)
	v_max3_i32 v9, v9, v10, v11
	global_store_b32 v[6:7], v9, off
	v_add_co_u32 v6, vcc_lo, v6, 4
	v_add_co_ci_u32_e32 v7, vcc_lo, 0, v7, vcc_lo
	s_cbranch_scc1 .LBB2_4
; %bb.5:                                ; %_Z16calculate_columnPiicPci.exit.i
                                        ;   in Loop: Header=BB2_3 Depth=1
	s_add_i32 s9, s9, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u32 s9, s8
	s_cbranch_scc1 .LBB2_3
.LBB2_6:                                ; %_Z21calculate_offset_costPiiPcS0_i.exit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z25calculate_cost_per_offsetPiPcS0_i
		.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 12
		.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	_Z25calculate_cost_per_offsetPiPcS0_i, .Lfunc_end2-_Z25calculate_cost_per_offsetPiPcS0_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 520
; NumSgprs: 18
; NumVgprs: 12
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 12
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.protected	cost_index              ; @cost_index
	.type	cost_index,@object
	.data
	.globl	cost_index
	.p2align	4, 0x0
cost_index:
	.long	1                               ; 0x1
	.long	4294967295                      ; 0xffffffff
	.long	4294967295                      ; 0xffffffff
	.long	4294967295                      ; 0xffffffff
	.long	4294967295                      ; 0xffffffff
	.long	1                               ; 0x1
	.long	4294967295                      ; 0xffffffff
	.long	4294967295                      ; 0xffffffff
	.long	4294967295                      ; 0xffffffff
	.long	4294967295                      ; 0xffffffff
	.long	1                               ; 0x1
	.long	4294967295                      ; 0xffffffff
	.long	4294967295                      ; 0xffffffff
	.long	4294967295                      ; 0xffffffff
	.long	4294967295                      ; 0xffffffff
	.long	1                               ; 0x1
	.size	cost_index, 64

	.protected	ascii_2_index           ; @ascii_2_index
	.type	ascii_2_index,@object
	.section	.bss,"aw",@nobits
	.globl	ascii_2_index
	.p2align	4, 0x0
ascii_2_index:
	.zero	512
	.size	ascii_2_index, 512

	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.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 cost_index
	.addrsig_sym ascii_2_index
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:           []
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 4
    .kernarg_segment_size: 0
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z18initIndexes_devicev
    .private_segment_fixed_size: 0
    .sgpr_count:     8
    .sgpr_spill_count: 0
    .symbol:         _Z18initIndexes_devicev.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
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11init_matrixPiPci
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11init_matrixPiPci.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     3
    .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:           _Z25calculate_cost_per_offsetPiPcS0_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z25calculate_cost_per_offsetPiPcS0_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     12
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
