//#ifdef SW2_BUILD_WITH_CUDA

typedef int ScoreType;

// CUDA global constants
__constant__ int partSeqSize, partsNumber, overlapLength, seqLibLength, queryLength;
__constant__ int gapOpen, gapExtension, maxScore, queryPartLength;


//global function
__global__ void calculateMatrix(const char * seqLib, ScoreType* queryProfile,
								ScoreType* g_HdataUp, ScoreType* g_HdataRec, ScoreType* g_HdataMax,
								ScoreType* g_FdataUp,
								ScoreType* g_directionsUp, ScoreType* g_directionsRec, ScoreType* g_directionsMax,
								int queryStartPos) 
{

	//registers
	int patternPos = threadIdx.x;	
	int globalPatternPos =  queryStartPos + patternPos;

	int seqStartPos = blockIdx.x * (partSeqSize - overlapLength);
	int globalStartPos = blockIdx.x * (partSeqSize + 1);
	
	int seqPos = 0, globalPos = 0, diagNum = 0;
	ScoreType substScore = 0;	
	ScoreType E = 0, E_left = 0, F = 0, F_up = 0, H = 0,
		H_left = 0, H_up = 0, H_upleft = 0, E_left_init = 0, 
		H_left_init = 0, directionLeft = 0, directionUp = 0, 
		directionUpLeft = 0, direction = 0, directionInit = 0,
		maxScore = 0;



	//dynamic allocation shared memory
	extern __shared__ ScoreType shared_H[];
	ScoreType* shared_E = (ScoreType*)&shared_H[queryPartLength + 1];
	ScoreType* shared_direction = (ScoreType*)&shared_E[queryPartLength + 1];

	shared_H[patternPos] = 0;
	shared_E[patternPos] = 0;
	shared_direction[patternPos] = 0;

	__syncthreads();	

	seqPos = seqStartPos - patternPos;
	globalPos = globalStartPos - patternPos;

	diagNum = (partSeqSize + queryPartLength - 1);
	for (int iteration = 0; iteration < diagNum; iteration++) {

		//check boundaries
		bool isActual = seqPos < seqLibLength && seqPos >= seqStartPos && seqPos < seqStartPos + partSeqSize && globalPatternPos < queryLength;
		if (isActual) {
			substScore = queryProfile[seqLib[seqPos] * queryLength + globalPatternPos];

			H_left = shared_H[patternPos];
			E_left = shared_E[patternPos];
			directionLeft = shared_direction[patternPos];

			if (patternPos == 0) {

				H_left = g_HdataUp[globalPos];
				E_left = g_FdataUp[globalPos];
				directionLeft = g_directionsUp[globalPos];

				if (globalPos > 0) {
					H_upleft = g_HdataUp[globalPos - 1];
					directionUpLeft = g_directionsUp[globalPos - 1];

				} 
				if (queryStartPos == 0 || iteration == 0) {
					directionUpLeft = seqPos;				
				}	
			}
		}
		__syncthreads();

		if (isActual) {
			E = max(E_left - gapExtension, H_left - gapOpen);
			F = max(F_up - gapExtension, H_up - gapOpen);

			// Compute H
			H = max(0, E);
			H = max(H, F);
			H = max(H, H_upleft + substScore);	

			//chose direction
			if (H == 0) {		 
				direction = seqPos + 1;				
			}
			else if (H == E) {
				direction = directionLeft;
			}	
			else if (H == F) {
				direction = directionUp;
			}	
			//(H == H_upleft + substScore)
			else {
				direction = directionUpLeft;
			}		
				
			shared_E[patternPos + 1] = E;
			shared_H[patternPos + 1] = H;
			shared_direction[patternPos + 1] = direction;

			H_upleft = H_left;
			H_up = H;
			F_up = F;

			directionUp = direction;			
			directionUpLeft = directionLeft;

			//collect best result
			maxScore = max(H, g_HdataMax[globalPos]);
			if (maxScore == H) {
				g_HdataMax[globalPos] = maxScore;
				g_directionsMax[globalPos] = direction;
			}

			//if this last iteration then start prepare next
			if (patternPos == (queryPartLength - 1)) {
				g_HdataRec[globalPos] = H;
				g_FdataUp[globalPos] = E;			
				g_directionsRec[globalPos]  = direction;
			}
		}
		__syncthreads();

		seqPos++;// = seqStartPos + iteration - patternPos;
		globalPos++;// = globalStartPos + iteration - patternPos;

	}

}


void calculateMatrix_wrap(int blockSize, int threadNum, const char * seqLib, ScoreType* queryProfile,                           
						  ScoreType* g_HdataUp, ScoreType* g_HdataRec, ScoreType* g_HdataMax,
						  ScoreType* g_FdataUp,
						  ScoreType* g_directionsUp, ScoreType* g_directionsRec, ScoreType* g_directionsMax,
						  int iteration) 
{
	size_t sh_mem_size = sizeof(ScoreType) * (threadNum + 1) * 3;
	calculateMatrix<<<blockSize, threadNum, sh_mem_size>>>(seqLib,
		queryProfile, g_HdataUp, 
		g_HdataRec, g_HdataMax, g_FdataUp,                                   
		g_directionsUp, g_directionsRec, g_directionsMax, iteration);
}

void setConstants(int partSeqSize, int partsNumber, int overlapLength, int seqLibLength, int queryLength, int gapOpen, int gapExtension, int maxScore, int queryPartLength) {
	cudaMemcpyToSymbol("partSeqSize",    &partSeqSize,    sizeof(partSeqSize));
	cudaMemcpyToSymbol("partsNumber",    &partsNumber,    sizeof(partsNumber));
	cudaMemcpyToSymbol("overlapLength",    &overlapLength,    sizeof(overlapLength));
	cudaMemcpyToSymbol("seqLibLength",    &seqLibLength,    sizeof(seqLibLength));
	cudaMemcpyToSymbol("queryLength",    &queryLength,    sizeof(queryLength));
	cudaMemcpyToSymbol("gapOpen",    &gapOpen,    sizeof(gapOpen));
	cudaMemcpyToSymbol("gapExtension",    &gapExtension,    sizeof(gapExtension));
	cudaMemcpyToSymbol("maxScore",    &maxScore,    sizeof(maxScore));
	cudaMemcpyToSymbol("queryPartLength",    &queryPartLength,    sizeof(queryPartLength));
}

//#endif //SW2_BUILD_WITH_CUDA

	.file	"tmpxft_002a3db3_00000000-6_sw_cuda.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2012:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2012:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"partSeqSize"
.LC1:
	.string	"partsNumber"
.LC2:
	.string	"overlapLength"
.LC3:
	.string	"seqLibLength"
.LC4:
	.string	"queryLength"
.LC5:
	.string	"gapOpen"
.LC6:
	.string	"gapExtension"
.LC7:
	.string	"maxScore"
.LC8:
	.string	"queryPartLength"
	.text
	.globl	_Z12setConstantsiiiiiiiii
	.type	_Z12setConstantsiiiiiiiii, @function
_Z12setConstantsiiiiiiiii:
.LFB2009:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movl	%edi, 28(%rsp)
	leaq	.LC0(%rip), %rdi
	movl	%esi, 24(%rsp)
	leaq	28(%rsp), %rsi
	movl	%edx, 20(%rsp)
	movl	$4, %edx
	movl	%ecx, 16(%rsp)
	xorl	%ecx, %ecx
	movl	%r8d, 12(%rsp)
	movl	$1, %r8d
	movl	%r9d, 8(%rsp)
	call	cudaMemcpyToSymbol@PLT
	leaq	24(%rsp), %rsi
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$4, %edx
	leaq	.LC1(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	leaq	20(%rsp), %rsi
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$4, %edx
	leaq	.LC2(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	leaq	16(%rsp), %rsi
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$4, %edx
	leaq	.LC3(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	leaq	12(%rsp), %rsi
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$4, %edx
	leaq	.LC4(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	leaq	8(%rsp), %rsi
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$4, %edx
	leaq	.LC5(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	leaq	48(%rsp), %rsi
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$4, %edx
	leaq	.LC6(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	leaq	56(%rsp), %rsi
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$4, %edx
	leaq	.LC7(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	leaq	64(%rsp), %rsi
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$4, %edx
	leaq	.LC8(%rip), %rdi
	call	cudaMemcpyToSymbol@PLT
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2009:
	.size	_Z12setConstantsiiiiiiiii, .-_Z12setConstantsiiiiiiiii
	.globl	_Z60__device_stub__Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_iPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.type	_Z60__device_stub__Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_iPKcPiS1_S1_S1_S1_S1_S1_S1_i, @function
_Z60__device_stub__Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_iPKcPiS1_S1_S1_S1_S1_S1_S1_i:
.LFB2034:
	.cfi_startproc
	endbr64
	subq	$248, %rsp
	.cfi_def_cfa_offset 256
	movq	256(%rsp), %rax
	movq	%rdi, 72(%rsp)
	leaq	104(%rsp), %rdi
	movq	%rsi, 64(%rsp)
	leaq	116(%rsp), %rsi
	movq	%rax, 24(%rsp)
	movq	264(%rsp), %rax
	movq	%rdx, 56(%rsp)
	leaq	88(%rsp), %rdx
	movq	%rax, 16(%rsp)
	movq	272(%rsp), %rax
	movq	%rcx, 48(%rsp)
	leaq	96(%rsp), %rcx
	movq	%r8, 40(%rsp)
	movq	%r9, 32(%rsp)
	movq	%rax, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	72(%rsp), %rax
	movl	$1, 112(%rsp)
	movq	%rax, 152(%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 184(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 192(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 200(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 208(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 216(%rsp)
	leaq	280(%rsp), %rax
	movq	%rax, 224(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 104(%rsp)
	movq	%rax, 116(%rsp)
	movl	$1, 124(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L4
	pushq	96(%rsp)
	.cfi_def_cfa_offset 264
	leaq	_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i(%rip), %rdi
	pushq	96(%rsp)
	.cfi_def_cfa_offset 272
	movq	132(%rsp), %rcx
	movl	140(%rsp), %r8d
	movq	120(%rsp), %rsi
	movl	128(%rsp), %edx
	leaq	168(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 264
	popq	%rdx
	.cfi_def_cfa_offset 256
.L4:
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	addq	$248, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2034:
	.size	_Z60__device_stub__Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_iPKcPiS1_S1_S1_S1_S1_S1_S1_i, .-_Z60__device_stub__Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_iPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.globl	_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.type	_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i, @function
_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i:
.LFB2035:
	.cfi_startproc
	endbr64
	jmp	_Z60__device_stub__Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_iPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.cfi_endproc
.LFE2035:
	.size	_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i, .-_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.globl	_Z20calculateMatrix_wrapiiPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.type	_Z20calculateMatrix_wrapiiPKcPiS1_S1_S1_S1_S1_S1_S1_i, @function
_Z20calculateMatrix_wrapiiPKcPiS1_S1_S1_S1_S1_S1_S1_i:
.LFB2008:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%r8, 16(%rsp)
	leal	1(%rsi), %r8d
	movq	128(%rsp), %r12
	movslq	%r8d, %r8
	movq	%rdx, (%rsp)
	movl	168(%rsp), %ebp
	movabsq	$4294967297, %rdx
	imulq	$12, %r8, %r8
	movq	%rdx, 44(%rsp)
	movq	136(%rsp), %r13
	movl	%esi, 52(%rsp)
	movl	48(%rsp), %esi
	movq	%rdx, 56(%rsp)
	movq	52(%rsp), %rdx
	movq	%rcx, 8(%rsp)
	movl	60(%rsp), %ecx
	movl	%edi, 40(%rsp)
	movq	40(%rsp), %rdi
	movq	%r9, 24(%rsp)
	xorl	%r9d, %r9d
	movq	144(%rsp), %r14
	movq	152(%rsp), %r15
	movq	160(%rsp), %rbx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L10
	movl	%ebp, 152(%rsp)
	movq	24(%rsp), %rcx
	movq	%r13, %r9
	movq	%r12, %r8
	movq	%rbx, 144(%rsp)
	movq	16(%rsp), %rdx
	movq	%r15, 136(%rsp)
	movq	8(%rsp), %rsi
	movq	%r14, 128(%rsp)
	movq	(%rsp), %rdi
	addq	$72, %rsp
	.cfi_remember_state
	.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
	jmp	_Z60__device_stub__Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_iPKcPiS1_S1_S1_S1_S1_S1_S1_i
.L10:
	.cfi_restore_state
	addq	$72, %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
.LFE2008:
	.size	_Z20calculateMatrix_wrapiiPKcPiS1_S1_S1_S1_S1_S1_S1_i, .-_Z20calculateMatrix_wrapiiPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.section	.rodata.str1.1
.LC9:
	.string	"_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2037:
	.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	.LC9(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_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	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC0(%rip), %rdx
	movl	$4, %r9d
	leaq	_ZL11partSeqSize(%rip), %rsi
	pushq	$1
	.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	$1
	.cfi_def_cfa_offset 32
	leaq	.LC1(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL11partsNumber(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC2(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL13overlapLength(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	popq	%r8
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC3(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL12seqLibLength(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%r9
	.cfi_def_cfa_offset 24
	popq	%r10
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC4(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL11queryLength(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%r11
	.cfi_def_cfa_offset 24
	popq	%rax
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC5(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL7gapOpen(%rip), %rsi
	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	$1
	.cfi_def_cfa_offset 32
	leaq	.LC6(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL12gapExtension(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC7(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL8maxScore(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	popq	%r8
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC8(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movl	$4, %r9d
	movq	%rdx, %rcx
	leaq	_ZL15queryPartLength(%rip), %rsi
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%r9
	.cfi_def_cfa_offset 24
	popq	%r10
	.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
.LFE2037:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.local	_ZL15queryPartLength
	.comm	_ZL15queryPartLength,4,4
	.local	_ZL8maxScore
	.comm	_ZL8maxScore,4,4
	.local	_ZL12gapExtension
	.comm	_ZL12gapExtension,4,4
	.local	_ZL7gapOpen
	.comm	_ZL7gapOpen,4,4
	.local	_ZL11queryLength
	.comm	_ZL11queryLength,4,4
	.local	_ZL12seqLibLength
	.comm	_ZL12seqLibLength,4,4
	.local	_ZL13overlapLength
	.comm	_ZL13overlapLength,4,4
	.local	_ZL11partsNumber
	.comm	_ZL11partsNumber,4,4
	.local	_ZL11partSeqSize
	.comm	_ZL11partSeqSize,4,4
	.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>
//#ifdef SW2_BUILD_WITH_CUDA

typedef int ScoreType;

// CUDA global constants
__constant__ int partSeqSize, partsNumber, overlapLength, seqLibLength, queryLength;
__constant__ int gapOpen, gapExtension, maxScore, queryPartLength;


//global function
__global__ void calculateMatrix(const char * seqLib, ScoreType* queryProfile,
								ScoreType* g_HdataUp, ScoreType* g_HdataRec, ScoreType* g_HdataMax,
								ScoreType* g_FdataUp,
								ScoreType* g_directionsUp, ScoreType* g_directionsRec, ScoreType* g_directionsMax,
								int queryStartPos) 
{

	//registers
	int patternPos = threadIdx.x;	
	int globalPatternPos =  queryStartPos + patternPos;

	int seqStartPos = blockIdx.x * (partSeqSize - overlapLength);
	int globalStartPos = blockIdx.x * (partSeqSize + 1);
	
	int seqPos = 0, globalPos = 0, diagNum = 0;
	ScoreType substScore = 0;	
	ScoreType E = 0, E_left = 0, F = 0, F_up = 0, H = 0,
		H_left = 0, H_up = 0, H_upleft = 0, E_left_init = 0, 
		H_left_init = 0, directionLeft = 0, directionUp = 0, 
		directionUpLeft = 0, direction = 0, directionInit = 0,
		maxScore = 0;



	//dynamic allocation shared memory
	extern __shared__ ScoreType shared_H[];
	ScoreType* shared_E = (ScoreType*)&shared_H[queryPartLength + 1];
	ScoreType* shared_direction = (ScoreType*)&shared_E[queryPartLength + 1];

	shared_H[patternPos] = 0;
	shared_E[patternPos] = 0;
	shared_direction[patternPos] = 0;

	__syncthreads();	

	seqPos = seqStartPos - patternPos;
	globalPos = globalStartPos - patternPos;

	diagNum = (partSeqSize + queryPartLength - 1);
	for (int iteration = 0; iteration < diagNum; iteration++) {

		//check boundaries
		bool isActual = seqPos < seqLibLength && seqPos >= seqStartPos && seqPos < seqStartPos + partSeqSize && globalPatternPos < queryLength;
		if (isActual) {
			substScore = queryProfile[seqLib[seqPos] * queryLength + globalPatternPos];

			H_left = shared_H[patternPos];
			E_left = shared_E[patternPos];
			directionLeft = shared_direction[patternPos];

			if (patternPos == 0) {

				H_left = g_HdataUp[globalPos];
				E_left = g_FdataUp[globalPos];
				directionLeft = g_directionsUp[globalPos];

				if (globalPos > 0) {
					H_upleft = g_HdataUp[globalPos - 1];
					directionUpLeft = g_directionsUp[globalPos - 1];

				} 
				if (queryStartPos == 0 || iteration == 0) {
					directionUpLeft = seqPos;				
				}	
			}
		}
		__syncthreads();

		if (isActual) {
			E = max(E_left - gapExtension, H_left - gapOpen);
			F = max(F_up - gapExtension, H_up - gapOpen);

			// Compute H
			H = max(0, E);
			H = max(H, F);
			H = max(H, H_upleft + substScore);	

			//chose direction
			if (H == 0) {		 
				direction = seqPos + 1;				
			}
			else if (H == E) {
				direction = directionLeft;
			}	
			else if (H == F) {
				direction = directionUp;
			}	
			//(H == H_upleft + substScore)
			else {
				direction = directionUpLeft;
			}		
				
			shared_E[patternPos + 1] = E;
			shared_H[patternPos + 1] = H;
			shared_direction[patternPos + 1] = direction;

			H_upleft = H_left;
			H_up = H;
			F_up = F;

			directionUp = direction;			
			directionUpLeft = directionLeft;

			//collect best result
			maxScore = max(H, g_HdataMax[globalPos]);
			if (maxScore == H) {
				g_HdataMax[globalPos] = maxScore;
				g_directionsMax[globalPos] = direction;
			}

			//if this last iteration then start prepare next
			if (patternPos == (queryPartLength - 1)) {
				g_HdataRec[globalPos] = H;
				g_FdataUp[globalPos] = E;			
				g_directionsRec[globalPos]  = direction;
			}
		}
		__syncthreads();

		seqPos++;// = seqStartPos + iteration - patternPos;
		globalPos++;// = globalStartPos + iteration - patternPos;

	}

}


void calculateMatrix_wrap(int blockSize, int threadNum, const char * seqLib, ScoreType* queryProfile,                           
						  ScoreType* g_HdataUp, ScoreType* g_HdataRec, ScoreType* g_HdataMax,
						  ScoreType* g_FdataUp,
						  ScoreType* g_directionsUp, ScoreType* g_directionsRec, ScoreType* g_directionsMax,
						  int iteration) 
{
	size_t sh_mem_size = sizeof(ScoreType) * (threadNum + 1) * 3;
	calculateMatrix<<<blockSize, threadNum, sh_mem_size>>>(seqLib,
		queryProfile, g_HdataUp, 
		g_HdataRec, g_HdataMax, g_FdataUp,                                   
		g_directionsUp, g_directionsRec, g_directionsMax, iteration);
}

void setConstants(int partSeqSize, int partsNumber, int overlapLength, int seqLibLength, int queryLength, int gapOpen, int gapExtension, int maxScore, int queryPartLength) {
	hipMemcpyToSymbol(HIP_SYMBOL("partSeqSize"),    &partSeqSize,    sizeof(partSeqSize));
	hipMemcpyToSymbol(HIP_SYMBOL("partsNumber"),    &partsNumber,    sizeof(partsNumber));
	hipMemcpyToSymbol(HIP_SYMBOL("overlapLength"),    &overlapLength,    sizeof(overlapLength));
	hipMemcpyToSymbol(HIP_SYMBOL("seqLibLength"),    &seqLibLength,    sizeof(seqLibLength));
	hipMemcpyToSymbol(HIP_SYMBOL("queryLength"),    &queryLength,    sizeof(queryLength));
	hipMemcpyToSymbol(HIP_SYMBOL("gapOpen"),    &gapOpen,    sizeof(gapOpen));
	hipMemcpyToSymbol(HIP_SYMBOL("gapExtension"),    &gapExtension,    sizeof(gapExtension));
	hipMemcpyToSymbol(HIP_SYMBOL("maxScore"),    &maxScore,    sizeof(maxScore));
	hipMemcpyToSymbol(HIP_SYMBOL("queryPartLength"),    &queryPartLength,    sizeof(queryPartLength));
}

//#endif //SW2_BUILD_WITH_CUDA

	.text
	.file	"sw_cuda.hip"
	.globl	_Z30__device_stub__calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i # -- Begin function _Z30__device_stub__calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.type	_Z30__device_stub__calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i,@function
_Z30__device_stub__calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i: # @_Z30__device_stub__calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_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	$176, %rsp
	.cfi_def_cfa_offset 224
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	16(%rsp), %r8
	movq	%r9, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	224(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	232(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	240(%rsp), %rax
	movq	%rax, 64(%rbx)
	leaq	248(%rsp), %rax
	movq	%rax, 72(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$192, %rsp
	.cfi_adjust_cfa_offset -192
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z30__device_stub__calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i, .Lfunc_end0-_Z30__device_stub__calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z20calculateMatrix_wrapiiPKcPiS1_S1_S1_S1_S1_S1_S1_i # -- Begin function _Z20calculateMatrix_wrapiiPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.type	_Z20calculateMatrix_wrapiiPKcPiS1_S1_S1_S1_S1_S1_S1_i,@function
_Z20calculateMatrix_wrapiiPKcPiS1_S1_S1_S1_S1_S1_S1_i: # @_Z20calculateMatrix_wrapiiPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%r9, %rbx
	movq	%r8, %r14
	movq	%rcx, %r15
	movq	%rdx, %r12
	movslq	%esi, %rax
	leaq	(,%rax,4), %rcx
	leaq	(%rcx,%rcx,2), %r8
	addq	$12, %r8
	movl	%edi, %edi
	btsq	$32, %rdi
	movl	%eax, %edx
	btsq	$32, %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	je	.LBB1_1
# %bb.2:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	jmp	.LBB1_3
.LBB1_1:
	.cfi_def_cfa_offset 48
	movl	88(%rsp), %eax
	movq	56(%rsp), %r9
	movq	48(%rsp), %r8
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movq	%rbx, %rcx
	pushq	%rax
	.cfi_adjust_cfa_offset 8
	pushq	88(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	88(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	88(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	_Z30__device_stub__calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
	addq	$40, %rsp
	.cfi_adjust_cfa_offset -40
.LBB1_3:
	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_end1:
	.size	_Z20calculateMatrix_wrapiiPKcPiS1_S1_S1_S1_S1_S1_S1_i, .Lfunc_end1-_Z20calculateMatrix_wrapiiPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z12setConstantsiiiiiiiii       # -- Begin function _Z12setConstantsiiiiiiiii
	.type	_Z12setConstantsiiiiiiiii,@function
_Z12setConstantsiiiiiiiii:              # @_Z12setConstantsiiiiiiiii
	.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	$32, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	28(%rsp), %rax
	movl	%edi, (%rax)
	leaq	24(%rsp), %r13
	movl	%esi, (%r13)
	leaq	20(%rsp), %r12
	movl	%edx, (%r12)
	leaq	16(%rsp), %r15
	movl	%ecx, (%r15)
	leaq	12(%rsp), %r14
	movl	%r8d, (%r14)
	leaq	8(%rsp), %rbx
	movl	%r9d, (%rbx)
	movl	$.L.str, %edi
	movl	$4, %edx
	movq	%rax, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movl	$.L.str.1, %edi
	movl	$4, %edx
	movq	%r13, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movl	$.L.str.2, %edi
	movl	$4, %edx
	movq	%r12, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movl	$.L.str.3, %edi
	movl	$4, %edx
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movl	$.L.str.4, %edi
	movl	$4, %edx
	movq	%r14, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	movl	$.L.str.5, %edi
	movl	$4, %edx
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	leaq	80(%rsp), %rsi
	movl	$.L.str.6, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	leaq	88(%rsp), %rsi
	movl	$.L.str.7, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	leaq	96(%rsp), %rsi
	movl	$.L.str.8, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	callq	hipMemcpyToSymbol
	addq	$32, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z12setConstantsiiiiiiiii, .Lfunc_end2-_Z12setConstantsiiiiiiiii
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	subq	$32, %rsp
	.cfi_adjust_cfa_offset 32
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movl	$partSeqSize, %esi
	movl	$.L.str, %edx
	movl	$.L.str, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$partsNumber, %esi
	movl	$.L.str.1, %edx
	movl	$.L.str.1, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$overlapLength, %esi
	movl	$.L.str.2, %edx
	movl	$.L.str.2, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$seqLibLength, %esi
	movl	$.L.str.3, %edx
	movl	$.L.str.3, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$queryLength, %esi
	movl	$.L.str.4, %edx
	movl	$.L.str.4, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$gapOpen, %esi
	movl	$.L.str.5, %edx
	movl	$.L.str.5, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$gapExtension, %esi
	movl	$.L.str.6, %edx
	movl	$.L.str.6, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$maxScore, %esi
	movl	$.L.str.7, %edx
	movl	$.L.str.7, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$queryPartLength, %esi
	movl	$.L.str.8, %edx
	movl	$.L.str.8, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$__hip_module_dtor, %edi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end3:
	.size	__hip_module_ctor, .Lfunc_end3-__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	.LBB4_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
.LBB4_2:
	retq
.Lfunc_end4:
	.size	__hip_module_dtor, .Lfunc_end4-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	partSeqSize,@object             # @partSeqSize
	.local	partSeqSize
	.comm	partSeqSize,4,4
	.type	partsNumber,@object             # @partsNumber
	.local	partsNumber
	.comm	partsNumber,4,4
	.type	overlapLength,@object           # @overlapLength
	.local	overlapLength
	.comm	overlapLength,4,4
	.type	seqLibLength,@object            # @seqLibLength
	.local	seqLibLength
	.comm	seqLibLength,4,4
	.type	queryLength,@object             # @queryLength
	.local	queryLength
	.comm	queryLength,4,4
	.type	gapOpen,@object                 # @gapOpen
	.local	gapOpen
	.comm	gapOpen,4,4
	.type	gapExtension,@object            # @gapExtension
	.local	gapExtension
	.comm	gapExtension,4,4
	.type	maxScore,@object                # @maxScore
	.local	maxScore
	.comm	maxScore,4,4
	.type	queryPartLength,@object         # @queryPartLength
	.local	queryPartLength
	.comm	queryPartLength,4,4
	.type	_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i,@object # @_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.section	.rodata,"a",@progbits
	.globl	_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.p2align	3, 0x0
_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i:
	.quad	_Z30__device_stub__calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.size	_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i, 8

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

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"partsNumber"
	.size	.L.str.1, 12

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"overlapLength"
	.size	.L.str.2, 14

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

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

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

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"gapExtension"
	.size	.L.str.6, 13

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"maxScore"
	.size	.L.str.7, 9

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"queryPartLength"
	.size	.L.str.8, 16

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i"
	.size	.L__unnamed_1, 47

	.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 _Z30__device_stub__calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym partSeqSize
	.addrsig_sym partsNumber
	.addrsig_sym overlapLength
	.addrsig_sym seqLibLength
	.addrsig_sym queryLength
	.addrsig_sym gapOpen
	.addrsig_sym gapExtension
	.addrsig_sym maxScore
	.addrsig_sym queryPartLength
	.addrsig_sym _Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i ; -- Begin function _Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.globl	_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
	.p2align	8
	.type	_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i,@function
_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i: ; @_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
; %bb.0:
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, queryPartLength@rel32@lo+4
	s_addc_u32 s3, s3, queryPartLength@rel32@hi+12
	v_dual_mov_b32 v1, 0 :: v_dual_lshlrev_b32 v4, 2, v0
	s_load_b32 s4, s[2:3], 0x0
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, partSeqSize@rel32@lo+4
	s_addc_u32 s3, s3, partSeqSize@rel32@hi+12
	s_load_b32 s2, s[2:3], 0x0
	v_add_nc_u32_e32 v18, 0, v4
	ds_store_b32 v18, v1
	s_waitcnt lgkmcnt(0)
	s_lshl_b32 s5, s4, 2
	s_add_i32 s4, s4, -1
	s_add_i32 s6, s5, 0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_i32 s3, s6, 4
	v_add_nc_u32_e32 v19, s6, v4
	s_add_i32 s5, s3, s5
	s_add_i32 s6, s4, s2
	v_add_nc_u32_e32 v20, s5, v4
	s_cmp_lt_i32 s6, 1
	ds_store_b32 v19, v1 offset:4
	ds_store_b32 v20, v1 offset:4
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc1 .LBB0_19
; %bb.1:                                ; %.lr.ph
	s_getpc_b64 s[8:9]
	s_add_u32 s8, s8, overlapLength@rel32@lo+4
	s_addc_u32 s9, s9, overlapLength@rel32@hi+12
	s_load_b512 s[16:31], s[0:1], 0x0
	s_load_b32 s14, s[8:9], 0x0
	s_clause 0x1
	s_load_b32 s33, s[0:1], 0x48
	s_load_b64 s[12:13], s[0:1], 0x40
	s_add_i32 s7, s2, 1
	s_getpc_b64 s[8:9]
	s_add_u32 s8, s8, queryLength@rel32@lo+4
	s_addc_u32 s9, s9, queryLength@rel32@hi+12
	s_mul_i32 s7, s7, s15
	s_getpc_b64 s[10:11]
	s_add_u32 s10, s10, seqLibLength@rel32@lo+4
	s_addc_u32 s11, s11, seqLibLength@rel32@hi+12
	v_sub_nc_u32_e32 v2, s7, v0
	s_load_b32 s7, s[8:9], 0x0
	v_cmp_eq_u32_e32 vcc_lo, 0, v0
	v_add_nc_u32_e32 v21, s3, v4
	v_cmp_eq_u32_e64 s0, s4, v0
	v_ashrrev_i32_e32 v3, 31, v2
	v_add3_u32 v22, s5, 4, v4
	s_load_b32 s34, s[10:11], 0x0
	v_dual_mov_b32 v29, 0 :: v_dual_mov_b32 v30, 0
	s_delay_alu instid0(VALU_DEP_3)
	v_lshlrev_b64 v[16:17], 2, v[2:3]
	v_dual_mov_b32 v31, 0 :: v_dual_mov_b32 v32, 0
	s_waitcnt lgkmcnt(0)
	s_sub_i32 s8, s2, s14
	v_dual_mov_b32 v26, 0 :: v_dual_add_nc_u32 v3, s33, v0
	s_mul_i32 s8, s8, s15
	v_add_co_u32 v4, s1, s24, v16
	v_sub_nc_u32_e32 v23, s8, v0
	s_add_i32 s14, s8, s2
	s_cmp_eq_u32 s33, 0
	v_add_co_ci_u32_e64 v5, s1, s25, v17, s1
	s_cselect_b32 s9, -1, 0
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, gapExtension@rel32@lo+4
	s_addc_u32 s3, s3, gapExtension@rel32@hi+12
	v_ashrrev_i32_e32 v0, 31, v23
	s_getpc_b64 s[4:5]
	s_add_u32 s4, s4, gapOpen@rel32@lo+4
	s_addc_u32 s5, s5, gapOpen@rel32@hi+12
	s_load_b32 s10, s[2:3], 0x0
	s_load_b32 s11, s[4:5], 0x0
	v_add_co_u32 v24, s2, s16, v23
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v25, s2, s17, v0, s2
	v_add_co_u32 v6, s2, s12, v16
	v_add_co_ci_u32_e64 v7, s2, s13, v17, s2
	v_add_co_u32 v8, s2, s22, v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v9, s2, s23, v17, s2
	v_add_co_u32 v10, s2, s26, v16
	v_add_co_ci_u32_e64 v11, s2, s27, v17, s2
	v_add_co_u32 v12, s2, s30, v16
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v13, s2, s31, v17, s2
	v_add_co_u32 v14, s2, s20, v16
	v_add_co_ci_u32_e64 v15, s2, s21, v17, s2
	v_add_co_u32 v16, s2, s28, v16
	v_cmp_gt_i32_e64 s1, s7, v3
	v_add_co_ci_u32_e64 v17, s2, s29, v17, s2
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v33, 0
	v_dual_mov_b32 v28, 0 :: v_dual_mov_b32 v27, 0
	s_mov_b64 s[4:5], 0
	s_min_i32 s12, s34, s14
.LBB0_2:                                ; =>This Inner Loop Header: Depth=1
	v_add_co_u32 v34, null, v23, s4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cmp_le_i32_e64 s2, s8, v34
	v_cmp_gt_i32_e64 s3, s12, v34
	s_and_b32 s2, s3, s2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s3, s2, s1
	s_and_saveexec_b32 s13, s3
	s_cbranch_execz .LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	v_add_co_u32 v29, s2, v24, s4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v30, s2, s5, v25, s2
	global_load_i8 v31, v[29:30], off
	s_waitcnt vmcnt(0)
	v_mad_u64_u32 v[29:30], null, s7, v31, v[3:4]
	v_ashrrev_i32_e32 v30, 31, v29
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[29:30], 2, v[29:30]
	v_add_co_u32 v29, s2, s18, v29
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v30, s2, s19, v30, s2
	global_load_b32 v29, v[29:30], off
	ds_load_b32 v32, v18
	ds_load_b32 v30, v19 offset:4
	ds_load_b32 v31, v20 offset:4
	s_and_saveexec_b32 s14, vcc_lo
	s_cbranch_execz .LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	s_waitcnt lgkmcnt(0)
	global_load_b32 v32, v[14:15], off
	global_load_b32 v30, v[10:11], off
	global_load_b32 v31, v[16:17], off
	v_add_co_u32 v35, null, v2, s4
	s_mov_b32 s15, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_lt_i32_e32 0, v35
	s_cbranch_execz .LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v0, -1, v35
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[35:36], 2, v[0:1]
	v_add_co_u32 v37, s2, s20, v35
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v38, s2, s21, v36, s2
	v_add_co_u32 v35, s2, s28, v35
	v_add_co_ci_u32_e64 v36, s2, s29, v36, s2
	global_load_b32 v33, v[37:38], off
	global_load_b32 v0, v[35:36], off
.LBB0_6:                                ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s15
	s_cmp_eq_u32 s4, 0
	s_cselect_b32 s2, -1, 0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s2, s9, s2
	s_waitcnt vmcnt(0)
	v_cndmask_b32_e64 v0, v0, v34, s2
.LBB0_7:                                ; %Flow221
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s14
.LBB0_8:                                ;   in Loop: Header=BB0_2 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s13
	s_waitcnt vmcnt(0) lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_and_saveexec_b32 s13, s3
	s_cbranch_execz .LBB0_18
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	v_subrev_nc_u32_e32 v35, s10, v30
	v_subrev_nc_u32_e32 v36, s11, v32
	v_subrev_nc_u32_e32 v28, s10, v28
	v_subrev_nc_u32_e32 v27, s11, v27
	v_add_nc_u32_e32 v37, v29, v33
	s_mov_b32 s3, exec_lo
	v_max_i32_e32 v33, v35, v36
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_max_i32_e32 v28, v28, v27
	v_max3_i32 v35, v33, v28, v37
	s_delay_alu instid0(VALU_DEP_1)
	v_max_i32_e32 v27, 0, v35
	v_cmpx_lt_i32_e32 0, v35
	s_xor_b32 s3, exec_lo, s3
; %bb.10:                               ;   in Loop: Header=BB0_2 Depth=1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_eq_u32_e64 s2, v27, v28
                                        ; implicit-def: $vgpr34
	v_cndmask_b32_e64 v0, v0, v26, s2
	v_cmp_eq_u32_e64 s2, v27, v33
	s_delay_alu instid0(VALU_DEP_1)
	v_cndmask_b32_e64 v26, v0, v31, s2
; %bb.11:                               ; %Flow219
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_and_not1_saveexec_b32 s2, s3
; %bb.12:                               ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v26, 1, v34
; %bb.13:                               ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s2
	global_load_b32 v0, v[4:5], off
	s_mov_b32 s3, exec_lo
	ds_store_b32 v21, v33 offset:4
	ds_store_b32 v18, v27 offset:4
	ds_store_b32 v22, v26 offset:4
	s_waitcnt vmcnt(0)
	v_cmpx_ge_i32_e64 v27, v0
	s_cbranch_execz .LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_2 Depth=1
	global_store_b32 v[4:5], v27, off
	global_store_b32 v[6:7], v26, off
.LBB0_15:                               ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s3
	s_and_saveexec_b32 s2, s0
	s_cbranch_execz .LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_2 Depth=1
	global_store_b32 v[8:9], v27, off
	global_store_b32 v[10:11], v33, off
	global_store_b32 v[12:13], v26, off
.LBB0_17:                               ; %Flow
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s2
	v_dual_mov_b32 v0, v31 :: v_dual_mov_b32 v33, v32
.LBB0_18:                               ; %Flow220
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s13
	v_add_co_u32 v4, s2, v4, 4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v5, s2, 0, v5, s2
	v_add_co_u32 v6, s2, v6, 4
	v_add_co_ci_u32_e64 v7, s2, 0, v7, s2
	v_add_co_u32 v8, s2, v8, 4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v9, s2, 0, v9, s2
	v_add_co_u32 v10, s2, v10, 4
	v_add_co_ci_u32_e64 v11, s2, 0, v11, s2
	v_add_co_u32 v12, s2, v12, 4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v13, s2, 0, v13, s2
	v_add_co_u32 v14, s2, v14, 4
	v_add_co_ci_u32_e64 v15, s2, 0, v15, s2
	v_add_co_u32 v16, s2, v16, 4
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v17, s2, 0, v17, s2
	s_add_u32 s4, s4, 1
	s_addc_u32 s5, s5, 0
	s_cmp_eq_u32 s6, s4
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc0 .LBB0_2
.LBB0_19:                               ; %._crit_edge
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 76
		.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 39
		.amdhsa_next_free_sgpr 35
		.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	_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i, .Lfunc_end0-_Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1356
; NumSgprs: 37
; NumVgprs: 39
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 4
; VGPRBlocks: 4
; NumSGPRsForWavesPerEU: 37
; NumVGPRsForWavesPerEU: 39
; 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	partSeqSize             ; @partSeqSize
	.type	partSeqSize,@object
	.section	.bss,"aw",@nobits
	.globl	partSeqSize
	.p2align	2, 0x0
partSeqSize:
	.long	0                               ; 0x0
	.size	partSeqSize, 4

	.protected	partsNumber             ; @partsNumber
	.type	partsNumber,@object
	.globl	partsNumber
	.p2align	2, 0x0
partsNumber:
	.long	0                               ; 0x0
	.size	partsNumber, 4

	.protected	overlapLength           ; @overlapLength
	.type	overlapLength,@object
	.globl	overlapLength
	.p2align	2, 0x0
overlapLength:
	.long	0                               ; 0x0
	.size	overlapLength, 4

	.protected	seqLibLength            ; @seqLibLength
	.type	seqLibLength,@object
	.globl	seqLibLength
	.p2align	2, 0x0
seqLibLength:
	.long	0                               ; 0x0
	.size	seqLibLength, 4

	.protected	queryLength             ; @queryLength
	.type	queryLength,@object
	.globl	queryLength
	.p2align	2, 0x0
queryLength:
	.long	0                               ; 0x0
	.size	queryLength, 4

	.protected	gapOpen                 ; @gapOpen
	.type	gapOpen,@object
	.globl	gapOpen
	.p2align	2, 0x0
gapOpen:
	.long	0                               ; 0x0
	.size	gapOpen, 4

	.protected	gapExtension            ; @gapExtension
	.type	gapExtension,@object
	.globl	gapExtension
	.p2align	2, 0x0
gapExtension:
	.long	0                               ; 0x0
	.size	gapExtension, 4

	.protected	maxScore                ; @maxScore
	.type	maxScore,@object
	.globl	maxScore
	.p2align	2, 0x0
maxScore:
	.long	0                               ; 0x0
	.size	maxScore, 4

	.protected	queryPartLength         ; @queryPartLength
	.type	queryPartLength,@object
	.globl	queryPartLength
	.p2align	2, 0x0
queryPartLength:
	.long	0                               ; 0x0
	.size	queryPartLength, 4

	.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 partSeqSize
	.addrsig_sym overlapLength
	.addrsig_sym seqLibLength
	.addrsig_sym queryLength
	.addrsig_sym gapOpen
	.addrsig_sym gapExtension
	.addrsig_sym queryPartLength
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         48
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         56
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         64
        .size:           8
        .value_kind:     global_buffer
      - .offset:         72
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 76
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i
    .private_segment_fixed_size: 0
    .sgpr_count:     37
    .sgpr_spill_count: 0
    .symbol:         _Z15calculateMatrixPKcPiS1_S1_S1_S1_S1_S1_S1_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     39
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
