#include <assert.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

/*!
 *	\brief calculate normalized frequency matrix 
 *
 *   Normalized value(x) = \f$ \frac{ X - min }{ max - min }\f$
 *	\return normalized matrix
 *	
 */
int normalize( 
        int *in_mat,     /*!< [in] input matrix */
        float *out_mat,     /*!< [out] output matrix */
        int in_rows,     /*!< [in] number of rows in the input matrix */
        int in_columns    /*!< [in] number of columns in the output matrix */
        )
{
    int i,j;
    int max, min;
    for ( i=0; i<in_rows; i++)
    {
        max = INT_MIN;
        min = INT_MAX;
        for ( j=0;j<in_columns; j++)
        {
            if( min > in_mat[ (i*in_columns)+j ] )
                min = in_mat[ (i*in_columns)+j ] ;

            if( max < in_mat[ (i*in_columns)+j ] )
                max = in_mat[ (i*in_columns)+j ];
        }
        for (  j=0; j<in_columns; j++)
        {
            out_mat[(i*in_columns)+j] =(float)(in_mat[(i*in_columns)+j] - min)/(float)(max-min)   ;
        }
    }
    return 0;
}

/*!
 *	\brief Calculates the total frequency of each file for each class
 *
 *	function goes through all the files, calculates total frequency of each total 
 *	frequency for each file is stored in last column of the output matrix
 *	in_mat:
 *	    numfiles X totalnumopcodes matrix, containing frequency of each opcode
 *	out_mat:
 *	    numclass X totalnumopcodes+1 matrix, containing total frequency of each opcode and
 *	    each file in last column
 *	in_inrows:
 *	    = numfiles
 *	in_incolumns:
 *	    = totalnumopcodes
 *	in_outrows:
 *	    = number of classes 
 *
 *	\return modified outmat contains total frequency for each opcode and each file
 *	
 */
int createClassWiseData( 
        int *in_mat,     /*!< [in] input matrix */
        int *out_mat,     /*!< [out] output matrix */
        int in_rows,     /*!< [in] number of rows in input matrix */
        int in_columns,     /*!< [in] number of columns in input matrix */
        int in_outrows    /*!< [in] number of rows in output matrix */
        )
{
    int i,j;
    int sum=0;
    // for each file
    for (  i=0; i<in_rows; i++)
    {
        sum = 0;
        // for each opcode
        for ( j=0; j<in_columns-1; j++)
        {
            // add the frequency for each opcode
            out_mat[ (i*in_columns)+j ] += in_mat [ (i*in_columns)+j ];
            // save the frequency for total collection
            sum += in_mat[ (i*in_columns)+j ];
        }
        out_mat[j] = sum;
    }
    return 0;
}

/*!
 *	\brief gives probability of occurrence of each opcode in each class
 *
 *   takes as input a matrix containing normalized frequencies of each opcode in a file, 
 *   probability of opcode occurring in a class is found, by adding frequencies of each
 *   opcode in each file of each class and then dividing by sum of all frequencies in that
 *   class. We take log so the values are in a smaller range
 *
 *	in_inmat:
 *	    numfiles X totalnumopcodes matrix, has normalized frequency value for each opcode
 *
 *	in_cvect:
 *	    numfiles in length, contains,class ,the current row in in_inmat belongs to
 *
 *	in_inrows:
 *	    = numfiles
 *
 *	in_incolumns:
 *	    = totalnumopcodes
 *
 *	in_outrows:
 *	    = number of classes 
 *
 *	in_outcolumns:
 *	    = totalnumopcodes
 *
 *	out_outmat:
 *	    in_outrows X in_outcolumns, probability of each opcode in each class
 *
 *	out_cprob:
 *	    probability of each class
 *
 *	\return out_outmat is the modified matrix which contains the required probabilities
 *	
 */
int createProbablityMatrix( 
        int     *in_inmat,    /*!< [in] input matrix */
        float   *out_outmat,    /*!< [out] output matrix */
        int     *in_cvect,    /*!< [in] class vector */
        float   *out_cprob,    /*!< [out] probability of each class */
        int     in_inrows,    /*!< [in] number of rows in input matrix */
        int     in_incolumns,    /*!< [in] number of columns in input matrix */
        int     in_outrows,    /*!< [in] number of rows in output matrix */
        int     in_outcolumns    /*!< [in] number of columns in output matrix */
        )
{
#define  INDEX(i,j,cols) ((i*cols)+j)
    int i,j;
    int cls;
    float *class_wise_total=(float*) calloc(sizeof(float),in_outrows);
    assert(class_wise_total != NULL );
    // For each file
    for ( i=0; i<in_inrows; i++)
    {
        // get class for current file
        cls = in_cvect[ i ];
        // For each opcode
        for ( j=0; j<in_outcolumns; j++)
        {
            // add frequency of each opcode to appropriate a class opcode
            out_outmat[ INDEX(cls,j,in_outcolumns) ] +=   (float)in_inmat[ INDEX(i,j,in_incolumns) ];
            // add frequency to current class frequency
            class_wise_total [ cls ] +=   (float)in_inmat[ INDEX(i,j,in_incolumns) ];
        }
        // increase the count of file in current class
        out_cprob[ cls ] += 1;
    }
    // For each class
    for ( i=0; i<in_outrows; i++)
    {
        // For each opcode
        for ( j=0; j<in_outcolumns; j++)
        {
            // store the probability of current opcode
            float temp = (log10((out_outmat[ INDEX(i,j,in_outcolumns) ]+1) / (class_wise_total[ i ]+1) ));
            out_outmat[ INDEX(i,j,in_outcolumns) ] = (-1)*temp; // multiply by -1, because log[0-1] < 0
        }
        // save probability of current class
        out_cprob[ i ] = (-1)*log10(out_cprob[ i ]/ in_inrows); // multiply by -1 because log[0-1] < 0
    }
    free(class_wise_total);
    return 0;
#undef INDEX
}

/*!
 *	\brief Displays the float matrix
 *
 *   Should not be used on huge matrices
 *
 *	\return 
 *	
 */
void printFloatMatrix(
        float *in_mat,     /*!< [in] pointer to the matrix */
        int in_rows,     /*!< [in] number of rows in the matrix */
        int in_columns    /*!< [in] number of columns in the matrix */
        )
{
    int i,j;
    for ( i=0; i<in_rows; i++)
    {
        for ( j=0; j<in_columns; j++)
        {
            printf(" %f",in_mat[ (i*in_columns)+j ]);
        }
        printf("\n");
    }
}

/*!
 *	\brief Displays the int matrix
 *
 *   Should not be used on huge matrices
 *
 *	\return 
 *	
 */
void printIntMatrix( 
        int *in_mat,     /*!< [in] pointer to the matrix */
        int in_rows,     /*!< [in] number of rows in the matrix */
        int in_columns    /*!< [in] number of columns in the matrix */
        )
{
    int i,j;
    for ( i=0; i<in_rows; i++)
    {
        for ( j=0; j<in_columns; j++)
        {
            printf(" %d",in_mat[ (i*in_columns)+j ]);
        }
        printf("\n");
    }
}

/*!
 *	\brief Assigns class to all the test files
 *
 *   takes a matrix of normalized frequency values for each test file, and probability
 *   matrix for each opcode of each class, calculates probability of each opcode for each
 *   class, assigns a class to a file with maximum probability
 *
 *   in_mat:
 *       numfiles X total_number_of_opcodes matrix, containing normalized frequencies
 *
 *   in_cprob:
 *       numclass wide vector, containing probability of each class
 *
 *   out_pridict:
 *       numfiles wide vector, containing assigned class for each file
 *
 *   in_rows:
 *       numfiles
 *
 *   in_classes:
 *       numclasses
 *
 *   in_columns:
 *       total number of opcodes
 *
 *	\return predicted class vector
 *	
 */
void assignClass( 
        int *in_mat,     /*!< [in] input matrix */
        float *in_prob,     /*!< [in] probability matrix */
        float *in_cprob,     /*!< [in] class probability matrix */
        int *out_pridict,     /*!< [out] predicted class */
        int in_rows,     /*!< [in] number of input rows */
        int in_classes,     /*!< [in] number of classes */
        int in_columns    /*!< [in] number of columns */
        )
{
#define  INDEX(i,j,cols) ((i*cols)+j)
    int i,j,k;
    double *classprob =  (double*) calloc( sizeof(double), in_classes);
    // for each file
    for ( i=0; i<in_rows; i++)
    {
        // for each class
        for ( k=0; k<in_classes; k++)
            classprob[ k ] = in_cprob[k];
        // for each opcode
        for ( j=0; j<in_columns; j++)
        {

            // for each class
            for ( k=0; k<in_classes; k++)
            {
                // for opcodes having normalized frequency greater than 1
                if ( in_mat [ INDEX(i,j,in_columns) ] > 0 ) 
                {
                    // add the probability to current class ( add because we already have
                    // log10 of those values)
                    // TODO remove multiplication and check
                    classprob[ k ] += in_mat [ INDEX(i,j,in_columns) ]*in_prob [ INDEX(k,j,in_columns) ];
                }
            }
        }
        int maxClass=0;
        // for each class 
        for ( k=0; k<in_classes; k++)
        {
            // save the max class
            if( classprob[ maxClass ] > classprob[k] )
                maxClass = k;
        }
        // assign the max class
        out_pridict[i] = maxClass;
    }
    free(classprob);
#undef INDEX
}

/*!
 *	\brief creates a int matrix of row X column dimensions
 *
 *   This is actually a vector of size rows X columns X sizeof(int)
 *   use the traditional way for accessing the vector elements
 *
 *	\return pointer to the allocated matrix
 *	
 */
int* createIntMatrix( 
        int in_rows,      /*!< [in] number of rows in the matrix */
        int in_columns    /*!< [in] number of columns in the matrix */
        )
{
    int *temp = (int*) calloc ( sizeof(int) , in_rows*in_columns );
    return temp;
}

/*!
 *	\brief creates a float matrix of row X column dimensions
 *
 *   This is actually a vector of size rows X columns X sizeof(float)
 *   use the traditional way for accessing the vector elements
 *
 *	\return pointer to the allocated matrix
 *	
 */
float* createFloatMatrix(
        int in_rows,      /*!< [in] number of rows in the matrix */
        int in_columns    /*!< [in] number of columns in the matrix */
        )
{
    float *temp = (float*) calloc( sizeof(float), in_columns*in_rows);
    return temp;
}

/*!
 *	\brief creates a integer vector of length size
 *
 *   More Details ...
 *	\return pointer to the newly created vector
 *	
 */
int *createVector(
        int in_size      /*!< [in] length of the vector */
        )    
{
    int *temp = (int*) calloc( sizeof(int), in_size);
    return temp;
}


/*!
 *	\brief Gives accuracy of current configuration
 *
 *   More Details ...
 *
 *	\return ratio of correct predictions to number of predictions
 *	
 */
float getAccuracy( 
        int *in_pmat,   /*!< [in] predicated class vector */
        int *in_cvect,  /*!< [in] actual class vector */
        int in_total    /*!< [in] length of the vector */
        )
{
    int i;
    float ans=0.0;
    for ( i=0; i<in_total; i++)
    {
        if( in_pmat[i] == in_cvect[i])
            ans ++;
    }
    return ans/in_total;
}

/*!
 *	\brief  Gives transpose of a matrix
 *
 *   The rows of in_mat are converted to columns of the out_mat, and columns of in_mat are
 *   converted to rows of out_mat
 *                                                                                       
 *	in_mat    =   in_rows      X   in_columns
 *
 *	out_mat   =   in_columns   X   in_rows
 *
 *	\return transpose of a matrix in out_mat
 *	
 */
void rotateMatrix( 
        int *in_mat,     /*!< [in] input matrix */
        int *out_mat,    /*!< [out] output matrix */
        int in_rows,     /*!< [in] number of rows in input matrix */
        int in_columns   /*!< [in] number of columns in output matrix */
        )
{
    int outcolumns=in_rows;
    int i,j;

    for ( i=0; i<in_rows; i++)
    {
        for ( j=0;j<in_columns;j++)
        {
            out_mat[ j*outcolumns + i ] = in_mat[ i*in_columns+j ];
        }
    }
}
void rotateMatrixF( 
        float *in_mat,     /*!< [in] input matrix */
        float *out_mat,    /*!< [out] output matrix */
        int in_rows,     /*!< [in] number of rows in input matrix */
        int in_columns   /*!< [in] number of columns in output matrix */
        )
{
    int outcolumns=in_rows;
    int i,j;

    for ( i=0; i<in_rows; i++)
    {
        for ( j=0;j<in_columns;j++)
        {
            out_mat[ j*outcolumns + i ] = in_mat[ i*in_columns+j ];
        }
    }
}

/*!
 *	\brief Gives the probablity for the current in_val
 *
 *   probability = \f$ \frac{1}{\sqrt{2\Pi\sigma^{2}}}\exp^{\frac{(x-\mu)^{2}}{2\sigma^{2}}} \f$
 *
 *	\return probablity in float
 *	\see 
 *	
 */
float getTheProbablity( 
        float in_vval,  /*!< [in] x as in above formulae */
        float in_vmean, /*!< [in] mean value */
        float in_vvar   /*!< [in] variance value */
        )
{

    float result=0.0;
    float val1 =  1/sqrt( 2.0* M_PI* in_vvar);
    float val2 = (in_vval-in_vmean)*(in_vval-in_vmean)/(2.0*in_vvar);
    val2 = 1 / exp( val2);
    result = log10( val1*val2);
    if( isnan(result) || isinf(result) ) return 0.0;
    return result;
}

/*!
 *	\brief Assigns class to the test inputs
 *
 *   For all the test files in testArray, gets the group index from in_group_index( which
 *   is decided based on file size), selects the probablites from in_trainMatrix only for
 *   those opcodes whose normalized occurances are greater than 0
 *   
 *   in_trainMatrix:
 *     four rows in in_trainMatrix are considered as one row, structure is as follows
 *
 *   |               |         |          | in_num_opcodes number of columns |
 *   |:-------------:|:-------:|:--------:|:--------------------------------:|
 *   | group [0-99]  | benign  | mean     |                                  |
 *   | in_num_groups |         | variance |                                  |
 *   |               | malware | mean     |                                  |
 *   |               |         | variance |                                  |
 *
 *    in_testMatrix:
 *   |                 | in_num_opcodes number of columns |
 *   |:---------------:|:--------------------------------:|
 *   | inumber of rows=n_numtestfiles  ||
 *
 *   in_group_index:
 *   has in_numtestfiles number of values containg group number of file, can be thought of
 *   extra column in in_testMatrix 
 *
 *   \return predicted class for files in in_testMatrix
 *	  
 */
void assignClassUsingMeanVarianceData(
        float *in_trainMatrix, /*!< [in] trained probablity matrix */
        float *in_testMatrix,  /*!< [in] testing matrix */
        int in_num_groups,     /*!< [in] number of groups / number of rows in train matrix */
        int in_num_opcodes,    /*!< [in] number of opcodes / number of columns in test,train matrix */
        int in_numtestfiles,   /*!< [in] number of test files / number of rows in test matrix */
        int *in_group_index,   /*!< [in] vector containing group index of each file in test matrix( 1:1 mapping) */
        int *out_predict_vect  /*!< [out] predicted class  */
        )

{
    int i,j;
    float pmal=0.0, pben=0.0;
    int mean =0, var =1; /// \todo make this genric or avoid it somehow
    float vmean =0, vvar =1;
    int index=0;
    // Iterate through each file in in_testMatrix
    for ( i=0; i<in_numtestfiles; i++)
    {
        index = in_group_index[i]*4;
        pmal=0.0; 
        pben=0.0;
        // For all the opcodes
        for ( j=0; j<in_num_opcodes; j++)
        {
            // If any opcode in current file has normalized freq > 0
            if( in_testMatrix[i*in_num_opcodes+j] > 0 ) 
            {
                // get vmean and var considering it is a benign
                vmean = in_trainMatrix[(index+0+mean)*in_num_opcodes+j];
                vvar  = in_trainMatrix[(index+0+var )*in_num_opcodes+j];
                assert( vmean >= 0.0f && vvar >= 0.0f );
                // add the probablity in benign
                pben += getTheProbablity( in_testMatrix[i*in_num_opcodes+j], vmean, vvar);

                // get vmean and var considering it is a malware
                vmean = in_trainMatrix[(index+2+mean)*in_num_opcodes+j];
                vvar  = in_trainMatrix[(index+2+var )*in_num_opcodes+j];
                assert( vmean >= 0.0f && vvar >= 0.0f );
                // add the probablity in malware
                pmal += getTheProbablity( in_testMatrix[i*in_num_opcodes+j], vmean, vvar);
            }
        }

        // assign class depending on which probability is higher
        if( pmal > 0 && pben > 0)
            out_predict_vect[i] = pmal > pben ? 1 : 0;
        else
        {
            if( pmal > 0 ) out_predict_vect[i] = 1;
            else if ( pben > 0 ) out_predict_vect[i] = 0;
            else //( pmal < 0 && pben < 0)
                out_predict_vect[i] = pmal > pben ? 1 : 0;

        }
    }
}

/*!
 *	\brief This function assigns class based on the selective features
 *
 *   Most of the details similar to function assignClassUsingMeanVarianceData, except for
 *   addition of in_feature list
 *
 *   in_feature_list:
 *   contains list of prominant features for each group
 * |                         | each row points to the feature vector in s_group   |
 * | :----------------------:| :------------------------------------------------: |
 * | rows = number of groups |                                                    |
 *
 *   the feature vector is in_num_opcodes in len, vector has bit set only if the opcode
 *   having id = index of this vector is amongst the prominant feature
 *
 *   \todo huge dependency !!! try and remove it viz feature list is pointing to feature vector
 *   in s_group
 *
 *	\return predicted class matrix
 *	
 */
void assignClassUsingMeanVarianceDataAndFeatureSelection(
        float *in_trainMatrix,  /*!< [in] trained probability matrix */
        float *in_testMatrix,   /*!< [in] testing matrix */
        int *in_feature_list,  /*!< [in] array of list of feature vector for each group, number of lists = number of groups */
        int in_num_groups,      /*!< [in] number of groups / number of rows in train matrix */
        int in_num_opcodes,     /*!< [in] number of opcodes / number of columns in test,train matrix */
        int in_num_features,     /*!< [in] number of prominent features */
        int in_numtestfiles,    /*!< [in] number of test files / number of rows in test matrix */
        int *in_group_index,    /*!< [in] vector containing group index of each file in test matrix( 1:1 mapping) */
        int *out_predict_vect   /*!< [out] predicted class  */
        )
{
    int i,j;
    float pmal=0.0, pben=0.0;
    int mean =0, var =1; /// \todo make this genric or avoid it somehow
    float vmean =0, vvar =1;
    int index=0;
    int grpindex=0;
    // for each file in in_testMatrix
    for ( i=0; i<in_numtestfiles; i++)
    {
        grpindex = in_group_index[i];
        index = grpindex*4;
        pmal=0.0; 
        pben=0.0;
        // for each opcode
        for ( j=0; j<in_num_features; j++)
        {
            int opcindex = in_feature_list[grpindex*in_num_features+j];
            // if the normalized frequency in in_testMatrix is greater than 0 and current
            // opcode is amongst the prominent opcode for the group,to which the current
            // file belongs.
            if( in_testMatrix[i*in_num_opcodes+opcindex] > 0 ) 
            {
                // get variance and mean assuming it is a benign file
                vmean = in_trainMatrix[(index+0+mean)*in_num_opcodes+opcindex];
                vvar  = in_trainMatrix[(index+0+var )*in_num_opcodes+opcindex];
                assert( vmean >= 0.0f && vvar >= 0.0f );
                // add to probability of file being benign
                pben += getTheProbablity( in_testMatrix[i*in_num_opcodes+opcindex], vmean, vvar);

                // get variance and mean assuming it is a malware file
                vmean = in_trainMatrix[(index+2+mean)*in_num_opcodes+opcindex];
                vvar  = in_trainMatrix[(index+2+var )*in_num_opcodes+opcindex];
                assert( vmean >= 0.0f && vvar >= 0.0f );
                // add to probability of file being malware
                pmal += getTheProbablity( in_testMatrix[i*in_num_opcodes+opcindex], vmean, vvar);
            }
        }
        /// assign class whos probablity is greater
        if( pmal > 0 && pben > 0)
            out_predict_vect[i] = pmal > pben ? 1 : 0;
        else
        {
            if( pmal > 0 ) out_predict_vect[i] = 1;
            else if ( pben > 0 ) out_predict_vect[i] = 0;
            else //( pmal < 0 && pben < 0)
                out_predict_vect[i] = pmal > pben ? 1 : 0;

        }
    }
}

	.file	"tmpxft_00269872_00000000-6_naiveOperations.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2044:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2044:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z9normalizePiPfii
	.type	_Z9normalizePiPfii, @function
_Z9normalizePiPfii:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rdi, %r8
	xorl	%r10d, %r10d
	xorl	%r11d, %r11d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rsi, %rbx
	movl	%ecx, %esi
.L3:
	cmpl	%ebp, %r11d
	jge	.L7
	movslq	%r10d, %rax
	xorl	%edi, %edi
	movl	$2147483647, %ecx
	movl	$-2147483648, %edx
	salq	$2, %rax
	leaq	(%r8,%rax), %r12
.L8:
	cmpl	%edi, %esi
	jle	.L11
	movl	(%r12,%rdi,4), %r9d
	cmpl	%r9d, %ecx
	cmovg	%r9d, %ecx
	cmpl	%r9d, %edx
	cmovl	%r9d, %edx
	incq	%rdi
	jmp	.L8
.L11:
	xorl	%edi, %edi
	subl	%ecx, %edx
.L5:
	cmpl	%esi, %edi
	jge	.L12
	movl	(%r8,%rax), %r9d
	cvtsi2ssl	%edx, %xmm1
	incl	%edi
	subl	%ecx, %r9d
	cvtsi2ssl	%r9d, %xmm0
	divss	%xmm1, %xmm0
	movss	%xmm0, (%rbx,%rax)
	addq	$4, %rax
	jmp	.L5
.L12:
	incl	%r11d
	addl	%esi, %r10d
	jmp	.L3
.L7:
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z9normalizePiPfii, .-_Z9normalizePiPfii
	.globl	_Z19createClassWiseDataPiS_iii
	.type	_Z19createClassWiseDataPiS_iii, @function
_Z19createClassWiseDataPiS_iii:
.LFB2028:
	.cfi_startproc
	endbr64
	testl	%ecx, %ecx
	movl	$1, %eax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%edx, %r11d
	cmovg	%ecx, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%ecx, %edx
	xorl	%r9d, %r9d
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%r10d, %r10d
	leal	-1(%rcx), %ebp
	decl	%eax
	leaq	(%rsi,%rax,4), %rbx
.L14:
	cmpl	%r11d, %r10d
	jge	.L16
	movslq	%r9d, %rax
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	salq	$2, %rax
.L17:
	cmpl	%ecx, %ebp
	jle	.L19
	movl	(%rdi,%rax), %r14d
	incl	%ecx
	addl	%r14d, (%rsi,%rax)
	addl	(%rdi,%rax), %r8d
	addq	$4, %rax
	jmp	.L17
.L19:
	movl	%r8d, (%rbx)
	incl	%r10d
	addl	%edx, %r9d
	jmp	.L14
.L16:
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z19createClassWiseDataPiS_iii, .-_Z19createClassWiseDataPiS_iii
	.globl	_Z22createProbablityMatrixPiPfS_S0_iiii
	.type	_Z22createProbablityMatrixPiPfS_S0_iiii, @function
_Z22createProbablityMatrixPiPfS_S0_iiii:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r15
	movl	$4, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movslq	80(%rsp), %rsi
	movl	88(%rsp), %r14d
	movl	%r9d, (%rsp)
	movl	%r8d, 8(%rsp)
	call	calloc@PLT
	movl	(%rsp), %r9d
	xorl	%edi, %edi
	xorl	%edx, %edx
	movss	.LC0(%rip), %xmm1
	movq	%rax, %rbx
.L21:
	cmpl	%edx, 8(%rsp)
	jle	.L30
	movslq	0(%r13,%rdx,4), %rax
	movq	%rax, %rcx
	salq	$2, %rax
	imull	%r14d, %ecx
	leaq	(%rbx,%rax), %r8
	movslq	%ecx, %rcx
	leaq	(%r12,%rcx,4), %rsi
	movslq	%edi, %rcx
	leaq	(%r15,%rcx,4), %r11
	xorl	%ecx, %ecx
.L22:
	cmpl	%ecx, %r14d
	jle	.L31
	cvtsi2ssl	(%r11,%rcx,4), %xmm0
	movss	(%rsi), %xmm2
	incq	%rcx
	addq	$4, %rsi
	addss	%xmm0, %xmm2
	addss	(%r8), %xmm0
	movss	%xmm2, -4(%rsi)
	movss	%xmm0, (%r8)
	jmp	.L22
.L31:
	addq	%rbp, %rax
	incq	%rdx
	addl	%r9d, %edi
	movss	(%rax), %xmm0
	addss	%xmm1, %xmm0
	movss	%xmm0, (%rax)
	jmp	.L21
.L30:
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
.L25:
	cmpl	%r13d, 80(%rsp)
	jle	.L27
	movslq	%r15d, %rdx
	xorl	%ecx, %ecx
	leaq	(%r12,%rdx,4), %rdx
.L28:
	cmpl	%r14d, %ecx
	jge	.L32
	movss	.LC0(%rip), %xmm1
	movss	(%rdx), %xmm0
	movl	%ecx, 12(%rsp)
	movq	%rdx, (%rsp)
	addss	%xmm1, %xmm0
	addss	(%rbx,%r13,4), %xmm1
	divss	%xmm1, %xmm0
	call	log10f@PLT
	movq	(%rsp), %rdx
	movl	12(%rsp), %ecx
	xorps	.LC1(%rip), %xmm0
	incl	%ecx
	addq	$4, %rdx
	movss	%xmm0, -4(%rdx)
	jmp	.L28
.L32:
	cvtsi2ssl	8(%rsp), %xmm1
	movss	0(%rbp,%r13,4), %xmm0
	addl	%r14d, %r15d
	divss	%xmm1, %xmm0
	call	log10f@PLT
	xorps	.LC1(%rip), %xmm0
	movss	%xmm0, 0(%rbp,%r13,4)
	incq	%r13
	jmp	.L25
.L27:
	movq	%rbx, %rdi
	call	free@PLT
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z22createProbablityMatrixPiPfS_S0_iiii, .-_Z22createProbablityMatrixPiPfS_S0_iiii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	" %f"
.LC3:
	.string	"\n"
	.text
	.globl	_Z16printFloatMatrixPfii
	.type	_Z16printFloatMatrixPfii, @function
_Z16printFloatMatrixPfii:
.LFB2030:
	.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
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L34:
	cmpl	%r14d, %r13d
	jge	.L33
	movslq	%r12d, %rax
	xorl	%r15d, %r15d
	leaq	0(%rbp,%rax,4), %rcx
.L37:
	cmpl	%r15d, %ebx
	jle	.L39
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	(%rcx,%r15,4), %xmm0
	movq	%rcx, 8(%rsp)
	incq	%r15
	call	__printf_chk@PLT
	movq	8(%rsp), %rcx
	jmp	.L37
.L39:
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	incl	%r13d
	addl	%ebx, %r12d
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L34
.L33:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2030:
	.size	_Z16printFloatMatrixPfii, .-_Z16printFloatMatrixPfii
	.section	.rodata.str1.1
.LC4:
	.string	" %d"
	.text
	.globl	_Z14printIntMatrixPiii
	.type	_Z14printIntMatrixPiii, @function
_Z14printIntMatrixPiii:
.LFB2031:
	.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
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L41:
	cmpl	%r14d, %r13d
	jge	.L40
	movslq	%r12d, %rax
	xorl	%r15d, %r15d
	leaq	0(%rbp,%rax,4), %r8
.L44:
	cmpl	%r15d, %ebx
	jle	.L46
	movl	(%r8,%r15,4), %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	incq	%r15
	movl	$2, %edi
	movq	%r8, 8(%rsp)
	call	__printf_chk@PLT
	movq	8(%rsp), %r8
	jmp	.L44
.L46:
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	incl	%r13d
	addl	%ebx, %r12d
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L41
.L40:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z14printIntMatrixPiii, .-_Z14printIntMatrixPiii
	.globl	_Z11assignClassPiPfS0_S_iii
	.type	_Z11assignClassPiPfS0_S_iii, @function
_Z11assignClassPiPfS0_S_iii:
.LFB2032:
	.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
	movq	%rcx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	movslq	%r9d, %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	movl	$8, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%r8d, 12(%rsp)
	movl	80(%rsp), %r15d
	call	calloc@PLT
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	movq	%rax, %rdi
.L48:
	cmpl	%ecx, 12(%rsp)
	jle	.L63
	xorl	%eax, %eax
.L58:
	cmpl	%eax, %ebx
	jle	.L64
	cvtss2sd	0(%r13,%rax,4), %xmm0
	movsd	%xmm0, (%rdi,%rax,8)
	incq	%rax
	jmp	.L58
.L64:
	xorl	%edx, %edx
.L50:
	cmpl	%r15d, %edx
	jge	.L59
	leal	(%rdx,%rsi), %eax
	movl	%edx, %r8d
	cltq
	leaq	0(%rbp,%rax,4), %r11
	xorl	%eax, %eax
.L54:
	cmpl	%eax, %ebx
	jle	.L65
	movl	(%r11), %r10d
	testl	%r10d, %r10d
	jle	.L51
	movslq	%r8d, %r9
	cvtsi2ssl	%r10d, %xmm0
	mulss	(%r12,%r9,4), %xmm0
	cvtss2sd	%xmm0, %xmm0
	addsd	(%rdi,%rax,8), %xmm0
	movsd	%xmm0, (%rdi,%rax,8)
.L51:
	incq	%rax
	addl	%r15d, %r8d
	jmp	.L54
.L65:
	incl	%edx
	jmp	.L50
.L59:
	xorl	%eax, %eax
	xorl	%edx, %edx
.L53:
	cmpl	%eax, %ebx
	jle	.L66
	movslq	%edx, %r8
	movsd	(%rdi,%r8,8), %xmm0
	ucomisd	(%rdi,%rax,8), %xmm0
	cmova	%eax, %edx
	incq	%rax
	jmp	.L53
.L66:
	movl	%edx, (%r14,%rcx,4)
	addl	%r15d, %esi
	incq	%rcx
	jmp	.L48
.L63:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE2032:
	.size	_Z11assignClassPiPfS0_S_iii, .-_Z11assignClassPiPfS0_S_iii
	.globl	_Z15createIntMatrixii
	.type	_Z15createIntMatrixii, @function
_Z15createIntMatrixii:
.LFB2033:
	.cfi_startproc
	endbr64
	imull	%esi, %edi
	movslq	%edi, %rsi
	movl	$4, %edi
	jmp	calloc@PLT
	.cfi_endproc
.LFE2033:
	.size	_Z15createIntMatrixii, .-_Z15createIntMatrixii
	.globl	_Z17createFloatMatrixii
	.type	_Z17createFloatMatrixii, @function
_Z17createFloatMatrixii:
.LFB2034:
	.cfi_startproc
	endbr64
	imull	%edi, %esi
	movl	$4, %edi
	movslq	%esi, %rsi
	jmp	calloc@PLT
	.cfi_endproc
.LFE2034:
	.size	_Z17createFloatMatrixii, .-_Z17createFloatMatrixii
	.globl	_Z12createVectori
	.type	_Z12createVectori, @function
_Z12createVectori:
.LFB2035:
	.cfi_startproc
	endbr64
	movslq	%edi, %rsi
	movl	$4, %edi
	jmp	calloc@PLT
	.cfi_endproc
.LFE2035:
	.size	_Z12createVectori, .-_Z12createVectori
	.globl	_Z11getAccuracyPiS_i
	.type	_Z11getAccuracyPiS_i, @function
_Z11getAccuracyPiS_i:
.LFB2036:
	.cfi_startproc
	endbr64
	movss	.LC0(%rip), %xmm1
	xorl	%eax, %eax
	xorps	%xmm0, %xmm0
.L71:
	cmpl	%eax, %edx
	jle	.L74
	movl	(%rsi,%rax,4), %ecx
	cmpl	%ecx, (%rdi,%rax,4)
	jne	.L72
	addss	%xmm1, %xmm0
.L72:
	incq	%rax
	jmp	.L71
.L74:
	cvtsi2ssl	%edx, %xmm1
	divss	%xmm1, %xmm0
	ret
	.cfi_endproc
.LFE2036:
	.size	_Z11getAccuracyPiS_i, .-_Z11getAccuracyPiS_i
	.globl	_Z12rotateMatrixPiS_ii
	.type	_Z12rotateMatrixPiS_ii, @function
_Z12rotateMatrixPiS_ii:
.LFB2037:
	.cfi_startproc
	endbr64
	movslq	%edx, %r11
	xorl	%r10d, %r10d
	movq	%rdi, %r8
	xorl	%r9d, %r9d
	salq	$2, %r11
	cmpl	%edx, %r10d
	jl	.L84
	ret
.L84:
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
.L82:
	movslq	%r9d, %rax
	movq	%rsi, %rdi
	leaq	(%r8,%rax,4), %rbx
	xorl	%eax, %eax
.L79:
	cmpl	%eax, %ecx
	jle	.L85
	movl	(%rbx,%rax,4), %r14d
	incq	%rax
	movl	%r14d, (%rdi)
	addq	%r11, %rdi
	jmp	.L79
.L85:
	incl	%r10d
	addq	$4, %rsi
	addl	%ecx, %r9d
	cmpl	%edx, %r10d
	jl	.L82
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2037:
	.size	_Z12rotateMatrixPiS_ii, .-_Z12rotateMatrixPiS_ii
	.globl	_Z13rotateMatrixFPfS_ii
	.type	_Z13rotateMatrixFPfS_ii, @function
_Z13rotateMatrixFPfS_ii:
.LFB2038:
	.cfi_startproc
	endbr64
	movslq	%edx, %r11
	xorl	%r10d, %r10d
	movq	%rdi, %r8
	xorl	%r9d, %r9d
	salq	$2, %r11
	cmpl	%edx, %r10d
	jl	.L95
	ret
.L95:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
.L93:
	movslq	%r9d, %rax
	movq	%rsi, %rdi
	leaq	(%r8,%rax,4), %rbx
	xorl	%eax, %eax
.L90:
	cmpl	%eax, %ecx
	jle	.L96
	movss	(%rbx,%rax,4), %xmm0
	incq	%rax
	movss	%xmm0, (%rdi)
	addq	%r11, %rdi
	jmp	.L90
.L96:
	incl	%r10d
	addq	$4, %rsi
	addl	%ecx, %r9d
	cmpl	%edx, %r10d
	jl	.L93
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2038:
	.size	_Z13rotateMatrixFPfS_ii, .-_Z13rotateMatrixFPfS_ii
	.globl	_Z16getTheProbablityfff
	.type	_Z16getTheProbablityfff, @function
_Z16getTheProbablityfff:
.LFB2039:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	cvtss2sd	%xmm2, %xmm2
	movss	%xmm0, 28(%rsp)
	movaps	%xmm2, %xmm0
	mulsd	.LC6(%rip), %xmm0
	movss	%xmm1, 24(%rsp)
	movsd	%xmm2, 16(%rsp)
	call	sqrt@PLT
	movss	28(%rsp), %xmm3
	subss	24(%rsp), %xmm3
	movsd	%xmm0, 8(%rsp)
	movsd	16(%rsp), %xmm2
	movaps	%xmm3, %xmm0
	addsd	%xmm2, %xmm2
	mulss	%xmm3, %xmm0
	cvtss2sd	%xmm0, %xmm0
	divsd	%xmm2, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	call	expf@PLT
	movss	.LC0(%rip), %xmm1
	movaps	%xmm0, %xmm2
	movsd	.LC7(%rip), %xmm0
	divsd	8(%rsp), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	divss	%xmm2, %xmm1
	mulss	%xmm1, %xmm0
	call	log10f@PLT
	ucomiss	%xmm0, %xmm0
	jp	.L102
	movaps	%xmm0, %xmm1
	andps	.LC8(%rip), %xmm1
	ucomiss	.LC9(%rip), %xmm1
	jbe	.L97
.L102:
	xorps	%xmm0, %xmm0
.L97:
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2039:
	.size	_Z16getTheProbablityfff, .-_Z16getTheProbablityfff
	.globl	_Z32assignClassUsingMeanVarianceDataPfS_iiiPiS0_
	.type	_Z32assignClassUsingMeanVarianceDataPfS_iiiPiS0_, @function
_Z32assignClassUsingMeanVarianceDataPfS_iiiPiS0_:
.LFB2040:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorps	%xmm5, %xmm5
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%ecx, %ebx
	xorl	%ecx, %ecx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movl	%r8d, 12(%rsp)
.L105:
	cmpl	%r13d, 12(%rsp)
	jle	.L124
	movl	(%r9,%r13,4), %eax
	movslq	%ecx, %rdi
	xorps	%xmm3, %xmm3
	xorl	%ebp, %ebp
	leaq	(%rsi,%rdi,4), %r11
	movaps	%xmm3, %xmm4
	sall	$2, %eax
	imull	%ebx, %eax
	leal	(%rax,%rbx), %r10d
	leal	(%r10,%rbx), %r14d
	leal	(%r14,%rbx), %r15d
.L106:
	cmpl	%ebp, %ebx
	jle	.L125
	movss	(%r11,%rbp,4), %xmm6
	comiss	%xmm5, %xmm6
	jbe	.L107
	leal	(%r10,%rbp), %r8d
	leal	(%rax,%rbp), %edi
	movaps	%xmm6, %xmm0
	movq	%r9, 56(%rsp)
	movslq	%r8d, %r8
	movslq	%edi, %rdi
	movq	%rsi, 48(%rsp)
	movss	(%r12,%r8,4), %xmm2
	movss	(%r12,%rdi,4), %xmm1
	movl	%ecx, 44(%rsp)
	movq	%r11, 32(%rsp)
	movl	%r10d, 28(%rsp)
	movl	%eax, 24(%rsp)
	movss	%xmm4, 40(%rsp)
	movss	%xmm3, 16(%rsp)
	movss	%xmm6, 20(%rsp)
	call	_Z16getTheProbablityfff
	movss	16(%rsp), %xmm3
	leal	(%r15,%rbp), %r8d
	leal	(%r14,%rbp), %edi
	movss	20(%rsp), %xmm6
	movslq	%r8d, %r8
	movslq	%edi, %rdi
	addss	%xmm0, %xmm3
	movss	(%r12,%r8,4), %xmm2
	movss	(%r12,%rdi,4), %xmm1
	movaps	%xmm6, %xmm0
	movss	%xmm3, 16(%rsp)
	call	_Z16getTheProbablityfff
	movss	40(%rsp), %xmm4
	movl	44(%rsp), %ecx
	xorps	%xmm5, %xmm5
	movq	56(%rsp), %r9
	movq	48(%rsp), %rsi
	addss	%xmm0, %xmm4
	movq	32(%rsp), %r11
	movl	28(%rsp), %r10d
	movl	24(%rsp), %eax
	movss	16(%rsp), %xmm3
.L107:
	incq	%rbp
	jmp	.L106
.L125:
	comiss	%xmm5, %xmm4
	jbe	.L120
	comiss	%xmm5, %xmm3
	movl	$1, %eax
	ja	.L123
	jmp	.L112
.L120:
	xorl	%eax, %eax
	comiss	%xmm5, %xmm3
	ja	.L112
.L123:
	xorl	%eax, %eax
	comiss	%xmm3, %xmm4
	seta	%al
.L112:
	movq	128(%rsp), %rdx
	addl	%ebx, %ecx
	movl	%eax, (%rdx,%r13,4)
	incq	%r13
	jmp	.L105
.L124:
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2040:
	.size	_Z32assignClassUsingMeanVarianceDataPfS_iiiPiS0_, .-_Z32assignClassUsingMeanVarianceDataPfS_iiiPiS0_
	.globl	_Z51assignClassUsingMeanVarianceDataAndFeatureSelectionPfS_PiiiiiS0_S0_
	.type	_Z51assignClassUsingMeanVarianceDataAndFeatureSelectionPfS_PiiiiiS0_S0_, @function
_Z51assignClassUsingMeanVarianceDataAndFeatureSelectionPfS_PiiiiiS0_S0_:
.LFB2041:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%ecx, %ecx
	xorps	%xmm5, %xmm5
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdx, (%rsp)
.L127:
	cmpl	%r13d, 128(%rsp)
	jle	.L146
	movq	136(%rsp), %rax
	movq	(%rsp), %rbx
	xorps	%xmm3, %xmm3
	movaps	%xmm3, %xmm4
	movl	(%rax,%r13,4), %eax
	leal	0(,%rax,4), %edx
	imull	%ebp, %edx
	imull	%r9d, %eax
	leal	0(%rbp,%rdx), %r10d
	cltq
	leal	0(%rbp,%r10), %r14d
	leaq	(%rbx,%rax,4), %r11
	leal	0(%rbp,%r14), %r15d
	xorl	%eax, %eax
.L128:
	cmpl	%eax, %r9d
	jle	.L147
	movl	(%r11,%rax,4), %ebx
	leal	(%rcx,%rbx), %edi
	movslq	%edi, %rdi
	movss	(%rsi,%rdi,4), %xmm6
	comiss	%xmm5, %xmm6
	jbe	.L129
	leal	(%r10,%rbx), %r8d
	leal	(%rdx,%rbx), %edi
	movaps	%xmm6, %xmm0
	movl	%r9d, 60(%rsp)
	movslq	%r8d, %r8
	movslq	%edi, %rdi
	movq	%rsi, 48(%rsp)
	movss	(%r12,%r8,4), %xmm2
	movss	(%r12,%rdi,4), %xmm1
	movl	%ecx, 56(%rsp)
	movq	%r11, 40(%rsp)
	movq	%rax, 32(%rsp)
	movl	%r10d, 24(%rsp)
	movl	%edx, 20(%rsp)
	movss	%xmm4, 28(%rsp)
	movss	%xmm3, 12(%rsp)
	movss	%xmm6, 16(%rsp)
	call	_Z16getTheProbablityfff
	movss	12(%rsp), %xmm3
	leal	(%r15,%rbx), %edi
	addl	%r14d, %ebx
	movss	16(%rsp), %xmm6
	movslq	%edi, %rdi
	movslq	%ebx, %rbx
	addss	%xmm0, %xmm3
	movss	(%r12,%rdi,4), %xmm2
	movss	(%r12,%rbx,4), %xmm1
	movaps	%xmm6, %xmm0
	movss	%xmm3, 12(%rsp)
	call	_Z16getTheProbablityfff
	movss	28(%rsp), %xmm4
	movl	56(%rsp), %ecx
	xorps	%xmm5, %xmm5
	movl	60(%rsp), %r9d
	movq	48(%rsp), %rsi
	addss	%xmm0, %xmm4
	movq	40(%rsp), %r11
	movq	32(%rsp), %rax
	movl	24(%rsp), %r10d
	movl	20(%rsp), %edx
	movss	12(%rsp), %xmm3
.L129:
	incq	%rax
	jmp	.L128
.L147:
	comiss	%xmm5, %xmm4
	jbe	.L142
	comiss	%xmm5, %xmm3
	movl	$1, %eax
	ja	.L145
	jmp	.L134
.L142:
	xorl	%eax, %eax
	comiss	%xmm5, %xmm3
	ja	.L134
.L145:
	xorl	%eax, %eax
	comiss	%xmm3, %xmm4
	seta	%al
.L134:
	movq	144(%rsp), %rdx
	addl	%ebp, %ecx
	movl	%eax, (%rdx,%r13,4)
	incq	%r13
	jmp	.L127
.L146:
	addq	$72, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2041:
	.size	_Z51assignClassUsingMeanVarianceDataAndFeatureSelectionPfS_PiiiiiS0_S0_, .-_Z51assignClassUsingMeanVarianceDataAndFeatureSelectionPfS_PiiiiiS0_S0_
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2067:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2067:
	.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.cst4,"aM",@progbits,4
	.align 4
.LC0:
	.long	1065353216
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	-2147483648
	.long	0
	.long	0
	.long	0
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC6:
	.long	1413754136
	.long	1075388923
	.align 8
.LC7:
	.long	0
	.long	1072693248
	.section	.rodata.cst16
	.align 16
.LC8:
	.long	2147483647
	.long	0
	.long	0
	.long	0
	.section	.rodata.cst4
	.align 4
.LC9:
	.long	2139095039
	.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 <assert.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

/*!
 *	\brief calculate normalized frequency matrix 
 *
 *   Normalized value(x) = \f$ \frac{ X - min }{ max - min }\f$
 *	\return normalized matrix
 *	
 */
int normalize( 
        int *in_mat,     /*!< [in] input matrix */
        float *out_mat,     /*!< [out] output matrix */
        int in_rows,     /*!< [in] number of rows in the input matrix */
        int in_columns    /*!< [in] number of columns in the output matrix */
        )
{
    int i,j;
    int max, min;
    for ( i=0; i<in_rows; i++)
    {
        max = INT_MIN;
        min = INT_MAX;
        for ( j=0;j<in_columns; j++)
        {
            if( min > in_mat[ (i*in_columns)+j ] )
                min = in_mat[ (i*in_columns)+j ] ;

            if( max < in_mat[ (i*in_columns)+j ] )
                max = in_mat[ (i*in_columns)+j ];
        }
        for (  j=0; j<in_columns; j++)
        {
            out_mat[(i*in_columns)+j] =(float)(in_mat[(i*in_columns)+j] - min)/(float)(max-min)   ;
        }
    }
    return 0;
}

/*!
 *	\brief Calculates the total frequency of each file for each class
 *
 *	function goes through all the files, calculates total frequency of each total 
 *	frequency for each file is stored in last column of the output matrix
 *	in_mat:
 *	    numfiles X totalnumopcodes matrix, containing frequency of each opcode
 *	out_mat:
 *	    numclass X totalnumopcodes+1 matrix, containing total frequency of each opcode and
 *	    each file in last column
 *	in_inrows:
 *	    = numfiles
 *	in_incolumns:
 *	    = totalnumopcodes
 *	in_outrows:
 *	    = number of classes 
 *
 *	\return modified outmat contains total frequency for each opcode and each file
 *	
 */
int createClassWiseData( 
        int *in_mat,     /*!< [in] input matrix */
        int *out_mat,     /*!< [out] output matrix */
        int in_rows,     /*!< [in] number of rows in input matrix */
        int in_columns,     /*!< [in] number of columns in input matrix */
        int in_outrows    /*!< [in] number of rows in output matrix */
        )
{
    int i,j;
    int sum=0;
    // for each file
    for (  i=0; i<in_rows; i++)
    {
        sum = 0;
        // for each opcode
        for ( j=0; j<in_columns-1; j++)
        {
            // add the frequency for each opcode
            out_mat[ (i*in_columns)+j ] += in_mat [ (i*in_columns)+j ];
            // save the frequency for total collection
            sum += in_mat[ (i*in_columns)+j ];
        }
        out_mat[j] = sum;
    }
    return 0;
}

/*!
 *	\brief gives probability of occurrence of each opcode in each class
 *
 *   takes as input a matrix containing normalized frequencies of each opcode in a file, 
 *   probability of opcode occurring in a class is found, by adding frequencies of each
 *   opcode in each file of each class and then dividing by sum of all frequencies in that
 *   class. We take log so the values are in a smaller range
 *
 *	in_inmat:
 *	    numfiles X totalnumopcodes matrix, has normalized frequency value for each opcode
 *
 *	in_cvect:
 *	    numfiles in length, contains,class ,the current row in in_inmat belongs to
 *
 *	in_inrows:
 *	    = numfiles
 *
 *	in_incolumns:
 *	    = totalnumopcodes
 *
 *	in_outrows:
 *	    = number of classes 
 *
 *	in_outcolumns:
 *	    = totalnumopcodes
 *
 *	out_outmat:
 *	    in_outrows X in_outcolumns, probability of each opcode in each class
 *
 *	out_cprob:
 *	    probability of each class
 *
 *	\return out_outmat is the modified matrix which contains the required probabilities
 *	
 */
int createProbablityMatrix( 
        int     *in_inmat,    /*!< [in] input matrix */
        float   *out_outmat,    /*!< [out] output matrix */
        int     *in_cvect,    /*!< [in] class vector */
        float   *out_cprob,    /*!< [out] probability of each class */
        int     in_inrows,    /*!< [in] number of rows in input matrix */
        int     in_incolumns,    /*!< [in] number of columns in input matrix */
        int     in_outrows,    /*!< [in] number of rows in output matrix */
        int     in_outcolumns    /*!< [in] number of columns in output matrix */
        )
{
#define  INDEX(i,j,cols) ((i*cols)+j)
    int i,j;
    int cls;
    float *class_wise_total=(float*) calloc(sizeof(float),in_outrows);
    assert(class_wise_total != NULL );
    // For each file
    for ( i=0; i<in_inrows; i++)
    {
        // get class for current file
        cls = in_cvect[ i ];
        // For each opcode
        for ( j=0; j<in_outcolumns; j++)
        {
            // add frequency of each opcode to appropriate a class opcode
            out_outmat[ INDEX(cls,j,in_outcolumns) ] +=   (float)in_inmat[ INDEX(i,j,in_incolumns) ];
            // add frequency to current class frequency
            class_wise_total [ cls ] +=   (float)in_inmat[ INDEX(i,j,in_incolumns) ];
        }
        // increase the count of file in current class
        out_cprob[ cls ] += 1;
    }
    // For each class
    for ( i=0; i<in_outrows; i++)
    {
        // For each opcode
        for ( j=0; j<in_outcolumns; j++)
        {
            // store the probability of current opcode
            float temp = (log10((out_outmat[ INDEX(i,j,in_outcolumns) ]+1) / (class_wise_total[ i ]+1) ));
            out_outmat[ INDEX(i,j,in_outcolumns) ] = (-1)*temp; // multiply by -1, because log[0-1] < 0
        }
        // save probability of current class
        out_cprob[ i ] = (-1)*log10(out_cprob[ i ]/ in_inrows); // multiply by -1 because log[0-1] < 0
    }
    free(class_wise_total);
    return 0;
#undef INDEX
}

/*!
 *	\brief Displays the float matrix
 *
 *   Should not be used on huge matrices
 *
 *	\return 
 *	
 */
void printFloatMatrix(
        float *in_mat,     /*!< [in] pointer to the matrix */
        int in_rows,     /*!< [in] number of rows in the matrix */
        int in_columns    /*!< [in] number of columns in the matrix */
        )
{
    int i,j;
    for ( i=0; i<in_rows; i++)
    {
        for ( j=0; j<in_columns; j++)
        {
            printf(" %f",in_mat[ (i*in_columns)+j ]);
        }
        printf("\n");
    }
}

/*!
 *	\brief Displays the int matrix
 *
 *   Should not be used on huge matrices
 *
 *	\return 
 *	
 */
void printIntMatrix( 
        int *in_mat,     /*!< [in] pointer to the matrix */
        int in_rows,     /*!< [in] number of rows in the matrix */
        int in_columns    /*!< [in] number of columns in the matrix */
        )
{
    int i,j;
    for ( i=0; i<in_rows; i++)
    {
        for ( j=0; j<in_columns; j++)
        {
            printf(" %d",in_mat[ (i*in_columns)+j ]);
        }
        printf("\n");
    }
}

/*!
 *	\brief Assigns class to all the test files
 *
 *   takes a matrix of normalized frequency values for each test file, and probability
 *   matrix for each opcode of each class, calculates probability of each opcode for each
 *   class, assigns a class to a file with maximum probability
 *
 *   in_mat:
 *       numfiles X total_number_of_opcodes matrix, containing normalized frequencies
 *
 *   in_cprob:
 *       numclass wide vector, containing probability of each class
 *
 *   out_pridict:
 *       numfiles wide vector, containing assigned class for each file
 *
 *   in_rows:
 *       numfiles
 *
 *   in_classes:
 *       numclasses
 *
 *   in_columns:
 *       total number of opcodes
 *
 *	\return predicted class vector
 *	
 */
void assignClass( 
        int *in_mat,     /*!< [in] input matrix */
        float *in_prob,     /*!< [in] probability matrix */
        float *in_cprob,     /*!< [in] class probability matrix */
        int *out_pridict,     /*!< [out] predicted class */
        int in_rows,     /*!< [in] number of input rows */
        int in_classes,     /*!< [in] number of classes */
        int in_columns    /*!< [in] number of columns */
        )
{
#define  INDEX(i,j,cols) ((i*cols)+j)
    int i,j,k;
    double *classprob =  (double*) calloc( sizeof(double), in_classes);
    // for each file
    for ( i=0; i<in_rows; i++)
    {
        // for each class
        for ( k=0; k<in_classes; k++)
            classprob[ k ] = in_cprob[k];
        // for each opcode
        for ( j=0; j<in_columns; j++)
        {

            // for each class
            for ( k=0; k<in_classes; k++)
            {
                // for opcodes having normalized frequency greater than 1
                if ( in_mat [ INDEX(i,j,in_columns) ] > 0 ) 
                {
                    // add the probability to current class ( add because we already have
                    // log10 of those values)
                    // TODO remove multiplication and check
                    classprob[ k ] += in_mat [ INDEX(i,j,in_columns) ]*in_prob [ INDEX(k,j,in_columns) ];
                }
            }
        }
        int maxClass=0;
        // for each class 
        for ( k=0; k<in_classes; k++)
        {
            // save the max class
            if( classprob[ maxClass ] > classprob[k] )
                maxClass = k;
        }
        // assign the max class
        out_pridict[i] = maxClass;
    }
    free(classprob);
#undef INDEX
}

/*!
 *	\brief creates a int matrix of row X column dimensions
 *
 *   This is actually a vector of size rows X columns X sizeof(int)
 *   use the traditional way for accessing the vector elements
 *
 *	\return pointer to the allocated matrix
 *	
 */
int* createIntMatrix( 
        int in_rows,      /*!< [in] number of rows in the matrix */
        int in_columns    /*!< [in] number of columns in the matrix */
        )
{
    int *temp = (int*) calloc ( sizeof(int) , in_rows*in_columns );
    return temp;
}

/*!
 *	\brief creates a float matrix of row X column dimensions
 *
 *   This is actually a vector of size rows X columns X sizeof(float)
 *   use the traditional way for accessing the vector elements
 *
 *	\return pointer to the allocated matrix
 *	
 */
float* createFloatMatrix(
        int in_rows,      /*!< [in] number of rows in the matrix */
        int in_columns    /*!< [in] number of columns in the matrix */
        )
{
    float *temp = (float*) calloc( sizeof(float), in_columns*in_rows);
    return temp;
}

/*!
 *	\brief creates a integer vector of length size
 *
 *   More Details ...
 *	\return pointer to the newly created vector
 *	
 */
int *createVector(
        int in_size      /*!< [in] length of the vector */
        )    
{
    int *temp = (int*) calloc( sizeof(int), in_size);
    return temp;
}


/*!
 *	\brief Gives accuracy of current configuration
 *
 *   More Details ...
 *
 *	\return ratio of correct predictions to number of predictions
 *	
 */
float getAccuracy( 
        int *in_pmat,   /*!< [in] predicated class vector */
        int *in_cvect,  /*!< [in] actual class vector */
        int in_total    /*!< [in] length of the vector */
        )
{
    int i;
    float ans=0.0;
    for ( i=0; i<in_total; i++)
    {
        if( in_pmat[i] == in_cvect[i])
            ans ++;
    }
    return ans/in_total;
}

/*!
 *	\brief  Gives transpose of a matrix
 *
 *   The rows of in_mat are converted to columns of the out_mat, and columns of in_mat are
 *   converted to rows of out_mat
 *                                                                                       
 *	in_mat    =   in_rows      X   in_columns
 *
 *	out_mat   =   in_columns   X   in_rows
 *
 *	\return transpose of a matrix in out_mat
 *	
 */
void rotateMatrix( 
        int *in_mat,     /*!< [in] input matrix */
        int *out_mat,    /*!< [out] output matrix */
        int in_rows,     /*!< [in] number of rows in input matrix */
        int in_columns   /*!< [in] number of columns in output matrix */
        )
{
    int outcolumns=in_rows;
    int i,j;

    for ( i=0; i<in_rows; i++)
    {
        for ( j=0;j<in_columns;j++)
        {
            out_mat[ j*outcolumns + i ] = in_mat[ i*in_columns+j ];
        }
    }
}
void rotateMatrixF( 
        float *in_mat,     /*!< [in] input matrix */
        float *out_mat,    /*!< [out] output matrix */
        int in_rows,     /*!< [in] number of rows in input matrix */
        int in_columns   /*!< [in] number of columns in output matrix */
        )
{
    int outcolumns=in_rows;
    int i,j;

    for ( i=0; i<in_rows; i++)
    {
        for ( j=0;j<in_columns;j++)
        {
            out_mat[ j*outcolumns + i ] = in_mat[ i*in_columns+j ];
        }
    }
}

/*!
 *	\brief Gives the probablity for the current in_val
 *
 *   probability = \f$ \frac{1}{\sqrt{2\Pi\sigma^{2}}}\exp^{\frac{(x-\mu)^{2}}{2\sigma^{2}}} \f$
 *
 *	\return probablity in float
 *	\see 
 *	
 */
float getTheProbablity( 
        float in_vval,  /*!< [in] x as in above formulae */
        float in_vmean, /*!< [in] mean value */
        float in_vvar   /*!< [in] variance value */
        )
{

    float result=0.0;
    float val1 =  1/sqrt( 2.0* M_PI* in_vvar);
    float val2 = (in_vval-in_vmean)*(in_vval-in_vmean)/(2.0*in_vvar);
    val2 = 1 / exp( val2);
    result = log10( val1*val2);
    if( isnan(result) || isinf(result) ) return 0.0;
    return result;
}

/*!
 *	\brief Assigns class to the test inputs
 *
 *   For all the test files in testArray, gets the group index from in_group_index( which
 *   is decided based on file size), selects the probablites from in_trainMatrix only for
 *   those opcodes whose normalized occurances are greater than 0
 *   
 *   in_trainMatrix:
 *     four rows in in_trainMatrix are considered as one row, structure is as follows
 *
 *   |               |         |          | in_num_opcodes number of columns |
 *   |:-------------:|:-------:|:--------:|:--------------------------------:|
 *   | group [0-99]  | benign  | mean     |                                  |
 *   | in_num_groups |         | variance |                                  |
 *   |               | malware | mean     |                                  |
 *   |               |         | variance |                                  |
 *
 *    in_testMatrix:
 *   |                 | in_num_opcodes number of columns |
 *   |:---------------:|:--------------------------------:|
 *   | inumber of rows=n_numtestfiles  ||
 *
 *   in_group_index:
 *   has in_numtestfiles number of values containg group number of file, can be thought of
 *   extra column in in_testMatrix 
 *
 *   \return predicted class for files in in_testMatrix
 *	  
 */
void assignClassUsingMeanVarianceData(
        float *in_trainMatrix, /*!< [in] trained probablity matrix */
        float *in_testMatrix,  /*!< [in] testing matrix */
        int in_num_groups,     /*!< [in] number of groups / number of rows in train matrix */
        int in_num_opcodes,    /*!< [in] number of opcodes / number of columns in test,train matrix */
        int in_numtestfiles,   /*!< [in] number of test files / number of rows in test matrix */
        int *in_group_index,   /*!< [in] vector containing group index of each file in test matrix( 1:1 mapping) */
        int *out_predict_vect  /*!< [out] predicted class  */
        )

{
    int i,j;
    float pmal=0.0, pben=0.0;
    int mean =0, var =1; /// \todo make this genric or avoid it somehow
    float vmean =0, vvar =1;
    int index=0;
    // Iterate through each file in in_testMatrix
    for ( i=0; i<in_numtestfiles; i++)
    {
        index = in_group_index[i]*4;
        pmal=0.0; 
        pben=0.0;
        // For all the opcodes
        for ( j=0; j<in_num_opcodes; j++)
        {
            // If any opcode in current file has normalized freq > 0
            if( in_testMatrix[i*in_num_opcodes+j] > 0 ) 
            {
                // get vmean and var considering it is a benign
                vmean = in_trainMatrix[(index+0+mean)*in_num_opcodes+j];
                vvar  = in_trainMatrix[(index+0+var )*in_num_opcodes+j];
                assert( vmean >= 0.0f && vvar >= 0.0f );
                // add the probablity in benign
                pben += getTheProbablity( in_testMatrix[i*in_num_opcodes+j], vmean, vvar);

                // get vmean and var considering it is a malware
                vmean = in_trainMatrix[(index+2+mean)*in_num_opcodes+j];
                vvar  = in_trainMatrix[(index+2+var )*in_num_opcodes+j];
                assert( vmean >= 0.0f && vvar >= 0.0f );
                // add the probablity in malware
                pmal += getTheProbablity( in_testMatrix[i*in_num_opcodes+j], vmean, vvar);
            }
        }

        // assign class depending on which probability is higher
        if( pmal > 0 && pben > 0)
            out_predict_vect[i] = pmal > pben ? 1 : 0;
        else
        {
            if( pmal > 0 ) out_predict_vect[i] = 1;
            else if ( pben > 0 ) out_predict_vect[i] = 0;
            else //( pmal < 0 && pben < 0)
                out_predict_vect[i] = pmal > pben ? 1 : 0;

        }
    }
}

/*!
 *	\brief This function assigns class based on the selective features
 *
 *   Most of the details similar to function assignClassUsingMeanVarianceData, except for
 *   addition of in_feature list
 *
 *   in_feature_list:
 *   contains list of prominant features for each group
 * |                         | each row points to the feature vector in s_group   |
 * | :----------------------:| :------------------------------------------------: |
 * | rows = number of groups |                                                    |
 *
 *   the feature vector is in_num_opcodes in len, vector has bit set only if the opcode
 *   having id = index of this vector is amongst the prominant feature
 *
 *   \todo huge dependency !!! try and remove it viz feature list is pointing to feature vector
 *   in s_group
 *
 *	\return predicted class matrix
 *	
 */
void assignClassUsingMeanVarianceDataAndFeatureSelection(
        float *in_trainMatrix,  /*!< [in] trained probability matrix */
        float *in_testMatrix,   /*!< [in] testing matrix */
        int *in_feature_list,  /*!< [in] array of list of feature vector for each group, number of lists = number of groups */
        int in_num_groups,      /*!< [in] number of groups / number of rows in train matrix */
        int in_num_opcodes,     /*!< [in] number of opcodes / number of columns in test,train matrix */
        int in_num_features,     /*!< [in] number of prominent features */
        int in_numtestfiles,    /*!< [in] number of test files / number of rows in test matrix */
        int *in_group_index,    /*!< [in] vector containing group index of each file in test matrix( 1:1 mapping) */
        int *out_predict_vect   /*!< [out] predicted class  */
        )
{
    int i,j;
    float pmal=0.0, pben=0.0;
    int mean =0, var =1; /// \todo make this genric or avoid it somehow
    float vmean =0, vvar =1;
    int index=0;
    int grpindex=0;
    // for each file in in_testMatrix
    for ( i=0; i<in_numtestfiles; i++)
    {
        grpindex = in_group_index[i];
        index = grpindex*4;
        pmal=0.0; 
        pben=0.0;
        // for each opcode
        for ( j=0; j<in_num_features; j++)
        {
            int opcindex = in_feature_list[grpindex*in_num_features+j];
            // if the normalized frequency in in_testMatrix is greater than 0 and current
            // opcode is amongst the prominent opcode for the group,to which the current
            // file belongs.
            if( in_testMatrix[i*in_num_opcodes+opcindex] > 0 ) 
            {
                // get variance and mean assuming it is a benign file
                vmean = in_trainMatrix[(index+0+mean)*in_num_opcodes+opcindex];
                vvar  = in_trainMatrix[(index+0+var )*in_num_opcodes+opcindex];
                assert( vmean >= 0.0f && vvar >= 0.0f );
                // add to probability of file being benign
                pben += getTheProbablity( in_testMatrix[i*in_num_opcodes+opcindex], vmean, vvar);

                // get variance and mean assuming it is a malware file
                vmean = in_trainMatrix[(index+2+mean)*in_num_opcodes+opcindex];
                vvar  = in_trainMatrix[(index+2+var )*in_num_opcodes+opcindex];
                assert( vmean >= 0.0f && vvar >= 0.0f );
                // add to probability of file being malware
                pmal += getTheProbablity( in_testMatrix[i*in_num_opcodes+opcindex], vmean, vvar);
            }
        }
        /// assign class whos probablity is greater
        if( pmal > 0 && pben > 0)
            out_predict_vect[i] = pmal > pben ? 1 : 0;
        else
        {
            if( pmal > 0 ) out_predict_vect[i] = 1;
            else if ( pben > 0 ) out_predict_vect[i] = 0;
            else //( pmal < 0 && pben < 0)
                out_predict_vect[i] = pmal > pben ? 1 : 0;

        }
    }
}

	.text
	.file	"naiveOperations.hip"
	.globl	_Z9normalizePiPfii              # -- Begin function _Z9normalizePiPfii
	.type	_Z9normalizePiPfii,@function
_Z9normalizePiPfii:                     # @_Z9normalizePiPfii
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB0_10
# %bb.1:                                # %.preheader46.lr.ph
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, %eax
	movl	%ecx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
.LBB0_2:                                # %.preheader46
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_4 Depth 2
                                        #     Child Loop BB0_7 Depth 2
	testl	%ecx, %ecx
	jle	.LBB0_8
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB0_2 Depth=1
	movl	%r8d, %r11d
	leaq	(%rsi,%r11,4), %r10
	leaq	(%rdi,%r11,4), %r11
	movl	$-2147483648, %ebp              # imm = 0x80000000
	movl	$2147483647, %ebx               # imm = 0x7FFFFFFF
	xorl	%r14d, %r14d
.LBB0_4:                                #   Parent Loop BB0_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%ebp, %r15d
	movl	(%r11,%r14,4), %ebp
	cmpl	%ebp, %ebx
	cmovgel	%ebp, %ebx
	cmpl	%ebp, %r15d
	cmovgl	%r15d, %ebp
	incq	%r14
	cmpq	%r14, %rdx
	jne	.LBB0_4
# %bb.5:                                # %.preheader
                                        #   in Loop: Header=BB0_2 Depth=1
	testl	%ecx, %ecx
	jle	.LBB0_8
# %bb.6:                                # %.lr.ph52
                                        #   in Loop: Header=BB0_2 Depth=1
	subl	%ebx, %ebp
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ebp, %xmm0
	xorl	%r14d, %r14d
.LBB0_7:                                #   Parent Loop BB0_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r11,%r14,4), %ebp
	subl	%ebx, %ebp
	xorps	%xmm1, %xmm1
	cvtsi2ss	%ebp, %xmm1
	divss	%xmm0, %xmm1
	movss	%xmm1, (%r10,%r14,4)
	incq	%r14
	cmpq	%r14, %rdx
	jne	.LBB0_7
.LBB0_8:                                # %._crit_edge
                                        #   in Loop: Header=BB0_2 Depth=1
	incq	%r9
	addl	%ecx, %r8d
	cmpq	%rax, %r9
	jne	.LBB0_2
# %bb.9:
	popq	%rbx
	.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
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB0_10:                               # %._crit_edge54
	xorl	%eax, %eax
	retq
.Lfunc_end0:
	.size	_Z9normalizePiPfii, .Lfunc_end0-_Z9normalizePiPfii
	.cfi_endproc
                                        # -- End function
	.globl	_Z19createClassWiseDataPiS_iii  # -- Begin function _Z19createClassWiseDataPiS_iii
	.type	_Z19createClassWiseDataPiS_iii,@function
_Z19createClassWiseDataPiS_iii:         # @_Z19createClassWiseDataPiS_iii
	.cfi_startproc
# %bb.0:
                                        # kill: def $ecx killed $ecx def $rcx
	testl	%edx, %edx
	jle	.LBB1_8
# %bb.1:                                # %.preheader.lr.ph
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	leal	-1(%rcx), %eax
	movl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
.LBB1_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_4 Depth 2
	movl	$0, %r11d
	movl	$0, %r10d
	cmpl	$2, %ecx
	jl	.LBB1_6
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB1_2 Depth=1
	movl	%r8d, %r10d
	leaq	(%rsi,%r10,4), %r11
	leaq	(%rdi,%r10,4), %rbx
	xorl	%r14d, %r14d
	xorl	%r10d, %r10d
.LBB1_4:                                #   Parent Loop BB1_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%rbx,%r14,4), %ebp
	addl	%ebp, (%r11,%r14,4)
	addl	(%rbx,%r14,4), %r10d
	incq	%r14
	cmpq	%r14, %rax
	jne	.LBB1_4
# %bb.5:                                #   in Loop: Header=BB1_2 Depth=1
	movl	%eax, %r11d
.LBB1_6:                                # %._crit_edge
                                        #   in Loop: Header=BB1_2 Depth=1
	movl	%r11d, %r11d
	movl	%r10d, (%rsi,%r11,4)
	incq	%r9
	addl	%ecx, %r8d
	cmpq	%rdx, %r9
	jne	.LBB1_2
# %bb.7:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %rbp
.LBB1_8:                                # %._crit_edge27
	xorl	%eax, %eax
	retq
.Lfunc_end1:
	.size	_Z19createClassWiseDataPiS_iii, .Lfunc_end1-_Z19createClassWiseDataPiS_iii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z22createProbablityMatrixPiPfS_S0_iiii
.LCPI2_0:
	.long	0x3f800000                      # float 1
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI2_1:
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.text
	.globl	_Z22createProbablityMatrixPiPfS_S0_iiii
	.type	_Z22createProbablityMatrixPiPfS_S0_iiii,@function
_Z22createProbablityMatrixPiPfS_S0_iiii: # @_Z22createProbablityMatrixPiPfS_S0_iiii
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%r9d, (%rsp)                    # 4-byte Spill
	movl	%r8d, %ebx
	movq	%rcx, 24(%rsp)                  # 8-byte Spill
	movq	%rdx, %r12
	movq	%rsi, 16(%rsp)                  # 8-byte Spill
	movq	%rdi, %r13
	movl	104(%rsp), %r15d
	movl	96(%rsp), %ebp
	movslq	%ebp, %rsi
	movl	$4, %edi
	callq	calloc
	movl	%r15d, %r14d
	testl	%ebx, %ebx
	jle	.LBB2_7
# %bb.1:                                # %.lr.ph56
	movslq	(%rsp), %r9                     # 4-byte Folded Reload
	movl	%ebx, %ecx
	shlq	$2, %r9
	xorl	%edx, %edx
	movss	.LCPI2_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
.LBB2_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_4 Depth 2
	movslq	(%r12,%rdx,4), %rsi
	testl	%r15d, %r15d
	jle	.LBB2_6
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB2_2 Depth=1
	movl	%esi, %edi
	imull	%r15d, %edi
	movss	(%rax,%rsi,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	movslq	%edi, %rdi
	movq	16(%rsp), %r8                   # 8-byte Reload
	leaq	(%r8,%rdi,4), %rdi
	xorl	%r8d, %r8d
.LBB2_4:                                #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm2, %xmm2
	cvtsi2ssl	(%r13,%r8,4), %xmm2
	movss	(%rdi,%r8,4), %xmm3             # xmm3 = mem[0],zero,zero,zero
	addss	%xmm2, %xmm3
	movss	%xmm3, (%rdi,%r8,4)
	addss	%xmm2, %xmm1
	incq	%r8
	cmpq	%r8, %r14
	jne	.LBB2_4
# %bb.5:                                # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	movss	%xmm1, (%rax,%rsi,4)
.LBB2_6:                                #   in Loop: Header=BB2_2 Depth=1
	movq	24(%rsp), %rdi                  # 8-byte Reload
	movss	(%rdi,%rsi,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm1
	movss	%xmm1, (%rdi,%rsi,4)
	incq	%rdx
	addq	%r9, %r13
	cmpq	%rcx, %rdx
	jne	.LBB2_2
.LBB2_7:                                # %.preheader52
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	testl	%ebp, %ebp
	jle	.LBB2_13
# %bb.8:                                # %.preheader.lr.ph
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ebx, %xmm0
	movss	%xmm0, 4(%rsp)                  # 4-byte Spill
	movl	%ebp, %eax
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	xorl	%r13d, %r13d
	movss	.LCPI2_0(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	xorl	%ebp, %ebp
.LBB2_9:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_11 Depth 2
	movl	%r15d, %ebx
	testl	%r15d, %r15d
	jle	.LBB2_12
# %bb.10:                               # %.lr.ph58
                                        #   in Loop: Header=BB2_9 Depth=1
	movl	%r13d, %eax
	movq	16(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,4), %r12
	movq	8(%rsp), %rax                   # 8-byte Reload
	movss	(%rax,%rbp,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	addss	%xmm1, %xmm0
	movss	%xmm0, (%rsp)                   # 4-byte Spill
	xorl	%r15d, %r15d
.LBB2_11:                               #   Parent Loop BB2_9 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r12,%r15,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	addss	%xmm1, %xmm0
	divss	(%rsp), %xmm0                   # 4-byte Folded Reload
	callq	log10f
	movss	.LCPI2_0(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	xorps	.LCPI2_1(%rip), %xmm0
	movss	%xmm0, (%r12,%r15,4)
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB2_11
.LBB2_12:                               # %._crit_edge59
                                        #   in Loop: Header=BB2_9 Depth=1
	movq	24(%rsp), %r15                  # 8-byte Reload
	movss	(%r15,%rbp,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	divss	4(%rsp), %xmm0                  # 4-byte Folded Reload
	callq	log10f
	movss	.LCPI2_0(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	movaps	.LCPI2_1(%rip), %xmm2           # xmm2 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
	xorps	%xmm2, %xmm0
	movss	%xmm0, (%r15,%rbp,4)
	incq	%rbp
	movl	%ebx, %r15d
	addl	%ebx, %r13d
	cmpq	32(%rsp), %rbp                  # 8-byte Folded Reload
	jne	.LBB2_9
.LBB2_13:                               # %._crit_edge61
	movq	8(%rsp), %rdi                   # 8-byte Reload
	callq	free
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z22createProbablityMatrixPiPfS_S0_iiii, .Lfunc_end2-_Z22createProbablityMatrixPiPfS_S0_iiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z16printFloatMatrixPfii        # -- Begin function _Z16printFloatMatrixPfii
	.type	_Z16printFloatMatrixPfii,@function
_Z16printFloatMatrixPfii:               # @_Z16printFloatMatrixPfii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB3_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %ebx
	movl	%esi, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	%edx, %r12d
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
.LBB3_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB3_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	%r13d, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorl	%r15d, %r15d
.LBB3_4:                                #   Parent Loop BB3_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14,%r15,4), %xmm0
	movl	$.L.str, %edi
	movb	$1, %al
	callq	printf
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB3_4
.LBB3_5:                                # %._crit_edge
                                        #   in Loop: Header=BB3_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%rbp
	addl	%ebx, %r13d
	cmpq	16(%rsp), %rbp                  # 8-byte Folded Reload
	jne	.LBB3_2
.LBB3_6:                                # %._crit_edge13
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z16printFloatMatrixPfii, .Lfunc_end3-_Z16printFloatMatrixPfii
	.cfi_endproc
                                        # -- End function
	.globl	_Z14printIntMatrixPiii          # -- Begin function _Z14printIntMatrixPiii
	.type	_Z14printIntMatrixPiii,@function
_Z14printIntMatrixPiii:                 # @_Z14printIntMatrixPiii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB4_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%edx, %ebx
	movl	%esi, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	%edx, %r12d
	xorl	%ebp, %ebp
	xorl	%r13d, %r13d
.LBB4_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB4_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB4_2 Depth=1
	movl	%ebp, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %r14
	xorl	%r15d, %r15d
.LBB4_4:                                #   Parent Loop BB4_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r14,%r15,4), %esi
	movl	$.L.str.2, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB4_4
.LBB4_5:                                # %._crit_edge
                                        #   in Loop: Header=BB4_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%r13
	addl	%ebx, %ebp
	cmpq	16(%rsp), %r13                  # 8-byte Folded Reload
	jne	.LBB4_2
.LBB4_6:                                # %._crit_edge13
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z14printIntMatrixPiii, .Lfunc_end4-_Z14printIntMatrixPiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z11assignClassPiPfS0_S_iii     # -- Begin function _Z11assignClassPiPfS0_S_iii
	.type	_Z11assignClassPiPfS0_S_iii,@function
_Z11assignClassPiPfS0_S_iii:            # @_Z11assignClassPiPfS0_S_iii
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%r9d, %ebx
	movl	%r8d, %r14d
	movq	%rcx, 32(%rsp)                  # 8-byte Spill
	movq	%rdx, %r15
	movq	%rsi, 24(%rsp)                  # 8-byte Spill
	movq	%rdi, 16(%rsp)                  # 8-byte Spill
	movl	96(%rsp), %ebp
	movslq	%r9d, %rsi
	movl	$8, %edi
	callq	calloc
	testl	%r14d, %r14d
	jle	.LBB5_20
# %bb.1:                                # %.preheader51.lr.ph
	movslq	%ebp, %rcx
	movl	%r14d, %edx
	movl	%ebx, %esi
	movl	%ecx, %edi
	movq	%rcx, 8(%rsp)                   # 8-byte Spill
	leaq	(,%rcx,4), %r8
	xorl	%r9d, %r9d
.LBB5_2:                                # %.preheader51
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_4 Depth 2
                                        #     Child Loop BB5_7 Depth 2
                                        #       Child Loop BB5_9 Depth 3
                                        #     Child Loop BB5_16 Depth 2
	testl	%ebx, %ebx
	jle	.LBB5_5
# %bb.3:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB5_2 Depth=1
	xorl	%ecx, %ecx
.LBB5_4:                                # %.lr.ph
                                        #   Parent Loop BB5_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r15,%rcx,4), %xmm0
	movsd	%xmm0, (%rax,%rcx,8)
	incq	%rcx
	cmpq	%rcx, %rsi
	jne	.LBB5_4
.LBB5_5:                                # %.preheader50
                                        #   in Loop: Header=BB5_2 Depth=1
	testl	%ebp, %ebp
	jle	.LBB5_13
# %bb.6:                                # %.preheader.lr.ph
                                        #   in Loop: Header=BB5_2 Depth=1
	movq	%r9, %rcx
	imulq	8(%rsp), %rcx                   # 8-byte Folded Reload
	movq	16(%rsp), %r10                  # 8-byte Reload
	leaq	(%r10,%rcx,4), %r10
	movq	24(%rsp), %rcx                  # 8-byte Reload
	xorl	%r12d, %r12d
.LBB5_7:                                # %.preheader
                                        #   Parent Loop BB5_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB5_9 Depth 3
	testl	%ebx, %ebx
	jle	.LBB5_12
# %bb.8:                                # %.lr.ph54
                                        #   in Loop: Header=BB5_7 Depth=2
	movl	(%r10,%r12,4), %r13d
	xorps	%xmm0, %xmm0
	cvtsi2ss	%r13d, %xmm0
	movq	%rcx, %r11
	xorl	%r14d, %r14d
.LBB5_9:                                #   Parent Loop BB5_2 Depth=1
                                        #     Parent Loop BB5_7 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	testl	%r13d, %r13d
	jle	.LBB5_11
# %bb.10:                               #   in Loop: Header=BB5_9 Depth=3
	movss	(%r11), %xmm1                   # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm1
	cvtss2sd	%xmm1, %xmm1
	addsd	(%rax,%r14,8), %xmm1
	movsd	%xmm1, (%rax,%r14,8)
.LBB5_11:                               #   in Loop: Header=BB5_9 Depth=3
	incq	%r14
	addq	%r8, %r11
	cmpq	%r14, %rsi
	jne	.LBB5_9
.LBB5_12:                               # %._crit_edge
                                        #   in Loop: Header=BB5_7 Depth=2
	incq	%r12
	addq	$4, %rcx
	cmpq	%rdi, %r12
	jne	.LBB5_7
.LBB5_13:                               # %.preheader49
                                        #   in Loop: Header=BB5_2 Depth=1
	testl	%ebx, %ebx
	jle	.LBB5_14
# %bb.15:                               # %.lr.ph58.preheader
                                        #   in Loop: Header=BB5_2 Depth=1
	xorl	%r10d, %r10d
	xorl	%r11d, %r11d
.LBB5_16:                               # %.lr.ph58
                                        #   Parent Loop BB5_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movslq	%r11d, %rcx
	movsd	(%rax,%rcx,8), %xmm0            # xmm0 = mem[0],zero
	ucomisd	(%rax,%r10,8), %xmm0
	movl	%r10d, %ecx
	ja	.LBB5_18
# %bb.17:                               # %.lr.ph58
                                        #   in Loop: Header=BB5_16 Depth=2
	movl	%r11d, %ecx
.LBB5_18:                               # %.lr.ph58
                                        #   in Loop: Header=BB5_16 Depth=2
	incq	%r10
	movl	%ecx, %r11d
	cmpq	%r10, %rsi
	jne	.LBB5_16
	jmp	.LBB5_19
.LBB5_14:                               #   in Loop: Header=BB5_2 Depth=1
	xorl	%ecx, %ecx
.LBB5_19:                               # %._crit_edge59
                                        #   in Loop: Header=BB5_2 Depth=1
	movq	32(%rsp), %r10                  # 8-byte Reload
	movl	%ecx, (%r10,%r9,4)
	incq	%r9
	cmpq	%rdx, %r9
	jne	.LBB5_2
.LBB5_20:                               # %._crit_edge61
	movq	%rax, %rdi
	addq	$40, %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
	jmp	free                            # TAILCALL
.Lfunc_end5:
	.size	_Z11assignClassPiPfS0_S_iii, .Lfunc_end5-_Z11assignClassPiPfS0_S_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z15createIntMatrixii           # -- Begin function _Z15createIntMatrixii
	.type	_Z15createIntMatrixii,@function
_Z15createIntMatrixii:                  # @_Z15createIntMatrixii
	.cfi_startproc
# %bb.0:
	imull	%esi, %edi
	movslq	%edi, %rsi
	movl	$4, %edi
	jmp	calloc                          # TAILCALL
.Lfunc_end6:
	.size	_Z15createIntMatrixii, .Lfunc_end6-_Z15createIntMatrixii
	.cfi_endproc
                                        # -- End function
	.globl	_Z17createFloatMatrixii         # -- Begin function _Z17createFloatMatrixii
	.type	_Z17createFloatMatrixii,@function
_Z17createFloatMatrixii:                # @_Z17createFloatMatrixii
	.cfi_startproc
# %bb.0:
	imull	%esi, %edi
	movslq	%edi, %rsi
	movl	$4, %edi
	jmp	calloc                          # TAILCALL
.Lfunc_end7:
	.size	_Z17createFloatMatrixii, .Lfunc_end7-_Z17createFloatMatrixii
	.cfi_endproc
                                        # -- End function
	.globl	_Z12createVectori               # -- Begin function _Z12createVectori
	.type	_Z12createVectori,@function
_Z12createVectori:                      # @_Z12createVectori
	.cfi_startproc
# %bb.0:
	movslq	%edi, %rsi
	movl	$4, %edi
	jmp	calloc                          # TAILCALL
.Lfunc_end8:
	.size	_Z12createVectori, .Lfunc_end8-_Z12createVectori
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z11getAccuracyPiS_i
.LCPI9_0:
	.long	0x3f800000                      # float 1
	.text
	.globl	_Z11getAccuracyPiS_i
	.type	_Z11getAccuracyPiS_i,@function
_Z11getAccuracyPiS_i:                   # @_Z11getAccuracyPiS_i
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB9_1
# %bb.3:                                # %.lr.ph.preheader
	movl	%edx, %eax
	xorps	%xmm2, %xmm2
	xorl	%ecx, %ecx
	movss	.LCPI9_0(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	movaps	%xmm2, %xmm0
.LBB9_4:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	(%rdi,%rcx,4), %r8d
	addss	%xmm1, %xmm0
	cmpl	(%rsi,%rcx,4), %r8d
	je	.LBB9_6
# %bb.5:                                # %.lr.ph
                                        #   in Loop: Header=BB9_4 Depth=1
	movaps	%xmm2, %xmm0
.LBB9_6:                                # %.lr.ph
                                        #   in Loop: Header=BB9_4 Depth=1
	incq	%rcx
	movaps	%xmm0, %xmm2
	cmpq	%rcx, %rax
	jne	.LBB9_4
	jmp	.LBB9_2
.LBB9_1:
	xorps	%xmm0, %xmm0
.LBB9_2:                                # %._crit_edge
	xorps	%xmm1, %xmm1
	cvtsi2ss	%edx, %xmm1
	divss	%xmm1, %xmm0
	retq
.Lfunc_end9:
	.size	_Z11getAccuracyPiS_i, .Lfunc_end9-_Z11getAccuracyPiS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z12rotateMatrixPiS_ii          # -- Begin function _Z12rotateMatrixPiS_ii
	.type	_Z12rotateMatrixPiS_ii,@function
_Z12rotateMatrixPiS_ii:                 # @_Z12rotateMatrixPiS_ii
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB10_7
# %bb.1:                                # %.preheader.lr.ph
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	movl	%edx, %eax
	movl	%ecx, %edx
	leaq	(,%rax,4), %r8
	xorl	%r9d, %r9d
	xorl	%r10d, %r10d
.LBB10_2:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_4 Depth 2
	testl	%ecx, %ecx
	jle	.LBB10_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB10_2 Depth=1
	movl	%r9d, %r11d
	leaq	(%rdi,%r11,4), %r11
	movq	%rsi, %rbx
	xorl	%r14d, %r14d
.LBB10_4:                               #   Parent Loop BB10_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r11,%r14,4), %ebp
	movl	%ebp, (%rbx)
	incq	%r14
	addq	%r8, %rbx
	cmpq	%r14, %rdx
	jne	.LBB10_4
.LBB10_5:                               # %._crit_edge
                                        #   in Loop: Header=BB10_2 Depth=1
	incq	%r10
	addl	%ecx, %r9d
	addq	$4, %rsi
	cmpq	%rax, %r10
	jne	.LBB10_2
# %bb.6:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %rbp
.LBB10_7:                               # %._crit_edge19
	retq
.Lfunc_end10:
	.size	_Z12rotateMatrixPiS_ii, .Lfunc_end10-_Z12rotateMatrixPiS_ii
	.cfi_endproc
                                        # -- End function
	.globl	_Z13rotateMatrixFPfS_ii         # -- Begin function _Z13rotateMatrixFPfS_ii
	.type	_Z13rotateMatrixFPfS_ii,@function
_Z13rotateMatrixFPfS_ii:                # @_Z13rotateMatrixFPfS_ii
	.cfi_startproc
# %bb.0:
	testl	%edx, %edx
	jle	.LBB11_7
# %bb.1:                                # %.preheader.lr.ph
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	%edx, %eax
	movl	%ecx, %edx
	leaq	(,%rax,4), %r8
	xorl	%r9d, %r9d
	xorl	%r10d, %r10d
.LBB11_2:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB11_4 Depth 2
	testl	%ecx, %ecx
	jle	.LBB11_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB11_2 Depth=1
	movl	%r9d, %r11d
	leaq	(%rdi,%r11,4), %r11
	movq	%rsi, %rbx
	xorl	%r14d, %r14d
.LBB11_4:                               #   Parent Loop BB11_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r11,%r14,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rbx)
	incq	%r14
	addq	%r8, %rbx
	cmpq	%r14, %rdx
	jne	.LBB11_4
.LBB11_5:                               # %._crit_edge
                                        #   in Loop: Header=BB11_2 Depth=1
	incq	%r10
	addl	%ecx, %r9d
	addq	$4, %rsi
	cmpq	%rax, %r10
	jne	.LBB11_2
# %bb.6:
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
.LBB11_7:                               # %._crit_edge19
	retq
.Lfunc_end11:
	.size	_Z13rotateMatrixFPfS_ii, .Lfunc_end11-_Z13rotateMatrixFPfS_ii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z16getTheProbablityfff
.LCPI12_0:
	.quad	0x401921fb54442d18              # double 6.2831853071795862
.LCPI12_1:
	.quad	0x3ff0000000000000              # double 1
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI12_2:
	.long	0x3f800000                      # float 1
.LCPI12_4:
	.long	0x7f800000                      # float +Inf
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI12_3:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.text
	.globl	_Z16getTheProbablityfff
	.type	_Z16getTheProbablityfff,@function
_Z16getTheProbablityfff:                # @_Z16getTheProbablityfff
	.cfi_startproc
# %bb.0:
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movaps	%xmm0, %xmm3
	cvtss2sd	%xmm2, %xmm2
	movsd	.LCPI12_0(%rip), %xmm0          # xmm0 = mem[0],zero
	mulsd	%xmm2, %xmm0
	xorpd	%xmm4, %xmm4
	ucomisd	%xmm4, %xmm0
	jb	.LBB12_2
# %bb.1:
	sqrtsd	%xmm0, %xmm0
	jmp	.LBB12_3
.LBB12_2:                               # %call.sqrt
	movsd	%xmm2, 8(%rsp)                  # 8-byte Spill
	movss	%xmm3, 20(%rsp)                 # 4-byte Spill
	movss	%xmm1, 16(%rsp)                 # 4-byte Spill
	callq	sqrt
	movss	16(%rsp), %xmm1                 # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	movss	20(%rsp), %xmm3                 # 4-byte Reload
                                        # xmm3 = mem[0],zero,zero,zero
	movsd	8(%rsp), %xmm2                  # 8-byte Reload
                                        # xmm2 = mem[0],zero
.LBB12_3:                               # %.split
	movsd	.LCPI12_1(%rip), %xmm4          # xmm4 = mem[0],zero
	divsd	%xmm0, %xmm4
	xorps	%xmm0, %xmm0
	cvtsd2ss	%xmm4, %xmm0
	movss	%xmm0, 8(%rsp)                  # 4-byte Spill
	subss	%xmm1, %xmm3
	mulss	%xmm3, %xmm3
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm3, %xmm0
	addsd	%xmm2, %xmm2
	divsd	%xmm2, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	callq	expf
	movss	.LCPI12_2(%rip), %xmm1          # xmm1 = mem[0],zero,zero,zero
	divss	%xmm0, %xmm1
	mulss	8(%rsp), %xmm1                  # 4-byte Folded Reload
	movaps	%xmm1, %xmm0
	callq	log10f
	movaps	.LCPI12_3(%rip), %xmm1          # xmm1 = [NaN,NaN,NaN,NaN]
	andps	%xmm0, %xmm1
	ucomiss	.LCPI12_4(%rip), %xmm1
	xorps	%xmm1, %xmm1
	je	.LBB12_5
# %bb.4:                                # %.split
	movaps	%xmm0, %xmm1
.LBB12_5:                               # %.split
	movaps	%xmm1, %xmm0
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end12:
	.size	_Z16getTheProbablityfff, .Lfunc_end12-_Z16getTheProbablityfff
	.cfi_endproc
                                        # -- End function
	.globl	_Z32assignClassUsingMeanVarianceDataPfS_iiiPiS0_ # -- Begin function _Z32assignClassUsingMeanVarianceDataPfS_iiiPiS0_
	.type	_Z32assignClassUsingMeanVarianceDataPfS_iiiPiS0_,@function
_Z32assignClassUsingMeanVarianceDataPfS_iiiPiS0_: # @_Z32assignClassUsingMeanVarianceDataPfS_iiiPiS0_
	.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, 32(%rsp)                   # 8-byte Spill
	movq	%rdi, 24(%rsp)                  # 8-byte Spill
	testl	%r8d, %r8d
	jle	.LBB13_14
# %bb.1:                                # %.lr.ph74
	movq	%rsi, %r14
	movslq	%ecx, %rax
	movl	%r8d, %edx
	movq	%rdx, 40(%rsp)                  # 8-byte Spill
	movl	%eax, %r13d
	shlq	$2, %rax
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	xorl	%esi, %esi
	xorps	%xmm1, %xmm1
	movl	%ecx, 16(%rsp)                  # 4-byte Spill
.LBB13_2:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB13_4 Depth 2
	xorps	%xmm0, %xmm0
	xorps	%xmm2, %xmm2
	testl	%ecx, %ecx
	jle	.LBB13_12
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB13_2 Depth=1
	movq	32(%rsp), %rax                  # 8-byte Reload
	movq	%rsi, 56(%rsp)                  # 8-byte Spill
	movl	(%rax,%rsi,4), %eax
	leal	(,%rax,4), %edi
	imull	%ecx, %edi
	leal	1(,%rax,4), %edx
	imull	%ecx, %edx
	leal	2(,%rax,4), %esi
	imull	%ecx, %esi
	leal	3(,%rax,4), %eax
	imull	%ecx, %eax
	movslq	%edi, %rcx
	movslq	%edx, %rdx
	movslq	%esi, %rsi
	cltq
	movq	24(%rsp), %rdi                  # 8-byte Reload
	leaq	(%rdi,%rcx,4), %rcx
	movq	%rcx, 64(%rsp)                  # 8-byte Spill
	leaq	(%rdi,%rdx,4), %r15
	leaq	(%rdi,%rsi,4), %rbp
	leaq	(%rdi,%rax,4), %r12
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	xorl	%ebx, %ebx
.LBB13_4:                               #   Parent Loop BB13_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r14,%rbx,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm0
	jbe	.LBB13_6
# %bb.5:                                #   in Loop: Header=BB13_4 Depth=2
	movq	64(%rsp), %rax                  # 8-byte Reload
	movss	(%rax,%rbx,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	movss	%xmm2, 20(%rsp)                 # 4-byte Spill
	movss	(%r15,%rbx,4), %xmm2            # xmm2 = mem[0],zero,zero,zero
	callq	_Z16getTheProbablityfff
	movss	12(%rsp), %xmm1                 # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm1
	movss	%xmm1, 12(%rsp)                 # 4-byte Spill
	movss	(%rbp,%rbx,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	movss	(%r12,%rbx,4), %xmm2            # xmm2 = mem[0],zero,zero,zero
	movss	(%r14,%rbx,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	callq	_Z16getTheProbablityfff
	movss	20(%rsp), %xmm2                 # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	xorps	%xmm1, %xmm1
	addss	%xmm0, %xmm2
.LBB13_6:                               #   in Loop: Header=BB13_4 Depth=2
	incq	%rbx
	cmpq	%rbx, %r13
	jne	.LBB13_4
# %bb.7:                                # %._crit_edge
                                        #   in Loop: Header=BB13_2 Depth=1
	ucomiss	%xmm1, %xmm2
	seta	%al
	movq	56(%rsp), %rsi                  # 8-byte Reload
	movss	12(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	jbe	.LBB13_10
# %bb.8:                                # %._crit_edge
                                        #   in Loop: Header=BB13_2 Depth=1
	ucomiss	%xmm1, %xmm0
	jbe	.LBB13_10
# %bb.9:                                #   in Loop: Header=BB13_2 Depth=1
	ucomiss	%xmm0, %xmm2
	seta	%al
	movl	16(%rsp), %ecx                  # 4-byte Reload
	jmp	.LBB13_13
.LBB13_10:                              #   in Loop: Header=BB13_2 Depth=1
	ucomiss	%xmm1, %xmm2
	movl	16(%rsp), %ecx                  # 4-byte Reload
	ja	.LBB13_13
# %bb.11:                               #   in Loop: Header=BB13_2 Depth=1
	ucomiss	%xmm1, %xmm0
	ja	.LBB13_13
.LBB13_12:                              # %.thread91
                                        #   in Loop: Header=BB13_2 Depth=1
	ucomiss	%xmm0, %xmm2
	seta	%al
.LBB13_13:                              #   in Loop: Header=BB13_2 Depth=1
	movzbl	%al, %eax
	movq	128(%rsp), %rdx
	movl	%eax, (%rdx,%rsi,4)
	incq	%rsi
	addq	48(%rsp), %r14                  # 8-byte Folded Reload
	cmpq	40(%rsp), %rsi                  # 8-byte Folded Reload
	jne	.LBB13_2
.LBB13_14:                              # %._crit_edge75
	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
.Lfunc_end13:
	.size	_Z32assignClassUsingMeanVarianceDataPfS_iiiPiS0_, .Lfunc_end13-_Z32assignClassUsingMeanVarianceDataPfS_iiiPiS0_
	.cfi_endproc
                                        # -- End function
	.globl	_Z51assignClassUsingMeanVarianceDataAndFeatureSelectionPfS_PiiiiiS0_S0_ # -- Begin function _Z51assignClassUsingMeanVarianceDataAndFeatureSelectionPfS_PiiiiiS0_S0_
	.type	_Z51assignClassUsingMeanVarianceDataAndFeatureSelectionPfS_PiiiiiS0_S0_,@function
_Z51assignClassUsingMeanVarianceDataAndFeatureSelectionPfS_PiiiiiS0_S0_: # @_Z51assignClassUsingMeanVarianceDataAndFeatureSelectionPfS_PiiiiiS0_S0_
	.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	$88, %rsp
	.cfi_def_cfa_offset 144
	.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	%rdx, 32(%rsp)                  # 8-byte Spill
	movq	%rsi, 24(%rsp)                  # 8-byte Spill
	movl	144(%rsp), %eax
	testl	%eax, %eax
	jle	.LBB14_14
# %bb.1:                                # %.lr.ph79
	movq	%rdi, %r12
	movslq	%r8d, %rcx
	movq	%rcx, 16(%rsp)                  # 8-byte Spill
	movl	%eax, %eax
	movq	%rax, 40(%rsp)                  # 8-byte Spill
	movl	%r9d, %ebx
	xorl	%edx, %edx
	xorps	%xmm1, %xmm1
	movl	%r9d, 8(%rsp)                   # 4-byte Spill
.LBB14_2:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB14_4 Depth 2
	xorps	%xmm2, %xmm2
	xorps	%xmm0, %xmm0
	testl	%r9d, %r9d
	jle	.LBB14_12
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB14_2 Depth=1
	movq	152(%rsp), %rax
	movl	(%rax,%rdx,4), %eax
	leal	(,%rax,4), %ecx
	movq	%rdx, 48(%rsp)                  # 8-byte Spill
	movq	16(%rsp), %rsi                  # 8-byte Reload
	imulq	%rsi, %rdx
	imull	%esi, %ecx
	leal	1(,%rax,4), %r8d
	leal	2(,%rax,4), %r10d
	leal	3(,%rax,4), %r11d
                                        # kill: def $eax killed $eax killed $rax
	imull	%r9d, %eax
	imull	%esi, %r8d
	movq	%r8, 80(%rsp)                   # 8-byte Spill
	imull	%esi, %r10d
	movq	%r10, 72(%rsp)                  # 8-byte Spill
	imull	%esi, %r11d
	movq	%r11, 64(%rsp)                  # 8-byte Spill
	cltq
	movq	32(%rsp), %rsi                  # 8-byte Reload
	leaq	(%rsi,%rax,4), %r15
	movq	24(%rsp), %rax                  # 8-byte Reload
	leaq	(%rax,%rdx,4), %r13
	movslq	%ecx, %rax
	movq	%rax, 56(%rsp)                  # 8-byte Spill
	xorl	%r14d, %r14d
	movss	%xmm0, 4(%rsp)                  # 4-byte Spill
.LBB14_4:                               #   Parent Loop BB14_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movslq	(%r15,%r14,4), %rbp
	movss	(%r13,%rbp,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm0
	jbe	.LBB14_6
# %bb.5:                                #   in Loop: Header=BB14_4 Depth=2
	movq	%rbp, %rax
	addq	56(%rsp), %rax                  # 8-byte Folded Reload
	movss	(%r12,%rax,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	movq	80(%rsp), %rax                  # 8-byte Reload
	addl	%ebp, %eax
	cltq
	movss	%xmm2, 12(%rsp)                 # 4-byte Spill
	movss	(%r12,%rax,4), %xmm2            # xmm2 = mem[0],zero,zero,zero
	callq	_Z16getTheProbablityfff
	movss	4(%rsp), %xmm1                  # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	addss	%xmm0, %xmm1
	movss	%xmm1, 4(%rsp)                  # 4-byte Spill
	movq	72(%rsp), %rax                  # 8-byte Reload
	addl	%ebp, %eax
	cltq
	movss	(%r12,%rax,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	movq	64(%rsp), %rax                  # 8-byte Reload
	addl	%ebp, %eax
	cltq
	movss	(%r12,%rax,4), %xmm2            # xmm2 = mem[0],zero,zero,zero
	movss	(%r13,%rbp,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	callq	_Z16getTheProbablityfff
	movss	12(%rsp), %xmm2                 # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	xorps	%xmm1, %xmm1
	addss	%xmm0, %xmm2
.LBB14_6:                               #   in Loop: Header=BB14_4 Depth=2
	incq	%r14
	cmpq	%r14, %rbx
	jne	.LBB14_4
# %bb.7:                                # %._crit_edge
                                        #   in Loop: Header=BB14_2 Depth=1
	ucomiss	%xmm1, %xmm2
	seta	%al
	movq	48(%rsp), %rdx                  # 8-byte Reload
	movss	4(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	jbe	.LBB14_10
# %bb.8:                                # %._crit_edge
                                        #   in Loop: Header=BB14_2 Depth=1
	ucomiss	%xmm1, %xmm0
	jbe	.LBB14_10
# %bb.9:                                #   in Loop: Header=BB14_2 Depth=1
	ucomiss	%xmm0, %xmm2
	seta	%al
	movl	8(%rsp), %r9d                   # 4-byte Reload
	jmp	.LBB14_13
.LBB14_10:                              #   in Loop: Header=BB14_2 Depth=1
	ucomiss	%xmm1, %xmm2
	movl	8(%rsp), %r9d                   # 4-byte Reload
	ja	.LBB14_13
# %bb.11:                               #   in Loop: Header=BB14_2 Depth=1
	ucomiss	%xmm1, %xmm0
	ja	.LBB14_13
.LBB14_12:                              # %.thread96
                                        #   in Loop: Header=BB14_2 Depth=1
	ucomiss	%xmm0, %xmm2
	seta	%al
.LBB14_13:                              #   in Loop: Header=BB14_2 Depth=1
	movzbl	%al, %eax
	movq	160(%rsp), %rcx
	movl	%eax, (%rcx,%rdx,4)
	incq	%rdx
	cmpq	40(%rsp), %rdx                  # 8-byte Folded Reload
	jne	.LBB14_2
.LBB14_14:                              # %._crit_edge80
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end14:
	.size	_Z51assignClassUsingMeanVarianceDataAndFeatureSelectionPfS_PiiiiiS0_S0_, .Lfunc_end14-_Z51assignClassUsingMeanVarianceDataAndFeatureSelectionPfS_PiiiiiS0_S0_
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	" %f"
	.size	.L.str, 4

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

	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_

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

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

	.end_amdgpu_metadata
