#include <stdio.h>
#include <stdlib.h>

#define PROMOTER_LEN 51594
#define SCORE_LEN 1963
#define PNVEC_MAX 18000

#define Nchunk 5000
#define MAX_LINE_LEN 24000
#define DELIM "\t"


#define gpuErrchk(ans) { gpuAssert((ans), __FILE__, __LINE__); }
inline void gpuAssert(cudaError_t code, const char *file, int line, bool abort=true)
{
   if (code != cudaSuccess) 
   {
      fprintf(stderr,"GPUassert: %s %s %d\n", cudaGetErrorString(code), file, line);
      if (abort) exit(code);
   }
}


__global__ 
void tfbs_kernel(int N,    int pvec_max,
                 char *pvec,   int *pvec_len, 
                 float *pwm,    int pwm_len, 
                 float tf_threshold,
                 float *bg,

                 float *output) 

{

   int id = blockIdx.x * blockDim.x + threadIdx.x;
   int ind1, ind2;
   float wt_score1, wt_score2;
   float wt_score31, wt_score41;
   float wt_score32, wt_score42;
   float wt_score33, wt_score43;
   float wt_score34, wt_score44;
   int ioffset = 29; 


   if (id < N ) {

        int ncol = 4;


      /* loop through positions */ 
      for ( int ipos = ioffset; ipos < pvec_len[id] - ioffset; ipos++ ){



         float fs1 = -99999.;
         float fs2 = -99999.;
         float fs31 = -99999.;
         float fs41 = -99999.;
         float fs32 = -99999.;
         float fs42 = -99999.;
         float fs33 = -99999.;
         float fs43 = -99999.;
         float fs34 = -99999.;
         float fs44 = -99999.;
         
         /* loop through all k-mers for that position */
         for (   int ik = 0; ik < pwm_len; ik ++ ) {
            
          
            wt_score1 = 0; wt_score2 = 0; 
	    wt_score31 = 0; wt_score41=0;
	    wt_score32 = 0; wt_score42=0;
	    wt_score33 = 0; wt_score43=0;
	    wt_score34 = 0; wt_score44=0;

            /* loop through the k-mer */
            for (   int i = 0; i < pwm_len; i++){


               ind1 = pvec[id * pvec_max + ipos + ik - pwm_len + 1 + i];
               if ( ind1 < 1 ) { /* skip kmere if not A,C,T,G */
                                        wt_score1 = 0; wt_score2 = 0;
                                        wt_score31 = 0; wt_score41=0;
                                        wt_score32 = 0; wt_score42=0;
                                        wt_score33 = 0; wt_score43=0;
                                        wt_score34 = 0; wt_score44=0;
                                        break;
                                }

               ind2 = 5 - pvec[id * pvec_max + ipos + ik   - i ];
               if ( ind2 > 4 ) { /* skip kmere if not A,C,T,G */
                                        wt_score1 = 0; wt_score2 = 0;
                                        wt_score31 = 0; wt_score41=0;
                                        wt_score32 = 0; wt_score42=0;
                                        wt_score33 = 0; wt_score43=0;
                                        wt_score34 = 0; wt_score44=0;
                                        break;
                                }


               wt_score1 = wt_score1 + log(pwm[ (i * ncol )  +  (ind1 -1) ] / bg[ ind1 - 1 ] );
               wt_score2 = wt_score2 + log(pwm[ (i * ncol )  +  (ind2 -1) ] / bg[ ind2 - 1 ] );

               if ( i == (pwm_len -ik -1)) ind1 = 1;
               if ( i == ik) ind2 = 5 - 1;
               wt_score31 = wt_score31 + log(pwm[ (i * ncol )  +  (ind1 -1) ] / bg[ ind1 - 1 ] );
               wt_score41 = wt_score41 + log(pwm[ (i * ncol )  +  (ind2 -1) ] / bg[ ind2 - 1 ] );

               if ( i == (pwm_len -ik -1)) ind1 = 2;
               if ( i == ik) ind2 = 5 - 2;
               wt_score32 = wt_score32 + log(pwm[ (i * ncol )  +  (ind1 -1) ] / bg[ ind1 - 1 ] );
               wt_score42 = wt_score42 + log(pwm[ (i * ncol )  +  (ind2 -1) ] / bg[ ind2 - 1 ] );

               if ( i == (pwm_len -ik -1)) ind1 = 3;
               if ( i == ik) ind2 = 5 - 3;
               wt_score33 = wt_score33 + log(pwm[ (i * ncol )  +  (ind1 -1) ] / bg[ ind1 - 1 ] );
               wt_score43 = wt_score43 + log(pwm[ (i * ncol )  +  (ind2 -1) ] / bg[ ind2 - 1 ] );

               if ( i == (pwm_len -ik -1)) ind1 = 4;
               if ( i == ik) ind2 = 5 - 4;
               wt_score34 = wt_score34 + log(pwm[ (i * ncol )  +  (ind1 -1) ] / bg[ ind1 - 1 ] );
               wt_score44 = wt_score44 + log(pwm[ (i * ncol )  +  (ind2 -1) ] / bg[ ind2 - 1 ] );
            }

            /* for all kmers for this position calculate maximum scores */
            fs1 = ( fs1 < wt_score1 ) ? wt_score1 : fs1; 
            fs2 = ( fs2 < wt_score2 ) ? wt_score2 : fs2; 
            fs31 = ( fs31 < wt_score31 ) ? wt_score31 : fs31; 
            fs41 = ( fs41 < wt_score41 ) ? wt_score41 : fs41;
            fs32 = ( fs32 < wt_score32 ) ? wt_score32 : fs32; 
            fs42 = ( fs42 < wt_score42 ) ? wt_score42 : fs42;
            fs33 = ( fs33 < wt_score33 ) ? wt_score33 : fs33; 
            fs43 = ( fs43 < wt_score43 ) ? wt_score43 : fs43;
            fs34 = ( fs34 < wt_score34 ) ? wt_score34 : fs34; 
            fs44 = ( fs44 < wt_score44 ) ? wt_score44 : fs44;

         }

         /* if all the scores are less than threshold do not store them */
         int icol =  id * (pvec_max - ioffset * 2 )  +  (ipos - ioffset );
         int ichunk = N * (pvec_max - ioffset * 2 );
         output[ 1 * ichunk + icol ] = ipos + 1;

         output[ 2 * ichunk + icol ] = fs1;
         output[ 3  * ichunk + icol ] = fs2;


         if ( (fs31 >= tf_threshold | fs41 >= tf_threshold ) & pvec[ id * pvec_max + ipos] != 1 ){
            output[ icol ] = 1;
            output[ 4 * ichunk + icol ] = fs31;
            output[ 5 * ichunk + icol ] = fs41;
         } else if( ( fs1 > tf_threshold | fs2 > tf_threshold) &   pvec[ id * pvec_max + ipos] != 1 ){
            output[ icol ] =0;
            output[ 4 * ichunk + icol ] = fs31;
            output[ 5 * ichunk + icol ] = fs41;

         } else {
            output[ icol ]  = 0;

         }

         if ( ( fs32 >= tf_threshold | fs42 >= tf_threshold) & pvec[ id * pvec_max + ipos] != 2 ){
            output[ icol ] = output[  icol  ] + 10;
            output[ 6 * ichunk + icol ] = fs32;
            output[ 7 * ichunk + icol ] = fs42;
         } else if( ( fs1 > tf_threshold | fs2 > tf_threshold) &   pvec[ id * pvec_max + ipos] != 2 ){
            output[ 6 * ichunk + icol ] = fs32;
            output[ 7 * ichunk + icol ] = fs42;
         } 

         if ( ( fs33 >= tf_threshold | fs43 >= tf_threshold) & pvec[ id * pvec_max + ipos] != 3 ){
            output[ icol ] = output[  icol  ] + 100;
            output[ 8 * ichunk + icol ] = fs33;
            output[ 9 * ichunk + icol ] = fs43;
         } else if( ( fs1 > tf_threshold | fs2 > tf_threshold) &   pvec[ id * pvec_max + ipos] != 3 ){
            output[ 8 * ichunk + icol ] = fs33;
            output[ 9 * ichunk + icol ] = fs43;
         } 

         if ( ( fs34 >= tf_threshold | fs44 >= tf_threshold) & pvec[ id * pvec_max + ipos] != 4 ){
            output[ icol ] = output[ icol ] + 1000;
            output[ 10 * ichunk + icol ] = fs34;
            output[ 11 * ichunk + icol ] = fs44;
         } else if( ( fs1 > tf_threshold | fs2 > tf_threshold) &   pvec[ id * pvec_max + ipos] != 4 ){
            output[ 10 * ichunk + icol ] = fs34;
            output[ 11 * ichunk + icol ] = fs44;
         } 


      }
 

   }

}
 

  void tfbs_cuda(  char *pvec,   // promoter
                   int *pvec_len,
                   int pvec_max,
                   float *pwm, 
                   int pwm_len, 
                   float tf_threshold, 
                   float *bg, 
                   int N, 
                   float *output)  {// output matrix


   
     char *d_pvec;
     int *d_pvec_len;
     float *d_output;
     float *d_pwm;
     float *d_bg;

   

	//printf("Allocating GPU memory for pvec_len\n");
	gpuErrchk( cudaMalloc( (void**)&d_pvec_len, N * sizeof(  int)) );
	//printf("Copying GPU memory for pvec_len\n");
	gpuErrchk( cudaMemcpy( d_pvec_len, pvec_len, N * sizeof(  int), cudaMemcpyHostToDevice ) ); 

	//printf("Allocating GPU memory for pvec\n");
	gpuErrchk( cudaMalloc( (void**) &d_pvec, N * pvec_max * sizeof(  char)) );
	//printf("Copying GPU memory for pvec\n");
        gpuErrchk( cudaMemcpy(     d_pvec, pvec, N * pvec_max * sizeof(  char), cudaMemcpyHostToDevice ) ); 

	//printf("Allocating GPU memory for pwm\n");
 	gpuErrchk( cudaMalloc( (void**)&d_pwm, 4 * pwm_len * sizeof(float)) );
	//printf("Copying GPU memory for pwm\n");
	gpuErrchk( cudaMemcpy(     d_pwm, pwm, 4 * pwm_len * sizeof(float), cudaMemcpyHostToDevice ) ); 


	//printf("Allocating GPU memory for bg\n");
 	gpuErrchk( cudaMalloc( (void**)&d_bg, 4 *  sizeof(float)) );
	//printf("Copying GPU memory for bg\n");
	gpuErrchk( cudaMemcpy(      d_bg, bg, 4 *  sizeof(float), cudaMemcpyHostToDevice ) ); 


	//printf("Allocating GPU memory for result\n");
	gpuErrchk( cudaMalloc( (void**)&d_output, N * 12 * (pvec_max -58 ) * sizeof(float) ) ); 
	//printf("Before kernel\n");
	
	dim3 dimBlock( 32, 1 );
	dim3 dimGrid( N/32 + 1,  1 );
	//printf("Calling CUDA kernel\n");
	tfbs_kernel<<<dimGrid,dimBlock>>>(N, pvec_max,
                                          d_pvec, d_pvec_len, 
                                          d_pwm,  pwm_len, 
                                          tf_threshold, d_bg, 
                                          d_output);
	gpuErrchk( cudaPeekAtLastError() );

	//cudaDeviceSynchronize();
	//printf("After CUDA kernel\n");

	gpuErrchk( cudaMemcpy( output, d_output, N * 12 * (pvec_max -58 ) * sizeof(float), cudaMemcpyDeviceToHost ) ); 
	//printf("Free GPU memory \n");

	cudaFree( d_pvec );
	cudaFree( d_pvec_len );
	cudaFree( d_output );

	cudaFree( d_pwm );
	cudaFree( d_bg );


   return;
  }



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

   char filename[1024];
   int taskID;
   float bg[] = {0.25, 0.25, 0.25, 0.25};
   FILE *ifp, *ofp;
   char in_line[MAX_LINE_LEN];
   char *token;
   int chrom[PROMOTER_LEN];
   int istart[PROMOTER_LEN];
   int i, j, jj, i1, i2, j1, j2, icurr;
   float score_threshold[SCORE_LEN];
   char **score_files;
   float pwm[30 * 4];
   int pwm_length;
   int any0;
   float sum;
   char *pnvec;
   int *pnvec_len; 
   float *result;
   int ires;
 

   /* command line processing */
   taskID = atoi(argv[1]); 
   printf("Input file name: %s\n", argv[2]);
   printf("tf.info file name: %s\n", argv[3]);
   printf("pwm directory: %s\n", argv[4]);
   sprintf(filename,"./%s/%s_%03d.txt", argv[5], argv[6], taskID);
   printf("Output file name: %s\n", filename);


   /* allocate memory to hold char arrays */
   //sequence = (char **) malloc( PROMOTER_LEN * sizeof(char *) );
   score_files = (char **) malloc( SCORE_LEN * sizeof(char *) );
   result = (float *) malloc( Nchunk * 12 * ( PNVEC_MAX - 58 ) * sizeof(float) );

   pnvec_len = ( int * ) malloc ( PROMOTER_LEN * sizeof( int ) );
   if ( pnvec_len == 0 ) {
      fprintf( stderr, "ERROR allocating pnvec_len: Out of memory\n");
      exit(1);
   }

   //printf("Allocating memory for pnvec\n");
   pnvec = ( char * ) malloc ( PROMOTER_LEN * PNVEC_MAX * sizeof( char) );
   if ( pnvec == 0 ) {
      fprintf( stderr, "ERROR allocating pnvec: Out of memory\n");
      exit(2);
   }

   printf("Reading Input files\n");

   /* read input file line by line  (only 1st, 2nd and 8th columns) */
   ifp = fopen(argv[2], "r");
   fgets(in_line, MAX_LINE_LEN, ifp); //skip header line
   i=0;
   while( fgets(in_line, MAX_LINE_LEN, ifp )!= NULL ){

      token = strtok( in_line, DELIM);
      sscanf( token,"chr%d", &(chrom[i])); 

      token = strtok( NULL, DELIM);
      sscanf( token,"%d", istart + i ); 

      token = strtok( NULL, DELIM);
      token = strtok( NULL, DELIM);
      token = strtok( NULL, DELIM);
      token = strtok( NULL, DELIM);
      token = strtok( NULL, DELIM);
      token = strtok( NULL, DELIM);

      //if(i > 14655) printf(" start processing letter\n");
      pnvec_len[i] = strlen(token);
      for (j = 0; j < pnvec_len[i] ; j++) {
         //if (i == 14660)printf("%c",token[j]);
         switch( token[j] ){
         case 'A':
            pnvec[ i * PNVEC_MAX + j ]=1;
            break;
         case 'a':
            pnvec[ i * PNVEC_MAX + j ]=1;
            break;
         case 'C':
            pnvec[ i * PNVEC_MAX + j ]=2;
            break;
         case 'c':
            pnvec[ i * PNVEC_MAX + j ]=2;
            break;
         case 'G':
            pnvec[ i * PNVEC_MAX + j ]=3;
            break;
         case 'g':
            pnvec[ i * PNVEC_MAX + j ]=3;
            break;
         case 'T':
            pnvec[ i * PNVEC_MAX + j ]=4;
            break;
         case 't':
            pnvec[ i * PNVEC_MAX + j ]=4;
            break;
         default:
            pnvec[ i * PNVEC_MAX + j ]=0;
            break;
         }
      }

      i++;
      //if ( i > 14600) { printf("i=%d\n",i);}
   }
   fclose(ifp);
   printf(" Read %d lines from the input file\n", i); 


   /* Read tf.info file */
   ifp = fopen(argv[3], "r");
   i=0;
   while( fgets(in_line, MAX_LINE_LEN, ifp ) ){

      token = strtok( in_line, DELIM);
      score_files[i] = (char *) malloc ( (strlen(token) + 1 ) * sizeof(char ));
      strcpy( score_files[i], token );

      token = strtok( NULL, DELIM);
      score_threshold[i] = atof(token);

      i++;


   }

   fclose(ifp);
   printf(" Read %d lines from %s file\n", i, argv[3]); 


   /* process chunks */
   i1 = (taskID - 1) * 100 + 1;  // was 10 originally
   i2 = taskID * 100;
   if ( i2 > SCORE_LEN ) i2 = SCORE_LEN;

   /* open output file */
   ofp = fopen(filename,"w");

   if (ofp == NULL) {
      fprintf( stderr, " Can't open output file\n");
      exit(3);
   }


   for ( icurr = i1; icurr <= i2; icurr++){
      printf(" icurr =%d\n", icurr);

      sprintf( filename, "./%s/%s\0", argv[4], score_files[icurr-1] );
      ifp = fopen( filename , "r");
      fgets(in_line, MAX_LINE_LEN, ifp ); // skip first line
      i = 0;
      any0 = 0;
      while( fgets(in_line, MAX_LINE_LEN, ifp ) ){

         token = strtok( in_line, DELIM); //skip first value

         token = strtok( NULL, DELIM);
         pwm[i*4 + 0] = atof(token); 
         if ( !strcmp(token, "0.0") ) any0=1;

         token = strtok( NULL, DELIM);
         pwm[i*4 + 1] = atof(token); 
         if ( !strcmp(token, "0.0") ) any0=1;

         token = strtok( NULL, DELIM);
         pwm[i*4 + 2] = atof(token); 
         if ( !strcmp(token, "0.0") ) any0=1;

         token = strtok( NULL, DELIM);
         pwm[i*4 + 3] = atof(token); 
         if ( !strcmp(token, "0.0\n") ) any0=1;
         
         i++;
      }

      fclose(ifp);
      pwm_length = i;
      printf(" Read %d lines from %s file\n", i, score_files[icurr-1]); 

      /* part of create_pwm function */
      if ( any0 ) {
         for ( j = 0; j < i; j++ ){
           sum = pwm[ j*4 + 0] + pwm[ j*4 + 1] + pwm[ j*4 + 2] + pwm[ j*4 + 3] + 0.001 * 4;
           pwm[ j*4 + 0] = (pwm[ j*4 + 0] + 0.001)/sum;
           pwm[ j*4 + 1] = (pwm[ j*4 + 1] + 0.001)/sum;
           pwm[ j*4 + 2] = (pwm[ j*4 + 2] + 0.001)/sum;
           pwm[ j*4 + 3] = (pwm[ j*4 + 3] + 0.001)/sum;

         }
      }


      /* inner loop in R*/
      for ( j = 1; j < 12; j++ ){

         j1 = (j - 1) * Nchunk + 1;
         j2 = j * Nchunk;
         if ( j2 > PROMOTER_LEN )j2 = PROMOTER_LEN;
         int n = j2 - j1 + 1;

         printf(" j = %d through %d; threshold = %f\n", j1, j2, score_threshold[icurr - 1]);
         tfbs_cuda (pnvec + (j1 -1) * PNVEC_MAX, 
                    pnvec_len + j1 -1, 
                    PNVEC_MAX, 
                    pwm, 
                    pwm_length, 
                    score_threshold[icurr - 1], 
                    bg, 
                    n,  
                    result);

         fflush(stdout);

         /* save result in the output file */
         for (i = 0; i < n * ( PNVEC_MAX - 58 ); i++){
            ires = (int) result [ i ];
            int in = i/( PNVEC_MAX - 58 );
            //printf("%d ",i);
            if (ires > 0 || (score_threshold[ icurr - 1] < result[ i + ( PNVEC_MAX - 58 ) * 2 * n] )|| (score_threshold[icurr - 1] < result[i + (PNVEC_MAX - 58 ) * 3 * n])) {
               fprintf(ofp,"%d ", chrom [ in ]);
               //unsigned int ipos = result [ i +  ( PNVEC_MAX - 58 ) * n * 1] + istart[ j1 - 1 + i/( PNVEC_MAX - 58 ) ]; 
               unsigned int ipos = 30 + i%( PNVEC_MAX - 58 ) + istart[ j1 - 1 + in ]; 
               fprintf(ofp,"%d %d ", ipos, ipos + 1);
               fprintf(ofp,"%d %d ", j1 + in,  icurr);
               fprintf(ofp,"%d ", ires );
               // use %f.3 for printing results with 3 digits
               for ( jj = 2; jj < 11; jj++ )fprintf(ofp,"%.3f ", result [ i +  ( PNVEC_MAX - 58 ) * jj * n] );
               fprintf(ofp,"%.3f\n", result [ i + ( PNVEC_MAX - 58 ) * 11 * n] );
            }
         } 

      } // end of j loop


   } // end of icurr loop
 
   fclose(ofp);

   exit(0);
}

	.file	"tmpxft_0022d9cc_00000000-6_tfbs_main.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2032:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2032:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata._Z9gpuAssert9cudaErrorPKcib.str1.1,"aMS",@progbits,1
.LC0:
	.string	"GPUassert: %s %s %d\n"
	.section	.text._Z9gpuAssert9cudaErrorPKcib,"axG",@progbits,_Z9gpuAssert9cudaErrorPKcib,comdat
	.weak	_Z9gpuAssert9cudaErrorPKcib
	.type	_Z9gpuAssert9cudaErrorPKcib, @function
_Z9gpuAssert9cudaErrorPKcib:
.LFB2027:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L8
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%ecx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movl	%edx, 12(%rsp)
	movq	%rsi, (%rsp)
	call	cudaGetErrorString@PLT
	movl	12(%rsp), %r9d
	movq	(%rsp), %r8
	leaq	.LC0(%rip), %rdx
	movq	stderr(%rip), %rdi
	movq	%rax, %rcx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	testb	%bpl, %bpl
	je	.L2
	movl	%ebx, %edi
	call	exit@PLT
.L2:
	addq	$24, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z9gpuAssert9cudaErrorPKcib, .-_Z9gpuAssert9cudaErrorPKcib
	.text
	.globl	_Z45__device_stub__Z11tfbs_kerneliiPcPiPfifS1_S1_iiPcPiPfifS1_S1_
	.type	_Z45__device_stub__Z11tfbs_kerneliiPcPiPfifS1_S1_iiPcPiPfifS1_S1_, @function
_Z45__device_stub__Z11tfbs_kerneliiPcPiPfifS1_S1_iiPcPiPfifS1_S1_:
.LFB2054:
	.cfi_startproc
	endbr64
	subq	$216, %rsp
	.cfi_def_cfa_offset 224
	movq	224(%rsp), %rax
	movl	%edi, 60(%rsp)
	leaq	80(%rsp), %rdi
	movl	%esi, 56(%rsp)
	leaq	92(%rsp), %rsi
	movq	%rax, 16(%rsp)
	movq	232(%rsp), %rax
	movq	%rdx, 48(%rsp)
	leaq	64(%rsp), %rdx
	movq	%rcx, 40(%rsp)
	leaq	72(%rsp), %rcx
	movq	%r8, 32(%rsp)
	movl	%r9d, 28(%rsp)
	movq	%rax, 8(%rsp)
	movss	%xmm0, 24(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rax
	movl	$1, 88(%rsp)
	movq	%rax, 128(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 184(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 192(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 80(%rsp)
	movq	%rax, 92(%rsp)
	movl	$1, 100(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L12
	pushq	72(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z11tfbs_kerneliiPcPiPfifS1_S1_(%rip), %rdi
	pushq	72(%rsp)
	.cfi_def_cfa_offset 240
	movq	108(%rsp), %rcx
	movl	116(%rsp), %r8d
	movq	96(%rsp), %rsi
	movl	104(%rsp), %edx
	leaq	144(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 232
	popq	%rdx
	.cfi_def_cfa_offset 224
.L12:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2054:
	.size	_Z45__device_stub__Z11tfbs_kerneliiPcPiPfifS1_S1_iiPcPiPfifS1_S1_, .-_Z45__device_stub__Z11tfbs_kerneliiPcPiPfifS1_S1_iiPcPiPfifS1_S1_
	.globl	_Z11tfbs_kerneliiPcPiPfifS1_S1_
	.type	_Z11tfbs_kerneliiPcPiPfifS1_S1_, @function
_Z11tfbs_kerneliiPcPiPfifS1_S1_:
.LFB2055:
	.cfi_startproc
	endbr64
	jmp	_Z45__device_stub__Z11tfbs_kerneliiPcPiPfifS1_S1_iiPcPiPfifS1_S1_
	.cfi_endproc
.LFE2055:
	.size	_Z11tfbs_kerneliiPcPiPfifS1_S1_, .-_Z11tfbs_kerneliiPcPiPfifS1_S1_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/fuxmanlab/altered_TFBS/master/tfbs_main.cu"
	.text
	.globl	_Z9tfbs_cudaPcPiiPfifS1_iS1_
	.type	_Z9tfbs_cudaPcPiiPfifS1_iS1_, @function
_Z9tfbs_cudaPcPiiPfifS1_iS1_:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rsi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rcx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r9, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%r8d, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	movq	184(%rsp), %rax
	movss	%xmm0, 28(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rax, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	movslq	176(%rsp), %rax
	salq	$2, %rax
	movq	%rax, %rsi
	movq	%rax, 8(%rsp)
	call	cudaMalloc@PLT
	movl	$1, %ecx
	movl	$219, %edx
	leaq	.LC1(%rip), %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPKcib
	movq	8(%rsp), %rdx
	movq	48(%rsp), %rdi
	movq	%r15, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$221, %edx
	leaq	.LC1(%rip), %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPKcib
	movl	176(%rsp), %r8d
	leaq	40(%rsp), %rdi
	imull	%ebx, %r8d
	movslq	%r8d, %r15
	movl	%r8d, 8(%rsp)
	movq	%r15, %rsi
	call	cudaMalloc@PLT
	movl	$1, %ecx
	movl	$224, %edx
	leaq	.LC1(%rip), %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPKcib
	movq	40(%rsp), %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$226, %edx
	leaq	.LC1(%rip), %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPKcib
	leal	0(,%rbp,4), %eax
	leaq	64(%rsp), %rdi
	cltq
	leaq	0(,%rax,4), %r14
	movq	%r14, %rsi
	call	cudaMalloc@PLT
	movl	$1, %ecx
	movl	$229, %edx
	leaq	.LC1(%rip), %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPKcib
	movq	64(%rsp), %rdi
	movq	%r14, %rdx
	movq	%r13, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$231, %edx
	leaq	.LC1(%rip), %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPKcib
	leaq	72(%rsp), %rdi
	movl	$16, %esi
	call	cudaMalloc@PLT
	movl	$1, %ecx
	movl	$235, %edx
	leaq	.LC1(%rip), %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPKcib
	movq	72(%rsp), %rdi
	movq	%r12, %rsi
	movl	$1, %ecx
	movl	$16, %edx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$237, %edx
	leaq	.LC1(%rip), %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPKcib
	movl	8(%rsp), %r8d
	leaq	56(%rsp), %rdi
	imull	$58, 176(%rsp), %eax
	subl	%eax, %r8d
	imull	$12, %r8d, %r12d
	movslq	%r12d, %r12
	salq	$2, %r12
	movq	%r12, %rsi
	call	cudaMalloc@PLT
	movl	$1, %ecx
	movl	$241, %edx
	leaq	.LC1(%rip), %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPKcib
	movl	$32, %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	176(%rsp), %eax
	cltd
	idivl	%ecx
	movl	$134217729, %edx
	movl	$1, %ecx
	salq	$5, %rdx
	incl	%eax
	movl	%eax, 92(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 96(%rsp)
	movq	92(%rsp), %rdi
	movl	100(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	movss	28(%rsp), %xmm0
	testl	%eax, %eax
	jne	.L18
	pushq	56(%rsp)
	.cfi_def_cfa_offset 184
	movl	%ebp, %r9d
	movl	%ebx, %esi
	pushq	80(%rsp)
	.cfi_def_cfa_offset 192
	movq	80(%rsp), %r8
	movq	64(%rsp), %rcx
	movq	56(%rsp), %rdx
	movl	192(%rsp), %edi
	call	_Z45__device_stub__Z11tfbs_kerneliiPcPiPfifS1_S1_iiPcPiPfifS1_S1_
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L18:
	call	cudaPeekAtLastError@PLT
	movl	$1, %ecx
	movl	$252, %edx
	leaq	.LC1(%rip), %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPKcib
	movq	56(%rsp), %rsi
	movq	16(%rsp), %rdi
	movq	%r12, %rdx
	movl	$2, %ecx
	call	cudaMemcpy@PLT
	movl	$1, %ecx
	movl	$257, %edx
	leaq	.LC1(%rip), %rsi
	movl	%eax, %edi
	call	_Z9gpuAssert9cudaErrorPKcib
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	addq	$120, %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
.LFE2028:
	.size	_Z9tfbs_cudaPcPiiPfifS1_iS1_, .-_Z9tfbs_cudaPcPiiPfifS1_iS1_
	.section	.rodata.str1.1
.LC2:
	.string	"Input file name: %s\n"
.LC3:
	.string	"tf.info file name: %s\n"
.LC4:
	.string	"pwm directory: %s\n"
.LC5:
	.string	"./%s/%s_%03d.txt"
.LC6:
	.string	"Output file name: %s\n"
.LC7:
	.string	"ERROR allocating pnvec_len: Out of memory\n"
.LC8:
	.string	"ERROR allocating pnvec: Out of memory\n"
.LC9:
	.string	"Reading Input files\n"
.LC10:
	.string	"r"
.LC11:
	.string	"\t"
.LC12:
	.string	"chr%d"
.LC13:
	.string	"%d"
.LC14:
	.string	" Read %d lines from the input file\n"
.LC15:
	.string	" Read %d lines from %s file\n"
.LC16:
	.string	"w"
.LC17:
	.string	" Can't open output file\n"
.LC18:
	.string	" icurr =%d\n"
	.section	.rodata
.LC19:
	.string	"./%s/%s"
	.string	""
	.section	.rodata.str1.1
.LC20:
	.string	"0.0"
.LC21:
	.string	"0.0\n"
.LC24:
	.string	" j = %d through %d; threshold = %f\n"
.LC25:
	.string	"%d "
.LC26:
	.string	"%d %d "
.LC27:
	.string	"%.3f "
.LC28:
	.string	"%.3f\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2029:
	.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
	leaq	-442368(%rsp), %r11
	.cfi_def_cfa 11, 442424
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3912, %rsp
	.cfi_def_cfa_offset 446336
	movq	8(%rsi), %rdi
	movq	%fs:40, %rax
	movq	%rax, 446264(%rsp)
	movabsq	$4503599628419072000, %rax
	movq	%rsi, %rbx
	movq	%rax, 140(%rsp)
	movq	%rax, 148(%rsp)
	call	atoi@PLT
	movq	16(%rbx), %rdx
	movl	$2, %edi
	leaq	.LC2(%rip), %rsi
	movl	%eax, %ebp
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	24(%rbx), %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	32(%rbx), %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	48(%rbx), %r9
	movq	40(%rbx), %r8
	leaq	421240(%rsp), %rax
	movq	%rax, (%rsp)
	leaq	.LC5(%rip), %rcx
	movl	$1024, %edx
	xorl	%eax, %eax
	pushq	%rsi
	.cfi_def_cfa_offset 446344
	movl	$2, %esi
	pushq	%rbp
	.cfi_def_cfa_offset 446352
	movq	16(%rsp), %rdi
	call	__sprintf_chk@PLT
	popq	%rdi
	.cfi_def_cfa_offset 446344
	popq	%r8
	.cfi_def_cfa_offset 446336
	leaq	.LC6(%rip), %rsi
	movq	(%rsp), %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$15704, %edi
	call	malloc@PLT
	movl	$16820625, %edi
	salq	$8, %rdi
	movq	%rax, 88(%rsp)
	call	malloc@PLT
	movl	$206376, %edi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movq	%rax, 32(%rsp)
	testq	%rax, %rax
	jne	.L22
	movq	stderr(%rip), %rdi
	leaq	.LC7(%rip), %rdx
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movl	$1, %edi
	jmp	.L69
.L22:
	movl	$928692000, %edi
	call	malloc@PLT
	movq	%rax, 40(%rsp)
	testq	%rax, %rax
	jne	.L23
	movq	stderr(%rip), %rdi
	leaq	.LC8(%rip), %rdx
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movl	$2, %edi
.L69:
	call	exit@PLT
.L23:
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	call	__printf_chk@PLT
	movq	16(%rbx), %rdi
	leaq	.LC10(%rip), %rsi
	leaq	.LC11(%rip), %r13
	call	fopen@PLT
	movl	$24000, %edx
	movl	$24000, %esi
	leaq	422264(%rsp), %rdi
	movq	%rax, %rcx
	movq	%rax, %r15
	call	__fgets_chk@PLT
.L24:
	leaq	422264(%rsp), %r14
	movq	%r15, %rcx
	movl	$24000, %edx
	movl	$24000, %esi
	movq	%r14, %rdi
	call	__fgets_chk@PLT
	testq	%rax, %rax
	je	.L70
	movq	%r14, %rdi
	movq	%r13, %rsi
	leaq	0(,%r12,4), %r14
	call	strtok@PLT
	leaq	8488(%rsp,%r14), %rdx
	leaq	.LC12(%rip), %rsi
	movq	%rax, %rdi
	xorl	%eax, %eax
	call	__isoc23_sscanf@PLT
	movq	%r13, %rsi
	xorl	%edi, %edi
	call	strtok@PLT
	leaq	214864(%rsp,%r14), %rdx
	leaq	.LC13(%rip), %rsi
	movq	%rax, %rdi
	xorl	%eax, %eax
	call	__isoc23_sscanf@PLT
	movq	%r13, %rsi
	xorl	%edi, %edi
	call	strtok@PLT
	movq	%r13, %rsi
	xorl	%edi, %edi
	call	strtok@PLT
	movq	%r13, %rsi
	xorl	%edi, %edi
	call	strtok@PLT
	movq	%r13, %rsi
	xorl	%edi, %edi
	call	strtok@PLT
	movq	%r13, %rsi
	xorl	%edi, %edi
	call	strtok@PLT
	movq	%r13, %rsi
	xorl	%edi, %edi
	call	strtok@PLT
	movq	%rax, %rdi
	movq	%rax, %r14
	call	strlen@PLT
	movq	32(%rsp), %rcx
	imulq	$18000, %r12, %rdi
	movl	%eax, %esi
	movl	%eax, (%rcx,%r12,4)
	movq	40(%rsp), %rax
	xorl	%ecx, %ecx
	addq	%rax, %rdi
.L25:
	cmpl	%ecx, %esi
	jle	.L71
	movb	(%r14,%rcx), %dl
	movb	$1, %al
	cmpb	$97, %dl
	je	.L26
	movb	$3, %al
	jg	.L27
	cmpb	$71, %dl
	je	.L26
	jg	.L28
	movb	$1, %al
	cmpb	$65, %dl
	je	.L26
	cmpb	$67, %dl
	jmp	.L68
.L28:
	cmpb	$84, %dl
	sete	%al
	sall	$2, %eax
	jmp	.L26
.L27:
	cmpb	$103, %dl
	je	.L26
	movb	$4, %al
	cmpb	$116, %dl
	je	.L26
	cmpb	$99, %dl
.L68:
	sete	%al
	addl	%eax, %eax
.L26:
	movb	%al, (%rdi,%rcx)
	incq	%rcx
	jmp	.L25
.L71:
	incq	%r12
	jmp	.L24
.L70:
	movq	%r15, %rdi
	leaq	.LC11(%rip), %r15
	call	fclose@PLT
	movl	%r12d, %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC14(%rip), %rsi
	xorl	%r12d, %r12d
	call	__printf_chk@PLT
	movq	24(%rbx), %rdi
	leaq	.LC10(%rip), %rsi
	call	fopen@PLT
	movq	%rax, %r13
.L31:
	movq	%r13, %rcx
	movl	$24000, %edx
	movl	$24000, %esi
	movq	%r14, %rdi
	call	__fgets_chk@PLT
	testq	%rax, %rax
	je	.L72
	movq	%r15, %rsi
	movq	%r14, %rdi
	call	strtok@PLT
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
	call	strlen@PLT
	leaq	1(%rax), %rdx
	movq	%rdx, %rdi
	movq	%rdx, 16(%rsp)
	call	malloc@PLT
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rsi
	movq	%rax, %rdi
	movq	88(%rsp), %rax
	movq	%rdi, (%rax,%r12,8)
	call	__strcpy_chk@PLT
	movq	%r15, %rsi
	xorl	%edi, %edi
	call	strtok@PLT
	movq	%rax, %rdi
	call	atof@PLT
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 636(%rsp,%r12,4)
	incq	%r12
	jmp	.L31
.L72:
	decl	%ebp
	movq	%r13, %rdi
	call	fclose@PLT
	imull	$100, %ebp, %ebp
	movq	24(%rbx), %rcx
	movl	%r12d, %edx
	leaq	.LC15(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%rsp), %rdi
	leaq	.LC16(%rip), %rsi
	leal	100(%rbp), %eax
	leal	1(%rbp), %r15d
	movl	%eax, 80(%rsp)
	movl	$1963, %eax
	cmpl	%eax, 80(%rsp)
	movslq	%r15d, %r15
	cmovle	80(%rsp), %eax
	movl	%eax, 80(%rsp)
	call	fopen@PLT
	movq	%rax, (%rsp)
	testq	%rax, %rax
	jne	.L34
	movq	stderr(%rip), %rdi
	leaq	.LC17(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	$3, %edi
	jmp	.L69
.L74:
	movq	16(%rsp), %rdi
	call	fclose@PLT
	movq	48(%rsp), %rcx
	movl	24(%rsp), %edx
	xorl	%eax, %eax
	leaq	.LC15(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	testl	%ebp, %ebp
	jne	.L62
.L44:
	movq	40(%rsp), %rax
	movl	$5000, %ebp
	movq	%rax, 72(%rsp)
	movq	32(%rsp), %rax
	movq	%rax, 64(%rsp)
.L42:
	movl	$51594, %ecx
	leal	-5000(%rbp), %eax
	movss	632(%rsp,%r15,4), %xmm7
	leaq	.LC24(%rip), %rsi
	cmpl	%ecx, %ebp
	movl	%eax, 108(%rsp)
	leal	-4999(%rbp), %eax
	movl	$2, %edi
	cmovle	%ebp, %ecx
	movl	%eax, 48(%rsp)
	movl	%eax, %edx
	cvtss2sd	%xmm7, %xmm0
	movss	%xmm7, 16(%rsp)
	movl	%ecx, %r13d
	subl	%eax, %r13d
	movb	$1, %al
	call	__printf_chk@PLT
	leal	1(%r13), %r12d
	movl	$18000, %edx
	leaq	156(%rsp), %rcx
	pushq	8(%rsp)
	.cfi_def_cfa_offset 446344
	pushq	%r12
	.cfi_def_cfa_offset 446352
	movss	32(%rsp), %xmm0
	movl	40(%rsp), %r8d
	movq	80(%rsp), %rsi
	movq	88(%rsp), %rdi
	leaq	156(%rsp), %r9
	call	_Z9tfbs_cudaPcPiiPfifS1_iS1_
	movq	stdout(%rip), %rdi
	popq	%rax
	.cfi_def_cfa_offset 446344
	popq	%rdx
	.cfi_def_cfa_offset 446336
	call	fflush@PLT
	imull	$17942, %r12d, %eax
	imull	$35884, %r12d, %r12d
	movl	%eax, 84(%rsp)
	movq	8(%rsp), %rax
	movslq	%r12d, %r12
	leaq	(%rax,%r12,4), %rax
	xorl	%r12d, %r12d
	movq	%rax, 96(%rsp)
	movslq	84(%rsp), %rax
	salq	$2, %rax
	movq	%rax, 112(%rsp)
.L45:
	movl	%r12d, %r14d
	cmpl	%r12d, 84(%rsp)
	jg	.L50
	addq	$90000000, 72(%rsp)
	addl	$5000, %ebp
	addq	$20000, 64(%rsp)
	cmpl	$60000, %ebp
	jne	.L42
	incq	%r15
.L34:
	movl	%r15d, 104(%rsp)
	cmpl	%r15d, 80(%rsp)
	jl	.L73
	movl	104(%rsp), %edx
	leaq	.LC18(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	421240(%rsp), %rbp
	leaq	156(%rsp), %r14
	call	__printf_chk@PLT
	movq	88(%rsp), %rax
	movq	%rbp, %rdi
	movq	%r14, %r12
	movq	32(%rbx), %r8
	movl	$1024, %edx
	movl	$2, %esi
	leaq	.LC19(%rip), %rcx
	movq	-8(%rax,%r15,8), %rax
	movq	%rax, %r9
	movq	%rax, 48(%rsp)
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	movq	%rbp, %rdi
	leaq	.LC10(%rip), %rsi
	xorl	%ebp, %ebp
	call	fopen@PLT
	movl	$24000, %edx
	movl	$24000, %esi
	leaq	422264(%rsp), %rdi
	movq	%rax, %rcx
	movq	%rax, 16(%rsp)
	call	__fgets_chk@PLT
	xorl	%ecx, %ecx
	movl	%ecx, 24(%rsp)
.L35:
	movq	16(%rsp), %rcx
	movl	$24000, %edx
	movl	$24000, %esi
	leaq	422264(%rsp), %r13
	movq	%r13, %rdi
	call	__fgets_chk@PLT
	testq	%rax, %rax
	je	.L74
	movq	%r13, %rdi
	leaq	.LC11(%rip), %rsi
	call	strtok@PLT
	leaq	.LC11(%rip), %rsi
	xorl	%edi, %edi
	call	strtok@PLT
	movq	%rax, %rdi
	movq	%rax, %r13
	call	atof@PLT
	movq	%r13, %rdi
	leaq	.LC20(%rip), %rsi
	movl	$1, %r13d
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r12)
	call	strcmp@PLT
	leaq	.LC11(%rip), %rsi
	testl	%eax, %eax
	cmove	%r13d, %ebp
	xorl	%edi, %edi
	call	strtok@PLT
	movq	%rax, %rdi
	movq	%rax, 56(%rsp)
	call	atof@PLT
	movq	56(%rsp), %rdi
	leaq	.LC20(%rip), %rsi
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 4(%r12)
	call	strcmp@PLT
	leaq	.LC11(%rip), %rsi
	testl	%eax, %eax
	cmove	%r13d, %ebp
	xorl	%edi, %edi
	call	strtok@PLT
	movq	%rax, %rdi
	movq	%rax, 56(%rsp)
	call	atof@PLT
	movq	56(%rsp), %rdi
	leaq	.LC20(%rip), %rsi
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 8(%r12)
	call	strcmp@PLT
	leaq	.LC11(%rip), %rsi
	testl	%eax, %eax
	cmove	%r13d, %ebp
	xorl	%edi, %edi
	call	strtok@PLT
	movq	%rax, %rdi
	movq	%rax, 56(%rsp)
	call	atof@PLT
	movq	56(%rsp), %rdi
	leaq	.LC21(%rip), %rsi
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 12(%r12)
	call	strcmp@PLT
	testl	%eax, %eax
	cmove	%r13d, %ebp
	incl	24(%rsp)
	addq	$16, %r12
	jmp	.L35
.L62:
	movsd	.LC22(%rip), %xmm4
	movsd	.LC23(%rip), %xmm3
	xorl	%eax, %eax
.L41:
	cmpl	%eax, 24(%rsp)
	je	.L44
	movss	(%r14), %xmm6
	movss	4(%r14), %xmm5
	incl	%eax
	addq	$16, %r14
	movss	-8(%r14), %xmm2
	movss	-4(%r14), %xmm1
	movaps	%xmm6, %xmm0
	cvtss2sd	%xmm6, %xmm6
	addsd	%xmm3, %xmm6
	addss	%xmm5, %xmm0
	cvtss2sd	%xmm5, %xmm5
	addsd	%xmm3, %xmm5
	addss	%xmm2, %xmm0
	cvtss2sd	%xmm2, %xmm2
	addsd	%xmm3, %xmm2
	addss	%xmm1, %xmm0
	cvtss2sd	%xmm1, %xmm1
	addsd	%xmm3, %xmm1
	cvtss2sd	%xmm0, %xmm0
	addsd	%xmm4, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	cvtss2sd	%xmm0, %xmm0
	divsd	%xmm0, %xmm6
	divsd	%xmm0, %xmm5
	cvtsd2ss	%xmm6, %xmm6
	movss	%xmm6, -16(%r14)
	divsd	%xmm0, %xmm2
	cvtsd2ss	%xmm5, %xmm5
	movss	%xmm5, -12(%r14)
	divsd	%xmm0, %xmm1
	cvtsd2ss	%xmm2, %xmm2
	movss	%xmm2, -8(%r14)
	cvtsd2ss	%xmm1, %xmm1
	movss	%xmm1, -4(%r14)
	jmp	.L41
.L50:
	movq	8(%rsp), %rax
	cvttss2sil	(%rax,%r12,4), %r9d
	testl	%r9d, %r9d
	jg	.L46
	leal	1(%r13), %eax
	movq	8(%rsp), %rcx
	imull	$35884, %eax, %edx
	addl	%r14d, %edx
	movslq	%edx, %rdx
	movss	(%rcx,%rdx,4), %xmm0
	comiss	16(%rsp), %xmm0
	ja	.L46
	imull	$53826, %eax, %eax
	addl	%r14d, %eax
	cltq
	movss	(%rcx,%rax,4), %xmm0
	comiss	16(%rsp), %xmm0
	jbe	.L47
.L46:
	movl	%r12d, %eax
	movl	$17942, %ecx
	movq	(%rsp), %rdi
	movl	$2, %esi
	cltd
	movl	%r9d, 124(%rsp)
	idivl	%ecx
	movl	%eax, 56(%rsp)
	cltq
	movl	8488(%rsp,%rax,4), %ecx
	movl	%edx, 120(%rsp)
	xorl	%eax, %eax
	leaq	.LC25(%rip), %rdx
	call	__fprintf_chk@PLT
	movl	56(%rsp), %ecx
	movl	108(%rsp), %eax
	leaq	.LC26(%rip), %rdx
	movq	(%rsp), %rdi
	movl	$2, %esi
	addl	%ecx, %eax
	movl	120(%rsp), %ecx
	cltq
	movl	214864(%rsp,%rax,4), %eax
	leal	30(%rcx,%rax), %ecx
	xorl	%eax, %eax
	leal	1(%rcx), %r8d
	call	__fprintf_chk@PLT
	movl	48(%rsp), %eax
	movl	56(%rsp), %ecx
	leaq	.LC26(%rip), %rdx
	movl	104(%rsp), %r8d
	movq	(%rsp), %rdi
	movl	$2, %esi
	addl	%eax, %ecx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	124(%rsp), %ecx
	movq	(%rsp), %rdi
	xorl	%eax, %eax
	leaq	.LC25(%rip), %rdx
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movq	96(%rsp), %rcx
	movl	$9, %r8d
.L49:
	movq	(%rsp), %rdi
	movl	$2, %esi
	movb	$1, %al
	movl	%r8d, 120(%rsp)
	leaq	.LC27(%rip), %rdx
	movq	%rcx, 56(%rsp)
	cvtss2sd	(%rcx), %xmm0
	call	__fprintf_chk@PLT
	movq	112(%rsp), %rax
	movq	56(%rsp), %rcx
	movl	120(%rsp), %r8d
	addq	%rax, %rcx
	decl	%r8d
	jne	.L49
	leal	1(%r13), %eax
	movq	8(%rsp), %rcx
	movq	(%rsp), %rdi
	leaq	.LC28(%rip), %rdx
	imull	$197362, %eax, %eax
	movl	$2, %esi
	addl	%r14d, %eax
	cltq
	cvtss2sd	(%rcx,%rax,4), %xmm0
	movb	$1, %al
	call	__fprintf_chk@PLT
.L47:
	addq	$4, 96(%rsp)
	incq	%r12
	jmp	.L45
.L73:
	movq	(%rsp), %rdi
	call	fclose@PLT
	xorl	%edi, %edi
	jmp	.L69
	.cfi_endproc
.LFE2029:
	.size	main, .-main
	.section	.rodata.str1.1
.LC29:
	.string	"_Z11tfbs_kerneliiPcPiPfifS1_S1_"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2057:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 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	.LC29(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z11tfbs_kerneliiPcPiPfifS1_S1_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2057:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC22:
	.long	-755914244
	.long	1064329805
	.align 8
.LC23:
	.long	-755914244
	.long	1062232653
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <stdio.h>
#include <stdlib.h>

#define PROMOTER_LEN 51594
#define SCORE_LEN 1963
#define PNVEC_MAX 18000

#define Nchunk 5000
#define MAX_LINE_LEN 24000
#define DELIM "\t"


#define gpuErrchk(ans) { gpuAssert((ans), __FILE__, __LINE__); }
inline void gpuAssert(hipError_t code, const char *file, int line, bool abort=true)
{
   if (code != hipSuccess) 
   {
      fprintf(stderr,"GPUassert: %s %s %d\n", hipGetErrorString(code), file, line);
      if (abort) exit(code);
   }
}


__global__ 
void tfbs_kernel(int N,    int pvec_max,
                 char *pvec,   int *pvec_len, 
                 float *pwm,    int pwm_len, 
                 float tf_threshold,
                 float *bg,

                 float *output) 

{

   int id = blockIdx.x * blockDim.x + threadIdx.x;
   int ind1, ind2;
   float wt_score1, wt_score2;
   float wt_score31, wt_score41;
   float wt_score32, wt_score42;
   float wt_score33, wt_score43;
   float wt_score34, wt_score44;
   int ioffset = 29; 


   if (id < N ) {

        int ncol = 4;


      /* loop through positions */ 
      for ( int ipos = ioffset; ipos < pvec_len[id] - ioffset; ipos++ ){



         float fs1 = -99999.;
         float fs2 = -99999.;
         float fs31 = -99999.;
         float fs41 = -99999.;
         float fs32 = -99999.;
         float fs42 = -99999.;
         float fs33 = -99999.;
         float fs43 = -99999.;
         float fs34 = -99999.;
         float fs44 = -99999.;
         
         /* loop through all k-mers for that position */
         for (   int ik = 0; ik < pwm_len; ik ++ ) {
            
          
            wt_score1 = 0; wt_score2 = 0; 
	    wt_score31 = 0; wt_score41=0;
	    wt_score32 = 0; wt_score42=0;
	    wt_score33 = 0; wt_score43=0;
	    wt_score34 = 0; wt_score44=0;

            /* loop through the k-mer */
            for (   int i = 0; i < pwm_len; i++){


               ind1 = pvec[id * pvec_max + ipos + ik - pwm_len + 1 + i];
               if ( ind1 < 1 ) { /* skip kmere if not A,C,T,G */
                                        wt_score1 = 0; wt_score2 = 0;
                                        wt_score31 = 0; wt_score41=0;
                                        wt_score32 = 0; wt_score42=0;
                                        wt_score33 = 0; wt_score43=0;
                                        wt_score34 = 0; wt_score44=0;
                                        break;
                                }

               ind2 = 5 - pvec[id * pvec_max + ipos + ik   - i ];
               if ( ind2 > 4 ) { /* skip kmere if not A,C,T,G */
                                        wt_score1 = 0; wt_score2 = 0;
                                        wt_score31 = 0; wt_score41=0;
                                        wt_score32 = 0; wt_score42=0;
                                        wt_score33 = 0; wt_score43=0;
                                        wt_score34 = 0; wt_score44=0;
                                        break;
                                }


               wt_score1 = wt_score1 + log(pwm[ (i * ncol )  +  (ind1 -1) ] / bg[ ind1 - 1 ] );
               wt_score2 = wt_score2 + log(pwm[ (i * ncol )  +  (ind2 -1) ] / bg[ ind2 - 1 ] );

               if ( i == (pwm_len -ik -1)) ind1 = 1;
               if ( i == ik) ind2 = 5 - 1;
               wt_score31 = wt_score31 + log(pwm[ (i * ncol )  +  (ind1 -1) ] / bg[ ind1 - 1 ] );
               wt_score41 = wt_score41 + log(pwm[ (i * ncol )  +  (ind2 -1) ] / bg[ ind2 - 1 ] );

               if ( i == (pwm_len -ik -1)) ind1 = 2;
               if ( i == ik) ind2 = 5 - 2;
               wt_score32 = wt_score32 + log(pwm[ (i * ncol )  +  (ind1 -1) ] / bg[ ind1 - 1 ] );
               wt_score42 = wt_score42 + log(pwm[ (i * ncol )  +  (ind2 -1) ] / bg[ ind2 - 1 ] );

               if ( i == (pwm_len -ik -1)) ind1 = 3;
               if ( i == ik) ind2 = 5 - 3;
               wt_score33 = wt_score33 + log(pwm[ (i * ncol )  +  (ind1 -1) ] / bg[ ind1 - 1 ] );
               wt_score43 = wt_score43 + log(pwm[ (i * ncol )  +  (ind2 -1) ] / bg[ ind2 - 1 ] );

               if ( i == (pwm_len -ik -1)) ind1 = 4;
               if ( i == ik) ind2 = 5 - 4;
               wt_score34 = wt_score34 + log(pwm[ (i * ncol )  +  (ind1 -1) ] / bg[ ind1 - 1 ] );
               wt_score44 = wt_score44 + log(pwm[ (i * ncol )  +  (ind2 -1) ] / bg[ ind2 - 1 ] );
            }

            /* for all kmers for this position calculate maximum scores */
            fs1 = ( fs1 < wt_score1 ) ? wt_score1 : fs1; 
            fs2 = ( fs2 < wt_score2 ) ? wt_score2 : fs2; 
            fs31 = ( fs31 < wt_score31 ) ? wt_score31 : fs31; 
            fs41 = ( fs41 < wt_score41 ) ? wt_score41 : fs41;
            fs32 = ( fs32 < wt_score32 ) ? wt_score32 : fs32; 
            fs42 = ( fs42 < wt_score42 ) ? wt_score42 : fs42;
            fs33 = ( fs33 < wt_score33 ) ? wt_score33 : fs33; 
            fs43 = ( fs43 < wt_score43 ) ? wt_score43 : fs43;
            fs34 = ( fs34 < wt_score34 ) ? wt_score34 : fs34; 
            fs44 = ( fs44 < wt_score44 ) ? wt_score44 : fs44;

         }

         /* if all the scores are less than threshold do not store them */
         int icol =  id * (pvec_max - ioffset * 2 )  +  (ipos - ioffset );
         int ichunk = N * (pvec_max - ioffset * 2 );
         output[ 1 * ichunk + icol ] = ipos + 1;

         output[ 2 * ichunk + icol ] = fs1;
         output[ 3  * ichunk + icol ] = fs2;


         if ( (fs31 >= tf_threshold | fs41 >= tf_threshold ) & pvec[ id * pvec_max + ipos] != 1 ){
            output[ icol ] = 1;
            output[ 4 * ichunk + icol ] = fs31;
            output[ 5 * ichunk + icol ] = fs41;
         } else if( ( fs1 > tf_threshold | fs2 > tf_threshold) &   pvec[ id * pvec_max + ipos] != 1 ){
            output[ icol ] =0;
            output[ 4 * ichunk + icol ] = fs31;
            output[ 5 * ichunk + icol ] = fs41;

         } else {
            output[ icol ]  = 0;

         }

         if ( ( fs32 >= tf_threshold | fs42 >= tf_threshold) & pvec[ id * pvec_max + ipos] != 2 ){
            output[ icol ] = output[  icol  ] + 10;
            output[ 6 * ichunk + icol ] = fs32;
            output[ 7 * ichunk + icol ] = fs42;
         } else if( ( fs1 > tf_threshold | fs2 > tf_threshold) &   pvec[ id * pvec_max + ipos] != 2 ){
            output[ 6 * ichunk + icol ] = fs32;
            output[ 7 * ichunk + icol ] = fs42;
         } 

         if ( ( fs33 >= tf_threshold | fs43 >= tf_threshold) & pvec[ id * pvec_max + ipos] != 3 ){
            output[ icol ] = output[  icol  ] + 100;
            output[ 8 * ichunk + icol ] = fs33;
            output[ 9 * ichunk + icol ] = fs43;
         } else if( ( fs1 > tf_threshold | fs2 > tf_threshold) &   pvec[ id * pvec_max + ipos] != 3 ){
            output[ 8 * ichunk + icol ] = fs33;
            output[ 9 * ichunk + icol ] = fs43;
         } 

         if ( ( fs34 >= tf_threshold | fs44 >= tf_threshold) & pvec[ id * pvec_max + ipos] != 4 ){
            output[ icol ] = output[ icol ] + 1000;
            output[ 10 * ichunk + icol ] = fs34;
            output[ 11 * ichunk + icol ] = fs44;
         } else if( ( fs1 > tf_threshold | fs2 > tf_threshold) &   pvec[ id * pvec_max + ipos] != 4 ){
            output[ 10 * ichunk + icol ] = fs34;
            output[ 11 * ichunk + icol ] = fs44;
         } 


      }
 

   }

}
 

  void tfbs_cuda(  char *pvec,   // promoter
                   int *pvec_len,
                   int pvec_max,
                   float *pwm, 
                   int pwm_len, 
                   float tf_threshold, 
                   float *bg, 
                   int N, 
                   float *output)  {// output matrix


   
     char *d_pvec;
     int *d_pvec_len;
     float *d_output;
     float *d_pwm;
     float *d_bg;

   

	//printf("Allocating GPU memory for pvec_len\n");
	gpuErrchk( hipMalloc( (void**)&d_pvec_len, N * sizeof(  int)) );
	//printf("Copying GPU memory for pvec_len\n");
	gpuErrchk( hipMemcpy( d_pvec_len, pvec_len, N * sizeof(  int), hipMemcpyHostToDevice ) ); 

	//printf("Allocating GPU memory for pvec\n");
	gpuErrchk( hipMalloc( (void**) &d_pvec, N * pvec_max * sizeof(  char)) );
	//printf("Copying GPU memory for pvec\n");
        gpuErrchk( hipMemcpy(     d_pvec, pvec, N * pvec_max * sizeof(  char), hipMemcpyHostToDevice ) ); 

	//printf("Allocating GPU memory for pwm\n");
 	gpuErrchk( hipMalloc( (void**)&d_pwm, 4 * pwm_len * sizeof(float)) );
	//printf("Copying GPU memory for pwm\n");
	gpuErrchk( hipMemcpy(     d_pwm, pwm, 4 * pwm_len * sizeof(float), hipMemcpyHostToDevice ) ); 


	//printf("Allocating GPU memory for bg\n");
 	gpuErrchk( hipMalloc( (void**)&d_bg, 4 *  sizeof(float)) );
	//printf("Copying GPU memory for bg\n");
	gpuErrchk( hipMemcpy(      d_bg, bg, 4 *  sizeof(float), hipMemcpyHostToDevice ) ); 


	//printf("Allocating GPU memory for result\n");
	gpuErrchk( hipMalloc( (void**)&d_output, N * 12 * (pvec_max -58 ) * sizeof(float) ) ); 
	//printf("Before kernel\n");
	
	dim3 dimBlock( 32, 1 );
	dim3 dimGrid( N/32 + 1,  1 );
	//printf("Calling CUDA kernel\n");
	tfbs_kernel<<<dimGrid,dimBlock>>>(N, pvec_max,
                                          d_pvec, d_pvec_len, 
                                          d_pwm,  pwm_len, 
                                          tf_threshold, d_bg, 
                                          d_output);
	gpuErrchk( hipPeekAtLastError() );

	//cudaDeviceSynchronize();
	//printf("After CUDA kernel\n");

	gpuErrchk( hipMemcpy( output, d_output, N * 12 * (pvec_max -58 ) * sizeof(float), hipMemcpyDeviceToHost ) ); 
	//printf("Free GPU memory \n");

	hipFree( d_pvec );
	hipFree( d_pvec_len );
	hipFree( d_output );

	hipFree( d_pwm );
	hipFree( d_bg );


   return;
  }



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

   char filename[1024];
   int taskID;
   float bg[] = {0.25, 0.25, 0.25, 0.25};
   FILE *ifp, *ofp;
   char in_line[MAX_LINE_LEN];
   char *token;
   int chrom[PROMOTER_LEN];
   int istart[PROMOTER_LEN];
   int i, j, jj, i1, i2, j1, j2, icurr;
   float score_threshold[SCORE_LEN];
   char **score_files;
   float pwm[30 * 4];
   int pwm_length;
   int any0;
   float sum;
   char *pnvec;
   int *pnvec_len; 
   float *result;
   int ires;
 

   /* command line processing */
   taskID = atoi(argv[1]); 
   printf("Input file name: %s\n", argv[2]);
   printf("tf.info file name: %s\n", argv[3]);
   printf("pwm directory: %s\n", argv[4]);
   sprintf(filename,"./%s/%s_%03d.txt", argv[5], argv[6], taskID);
   printf("Output file name: %s\n", filename);


   /* allocate memory to hold char arrays */
   //sequence = (char **) malloc( PROMOTER_LEN * sizeof(char *) );
   score_files = (char **) malloc( SCORE_LEN * sizeof(char *) );
   result = (float *) malloc( Nchunk * 12 * ( PNVEC_MAX - 58 ) * sizeof(float) );

   pnvec_len = ( int * ) malloc ( PROMOTER_LEN * sizeof( int ) );
   if ( pnvec_len == 0 ) {
      fprintf( stderr, "ERROR allocating pnvec_len: Out of memory\n");
      exit(1);
   }

   //printf("Allocating memory for pnvec\n");
   pnvec = ( char * ) malloc ( PROMOTER_LEN * PNVEC_MAX * sizeof( char) );
   if ( pnvec == 0 ) {
      fprintf( stderr, "ERROR allocating pnvec: Out of memory\n");
      exit(2);
   }

   printf("Reading Input files\n");

   /* read input file line by line  (only 1st, 2nd and 8th columns) */
   ifp = fopen(argv[2], "r");
   fgets(in_line, MAX_LINE_LEN, ifp); //skip header line
   i=0;
   while( fgets(in_line, MAX_LINE_LEN, ifp )!= NULL ){

      token = strtok( in_line, DELIM);
      sscanf( token,"chr%d", &(chrom[i])); 

      token = strtok( NULL, DELIM);
      sscanf( token,"%d", istart + i ); 

      token = strtok( NULL, DELIM);
      token = strtok( NULL, DELIM);
      token = strtok( NULL, DELIM);
      token = strtok( NULL, DELIM);
      token = strtok( NULL, DELIM);
      token = strtok( NULL, DELIM);

      //if(i > 14655) printf(" start processing letter\n");
      pnvec_len[i] = strlen(token);
      for (j = 0; j < pnvec_len[i] ; j++) {
         //if (i == 14660)printf("%c",token[j]);
         switch( token[j] ){
         case 'A':
            pnvec[ i * PNVEC_MAX + j ]=1;
            break;
         case 'a':
            pnvec[ i * PNVEC_MAX + j ]=1;
            break;
         case 'C':
            pnvec[ i * PNVEC_MAX + j ]=2;
            break;
         case 'c':
            pnvec[ i * PNVEC_MAX + j ]=2;
            break;
         case 'G':
            pnvec[ i * PNVEC_MAX + j ]=3;
            break;
         case 'g':
            pnvec[ i * PNVEC_MAX + j ]=3;
            break;
         case 'T':
            pnvec[ i * PNVEC_MAX + j ]=4;
            break;
         case 't':
            pnvec[ i * PNVEC_MAX + j ]=4;
            break;
         default:
            pnvec[ i * PNVEC_MAX + j ]=0;
            break;
         }
      }

      i++;
      //if ( i > 14600) { printf("i=%d\n",i);}
   }
   fclose(ifp);
   printf(" Read %d lines from the input file\n", i); 


   /* Read tf.info file */
   ifp = fopen(argv[3], "r");
   i=0;
   while( fgets(in_line, MAX_LINE_LEN, ifp ) ){

      token = strtok( in_line, DELIM);
      score_files[i] = (char *) malloc ( (strlen(token) + 1 ) * sizeof(char ));
      strcpy( score_files[i], token );

      token = strtok( NULL, DELIM);
      score_threshold[i] = atof(token);

      i++;


   }

   fclose(ifp);
   printf(" Read %d lines from %s file\n", i, argv[3]); 


   /* process chunks */
   i1 = (taskID - 1) * 100 + 1;  // was 10 originally
   i2 = taskID * 100;
   if ( i2 > SCORE_LEN ) i2 = SCORE_LEN;

   /* open output file */
   ofp = fopen(filename,"w");

   if (ofp == NULL) {
      fprintf( stderr, " Can't open output file\n");
      exit(3);
   }


   for ( icurr = i1; icurr <= i2; icurr++){
      printf(" icurr =%d\n", icurr);

      sprintf( filename, "./%s/%s\0", argv[4], score_files[icurr-1] );
      ifp = fopen( filename , "r");
      fgets(in_line, MAX_LINE_LEN, ifp ); // skip first line
      i = 0;
      any0 = 0;
      while( fgets(in_line, MAX_LINE_LEN, ifp ) ){

         token = strtok( in_line, DELIM); //skip first value

         token = strtok( NULL, DELIM);
         pwm[i*4 + 0] = atof(token); 
         if ( !strcmp(token, "0.0") ) any0=1;

         token = strtok( NULL, DELIM);
         pwm[i*4 + 1] = atof(token); 
         if ( !strcmp(token, "0.0") ) any0=1;

         token = strtok( NULL, DELIM);
         pwm[i*4 + 2] = atof(token); 
         if ( !strcmp(token, "0.0") ) any0=1;

         token = strtok( NULL, DELIM);
         pwm[i*4 + 3] = atof(token); 
         if ( !strcmp(token, "0.0\n") ) any0=1;
         
         i++;
      }

      fclose(ifp);
      pwm_length = i;
      printf(" Read %d lines from %s file\n", i, score_files[icurr-1]); 

      /* part of create_pwm function */
      if ( any0 ) {
         for ( j = 0; j < i; j++ ){
           sum = pwm[ j*4 + 0] + pwm[ j*4 + 1] + pwm[ j*4 + 2] + pwm[ j*4 + 3] + 0.001 * 4;
           pwm[ j*4 + 0] = (pwm[ j*4 + 0] + 0.001)/sum;
           pwm[ j*4 + 1] = (pwm[ j*4 + 1] + 0.001)/sum;
           pwm[ j*4 + 2] = (pwm[ j*4 + 2] + 0.001)/sum;
           pwm[ j*4 + 3] = (pwm[ j*4 + 3] + 0.001)/sum;

         }
      }


      /* inner loop in R*/
      for ( j = 1; j < 12; j++ ){

         j1 = (j - 1) * Nchunk + 1;
         j2 = j * Nchunk;
         if ( j2 > PROMOTER_LEN )j2 = PROMOTER_LEN;
         int n = j2 - j1 + 1;

         printf(" j = %d through %d; threshold = %f\n", j1, j2, score_threshold[icurr - 1]);
         tfbs_cuda (pnvec + (j1 -1) * PNVEC_MAX, 
                    pnvec_len + j1 -1, 
                    PNVEC_MAX, 
                    pwm, 
                    pwm_length, 
                    score_threshold[icurr - 1], 
                    bg, 
                    n,  
                    result);

         fflush(stdout);

         /* save result in the output file */
         for (i = 0; i < n * ( PNVEC_MAX - 58 ); i++){
            ires = (int) result [ i ];
            int in = i/( PNVEC_MAX - 58 );
            //printf("%d ",i);
            if (ires > 0 || (score_threshold[ icurr - 1] < result[ i + ( PNVEC_MAX - 58 ) * 2 * n] )|| (score_threshold[icurr - 1] < result[i + (PNVEC_MAX - 58 ) * 3 * n])) {
               fprintf(ofp,"%d ", chrom [ in ]);
               //unsigned int ipos = result [ i +  ( PNVEC_MAX - 58 ) * n * 1] + istart[ j1 - 1 + i/( PNVEC_MAX - 58 ) ]; 
               unsigned int ipos = 30 + i%( PNVEC_MAX - 58 ) + istart[ j1 - 1 + in ]; 
               fprintf(ofp,"%d %d ", ipos, ipos + 1);
               fprintf(ofp,"%d %d ", j1 + in,  icurr);
               fprintf(ofp,"%d ", ires );
               // use %f.3 for printing results with 3 digits
               for ( jj = 2; jj < 11; jj++ )fprintf(ofp,"%.3f ", result [ i +  ( PNVEC_MAX - 58 ) * jj * n] );
               fprintf(ofp,"%.3f\n", result [ i + ( PNVEC_MAX - 58 ) * 11 * n] );
            }
         } 

      } // end of j loop


   } // end of icurr loop
 
   fclose(ofp);

   exit(0);
}

	.text
	.file	"tfbs_main.hip"
	.globl	_Z26__device_stub__tfbs_kerneliiPcPiPfifS1_S1_ # -- Begin function _Z26__device_stub__tfbs_kerneliiPcPiPfifS1_S1_
	.type	_Z26__device_stub__tfbs_kerneliiPcPiPfifS1_S1_,@function
_Z26__device_stub__tfbs_kerneliiPcPiPfifS1_S1_: # @_Z26__device_stub__tfbs_kerneliiPcPiPfifS1_S1_
	.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	20(%rsp), %rax
	movl	%edi, (%rax)
	leaq	16(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	56(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	48(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	40(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	8(%rsp), %r9
	movss	%xmm0, (%r9)
	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)
	movq	%r9, 48(%rbx)
	leaq	224(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	232(%rsp), %rax
	movq	%rax, 64(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%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	$_Z11tfbs_kerneliiPcPiPfifS1_S1_, %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	_Z26__device_stub__tfbs_kerneliiPcPiPfifS1_S1_, .Lfunc_end0-_Z26__device_stub__tfbs_kerneliiPcPiPfifS1_S1_
	.cfi_endproc
                                        # -- End function
	.globl	_Z9tfbs_cudaPcPiiPfifS1_iS1_    # -- Begin function _Z9tfbs_cudaPcPiiPfifS1_iS1_
	.type	_Z9tfbs_cudaPcPiiPfifS1_iS1_,@function
_Z9tfbs_cudaPcPiiPfifS1_iS1_:           # @_Z9tfbs_cudaPcPiiPfifS1_iS1_
	.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	$72, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, 56(%rsp)                   # 8-byte Spill
	movss	%xmm0, 52(%rsp)                 # 4-byte Spill
	movl	%r8d, %r13d
	movq	%rcx, 64(%rsp)                  # 8-byte Spill
                                        # kill: def $edx killed $edx def $rdx
	movq	%rdx, (%rsp)                    # 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbp
	movslq	128(%rsp), %r15
	leaq	(,%r15,4), %r14
	leaq	32(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB1_1
# %bb.3:                                # %_Z9gpuAssert10hipError_tPKcib.exit
	movq	32(%rsp), %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB1_4
# %bb.5:                                # %_Z9gpuAssert10hipError_tPKcib.exit28
	movl	%r15d, %eax
	imull	(%rsp), %eax                    # 4-byte Folded Reload
	movslq	%eax, %r14
	leaq	40(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB1_6
# %bb.7:                                # %_Z9gpuAssert10hipError_tPKcib.exit30
	movq	40(%rsp), %rdi
	movq	%rbp, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB1_8
# %bb.9:                                # %_Z9gpuAssert10hipError_tPKcib.exit32
	leal	(,%r13,4), %eax
	movslq	%eax, %rbp
	shlq	$2, %rbp
	leaq	16(%rsp), %rdi
	movq	%rbp, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB1_10
# %bb.11:                               # %_Z9gpuAssert10hipError_tPKcib.exit34
	movq	16(%rsp), %rdi
	movq	64(%rsp), %rsi                  # 8-byte Reload
	movq	%rbp, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB1_12
# %bb.13:                               # %_Z9gpuAssert10hipError_tPKcib.exit36
	leaq	8(%rsp), %rdi
	movl	$16, %esi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB1_14
# %bb.15:                               # %_Z9gpuAssert10hipError_tPKcib.exit38
	movq	8(%rsp), %rdi
	movl	$16, %edx
	movq	56(%rsp), %rsi                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB1_16
# %bb.17:                               # %_Z9gpuAssert10hipError_tPKcib.exit40
	movq	(%rsp), %rax                    # 8-byte Reload
	leal	(%rax,%rax,2), %eax
	leal	-696(,%rax,4), %eax
	imull	%r15d, %eax
	movslq	%eax, %r12
	shlq	$2, %r12
	leaq	24(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB1_18
# %bb.19:                               # %_Z9gpuAssert10hipError_tPKcib.exit42
	leal	31(%r15), %edi
	testl	%r15d, %r15d
	cmovnsl	%r15d, %edi
	sarl	$5, %edi
	incl	%edi
	btsq	$32, %rdi
	movabsq	$4294967296, %rdx               # imm = 0x100000000
	orq	$32, %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_21
# %bb.20:
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rcx
	movq	16(%rsp), %r8
	movl	%r15d, %edi
	movq	(%rsp), %rsi                    # 8-byte Reload
                                        # kill: def $esi killed $esi killed $rsi
	movl	%r13d, %r9d
	movss	52(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	pushq	24(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	16(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	_Z26__device_stub__tfbs_kerneliiPcPiPfifS1_S1_
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
.LBB1_21:
	callq	hipPeekAtLastError
	testl	%eax, %eax
	jne	.LBB1_22
# %bb.23:                               # %_Z9gpuAssert10hipError_tPKcib.exit44
	movq	136(%rsp), %rdi
	movq	24(%rsp), %rsi
	movq	%r12, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB1_24
# %bb.25:                               # %_Z9gpuAssert10hipError_tPKcib.exit46
	movq	40(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	callq	hipFree
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB1_1:
	.cfi_def_cfa_offset 128
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.26, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$221, %r8d
	jmp	.LBB1_2
.LBB1_4:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.26, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$223, %r8d
	jmp	.LBB1_2
.LBB1_6:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.26, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$226, %r8d
	jmp	.LBB1_2
.LBB1_8:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.26, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$228, %r8d
	jmp	.LBB1_2
.LBB1_10:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.26, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$231, %r8d
	jmp	.LBB1_2
.LBB1_12:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.26, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$233, %r8d
	jmp	.LBB1_2
.LBB1_14:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.26, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$237, %r8d
	jmp	.LBB1_2
.LBB1_16:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.26, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$239, %r8d
	jmp	.LBB1_2
.LBB1_18:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.26, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$243, %r8d
	jmp	.LBB1_2
.LBB1_22:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.26, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$254, %r8d
	jmp	.LBB1_2
.LBB1_24:
	movl	%eax, %ebx
	movq	stderr(%rip), %r14
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.26, %esi
	movl	$.L.str, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$259, %r8d                      # imm = 0x103
.LBB1_2:
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebx, %edi
	callq	exit
.Lfunc_end1:
	.size	_Z9tfbs_cudaPcPiiPfifS1_iS1_, .Lfunc_end1-_Z9tfbs_cudaPcPiiPfifS1_iS1_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function main
.LCPI2_0:
	.long	0x3e800000                      # float 0.25
	.long	0x3e800000                      # float 0.25
	.long	0x3e800000                      # float 0.25
	.long	0x3e800000                      # float 0.25
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI2_1:
	.quad	0x3f70624dd2f1a9fc              # double 0.0040000000000000001
.LCPI2_2:
	.quad	0x3f50624dd2f1a9fc              # double 0.001
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$446296, %rsp                   # imm = 0x6CF58
	.cfi_def_cfa_offset 446352
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %rbx
	movaps	.LCPI2_0(%rip), %xmm0           # xmm0 = [2.5E-1,2.5E-1,2.5E-1,2.5E-1]
	movaps	%xmm0, 160(%rsp)
	movq	8(%rsi), %rdi
	callq	atoi
	movl	%eax, %ebp
	movq	16(%rbx), %rsi
	movl	$.L.str.1, %edi
	xorl	%eax, %eax
	callq	printf
	movq	24(%rbx), %rsi
	movl	$.L.str.2, %edi
	xorl	%eax, %eax
	callq	printf
	movq	32(%rbx), %rsi
	movl	$.L.str.3, %edi
	xorl	%eax, %eax
	callq	printf
	movq	40(%rbx), %rdx
	movq	%rbx, 40(%rsp)                  # 8-byte Spill
	movq	48(%rbx), %rcx
	leaq	656(%rsp), %rbx
	movl	$.L.str.4, %esi
	movq	%rbx, %rdi
	movl	%ebp, %r8d
	xorl	%eax, %eax
	callq	sprintf
	movl	$.L.str.5, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	printf
	movl	$15704, %edi                    # imm = 0x3D58
	callq	malloc
	movq	%rax, %r15
	movabsq	$4306080000, %rdi               # imm = 0x100A99100
	callq	malloc
	movq	%rax, %rbx
	movl	$206376, %edi                   # imm = 0x32628
	callq	malloc
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	testq	%rax, %rax
	jne	.LBB2_1
# %bb.49:
	movq	stderr(%rip), %rcx
	movl	$.L.str.6, %edi
	movl	$42, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movl	$1, %edi
	callq	exit
.LBB2_1:
	movl	$928692000, %edi                # imm = 0x375AB720
	callq	malloc
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	testq	%rax, %rax
	jne	.LBB2_2
# %bb.50:
	movq	stderr(%rip), %rcx
	movl	$.L.str.7, %edi
	movl	$38, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movl	$2, %edi
	callq	exit
.LBB2_2:
	movl	%ebp, 24(%rsp)                  # 4-byte Spill
	movq	%rbx, 88(%rsp)                  # 8-byte Spill
	movl	$.Lstr, %edi
	callq	puts@PLT
	movq	40(%rsp), %rax                  # 8-byte Reload
	movq	16(%rax), %rdi
	movl	$.L.str.9, %esi
	callq	fopen
	movq	%rax, %r14
	leaq	1680(%rsp), %rbx
	movq	%rbx, %rdi
	movl	$24000, %esi                    # imm = 0x5DC0
	movq	%rax, %rdx
	callq	fgets
	movq	%rbx, %rdi
	movl	$24000, %esi                    # imm = 0x5DC0
	movq	%r14, 8(%rsp)                   # 8-byte Spill
	movq	%r14, %rdx
	callq	fgets
	xorl	%r14d, %r14d
	movl	$0, %ebp
	testq	%rax, %rax
	je	.LBB2_23
# %bb.3:                                # %.lr.ph205.preheader
	leaq	1680(%rsp), %rbx
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
.LBB2_4:                                # %.lr.ph205
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_6 Depth 2
	movl	$.L.str.10, %esi
	movq	%rbx, %rdi
	callq	strtok
	leaq	(%rsp,%rbp,4), %rdx
	addq	$239920, %rdx                   # imm = 0x3A930
	movl	$.L.str.11, %esi
	movq	%rax, %rdi
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	movl	$.L.str.10, %esi
	xorl	%edi, %edi
	callq	strtok
	leaq	(%rsp,%rbp,4), %rdx
	addq	$33536, %rdx                    # imm = 0x8300
	movl	$.L.str.12, %esi
	movq	%rax, %rdi
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	movl	$.L.str.10, %esi
	xorl	%edi, %edi
	callq	strtok
	movl	$.L.str.10, %esi
	xorl	%edi, %edi
	callq	strtok
	movl	$.L.str.10, %esi
	xorl	%edi, %edi
	callq	strtok
	movl	$.L.str.10, %esi
	xorl	%edi, %edi
	callq	strtok
	movl	$.L.str.10, %esi
	xorl	%edi, %edi
	callq	strtok
	movl	$.L.str.10, %esi
	xorl	%edi, %edi
	callq	strtok
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	strlen
	movq	48(%rsp), %rcx                  # 8-byte Reload
	movl	%eax, (%rcx,%rbp,4)
	testl	%eax, %eax
	jle	.LBB2_22
# %bb.5:                                # %.lr.ph
                                        #   in Loop: Header=BB2_4 Depth=1
	movl	%r13d, %ecx
	andl	$-16, %ecx
	addq	80(%rsp), %rcx                  # 8-byte Folded Reload
	movl	%eax, %eax
	xorl	%edx, %edx
.LBB2_6:                                #   Parent Loop BB2_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movzbl	(%r12,%rdx), %edi
	movb	$1, %sil
	cmpl	$96, %edi
	jg	.LBB2_13
# %bb.7:                                #   in Loop: Header=BB2_6 Depth=2
	cmpl	$70, %edi
	jg	.LBB2_10
# %bb.8:                                #   in Loop: Header=BB2_6 Depth=2
	cmpl	$65, %edi
	je	.LBB2_21
# %bb.9:                                #   in Loop: Header=BB2_6 Depth=2
	cmpl	$67, %edi
	je	.LBB2_16
	jmp	.LBB2_12
.LBB2_13:                               #   in Loop: Header=BB2_6 Depth=2
	cmpl	$102, %edi
	jg	.LBB2_17
# %bb.14:                               #   in Loop: Header=BB2_6 Depth=2
	cmpl	$97, %edi
	je	.LBB2_21
# %bb.15:                               #   in Loop: Header=BB2_6 Depth=2
	cmpl	$99, %edi
	jne	.LBB2_12
.LBB2_16:                               #   in Loop: Header=BB2_6 Depth=2
	movb	$2, %sil
	jmp	.LBB2_21
.LBB2_10:                               #   in Loop: Header=BB2_6 Depth=2
	cmpl	$71, %edi
	je	.LBB2_20
# %bb.11:                               #   in Loop: Header=BB2_6 Depth=2
	cmpl	$84, %edi
	je	.LBB2_19
.LBB2_12:                               #   in Loop: Header=BB2_6 Depth=2
	xorl	%esi, %esi
	jmp	.LBB2_21
.LBB2_17:                               #   in Loop: Header=BB2_6 Depth=2
	cmpl	$103, %edi
	je	.LBB2_20
# %bb.18:                               #   in Loop: Header=BB2_6 Depth=2
	cmpl	$116, %edi
	jne	.LBB2_12
.LBB2_19:                               #   in Loop: Header=BB2_6 Depth=2
	movb	$4, %sil
	jmp	.LBB2_21
.LBB2_20:                               #   in Loop: Header=BB2_6 Depth=2
	movb	$3, %sil
.LBB2_21:                               #   in Loop: Header=BB2_6 Depth=2
	movb	%sil, (%rcx,%rdx)
	incq	%rdx
	cmpq	%rdx, %rax
	jne	.LBB2_6
.LBB2_22:                               # %._crit_edge
                                        #   in Loop: Header=BB2_4 Depth=1
	incq	%rbp
	movq	%rbx, %rdi
	movl	$24000, %esi                    # imm = 0x5DC0
	movq	8(%rsp), %rdx                   # 8-byte Reload
	callq	fgets
	addq	$18000, %r13                    # imm = 0x4650
	testq	%rax, %rax
	jne	.LBB2_4
.LBB2_23:                               # %._crit_edge206
	movq	8(%rsp), %rdi                   # 8-byte Reload
	callq	fclose
	movl	$.L.str.13, %edi
	movl	%ebp, %esi
	xorl	%eax, %eax
	callq	printf
	movq	40(%rsp), %rax                  # 8-byte Reload
	movq	24(%rax), %rdi
	movl	$.L.str.9, %esi
	callq	fopen
	movq	%rax, %rbx
	leaq	1680(%rsp), %rdi
	movl	$24000, %esi                    # imm = 0x5DC0
	movq	%rax, %rdx
	callq	fgets
	testq	%rax, %rax
	movl	24(%rsp), %ebp                  # 4-byte Reload
	je	.LBB2_26
# %bb.24:                               # %.lr.ph210.preheader
	xorl	%r14d, %r14d
	leaq	1680(%rsp), %r12
.LBB2_25:                               # %.lr.ph210
                                        # =>This Inner Loop Header: Depth=1
	movl	$.L.str.10, %esi
	movq	%r12, %rdi
	callq	strtok
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	strlen
	leaq	1(%rax), %rdi
	callq	malloc
	movq	%rax, (%r15,%r14,8)
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	strcpy
	movl	$.L.str.10, %esi
	xorl	%edi, %edi
	callq	strtok
	movq	%rax, %rdi
	callq	atof
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 25680(%rsp,%r14,4)
	incq	%r14
	movq	%r12, %rdi
	movl	$24000, %esi                    # imm = 0x5DC0
	movq	%rbx, %rdx
	callq	fgets
	testq	%rax, %rax
	jne	.LBB2_25
.LBB2_26:                               # %._crit_edge211
	movq	%rbx, %rdi
	callq	fclose
	movq	40(%rsp), %rax                  # 8-byte Reload
	movq	24(%rax), %rdx
	movl	$.L.str.14, %edi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	printf
	imull	$100, %ebp, %ebx
	movl	$1963, %r14d                    # imm = 0x7AB
	cmpl	%r14d, %ebx
	cmovll	%ebx, %r14d
	leaq	656(%rsp), %rdi
	movl	$.L.str.15, %esi
	callq	fopen
	testq	%rax, %rax
	jne	.LBB2_27
# %bb.51:
	movq	stderr(%rip), %rcx
	movl	$.L.str.16, %edi
	movl	$24, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movl	$3, %edi
	callq	exit
.LBB2_27:
	movq	%rax, %rbp
	addl	$-99, %ebx
	cmpl	%r14d, %ebx
	jg	.LBB2_48
# %bb.28:                               # %.lr.ph232
	addq	$-4, 48(%rsp)                   # 8-byte Folded Spill
	movslq	%ebx, %rbx
	incl	%r14d
	leaq	1680(%rsp), %r12
	movq	%r15, 96(%rsp)                  # 8-byte Spill
	movl	%r14d, 72(%rsp)                 # 4-byte Spill
.LBB2_29:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_31 Depth 2
                                        #     Child Loop BB2_35 Depth 2
                                        #     Child Loop BB2_37 Depth 2
                                        #       Child Loop BB2_39 Depth 3
                                        #         Child Loop BB2_43 Depth 4
	movl	$.L.str.17, %edi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	printf
	movq	40(%rsp), %rax                  # 8-byte Reload
	movq	32(%rax), %rdx
	movq	%rbx, 56(%rsp)                  # 8-byte Spill
	movq	-8(%r15,%rbx,8), %rcx
	movl	$.L.str.18, %esi
	leaq	656(%rsp), %rbx
	movq	%rbx, %rdi
	movq	%rcx, 64(%rsp)                  # 8-byte Spill
	xorl	%eax, %eax
	callq	sprintf
	movl	$.L.str.9, %esi
	movq	%rbx, %rdi
	callq	fopen
	movq	%rax, %rbx
	movq	%r12, %rdi
	movl	$24000, %esi                    # imm = 0x5DC0
	movq	%rax, %rdx
	callq	fgets
	movq	%r12, %rdi
	movl	$24000, %esi                    # imm = 0x5DC0
	movq	%rbx, %r15
	movq	%rbx, %rdx
	callq	fgets
	movl	$0, %ebx
	movl	$0, %r14d
	testq	%rax, %rax
	je	.LBB2_32
# %bb.30:                               # %.lr.ph217.preheader
                                        #   in Loop: Header=BB2_29 Depth=1
	xorl	%r14d, %r14d
	leaq	188(%rsp), %r13
	xorl	%ebx, %ebx
	movq	%r15, 24(%rsp)                  # 8-byte Spill
.LBB2_31:                               # %.lr.ph217
                                        #   Parent Loop BB2_29 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%r14d, 16(%rsp)                 # 4-byte Spill
	movl	$.L.str.10, %esi
	movq	%r12, %rdi
	callq	strtok
	movl	$.L.str.10, %esi
	xorl	%edi, %edi
	callq	strtok
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	atof
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, -12(%r13)
	movl	$.L.str.19, %esi
	movq	%r14, %rdi
	callq	strcmp
	movl	%eax, 8(%rsp)                   # 4-byte Spill
	movl	$.L.str.10, %esi
	xorl	%edi, %edi
	callq	strtok
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	atof
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, -8(%r13)
	movl	$.L.str.19, %esi
	movq	%r12, %rdi
	callq	strcmp
	movl	%eax, %r12d
	movl	$.L.str.10, %esi
	xorl	%edi, %edi
	callq	strtok
	movq	%r13, %r15
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	atof
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, -4(%r15)
	movl	$.L.str.19, %esi
	movq	%r13, %rdi
	callq	strcmp
	movl	%eax, %r13d
	movl	$.L.str.10, %esi
	xorl	%edi, %edi
	callq	strtok
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	atof
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r15)
	movl	$.L.str.20, %esi
	movq	%r14, %rdi
	movl	16(%rsp), %r14d                 # 4-byte Reload
	callq	strcmp
	cmpl	$0, 8(%rsp)                     # 4-byte Folded Reload
	movl	$1, %ecx
	cmovel	%ecx, %ebx
	testl	%r12d, %r12d
	leaq	1680(%rsp), %r12
	cmovel	%ecx, %ebx
	movq	24(%rsp), %rdx                  # 8-byte Reload
	testl	%r13d, %r13d
	movq	%r15, %r13
	cmovel	%ecx, %ebx
	testl	%eax, %eax
	cmovel	%ecx, %ebx
	movq	%r12, %rdi
	movl	$24000, %esi                    # imm = 0x5DC0
	movq	%rdx, %r15
	callq	fgets
	addq	$16, %r13
	incl	%r14d
	testq	%rax, %rax
	jne	.LBB2_31
.LBB2_32:                               # %._crit_edge218
                                        #   in Loop: Header=BB2_29 Depth=1
	movq	%r15, %rdi
	callq	fclose
	movl	$.L.str.14, %edi
	movl	%r14d, %esi
	movq	64(%rsp), %rdx                  # 8-byte Reload
	xorl	%eax, %eax
	callq	printf
	testl	%ebx, %ebx
	movsd	.LCPI2_1(%rip), %xmm5           # xmm5 = mem[0],zero
	movsd	.LCPI2_2(%rip), %xmm6           # xmm6 = mem[0],zero
	je	.LBB2_36
# %bb.33:                               # %._crit_edge218
                                        #   in Loop: Header=BB2_29 Depth=1
	testl	%r14d, %r14d
	je	.LBB2_36
# %bb.34:                               # %.lr.ph222.preheader
                                        #   in Loop: Header=BB2_29 Depth=1
	movl	%r14d, %eax
	shlq	$4, %rax
	xorl	%ecx, %ecx
.LBB2_35:                               # %.lr.ph222
                                        #   Parent Loop BB2_29 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	176(%rsp,%rcx), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	180(%rsp,%rcx), %xmm1           # xmm1 = mem[0],zero,zero,zero
	xorps	%xmm2, %xmm2
	cvtss2sd	%xmm0, %xmm2
	addss	%xmm1, %xmm0
	movss	184(%rsp,%rcx), %xmm3           # xmm3 = mem[0],zero,zero,zero
	addss	%xmm3, %xmm0
	movss	188(%rsp,%rcx), %xmm4           # xmm4 = mem[0],zero,zero,zero
	addss	%xmm4, %xmm0
	cvtss2sd	%xmm0, %xmm0
	addsd	%xmm5, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	addsd	%xmm6, %xmm2
	cvtss2sd	%xmm0, %xmm0
	divsd	%xmm0, %xmm2
	cvtsd2ss	%xmm2, %xmm2
	cvtss2sd	%xmm1, %xmm1
	addsd	%xmm6, %xmm1
	divsd	%xmm0, %xmm1
	cvtsd2ss	%xmm1, %xmm1
	movss	%xmm2, 176(%rsp,%rcx)
	movss	%xmm1, 180(%rsp,%rcx)
	xorps	%xmm1, %xmm1
	cvtss2sd	%xmm3, %xmm1
	addsd	%xmm6, %xmm1
	divsd	%xmm0, %xmm1
	cvtsd2ss	%xmm1, %xmm1
	xorps	%xmm2, %xmm2
	cvtss2sd	%xmm4, %xmm2
	addsd	%xmm6, %xmm2
	divsd	%xmm0, %xmm2
	xorps	%xmm0, %xmm0
	cvtsd2ss	%xmm2, %xmm0
	movss	%xmm1, 184(%rsp,%rcx)
	movss	%xmm0, 188(%rsp,%rcx)
	addq	$16, %rcx
	cmpq	%rcx, %rax
	jne	.LBB2_35
.LBB2_36:                               # %.loopexit
                                        #   in Loop: Header=BB2_29 Depth=1
	movl	%r14d, 16(%rsp)                 # 4-byte Spill
	movq	56(%rsp), %rax                  # 8-byte Reload
	movss	25676(%rsp,%rax,4), %xmm0       # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, 20(%rsp)                 # 4-byte Spill
	cvtss2sd	%xmm0, %xmm0
	movsd	%xmm0, 104(%rsp)                # 8-byte Spill
	movl	$1, %ecx
	movl	$5000, %edx                     # imm = 0x1388
	movl	$0, 36(%rsp)                    # 4-byte Folded Spill
.LBB2_37:                               #   Parent Loop BB2_29 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_39 Depth 3
                                        #         Child Loop BB2_43 Depth 4
	movl	$51594, %eax                    # imm = 0xC98A
	cmpl	%eax, %edx
	movl	$51594, %r14d                   # imm = 0xC98A
	movl	%edx, 76(%rsp)                  # 4-byte Spill
	cmovbl	%edx, %r14d
	movq	%rcx, 112(%rsp)                 # 8-byte Spill
	imulq	$5000, %rcx, %r15               # imm = 0x1388
	leaq	-5000(%r15), %r12
	cmpl	%eax, %r15d
	movl	$51594, %edx                    # imm = 0xC98A
	cmovbl	%r15d, %edx
	leaq	-4999(%r15), %rsi
	movl	%edx, %ebx
	subl	%esi, %ebx
	leal	1(%rbx), %r13d
	movl	$.L.str.21, %edi
	movq	%rsi, 144(%rsp)                 # 8-byte Spill
                                        # kill: def $esi killed $esi killed $rsi
	movsd	104(%rsp), %xmm0                # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	movq	%r12, 152(%rsp)                 # 8-byte Spill
	imulq	$18000, %r12, %rdi              # imm = 0x4650
	addq	80(%rsp), %rdi                  # 8-byte Folded Reload
	movq	48(%rsp), %rax                  # 8-byte Reload
	leaq	(%rax,%r15,4), %rsi
	addq	$-19996, %rsi                   # imm = 0xB1E4
	movl	$18000, %edx                    # imm = 0x4650
	leaq	176(%rsp), %rcx
	movl	16(%rsp), %r8d                  # 4-byte Reload
	movss	20(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	leaq	160(%rsp), %r9
	movq	88(%rsp), %r15                  # 8-byte Reload
	pushq	%r15
	.cfi_adjust_cfa_offset 8
	pushq	%r13
	.cfi_adjust_cfa_offset 8
	callq	_Z9tfbs_cudaPcPiiPfifS1_iS1_
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movq	stdout(%rip), %rdi
	callq	fflush
	testl	%ebx, %ebx
	js	.LBB2_46
# %bb.38:                               # %.lr.ph226
                                        #   in Loop: Header=BB2_37 Depth=2
	movq	%r15, %rbx
	addl	36(%rsp), %r14d                 # 4-byte Folded Reload
	imull	$35884, %r14d, %eax             # imm = 0x8C2C
	movl	%eax, 8(%rsp)                   # 4-byte Spill
	imull	$17942, %r14d, %r12d            # imm = 0x4616
	imull	$17942, %r13d, %eax             # imm = 0x4616
	imull	$35884, %r13d, %ecx             # imm = 0x8C2C
	imull	$53826, %r13d, %edx             # imm = 0xD242
	imull	$197362, %r13d, %esi            # imm = 0x302F2
	cltq
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	leaq	(%r15,%rcx,4), %rax
	movq	%rax, 128(%rsp)                 # 8-byte Spill
	leaq	(%r15,%rdx,4), %rax
	movq	%rax, 120(%rsp)                 # 8-byte Spill
	leaq	(%r15,%rsi,4), %rax
	movq	%rax, 136(%rsp)                 # 8-byte Spill
	xorl	%r14d, %r14d
.LBB2_39:                               #   Parent Loop BB2_29 Depth=1
                                        #     Parent Loop BB2_37 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB2_43 Depth 4
	cvttss2si	(%rbx,%r14,4), %ecx
	testl	%ecx, %ecx
	jg	.LBB2_42
# %bb.40:                               #   in Loop: Header=BB2_39 Depth=3
	movq	128(%rsp), %rax                 # 8-byte Reload
	movss	(%rax,%r14,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	ucomiss	20(%rsp), %xmm0                 # 4-byte Folded Reload
	ja	.LBB2_42
# %bb.41:                               #   in Loop: Header=BB2_39 Depth=3
	movq	120(%rsp), %rax                 # 8-byte Reload
	movss	(%rax,%r14,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	ucomiss	20(%rsp), %xmm0                 # 4-byte Folded Reload
	jbe	.LBB2_45
.LBB2_42:                               #   in Loop: Header=BB2_39 Depth=3
	movl	%r14d, %eax
	imulq	$245125767, %rax, %r13          # imm = 0xE9C5287
	shrq	$42, %r13
	imull	$17942, %r13d, %eax             # imm = 0x4616
	movl	%r14d, %r15d
	subl	%eax, %r15d
	movl	%r13d, %ebx
	movl	%ecx, 24(%rsp)                  # 4-byte Spill
	movl	239920(%rsp,%rbx,4), %edx
	movl	$.L.str.22, %esi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	callq	fprintf
	addq	152(%rsp), %rbx                 # 8-byte Folded Reload
	movl	33536(%rsp,%rbx,4), %eax
	movq	88(%rsp), %rbx                  # 8-byte Reload
	leal	(%r15,%rax), %edx
	addl	$30, %edx
	leal	(%r15,%rax), %ecx
	addl	$31, %ecx
	movl	$.L.str.23, %esi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	callq	fprintf
	addl	144(%rsp), %r13d                # 4-byte Folded Reload
	movl	$.L.str.23, %esi
	movq	%rbp, %rdi
	movl	%r13d, %edx
	movq	56(%rsp), %rcx                  # 8-byte Reload
                                        # kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	fprintf
	movl	$.L.str.22, %esi
	movq	%rbp, %rdi
	movl	24(%rsp), %edx                  # 4-byte Reload
	xorl	%eax, %eax
	callq	fprintf
	movl	$9, %r13d
	movl	8(%rsp), %eax                   # 4-byte Reload
	movl	%eax, %r15d
.LBB2_43:                               #   Parent Loop BB2_29 Depth=1
                                        #     Parent Loop BB2_37 Depth=2
                                        #       Parent Loop BB2_39 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movslq	%r15d, %r15
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbx,%r15,4), %xmm0
	movl	$.L.str.24, %esi
	movq	%rbp, %rdi
	movb	$1, %al
	callq	fprintf
	addl	%r12d, %r15d
	decq	%r13
	jne	.LBB2_43
# %bb.44:                               #   in Loop: Header=BB2_39 Depth=3
	movq	136(%rsp), %rax                 # 8-byte Reload
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rax,%r14,4), %xmm0
	movl	$.L.str.25, %esi
	movq	%rbp, %rdi
	movb	$1, %al
	callq	fprintf
.LBB2_45:                               #   in Loop: Header=BB2_39 Depth=3
	incq	%r14
	incl	8(%rsp)                         # 4-byte Folded Spill
	cmpq	64(%rsp), %r14                  # 8-byte Folded Reload
	jl	.LBB2_39
.LBB2_46:                               # %._crit_edge227
                                        #   in Loop: Header=BB2_37 Depth=2
	movq	112(%rsp), %rcx                 # 8-byte Reload
	incq	%rcx
	movl	76(%rsp), %edx                  # 4-byte Reload
	addl	$5000, %edx                     # imm = 0x1388
	addl	$-5000, 36(%rsp)                # 4-byte Folded Spill
                                        # imm = 0xEC78
	cmpq	$12, %rcx
	jne	.LBB2_37
# %bb.47:                               #   in Loop: Header=BB2_29 Depth=1
	movq	56(%rsp), %rbx                  # 8-byte Reload
	incq	%rbx
	movl	72(%rsp), %r14d                 # 4-byte Reload
	cmpl	%ebx, %r14d
	movq	96(%rsp), %r15                  # 8-byte Reload
	leaq	1680(%rsp), %r12
	jne	.LBB2_29
.LBB2_48:                               # %._crit_edge233
	movq	%rbp, %rdi
	callq	fclose
	xorl	%edi, %edi
	callq	exit
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z11tfbs_kerneliiPcPiPfifS1_S1_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.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	_Z11tfbs_kerneliiPcPiPfifS1_S1_,@object # @_Z11tfbs_kerneliiPcPiPfifS1_S1_
	.section	.rodata,"a",@progbits
	.globl	_Z11tfbs_kerneliiPcPiPfifS1_S1_
	.p2align	3, 0x0
_Z11tfbs_kerneliiPcPiPfifS1_S1_:
	.quad	_Z26__device_stub__tfbs_kerneliiPcPiPfifS1_S1_
	.size	_Z11tfbs_kerneliiPcPiPfifS1_S1_, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/fuxmanlab/altered_TFBS/master/tfbs_main.hip"
	.size	.L.str, 106

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Input file name: %s\n"
	.size	.L.str.1, 21

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"tf.info file name: %s\n"
	.size	.L.str.2, 23

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"pwm directory: %s\n"
	.size	.L.str.3, 19

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"./%s/%s_%03d.txt"
	.size	.L.str.4, 17

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Output file name: %s\n"
	.size	.L.str.5, 22

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"ERROR allocating pnvec_len: Out of memory\n"
	.size	.L.str.6, 43

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"ERROR allocating pnvec: Out of memory\n"
	.size	.L.str.7, 39

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

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

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"chr%d"
	.size	.L.str.11, 6

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"%d"
	.size	.L.str.12, 3

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	" Read %d lines from the input file\n"
	.size	.L.str.13, 36

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	" Read %d lines from %s file\n"
	.size	.L.str.14, 29

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"w"
	.size	.L.str.15, 2

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	" Can't open output file\n"
	.size	.L.str.16, 25

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	" icurr =%d\n"
	.size	.L.str.17, 12

	.type	.L.str.18,@object               # @.str.18
	.section	.rodata,"a",@progbits
.L.str.18:
	.asciz	"./%s/%s\000"
	.size	.L.str.18, 9

	.type	.L.str.19,@object               # @.str.19
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.19:
	.asciz	"0.0"
	.size	.L.str.19, 4

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"0.0\n"
	.size	.L.str.20, 5

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	" j = %d through %d; threshold = %f\n"
	.size	.L.str.21, 36

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"%d "
	.size	.L.str.22, 4

	.type	.L.str.23,@object               # @.str.23
.L.str.23:
	.asciz	"%d %d "
	.size	.L.str.23, 7

	.type	.L.str.24,@object               # @.str.24
.L.str.24:
	.asciz	"%.3f "
	.size	.L.str.24, 6

	.type	.L.str.25,@object               # @.str.25
.L.str.25:
	.asciz	"%.3f\n"
	.size	.L.str.25, 6

	.type	.L.str.26,@object               # @.str.26
.L.str.26:
	.asciz	"GPUassert: %s %s %d\n"
	.size	.L.str.26, 21

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z11tfbs_kerneliiPcPiPfifS1_S1_"
	.size	.L__unnamed_1, 32

	.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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"Reading Input files"
	.size	.Lstr, 20

	.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 _Z26__device_stub__tfbs_kerneliiPcPiPfifS1_S1_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z11tfbs_kerneliiPcPiPfifS1_S1_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z11tfbs_kerneliiPcPiPfifS1_S1_ ; -- Begin function _Z11tfbs_kerneliiPcPiPfifS1_S1_
	.globl	_Z11tfbs_kerneliiPcPiPfifS1_S1_
	.p2align	8
	.type	_Z11tfbs_kerneliiPcPiPfifS1_S1_,@function
_Z11tfbs_kerneliiPcPiPfifS1_S1_:        ; @_Z11tfbs_kerneliiPcPiPfifS1_S1_
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x44
	s_load_b64 s[2:3], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s4, s4, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s4, v[0:1]
	s_mov_b32 s4, exec_lo
	v_cmpx_gt_i32_e64 s2, v1
	s_cbranch_execz .LBB0_37
; %bb.1:                                ; %.preheader372
	s_load_b128 s[20:23], s[0:1], 0x8
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s22, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s23, v3, vcc_lo
	global_load_b32 v0, v[2:3], off
	s_waitcnt vmcnt(0)
	v_cmp_lt_i32_e32 vcc_lo, 58, v0
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB0_37
; %bb.2:                                ; %.preheader371.lr.ph
	s_load_b256 s[12:19], s[0:1], 0x18
	v_mul_lo_u32 v8, v1, s3
	v_mul_lo_u32 v2, 0xffffffc6, v1
	v_subrev_nc_u32_e32 v9, 30, v0
	v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v10, 1.0
	s_mov_b32 s11, 0
	s_mov_b32 s38, 29
	s_mov_b32 s37, s11
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_nc_u32_e32 v12, 29, v8
	v_add3_u32 v11, v8, v2, 0xffffffe3
	s_waitcnt lgkmcnt(0)
	v_subrev_nc_u32_e32 v0, s14, v8
	s_cmp_gt_i32 s14, 0
	s_cselect_b32 s9, -1, 0
	s_sub_i32 s29, s3, 58
	s_add_u32 s28, s12, 16
	v_add_nc_u32_e32 v13, 30, v0
	s_mul_i32 s29, s29, s2
	s_addc_u32 s30, s13, 0
	s_add_u32 s31, s16, 16
	s_addc_u32 s33, s17, 0
	s_mul_i32 s34, s29, 3
	s_mul_i32 s35, s29, 5
	s_mul_i32 s36, s29, 7
	s_add_i32 s10, s14, -1
.LBB0_3:                                ; %.preheader371
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
                                        ;       Child Loop BB0_6 Depth 3
	v_dual_mov_b32 v14, 0xc7c34f80 :: v_dual_mov_b32 v15, 0xc7c34f80
	v_dual_mov_b32 v18, 0xc7c34f80 :: v_dual_mov_b32 v19, 0xc7c34f80
	v_dual_mov_b32 v20, 0xc7c34f80 :: v_dual_mov_b32 v21, 0xc7c34f80
	v_dual_mov_b32 v22, 0xc7c34f80 :: v_dual_mov_b32 v23, 0xc7c34f80
	v_dual_mov_b32 v16, 0xc7c34f80 :: v_dual_mov_b32 v17, 0xc7c34f80
	s_and_not1_b32 vcc_lo, exec_lo, s9
	s_cbranch_vccnz .LBB0_12
; %bb.4:                                ; %.preheader.preheader
                                        ;   in Loop: Header=BB0_3 Depth=1
	v_ashrrev_i32_e32 v0, 31, v12
	v_add_co_u32 v2, vcc_lo, s20, v12
	v_dual_mov_b32 v14, 0xc7c34f80 :: v_dual_mov_b32 v15, 0xc7c34f80
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v3, vcc_lo, s21, v0, vcc_lo
	v_dual_mov_b32 v6, v13 :: v_dual_mov_b32 v19, 0xc7c34f80
	v_dual_mov_b32 v18, 0xc7c34f80 :: v_dual_mov_b32 v21, 0xc7c34f80
	v_dual_mov_b32 v20, 0xc7c34f80 :: v_dual_mov_b32 v23, 0xc7c34f80
	v_dual_mov_b32 v22, 0xc7c34f80 :: v_dual_mov_b32 v17, 0xc7c34f80
	v_mov_b32_e32 v16, 0xc7c34f80
	s_mov_b32 s39, 0
	s_mov_b64 s[22:23], 0
	s_mov_b64 s[24:25], s[10:11]
.LBB0_5:                                ; %.preheader
                                        ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_6 Depth 3
	v_ashrrev_i32_e32 v0, 31, v6
	v_add_co_u32 v24, vcc_lo, s20, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_dual_mov_b32 v5, v3 :: v_dual_mov_b32 v26, 0
	v_dual_mov_b32 v7, 0 :: v_dual_mov_b32 v4, v2
	v_add_co_ci_u32_e32 v25, vcc_lo, s21, v0, vcc_lo
	v_dual_mov_b32 v27, 0 :: v_dual_mov_b32 v28, 0
	v_dual_mov_b32 v29, 0 :: v_dual_mov_b32 v30, 0
	v_dual_mov_b32 v31, 0 :: v_dual_mov_b32 v32, 0
	v_dual_mov_b32 v33, 0 :: v_dual_mov_b32 v34, 0
	s_mov_b32 s40, 0
	s_mov_b32 s41, 0
	s_mov_b64 s[26:27], 0
                                        ; implicit-def: $sgpr42
.LBB0_6:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_5 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	s_delay_alu instid0(SALU_CYCLE_1)
	v_add_co_u32 v35, vcc_lo, v24, s26
	v_add_co_ci_u32_e32 v36, vcc_lo, s27, v25, vcc_lo
	v_mov_b32_e32 v0, 0
	v_dual_mov_b32 v38, 0 :: v_dual_mov_b32 v39, 0
	global_load_i8 v44, v[35:36], off
	v_dual_mov_b32 v35, 0 :: v_dual_mov_b32 v36, 0
	v_dual_mov_b32 v37, 0 :: v_dual_mov_b32 v40, 0
	v_dual_mov_b32 v41, 0 :: v_dual_mov_b32 v42, 0
	v_mov_b32_e32 v43, 0
	s_or_b32 s42, s42, exec_lo
	s_mov_b32 s43, exec_lo
	s_waitcnt vmcnt(0)
	v_cmpx_lt_i16_e32 0, v44
	s_cbranch_execz .LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=3
	global_load_i8 v45, v[4:5], off
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v35, 0
	v_dual_mov_b32 v36, 0 :: v_dual_mov_b32 v37, 0
	v_dual_mov_b32 v38, 0 :: v_dual_mov_b32 v39, 0
	v_dual_mov_b32 v40, 0 :: v_dual_mov_b32 v41, 0
	v_dual_mov_b32 v42, 0 :: v_dual_mov_b32 v43, 0
	s_mov_b32 s0, -1
	s_mov_b32 s44, exec_lo
	s_waitcnt vmcnt(0)
	v_cmpx_lt_i16_e32 0, v45
	s_cbranch_execz .LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=3
	v_add_nc_u16 v0, v44, -1
	v_and_b32_e32 v37, 0xff, v45
	s_ashr_i32 s0, s41, 31
	s_add_i32 s1, s22, s26
	s_cmp_eq_u32 s24, s26
	v_and_b32_e32 v38, 0xff, v0
	v_sub_co_u32 v39, s2, s41, v37
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_sub_co_ci_u32_e64 v40, null, s0, 0, s2
	v_add_nc_u32_e32 v0, s41, v38
	s_cselect_b32 s0, -1, 0
	v_sub_nc_u32_e32 v50, 4, v37
	s_delay_alu instid0(VALU_DEP_3)
	v_lshlrev_b64 v[39:40], 2, v[39:40]
	v_cndmask_b32_e64 v49, v38, 0, s0
	v_lshlrev_b64 v[35:36], 2, v[0:1]
	v_lshlrev_b32_e32 v0, 2, v38
	s_cmp_eq_u32 s1, 0
	v_lshlrev_b32_e32 v37, 2, v37
	s_cselect_b32 s1, -1, 0
	v_lshlrev_b32_e32 v51, 2, v49
	v_add_co_u32 v41, vcc_lo, s12, v35
	v_add_co_ci_u32_e32 v42, vcc_lo, s13, v36, vcc_lo
	v_add_co_u32 v39, vcc_lo, s28, v39
	global_load_b32 v35, v0, s[16:17]
	v_add_nc_u32_e32 v0, s41, v49
	v_add_co_ci_u32_e32 v40, vcc_lo, s30, v40, vcc_lo
	v_cndmask_b32_e64 v43, v50, 3, s1
	global_load_b32 v36, v[41:42], off
	v_sub_co_u32 v45, s2, s31, v37
	global_load_b32 v37, v[39:40], off
	v_lshlrev_b64 v[41:42], 2, v[0:1]
	v_add_nc_u32_e32 v47, s41, v43
	v_sub_co_ci_u32_e64 v46, null, s33, 0, s2
	v_ashrrev_i32_e32 v44, 31, v43
	v_cndmask_b32_e64 v52, v38, 1, s0
	v_add_co_u32 v41, vcc_lo, s12, v41
	v_ashrrev_i32_e32 v48, 31, v47
	v_add_co_ci_u32_e32 v42, vcc_lo, s13, v42, vcc_lo
	global_load_b32 v40, v[45:46], off
	global_load_b32 v39, v[41:42], off
	v_lshlrev_b64 v[41:42], 2, v[47:48]
	v_lshlrev_b64 v[43:44], 2, v[43:44]
	v_cndmask_b32_e64 v45, v50, 2, s1
	v_add_nc_u32_e32 v0, s41, v52
	v_cndmask_b32_e64 v59, v38, 2, s0
	s_add_u32 s26, s26, 1
	v_add_co_u32 v41, vcc_lo, s12, v41
	v_add_co_ci_u32_e32 v42, vcc_lo, s13, v42, vcc_lo
	v_add_co_u32 v43, vcc_lo, s16, v43
	v_add_co_ci_u32_e32 v44, vcc_lo, s17, v44, vcc_lo
	global_load_b32 v55, v51, s[16:17]
	global_load_b32 v41, v[41:42], off
	global_load_b32 v42, v[43:44], off
	v_add_nc_u32_e32 v46, s41, v45
	v_lshlrev_b64 v[48:49], 2, v[0:1]
	s_addc_u32 s27, s27, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v47, 31, v46
	v_lshlrev_b64 v[43:44], 2, v[46:47]
	v_ashrrev_i32_e32 v46, 31, v45
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_add_co_u32 v47, vcc_lo, s12, v48
	v_add_co_ci_u32_e32 v48, vcc_lo, s13, v49, vcc_lo
	v_add_co_u32 v43, vcc_lo, s12, v43
	s_delay_alu instid0(VALU_DEP_4)
	v_lshlrev_b64 v[45:46], 2, v[45:46]
	v_cndmask_b32_e64 v49, v50, 1, s1
	v_add_co_ci_u32_e32 v44, vcc_lo, s13, v44, vcc_lo
	s_clause 0x1
	global_load_b32 v56, v[47:48], off
	global_load_b32 v58, v[43:44], off
	v_add_nc_u32_e32 v47, s41, v49
	v_add_co_u32 v44, vcc_lo, s16, v45
	v_add_co_ci_u32_e32 v45, vcc_lo, s17, v46, vcc_lo
	v_cndmask_b32_e64 v43, v50, 0, s1
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v48, 31, v47
	v_ashrrev_i32_e32 v50, 31, v49
	global_load_b32 v60, v[44:45], off
	v_add_nc_u32_e32 v46, s41, v43
	v_ashrrev_i32_e32 v44, 31, v43
	v_lshlrev_b64 v[43:44], 2, v[43:44]
	s_waitcnt vmcnt(5)
	v_div_scale_f32 v61, s1, v39, v55, v39
	s_waitcnt vmcnt(3)
	v_div_scale_f32 v65, s2, v41, v42, v41
	v_lshlrev_b32_e32 v0, 2, v52
	v_lshlrev_b64 v[51:52], 2, v[47:48]
	v_lshlrev_b64 v[48:49], 2, v[49:50]
	v_ashrrev_i32_e32 v47, 31, v46
	v_div_scale_f32 v64, null, v42, v42, v41
	global_load_b32 v57, v0, s[16:17]
	v_add_co_u32 v50, vcc_lo, s12, v51
	v_add_co_ci_u32_e32 v51, vcc_lo, s13, v52, vcc_lo
	v_lshlrev_b64 v[45:46], 2, v[46:47]
	v_add_co_u32 v47, vcc_lo, s16, v48
	v_add_co_ci_u32_e32 v48, vcc_lo, s17, v49, vcc_lo
	global_load_b32 v49, v[50:51], off
	global_load_b32 v47, v[47:48], off
	v_div_scale_f32 v52, null, v35, v35, v36
	v_add_co_u32 v45, vcc_lo, s12, v45
	v_add_co_ci_u32_e32 v46, vcc_lo, s13, v46, vcc_lo
	v_add_co_u32 v43, vcc_lo, s16, v43
	v_add_co_ci_u32_e32 v44, vcc_lo, s17, v44, vcc_lo
	global_load_b32 v48, v[45:46], off
	global_load_b32 v50, v[43:44], off
	s_waitcnt vmcnt(5)
	v_div_scale_f32 v68, null, v60, v60, v58
	v_div_scale_f32 v69, s4, v58, v60, v58
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v76, v68
	s_waitcnt_depctr 0xfff
	v_fma_f32 v88, -v68, v76, 1.0
	v_dual_fmac_f32 v76, v88, v76 :: v_dual_lshlrev_b32 v51, 2, v59
	v_add_nc_u32_e32 v0, s41, v59
	v_rcp_f32_e32 v59, v52
	s_waitcnt_depctr 0xfff
	v_fma_f32 v74, -v52, v59, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v59, v74, v59
	v_cndmask_b32_e64 v38, v38, 3, s0
	s_waitcnt vmcnt(4)
	v_div_scale_f32 v66, null, v57, v57, v56
	v_div_scale_f32 v67, s3, v56, v57, v56
	v_rcp_f32_e32 v75, v66
	s_waitcnt vmcnt(2)
	v_div_scale_f32 v70, null, v47, v47, v49
	v_div_scale_f32 v71, s5, v49, v47, v49
	s_waitcnt_depctr 0xfff
	v_fma_f32 v87, -v66, v75, 1.0
	v_rcp_f32_e32 v79, v70
	s_delay_alu instid0(VALU_DEP_1)
	v_fmac_f32_e32 v75, v87, v75
	s_waitcnt vmcnt(0)
	v_div_scale_f32 v72, null, v50, v50, v48
	s_waitcnt_depctr 0xfff
	v_fma_f32 v89, -v70, v79, 1.0
	v_div_scale_f32 v73, s6, v48, v50, v48
	v_rcp_f32_e32 v80, v72
	s_delay_alu instid0(VALU_DEP_2)
	v_fmac_f32_e32 v79, v89, v79
	v_mul_f32_e32 v89, v69, v76
	v_lshlrev_b64 v[53:54], 2, v[0:1]
	v_add_nc_u32_e32 v0, s41, v38
	s_add_i32 s41, s41, 4
	s_cmp_eq_u32 s14, s26
	v_fma_f32 v93, -v68, v89, v69
	v_lshlrev_b32_e32 v38, 2, v38
	v_add_co_u32 v43, vcc_lo, s12, v53
	v_lshlrev_b64 v[45:46], 2, v[0:1]
	s_delay_alu instid0(VALU_DEP_4)
	v_fmac_f32_e32 v89, v93, v76
	v_add_co_ci_u32_e32 v44, vcc_lo, s13, v54, vcc_lo
	global_load_b32 v0, v[43:44], off
	global_load_b32 v51, v51, s[16:17]
	v_add_co_u32 v43, vcc_lo, s12, v45
	v_add_co_ci_u32_e32 v44, vcc_lo, s13, v46, vcc_lo
	global_load_b32 v38, v38, s[16:17]
	global_load_b32 v43, v[43:44], off
	v_div_scale_f32 v44, null, v40, v40, v37
	v_add_co_u32 v4, vcc_lo, v4, -1
	v_add_co_ci_u32_e32 v5, vcc_lo, -1, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_rcp_f32_e32 v46, v44
	v_div_scale_f32 v53, vcc_lo, v36, v35, v36
	v_div_scale_f32 v54, null, v55, v55, v39
	v_div_scale_f32 v45, s0, v37, v40, v37
	v_mul_f32_e32 v85, v53, v59
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(TRANS32_DEP_2)
	v_rcp_f32_e32 v63, v54
	v_fma_f32 v91, -v72, v80, 1.0
	v_fma_f32 v62, -v44, v46, 1.0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v92, -v52, v85, v53
	v_fmac_f32_e32 v46, v62, v46
	v_rcp_f32_e32 v62, v64
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(TRANS32_DEP_2)
	v_fmac_f32_e32 v85, v92, v59
	v_fma_f32 v81, -v54, v63, 1.0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mul_f32_e32 v74, v45, v46
	v_fma_f32 v52, -v52, v85, v53
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fmac_f32_e32 v63, v81, v63
	v_fma_f32 v86, -v44, v74, v45
	s_delay_alu instid0(TRANS32_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_fma_f32 v81, -v64, v62, 1.0
	v_div_fmas_f32 v52, v52, v59, v85
	s_mov_b32 vcc_lo, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_3) | instid1(VALU_DEP_4)
	v_fmac_f32_e32 v74, v86, v46
	v_mul_f32_e32 v86, v61, v63
	v_fmac_f32_e32 v62, v81, v62
	v_div_fixup_f32 v35, v52, v35, v36
	v_fma_f32 v44, -v44, v74, v45
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_fma_f32 v45, -v54, v86, v61
	v_mul_f32_e32 v87, v65, v62
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cmp_gt_f32_e64 s0, 0x800000, v35
	v_div_fmas_f32 v44, v44, v46, v74
	s_mov_b32 vcc_lo, s1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_div_fixup_f32 v37, v44, v40, v37
	v_cndmask_b32_e64 v40, 1.0, 0x4f800000, s0
	v_fmac_f32_e32 v86, v45, v63
	v_fma_f32 v45, -v64, v87, v65
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cmp_gt_f32_e64 s1, 0x800000, v37
	v_mul_f32_e32 v35, v35, v40
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_fma_f32 v54, -v54, v86, v61
	v_fmac_f32_e32 v87, v45, v62
	v_cndmask_b32_e64 v40, 0, 0x41b17218, s0
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_log_f32_e32 v35, v35
	v_div_fmas_f32 v36, v54, v63, v86
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_fma_f32 v46, -v64, v87, v65
	s_mov_b32 vcc_lo, s2
	v_fma_f32 v54, -v68, v89, v69
	v_div_fixup_f32 v36, v36, v55, v39
	s_delay_alu instid0(VALU_DEP_3)
	v_div_fmas_f32 v39, v46, v62, v87
	v_cndmask_b32_e64 v46, 1.0, 0x4f800000, s1
	v_mul_f32_e32 v88, v67, v75
	s_mov_b32 vcc_lo, s3
	v_cmp_gt_f32_e64 s0, 0x800000, v36
	v_div_fixup_f32 v39, v39, v42, v41
	v_mul_f32_e32 v37, v37, v46
	v_fma_f32 v53, -v66, v88, v67
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v55, 1.0, 0x4f800000, s0
	v_log_f32_e32 v37, v37
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v88, v53, v75
	v_mul_f32_e32 v36, v36, v55
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v52, -v66, v88, v67
	v_log_f32_e32 v36, v36
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_div_fmas_f32 v52, v52, v75, v88
	s_mov_b32 vcc_lo, s4
	v_div_fmas_f32 v54, v54, v76, v89
	v_div_fixup_f32 v46, v52, v57, v56
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v57, 0x3f317217, v36
	v_div_fixup_f32 v52, v54, v60, v58
	v_cndmask_b32_e64 v54, 0, 0x41b17218, s0
	v_cmp_gt_f32_e64 s0, 0x800000, v39
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v55, 1.0, 0x4f800000, s0
	v_mul_f32_e32 v39, v39, v55
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_log_f32_e32 v39, v39
	s_waitcnt vmcnt(2)
	v_div_scale_f32 v77, null, v51, v51, v0
	v_div_scale_f32 v78, s7, v0, v51, v0
	s_mov_b32 vcc_lo, s7
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_4) | instid1(VALU_DEP_3)
	v_rcp_f32_e32 v82, v77
	s_waitcnt vmcnt(0)
	v_div_scale_f32 v83, null, v38, v38, v43
	v_div_scale_f32 v84, s8, v43, v38, v43
	v_fmac_f32_e32 v80, v91, v80
	v_rcp_f32_e32 v90, v83
	s_waitcnt_depctr 0xfff
	v_fma_f32 v81, -v77, v82, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_fmac_f32 v82, v81, v82 :: v_dual_mul_f32 v81, v71, v79
	v_fma_f32 v91, -v83, v90, 1.0
	v_fma_f32 v95, -v70, v81, v71
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v90, v91, v90
	v_dual_fmac_f32 v81, v95, v79 :: v_dual_mul_f32 v94, v78, v82
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v53, v84, v90
	v_fma_f32 v45, -v77, v94, v78
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fma_f32 v59, -v83, v53, v84
	v_mul_f32_e32 v92, v73, v80
	v_fmac_f32_e32 v94, v45, v82
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fmac_f32_e32 v53, v59, v90
	v_fma_f32 v91, -v72, v92, v73
	v_fma_f32 v45, -v70, v81, v71
	v_fma_f32 v59, 0x3f317217, v36, -v57
	v_fma_f32 v44, -v77, v94, v78
	v_fma_f32 v41, -v83, v53, v84
	v_fmac_f32_e32 v92, v91, v80
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_fmac_f32_e32 v59, 0x3377d1cf, v36
	v_div_fmas_f32 v42, v44, v82, v94
	s_mov_b32 vcc_lo, s5
	s_delay_alu instid0(VALU_DEP_3)
	v_fma_f32 v61, -v72, v92, v73
	v_cndmask_b32_e64 v44, 0, 0x41b17218, s1
	v_cmp_gt_f32_e64 s1, 0x800000, v46
	v_div_fmas_f32 v45, v45, v79, v81
	s_mov_b32 vcc_lo, s8
	v_div_fixup_f32 v0, v42, v51, v0
	v_div_fmas_f32 v41, v41, v90, v53
	s_mov_b32 vcc_lo, s6
	v_cndmask_b32_e64 v42, 1.0, 0x4f800000, s1
	v_div_fmas_f32 v51, v61, v80, v92
	v_div_fixup_f32 v45, v45, v47, v49
	v_cndmask_b32_e64 v49, 0, 0x41b17218, s0
	v_cmp_gt_f32_e64 s0, 0x800000, v0
	v_mul_f32_e32 v42, v46, v42
	v_div_fixup_f32 v46, v51, v50, v48
	v_mul_f32_e32 v51, 0x3f317217, v35
	v_cmp_gt_f32_e32 vcc_lo, 0x800000, v52
	v_div_fixup_f32 v38, v41, v38, v43
	v_cndmask_b32_e64 v41, 1.0, 0x4f800000, s0
	v_cndmask_b32_e64 v43, 0, 0x41b17218, s1
	v_fma_f32 v56, 0x3f317217, v35, -v51
	v_cndmask_b32_e64 v47, 1.0, 0x4f800000, vcc_lo
	v_cmp_gt_f32_e64 s1, 0x800000, v45
	v_cndmask_b32_e64 v50, 0, 0x41b17218, vcc_lo
	v_cmp_gt_f32_e32 vcc_lo, 0x800000, v38
	v_fmac_f32_e32 v56, 0x3377d1cf, v35
	v_mul_f32_e32 v47, v52, v47
	v_cndmask_b32_e64 v48, 1.0, 0x4f800000, s1
	v_mul_f32_e32 v53, 0x3f317217, v37
	v_cndmask_b32_e64 v52, 1.0, 0x4f800000, vcc_lo
	v_add_f32_e32 v51, v51, v56
	v_log_f32_e32 v42, v42
	v_mul_f32_e32 v0, v0, v41
	v_cndmask_b32_e64 v41, 0, 0x41b17218, s0
	v_cmp_gt_f32_e64 s0, 0x800000, v46
	v_mul_f32_e32 v45, v45, v48
	v_log_f32_e32 v47, v47
	v_cndmask_b32_e64 v48, 0, 0x41b17218, s1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v55, 1.0, 0x4f800000, s0
	v_log_f32_e32 v45, v45
	s_delay_alu instid0(TRANS32_DEP_3)
	v_mul_f32_e32 v61, 0x3f317217, v42
	v_log_f32_e32 v58, v0
	v_mul_f32_e32 v38, v38, v52
	v_fma_f32 v0, 0x3f317217, v37, -v53
	v_cndmask_b32_e64 v52, 0, 0x41b17218, vcc_lo
	v_mul_f32_e32 v46, v46, v55
	v_cmp_gt_f32_e64 vcc_lo, 0x7f800000, |v35|
	v_cndmask_b32_e64 v55, 0, 0x41b17218, s0
	v_fmac_f32_e32 v0, 0x3377d1cf, v37
	v_mul_f32_e32 v64, 0x3f317217, v45
	v_log_f32_e32 v46, v46
	v_mul_f32_e32 v63, 0x3f317217, v58
	v_log_f32_e32 v38, v38
	v_mul_f32_e32 v60, 0x3f317217, v39
	v_dual_cndmask_b32 v35, v35, v51 :: v_dual_add_f32 v0, v53, v0
	v_add_f32_e32 v51, v57, v59
	v_cmp_gt_f32_e64 vcc_lo, 0x7f800000, |v37|
	v_mul_f32_e32 v62, 0x3f317217, v47
	v_fma_f32 v53, 0x3f317217, v42, -v61
	v_fma_f32 v59, 0x3f317217, v58, -v63
	v_sub_f32_e32 v35, v35, v40
	s_delay_alu instid0(TRANS32_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_mul_f32_e32 v57, 0x3f317217, v38
	v_fma_f32 v56, 0x3f317217, v39, -v60
	v_dual_cndmask_b32 v0, v37, v0 :: v_dual_fmac_f32 v59, 0x3377d1cf, v58
	v_cmp_gt_f32_e64 vcc_lo, 0x7f800000, |v36|
	s_delay_alu instid0(VALU_DEP_3)
	v_dual_fmac_f32 v53, 0x3377d1cf, v42 :: v_dual_fmac_f32 v56, 0x3377d1cf, v39
	v_mul_f32_e32 v37, 0x3f317217, v46
	v_fma_f32 v65, 0x3f317217, v47, -v62
	v_cndmask_b32_e32 v36, v36, v51, vcc_lo
	v_fma_f32 v51, 0x3f317217, v38, -v57
	v_dual_add_f32 v40, v60, v56 :: v_dual_add_f32 v7, v7, v35
	v_cmp_gt_f32_e64 vcc_lo, 0x7f800000, |v39|
	v_fma_f32 v66, 0x3f317217, v45, -v64
	v_dual_fmac_f32 v65, 0x3377d1cf, v47 :: v_dual_sub_f32 v0, v0, v44
	v_dual_fmac_f32 v51, 0x3377d1cf, v38 :: v_dual_add_f32 v44, v61, v53
	v_sub_f32_e32 v35, v36, v54
	v_fma_f32 v53, 0x3f317217, v46, -v37
	v_cndmask_b32_e32 v36, v39, v40, vcc_lo
	v_cmp_gt_f32_e64 vcc_lo, 0x7f800000, |v42|
	v_fmac_f32_e32 v66, 0x3377d1cf, v45
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_dual_add_f32 v56, v62, v65 :: v_dual_fmac_f32 v53, 0x3377d1cf, v46
	v_dual_add_f32 v39, v63, v59 :: v_dual_cndmask_b32 v40, v42, v44
	v_cmp_gt_f32_e64 vcc_lo, 0x7f800000, |v47|
	v_dual_add_f32 v26, v26, v0 :: v_dual_add_f32 v37, v37, v53
	v_add_f32_e32 v42, v64, v66
	s_cselect_b32 s0, -1, 0
	v_cndmask_b32_e32 v44, v47, v56, vcc_lo
	v_cmp_gt_f32_e64 vcc_lo, 0x7f800000, |v58|
	v_add_f32_e32 v47, v57, v51
	s_or_not1_b32 s0, s0, exec_lo
	v_cndmask_b32_e32 v39, v58, v39, vcc_lo
	v_cmp_gt_f32_e64 vcc_lo, 0x7f800000, |v45|
	v_sub_f32_e32 v36, v36, v49
	v_add_f32_e32 v34, v34, v35
	v_dual_mov_b32 v35, v26 :: v_dual_cndmask_b32 v42, v45, v42
	v_cmp_gt_f32_e64 vcc_lo, 0x7f800000, |v38|
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_dual_add_f32 v33, v33, v36 :: v_dual_cndmask_b32 v36, v38, v47
	v_cmp_gt_f32_e64 vcc_lo, 0x7f800000, |v46|
	v_sub_f32_e32 v38, v39, v41
	v_dual_cndmask_b32 v37, v46, v37 :: v_dual_mov_b32 v0, v7
	v_sub_f32_e32 v37, v37, v55
	v_sub_f32_e32 v40, v40, v43
	v_sub_f32_e32 v43, v44, v50
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f32_e32 v27, v27, v37
	v_add_f32_e32 v31, v31, v43
	v_sub_f32_e32 v39, v42, v48
	v_mov_b32_e32 v43, v34
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_dual_add_f32 v29, v29, v39 :: v_dual_add_f32 v30, v30, v38
	v_add_f32_e32 v32, v32, v40
	v_mov_b32_e32 v40, v31
	v_dual_mov_b32 v38, v29 :: v_dual_mov_b32 v39, v30
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mov_b32_e32 v41, v32
	v_sub_f32_e32 v36, v36, v52
	v_add_f32_e32 v28, v28, v36
	v_mov_b32_e32 v42, v33
	s_delay_alu instid0(VALU_DEP_2)
	v_dual_mov_b32 v36, v27 :: v_dual_mov_b32 v37, v28
.LBB0_9:                                ; %Flow584
                                        ;   in Loop: Header=BB0_6 Depth=3
	s_or_b32 exec_lo, exec_lo, s44
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s1, s42, exec_lo
	s_and_b32 s0, s0, exec_lo
	s_or_b32 s42, s1, s0
.LBB0_10:                               ; %Flow583
                                        ;   in Loop: Header=BB0_6 Depth=3
	s_or_b32 exec_lo, exec_lo, s43
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, exec_lo, s42
	s_or_b32 s40, s0, s40
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s40
	s_cbranch_execnz .LBB0_6
; %bb.11:                               ; %._crit_edge
                                        ;   in Loop: Header=BB0_5 Depth=2
	s_or_b32 exec_lo, exec_lo, s40
	v_cmp_lt_f32_e32 vcc_lo, v17, v0
	s_add_i32 s39, s39, 1
	s_add_u32 s22, s22, -1
	s_addc_u32 s23, s23, -1
	v_dual_cndmask_b32 v17, v17, v0 :: v_dual_add_nc_u32 v6, 1, v6
	v_cmp_lt_f32_e32 vcc_lo, v16, v35
	s_add_u32 s24, s24, -1
	s_addc_u32 s25, s25, -1
	s_cmp_eq_u32 s39, s14
	v_cndmask_b32_e32 v16, v16, v35, vcc_lo
	v_cmp_lt_f32_e32 vcc_lo, v23, v43
	v_cndmask_b32_e32 v23, v23, v43, vcc_lo
	v_cmp_lt_f32_e32 vcc_lo, v22, v42
	v_cndmask_b32_e32 v22, v22, v42, vcc_lo
	v_cmp_lt_f32_e32 vcc_lo, v21, v41
	v_cndmask_b32_e32 v21, v21, v41, vcc_lo
	v_cmp_lt_f32_e32 vcc_lo, v20, v40
	v_cndmask_b32_e32 v20, v20, v40, vcc_lo
	v_cmp_lt_f32_e32 vcc_lo, v19, v39
	v_cndmask_b32_e32 v19, v19, v39, vcc_lo
	v_cmp_lt_f32_e32 vcc_lo, v18, v38
	v_cndmask_b32_e32 v18, v18, v38, vcc_lo
	v_cmp_lt_f32_e32 vcc_lo, v15, v37
	v_cndmask_b32_e32 v15, v15, v37, vcc_lo
	v_cmp_lt_f32_e32 vcc_lo, v14, v36
	v_cndmask_b32_e32 v14, v14, v36, vcc_lo
	v_add_co_u32 v2, vcc_lo, v2, 1
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v3, vcc_lo
	s_cbranch_scc0 .LBB0_5
.LBB0_12:                               ; %._crit_edge426
                                        ;   in Loop: Header=BB0_3 Depth=1
	v_add_nc_u32_e32 v4, s38, v11
	s_add_i32 s2, s38, 1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f32_i32_e32 v30, s2
	v_add_nc_u32_e32 v5, s29, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v24, s29, v5
	v_ashrrev_i32_e32 v6, 31, v5
	v_add_nc_u32_e32 v2, s29, v24
	v_ashrrev_i32_e32 v25, 31, v24
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[5:6], 2, v[5:6]
	v_ashrrev_i32_e32 v3, 31, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[24:25], 2, v[24:25]
	v_add_co_u32 v26, vcc_lo, s18, v5
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_ci_u32_e32 v27, vcc_lo, s19, v6, vcc_lo
	v_lshlrev_b64 v[5:6], 2, v[2:3]
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_4)
	v_add_co_u32 v24, vcc_lo, s18, v24
	v_add_co_ci_u32_e32 v25, vcc_lo, s19, v25, vcc_lo
	v_max_f32_e32 v3, v22, v22
	v_add_co_u32 v28, vcc_lo, s18, v5
	v_dual_max_f32 v5, v23, v23 :: v_dual_add_nc_u32 v0, s38, v8
	v_add_co_ci_u32_e32 v29, vcc_lo, s19, v6, vcc_lo
	s_clause 0x2
	global_store_b32 v[26:27], v30, off
	global_store_b32 v[24:25], v17, off
	global_store_b32 v[28:29], v16, off
	v_max_f32_e32 v3, v5, v3
	v_ashrrev_i32_e32 v7, 31, v0
	v_add_co_u32 v6, vcc_lo, s20, v0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cmp_nle_f32_e64 s0, s15, v3
	v_add_co_ci_u32_e32 v7, vcc_lo, s21, v7, vcc_lo
	global_load_u8 v0, v[6:7], off
	s_waitcnt vmcnt(0)
	v_cmp_eq_u16_e64 s1, 1, v0
	v_cmp_ne_u16_e32 vcc_lo, 1, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	s_or_b32 s1, s0, s1
	s_mov_b32 s0, 0
	s_and_saveexec_b32 s3, s1
	s_xor_b32 s3, exec_lo, s3
	s_cbranch_execz .LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
	v_ashrrev_i32_e32 v5, 31, v4
	v_dual_max_f32 v0, v16, v16 :: v_dual_max_f32 v3, v17, v17
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[24:25], 2, v[4:5]
	v_max_f32_e32 v0, v3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v24, s1, s18, v24
	v_cmp_lt_f32_e64 s0, s15, v0
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_ci_u32_e64 v25, s1, s19, v25, s1
	s_and_b32 s0, s0, vcc_lo
	global_store_b32 v[24:25], v1, off
	s_and_b32 s0, s0, exec_lo
.LBB0_14:                               ; %Flow579
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_and_not1_saveexec_b32 s1, s3
	s_cbranch_execz .LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_3 Depth=1
	v_ashrrev_i32_e32 v5, 31, v4
	s_or_b32 s0, s0, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[24:25], 2, v[4:5]
	v_add_co_u32 v24, vcc_lo, s18, v24
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v25, vcc_lo, s19, v25, vcc_lo
	global_store_b32 v[24:25], v10, off
.LBB0_16:                               ; %Flow580
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_and_saveexec_b32 s1, s0
; %bb.17:                               ; %.sink.split
                                        ;   in Loop: Header=BB0_3 Depth=1
	v_add_nc_u32_e32 v24, s29, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v26, s29, v24
	v_ashrrev_i32_e32 v25, 31, v24
	v_ashrrev_i32_e32 v27, 31, v26
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[24:25], 2, v[24:25]
	v_lshlrev_b64 v[26:27], 2, v[26:27]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v24, vcc_lo, s18, v24
	v_add_co_ci_u32_e32 v25, vcc_lo, s19, v25, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v26, vcc_lo, s18, v26
	v_add_co_ci_u32_e32 v27, vcc_lo, s19, v27, vcc_lo
	s_clause 0x1
	global_store_b32 v[24:25], v23, off
	global_store_b32 v[26:27], v22, off
; %bb.18:                               ;   in Loop: Header=BB0_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	global_load_u8 v0, v[6:7], off
	v_max_f32_e32 v3, v20, v20
	v_max_f32_e32 v5, v21, v21
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_max_f32_e32 v3, v5, v3
	v_cmp_nle_f32_e64 s0, s15, v3
	s_waitcnt vmcnt(0)
	v_cmp_eq_u16_e64 s1, 2, v0
	v_cmp_ne_u16_e32 vcc_lo, 2, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	s_or_b32 s1, s0, s1
	s_mov_b32 s0, 0
	s_and_saveexec_b32 s3, s1
	s_xor_b32 s1, exec_lo, s3
; %bb.19:                               ;   in Loop: Header=BB0_3 Depth=1
	v_dual_max_f32 v0, v16, v16 :: v_dual_max_f32 v3, v17, v17
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_max_f32_e32 v0, v3, v0
	v_cmp_lt_f32_e64 s0, s15, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, s0, vcc_lo
	s_and_b32 s0, s0, exec_lo
; %bb.20:                               ; %Flow576
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_and_not1_saveexec_b32 s1, s1
	s_cbranch_execz .LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_3 Depth=1
	v_ashrrev_i32_e32 v5, 31, v4
	s_or_b32 s0, s0, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[22:23], 2, v[4:5]
	v_add_co_u32 v22, vcc_lo, s18, v22
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v23, vcc_lo, s19, v23, vcc_lo
	global_load_b32 v0, v[22:23], off
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v0, 0x41200000, v0
	global_store_b32 v[22:23], v0, off
.LBB0_22:                               ; %Flow577
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_and_saveexec_b32 s1, s0
; %bb.23:                               ; %.sink.split459
                                        ;   in Loop: Header=BB0_3 Depth=1
	v_add_nc_u32_e32 v22, s34, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v24, s29, v22
	v_ashrrev_i32_e32 v23, 31, v22
	v_ashrrev_i32_e32 v25, 31, v24
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[22:23], 2, v[22:23]
	v_lshlrev_b64 v[24:25], 2, v[24:25]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v22, vcc_lo, s18, v22
	v_add_co_ci_u32_e32 v23, vcc_lo, s19, v23, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v24, vcc_lo, s18, v24
	v_add_co_ci_u32_e32 v25, vcc_lo, s19, v25, vcc_lo
	s_clause 0x1
	global_store_b32 v[22:23], v21, off
	global_store_b32 v[24:25], v20, off
; %bb.24:                               ;   in Loop: Header=BB0_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	global_load_u8 v0, v[6:7], off
	v_max_f32_e32 v3, v18, v18
	v_max_f32_e32 v5, v19, v19
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_max_f32_e32 v3, v5, v3
	v_cmp_nle_f32_e64 s0, s15, v3
	s_waitcnt vmcnt(0)
	v_cmp_eq_u16_e64 s1, 3, v0
	v_cmp_ne_u16_e32 vcc_lo, 3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	s_or_b32 s1, s0, s1
	s_mov_b32 s0, 0
	s_and_saveexec_b32 s3, s1
	s_xor_b32 s1, exec_lo, s3
; %bb.25:                               ;   in Loop: Header=BB0_3 Depth=1
	v_dual_max_f32 v0, v16, v16 :: v_dual_max_f32 v3, v17, v17
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_max_f32_e32 v0, v3, v0
	v_cmp_lt_f32_e64 s0, s15, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, s0, vcc_lo
	s_and_b32 s0, s0, exec_lo
; %bb.26:                               ; %Flow573
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_and_not1_saveexec_b32 s1, s1
	s_cbranch_execz .LBB0_28
; %bb.27:                               ;   in Loop: Header=BB0_3 Depth=1
	v_ashrrev_i32_e32 v5, 31, v4
	s_or_b32 s0, s0, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[20:21], 2, v[4:5]
	v_add_co_u32 v20, vcc_lo, s18, v20
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v21, vcc_lo, s19, v21, vcc_lo
	global_load_b32 v0, v[20:21], off
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v0, 0x42c80000, v0
	global_store_b32 v[20:21], v0, off
.LBB0_28:                               ; %Flow574
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_and_saveexec_b32 s1, s0
; %bb.29:                               ; %.sink.split462
                                        ;   in Loop: Header=BB0_3 Depth=1
	v_add_nc_u32_e32 v20, s35, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v22, s29, v20
	v_ashrrev_i32_e32 v21, 31, v20
	v_ashrrev_i32_e32 v23, 31, v22
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[20:21], 2, v[20:21]
	v_lshlrev_b64 v[22:23], 2, v[22:23]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v20, vcc_lo, s18, v20
	v_add_co_ci_u32_e32 v21, vcc_lo, s19, v21, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v22, vcc_lo, s18, v22
	v_add_co_ci_u32_e32 v23, vcc_lo, s19, v23, vcc_lo
	s_clause 0x1
	global_store_b32 v[20:21], v19, off
	global_store_b32 v[22:23], v18, off
; %bb.30:                               ;   in Loop: Header=BB0_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	global_load_u8 v0, v[6:7], off
	v_max_f32_e32 v3, v14, v14
	v_max_f32_e32 v5, v15, v15
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_max_f32_e32 v3, v5, v3
	v_cmp_nle_f32_e64 s0, s15, v3
	s_waitcnt vmcnt(0)
	v_cmp_eq_u16_e64 s1, 4, v0
	v_cmp_ne_u16_e32 vcc_lo, 4, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	s_or_b32 s1, s0, s1
	s_mov_b32 s0, 0
	s_and_saveexec_b32 s3, s1
	s_xor_b32 s1, exec_lo, s3
; %bb.31:                               ;   in Loop: Header=BB0_3 Depth=1
	v_dual_max_f32 v0, v16, v16 :: v_dual_max_f32 v3, v17, v17
                                        ; implicit-def: $vgpr4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_max_f32_e32 v0, v3, v0
	v_cmp_lt_f32_e64 s0, s15, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, s0, vcc_lo
	s_and_b32 s0, s0, exec_lo
; %bb.32:                               ; %Flow
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_and_not1_saveexec_b32 s1, s1
	s_cbranch_execz .LBB0_34
; %bb.33:                               ;   in Loop: Header=BB0_3 Depth=1
	v_ashrrev_i32_e32 v5, 31, v4
	s_or_b32 s0, s0, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[3:4], 2, v[4:5]
	v_add_co_u32 v3, vcc_lo, s18, v3
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v4, vcc_lo, s19, v4, vcc_lo
	global_load_b32 v0, v[3:4], off
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v0, 0x447a0000, v0
	global_store_b32 v[3:4], v0, off
.LBB0_34:                               ; %Flow571
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_and_saveexec_b32 s1, s0
; %bb.35:                               ; %.sink.split465
                                        ;   in Loop: Header=BB0_3 Depth=1
	v_add_nc_u32_e32 v2, s36, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v4, s29, v2
	v_ashrrev_i32_e32 v3, 31, v2
	v_ashrrev_i32_e32 v5, 31, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[2:3], 2, v[2:3]
	v_lshlrev_b64 v[4:5], 2, v[4:5]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v2, vcc_lo, s18, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s19, v3, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v4, vcc_lo, s18, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s19, v5, vcc_lo
	s_clause 0x1
	global_store_b32 v[2:3], v15, off
	global_store_b32 v[4:5], v14, off
; %bb.36:                               ;   in Loop: Header=BB0_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	v_cmp_eq_u32_e32 vcc_lo, s38, v9
	v_add_nc_u32_e32 v12, 1, v12
	v_add_nc_u32_e32 v13, 1, v13
	s_mov_b32 s38, s2
	s_or_b32 s37, vcc_lo, s37
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s37
	s_cbranch_execnz .LBB0_3
.LBB0_37:                               ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11tfbs_kerneliiPcPiPfifS1_S1_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 312
		.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 96
		.amdhsa_next_free_sgpr 45
		.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	_Z11tfbs_kerneliiPcPiPfifS1_S1_, .Lfunc_end0-_Z11tfbs_kerneliiPcPiPfifS1_S1_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 4956
; NumSgprs: 47
; NumVgprs: 96
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 5
; VGPRBlocks: 11
; NumSGPRsForWavesPerEU: 47
; NumVGPRsForWavesPerEU: 96
; 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
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .offset:         4
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     by_value
      - .offset:         36
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         48
        .size:           8
        .value_kind:     global_buffer
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         60
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         64
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         68
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         70
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         72
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         74
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         76
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         78
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         112
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         120
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 312
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11tfbs_kerneliiPcPiPfifS1_S1_
    .private_segment_fixed_size: 0
    .sgpr_count:     47
    .sgpr_spill_count: 0
    .symbol:         _Z11tfbs_kerneliiPcPiPfifS1_S1_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     96
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
