///////	/////////////////////////////////////////////////////////////////////
// Calculate scalar products of VectorN vectors of ElementN elements on CPU.
// Straight accumulation in double precision.
////////////////////////////////////////////////////////////////////////////
 #include <iostream>
#include <cmath>
using namespace std;


void Kernel_5_CPU (int* B, int* Kernel_5_output, int* Kernel_4_output, int* Length_Seq_K4, 
				   int K3_Length, int K3_Report, int K3_Safety, int K5R,
				   int K5_Length, int K4_S1, int K4_S2,int K4_S3)
{
	int *Sum, *Center_Seq, *Center_Rev, *Kernel_5_out_shared, *D, *L, *Kernel_5_Temp;
	int Center_Loc;
	
	Sum                  = new int [K3_Report];
    Center_Seq		     = new int [K5_Length];
	Center_Rev		     = new int [K5_Length];
	Kernel_5_out_shared  = new int [K5_Length];
	D    			     = new int [(K5_Length+1)*(K5_Length+1)];
	L    			     = new int [(K5_Length+1)*(K5_Length+1)];
	Kernel_5_Temp        = new int [K3_Report*K3_Report*K5R];



	for (int Sub_Thread=0; Sub_Thread<K5R; Sub_Thread++)
	{
		int counter = Sub_Thread*K3_Report*K3_Report;
		int Loc = counter;
		for (int i=0; i<K3_Report; i++)
		{
			for (int j=i+1; j<K3_Report; j++)
			{
				Kernel_5_Temp [i*K3_Report + j + Loc] = Kernel_4_output[counter];
				Kernel_5_Temp [j*K3_Report + i + Loc] = Kernel_4_output[counter];
				counter++;
			}
		}
	}

	// ---------------------------- finding summation of each row of matrix (minimum is a Center) --------------------------------
	for(int Sub_Block =0; Sub_Block < K5R; Sub_Block ++)
	{
		for (int Sub_Thread=0; Sub_Thread<K3_Report; Sub_Thread++)
		{
			int iStart = Sub_Thread * K3_Report + Sub_Block * K3_Report * K3_Report;
			Sum[Sub_Thread] = 0;
			for (int j=0; j<K3_Report; j++)
			{
				Sum[Sub_Thread] = Sum[Sub_Thread] + Kernel_5_Temp [j + iStart] ;
			}
		}
		int Minimum_Sum = 10000;
		for (int i=0; i<K3_Report; i++)
		{
			if (Sum[i]<Minimum_Sum)
			{
				Minimum_Sum   = Sum[i];
				Center_Loc = i;
			}
		}
//printf("---------  %i      %i   \n", Minimum_Sum,Center_Loc);
		//--------------------------------------------- Extract Center Sequence ----------------------------------
		for (int i=0; i<K3_Length; i++)          
		{
			Center_Seq [i]= B[i + Center_Loc * K3_Length * K3_Safety + Sub_Block * K3_Length * K3_Safety * K3_Report];
			Center_Rev[i]=0;
//			printf("---------  %i      %i   \n", i,Center_Seq [i]);
//			Kernel_5_Temp[i+K5_Length*K3_Report*Sub_Block]=Center_Seq [i];
		}
		//--------------------------------------------- Initialize D & L arrays ----------------------------------
		L[0]=0;
		for (int i=0; i<K5_Length+1; i++)
		{
			D[i] = i * K4_S3;
			D[i*(K5_Length+1)] = i * K4_S3;
			if (i>0)
				{
					L[i]           = i - 1;
					L[i*(K5_Length+1)] = (i-1)*(K5_Length+1);
				}
		}
		//--------------------------------------------- Start Multiple Alignment  ----------------------------------
		int Length_Center_Seq = Length_Seq_K4[Center_Loc + Sub_Block * K3_Report];
		int Temp[6];
		for (int k=0; k<K3_Report; k++)
		{
			int B_Loc = k * K3_Safety * K3_Length + Sub_Block * K3_Safety * K3_Length * K3_Report;
			int End_A = Length_Center_Seq;
			int End_B = Length_Seq_K4[k + Sub_Block * K3_Report];

			for (int i = 0; i<End_B; i++ )
			{
				for (int j = 0; j<End_A; j++) 
				{
					int D_Sim;
					int Num  =  i   *(K5_Length+1) + j ;
					int Num1 = (i+1)*(K5_Length+1) + j ;

					// First E then F then Similarity 	
					if (Center_Seq [j]==B[B_Loc + i])
						D_Sim = D[Num]+K4_S1;
					else
						D_Sim=D[Num]+K4_S2;
					
					Temp[4]= D_Sim;
					Temp[5]= Num;
					
					Temp[0] = D[Num1]  + K4_S3; 
					Temp[1] = Num1;

					Temp[2] = D[Num+1] + K4_S3;
					Temp[3] = Num+1;
							
					int minD =1000;
					int minL = 0;
					for (int n=0; n<6; n=n+2)
					{
						if (Temp[n]<minD)
						{
							minD = Temp[n];
							minL = Temp[n+1];
						}
					}	
					D[Num1+1] = minD;             
					L[Num1+1] = minL;
				}
			}
			//------------------------------------------------ Trace Back -----------------------------------------------------------------------
			int Loc_Temp = (End_B)*(K5_Length+1) + End_A; 
			int Loc_Path = Loc_Temp;
			int Check = 0;

			int Index_A = Length_Center_Seq-1;
			int Index_B = B_Loc + End_B-1;
			int cnt = 0;
			int update = 0;

			while   (Loc_Path != Check) 
			{						   
				Loc_Path = L[Loc_Temp];
				int Dif = Loc_Temp - Loc_Path;
				if (Dif==(K5_Length+1+1))
				{
					Center_Rev [cnt] = Center_Seq [Index_A];
					Kernel_5_output[cnt + K5_Length*k + K5_Length*K3_Report*Sub_Block] = B[Index_B];
					
					Index_B -=1;
					Index_A -=1;
				}
				else
				{				
					if (Dif==(K5_Length+1))
					{
						Center_Rev [cnt] = 666;
						Kernel_5_output[cnt + K5_Length*k + K5_Length*K3_Report*Sub_Block] = B[Index_B];
						Index_B -=1;
						update=1;
						// update previous sequences
						for (int j=0; j<k; j++)
						{
							for (int i=cnt; i<K5_Length; i++)
							{
								Kernel_5_out_shared[i] = Kernel_5_output[i + K5_Length*j + K5_Length*K3_Report*Sub_Block]; 
							}
							Kernel_5_output[cnt + K5_Length*j + K5_Length*K3_Report*Sub_Block] = 666;
							for (int i=cnt+1; i<K5_Length; i++)
							{
								Kernel_5_output[i + K5_Length*j + K5_Length*K3_Report*Sub_Block]  = Kernel_5_out_shared[i-1] ;
							}
						}
					}
					else
					{
						Center_Rev [cnt] = Center_Seq [Index_A];
						Kernel_5_output[cnt + K5_Length*k + K5_Length*K3_Report*Sub_Block] = 666;
						Index_A -=1;
					}
				}
				Loc_Temp = Loc_Path;
				cnt++;
			}       // While End
			if (update == 1)
			{
				Length_Center_Seq = cnt;
				for (int i=0; i<Length_Center_Seq; i++)
				{
					Center_Seq [i] = Center_Rev [Length_Center_Seq-i-1];
		//			Kernel_5_output2[i+ K5_Length*k + K5_Length*K3_Report*Sub_Block]=Center_Rev [i];
				}
			}
		} // End K (Report)
		//  Bring Center Sequence to the first of array
		for (int i=0; i<K5_Length; i++)
		{
			int Tmp = Kernel_5_output[i + K5_Length*0          + K5_Length*K3_Report*Sub_Block]; 
					  Kernel_5_output[i + K5_Length*0          + K5_Length*K3_Report*Sub_Block] = Center_Rev [i]; 
			          Kernel_5_output[i + K5_Length*Center_Loc + K5_Length*K3_Report*Sub_Block] = Tmp;
		}
	}

	for (int Sub_Thread=0; Sub_Thread<(K3_Report*K3_Report*K5R); Sub_Thread++)
		Kernel_4_output [Sub_Thread] = Kernel_5_Temp[Sub_Thread];
}
	.file	"tmpxft_00254f24_00000000-6_Kernel_5_CPU.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3638:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3638:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z12Kernel_5_CPUPiS_S_S_iiiiiiii
	.type	_Z12Kernel_5_CPUPiS_S_S_iiiiiiii, @function
_Z12Kernel_5_CPUPiS_S_S_iiiiiiii:
.LFB3635:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%r9d, %rax
	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
	movabsq	$2305843009213693950, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movq	%rdi, 72(%rsp)
	movl	320(%rsp), %r13d
	movq	%rsi, 24(%rsp)
	movq	%rdx, 184(%rsp)
	movq	%rcx, 192(%rsp)
	movl	%r8d, 116(%rsp)
	cmpq	%rax, %rbp
	jb	.L3
	movq	%rax, %r14
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	_Znam@PLT
	movq	%rax, 144(%rsp)
	movslq	%r13d, %rax
	cmpq	%rax, %rbp
	jnb	.L4
.L3:
	call	__cxa_throw_bad_array_new_length@PLT
.L4:
	salq	$2, %rax
	movq	%rax, %rdi
	movq	%rax, 32(%rsp)
	call	_Znam@PLT
	movq	32(%rsp), %rdi
	movq	%rax, 40(%rsp)
	call	_Znam@PLT
	movq	32(%rsp), %rdi
	movq	%rax, 16(%rsp)
	call	_Znam@PLT
	movq	%rax, 152(%rsp)
	leal	1(%r13), %eax
	movl	%eax, %ebx
	movl	%eax, 80(%rsp)
	imull	%eax, %ebx
	movslq	%ebx, %rbx
	salq	$2, %rbx
	movq	%rbx, %rdi
	call	_Znam@PLT
	movq	%rbx, %rdi
	movl	%r14d, %ebx
	movq	%rax, 48(%rsp)
	imull	%r14d, %ebx
	call	_Znam@PLT
	movq	%rax, 56(%rsp)
	movl	312(%rsp), %eax
	imull	%ebx, %eax
	movslq	%eax, %rdi
	movl	%eax, 136(%rsp)
	cmpq	%rdi, %rbp
	jb	.L3
	salq	$2, %rdi
	movslq	%ebx, %r12
	xorl	%ebp, %ebp
	call	_Znam@PLT
	movq	8(%rsp), %rsi
	movl	%ebp, 112(%rsp)
	xorl	%edi, %edi
	movq	%rax, 64(%rsp)
	leaq	0(,%r12,4), %rax
	xorl	%r8d, %r8d
	movq	%rax, 128(%rsp)
	movq	64(%rsp), %rax
	addq	%rsi, %rax
	movq	%rax, 88(%rsp)
	movq	%rsi, %rax
	addq	$4, %rax
	movq	%rax, 104(%rsp)
	leal	-1(%r14), %eax
	movl	%eax, 140(%rsp)
.L5:
	movl	112(%rsp), %eax
	cmpl	312(%rsp), %eax
	jge	.L61
	movq	88(%rsp), %r9
	movl	%edi, %edx
	xorl	%r10d, %r10d
	xorl	%eax, %eax
.L6:
	movl	%eax, 120(%rsp)
	cmpl	%eax, %r14d
	jle	.L62
	movq	64(%rsp), %rbp
	movslq	%r10d, %rcx
	incq	%rax
	movslq	%edx, %r11
	addq	%r8, %rcx
	leaq	0(%rbp,%rcx,4), %rcx
	movq	%r9, %rbp
	movq	%rcx, 96(%rsp)
	movq	%rax, %rcx
.L7:
	cmpl	%ecx, %r14d
	jle	.L63
	movq	184(%rsp), %r15
	movl	(%r15,%r11,4), %esi
	movq	96(%rsp), %r15
	incq	%r11
	movl	%esi, (%r15,%rcx,4)
	incq	%rcx
	movl	%esi, 0(%rbp)
	movq	8(%rsp), %rsi
	addq	%rsi, %rbp
	jmp	.L7
.L63:
	movl	140(%rsp), %esi
	addl	%r14d, %r10d
	addl	%esi, %edx
	movl	120(%rsp), %esi
	subl	%esi, %edx
	movq	104(%rsp), %rsi
	addq	%rsi, %r9
	jmp	.L6
.L62:
	movq	128(%rsp), %rsi
	incl	112(%rsp)
	addl	%ebx, %edi
	addq	%r12, %r8
	addq	%rsi, 88(%rsp)
	jmp	.L5
.L61:
	movl	%r13d, %eax
	xorl	%ebx, %ebx
	imull	%r14d, %eax
	movl	%ebx, 208(%rsp)
	movl	%ebx, 104(%rsp)
	movl	%ebx, 172(%rsp)
	movl	%eax, 140(%rsp)
	movl	116(%rsp), %eax
	imull	304(%rsp), %eax
	movl	%ebx, 96(%rsp)
	movl	%ebx, 88(%rsp)
	movl	%ebx, 128(%rsp)
	movl	%eax, 168(%rsp)
	imull	%r14d, %eax
	movl	%eax, 232(%rsp)
	movq	192(%rsp), %rax
	movq	%rax, 176(%rsp)
	movq	32(%rsp), %rax
	addq	$4, %rax
	movq	%rax, 216(%rsp)
	leal	2(%r13), %eax
	movl	%eax, 236(%rsp)
.L11:
	movl	128(%rsp), %eax
	cmpl	312(%rsp), %eax
	jge	.L52
	movl	208(%rsp), %eax
	movq	64(%rsp), %rsi
	imull	%r14d, %eax
	cltq
	leaq	(%rsi,%rax,4), %rcx
	xorl	%eax, %eax
.L47:
	cmpl	%eax, %r14d
	jle	.L64
	xorl	%edx, %edx
	xorl	%esi, %esi
.L12:
	addl	(%rcx,%rdx,4), %esi
	incq	%rdx
	cmpl	%edx, %r14d
	jg	.L12
	movq	144(%rsp), %rbx
	movl	%esi, (%rbx,%rax,4)
	movq	8(%rsp), %rbx
	incq	%rax
	addq	%rbx, %rcx
	jmp	.L47
.L64:
	xorl	%eax, %eax
	movl	$10000, %edx
.L13:
	cmpl	%eax, %r14d
	jle	.L65
	movq	144(%rsp), %rdi
	movl	(%rdi,%rax,4), %ecx
	cmpl	%edx, %ecx
	jge	.L14
	movl	%eax, 84(%rsp)
	movl	%ecx, %edx
.L14:
	incq	%rax
	jmp	.L13
.L65:
	movl	116(%rsp), %ebx
	movl	84(%rsp), %eax
	xorl	%edx, %edx
	movslq	96(%rsp), %rcx
	imull	%ebx, %eax
	movq	72(%rsp), %rbx
	imull	304(%rsp), %eax
	cltq
	addq	%rcx, %rax
	leaq	(%rbx,%rax,4), %rax
.L16:
	cmpl	%edx, 116(%rsp)
	jle	.L66
	movl	(%rax,%rdx,4), %ecx
	movq	40(%rsp), %rdi
	xorl	%r11d, %r11d
	movl	%ecx, (%rdi,%rdx,4)
	movq	16(%rsp), %rdi
	movl	%r11d, (%rdi,%rdx,4)
	incq	%rdx
	jmp	.L16
.L66:
	movq	56(%rsp), %rax
	movl	80(%rsp), %esi
	xorl	%r10d, %r10d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	%r10d, (%rax)
	negl	%esi
	xorl	%eax, %eax
.L19:
	movq	48(%rsp), %rdi
	movl	%ecx, (%rdi,%rax,4)
	movl	%ecx, (%rdi,%rdx)
	testq	%rax, %rax
	je	.L18
	movq	56(%rsp), %rbx
	leal	-1(%rax), %edi
	movl	%edi, (%rbx,%rax,4)
	movl	%esi, (%rbx,%rdx)
.L18:
	movl	80(%rsp), %edi
	movq	216(%rsp), %rbx
	incq	%rax
	addl	344(%rsp), %ecx
	addl	%edi, %esi
	addq	%rbx, %rdx
	cmpl	%eax, %r13d
	jge	.L19
	movl	84(%rsp), %esi
	movl	172(%rsp), %eax
	xorl	%r9d, %r9d
	movl	%r9d, 164(%rsp)
	addl	%esi, %eax
	movq	192(%rsp), %rsi
	movl	%r9d, 160(%rsp)
	cltq
	movl	(%rsi,%rax,4), %edi
	movl	96(%rsp), %eax
	xorl	%esi, %esi
	movl	%eax, 112(%rsp)
	movslq	104(%rsp), %rax
	movq	%rax, 200(%rsp)
	salq	$2, %rax
	movq	%rax, 224(%rsp)
.L20:
	movl	%esi, 212(%rsp)
	cmpl	%esi, %r14d
	jle	.L67
	movq	176(%rsp), %rax
	xorl	%edx, %edx
	xorl	%r10d, %r10d
	movl	(%rax,%rsi,4), %ebx
.L21:
	cmpl	%ebx, %r10d
	jge	.L28
	movl	80(%rsp), %eax
	movq	72(%rsp), %rcx
	xorl	%r8d, %r8d
	leal	(%rdx,%rax), %ebp
	movl	112(%rsp), %eax
	addl	%r10d, %eax
	cltq
	leaq	(%rcx,%rax,4), %rax
	movq	48(%rsp), %rcx
	movq	%rax, 120(%rsp)
	movslq	%edx, %rax
	leaq	(%rcx,%rax,4), %r9
	movslq	%ebp, %rax
	salq	$2, %rax
.L29:
	cmpl	%r8d, %edi
	jle	.L68
	movl	(%r9), %ecx
	movl	336(%rsp), %r12d
	movq	120(%rsp), %r15
	movq	40(%rsp), %r11
	addl	%ecx, %r12d
	movl	(%r15), %r15d
	cmpl	%r15d, (%r11,%r8,4)
	jne	.L23
	addl	328(%rsp), %ecx
	movl	%ecx, %r12d
.L23:
	movq	48(%rsp), %r15
	movl	344(%rsp), %ecx
	movl	344(%rsp), %r11d
	addl	4(%r9), %r11d
	addl	(%r15,%rax), %ecx
	movl	%r11d, %r15d
	leal	0(%rbp,%r8), %r11d
	cmpl	$999, %ecx
	jle	.L24
	xorl	%r11d, %r11d
	movl	$1000, %ecx
.L24:
	cmpl	%ecx, %r15d
	jge	.L25
	leal	1(%rdx), %r11d
	movl	%r15d, %ecx
.L25:
	cmpl	%ecx, %r12d
	jge	.L26
	movl	%edx, %r11d
	movl	%r12d, %ecx
.L26:
	movq	48(%rsp), %r15
	incq	%r8
	incl	%edx
	addq	$4, %r9
	movl	%ecx, 4(%r15,%rax)
	movq	56(%rsp), %rcx
	movl	%r11d, 4(%rcx,%rax)
	addq	$4, %rax
	jmp	.L29
.L68:
	incl	%r10d
	movl	%ebp, %edx
	jmp	.L21
.L28:
	movl	80(%rsp), %r8d
	movl	112(%rsp), %eax
	leal	-1(%rdi), %edx
	xorl	%r10d, %r10d
	imull	%ebx, %r8d
	leal	-1(%rbx,%rax), %ecx
	movl	160(%rsp), %eax
	movl	88(%rsp), %ebx
	leal	(%rax,%rbx), %r9d
	xorl	%eax, %eax
	addl	%edi, %r8d
.L30:
	testl	%r8d, %r8d
	je	.L69
	movq	56(%rsp), %rbx
	movslq	%r8d, %r11
	movl	(%rbx,%r11,4), %ebp
	subl	%ebp, %r8d
	cmpl	%r8d, 236(%rsp)
	jne	.L31
	movq	40(%rsp), %rbx
	movslq	%edx, %r8
	movl	(%rbx,%r8,4), %r8d
	movq	16(%rsp), %rbx
	movl	%r8d, (%rbx,%rax,4)
	movq	72(%rsp), %rbx
	movslq	%ecx, %r8
	decl	%ecx
	movl	(%rbx,%r8,4), %r11d
	movq	24(%rsp), %rbx
	movslq	%r9d, %r8
	movl	%r11d, (%rbx,%r8,4)
	jmp	.L59
.L31:
	cmpl	%r8d, 80(%rsp)
	jne	.L33
	movq	16(%rsp), %rbx
	movslq	%ecx, %r8
	movl	104(%rsp), %r15d
	decl	%ecx
	movl	$666, (%rbx,%rax,4)
	movq	72(%rsp), %rbx
	movl	(%rbx,%r8,4), %r10d
	movl	164(%rsp), %ebx
	leal	(%rbx,%r15), %r8d
	movq	24(%rsp), %rbx
	addl	%eax, %r8d
	movslq	%r8d, %r8
	movl	%r10d, (%rbx,%r8,4)
	xorl	%r8d, %r8d
	movq	224(%rsp), %r10
	movl	%r8d, 120(%rsp)
	addq	%rbx, %r10
	xorl	%ebx, %ebx
.L34:
	movl	212(%rsp), %r15d
	cmpl	%r15d, %ebx
	je	.L51
	movslq	120(%rsp), %r8
	movq	200(%rsp), %r11
	movq	24(%rsp), %r15
	addq	%r11, %r8
	leaq	(%r15,%r8,4), %r12
	movq	%rax, %r8
.L38:
	cmpl	%r8d, %r13d
	jle	.L70
	movl	(%r12,%r8,4), %r11d
	movq	152(%rsp), %r15
	movl	%r11d, (%r15,%r8,4)
	incq	%r8
	jmp	.L38
.L70:
	movl	$666, (%r10,%rax,4)
	leaq	1(%rax), %r8
.L36:
	cmpl	%r8d, %r13d
	jle	.L71
	movq	152(%rsp), %r11
	movl	-4(%r11,%r8,4), %r12d
	movl	%r12d, (%r10,%r8,4)
	incq	%r8
	jmp	.L36
.L71:
	movq	32(%rsp), %r11
	addl	%r13d, 120(%rsp)
	incl	%ebx
	addq	%r11, %r10
	jmp	.L34
.L33:
	movq	40(%rsp), %rbx
	movslq	%edx, %r8
	movl	(%rbx,%r8,4), %r8d
	movq	16(%rsp), %rbx
	movl	%r8d, (%rbx,%rax,4)
	movq	24(%rsp), %rbx
	movslq	%r9d, %r8
	movl	$666, (%rbx,%r8,4)
.L59:
	decl	%edx
	jmp	.L32
.L51:
	movl	$1, %r10d
.L32:
	incq	%rax
	incl	%r9d
	movl	%ebp, %r8d
	jmp	.L30
.L69:
	decl	%r10d
	jne	.L40
	movq	16(%rsp), %rdx
	movl	%eax, %edi
	cltq
	leaq	(%rdx,%rax,4), %rdx
	xorl	%eax, %eax
.L41:
	subq	$4, %rdx
	cmpl	%eax, %edi
	jle	.L40
	movl	(%rdx), %ecx
	movq	40(%rsp), %rbx
	movl	%ecx, (%rbx,%rax,4)
	incq	%rax
	jmp	.L41
.L40:
	movl	168(%rsp), %edx
	addl	%r13d, 160(%rsp)
	incq	%rsi
	addl	%edx, 112(%rsp)
	addl	%r13d, 164(%rsp)
	jmp	.L20
.L67:
	movl	84(%rsp), %ecx
	movslq	88(%rsp), %rax
	xorl	%edx, %edx
	movq	24(%rsp), %rsi
	imull	%r13d, %ecx
	leaq	(%rsi,%rax,4), %rax
	movslq	%ecx, %rcx
.L44:
	cmpl	%edx, %r13d
	jle	.L72
	movq	16(%rsp), %rdi
	movl	(%rax), %esi
	movl	(%rdi,%rdx,4), %edi
	incq	%rdx
	movl	%edi, (%rax)
	movl	%esi, (%rax,%rcx,4)
	addq	$4, %rax
	jmp	.L44
.L72:
	movl	140(%rsp), %esi
	movl	232(%rsp), %edi
	incl	128(%rsp)
	addl	%edi, 96(%rsp)
	movq	8(%rsp), %rdi
	addl	%esi, 88(%rsp)
	addl	%r14d, 172(%rsp)
	addl	%esi, 104(%rsp)
	addq	%rdi, 176(%rsp)
	addl	%r14d, 208(%rsp)
	jmp	.L11
.L52:
	xorl	%eax, %eax
.L46:
	cmpl	%eax, 136(%rsp)
	jle	.L73
	movq	64(%rsp), %rdi
	movq	184(%rsp), %rsi
	movl	(%rdi,%rax,4), %edx
	movl	%edx, (%rsi,%rax,4)
	incq	%rax
	jmp	.L46
.L73:
	addq	$248, %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
.LFE3635:
	.size	_Z12Kernel_5_CPUPiS_S_S_iiiiiiii, .-_Z12Kernel_5_CPUPiS_S_S_iiiiiiii
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3661:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3661:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

///////	/////////////////////////////////////////////////////////////////////
// Calculate scalar products of VectorN vectors of ElementN elements on CPU.
// Straight accumulation in double precision.
////////////////////////////////////////////////////////////////////////////
 
#include <hip/hip_runtime.h>
#include <iostream>
#include <cmath>
using namespace std;


void Kernel_5_CPU (int* B, int* Kernel_5_output, int* Kernel_4_output, int* Length_Seq_K4, 
				   int K3_Length, int K3_Report, int K3_Safety, int K5R,
				   int K5_Length, int K4_S1, int K4_S2,int K4_S3)
{
	int *Sum, *Center_Seq, *Center_Rev, *Kernel_5_out_shared, *D, *L, *Kernel_5_Temp;
	int Center_Loc;
	
	Sum                  = new int [K3_Report];
    Center_Seq		     = new int [K5_Length];
	Center_Rev		     = new int [K5_Length];
	Kernel_5_out_shared  = new int [K5_Length];
	D    			     = new int [(K5_Length+1)*(K5_Length+1)];
	L    			     = new int [(K5_Length+1)*(K5_Length+1)];
	Kernel_5_Temp        = new int [K3_Report*K3_Report*K5R];



	for (int Sub_Thread=0; Sub_Thread<K5R; Sub_Thread++)
	{
		int counter = Sub_Thread*K3_Report*K3_Report;
		int Loc = counter;
		for (int i=0; i<K3_Report; i++)
		{
			for (int j=i+1; j<K3_Report; j++)
			{
				Kernel_5_Temp [i*K3_Report + j + Loc] = Kernel_4_output[counter];
				Kernel_5_Temp [j*K3_Report + i + Loc] = Kernel_4_output[counter];
				counter++;
			}
		}
	}

	// ---------------------------- finding summation of each row of matrix (minimum is a Center) --------------------------------
	for(int Sub_Block =0; Sub_Block < K5R; Sub_Block ++)
	{
		for (int Sub_Thread=0; Sub_Thread<K3_Report; Sub_Thread++)
		{
			int iStart = Sub_Thread * K3_Report + Sub_Block * K3_Report * K3_Report;
			Sum[Sub_Thread] = 0;
			for (int j=0; j<K3_Report; j++)
			{
				Sum[Sub_Thread] = Sum[Sub_Thread] + Kernel_5_Temp [j + iStart] ;
			}
		}
		int Minimum_Sum = 10000;
		for (int i=0; i<K3_Report; i++)
		{
			if (Sum[i]<Minimum_Sum)
			{
				Minimum_Sum   = Sum[i];
				Center_Loc = i;
			}
		}
//printf("---------  %i      %i   \n", Minimum_Sum,Center_Loc);
		//--------------------------------------------- Extract Center Sequence ----------------------------------
		for (int i=0; i<K3_Length; i++)          
		{
			Center_Seq [i]= B[i + Center_Loc * K3_Length * K3_Safety + Sub_Block * K3_Length * K3_Safety * K3_Report];
			Center_Rev[i]=0;
//			printf("---------  %i      %i   \n", i,Center_Seq [i]);
//			Kernel_5_Temp[i+K5_Length*K3_Report*Sub_Block]=Center_Seq [i];
		}
		//--------------------------------------------- Initialize D & L arrays ----------------------------------
		L[0]=0;
		for (int i=0; i<K5_Length+1; i++)
		{
			D[i] = i * K4_S3;
			D[i*(K5_Length+1)] = i * K4_S3;
			if (i>0)
				{
					L[i]           = i - 1;
					L[i*(K5_Length+1)] = (i-1)*(K5_Length+1);
				}
		}
		//--------------------------------------------- Start Multiple Alignment  ----------------------------------
		int Length_Center_Seq = Length_Seq_K4[Center_Loc + Sub_Block * K3_Report];
		int Temp[6];
		for (int k=0; k<K3_Report; k++)
		{
			int B_Loc = k * K3_Safety * K3_Length + Sub_Block * K3_Safety * K3_Length * K3_Report;
			int End_A = Length_Center_Seq;
			int End_B = Length_Seq_K4[k + Sub_Block * K3_Report];

			for (int i = 0; i<End_B; i++ )
			{
				for (int j = 0; j<End_A; j++) 
				{
					int D_Sim;
					int Num  =  i   *(K5_Length+1) + j ;
					int Num1 = (i+1)*(K5_Length+1) + j ;

					// First E then F then Similarity 	
					if (Center_Seq [j]==B[B_Loc + i])
						D_Sim = D[Num]+K4_S1;
					else
						D_Sim=D[Num]+K4_S2;
					
					Temp[4]= D_Sim;
					Temp[5]= Num;
					
					Temp[0] = D[Num1]  + K4_S3; 
					Temp[1] = Num1;

					Temp[2] = D[Num+1] + K4_S3;
					Temp[3] = Num+1;
							
					int minD =1000;
					int minL = 0;
					for (int n=0; n<6; n=n+2)
					{
						if (Temp[n]<minD)
						{
							minD = Temp[n];
							minL = Temp[n+1];
						}
					}	
					D[Num1+1] = minD;             
					L[Num1+1] = minL;
				}
			}
			//------------------------------------------------ Trace Back -----------------------------------------------------------------------
			int Loc_Temp = (End_B)*(K5_Length+1) + End_A; 
			int Loc_Path = Loc_Temp;
			int Check = 0;

			int Index_A = Length_Center_Seq-1;
			int Index_B = B_Loc + End_B-1;
			int cnt = 0;
			int update = 0;

			while   (Loc_Path != Check) 
			{						   
				Loc_Path = L[Loc_Temp];
				int Dif = Loc_Temp - Loc_Path;
				if (Dif==(K5_Length+1+1))
				{
					Center_Rev [cnt] = Center_Seq [Index_A];
					Kernel_5_output[cnt + K5_Length*k + K5_Length*K3_Report*Sub_Block] = B[Index_B];
					
					Index_B -=1;
					Index_A -=1;
				}
				else
				{				
					if (Dif==(K5_Length+1))
					{
						Center_Rev [cnt] = 666;
						Kernel_5_output[cnt + K5_Length*k + K5_Length*K3_Report*Sub_Block] = B[Index_B];
						Index_B -=1;
						update=1;
						// update previous sequences
						for (int j=0; j<k; j++)
						{
							for (int i=cnt; i<K5_Length; i++)
							{
								Kernel_5_out_shared[i] = Kernel_5_output[i + K5_Length*j + K5_Length*K3_Report*Sub_Block]; 
							}
							Kernel_5_output[cnt + K5_Length*j + K5_Length*K3_Report*Sub_Block] = 666;
							for (int i=cnt+1; i<K5_Length; i++)
							{
								Kernel_5_output[i + K5_Length*j + K5_Length*K3_Report*Sub_Block]  = Kernel_5_out_shared[i-1] ;
							}
						}
					}
					else
					{
						Center_Rev [cnt] = Center_Seq [Index_A];
						Kernel_5_output[cnt + K5_Length*k + K5_Length*K3_Report*Sub_Block] = 666;
						Index_A -=1;
					}
				}
				Loc_Temp = Loc_Path;
				cnt++;
			}       // While End
			if (update == 1)
			{
				Length_Center_Seq = cnt;
				for (int i=0; i<Length_Center_Seq; i++)
				{
					Center_Seq [i] = Center_Rev [Length_Center_Seq-i-1];
		//			Kernel_5_output2[i+ K5_Length*k + K5_Length*K3_Report*Sub_Block]=Center_Rev [i];
				}
			}
		} // End K (Report)
		//  Bring Center Sequence to the first of array
		for (int i=0; i<K5_Length; i++)
		{
			int Tmp = Kernel_5_output[i + K5_Length*0          + K5_Length*K3_Report*Sub_Block]; 
					  Kernel_5_output[i + K5_Length*0          + K5_Length*K3_Report*Sub_Block] = Center_Rev [i]; 
			          Kernel_5_output[i + K5_Length*Center_Loc + K5_Length*K3_Report*Sub_Block] = Tmp;
		}
	}

	for (int Sub_Thread=0; Sub_Thread<(K3_Report*K3_Report*K5R); Sub_Thread++)
		Kernel_4_output [Sub_Thread] = Kernel_5_Temp[Sub_Thread];
}
	.text
	.file	"Kernel_5_CPU.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z12Kernel_5_CPUPiS_S_S_iiiiiiii # -- Begin function _Z12Kernel_5_CPUPiS_S_S_iiiiiiii
	.type	_Z12Kernel_5_CPUPiS_S_S_iiiiiiii,@function
_Z12Kernel_5_CPUPiS_S_S_iiiiiiii:       # @_Z12Kernel_5_CPUPiS_S_S_iiiiiiii
	.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	$424, %rsp                      # imm = 0x1A8
	.cfi_def_cfa_offset 480
	.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	%r9d, %ebp
	movl	%r8d, 108(%rsp)                 # 4-byte Spill
	movq	%rcx, 344(%rsp)                 # 8-byte Spill
	movq	%rdx, 232(%rsp)                 # 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, 40(%rsp)                  # 8-byte Spill
	movl	520(%rsp), %r14d
	movl	512(%rsp), %eax
	movl	%eax, 220(%rsp)                 # 4-byte Spill
	movl	504(%rsp), %eax
	movl	%eax, 216(%rsp)                 # 4-byte Spill
	movl	496(%rsp), %ebx
	movl	488(%rsp), %eax
	movl	%eax, 8(%rsp)                   # 4-byte Spill
	movl	480(%rsp), %eax
	movl	%eax, 16(%rsp)                  # 4-byte Spill
	movl	%r9d, %eax
	movq	%rax, 128(%rsp)                 # 8-byte Spill
	leaq	(,%rax,4), %rdi
	testl	%r9d, %r9d
	movq	$-1, %r15
	cmovsq	%r15, %rdi
	callq	_Znam
	movq	%rax, 392(%rsp)                 # 8-byte Spill
	movq	%rbx, %rax
	leaq	(,%rbx,4), %rbx
	testl	%eax, %eax
	movq	%rax, %r13
	movq	%rax, 144(%rsp)                 # 8-byte Spill
	cmovsq	%r15, %rbx
	movq	%rbx, %rdi
	callq	_Znam
	movq	%rax, 96(%rsp)                  # 8-byte Spill
	movq	%rbx, %rdi
	callq	_Znam
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movq	%rbx, %rdi
	callq	_Znam
	movq	%rax, %rbx
	leal	1(%r13), %eax
	movl	%eax, 20(%rsp)                  # 4-byte Spill
	movl	%eax, %r15d
	imull	%r15d, %r15d
	shlq	$2, %r15
	movq	%r15, %rdi
	callq	_Znam
	movq	%rax, %r13
	movq	%r15, %rdi
	movq	128(%rsp), %r15                 # 8-byte Reload
	callq	_Znam
	movq	%rax, 192(%rsp)                 # 8-byte Spill
	movq	%rbp, 72(%rsp)                  # 8-byte Spill
	movl	%ebp, %eax
	imull	%eax, %eax
	movq	%rax, 168(%rsp)                 # 8-byte Spill
	movl	%eax, %ecx
	movl	8(%rsp), %ebp                   # 4-byte Reload
	imull	%ebp, %ecx
	leaq	(,%rcx,4), %rax
	movq	%rcx, 312(%rsp)                 # 8-byte Spill
	testl	%ecx, %ecx
	movq	%rax, 304(%rsp)                 # 8-byte Spill
	movq	$-1, %rdi
	cmovnsq	%rax, %rdi
	callq	_Znam
	movl	%ebp, %r9d
	movq	24(%rsp), %rsi                  # 8-byte Reload
	testl	%ebp, %ebp
	jle	.LBB0_14
# %bb.1:                                # %.lr.ph393
	movq	%rax, 120(%rsp)                 # 8-byte Spill
	movq	72(%rsp), %rbp                  # 8-byte Reload
	leal	1(%rbp), %ecx
	leaq	-1(%r15), %rax
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	movl	$1, %eax
	movq	%rax, 56(%rsp)                  # 8-byte Spill
	movl	%ebp, %eax
	movl	%ebp, 80(%rsp)                  # 4-byte Spill
	movq	%rcx, 184(%rsp)                 # 8-byte Spill
	movq	120(%rsp), %r8                  # 8-byte Reload
.LBB0_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_4 Depth 2
                                        #       Child Loop BB0_6 Depth 3
	testl	%ebp, %ebp
	jle	.LBB0_9
# %bb.3:                                # %.lr.ph390.preheader
                                        #   in Loop: Header=BB0_2 Depth=1
	movq	168(%rsp), %rax                 # 8-byte Reload
	movl	%eax, %edx
	imull	88(%rsp), %edx                  # 4-byte Folded Reload
	xorl	%r9d, %r9d
	movq	48(%rsp), %r10                  # 8-byte Reload
	movq	56(%rsp), %r11                  # 8-byte Reload
	movl	80(%rsp), %r15d                 # 4-byte Reload
.LBB0_4:                                # %.lr.ph390
                                        #   Parent Loop BB0_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB0_6 Depth 3
	incl	%r9d
	cmpl	%ebp, %r9d
	jge	.LBB0_8
# %bb.5:                                # %.lr.ph
                                        #   in Loop: Header=BB0_4 Depth=2
	movl	%edx, 64(%rsp)                  # 4-byte Spill
	movslq	%edx, %rcx
	movq	232(%rsp), %rdx                 # 8-byte Reload
	movq	%rbp, %rax
	leaq	(%rdx,%rcx,4), %rbp
	xorl	%ecx, %ecx
	movl	%r15d, %esi
.LBB0_6:                                #   Parent Loop BB0_2 Depth=1
                                        #     Parent Loop BB0_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%rbp,%rcx,4), %edi
	leal	(%r11,%rcx), %edx
	movslq	%edx, %rdx
	movl	%edi, (%r8,%rdx,4)
	movslq	%esi, %rsi
	movl	%edi, (%r8,%rsi,4)
	addl	%eax, %esi
	incq	%rcx
	cmpq	%rcx, %r10
	jne	.LBB0_6
# %bb.7:                                # %.loopexit385.loopexit
                                        #   in Loop: Header=BB0_4 Depth=2
	movl	64(%rsp), %edx                  # 4-byte Reload
	addl	%ecx, %edx
	movq	%rax, %rbp
	movq	24(%rsp), %rsi                  # 8-byte Reload
	movq	184(%rsp), %rcx                 # 8-byte Reload
.LBB0_8:                                # %.loopexit385
                                        #   in Loop: Header=BB0_4 Depth=2
	addl	%ecx, %r15d
	addq	%rcx, %r11
	decq	%r10
	cmpl	%ebp, %r9d
	jne	.LBB0_4
.LBB0_9:                                # %._crit_edge
                                        #   in Loop: Header=BB0_2 Depth=1
	movq	88(%rsp), %rdx                  # 8-byte Reload
	incl	%edx
	movq	168(%rsp), %rax                 # 8-byte Reload
	addl	%eax, 80(%rsp)                  # 4-byte Folded Spill
	addq	%rax, 56(%rsp)                  # 8-byte Folded Spill
	movl	8(%rsp), %r9d                   # 4-byte Reload
	movq	%rdx, 88(%rsp)                  # 8-byte Spill
	cmpl	%r9d, %edx
	jne	.LBB0_2
# %bb.10:                               # %.preheader384
	testl	%r9d, %r9d
	movq	144(%rsp), %r11                 # 8-byte Reload
	movq	128(%rsp), %r15                 # 8-byte Reload
	movq	96(%rsp), %r10                  # 8-byte Reload
	movq	120(%rsp), %rax                 # 8-byte Reload
	jle	.LBB0_14
# %bb.11:                               # %.preheader383.lr.ph
	movq	%rbp, %rdi
	movl	108(%rsp), %ecx                 # 4-byte Reload
	movl	16(%rsp), %edx                  # 4-byte Reload
	imull	%ecx, %edx
	movl	%edx, 16(%rsp)                  # 4-byte Spill
	leal	2(%r11), %eax
	movl	%eax, 212(%rsp)                 # 4-byte Spill
	movl	%r11d, %eax
	imull	%edi, %eax
	movl	%ecx, %ecx
	movq	%rcx, 336(%rsp)                 # 8-byte Spill
	leaq	(,%rcx,4), %rcx
	movq	%rcx, 328(%rsp)                 # 8-byte Spill
	movl	20(%rsp), %ecx                  # 4-byte Reload
	movslq	%ecx, %rdx
	movq	%rdx, 248(%rsp)                 # 8-byte Spill
	movslq	%r11d, %rdx
	movslq	%edi, %r8
	movq	%r8, 320(%rsp)                  # 8-byte Spill
	movq	%rax, 224(%rsp)                 # 8-byte Spill
	cltq
	movl	%r9d, %r8d
	movq	%r8, 352(%rsp)                  # 8-byte Spill
	movl	%ecx, %ecx
	movq	%rcx, 384(%rsp)                 # 8-byte Spill
	movq	%rdx, 184(%rsp)                 # 8-byte Spill
	leaq	-1(%rdx), %rcx
	movq	%rcx, 88(%rsp)                  # 8-byte Spill
	movl	%r11d, %ecx
	notl	%ecx
	movl	%ecx, 200(%rsp)                 # 4-byte Spill
	leal	-1(%r11), %ebp
	addq	$-4, %rsi
	movq	%rsi, 376(%rsp)                 # 8-byte Spill
	shlq	$2, %rax
	movq	%rax, 360(%rsp)                 # 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, 176(%rsp)                 # 8-byte Spill
	movl	$1, 112(%rsp)                   # 4-byte Folded Spill
	movq	%r12, %r8
	xorl	%eax, %eax
	movq	%rax, 160(%rsp)                 # 8-byte Spill
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	movq	%rax, 152(%rsp)                 # 8-byte Spill
                                        # implicit-def: $r9d
.LBB0_12:                               # %.preheader383
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_36 Depth 2
                                        #       Child Loop BB0_37 Depth 3
                                        #     Child Loop BB0_40 Depth 2
                                        #     Child Loop BB0_20 Depth 2
                                        #     Child Loop BB0_23 Depth 2
                                        #     Child Loop BB0_28 Depth 2
                                        #       Child Loop BB0_30 Depth 3
                                        #         Child Loop BB0_46 Depth 4
                                        #           Child Loop BB0_47 Depth 5
                                        #       Child Loop BB0_53 Depth 3
                                        #         Child Loop BB0_59 Depth 4
                                        #           Child Loop BB0_61 Depth 5
                                        #           Child Loop BB0_65 Depth 5
                                        #       Child Loop BB0_72 Depth 3
                                        #     Child Loop BB0_43 Depth 2
	movq	%r9, 32(%rsp)                   # 8-byte Spill
	movq	%r8, 368(%rsp)                  # 8-byte Spill
	testl	%edi, %edi
	movl	%ecx, 204(%rsp)                 # 4-byte Spill
	jle	.LBB0_13
# %bb.35:                               # %.lr.ph399
                                        #   in Loop: Header=BB0_12 Depth=1
	movl	%ecx, %eax
	xorl	%ecx, %ecx
	movq	40(%rsp), %r9                   # 8-byte Reload
.LBB0_36:                               # %.lr.ph396
                                        #   Parent Loop BB0_12 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB0_37 Depth 3
	movslq	%eax, %rdx
	movq	120(%rsp), %rsi                 # 8-byte Reload
	leaq	(%rsi,%rdx,4), %rdx
	xorl	%esi, %esi
	xorl	%edi, %edi
.LBB0_37:                               #   Parent Loop BB0_12 Depth=1
                                        #     Parent Loop BB0_36 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	addl	(%rdx,%rsi,4), %edi
	incq	%rsi
	cmpq	%rsi, %r15
	jne	.LBB0_37
# %bb.38:                               # %._crit_edge397
                                        #   in Loop: Header=BB0_36 Depth=2
	movq	392(%rsp), %rsi                 # 8-byte Reload
	movl	%edi, (%rsi,%rcx,4)
	incq	%rcx
	addl	72(%rsp), %eax                  # 4-byte Folded Reload
	cmpq	%r15, %rcx
	jne	.LBB0_36
# %bb.16:                               # %.preheader382
                                        #   in Loop: Header=BB0_12 Depth=1
	cmpl	$0, 72(%rsp)                    # 4-byte Folded Reload
	jle	.LBB0_17
# %bb.39:                               # %.lr.ph403.preheader
                                        #   in Loop: Header=BB0_12 Depth=1
	movl	$10000, %eax                    # imm = 0x2710
	xorl	%ecx, %ecx
	movq	32(%rsp), %rdi                  # 8-byte Reload
.LBB0_40:                               # %.lr.ph403
                                        #   Parent Loop BB0_12 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%rsi,%rcx,4), %edx
	cmpl	%eax, %edx
	cmovll	%edx, %eax
	cmovll	%ecx, %edi
	incq	%rcx
	cmpq	%rcx, %r15
	jne	.LBB0_40
	jmp	.LBB0_18
.LBB0_13:                               #   in Loop: Header=BB0_12 Depth=1
	movq	40(%rsp), %r9                   # 8-byte Reload
.LBB0_17:                               #   in Loop: Header=BB0_12 Depth=1
	movq	32(%rsp), %rdi                  # 8-byte Reload
.LBB0_18:                               # %.preheader381
                                        #   in Loop: Header=BB0_12 Depth=1
	movq	%rdi, 32(%rsp)                  # 8-byte Spill
	cmpl	$0, 108(%rsp)                   # 4-byte Folded Reload
	jle	.LBB0_21
# %bb.19:                               # %.lr.ph406
                                        #   in Loop: Header=BB0_12 Depth=1
	movq	24(%rsp), %rdi                  # 8-byte Reload
	xorl	%esi, %esi
	movq	328(%rsp), %rdx                 # 8-byte Reload
	callq	memset@PLT
	movq	336(%rsp), %rsi                 # 8-byte Reload
	movq	96(%rsp), %r10                  # 8-byte Reload
	movq	144(%rsp), %r11                 # 8-byte Reload
	movq	40(%rsp), %r9                   # 8-byte Reload
	movq	160(%rsp), %rax                 # 8-byte Reload
	movq	32(%rsp), %rcx                  # 8-byte Reload
	addl	%ecx, %eax
	imull	16(%rsp), %eax                  # 4-byte Folded Reload
	xorl	%ecx, %ecx
.LBB0_20:                               #   Parent Loop BB0_12 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	leal	(%rax,%rcx), %edx
	movslq	%edx, %rdx
	movl	(%r9,%rdx,4), %edx
	movl	%edx, (%r10,%rcx,4)
	incq	%rcx
	cmpq	%rcx, %rsi
	jne	.LBB0_20
.LBB0_21:                               # %._crit_edge407
                                        #   in Loop: Header=BB0_12 Depth=1
	testl	%r11d, %r11d
	js	.LBB0_26
# %bb.22:                               # %.lr.ph411.preheader
                                        #   in Loop: Header=BB0_12 Depth=1
	xorl	%eax, %eax
	movl	200(%rsp), %ecx                 # 4-byte Reload
	xorl	%edx, %edx
	xorl	%esi, %esi
.LBB0_23:                               # %.lr.ph411
                                        #   Parent Loop BB0_12 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%edx, (%r13,%rsi,4)
	movl	%edx, (%r13,%rax,4)
	testq	%rsi, %rsi
	je	.LBB0_25
# %bb.24:                               #   in Loop: Header=BB0_23 Depth=2
	leal	-1(%rsi), %edi
	movq	192(%rsp), %r8                  # 8-byte Reload
	movl	%edi, (%r8,%rsi,4)
	movl	%ecx, (%r8,%rax,4)
.LBB0_25:                               #   in Loop: Header=BB0_23 Depth=2
	incq	%rsi
	addl	%r14d, %edx
	addq	248(%rsp), %rax                 # 8-byte Folded Reload
	addl	20(%rsp), %ecx                  # 4-byte Folded Reload
	cmpq	%rsi, 384(%rsp)                 # 8-byte Folded Reload
	jne	.LBB0_23
.LBB0_26:                               # %._crit_edge412
                                        #   in Loop: Header=BB0_12 Depth=1
	cmpl	$0, 72(%rsp)                    # 4-byte Folded Reload
	movq	24(%rsp), %rsi                  # 8-byte Reload
	jle	.LBB0_41
# %bb.27:                               # %.lr.ph448
                                        #   in Loop: Header=BB0_12 Depth=1
	movq	152(%rsp), %rdi                 # 8-byte Reload
	movq	%rdi, %rax
	imulq	320(%rsp), %rax                 # 8-byte Folded Reload
	movslq	32(%rsp), %rcx                  # 4-byte Folded Reload
	movq	344(%rsp), %rdx                 # 8-byte Reload
	leaq	(%rdx,%rax,4), %rax
	movq	%rax, 408(%rsp)                 # 8-byte Spill
	movl	(%rax,%rcx,4), %ecx
	movq	224(%rsp), %rax                 # 8-byte Reload
                                        # kill: def $eax killed $eax killed $rax def $rax
	imull	%edi, %eax
	movq	%rax, 240(%rsp)                 # 8-byte Spill
                                        # kill: def $edi killed $edi killed $rdi def $rdi
	imull	72(%rsp), %edi                  # 4-byte Folded Reload
	movq	%rdi, 400(%rsp)                 # 8-byte Spill
	xorl	%edi, %edi
.LBB0_28:                               #   Parent Loop BB0_12 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB0_30 Depth 3
                                        #         Child Loop BB0_46 Depth 4
                                        #           Child Loop BB0_47 Depth 5
                                        #       Child Loop BB0_53 Depth 3
                                        #         Child Loop BB0_59 Depth 4
                                        #           Child Loop BB0_61 Depth 5
                                        #           Child Loop BB0_65 Depth 5
                                        #       Child Loop BB0_72 Depth 3
	movq	400(%rsp), %rax                 # 8-byte Reload
	leal	(%rax,%rdi), %edx
	movl	16(%rsp), %eax                  # 4-byte Reload
                                        # kill: def $eax killed $eax def $rax
	movq	%rdx, 136(%rsp)                 # 8-byte Spill
	imull	%edx, %eax
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movq	408(%rsp), %rax                 # 8-byte Reload
	movq	%rdi, 64(%rsp)                  # 8-byte Spill
	movl	(%rax,%rdi,4), %edx
	testl	%edx, %edx
	movq	%rcx, 256(%rsp)                 # 8-byte Spill
	jle	.LBB0_33
# %bb.29:                               # %.preheader377.lr.ph
                                        #   in Loop: Header=BB0_28 Depth=2
	movslq	48(%rsp), %rax                  # 4-byte Folded Reload
	leaq	(%r9,%rax,4), %rax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movl	%ecx, %edi
	xorl	%eax, %eax
	movq	%rdx, 80(%rsp)                  # 8-byte Spill
.LBB0_30:                               # %.preheader377
                                        #   Parent Loop BB0_12 Depth=1
                                        #     Parent Loop BB0_28 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB0_46 Depth 4
                                        #           Child Loop BB0_47 Depth 5
	testl	%ecx, %ecx
	jle	.LBB0_31
# %bb.45:                               # %.lr.ph417
                                        #   in Loop: Header=BB0_30 Depth=3
	movq	%rax, %r9
	movq	248(%rsp), %rcx                 # 8-byte Reload
	imulq	%rcx, %r9
	leaq	1(%rax), %rsi
	movq	%rsi, 56(%rsp)                  # 8-byte Spill
	imulq	%rcx, %rsi
	movq	8(%rsp), %rcx                   # 8-byte Reload
	movl	(%rcx,%rax,4), %r10d
	xorl	%r11d, %r11d
.LBB0_46:                               #   Parent Loop BB0_12 Depth=1
                                        #     Parent Loop BB0_28 Depth=2
                                        #       Parent Loop BB0_30 Depth=3
                                        # =>      This Loop Header: Depth=4
                                        #           Child Loop BB0_47 Depth 5
	leaq	(%r11,%r9), %rax
	movq	96(%rsp), %rcx                  # 8-byte Reload
	cmpl	%r10d, (%rcx,%r11,4)
	leaq	(%r11,%rsi), %r15
	movl	220(%rsp), %ecx                 # 4-byte Reload
	cmovel	216(%rsp), %ecx                 # 4-byte Folded Reload
	addl	(%r13,%rax,4), %ecx
	movl	%ecx, 288(%rsp)
	movl	%eax, 292(%rsp)
	movl	(%r13,%r15,4), %ecx
	addl	%r14d, %ecx
	movl	%ecx, 272(%rsp)
	movl	%r15d, 276(%rsp)
	leaq	(%r11,%r9), %rcx
	incq	%rcx
	movl	4(%r13,%rax,4), %eax
	addl	%r14d, %eax
	movl	%eax, 280(%rsp)
	movl	%ecx, 284(%rsp)
	movl	$1000, %r8d                     # imm = 0x3E8
	xorl	%eax, %eax
	movq	$-2, %rcx
.LBB0_47:                               #   Parent Loop BB0_12 Depth=1
                                        #     Parent Loop BB0_28 Depth=2
                                        #       Parent Loop BB0_30 Depth=3
                                        #         Parent Loop BB0_46 Depth=4
                                        # =>        This Inner Loop Header: Depth=5
	movl	280(%rsp,%rcx,4), %edx
	cmpl	%r8d, %edx
	jge	.LBB0_49
# %bb.48:                               #   in Loop: Header=BB0_47 Depth=5
	movl	284(%rsp,%rcx,4), %eax
	movl	%edx, %r8d
.LBB0_49:                               #   in Loop: Header=BB0_47 Depth=5
	addq	$2, %rcx
	cmpq	$4, %rcx
	jb	.LBB0_47
# %bb.50:                               #   in Loop: Header=BB0_46 Depth=4
	movl	%r8d, 4(%r13,%r15,4)
	movq	192(%rsp), %rcx                 # 8-byte Reload
	movl	%eax, 4(%rcx,%r15,4)
	incq	%r11
	cmpq	%rdi, %r11
	jne	.LBB0_46
# %bb.51:                               #   in Loop: Header=BB0_30 Depth=3
	movq	56(%rsp), %r8                   # 8-byte Reload
	movq	%r8, %rax
	movq	144(%rsp), %r11                 # 8-byte Reload
	movq	128(%rsp), %r15                 # 8-byte Reload
	movq	96(%rsp), %r10                  # 8-byte Reload
	movq	24(%rsp), %rsi                  # 8-byte Reload
	movq	256(%rsp), %rcx                 # 8-byte Reload
	movq	80(%rsp), %rdx                  # 8-byte Reload
	jmp	.LBB0_32
.LBB0_31:                               # %.preheader377.._crit_edge418_crit_edge
                                        #   in Loop: Header=BB0_30 Depth=3
	incq	%rax
	movq	%rax, %r8
.LBB0_32:                               # %._crit_edge418
                                        #   in Loop: Header=BB0_30 Depth=3
	cmpq	%rdx, %r8
	jne	.LBB0_30
.LBB0_33:                               # %._crit_edge420
                                        #   in Loop: Header=BB0_28 Depth=2
	movq	%r10, %r9
	movl	%edx, %r10d
	imull	20(%rsp), %r10d                 # 4-byte Folded Reload
	addl	%ecx, %r10d
	je	.LBB0_34
# %bb.52:                               # %.lr.ph439
                                        #   in Loop: Header=BB0_28 Depth=2
	movq	48(%rsp), %rax                  # 8-byte Reload
	leal	(%rax,%rdx), %edi
	decl	%edi
	leal	-1(%rcx), %eax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movq	136(%rsp), %rax                 # 8-byte Reload
	imull	%r11d, %eax
	movq	%rax, 136(%rsp)                 # 8-byte Spill
	movq	64(%rsp), %rax                  # 8-byte Reload
                                        # kill: def $eax killed $eax killed $rax def $rax
	imull	%r11d, %eax
	addl	240(%rsp), %eax                 # 4-byte Folded Reload
	movq	%rax, 416(%rsp)                 # 8-byte Spill
	xorl	%eax, %eax
	movl	$1, %edx
	movl	112(%rsp), %ecx                 # 4-byte Reload
	movl	%ecx, 48(%rsp)                  # 4-byte Spill
	movq	%r11, %rcx
	movq	176(%rsp), %r8                  # 8-byte Reload
	movq	%r8, 264(%rsp)                  # 8-byte Spill
	movq	%rbx, %r15
	movl	$0, 116(%rsp)                   # 4-byte Folded Spill
.LBB0_53:                               #   Parent Loop BB0_12 Depth=1
                                        #     Parent Loop BB0_28 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB0_59 Depth 4
                                        #           Child Loop BB0_61 Depth 5
                                        #           Child Loop BB0_65 Depth 5
	movq	%rax, %r8
	movl	%edx, %eax
	movq	%rax, 56(%rsp)                  # 8-byte Spill
	movslq	%r10d, %rax
	movq	192(%rsp), %rdx                 # 8-byte Reload
	movl	(%rdx,%rax,4), %edx
	subl	%edx, %eax
	cmpl	212(%rsp), %eax                 # 4-byte Folded Reload
	movl	%edx, 80(%rsp)                  # 4-byte Spill
	jne	.LBB0_55
# %bb.54:                               #   in Loop: Header=BB0_53 Depth=3
	movq	8(%rsp), %r10                   # 8-byte Reload
	movslq	%r10d, %rax
	movl	(%r9,%rax,4), %eax
	movl	%eax, (%rsi,%r8,4)
	movslq	%edi, %rax
	movq	40(%rsp), %rdx                  # 8-byte Reload
	movl	(%rdx,%rax,4), %eax
	movq	136(%rsp), %rdx                 # 8-byte Reload
	addl	%r8d, %edx
	movslq	%edx, %rdx
	movl	%eax, (%r12,%rdx,4)
	decl	%edi
	decl	%r10d
	movq	%r10, 8(%rsp)                   # 8-byte Spill
	jmp	.LBB0_67
.LBB0_55:                               #   in Loop: Header=BB0_53 Depth=3
	cmpl	20(%rsp), %eax                  # 4-byte Folded Reload
	jne	.LBB0_66
# %bb.56:                               #   in Loop: Header=BB0_53 Depth=3
	movq	416(%rsp), %rax                 # 8-byte Reload
	addl	%r8d, %eax
	leal	-1(%rdi), %r10d
	movl	$666, (%rsi,%r8,4)              # imm = 0x29A
	movslq	%edi, %rdx
	movq	40(%rsp), %rdi                  # 8-byte Reload
	movl	(%rdi,%rdx,4), %edx
	cltq
	movl	%edx, (%r12,%rax,4)
	movl	$1, 116(%rsp)                   # 4-byte Folded Spill
	cmpq	$0, 64(%rsp)                    # 8-byte Folded Reload
	je	.LBB0_57
# %bb.58:                               # %.preheader376.lr.ph
                                        #   in Loop: Header=BB0_53 Depth=3
	movl	%r10d, 208(%rsp)                # 4-byte Spill
	movq	240(%rsp), %rax                 # 8-byte Reload
	leal	(%rax,%r8), %edi
	movl	48(%rsp), %edx                  # 4-byte Reload
	movq	264(%rsp), %rax                 # 8-byte Reload
	xorl	%esi, %esi
.LBB0_59:                               # %.preheader376
                                        #   Parent Loop BB0_12 Depth=1
                                        #     Parent Loop BB0_28 Depth=2
                                        #       Parent Loop BB0_53 Depth=3
                                        # =>      This Loop Header: Depth=4
                                        #           Child Loop BB0_61 Depth 5
                                        #           Child Loop BB0_65 Depth 5
	cmpq	184(%rsp), %r8                  # 8-byte Folded Reload
	jge	.LBB0_62
# %bb.60:                               # %.lr.ph422
                                        #   in Loop: Header=BB0_59 Depth=4
	xorl	%r9d, %r9d
.LBB0_61:                               #   Parent Loop BB0_12 Depth=1
                                        #     Parent Loop BB0_28 Depth=2
                                        #       Parent Loop BB0_53 Depth=3
                                        #         Parent Loop BB0_59 Depth=4
                                        # =>        This Inner Loop Header: Depth=5
	leal	(%rax,%r9), %r10d
	movslq	%r10d, %r10
	movl	(%r12,%r10,4), %r10d
	movl	%r10d, (%r15,%r9,4)
	incq	%r9
	cmpq	%r9, %rcx
	jne	.LBB0_61
.LBB0_62:                               # %._crit_edge423
                                        #   in Loop: Header=BB0_59 Depth=4
	movl	%esi, %r9d
	imull	%r11d, %r9d
	addl	%edi, %r9d
	movslq	%r9d, %r9
	movl	$666, (%r12,%r9,4)              # imm = 0x29A
	movl	%edx, %r9d
	movq	%r8, %r10
	cmpq	88(%rsp), %r8                   # 8-byte Folded Reload
	jge	.LBB0_63
.LBB0_65:                               #   Parent Loop BB0_12 Depth=1
                                        #     Parent Loop BB0_28 Depth=2
                                        #       Parent Loop BB0_53 Depth=3
                                        #         Parent Loop BB0_59 Depth=4
                                        # =>        This Inner Loop Header: Depth=5
	movl	%r10d, %r11d
	movl	(%rbx,%r11,4), %r11d
	movslq	%r9d, %r9
	movl	%r11d, (%r12,%r9,4)
	incq	%r10
	incl	%r9d
	cmpl	%r10d, %ebp
	jne	.LBB0_65
.LBB0_63:                               # %._crit_edge429
                                        #   in Loop: Header=BB0_59 Depth=4
	incq	%rsi
	movq	144(%rsp), %r11                 # 8-byte Reload
	addq	%r11, %rax
	addl	%r11d, %edx
	cmpq	64(%rsp), %rsi                  # 8-byte Folded Reload
	jne	.LBB0_59
# %bb.64:                               #   in Loop: Header=BB0_53 Depth=3
	movl	208(%rsp), %eax                 # 4-byte Reload
	movl	%eax, %edi
	movq	96(%rsp), %r9                   # 8-byte Reload
	movq	24(%rsp), %rsi                  # 8-byte Reload
	jmp	.LBB0_67
.LBB0_66:                               #   in Loop: Header=BB0_53 Depth=3
	movq	%r9, %rax
	movq	8(%rsp), %rdx                   # 8-byte Reload
	movslq	%edx, %rdx
	movl	(%r9,%rdx,4), %eax
	movl	%eax, (%rsi,%r8,4)
	movq	136(%rsp), %rax                 # 8-byte Reload
	addl	%r8d, %eax
	cltq
	movl	$666, (%r12,%rax,4)             # imm = 0x29A
	decl	%edx
	movq	%rdx, 8(%rsp)                   # 8-byte Spill
	jmp	.LBB0_67
.LBB0_57:                               #   in Loop: Header=BB0_53 Depth=3
	movl	%r10d, %edi
.LBB0_67:                               # %.loopexit
                                        #   in Loop: Header=BB0_53 Depth=3
	leaq	1(%r8), %rax
	addq	$4, %r15
	incq	264(%rsp)                       # 8-byte Folded Spill
	decq	%rcx
	incl	48(%rsp)                        # 4-byte Folded Spill
	movq	56(%rsp), %rdx                  # 8-byte Reload
	incl	%edx
	movl	80(%rsp), %r10d                 # 4-byte Reload
	testl	%r10d, %r10d
	jne	.LBB0_53
# %bb.68:                               # %._crit_edge440
                                        #   in Loop: Header=BB0_28 Depth=2
	cmpl	$1, 116(%rsp)                   # 4-byte Folded Reload
	movq	128(%rsp), %r15                 # 8-byte Reload
	movq	64(%rsp), %rdi                  # 8-byte Reload
	movq	256(%rsp), %rcx                 # 8-byte Reload
	movq	%r9, %r10
	movq	40(%rsp), %r9                   # 8-byte Reload
	jne	.LBB0_74
# %bb.69:                               # %.preheader378
                                        #   in Loop: Header=BB0_28 Depth=2
	testl	%eax, %eax
	je	.LBB0_70
# %bb.71:                               # %.lr.ph444.preheader
                                        #   in Loop: Header=BB0_28 Depth=2
	movslq	56(%rsp), %rcx                  # 4-byte Folded Reload
	movq	376(%rsp), %rdx                 # 8-byte Reload
	leaq	(%rdx,%rcx,4), %rcx
	movq	$-1, %rdx
.LBB0_72:                               # %.lr.ph444
                                        #   Parent Loop BB0_12 Depth=1
                                        #     Parent Loop BB0_28 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%rcx), %esi
	movl	%esi, 4(%r10,%rdx,4)
	addq	$-4, %rcx
	incq	%rdx
	cmpq	%rdx, %r8
	jne	.LBB0_72
# %bb.73:                               #   in Loop: Header=BB0_28 Depth=2
	movl	%eax, %ecx
	movq	24(%rsp), %rsi                  # 8-byte Reload
	jmp	.LBB0_74
.LBB0_34:                               #   in Loop: Header=BB0_28 Depth=2
	movq	64(%rsp), %rdi                  # 8-byte Reload
	movq	%r9, %r10
	movq	40(%rsp), %r9                   # 8-byte Reload
	jmp	.LBB0_74
.LBB0_70:                               #   in Loop: Header=BB0_28 Depth=2
	xorl	%ecx, %ecx
.LBB0_74:                               # %.loopexit379
                                        #   in Loop: Header=BB0_28 Depth=2
	incq	%rdi
	cmpq	%r15, %rdi
	jne	.LBB0_28
.LBB0_41:                               # %.preheader380
                                        #   in Loop: Header=BB0_12 Depth=1
	testl	%r11d, %r11d
	movq	368(%rsp), %r8                  # 8-byte Reload
	movq	32(%rsp), %r9                   # 8-byte Reload
	jle	.LBB0_44
# %bb.42:                               # %.lr.ph450
                                        #   in Loop: Header=BB0_12 Depth=1
	movl	%r9d, %eax
	imull	%r11d, %eax
	addl	176(%rsp), %eax                 # 4-byte Folded Reload
	xorl	%ecx, %ecx
.LBB0_43:                               #   Parent Loop BB0_12 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r8,%rcx,4), %edx
	movq	24(%rsp), %rsi                  # 8-byte Reload
	movl	(%rsi,%rcx,4), %esi
	movl	%esi, (%r8,%rcx,4)
	leal	(%rax,%rcx), %esi
	movslq	%esi, %rsi
	movl	%edx, (%r12,%rsi,4)
	incq	%rcx
	cmpq	%rcx, %r11
	jne	.LBB0_43
.LBB0_44:                               # %._crit_edge451
                                        #   in Loop: Header=BB0_12 Depth=1
	movq	152(%rsp), %rdx                 # 8-byte Reload
	incq	%rdx
	movl	204(%rsp), %ecx                 # 4-byte Reload
	addl	168(%rsp), %ecx                 # 4-byte Folded Reload
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movq	160(%rsp), %rax                 # 8-byte Reload
	addl	%edi, %eax
	movq	%rax, 160(%rsp)                 # 8-byte Spill
	movq	224(%rsp), %rax                 # 8-byte Reload
	addq	%rax, 176(%rsp)                 # 8-byte Folded Spill
	addl	%eax, 112(%rsp)                 # 4-byte Folded Spill
	addq	360(%rsp), %r8                  # 8-byte Folded Reload
	movq	%rdx, %rax
	movq	%rdx, 152(%rsp)                 # 8-byte Spill
	cmpq	352(%rsp), %rdx                 # 8-byte Folded Reload
	movq	120(%rsp), %rax                 # 8-byte Reload
	jne	.LBB0_12
.LBB0_14:                               # %.preheader
	cmpl	$0, 312(%rsp)                   # 4-byte Folded Reload
	jle	.LBB0_75
# %bb.15:                               # %.lr.ph455.preheader
	movq	232(%rsp), %rdi                 # 8-byte Reload
	movq	%rax, %rsi
	movq	304(%rsp), %rdx                 # 8-byte Reload
	addq	$424, %rsp                      # imm = 0x1A8
	.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
	jmp	memcpy@PLT                      # TAILCALL
.LBB0_75:                               # %._crit_edge456
	.cfi_def_cfa_offset 480
	addq	$424, %rsp                      # imm = 0x1A8
	.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_end0:
	.size	_Z12Kernel_5_CPUPiS_S_S_iiiiiiii, .Lfunc_end0-_Z12Kernel_5_CPUPiS_S_S_iiiiiiii
	.cfi_endproc
                                        # -- End function
	.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 __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
