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

//NUMERO BLOQUES = INTEGERMASALTO(NUMVERTICES/MAXTRHEADSXBLOCK)
//VARIABLES GLOBALES
#define NUMVERTICES 5      //MAXIMUM 300
#define MAXTRHEADSXBLOCK 32 //[1 - 32]

//ID gpudevice that is used
int gpudev = 0;

//Graph representation with
int *EG;    //Double array of edges |NUMVERTICES|
int *VG;    //Double array of vertices

int C;      //Current vertex INDEX
int NUMBEREDGES;

//MST edge list: Shows the path that is followed.
int *R1source;
int *R2destination;
int *R3weigth;

//Temporal arrays used for reduction results
int *T1weights;
int *T2indexes;

//------- FUNCIONES --------
void writeFile(char* filename, char* content)
{
	FILE *fp;
	int error;
	
	//Open a text file for append stream to the end
	//If there is no file, it is created
	fp = fopen(filename,"a+");
	

	//Write content
	error = fputs(content,fp);
	if( error  == EOF )
	{
		printf("Error al escribir en archivo!\n");
		printf("ERROR: %i = %s\n", error ,strerror(error));
		//clearerr(fp);
		//fflush(stdout);
		//Llamada recursiva para ver si ya se hace la escritura sin error
		//writeFile(filename,content);
		
	}//Fin if 1
	
	//Cerrar archivo
	fclose(fp);
	
}//Fin writeFile
//--------------------------------------------------------------
void printDoubleArray(int *VX)
{
    int lengthArray = NUMVERTICES;

    for(int i = 0; i <lengthArray; i++)
    {
        printf("%i ", VX[i]);

    }//End for 2

    printf("\n");

    for(int i = lengthArray; i < (lengthArray*2); i++)
    {
         printf("%i ",VX[i]);

    }//End for 2

    printf("\n");

}//Fin funcion printDoubleArray
//------------------------
void printArrayRange(int *VX,int start,int end)
{

    for(int i = start; i <= end; i++)
    {
        printf("%2i ", VX[i]);

    }//End for 2

    printf("\n");

}//Fin funcion printArrayRange
//------------------------
/*
*Function that creates the vaules of the graph
*in the strucutre.
*/
void setGraph()
{
    //Asign and initialize memory for the double array of integers
    //Because is a doble array it is multiplied by 2 only
    VG = (int *) calloc(NUMVERTICES*2, NUMVERTICES*2*sizeof(int) );
    
    int numberEdges = 0;
    int randValue = 0;

    //Inicializacion valores VG
    for (int i = 0; i < NUMVERTICES; i++)
    {
        //Set the index of the Vertex
        VG[i] = i;
        //Set in random way the # of vertices to 
        //wich this vertex is connected

        //#Of vertices can not be 0,becuase all the veritces
        //have to be connected so ensure that at least all
        // the nodes are connected to at leas 2 other vertices
        randValue = rand() % (NUMVERTICES-2) +2;
        VG[i+NUMVERTICES] = randValue;
        //Keep track of the number edges
        numberEdges = numberEdges + randValue;

    }//Fin for 1

    //!!!SAVE IN GLOBAL VARIABLE!!!
    NUMBEREDGES = numberEdges;

    //----------------
    printf("-- Source Vertex --\n");
    printDoubleArray(VG);
    printf("------\n");
    printf("TOTAL EDGES: %i\n",numberEdges);
    //----------------

    //Asign and initialize memory for the double array of integers
    //Because is a doble array it is multiplied by 2 only
    EG = (int *) calloc(numberEdges*2,numberEdges*2*sizeof(int));

    //Initialize EDGE Double array values
    int indxEdges = 0;

    for(int i = 0; i < NUMVERTICES; i++)
    {
        //Num of vertices to wich vertex i has a path
        int numVerticesConn = VG[i+NUMVERTICES];

        //1)Set the destinatio id of the vertex, which can not
        //be repeated and can not be the same as the source
        //vertex i
        int indxDestination = 0;

        //2)Set randomly the value of the weight of edge 1)
        //values of weight from 1 - 100 
        for(int j = 0; j < numVerticesConn; j++)
        {
            //1)
            //Ojo: indxDestination = j a menos que se encuentr
            //que source = destino; en ese caso y por el resto
            //del for j, indxDestination ira uno arriba que j
            if( i == j )
            {
                indxDestination++;
            }//End if

            EG[indxEdges] = indxDestination;

            //2)
            EG[indxEdges+numberEdges] = rand() % (100) +1;

            indxEdges++;
            indxDestination++; 

        }//End for 3

    }//Fin for 2

    //----------------
    printf("-- Destination vertex --\n");
    printArrayRange(EG,0,numberEdges-1);
    printf("-- Weigth of Edge --\n");
    printArrayRange(EG,numberEdges,(numberEdges*2)-1);
    //----------------

}//Fin funcion setGraph
//--------------------------------
//Function that initializes values of R1,R2,R3 according to
//the Root vertex; and also define and initializes with 0s
//the temporal arrays
void setVariables()
{
    //Rs length = |NUMVERTICES|-1 because final path always
    //has one less than the #of vertices 
    R1source = (int *)calloc(NUMVERTICES-1,NUMVERTICES-1*sizeof(int));
    R2destination = (int *)calloc(NUMVERTICES-1,NUMVERTICES-1*sizeof(int));
    R3weigth = (int *)calloc(NUMVERTICES-1,NUMVERTICES-1*sizeof(int));

    //Look for the actual weights in VE and VG
    //for the source and destination and in case
    //of not being found asign 0 as the weight
    int numDestinations = VG[C+NUMVERTICES];

    int startIndex = 0;
    for(int k = 0; k < C; k++)
    {
        startIndex = startIndex+VG[k+NUMVERTICES];
    }//End for

    numDestinations = numDestinations+startIndex;

    //----------
    //printf("Range of values in EG(%i - %i)\n", startIndex, numDestinations);
    //----------
    
    //Set by default all the edges taking as the origin 
    //the root source, to all posible destinations
    int indxValidDestinations = -1;
    for(int i = 0; i < NUMVERTICES; i++)
    {

        //Only do not take as destination when source
        //and destination are equal
        if(C != i)
        {
            indxValidDestinations++;

            //Set source index
            R1source[indxValidDestinations] = C;
            R2destination[indxValidDestinations] = i;

            //Recorrer solamente los destinos para el source
            for(int j = startIndex; j < numDestinations; j++)
            {
                int idDestino = EG[j];

                //Se encontro el destino .:. poner peso correspondiente
                //----------
                //printf("%i == %i\n", idDestino, i);
                //----------
                if(idDestino == i)
                {
                    R3weigth[indxValidDestinations] = EG[j+NUMBEREDGES];
                }//End if

            }//End for 2

        }//End if


    }//Fin for 1

    //--------------
    //Recordar que para el print se considera un elemento menos
    //del limite superior ya que realmnete hace el print hasta
    //la posicion indicada
    //printf("R1: \n");
    //printArrayRange(R1source,0,NUMVERTICES-2);
    //printf("R2: \n");
    //printArrayRange(R2destination,0,NUMVERTICES-2);
    //printf("R3: \n");
    //printArrayRange(R3weigth,0,NUMVERTICES-2);
    //--------------


}//End fucntions setVariables
//--------------------------------
__global__ void kernel1(int *v, int *e, int *r1, int *r2, int *r3, int *c, int *t1, int *t2)
{
    //Define and construct T1 and T2
    //T1weights = (int *)calloc(MAXTRHEADSXBLOCK,MAXTRHEADSXBLOCK*sizeof(int));
    //T2indexes = (int *)calloc(MAXTRHEADSXBLOCK,MAXTRHEADSXBLOCK*sizeof(int));

    int idBloque = blockIdx.x;
    //ID de cada hilo (IDHILOBLOQUE+IDBLOQUE*HILOSPORBLOQUE)
    int i = threadIdx.x + idBloque*blockDim.x;

    //MIN REDUCTION AND WRITE RESULTS IN T1 AND T2

    //1)All threads in the grid make reduction operation on an array
    //of input data, ann obtain min weight and index of each thread
    
    //Solo trabajar |v|-1 hilos 
    //V-1 porque Rs son de size |V|-1
    if( i < NUMVERTICES-1 )
    {
        //----------------------
        //printf("| idh: %i | ", i);
        //printf("| %i %i | ", v[i],v[i+NUMVERTICES]);
        //----------------------

        //---------------------
        //printf("| %i  %i : %i | ", r1[i], r2[2], r3[2]);
        //printf(" %i < %i //", r3[i], t1[idBloque]);
        //---------------------
        //Con weiht mwnor al actual pero que sea un
        //weigth valido (diferente de 0)
        if(r3[i] < t1[idBloque] && r3[i] != 0 )
        {
            //Guardar Weight
            t1[idBloque] = r3[i];

            //Guardar Indice
            t2[idBloque] = r2[i];

        }//Nuevo menor encontrado

    }//End if

    //printf("| %i | ", r3[i]);

    //i < MAXNUMBEREDGES
    /*if(i < 15)
    {
                                 //[i+MAXNUMBEREDGES]
        printf("! %i %i ! ", e[i],e[i+15]);

    }//End if*/


    //2)All threads in every block make reduction of the result data in 1)
    //And obtain the minim value and index of every thread block

}//End function kernel1
//--------------------------------
__global__ void kernel2(int *numBlocks, int *weights, int *indxs)
{
    int N = numBlocks[0];

    //Reservar espacio en zona de memoria compartida
    __shared__ int temporal[MAXTRHEADSXBLOCK];
    __shared__ int tempids[MAXTRHEADSXBLOCK];

    //Indice de cada hilo en un solo bloque
    int i = threadIdx.x;
    
    if(i < N)
    {
        //Copiamos el vector de pesos en temporal y sincronizamos
        temporal[i] = weights[i];
        tempids[i] = indxs[i];
        __syncthreads();

        //---------------------
        //printf("|%i)  %i : %i | ", i ,weights[i], indxs[i]);
        //printf("| %i | ", temporal[i]);
        //----------------------

        //Inicio de reduccion paralela
        int salto = N/2;

        //log2(N) iteraciones
        while(salto)
        {
            //Solo trabajan la mitad de los hilos
            if(i < salto)
            {
                //Si se encuentra un vertex con peso menor se elige
                //como mejor candidato
                if( temporal[i+salto] < temporal[i] && temporal[i] != 0 )
                {
                    temporal[i] = temporal[i+salto];
                    tempids[i] = tempids[i+salto];

                }//End if

            }//End if 2
            __syncthreads();
            salto = salto/2;

        }//End while

        //Hilo 0 escibe el resultado final en memoria global
        if(i == 0)
        {
            weights[0] = temporal[0];
            indxs[0] = tempids[0];

        }//End if 2

    }//End if 1 


}//End function kernel2
//--------------------------------
//Comparing and update MST
__global__ void kernel3(int *v, int *e, int *r1, int *r3, int *c, int *numEdges)
{
    //1)Read current Vertex index

    //2)Fin the weight between current vertex and the
    //other vertices (n other Vertex in actual moment)

    //For every Vertex n if new weight with this C vertex is < old weight
    // Adjust corresponding values of R1 and R3 by :
    //if(W[n] < R3[n] )
    //R1[n] = C
    //R3[n] = W[n]

    //Look for the actual weights in VE and VG
    //for the source and destination and in case
    //of not being found asign 0 as the weight
    int NE = numEdges[0];
    int C = c[0];
    int numDestinations = v[C+NUMVERTICES];

    int startIndex = 0;
    for(int k = 0; k < C; k++)
    {
        startIndex = startIndex+v[k+NUMVERTICES];
    }//End for

    numDestinations = numDestinations+startIndex;

    //----------
    //printf("Range of values in EG(%i - %i)\n", startIndex, numDestinations);
    //----------

    int idBloque = blockIdx.x;
    //ID de cada hilo (IDHILOBLOQUE+IDBLOQUE*HILOSPORBLOQUE)
    int i = threadIdx.x + idBloque*blockDim.x;
    
    //Set by default all the edges taking as the origin 
    //the root source, to all posible destinations
    int indxValidDestinations = -1;
    if(i < NUMVERTICES)
    {

        //Only do not take as destination when source
        //and destination are equal
        if(C != i)
        {
            indxValidDestinations++;

            //Recorrer solamente los destinos para el source
            for(int j = startIndex; j < numDestinations; j++)
            {
                int idDestino = e[j];

                //Se encontro el destino .:. poner peso correspondiente
                //----------
                //printf("%i == %i\n", idDestino, i);
                //----------
                if(idDestino == i)
                {

                    if(e[j+NE] < r3[indxValidDestinations])
                    {
                        r3[indxValidDestinations] = e[j+NE];
                        r1[indxValidDestinations] = C;

                    }//End if

                }//End if

            }//End for 2

        }//End if


    }//Fin for 1
    

}//End function kernel3
//--------------------------------
void primMST(int *v, int *e, int *r1, int * r2, int *r3, int c)
{
    //Define size of CUDA grid
    int g_row = (int)ceil((float)NUMVERTICES/(float)MAXTRHEADSXBLOCK);
    int g_col = (int)ceil((float)NUMVERTICES/(float)MAXTRHEADSXBLOCK); 
    int numBloques = g_row;
    dim3 bloques(g_col,g_row);
    dim3 hilos(MAXTRHEADSXBLOCK,MAXTRHEADSXBLOCK);

    cudaEvent_t start, stop; 

    printf("Bloques: %i == %i \n", bloques, numBloques);
    printf("Hilos: %i \n", hilos);
    printf("Grid (%d,%d)\n", g_row, g_col); 

    //vARIABLES IN DEVICE
    int *VGD, *VED, *R1D, *R2D, *R3D;   //Arrays
    int *T1D, *T2D;
    int *CD, *NED;                      //Variables 

    //Define and construct T1 and T2? HERE
    T1weights = (int *)calloc(numBloques,numBloques*sizeof(int));
    T2indexes = (int *)calloc(numBloques,numBloques*sizeof(int));

    //Initialize temporal weights with a very high value
    //in order to make that any wieght is better than 
    //the init value
    for(int i = 0; i < numBloques; i++)
    {
        T1weights[i] = 99999;

    }//End for 1

    //--------------
    //Recordar que para el print se considera un elemento menos
    //del limite superior ya que realmnete hace el print hasta
    //la posicion indicada
    printf("R1: \n");
    printArrayRange(r1,0,NUMVERTICES-2);
    printf("R2: \n");
    printArrayRange(r2,0,NUMVERTICES-2);
    printf("R3: \n");
    printArrayRange(r3,0,NUMVERTICES-2);
    //--------------

    //TRANSFER FROM HOST (CPU) TO DEVICE GPU
    cudaSetDevice(gpudev);

    cudaEventCreate(&start); cudaEventCreate(&stop);
    cudaEventRecord(start,0); 

    //1)Asignar memoria para variables en GPU
    cudaMalloc(&VGD, NUMVERTICES*2*sizeof(int) );
    cudaMalloc(&VED, NUMBEREDGES*2*sizeof(int) );
    cudaMalloc(&R1D, (NUMVERTICES-1)*sizeof(int) );
    cudaMalloc(&R2D, (NUMVERTICES-1)*sizeof(int) );
    cudaMalloc(&R3D, (NUMVERTICES-1)*sizeof(int) );
    cudaMalloc(&T1D, (numBloques)*sizeof(int) );
    cudaMalloc(&T2D, (numBloques)*sizeof(int) );
    cudaMalloc(&CD, int(sizeof(int)) );
    cudaMalloc(&NED, int(sizeof(int)) );


    //INICIO LOOP |NUMVERTICES|-1 VECES
    int iCountVer = 0;

    while(iCountVer < NUMVERTICES-1)
    {
        //----
        printf("---- %i) ----- \n", iCountVer);
        printf("Current vertex: %i \n", c);
        //----

        //2)Copiar datos del host al device
        cudaMemcpy(VGD,v,NUMVERTICES*2*sizeof(int),cudaMemcpyDefault);
        cudaMemcpy(VED,e,NUMBEREDGES*2*sizeof(int),cudaMemcpyDefault);
        cudaMemcpy(R1D,r1,(NUMVERTICES-1)*sizeof(int),cudaMemcpyDefault);
        cudaMemcpy(R2D,r2,(NUMVERTICES-1)*sizeof(int),cudaMemcpyDefault);
        cudaMemcpy(R3D,r3,(NUMVERTICES-1)*sizeof(int),cudaMemcpyDefault);
        cudaMemcpy(T1D,T1weights,numBloques*sizeof(int),cudaMemcpyDefault);
        cudaMemcpy(T2D,T2indexes,numBloques*sizeof(int),cudaMemcpyDefault);
        cudaMemcpy(CD,&c,sizeof(int),cudaMemcpyDefault);
        cudaMemcpy(NED,&NUMBEREDGES,sizeof(int),cudaMemcpyDefault);

        //3)Ejecutar kernel
        //INVOQUE KERNEL 1 AND WRITE RESULTS IN T1 AND T2
        kernel1<<<bloques, hilos>>>(VGD,VED,R1D,R2D,R3D,CD,T1D,T2D);

        //4)Copiar datos del device al host
        //T1 Y T2
        
        // Valores de T1[0] y T2[0] son añadidos
        // a los correspondientes R1 Y R3
        //T2[0] sobreescribe a C
        cudaMemcpy(T1weights,T1D,numBloques*sizeof(int),cudaMemcpyDefault);
        cudaMemcpy(T2indexes,T2D,numBloques*sizeof(int),cudaMemcpyDefault);
        //---------------
        printf("\n Minimum weight found for each block (Global memory reduction) \n");
        printf("Id: \n");
        printArrayRange(T2indexes,0,numBloques-1);
        printf("Weight: \n");
        printArrayRange(T1weights,0,numBloques-1);
        //---------------

        //Verificar si se inicia al Kernel 2
        //MAXTRHEADSXBLOCK > numBloques > 1
        if(numBloques > 1)
        {
            //Definir variable en device
            int *NBD;

            //1)Asinar memoria para vairable en GPU/device
            cudaMalloc(&NBD, int(sizeof(int)) );

            //2)Copiar datos del host al device
            cudaMemcpy(NBD,&numBloques,sizeof(int),cudaMemcpyDefault);

            //3)ejecutar kermel2
            printf("Invoke Kernel2\n");
            kernel2<<<1,hilos>>>(NBD,T1D,T2D);

            //4)Copiar datos del device al host
            cudaMemcpy(T1weights,T1D,numBloques*sizeof(int),cudaMemcpyDefault);
            cudaMemcpy(T2indexes,T2D,numBloques*sizeof(int),cudaMemcpyDefault);

            //---------------
            printf("\n 2) Minimum weight found of each block (After shared memory reduction) \n");
            printf("Id: \n");
            printArrayRange(T2indexes,0,numBloques-1);
            printf("Weight: \n");
            printArrayRange(T1weights,0,numBloques-1);
            //---------------
            
            //5)liberar memoria NBD

        }//End if kernel2

        //---------------
        printf("Minimum weight found: %i for vertex with ID: %i \n", T1weights[0], T2indexes[0]);
        //---------------

        //ADDING NEW MST EDGE

        //1)Add previously found minimum weight Edge (T1[0] WEIGHT T2[0] EDGE)
        //to the MST by moving this Edge to the first position of R1 R2 R3
        r2[0] = T2indexes[0];  //R2[C] ? 
        r3[0] = T1weights[0];  //R3[C] ?

        //2)Saving current Vertex C= R2[T2[0]]
        c = r2[T2indexes[0]];

        //Copiar datos del host al device que han sido modificados
        cudaMemcpy(R2D,r2,(NUMVERTICES-1)*sizeof(int),cudaMemcpyDefault);
        cudaMemcpy(R3D,r3,(NUMVERTICES-1)*sizeof(int),cudaMemcpyDefault);
        cudaMemcpy(CD,&c,sizeof(int),cudaMemcpyDefault);

        //Kernel 3: Comparing and updating MST
        kernel3<<<bloques, hilos>>>(VGD,VED,R1D,R3D,CD,NED);

        //Copiar datos del device al host
        cudaMemcpy(r1,R1D,(NUMVERTICES-1)*sizeof(int),cudaMemcpyDefault);
        cudaMemcpy(r3,R3D,(NUMVERTICES-1)*sizeof(int),cudaMemcpyDefault);

        
        //--------------
        //Recordar que para el print se considera un elemento menos
        //del limite superior ya que realmnete hace el print hasta
        //la posicion indicada
        printf("--- MST ACTUALIZADO ---: \n");
        printf("R1: \n");
        printArrayRange(r1,0,NUMVERTICES-2);
        printf("R2: \n");
        printArrayRange(r2,0,NUMVERTICES-2);
        printf("R3: \n");
        printArrayRange(r3,0,NUMVERTICES-2);
        //--------------

        iCountVer++;

    }//End while
    
    //FIN LOOP |NUMVERTICES|-1 VECES


    //5) Liberar Memoria
    cudaFree(VGD);
    cudaFree(VED);
    cudaFree(R1D);
    cudaFree(R2D);
    cudaFree(R3D);
    cudaFree(T1D);
    cudaFree(T2D);
    cudaFree(CD);
    cudaFree(NED);

    cudaEventRecord(stop, 0); 
    cudaEventSynchronize(stop);

    float milliseconds = 0;
    char strvertices[10];
	char strtottime[15];

    cudaEventElapsedTime(&milliseconds, start, stop);

    //--- Escribir resultados en archivo txt ---
    //Convertir entero de numero de procesadores a cadena
    //Convertir int to char itoa(stringDestination,"%d",intValue)
    sprintf(strvertices,"%d",NUMVERTICES); 
    
    //Convert double to string
    sprintf(strtottime,"%f",milliseconds);

    //Append en archivo de resultados
    writeFile("resultados.txt",strvertices);
    writeFile("resultados.txt"," ");
    writeFile("resultados.txt",strtottime);
    writeFile("resultados.txt","\n");

}//En function primMST
//---- FIN FUNCIONES -----
//Inicio del programa
int main(int argc, char **argv)
{
    setGraph();
    
    //Set root vertex of the MST
    C = 2;

    setVariables();

    printf("IDs threads: \n");
    primMST(VG,EG,R1source,R2destination,R3weigth,C);
    printf("\n");


    printf("Fin del programa V4\n");

}//Fin del main
	.file	"tmpxft_00226d06_00000000-6_pmst.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2036:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2036:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0, @function
_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0:
.LFB2182:
	.cfi_startproc
	jmp	cudaMalloc@PLT
	.cfi_endproc
.LFE2182:
	.size	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0, .-_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"a+"
.LC1:
	.string	"Error al escribir en archivo!\n"
.LC2:
	.string	"ERROR: %i = %s\n"
	.text
	.globl	_Z9writeFilePcS_
	.type	_Z9writeFilePcS_, @function
_Z9writeFilePcS_:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	leaq	.LC0(%rip), %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	pushq	%rdx
	.cfi_def_cfa_offset 32
	call	fopen@PLT
	movq	%rbp, %rdi
	movq	%rax, %rsi
	movq	%rax, %rbx
	call	fputs@PLT
	incl	%eax
	jne	.L4
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	orl	$-1, %edi
	call	strerror@PLT
	orl	$-1, %edx
	movl	$2, %edi
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rcx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L4:
	popq	%rax
	.cfi_def_cfa_offset 24
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	fclose@PLT
	.cfi_endproc
.LFE2027:
	.size	_Z9writeFilePcS_, .-_Z9writeFilePcS_
	.section	.rodata.str1.1
.LC3:
	.string	"%i "
.LC4:
	.string	"\n"
	.text
	.globl	_Z16printDoubleArrayPi
	.type	_Z16printDoubleArrayPi, @function
_Z16printDoubleArrayPi:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC3(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 48
.L8:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r13, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incq	%rbx
	call	__printf_chk@PLT
	cmpq	$5, %rbx
	jne	.L8
	leaq	.LC4(%rip), %r12
	movl	$2, %edi
	xorl	%eax, %eax
	movq	%r12, %rsi
	call	__printf_chk@PLT
.L9:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r13, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incq	%rbx
	call	__printf_chk@PLT
	cmpq	$10, %rbx
	jne	.L9
	popq	%rdx
	.cfi_def_cfa_offset 40
	movq	%r12, %rsi
	popq	%rbx
	.cfi_def_cfa_offset 32
	movl	$2, %edi
	popq	%rbp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2028:
	.size	_Z16printDoubleArrayPi, .-_Z16printDoubleArrayPi
	.section	.rodata.str1.1
.LC5:
	.string	"%2i "
	.text
	.globl	_Z15printArrayRangePiii
	.type	_Z15printArrayRangePiii, @function
_Z15printArrayRangePiii:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC5(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movslq	%esi, %rbx
	pushq	%rcx
	.cfi_def_cfa_offset 48
.L14:
	cmpl	%ebx, %ebp
	jl	.L17
	movl	(%r12,%rbx,4), %edx
	movq	%r13, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incq	%rbx
	call	__printf_chk@PLT
	jmp	.L14
.L17:
	popq	%rdx
	.cfi_def_cfa_offset 40
	leaq	.LC4(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 32
	movl	$2, %edi
	popq	%rbp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2029:
	.size	_Z15printArrayRangePiii, .-_Z15printArrayRangePiii
	.section	.rodata.str1.1
.LC6:
	.string	"-- Source Vertex --\n"
.LC7:
	.string	"------\n"
.LC8:
	.string	"TOTAL EDGES: %i\n"
.LC9:
	.string	"-- Destination vertex --\n"
.LC10:
	.string	"-- Weigth of Edge --\n"
	.text
	.globl	_Z8setGraphv
	.type	_Z8setGraphv, @function
_Z8setGraphv:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$40, %esi
	movl	$10, %edi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$3, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	calloc@PLT
	movq	%rax, VG(%rip)
.L19:
	movq	VG(%rip), %rax
	leaq	0(,%rbp,4), %r13
	movl	%ebp, (%rax,%rbp,4)
	incq	%rbp
	call	rand@PLT
	cltd
	idivl	%r12d
	movq	VG(%rip), %rax
	addl	$2, %edx
	movl	%edx, 20(%rax,%r13)
	addl	%edx, %ebx
	cmpq	$5, %rbp
	jne	.L19
	leaq	.LC6(%rip), %rsi
	xorl	%eax, %eax
	leal	(%rbx,%rbx), %r13d
	movslq	%ebx, %r14
	movl	$2, %edi
	movl	%ebx, NUMBEREDGES(%rip)
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	call	__printf_chk@PLT
	movq	VG(%rip), %rdi
	call	_Z16printDoubleArrayPi
	leaq	.LC7(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%ebx, %edx
	leaq	.LC8(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movslq	%r13d, %rdi
	leaq	0(,%rdi,4), %rsi
	call	calloc@PLT
	movq	%rax, EG(%rip)
	leaq	0(,%r14,4), %rax
	movq	%rax, (%rsp)
.L23:
	movq	VG(%rip), %rax
	movslq	%r15d, %rbp
	xorl	%edi, %edi
	xorl	%esi, %esi
	salq	$2, %rbp
	movl	20(%rax,%r12,4), %r14d
.L20:
	cmpl	%r14d, %edi
	jge	.L27
	cmpl	%r12d, %edi
	jne	.L21
	incl	%esi
.L21:
	movq	EG(%rip), %rax
	movl	%edi, 12(%rsp)
	movl	%esi, 8(%rsp)
	movl	%esi, (%rax,%rbp)
	call	rand@PLT
	movl	$100, %ecx
	movq	EG(%rip), %r9
	movl	8(%rsp), %esi
	cltd
	movl	12(%rsp), %edi
	idivl	%ecx
	movq	(%rsp), %rax
	addq	%rbp, %r9
	incl	%esi
	incl	%edi
	addq	$4, %rbp
	incl	%edx
	movl	%edx, (%r9,%rax)
	jmp	.L20
.L27:
	xorl	%eax, %eax
	testl	%r14d, %r14d
	cmovns	%r14d, %eax
	incq	%r12
	addl	%eax, %r15d
	cmpq	$5, %r12
	jne	.L23
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	EG(%rip), %rdi
	leal	-1(%rbx), %edx
	xorl	%esi, %esi
	call	_Z15printArrayRangePiii
	leaq	.LC10(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	EG(%rip), %rdi
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	leal	-1(%r13), %edx
	movl	%ebx, %esi
	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	_Z15printArrayRangePiii
	.cfi_endproc
.LFE2030:
	.size	_Z8setGraphv, .-_Z8setGraphv
	.globl	_Z12setVariablesv
	.type	_Z12setVariablesv, @function
_Z12setVariablesv:
.LFB2031:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$1, %esi
	movl	$4, %edi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	pushq	%rdx
	.cfi_def_cfa_offset 48
	call	calloc@PLT
	movl	$1, %esi
	movl	$4, %edi
	movq	%rax, R1source(%rip)
	movq	%rax, %rbx
	call	calloc@PLT
	movl	$1, %esi
	movl	$4, %edi
	movq	%rax, R2destination(%rip)
	movq	%rax, %rbp
	call	calloc@PLT
	movq	VG(%rip), %rdx
	xorl	%edi, %edi
	movq	%rax, R3weigth(%rip)
	movq	%rax, %rcx
	movslq	C(%rip), %rax
	movl	20(%rdx,%rax,4), %r9d
	movq	%rax, %rsi
	xorl	%eax, %eax
.L29:
	cmpl	%eax, %esi
	jle	.L38
	addl	20(%rdx,%rax,4), %edi
	incq	%rax
	jmp	.L29
.L38:
	movq	EG(%rip), %r11
	addl	%edi, %r9d
	xorl	%eax, %eax
	orl	$-1, %r8d
	movl	NUMBEREDGES(%rip), %r12d
.L35:
	cmpl	%eax, %esi
	je	.L31
	incl	%r8d
	movslq	%r8d, %rdx
	movl	%esi, (%rbx,%rdx,4)
	leaq	0(,%rdx,4), %r13
	movl	%eax, 0(%rbp,%rdx,4)
	movslq	%edi, %rdx
.L32:
	cmpl	%edx, %r9d
	jle	.L31
	cmpl	%eax, (%r11,%rdx,4)
	jne	.L33
	leal	(%r12,%rdx), %r10d
	movslq	%r10d, %r10
	movl	(%r11,%r10,4), %r10d
	movl	%r10d, (%rcx,%r13)
.L33:
	incq	%rdx
	jmp	.L32
.L31:
	incl	%eax
	cmpl	$5, %eax
	jne	.L35
	popq	%rax
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z12setVariablesv, .-_Z12setVariablesv
	.globl	_Z40__device_stub__Z7kernel1PiS_S_S_S_S_S_S_PiS_S_S_S_S_S_S_
	.type	_Z40__device_stub__Z7kernel1PiS_S_S_S_S_S_S_PiS_S_S_S_S_S_S_, @function
_Z40__device_stub__Z7kernel1PiS_S_S_S_S_S_S_PiS_S_S_S_S_S_S_:
.LFB2058:
	.cfi_startproc
	endbr64
	subq	$216, %rsp
	.cfi_def_cfa_offset 224
	movq	224(%rsp), %rax
	movq	%rdi, 56(%rsp)
	leaq	88(%rsp), %rdi
	movq	%rsi, 48(%rsp)
	leaq	100(%rsp), %rsi
	movq	%rax, 8(%rsp)
	movq	232(%rsp), %rax
	movq	%rdx, 40(%rsp)
	leaq	72(%rsp), %rdx
	movq	%rcx, 32(%rsp)
	leaq	80(%rsp), %rcx
	movq	%r8, 24(%rsp)
	movq	%r9, 16(%rsp)
	movq	%rax, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	movl	$1, 96(%rsp)
	movq	%rax, 136(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 184(%rsp)
	movq	%rsp, %rax
	movq	%rax, 192(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 88(%rsp)
	movq	%rax, 100(%rsp)
	movl	$1, 108(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L39
	pushq	80(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z7kernel1PiS_S_S_S_S_S_S_(%rip), %rdi
	pushq	80(%rsp)
	.cfi_def_cfa_offset 240
	movq	116(%rsp), %rcx
	movl	124(%rsp), %r8d
	movq	104(%rsp), %rsi
	movl	112(%rsp), %edx
	leaq	152(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 232
	popq	%rdx
	.cfi_def_cfa_offset 224
.L39:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2058:
	.size	_Z40__device_stub__Z7kernel1PiS_S_S_S_S_S_S_PiS_S_S_S_S_S_S_, .-_Z40__device_stub__Z7kernel1PiS_S_S_S_S_S_S_PiS_S_S_S_S_S_S_
	.globl	_Z7kernel1PiS_S_S_S_S_S_S_
	.type	_Z7kernel1PiS_S_S_S_S_S_S_, @function
_Z7kernel1PiS_S_S_S_S_S_S_:
.LFB2059:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z7kernel1PiS_S_S_S_S_S_S_PiS_S_S_S_S_S_S_
	.cfi_endproc
.LFE2059:
	.size	_Z7kernel1PiS_S_S_S_S_S_S_, .-_Z7kernel1PiS_S_S_S_S_S_S_
	.globl	_Z30__device_stub__Z7kernel2PiS_S_PiS_S_
	.type	_Z30__device_stub__Z7kernel2PiS_S_PiS_S_, @function
_Z30__device_stub__Z7kernel2PiS_S_PiS_S_:
.LFB2060:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L44
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z7kernel2PiS_S_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L44:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L46
	call	__stack_chk_fail@PLT
.L46:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2060:
	.size	_Z30__device_stub__Z7kernel2PiS_S_PiS_S_, .-_Z30__device_stub__Z7kernel2PiS_S_PiS_S_
	.globl	_Z7kernel2PiS_S_
	.type	_Z7kernel2PiS_S_, @function
_Z7kernel2PiS_S_:
.LFB2061:
	.cfi_startproc
	endbr64
	jmp	_Z30__device_stub__Z7kernel2PiS_S_PiS_S_
	.cfi_endproc
.LFE2061:
	.size	_Z7kernel2PiS_S_, .-_Z7kernel2PiS_S_
	.globl	_Z36__device_stub__Z7kernel3PiS_S_S_S_S_PiS_S_S_S_S_
	.type	_Z36__device_stub__Z7kernel3PiS_S_S_S_S_PiS_S_S_S_S_, @function
_Z36__device_stub__Z7kernel3PiS_S_S_S_S_PiS_S_S_S_S_:
.LFB2062:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	movq	%rsp, %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L49
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z7kernel3PiS_S_S_S_S_(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L49:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L51
	call	__stack_chk_fail@PLT
.L51:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2062:
	.size	_Z36__device_stub__Z7kernel3PiS_S_S_S_S_PiS_S_S_S_S_, .-_Z36__device_stub__Z7kernel3PiS_S_S_S_S_PiS_S_S_S_S_
	.globl	_Z7kernel3PiS_S_S_S_S_
	.type	_Z7kernel3PiS_S_S_S_S_, @function
_Z7kernel3PiS_S_S_S_S_:
.LFB2063:
	.cfi_startproc
	endbr64
	jmp	_Z36__device_stub__Z7kernel3PiS_S_S_S_S_PiS_S_S_S_S_
	.cfi_endproc
.LFE2063:
	.size	_Z7kernel3PiS_S_S_S_S_, .-_Z7kernel3PiS_S_S_S_S_
	.section	.rodata.str1.1
.LC11:
	.string	"Bloques: %i == %i \n"
.LC12:
	.string	"Hilos: %i \n"
.LC13:
	.string	"Grid (%d,%d)\n"
.LC14:
	.string	"R1: \n"
.LC15:
	.string	"R2: \n"
.LC16:
	.string	"R3: \n"
.LC17:
	.string	"---- %i) ----- \n"
.LC18:
	.string	"Current vertex: %i \n"
.LC19:
	.string	"\n Minimum weight found for each block (Global memory reduction) \n"
.LC20:
	.string	"Id: \n"
.LC21:
	.string	"Weight: \n"
.LC22:
	.string	"Invoke Kernel2\n"
.LC23:
	.string	"\n 2) Minimum weight found of each block (After shared memory reduction) \n"
.LC24:
	.string	"Minimum weight found: %i for vertex with ID: %i \n"
.LC25:
	.string	"--- MST ACTUALIZADO ---: \n"
.LC27:
	.string	"%d"
.LC28:
	.string	"%f"
.LC29:
	.string	"resultados.txt"
.LC30:
	.string	" "
	.text
	.globl	_Z7primMSTPiS_S_S_S_i
	.type	_Z7primMSTPiS_S_S_S_i, @function
_Z7primMSTPiS_S_S_S_i:
.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	%rsi, %r14
	leaq	.LC11(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rcx, %rbp
	movl	$1, %ecx
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r8, %rbx
	movl	$1, %r8d
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	movl	%r9d, 28(%rsp)
	movq	%rdi, 8(%rsp)
	movl	$2, %edi
	movq	%rdx, (%rsp)
	movabsq	$4294967297, %rdx
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	movq	%rdx, 136(%rsp)
	movabsq	$137438953504, %rax
	movq	%rax, 148(%rsp)
	xorl	%eax, %eax
	movl	$1, 36(%rsp)
	movl	$1, 144(%rsp)
	movl	$1, 156(%rsp)
	call	__printf_chk@PLT
	movl	156(%rsp), %ecx
	movl	$2, %edi
	xorl	%eax, %eax
	movq	148(%rsp), %rdx
	leaq	.LC12(%rip), %rsi
	call	__printf_chk@PLT
	movl	$1, %edx
	movl	$1, %ecx
	xorl	%eax, %eax
	leaq	.LC13(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movslq	36(%rsp), %rdi
	leaq	0(,%rdi,4), %r15
	movq	%rdi, 16(%rsp)
	movq	%rdi, %r13
	movq	%r15, %rsi
	call	calloc@PLT
	movq	16(%rsp), %rdi
	movq	%r15, %rsi
	movq	%rax, T1weights(%rip)
	movq	%rax, %r12
	call	calloc@PLT
	xorl	%edx, %edx
	movq	%rax, T2indexes(%rip)
.L55:
	cmpl	%edx, %r13d
	jle	.L65
	movl	$99999, (%r12,%rdx,4)
	incq	%rdx
	jmp	.L55
.L65:
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	28(%rsp), %r15
	xorl	%r12d, %r12d
	leaq	.LC14(%rip), %rsi
	call	__printf_chk@PLT
	movq	(%rsp), %rdi
	movl	$3, %edx
	xorl	%esi, %esi
	call	_Z15printArrayRangePiii
	leaq	.LC15(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$3, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	_Z15printArrayRangePiii
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$3, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	_Z15printArrayRangePiii
	movl	gpudev(%rip), %edi
	call	cudaSetDevice@PLT
	leaq	40(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	48(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	40(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	leaq	56(%rsp), %rdi
	movl	$40, %esi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movl	NUMBEREDGES(%rip), %eax
	leaq	64(%rsp), %rdi
	leal	(%rax,%rax), %esi
	movslq	%esi, %rsi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	leaq	72(%rsp), %rdi
	movl	$16, %esi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	leaq	80(%rsp), %rdi
	movl	$16, %esi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	leaq	88(%rsp), %rdi
	movl	$16, %esi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movslq	36(%rsp), %rsi
	leaq	96(%rsp), %rdi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movslq	36(%rsp), %rsi
	leaq	104(%rsp), %rdi
	salq	$2, %rsi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	leaq	112(%rsp), %rdi
	movl	$4, %esi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	leaq	120(%rsp), %rdi
	movl	$4, %esi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
.L61:
	movl	%r12d, %edx
	leaq	.LC17(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	28(%rsp), %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC18(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rsi
	movq	56(%rsp), %rdi
	movl	$4, %ecx
	movl	$40, %edx
	call	cudaMemcpy@PLT
	movl	NUMBEREDGES(%rip), %eax
	movq	64(%rsp), %rdi
	movq	%r14, %rsi
	movl	$4, %ecx
	leal	(%rax,%rax), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movq	(%rsp), %rsi
	movq	72(%rsp), %rdi
	movl	$4, %ecx
	movl	$16, %edx
	call	cudaMemcpy@PLT
	movq	80(%rsp), %rdi
	movl	$4, %ecx
	movq	%rbp, %rsi
	movl	$16, %edx
	call	cudaMemcpy@PLT
	movq	88(%rsp), %rdi
	movl	$4, %ecx
	movq	%rbx, %rsi
	movl	$16, %edx
	call	cudaMemcpy@PLT
	movslq	36(%rsp), %rdx
	movq	96(%rsp), %rdi
	movl	$4, %ecx
	movq	T1weights(%rip), %rsi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movslq	36(%rsp), %rdx
	movq	104(%rsp), %rdi
	movl	$4, %ecx
	movq	T2indexes(%rip), %rsi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movq	112(%rsp), %rdi
	movl	$4, %ecx
	movq	%r15, %rsi
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	120(%rsp), %rdi
	movl	$4, %ecx
	movl	$4, %edx
	leaq	NUMBEREDGES(%rip), %rsi
	call	cudaMemcpy@PLT
	movl	156(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	148(%rsp), %rdx
	movq	136(%rsp), %rdi
	movl	144(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L57
	pushq	104(%rsp)
	.cfi_def_cfa_offset 280
	pushq	104(%rsp)
	.cfi_def_cfa_offset 288
	movq	128(%rsp), %r9
	movq	104(%rsp), %r8
	movq	96(%rsp), %rcx
	movq	88(%rsp), %rdx
	movq	80(%rsp), %rsi
	movq	72(%rsp), %rdi
	call	_Z40__device_stub__Z7kernel1PiS_S_S_S_S_S_S_PiS_S_S_S_S_S_S_
	popq	%rax
	.cfi_def_cfa_offset 280
	popq	%rdx
	.cfi_def_cfa_offset 272
.L57:
	movslq	36(%rsp), %rdx
	movq	96(%rsp), %rsi
	movl	$4, %ecx
	movq	T1weights(%rip), %rdi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movslq	36(%rsp), %rdx
	movq	104(%rsp), %rsi
	movl	$4, %ecx
	movq	T2indexes(%rip), %rdi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	leaq	.LC19(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC20(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	36(%rsp), %eax
	movq	T2indexes(%rip), %rdi
	xorl	%esi, %esi
	leal	-1(%rax), %edx
	call	_Z15printArrayRangePiii
	leaq	.LC21(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	36(%rsp), %eax
	movq	T1weights(%rip), %rdi
	xorl	%esi, %esi
	leal	-1(%rax), %edx
	call	_Z15printArrayRangePiii
	cmpl	$1, 36(%rsp)
	jle	.L58
	leaq	128(%rsp), %rdi
	movl	$4, %esi
	call	_Z10cudaMallocIiE9cudaErrorPPT_m.isra.0
	movl	$4, %ecx
	movl	$4, %edx
	movq	128(%rsp), %rdi
	leaq	36(%rsp), %rsi
	call	cudaMemcpy@PLT
	leaq	.LC22(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %esi
	movl	156(%rsp), %ecx
	movq	148(%rsp), %rdx
	movabsq	$4294967297, %rdi
	movl	$1, 168(%rsp)
	movq	%rdi, 160(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L59
	movq	104(%rsp), %rdx
	movq	96(%rsp), %rsi
	movq	128(%rsp), %rdi
	call	_Z30__device_stub__Z7kernel2PiS_S_PiS_S_
.L59:
	movslq	36(%rsp), %rdx
	movq	96(%rsp), %rsi
	movl	$4, %ecx
	movq	T1weights(%rip), %rdi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movslq	36(%rsp), %rdx
	movq	104(%rsp), %rsi
	movl	$4, %ecx
	movq	T2indexes(%rip), %rdi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	leaq	.LC23(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC20(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	36(%rsp), %eax
	movq	T2indexes(%rip), %rdi
	xorl	%esi, %esi
	leal	-1(%rax), %edx
	call	_Z15printArrayRangePiii
	leaq	.LC21(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	36(%rsp), %eax
	movq	T1weights(%rip), %rdi
	xorl	%esi, %esi
	leal	-1(%rax), %edx
	call	_Z15printArrayRangePiii
.L58:
	movq	T2indexes(%rip), %rax
	leaq	.LC24(%rip), %rsi
	movl	$2, %edi
	movl	(%rax), %ecx
	movq	T1weights(%rip), %rax
	movl	(%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	T2indexes(%rip), %rax
	movq	80(%rsp), %rdi
	movq	%rbp, %rsi
	movl	$4, %ecx
	movl	(%rax), %edx
	movl	%edx, 0(%rbp)
	movq	T1weights(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, (%rbx)
	movslq	(%rax), %rax
	movl	$16, %edx
	movl	0(%rbp,%rax,4), %eax
	movl	%eax, 28(%rsp)
	call	cudaMemcpy@PLT
	movq	88(%rsp), %rdi
	movl	$4, %ecx
	movq	%rbx, %rsi
	movl	$16, %edx
	call	cudaMemcpy@PLT
	movq	112(%rsp), %rdi
	movl	$4, %ecx
	movq	%r15, %rsi
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movl	156(%rsp), %ecx
	xorl	%r9d, %r9d
	movq	148(%rsp), %rdx
	movq	136(%rsp), %rdi
	movl	144(%rsp), %esi
	xorl	%r8d, %r8d
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L60
	movq	120(%rsp), %r9
	movq	112(%rsp), %r8
	movq	88(%rsp), %rcx
	movq	72(%rsp), %rdx
	movq	64(%rsp), %rsi
	movq	56(%rsp), %rdi
	call	_Z36__device_stub__Z7kernel3PiS_S_S_S_S_PiS_S_S_S_S_
.L60:
	movq	72(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$4, %ecx
	incl	%r12d
	movl	$16, %edx
	call	cudaMemcpy@PLT
	movq	88(%rsp), %rsi
	movl	$4, %ecx
	movq	%rbx, %rdi
	movl	$16, %edx
	call	cudaMemcpy@PLT
	leaq	.LC25(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC14(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	(%rsp), %rdi
	movl	$3, %edx
	xorl	%esi, %esi
	call	_Z15printArrayRangePiii
	leaq	.LC15(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$3, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	_Z15printArrayRangePiii
	leaq	.LC16(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$3, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	_Z15printArrayRangePiii
	cmpl	$4, %r12d
	jne	.L61
	movq	56(%rsp), %rdi
	leaq	175(%rsp), %rbx
	leaq	185(%rsp), %rbp
	call	cudaFree@PLT
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movq	80(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
	movq	96(%rsp), %rdi
	call	cudaFree@PLT
	movq	104(%rsp), %rdi
	call	cudaFree@PLT
	movq	112(%rsp), %rdi
	call	cudaFree@PLT
	movq	120(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	48(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rsi
	leaq	160(%rsp), %rdi
	movl	$0x00000000, 160(%rsp)
	call	cudaEventElapsedTime@PLT
	movl	$5, %r8d
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC27(%rip), %rcx
	movl	$10, %edx
	movl	$2, %esi
	call	__sprintf_chk@PLT
	movl	$15, %edx
	movq	%rbp, %rdi
	movb	$1, %al
	leaq	.LC28(%rip), %rcx
	movl	$2, %esi
	cvtss2sd	160(%rsp), %xmm0
	call	__sprintf_chk@PLT
	movq	%rbx, %rsi
	leaq	.LC29(%rip), %rbx
	movq	%rbx, %rdi
	call	_Z9writeFilePcS_
	leaq	.LC30(%rip), %rsi
	movq	%rbx, %rdi
	call	_Z9writeFilePcS_
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	_Z9writeFilePcS_
	leaq	.LC4(%rip), %rsi
	movq	%rbx, %rdi
	call	_Z9writeFilePcS_
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L62
	call	__stack_chk_fail@PLT
.L62:
	addq	$216, %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
.LFE2032:
	.size	_Z7primMSTPiS_S_S_S_i, .-_Z7primMSTPiS_S_S_S_i
	.section	.rodata.str1.1
.LC31:
	.string	"IDs threads: \n"
.LC32:
	.string	"Fin del programa V4\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2033:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z8setGraphv
	movl	$2, C(%rip)
	call	_Z12setVariablesv
	leaq	.LC31(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	R1source(%rip), %rdx
	movl	C(%rip), %r9d
	movq	R3weigth(%rip), %r8
	movq	R2destination(%rip), %rcx
	movq	EG(%rip), %rsi
	movq	VG(%rip), %rdi
	call	_Z7primMSTPiS_S_S_S_i
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC32(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	popq	%rdx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2033:
	.size	main, .-main
	.section	.rodata.str1.1
.LC33:
	.string	"_Z7kernel3PiS_S_S_S_S_"
.LC34:
	.string	"_Z7kernel2PiS_S_"
.LC35:
	.string	"_Z7kernel1PiS_S_S_S_S_S_S_"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2065:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC33(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z7kernel3PiS_S_S_S_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC34(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z7kernel2PiS_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC35(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z7kernel1PiS_S_S_S_S_S_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2065:
	.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
	.globl	T2indexes
	.bss
	.align 8
	.type	T2indexes, @object
	.size	T2indexes, 8
T2indexes:
	.zero	8
	.globl	T1weights
	.align 8
	.type	T1weights, @object
	.size	T1weights, 8
T1weights:
	.zero	8
	.globl	R3weigth
	.align 8
	.type	R3weigth, @object
	.size	R3weigth, 8
R3weigth:
	.zero	8
	.globl	R2destination
	.align 8
	.type	R2destination, @object
	.size	R2destination, 8
R2destination:
	.zero	8
	.globl	R1source
	.align 8
	.type	R1source, @object
	.size	R1source, 8
R1source:
	.zero	8
	.globl	NUMBEREDGES
	.align 4
	.type	NUMBEREDGES, @object
	.size	NUMBEREDGES, 4
NUMBEREDGES:
	.zero	4
	.globl	C
	.align 4
	.type	C, @object
	.size	C, 4
C:
	.zero	4
	.globl	VG
	.align 8
	.type	VG, @object
	.size	VG, 8
VG:
	.zero	8
	.globl	EG
	.align 8
	.type	EG, @object
	.size	EG, 8
EG:
	.zero	8
	.globl	gpudev
	.align 4
	.type	gpudev, @object
	.size	gpudev, 4
gpudev:
	.zero	4
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


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

//NUMERO BLOQUES = INTEGERMASALTO(NUMVERTICES/MAXTRHEADSXBLOCK)
//VARIABLES GLOBALES
#define NUMVERTICES 5      //MAXIMUM 300
#define MAXTRHEADSXBLOCK 32 //[1 - 32]

//ID gpudevice that is used
int gpudev = 0;

//Graph representation with
int *EG;    //Double array of edges |NUMVERTICES|
int *VG;    //Double array of vertices

int C;      //Current vertex INDEX
int NUMBEREDGES;

//MST edge list: Shows the path that is followed.
int *R1source;
int *R2destination;
int *R3weigth;

//Temporal arrays used for reduction results
int *T1weights;
int *T2indexes;

//------- FUNCIONES --------
void writeFile(char* filename, char* content)
{
	FILE *fp;
	int error;
	
	//Open a text file for append stream to the end
	//If there is no file, it is created
	fp = fopen(filename,"a+");
	

	//Write content
	error = fputs(content,fp);
	if( error  == EOF )
	{
		printf("Error al escribir en archivo!\n");
		printf("ERROR: %i = %s\n", error ,strerror(error));
		//clearerr(fp);
		//fflush(stdout);
		//Llamada recursiva para ver si ya se hace la escritura sin error
		//writeFile(filename,content);
		
	}//Fin if 1
	
	//Cerrar archivo
	fclose(fp);
	
}//Fin writeFile
//--------------------------------------------------------------
void printDoubleArray(int *VX)
{
    int lengthArray = NUMVERTICES;

    for(int i = 0; i <lengthArray; i++)
    {
        printf("%i ", VX[i]);

    }//End for 2

    printf("\n");

    for(int i = lengthArray; i < (lengthArray*2); i++)
    {
         printf("%i ",VX[i]);

    }//End for 2

    printf("\n");

}//Fin funcion printDoubleArray
//------------------------
void printArrayRange(int *VX,int start,int end)
{

    for(int i = start; i <= end; i++)
    {
        printf("%2i ", VX[i]);

    }//End for 2

    printf("\n");

}//Fin funcion printArrayRange
//------------------------
/*
*Function that creates the vaules of the graph
*in the strucutre.
*/
void setGraph()
{
    //Asign and initialize memory for the double array of integers
    //Because is a doble array it is multiplied by 2 only
    VG = (int *) calloc(NUMVERTICES*2, NUMVERTICES*2*sizeof(int) );
    
    int numberEdges = 0;
    int randValue = 0;

    //Inicializacion valores VG
    for (int i = 0; i < NUMVERTICES; i++)
    {
        //Set the index of the Vertex
        VG[i] = i;
        //Set in random way the # of vertices to 
        //wich this vertex is connected

        //#Of vertices can not be 0,becuase all the veritces
        //have to be connected so ensure that at least all
        // the nodes are connected to at leas 2 other vertices
        randValue = rand() % (NUMVERTICES-2) +2;
        VG[i+NUMVERTICES] = randValue;
        //Keep track of the number edges
        numberEdges = numberEdges + randValue;

    }//Fin for 1

    //!!!SAVE IN GLOBAL VARIABLE!!!
    NUMBEREDGES = numberEdges;

    //----------------
    printf("-- Source Vertex --\n");
    printDoubleArray(VG);
    printf("------\n");
    printf("TOTAL EDGES: %i\n",numberEdges);
    //----------------

    //Asign and initialize memory for the double array of integers
    //Because is a doble array it is multiplied by 2 only
    EG = (int *) calloc(numberEdges*2,numberEdges*2*sizeof(int));

    //Initialize EDGE Double array values
    int indxEdges = 0;

    for(int i = 0; i < NUMVERTICES; i++)
    {
        //Num of vertices to wich vertex i has a path
        int numVerticesConn = VG[i+NUMVERTICES];

        //1)Set the destinatio id of the vertex, which can not
        //be repeated and can not be the same as the source
        //vertex i
        int indxDestination = 0;

        //2)Set randomly the value of the weight of edge 1)
        //values of weight from 1 - 100 
        for(int j = 0; j < numVerticesConn; j++)
        {
            //1)
            //Ojo: indxDestination = j a menos que se encuentr
            //que source = destino; en ese caso y por el resto
            //del for j, indxDestination ira uno arriba que j
            if( i == j )
            {
                indxDestination++;
            }//End if

            EG[indxEdges] = indxDestination;

            //2)
            EG[indxEdges+numberEdges] = rand() % (100) +1;

            indxEdges++;
            indxDestination++; 

        }//End for 3

    }//Fin for 2

    //----------------
    printf("-- Destination vertex --\n");
    printArrayRange(EG,0,numberEdges-1);
    printf("-- Weigth of Edge --\n");
    printArrayRange(EG,numberEdges,(numberEdges*2)-1);
    //----------------

}//Fin funcion setGraph
//--------------------------------
//Function that initializes values of R1,R2,R3 according to
//the Root vertex; and also define and initializes with 0s
//the temporal arrays
void setVariables()
{
    //Rs length = |NUMVERTICES|-1 because final path always
    //has one less than the #of vertices 
    R1source = (int *)calloc(NUMVERTICES-1,NUMVERTICES-1*sizeof(int));
    R2destination = (int *)calloc(NUMVERTICES-1,NUMVERTICES-1*sizeof(int));
    R3weigth = (int *)calloc(NUMVERTICES-1,NUMVERTICES-1*sizeof(int));

    //Look for the actual weights in VE and VG
    //for the source and destination and in case
    //of not being found asign 0 as the weight
    int numDestinations = VG[C+NUMVERTICES];

    int startIndex = 0;
    for(int k = 0; k < C; k++)
    {
        startIndex = startIndex+VG[k+NUMVERTICES];
    }//End for

    numDestinations = numDestinations+startIndex;

    //----------
    //printf("Range of values in EG(%i - %i)\n", startIndex, numDestinations);
    //----------
    
    //Set by default all the edges taking as the origin 
    //the root source, to all posible destinations
    int indxValidDestinations = -1;
    for(int i = 0; i < NUMVERTICES; i++)
    {

        //Only do not take as destination when source
        //and destination are equal
        if(C != i)
        {
            indxValidDestinations++;

            //Set source index
            R1source[indxValidDestinations] = C;
            R2destination[indxValidDestinations] = i;

            //Recorrer solamente los destinos para el source
            for(int j = startIndex; j < numDestinations; j++)
            {
                int idDestino = EG[j];

                //Se encontro el destino .:. poner peso correspondiente
                //----------
                //printf("%i == %i\n", idDestino, i);
                //----------
                if(idDestino == i)
                {
                    R3weigth[indxValidDestinations] = EG[j+NUMBEREDGES];
                }//End if

            }//End for 2

        }//End if


    }//Fin for 1

    //--------------
    //Recordar que para el print se considera un elemento menos
    //del limite superior ya que realmnete hace el print hasta
    //la posicion indicada
    //printf("R1: \n");
    //printArrayRange(R1source,0,NUMVERTICES-2);
    //printf("R2: \n");
    //printArrayRange(R2destination,0,NUMVERTICES-2);
    //printf("R3: \n");
    //printArrayRange(R3weigth,0,NUMVERTICES-2);
    //--------------


}//End fucntions setVariables
//--------------------------------
__global__ void kernel1(int *v, int *e, int *r1, int *r2, int *r3, int *c, int *t1, int *t2)
{
    //Define and construct T1 and T2
    //T1weights = (int *)calloc(MAXTRHEADSXBLOCK,MAXTRHEADSXBLOCK*sizeof(int));
    //T2indexes = (int *)calloc(MAXTRHEADSXBLOCK,MAXTRHEADSXBLOCK*sizeof(int));

    int idBloque = blockIdx.x;
    //ID de cada hilo (IDHILOBLOQUE+IDBLOQUE*HILOSPORBLOQUE)
    int i = threadIdx.x + idBloque*blockDim.x;

    //MIN REDUCTION AND WRITE RESULTS IN T1 AND T2

    //1)All threads in the grid make reduction operation on an array
    //of input data, ann obtain min weight and index of each thread
    
    //Solo trabajar |v|-1 hilos 
    //V-1 porque Rs son de size |V|-1
    if( i < NUMVERTICES-1 )
    {
        //----------------------
        //printf("| idh: %i | ", i);
        //printf("| %i %i | ", v[i],v[i+NUMVERTICES]);
        //----------------------

        //---------------------
        //printf("| %i  %i : %i | ", r1[i], r2[2], r3[2]);
        //printf(" %i < %i //", r3[i], t1[idBloque]);
        //---------------------
        //Con weiht mwnor al actual pero que sea un
        //weigth valido (diferente de 0)
        if(r3[i] < t1[idBloque] && r3[i] != 0 )
        {
            //Guardar Weight
            t1[idBloque] = r3[i];

            //Guardar Indice
            t2[idBloque] = r2[i];

        }//Nuevo menor encontrado

    }//End if

    //printf("| %i | ", r3[i]);

    //i < MAXNUMBEREDGES
    /*if(i < 15)
    {
                                 //[i+MAXNUMBEREDGES]
        printf("! %i %i ! ", e[i],e[i+15]);

    }//End if*/


    //2)All threads in every block make reduction of the result data in 1)
    //And obtain the minim value and index of every thread block

}//End function kernel1
//--------------------------------
__global__ void kernel2(int *numBlocks, int *weights, int *indxs)
{
    int N = numBlocks[0];

    //Reservar espacio en zona de memoria compartida
    __shared__ int temporal[MAXTRHEADSXBLOCK];
    __shared__ int tempids[MAXTRHEADSXBLOCK];

    //Indice de cada hilo en un solo bloque
    int i = threadIdx.x;
    
    if(i < N)
    {
        //Copiamos el vector de pesos en temporal y sincronizamos
        temporal[i] = weights[i];
        tempids[i] = indxs[i];
        __syncthreads();

        //---------------------
        //printf("|%i)  %i : %i | ", i ,weights[i], indxs[i]);
        //printf("| %i | ", temporal[i]);
        //----------------------

        //Inicio de reduccion paralela
        int salto = N/2;

        //log2(N) iteraciones
        while(salto)
        {
            //Solo trabajan la mitad de los hilos
            if(i < salto)
            {
                //Si se encuentra un vertex con peso menor se elige
                //como mejor candidato
                if( temporal[i+salto] < temporal[i] && temporal[i] != 0 )
                {
                    temporal[i] = temporal[i+salto];
                    tempids[i] = tempids[i+salto];

                }//End if

            }//End if 2
            __syncthreads();
            salto = salto/2;

        }//End while

        //Hilo 0 escibe el resultado final en memoria global
        if(i == 0)
        {
            weights[0] = temporal[0];
            indxs[0] = tempids[0];

        }//End if 2

    }//End if 1 


}//End function kernel2
//--------------------------------
//Comparing and update MST
__global__ void kernel3(int *v, int *e, int *r1, int *r3, int *c, int *numEdges)
{
    //1)Read current Vertex index

    //2)Fin the weight between current vertex and the
    //other vertices (n other Vertex in actual moment)

    //For every Vertex n if new weight with this C vertex is < old weight
    // Adjust corresponding values of R1 and R3 by :
    //if(W[n] < R3[n] )
    //R1[n] = C
    //R3[n] = W[n]

    //Look for the actual weights in VE and VG
    //for the source and destination and in case
    //of not being found asign 0 as the weight
    int NE = numEdges[0];
    int C = c[0];
    int numDestinations = v[C+NUMVERTICES];

    int startIndex = 0;
    for(int k = 0; k < C; k++)
    {
        startIndex = startIndex+v[k+NUMVERTICES];
    }//End for

    numDestinations = numDestinations+startIndex;

    //----------
    //printf("Range of values in EG(%i - %i)\n", startIndex, numDestinations);
    //----------

    int idBloque = blockIdx.x;
    //ID de cada hilo (IDHILOBLOQUE+IDBLOQUE*HILOSPORBLOQUE)
    int i = threadIdx.x + idBloque*blockDim.x;
    
    //Set by default all the edges taking as the origin 
    //the root source, to all posible destinations
    int indxValidDestinations = -1;
    if(i < NUMVERTICES)
    {

        //Only do not take as destination when source
        //and destination are equal
        if(C != i)
        {
            indxValidDestinations++;

            //Recorrer solamente los destinos para el source
            for(int j = startIndex; j < numDestinations; j++)
            {
                int idDestino = e[j];

                //Se encontro el destino .:. poner peso correspondiente
                //----------
                //printf("%i == %i\n", idDestino, i);
                //----------
                if(idDestino == i)
                {

                    if(e[j+NE] < r3[indxValidDestinations])
                    {
                        r3[indxValidDestinations] = e[j+NE];
                        r1[indxValidDestinations] = C;

                    }//End if

                }//End if

            }//End for 2

        }//End if


    }//Fin for 1
    

}//End function kernel3
//--------------------------------
void primMST(int *v, int *e, int *r1, int * r2, int *r3, int c)
{
    //Define size of CUDA grid
    int g_row = (int)ceil((float)NUMVERTICES/(float)MAXTRHEADSXBLOCK);
    int g_col = (int)ceil((float)NUMVERTICES/(float)MAXTRHEADSXBLOCK); 
    int numBloques = g_row;
    dim3 bloques(g_col,g_row);
    dim3 hilos(MAXTRHEADSXBLOCK,MAXTRHEADSXBLOCK);

    hipEvent_t start, stop; 

    printf("Bloques: %i == %i \n", bloques, numBloques);
    printf("Hilos: %i \n", hilos);
    printf("Grid (%d,%d)\n", g_row, g_col); 

    //vARIABLES IN DEVICE
    int *VGD, *VED, *R1D, *R2D, *R3D;   //Arrays
    int *T1D, *T2D;
    int *CD, *NED;                      //Variables 

    //Define and construct T1 and T2? HERE
    T1weights = (int *)calloc(numBloques,numBloques*sizeof(int));
    T2indexes = (int *)calloc(numBloques,numBloques*sizeof(int));

    //Initialize temporal weights with a very high value
    //in order to make that any wieght is better than 
    //the init value
    for(int i = 0; i < numBloques; i++)
    {
        T1weights[i] = 99999;

    }//End for 1

    //--------------
    //Recordar que para el print se considera un elemento menos
    //del limite superior ya que realmnete hace el print hasta
    //la posicion indicada
    printf("R1: \n");
    printArrayRange(r1,0,NUMVERTICES-2);
    printf("R2: \n");
    printArrayRange(r2,0,NUMVERTICES-2);
    printf("R3: \n");
    printArrayRange(r3,0,NUMVERTICES-2);
    //--------------

    //TRANSFER FROM HOST (CPU) TO DEVICE GPU
    hipSetDevice(gpudev);

    hipEventCreate(&start); hipEventCreate(&stop);
    hipEventRecord(start,0); 

    //1)Asignar memoria para variables en GPU
    hipMalloc(&VGD, NUMVERTICES*2*sizeof(int) );
    hipMalloc(&VED, NUMBEREDGES*2*sizeof(int) );
    hipMalloc(&R1D, (NUMVERTICES-1)*sizeof(int) );
    hipMalloc(&R2D, (NUMVERTICES-1)*sizeof(int) );
    hipMalloc(&R3D, (NUMVERTICES-1)*sizeof(int) );
    hipMalloc(&T1D, (numBloques)*sizeof(int) );
    hipMalloc(&T2D, (numBloques)*sizeof(int) );
    hipMalloc(&CD, int(sizeof(int)) );
    hipMalloc(&NED, int(sizeof(int)) );


    //INICIO LOOP |NUMVERTICES|-1 VECES
    int iCountVer = 0;

    while(iCountVer < NUMVERTICES-1)
    {
        //----
        printf("---- %i) ----- \n", iCountVer);
        printf("Current vertex: %i \n", c);
        //----

        //2)Copiar datos del host al device
        hipMemcpy(VGD,v,NUMVERTICES*2*sizeof(int),hipMemcpyDefault);
        hipMemcpy(VED,e,NUMBEREDGES*2*sizeof(int),hipMemcpyDefault);
        hipMemcpy(R1D,r1,(NUMVERTICES-1)*sizeof(int),hipMemcpyDefault);
        hipMemcpy(R2D,r2,(NUMVERTICES-1)*sizeof(int),hipMemcpyDefault);
        hipMemcpy(R3D,r3,(NUMVERTICES-1)*sizeof(int),hipMemcpyDefault);
        hipMemcpy(T1D,T1weights,numBloques*sizeof(int),hipMemcpyDefault);
        hipMemcpy(T2D,T2indexes,numBloques*sizeof(int),hipMemcpyDefault);
        hipMemcpy(CD,&c,sizeof(int),hipMemcpyDefault);
        hipMemcpy(NED,&NUMBEREDGES,sizeof(int),hipMemcpyDefault);

        //3)Ejecutar kernel
        //INVOQUE KERNEL 1 AND WRITE RESULTS IN T1 AND T2
        kernel1<<<bloques, hilos>>>(VGD,VED,R1D,R2D,R3D,CD,T1D,T2D);

        //4)Copiar datos del device al host
        //T1 Y T2
        
        // Valores de T1[0] y T2[0] son añadidos
        // a los correspondientes R1 Y R3
        //T2[0] sobreescribe a C
        hipMemcpy(T1weights,T1D,numBloques*sizeof(int),hipMemcpyDefault);
        hipMemcpy(T2indexes,T2D,numBloques*sizeof(int),hipMemcpyDefault);
        //---------------
        printf("\n Minimum weight found for each block (Global memory reduction) \n");
        printf("Id: \n");
        printArrayRange(T2indexes,0,numBloques-1);
        printf("Weight: \n");
        printArrayRange(T1weights,0,numBloques-1);
        //---------------

        //Verificar si se inicia al Kernel 2
        //MAXTRHEADSXBLOCK > numBloques > 1
        if(numBloques > 1)
        {
            //Definir variable en device
            int *NBD;

            //1)Asinar memoria para vairable en GPU/device
            hipMalloc(&NBD, int(sizeof(int)) );

            //2)Copiar datos del host al device
            hipMemcpy(NBD,&numBloques,sizeof(int),hipMemcpyDefault);

            //3)ejecutar kermel2
            printf("Invoke Kernel2\n");
            kernel2<<<1,hilos>>>(NBD,T1D,T2D);

            //4)Copiar datos del device al host
            hipMemcpy(T1weights,T1D,numBloques*sizeof(int),hipMemcpyDefault);
            hipMemcpy(T2indexes,T2D,numBloques*sizeof(int),hipMemcpyDefault);

            //---------------
            printf("\n 2) Minimum weight found of each block (After shared memory reduction) \n");
            printf("Id: \n");
            printArrayRange(T2indexes,0,numBloques-1);
            printf("Weight: \n");
            printArrayRange(T1weights,0,numBloques-1);
            //---------------
            
            //5)liberar memoria NBD

        }//End if kernel2

        //---------------
        printf("Minimum weight found: %i for vertex with ID: %i \n", T1weights[0], T2indexes[0]);
        //---------------

        //ADDING NEW MST EDGE

        //1)Add previously found minimum weight Edge (T1[0] WEIGHT T2[0] EDGE)
        //to the MST by moving this Edge to the first position of R1 R2 R3
        r2[0] = T2indexes[0];  //R2[C] ? 
        r3[0] = T1weights[0];  //R3[C] ?

        //2)Saving current Vertex C= R2[T2[0]]
        c = r2[T2indexes[0]];

        //Copiar datos del host al device que han sido modificados
        hipMemcpy(R2D,r2,(NUMVERTICES-1)*sizeof(int),hipMemcpyDefault);
        hipMemcpy(R3D,r3,(NUMVERTICES-1)*sizeof(int),hipMemcpyDefault);
        hipMemcpy(CD,&c,sizeof(int),hipMemcpyDefault);

        //Kernel 3: Comparing and updating MST
        kernel3<<<bloques, hilos>>>(VGD,VED,R1D,R3D,CD,NED);

        //Copiar datos del device al host
        hipMemcpy(r1,R1D,(NUMVERTICES-1)*sizeof(int),hipMemcpyDefault);
        hipMemcpy(r3,R3D,(NUMVERTICES-1)*sizeof(int),hipMemcpyDefault);

        
        //--------------
        //Recordar que para el print se considera un elemento menos
        //del limite superior ya que realmnete hace el print hasta
        //la posicion indicada
        printf("--- MST ACTUALIZADO ---: \n");
        printf("R1: \n");
        printArrayRange(r1,0,NUMVERTICES-2);
        printf("R2: \n");
        printArrayRange(r2,0,NUMVERTICES-2);
        printf("R3: \n");
        printArrayRange(r3,0,NUMVERTICES-2);
        //--------------

        iCountVer++;

    }//End while
    
    //FIN LOOP |NUMVERTICES|-1 VECES


    //5) Liberar Memoria
    hipFree(VGD);
    hipFree(VED);
    hipFree(R1D);
    hipFree(R2D);
    hipFree(R3D);
    hipFree(T1D);
    hipFree(T2D);
    hipFree(CD);
    hipFree(NED);

    hipEventRecord(stop, 0); 
    hipEventSynchronize(stop);

    float milliseconds = 0;
    char strvertices[10];
	char strtottime[15];

    hipEventElapsedTime(&milliseconds, start, stop);

    //--- Escribir resultados en archivo txt ---
    //Convertir entero de numero de procesadores a cadena
    //Convertir int to char itoa(stringDestination,"%d",intValue)
    sprintf(strvertices,"%d",NUMVERTICES); 
    
    //Convert double to string
    sprintf(strtottime,"%f",milliseconds);

    //Append en archivo de resultados
    writeFile("resultados.txt",strvertices);
    writeFile("resultados.txt"," ");
    writeFile("resultados.txt",strtottime);
    writeFile("resultados.txt","\n");

}//En function primMST
//---- FIN FUNCIONES -----
//Inicio del programa
int main(int argc, char **argv)
{
    setGraph();
    
    //Set root vertex of the MST
    C = 2;

    setVariables();

    printf("IDs threads: \n");
    primMST(VG,EG,R1source,R2destination,R3weigth,C);
    printf("\n");


    printf("Fin del programa V4\n");

}//Fin del main
	.text
	.file	"pmst.hip"
	.globl	_Z9writeFilePcS_                # -- Begin function _Z9writeFilePcS_
	.type	_Z9writeFilePcS_,@function
_Z9writeFilePcS_:                       # @_Z9writeFilePcS_
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rsi, %r14
	movl	$.L.str, %esi
	callq	fopen
	movq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	fputs
	cmpl	$-1, %eax
	jne	.LBB0_2
# %bb.1:
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$-1, %edi
	callq	strerror
	movl	$.L.str.2, %edi
	movl	$-1, %esi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	printf
.LBB0_2:
	movq	%rbx, %rdi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	fclose                          # TAILCALL
.Lfunc_end0:
	.size	_Z9writeFilePcS_, .Lfunc_end0-_Z9writeFilePcS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z16printDoubleArrayPi          # -- Begin function _Z16printDoubleArrayPi
	.type	_Z16printDoubleArrayPi,@function
_Z16printDoubleArrayPi:                 # @_Z16printDoubleArrayPi
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rdi, %rbx
	xorl	%r14d, %r14d
.LBB1_1:                                # =>This Inner Loop Header: Depth=1
	movl	(%rbx,%r14,4), %esi
	movl	$.L.str.3, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r14
	cmpq	$5, %r14
	jne	.LBB1_1
# %bb.2:
	movl	$10, %edi
	callq	putchar@PLT
	xorl	%r14d, %r14d
.LBB1_3:                                # =>This Inner Loop Header: Depth=1
	movl	20(%rbx,%r14,4), %esi
	movl	$.L.str.3, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r14
	cmpq	$5, %r14
	jne	.LBB1_3
# %bb.4:
	movl	$10, %edi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT                     # TAILCALL
.Lfunc_end1:
	.size	_Z16printDoubleArrayPi, .Lfunc_end1-_Z16printDoubleArrayPi
	.cfi_endproc
                                        # -- End function
	.globl	_Z15printArrayRangePiii         # -- Begin function _Z15printArrayRangePiii
	.type	_Z15printArrayRangePiii,@function
_Z15printArrayRangePiii:                # @_Z15printArrayRangePiii
	.cfi_startproc
# %bb.0:
	cmpl	%edx, %esi
	jg	.LBB2_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r15
	.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 %r15, -16
	movl	%edx, %ebx
	movslq	%esi, %rax
	leaq	(%rdi,%rax,4), %r14
	subl	%esi, %ebx
	incl	%ebx
	xorl	%r15d, %r15d
.LBB2_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	(%r14,%r15,4), %esi
	movl	$.L.str.5, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r15
	cmpl	%r15d, %ebx
	jne	.LBB2_2
# %bb.3:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB2_4:                                # %._crit_edge
	movl	$10, %edi
	jmp	putchar@PLT                     # TAILCALL
.Lfunc_end2:
	.size	_Z15printArrayRangePiii, .Lfunc_end2-_Z15printArrayRangePiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z8setGraphv                    # -- Begin function _Z8setGraphv
	.type	_Z8setGraphv,@function
_Z8setGraphv:                           # @_Z8setGraphv
	.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	$10, %edi
	movl	$40, %esi
	callq	calloc
	movq	%rax, VG(%rip)
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
.LBB3_1:                                # =>This Inner Loop Header: Depth=1
	movl	%ebx, (%rax,%rbx,4)
	callq	rand
	cltq
	imulq	$1431655766, %rax, %rcx         # imm = 0x55555556
	movq	%rcx, %rdx
	shrq	$63, %rdx
	shrq	$32, %rcx
	addl	%edx, %ecx
	leal	(%rcx,%rcx,2), %ecx
	movl	%eax, %edx
	subl	%ecx, %edx
	negl	%ecx
	addl	%eax, %ecx
	addl	$2, %ecx
	movq	VG(%rip), %rax
	movl	%ecx, 20(%rax,%rbx,4)
	addl	%edx, %r14d
	addl	$2, %r14d
	incq	%rbx
	cmpq	$5, %rbx
	jne	.LBB3_1
# %bb.2:
	movl	%r14d, NUMBEREDGES(%rip)
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	movq	VG(%rip), %rdi
	callq	_Z16printDoubleArrayPi
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movl	$.L.str.8, %edi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	printf
	leal	(%r14,%r14), %eax
	movl	%eax, 8(%rsp)                   # 4-byte Spill
	movslq	%eax, %rdi
	leaq	(,%rdi,4), %rsi
	callq	calloc
	xorl	%r13d, %r13d
	movq	%rax, EG(%rip)
	movq	%r14, 16(%rsp)                  # 8-byte Spill
	movslq	%r14d, %rcx
	shlq	$2, %rcx
	movq	%rcx, 24(%rsp)                  # 8-byte Spill
	xorl	%esi, %esi
.LBB3_3:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_5 Depth 2
	movq	VG(%rip), %rcx
	movl	20(%rcx,%r13,4), %r12d
	testl	%r12d, %r12d
	jle	.LBB3_7
# %bb.4:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB3_3 Depth=1
	movl	%esi, 12(%rsp)                  # 4-byte Spill
	movslq	%esi, %rbp
	movq	24(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rbp,4), %rcx
	movq	%rcx, 32(%rsp)                  # 8-byte Spill
	shlq	$2, %rbp
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
.LBB3_5:                                # %.lr.ph
                                        #   Parent Loop BB3_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorl	%r14d, %r14d
	cmpq	%r15, %r13
	sete	%r14b
	leal	(%rbx,%r14), %ecx
	addq	%rbp, %rax
	movl	%ecx, (%rax,%r15,4)
	callq	rand
	cltq
	imulq	$1374389535, %rax, %rcx         # imm = 0x51EB851F
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$37, %rcx
	addl	%edx, %ecx
	imull	$100, %ecx, %ecx
	negl	%ecx
	addl	%eax, %ecx
	incl	%ecx
	movq	EG(%rip), %rax
	movq	32(%rsp), %rdx                  # 8-byte Reload
	addq	%rax, %rdx
	movl	%ecx, (%rdx,%r15,4)
	addl	%r14d, %ebx
	incl	%ebx
	incq	%r15
	cmpl	%r15d, %r12d
	jne	.LBB3_5
# %bb.6:                                # %._crit_edge.loopexit
                                        #   in Loop: Header=BB3_3 Depth=1
	movl	12(%rsp), %esi                  # 4-byte Reload
	addl	%r15d, %esi
.LBB3_7:                                # %._crit_edge
                                        #   in Loop: Header=BB3_3 Depth=1
	incq	%r13
	cmpq	$5, %r13
	jne	.LBB3_3
# %bb.8:
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	movq	EG(%rip), %rdi
	movq	16(%rsp), %rbx                  # 8-byte Reload
	leal	-1(%rbx), %edx
	xorl	%esi, %esi
	callq	_Z15printArrayRangePiii
	movl	$.Lstr.4, %edi
	callq	puts@PLT
	movq	EG(%rip), %rdi
	movl	8(%rsp), %edx                   # 4-byte Reload
	decl	%edx
	movl	%ebx, %esi
	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	_Z15printArrayRangePiii         # TAILCALL
.Lfunc_end3:
	.size	_Z8setGraphv, .Lfunc_end3-_Z8setGraphv
	.cfi_endproc
                                        # -- End function
	.globl	_Z12setVariablesv               # -- Begin function _Z12setVariablesv
	.type	_Z12setVariablesv,@function
_Z12setVariablesv:                      # @_Z12setVariablesv
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$4, %edi
	movl	$1, %esi
	callq	calloc
	movq	%rax, %rbx
	movq	%rax, R1source(%rip)
	movl	$4, %edi
	movl	$1, %esi
	callq	calloc
	movq	%rax, %r14
	movq	%rax, R2destination(%rip)
	movl	$4, %edi
	movl	$1, %esi
	callq	calloc
	movq	%rax, R3weigth(%rip)
	movq	VG(%rip), %rdi
	movslq	C(%rip), %rcx
	xorl	%edx, %edx
	movl	20(%rdi,%rcx,4), %esi
	movl	$0, %r9d
	testq	%rcx, %rcx
	jle	.LBB4_3
# %bb.1:                                # %.lr.ph.preheader
	movl	%ecx, %r8d
	xorl	%r10d, %r10d
	xorl	%r9d, %r9d
.LBB4_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	addl	20(%rdi,%r10,4), %r9d
	incq	%r10
	cmpq	%r10, %r8
	jne	.LBB4_2
.LBB4_3:                                # %._crit_edge
	movq	EG(%rip), %rdi
	movslq	NUMBEREDGES(%rip), %r10
	movslq	%r9d, %r8
	addl	%esi, %r9d
	movslq	%r9d, %r9
	leaq	(%rdi,%r10,4), %r10
	movl	$-1, %r11d
.LBB4_4:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_7 Depth 2
	cmpl	%edx, %ecx
	je	.LBB4_10
# %bb.5:                                #   in Loop: Header=BB4_4 Depth=1
	movslq	%r11d, %r15
	incl	%r11d
	movl	%ecx, 4(%rbx,%r15,4)
	movl	%edx, 4(%r14,%r15,4)
	testl	%esi, %esi
	jle	.LBB4_10
# %bb.6:                                # %.lr.ph31
                                        #   in Loop: Header=BB4_4 Depth=1
	incq	%r15
	movq	%r8, %r12
.LBB4_7:                                #   Parent Loop BB4_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpl	%edx, (%rdi,%r12,4)
	jne	.LBB4_9
# %bb.8:                                #   in Loop: Header=BB4_7 Depth=2
	movl	(%r10,%r12,4), %ebp
	movl	%ebp, (%rax,%r15,4)
.LBB4_9:                                #   in Loop: Header=BB4_7 Depth=2
	incq	%r12
	cmpq	%r9, %r12
	jl	.LBB4_7
.LBB4_10:                               # %.loopexit
                                        #   in Loop: Header=BB4_4 Depth=1
	incl	%edx
	cmpl	$5, %edx
	jne	.LBB4_4
# %bb.11:
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z12setVariablesv, .Lfunc_end4-_Z12setVariablesv
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__kernel1PiS_S_S_S_S_S_S_ # -- Begin function _Z22__device_stub__kernel1PiS_S_S_S_S_S_S_
	.type	_Z22__device_stub__kernel1PiS_S_S_S_S_S_S_,@function
_Z22__device_stub__kernel1PiS_S_S_S_S_S_S_: # @_Z22__device_stub__kernel1PiS_S_S_S_S_S_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	16(%rsp), %r8
	movq	%r9, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	208(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	216(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z7kernel1PiS_S_S_S_S_S_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_Z22__device_stub__kernel1PiS_S_S_S_S_S_S_, .Lfunc_end5-_Z22__device_stub__kernel1PiS_S_S_S_S_S_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__kernel2PiS_S_ # -- Begin function _Z22__device_stub__kernel2PiS_S_
	.type	_Z22__device_stub__kernel2PiS_S_,@function
_Z22__device_stub__kernel2PiS_S_:       # @_Z22__device_stub__kernel2PiS_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z7kernel2PiS_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_Z22__device_stub__kernel2PiS_S_, .Lfunc_end6-_Z22__device_stub__kernel2PiS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__kernel3PiS_S_S_S_S_ # -- Begin function _Z22__device_stub__kernel3PiS_S_S_S_S_
	.type	_Z22__device_stub__kernel3PiS_S_S_S_S_,@function
_Z22__device_stub__kernel3PiS_S_S_S_S_: # @_Z22__device_stub__kernel3PiS_S_S_S_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	16(%rsp), %r8
	movq	%r9, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z7kernel3PiS_S_S_S_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_Z22__device_stub__kernel3PiS_S_S_S_S_, .Lfunc_end7-_Z22__device_stub__kernel3PiS_S_S_S_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z7primMSTPiS_S_S_S_i           # -- Begin function _Z7primMSTPiS_S_S_S_i
	.type	_Z7primMSTPiS_S_S_S_i,@function
_Z7primMSTPiS_S_S_S_i:                  # @_Z7primMSTPiS_S_S_S_i
	.cfi_startproc
# %bb.0:                                # %._crit_edge
	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	$152, %rsp
	.cfi_def_cfa_offset 208
	.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	%r8, %rbx
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, 120(%rsp)                 # 8-byte Spill
	movq	%rdi, 112(%rsp)                 # 8-byte Spill
	movabsq	$137438953504, %rbp             # imm = 0x2000000020
	movabsq	$4294967297, %r12               # imm = 0x100000001
	leaq	12(%rsp), %rax
	movl	%r9d, (%rax)
	leaq	8(%rsp), %rax
	movl	$1, (%rax)
	movl	$.L.str.11, %edi
	movq	%r12, %rsi
	movl	$1, %edx
	movl	$1, %ecx
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.12, %edi
	movq	%rbp, %rsi
	movl	$1, %edx
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.13, %edi
	movl	$1, %esi
	movl	$1, %edx
	xorl	%eax, %eax
	callq	printf
	movl	$1, %edi
	movl	$4, %esi
	callq	calloc
	movq	%rax, %r13
	movq	%rax, T1weights(%rip)
	movl	$1, %edi
	movl	$4, %esi
	callq	calloc
	movq	%rax, T2indexes(%rip)
	movl	$99999, (%r13)                  # imm = 0x1869F
	movl	$.Lstr.16, %edi
	callq	puts@PLT
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$3, %edx
	callq	_Z15printArrayRangePiii
	movl	$.Lstr.17, %edi
	callq	puts@PLT
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$3, %edx
	callq	_Z15printArrayRangePiii
	movl	$.Lstr.18, %edi
	callq	puts@PLT
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$3, %edx
	callq	_Z15printArrayRangePiii
	movl	gpudev(%rip), %edi
	callq	hipSetDevice
	leaq	128(%rsp), %r13
	movq	%r13, %rdi
	callq	hipEventCreate
	leaq	88(%rsp), %rdi
	callq	hipEventCreate
	movq	(%r13), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	leaq	72(%rsp), %rdi
	movl	$40, %esi
	callq	hipMalloc
	movslq	NUMBEREDGES(%rip), %rsi
	shlq	$3, %rsi
	leaq	64(%rsp), %rdi
	callq	hipMalloc
	leaq	48(%rsp), %rdi
	movl	$16, %esi
	callq	hipMalloc
	leaq	56(%rsp), %rdi
	movl	$16, %esi
	callq	hipMalloc
	leaq	32(%rsp), %rdi
	movl	$16, %esi
	callq	hipMalloc
	leaq	24(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
	leaq	16(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
	leaq	40(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
	leaq	80(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
	xorl	%r13d, %r13d
.LBB8_1:                                # =>This Inner Loop Header: Depth=1
	movl	$.L.str.17, %edi
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	printf
	movl	12(%rsp), %esi
	movl	$.L.str.18, %edi
	xorl	%eax, %eax
	callq	printf
	movq	72(%rsp), %rdi
	movl	$40, %edx
	movq	112(%rsp), %rsi                 # 8-byte Reload
	movl	$4, %ecx
	callq	hipMemcpy
	movq	64(%rsp), %rdi
	movslq	NUMBEREDGES(%rip), %rdx
	shlq	$3, %rdx
	movq	120(%rsp), %rsi                 # 8-byte Reload
	movl	$4, %ecx
	callq	hipMemcpy
	movq	48(%rsp), %rdi
	movl	$16, %edx
	movq	%r15, %rsi
	movl	$4, %ecx
	callq	hipMemcpy
	movq	56(%rsp), %rdi
	movl	$16, %edx
	movq	%r14, %rsi
	movl	$4, %ecx
	callq	hipMemcpy
	movq	32(%rsp), %rdi
	movl	$16, %edx
	movq	%rbx, %rsi
	movl	$4, %ecx
	callq	hipMemcpy
	movq	24(%rsp), %rdi
	movq	T1weights(%rip), %rsi
	movslq	8(%rsp), %rdx
	shlq	$2, %rdx
	movl	$4, %ecx
	callq	hipMemcpy
	movq	16(%rsp), %rdi
	movq	T2indexes(%rip), %rsi
	movslq	8(%rsp), %rdx
	shlq	$2, %rdx
	movl	$4, %ecx
	callq	hipMemcpy
	movq	40(%rsp), %rdi
	movl	$4, %edx
	leaq	12(%rsp), %rsi
	movl	$4, %ecx
	callq	hipMemcpy
	movq	80(%rsp), %rdi
	movl	$NUMBEREDGES, %esi
	movl	$4, %edx
	movl	$4, %ecx
	callq	hipMemcpy
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB8_3
# %bb.2:                                #   in Loop: Header=BB8_1 Depth=1
	movq	72(%rsp), %rdi
	movq	64(%rsp), %rsi
	movq	48(%rsp), %rdx
	movq	56(%rsp), %rcx
	movq	32(%rsp), %r8
	movq	40(%rsp), %r9
	pushq	16(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	32(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	_Z22__device_stub__kernel1PiS_S_S_S_S_S_S_
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
.LBB8_3:                                #   in Loop: Header=BB8_1 Depth=1
	movq	T1weights(%rip), %rdi
	movq	24(%rsp), %rsi
	movslq	8(%rsp), %rdx
	shlq	$2, %rdx
	movl	$4, %ecx
	callq	hipMemcpy
	movq	T2indexes(%rip), %rdi
	movq	16(%rsp), %rsi
	movslq	8(%rsp), %rdx
	shlq	$2, %rdx
	movl	$4, %ecx
	callq	hipMemcpy
	movl	$.Lstr.8, %edi
	callq	puts@PLT
	movl	$.Lstr.13, %edi
	callq	puts@PLT
	movq	T2indexes(%rip), %rdi
	movl	8(%rsp), %edx
	decl	%edx
	xorl	%esi, %esi
	callq	_Z15printArrayRangePiii
	movl	$.Lstr.14, %edi
	callq	puts@PLT
	movq	T1weights(%rip), %rdi
	movl	8(%rsp), %edx
	decl	%edx
	xorl	%esi, %esi
	callq	_Z15printArrayRangePiii
	cmpl	$2, 8(%rsp)
	jl	.LBB8_7
# %bb.4:                                #   in Loop: Header=BB8_1 Depth=1
	movl	$4, %esi
	leaq	96(%rsp), %rdi
	callq	hipMalloc
	movq	96(%rsp), %rdi
	movl	$4, %edx
	leaq	8(%rsp), %rsi
	movl	$4, %ecx
	callq	hipMemcpy
	movl	$.Lstr.11, %edi
	callq	puts@PLT
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB8_6
# %bb.5:                                #   in Loop: Header=BB8_1 Depth=1
	movq	96(%rsp), %rdi
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
	callq	_Z22__device_stub__kernel2PiS_S_
.LBB8_6:                                #   in Loop: Header=BB8_1 Depth=1
	movq	T1weights(%rip), %rdi
	movq	24(%rsp), %rsi
	movslq	8(%rsp), %rdx
	shlq	$2, %rdx
	movl	$4, %ecx
	callq	hipMemcpy
	movq	T2indexes(%rip), %rdi
	movq	16(%rsp), %rsi
	movslq	8(%rsp), %rdx
	shlq	$2, %rdx
	movl	$4, %ecx
	callq	hipMemcpy
	movl	$.Lstr.12, %edi
	callq	puts@PLT
	movl	$.Lstr.13, %edi
	callq	puts@PLT
	movq	T2indexes(%rip), %rdi
	movl	8(%rsp), %edx
	decl	%edx
	xorl	%esi, %esi
	callq	_Z15printArrayRangePiii
	movl	$.Lstr.14, %edi
	callq	puts@PLT
	movq	T1weights(%rip), %rdi
	movl	8(%rsp), %edx
	decl	%edx
	xorl	%esi, %esi
	callq	_Z15printArrayRangePiii
.LBB8_7:                                #   in Loop: Header=BB8_1 Depth=1
	movq	T1weights(%rip), %rax
	movl	(%rax), %esi
	movq	T2indexes(%rip), %rax
	movl	(%rax), %edx
	movl	$.L.str.24, %edi
	xorl	%eax, %eax
	callq	printf
	movq	T2indexes(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, (%r14)
	movq	T1weights(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rbx)
	movslq	(%rax), %rax
	movl	(%r14,%rax,4), %eax
	movl	%eax, 12(%rsp)
	movq	56(%rsp), %rdi
	movl	$16, %edx
	movq	%r14, %rsi
	movl	$4, %ecx
	callq	hipMemcpy
	movq	32(%rsp), %rdi
	movl	$16, %edx
	movq	%rbx, %rsi
	movl	$4, %ecx
	callq	hipMemcpy
	movq	40(%rsp), %rdi
	movl	$4, %edx
	leaq	12(%rsp), %rsi
	movl	$4, %ecx
	callq	hipMemcpy
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%rbp, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB8_9
# %bb.8:                                #   in Loop: Header=BB8_1 Depth=1
	movq	72(%rsp), %rdi
	movq	64(%rsp), %rsi
	movq	48(%rsp), %rdx
	movq	32(%rsp), %rcx
	movq	40(%rsp), %r8
	movq	80(%rsp), %r9
	callq	_Z22__device_stub__kernel3PiS_S_S_S_S_
.LBB8_9:                                #   in Loop: Header=BB8_1 Depth=1
	movq	48(%rsp), %rsi
	movl	$16, %edx
	movq	%r15, %rdi
	movl	$4, %ecx
	callq	hipMemcpy
	movq	32(%rsp), %rsi
	movl	$16, %edx
	movq	%rbx, %rdi
	movl	$4, %ecx
	callq	hipMemcpy
	movl	$.Lstr.15, %edi
	callq	puts@PLT
	movl	$.Lstr.16, %edi
	callq	puts@PLT
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$3, %edx
	callq	_Z15printArrayRangePiii
	movl	$.Lstr.17, %edi
	callq	puts@PLT
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$3, %edx
	callq	_Z15printArrayRangePiii
	movl	$.Lstr.18, %edi
	callq	puts@PLT
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$3, %edx
	callq	_Z15printArrayRangePiii
	incl	%r13d
	cmpl	$4, %r13d
	jne	.LBB8_1
# %bb.10:
	movq	72(%rsp), %rdi
	callq	hipFree
	movq	64(%rsp), %rdi
	callq	hipFree
	movq	48(%rsp), %rdi
	callq	hipFree
	movq	56(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	40(%rsp), %rdi
	callq	hipFree
	movq	80(%rsp), %rdi
	callq	hipFree
	movq	88(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	88(%rsp), %rdi
	callq	hipEventSynchronize
	leaq	136(%rsp), %rbx
	movl	$0, (%rbx)
	movq	128(%rsp), %rsi
	movq	88(%rsp), %rdx
	movq	%rbx, %rdi
	callq	hipEventElapsedTime
	leaq	142(%rsp), %r14
	movl	$.L.str.26, %esi
	movq	%r14, %rdi
	movl	$5, %edx
	xorl	%eax, %eax
	callq	sprintf
	cvtss2sd	(%rbx), %xmm0
	leaq	96(%rsp), %rbx
	movl	$.L.str.27, %esi
	movq	%rbx, %rdi
	movb	$1, %al
	callq	sprintf
	movl	$.L.str.28, %edi
	movq	%r14, %rsi
	callq	_Z9writeFilePcS_
	movl	$.L.str.28, %edi
	movl	$.L.str.29, %esi
	callq	_Z9writeFilePcS_
	movl	$.L.str.28, %edi
	movq	%rbx, %rsi
	callq	_Z9writeFilePcS_
	movl	$.L.str.28, %edi
	movl	$.L.str.4, %esi
	callq	_Z9writeFilePcS_
	addq	$152, %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_end8:
	.size	_Z7primMSTPiS_S_S_S_i, .Lfunc_end8-_Z7primMSTPiS_S_S_S_i
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	_Z8setGraphv
	movl	$2, C(%rip)
	callq	_Z12setVariablesv
	movl	$.Lstr.19, %edi
	callq	puts@PLT
	movq	VG(%rip), %rdi
	movq	EG(%rip), %rsi
	movq	R1source(%rip), %rdx
	movq	R2destination(%rip), %rcx
	movq	R3weigth(%rip), %r8
	movl	C(%rip), %r9d
	callq	_Z7primMSTPiS_S_S_S_i
	movl	$10, %edi
	callq	putchar@PLT
	movl	$.Lstr.20, %edi
	callq	puts@PLT
	xorl	%eax, %eax
	popq	%rcx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	main, .Lfunc_end9-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB10_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB10_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7kernel1PiS_S_S_S_S_S_S_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7kernel2PiS_S_, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7kernel3PiS_S_S_S_S_, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end10:
	.size	__hip_module_ctor, .Lfunc_end10-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB11_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB11_2:
	retq
.Lfunc_end11:
	.size	__hip_module_dtor, .Lfunc_end11-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	gpudev,@object                  # @gpudev
	.bss
	.globl	gpudev
	.p2align	2, 0x0
gpudev:
	.long	0                               # 0x0
	.size	gpudev, 4

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

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

	.type	C,@object                       # @C
	.globl	C
	.p2align	2, 0x0
C:
	.long	0                               # 0x0
	.size	C, 4

	.type	NUMBEREDGES,@object             # @NUMBEREDGES
	.globl	NUMBEREDGES
	.p2align	2, 0x0
NUMBEREDGES:
	.long	0                               # 0x0
	.size	NUMBEREDGES, 4

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

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

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

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

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"a+"
	.size	.L.str, 3

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"ERROR: %i = %s\n"
	.size	.L.str.2, 16

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

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

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"%2i "
	.size	.L.str.5, 5

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"TOTAL EDGES: %i\n"
	.size	.L.str.8, 17

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

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

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

	.type	.L.str.11,@object               # @.str.11
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.11:
	.asciz	"Bloques: %i == %i \n"
	.size	.L.str.11, 20

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Hilos: %i \n"
	.size	.L.str.12, 12

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"Grid (%d,%d)\n"
	.size	.L.str.13, 14

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"---- %i) ----- \n"
	.size	.L.str.17, 17

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"Current vertex: %i \n"
	.size	.L.str.18, 21

	.type	.L.str.24,@object               # @.str.24
.L.str.24:
	.asciz	"Minimum weight found: %i for vertex with ID: %i \n"
	.size	.L.str.24, 50

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

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

	.type	.L.str.28,@object               # @.str.28
.L.str.28:
	.asciz	"resultados.txt"
	.size	.L.str.28, 15

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z7kernel1PiS_S_S_S_S_S_S_"
	.size	.L__unnamed_1, 27

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z7kernel2PiS_S_"
	.size	.L__unnamed_2, 17

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z7kernel3PiS_S_S_S_S_"
	.size	.L__unnamed_3, 23

	.type	__hip_fatbin_wrapper,@object    # @__hip_fatbin_wrapper
	.section	.hipFatBinSegment,"a",@progbits
	.p2align	3, 0x0
__hip_fatbin_wrapper:
	.long	1212764230                      # 0x48495046
	.long	1                               # 0x1
	.quad	__hip_fatbin
	.quad	0
	.size	__hip_fatbin_wrapper, 24

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"Error al escribir en archivo!"
	.size	.Lstr, 30

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"-- Source Vertex --"
	.size	.Lstr.1, 20

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"------"
	.size	.Lstr.2, 7

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"-- Destination vertex --"
	.size	.Lstr.3, 25

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"-- Weigth of Edge --"
	.size	.Lstr.4, 21

	.type	.Lstr.8,@object                 # @str.8
.Lstr.8:
	.asciz	"\n Minimum weight found for each block (Global memory reduction) "
	.size	.Lstr.8, 65

	.type	.Lstr.11,@object                # @str.11
.Lstr.11:
	.asciz	"Invoke Kernel2"
	.size	.Lstr.11, 15

	.type	.Lstr.12,@object                # @str.12
.Lstr.12:
	.asciz	"\n 2) Minimum weight found of each block (After shared memory reduction) "
	.size	.Lstr.12, 73

	.type	.Lstr.13,@object                # @str.13
.Lstr.13:
	.asciz	"Id: "
	.size	.Lstr.13, 5

	.type	.Lstr.14,@object                # @str.14
.Lstr.14:
	.asciz	"Weight: "
	.size	.Lstr.14, 9

	.type	.Lstr.15,@object                # @str.15
.Lstr.15:
	.asciz	"--- MST ACTUALIZADO ---: "
	.size	.Lstr.15, 26

	.type	.Lstr.16,@object                # @str.16
.Lstr.16:
	.asciz	"R1: "
	.size	.Lstr.16, 5

	.type	.Lstr.17,@object                # @str.17
.Lstr.17:
	.asciz	"R2: "
	.size	.Lstr.17, 5

	.type	.Lstr.18,@object                # @str.18
.Lstr.18:
	.asciz	"R3: "
	.size	.Lstr.18, 5

	.type	.Lstr.19,@object                # @str.19
.Lstr.19:
	.asciz	"IDs threads: "
	.size	.Lstr.19, 14

	.type	.Lstr.20,@object                # @str.20
.Lstr.20:
	.asciz	"Fin del programa V4"
	.size	.Lstr.20, 20

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z22__device_stub__kernel1PiS_S_S_S_S_S_S_
	.addrsig_sym _Z22__device_stub__kernel2PiS_S_
	.addrsig_sym _Z22__device_stub__kernel3PiS_S_S_S_S_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym NUMBEREDGES
	.addrsig_sym _Z7kernel1PiS_S_S_S_S_S_S_
	.addrsig_sym _Z7kernel2PiS_S_
	.addrsig_sym _Z7kernel3PiS_S_S_S_S_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z7kernel1PiS_S_S_S_S_S_S_ ; -- Begin function _Z7kernel1PiS_S_S_S_S_S_S_
	.globl	_Z7kernel1PiS_S_S_S_S_S_S_
	.p2align	8
	.type	_Z7kernel1PiS_S_S_S_S_S_S_,@function
_Z7kernel1PiS_S_S_S_S_S_S_:             ; @_Z7kernel1PiS_S_S_S_S_S_S_
; %bb.0:
	s_load_b32 s2, s[0:1], 0x4c
	s_mov_b32 s8, s15
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s8, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e32 4, v1
	s_cbranch_execz .LBB0_3
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x18
	v_ashrrev_i32_e32 v2, 31, v1
	s_load_b128 s[0:3], s[0:1], 0x30
	s_ashr_i32 s9, s8, 31
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s6, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_add_co_ci_u32_e32 v3, vcc_lo, s7, v1, vcc_lo
	s_lshl_b64 s[6:7], s[8:9], 2
	s_add_u32 s8, s0, s6
	global_load_b32 v2, v[2:3], off
	s_addc_u32 s9, s1, s7
	s_load_b32 s0, s[8:9], 0x0
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_cmp_gt_i32_e32 vcc_lo, s0, v2
	v_cmp_ne_u32_e64 s0, 0, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, s0, vcc_lo
	s_and_b32 exec_lo, exec_lo, s0
	s_cbranch_execz .LBB0_3
; %bb.2:
	v_add_co_u32 v0, vcc_lo, s4, v0
	v_mov_b32_e32 v3, 0
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	s_add_u32 s0, s2, s6
	s_addc_u32 s1, s3, s7
	global_store_b32 v3, v2, s[8:9]
	global_load_b32 v0, v[0:1], off
	s_waitcnt vmcnt(0)
	global_store_b32 v3, v0, s[0:1]
.LBB0_3:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7kernel1PiS_S_S_S_S_S_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 320
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 4
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z7kernel1PiS_S_S_S_S_S_S_, .Lfunc_end0-_Z7kernel1PiS_S_S_S_S_S_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 228
; NumSgprs: 18
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 4
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z7kernel2PiS_S_        ; -- Begin function _Z7kernel2PiS_S_
	.globl	_Z7kernel2PiS_S_
	.p2align	8
	.type	_Z7kernel2PiS_S_,@function
_Z7kernel2PiS_S_:                       ; @_Z7kernel2PiS_S_
; %bb.0:
	s_load_b128 s[4:7], s[0:1], 0x0
	s_mov_b32 s2, exec_lo
	s_waitcnt lgkmcnt(0)
	s_load_b32 s4, s[4:5], 0x0
	s_waitcnt lgkmcnt(0)
	v_cmpx_gt_i32_e64 s4, v0
	s_cbranch_execz .LBB1_9
; %bb.1:
	s_load_b64 s[2:3], s[0:1], 0x10
	v_lshlrev_b32_e32 v1, 2, v0
	s_cmp_lt_u32 s4, 2
	global_load_b32 v2, v1, s[6:7]
	s_waitcnt lgkmcnt(0)
	global_load_b32 v3, v1, s[2:3]
	s_waitcnt vmcnt(0)
	ds_store_2addr_b32 v1, v3, v2 offset1:32
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc1 .LBB1_7
; %bb.2:
	v_add_nc_u32_e32 v2, 0x80, v1
.LBB1_3:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	s_mov_b32 s1, s4
	s_lshr_b32 s4, s4, 1
	s_mov_b32 s5, exec_lo
	v_cmpx_gt_u32_e64 s4, v0
	s_cbranch_execz .LBB1_6
; %bb.4:                                ;   in Loop: Header=BB1_3 Depth=1
	v_lshl_add_u32 v3, s4, 2, v2
	ds_load_b32 v3, v3
	ds_load_b32 v4, v2
	s_waitcnt lgkmcnt(0)
	v_cmp_lt_i32_e32 vcc_lo, v3, v4
	v_cmp_ne_u32_e64 s0, 0, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, vcc_lo, s0
	s_and_b32 exec_lo, exec_lo, s0
	s_cbranch_execz .LBB1_6
; %bb.5:                                ;   in Loop: Header=BB1_3 Depth=1
	v_lshl_add_u32 v4, s4, 2, v1
	ds_load_b32 v4, v4
	ds_store_b32 v2, v3
	s_waitcnt lgkmcnt(1)
	ds_store_b32 v1, v4
.LBB1_6:                                ;   in Loop: Header=BB1_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	s_cmp_gt_u32 s1, 3
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc1 .LBB1_3
.LBB1_7:                                ; %._crit_edge
	v_cmp_eq_u32_e32 vcc_lo, 0, v0
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_9
; %bb.8:
	v_mov_b32_e32 v2, 0
	ds_load_2addr_b32 v[0:1], v2 offset1:32
	s_waitcnt lgkmcnt(0)
	s_clause 0x1
	global_store_b32 v2, v1, s[6:7]
	global_store_b32 v2, v0, s[2:3]
.LBB1_9:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7kernel2PiS_S_
		.amdhsa_group_segment_fixed_size 256
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 24
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 5
		.amdhsa_next_free_sgpr 8
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z7kernel2PiS_S_, .Lfunc_end1-_Z7kernel2PiS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 320
; NumSgprs: 10
; NumVgprs: 5
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 256 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 10
; NumVGPRsForWavesPerEU: 5
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z7kernel3PiS_S_S_S_S_  ; -- Begin function _Z7kernel3PiS_S_S_S_S_
	.globl	_Z7kernel3PiS_S_S_S_S_
	.p2align	8
	.type	_Z7kernel3PiS_S_S_S_S_,@function
_Z7kernel3PiS_S_S_S_S_:                 ; @_Z7kernel3PiS_S_S_S_S_
; %bb.0:
	s_load_b128 s[16:19], s[0:1], 0x20
	s_waitcnt lgkmcnt(0)
	s_load_b32 s2, s[16:17], 0x0
	s_load_b256 s[4:11], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_ashr_i32 s3, s2, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_lt_i64_e64 s14, s[2:3], 1
	s_lshl_b64 s[12:13], s[2:3], 2
	s_add_u32 s12, s4, s12
	s_addc_u32 s13, s5, s13
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s14
	s_cbranch_vccnz .LBB2_3
; %bb.1:                                ; %.lr.ph.preheader
	s_add_u32 s16, s4, 20
	s_addc_u32 s17, s5, 0
	s_mov_b32 s4, 0
	s_mov_b32 s3, s2
.LBB2_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	s_load_b32 s5, s[16:17], 0x0
	s_add_i32 s3, s3, -1
	s_waitcnt lgkmcnt(0)
	s_add_i32 s4, s5, s4
	s_add_u32 s16, s16, 4
	s_addc_u32 s17, s17, 0
	s_cmp_eq_u32 s3, 0
	s_cbranch_scc0 .LBB2_2
	s_branch .LBB2_4
.LBB2_3:
	s_mov_b32 s4, 0
.LBB2_4:                                ; %Flow80
	s_load_b32 s14, s[18:19], 0x0
	s_load_b32 s3, s[12:13], 0x14
	s_load_b32 s0, s[0:1], 0x3c
	s_waitcnt lgkmcnt(0)
	s_and_b32 s0, s0, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s0, v[0:1]
	v_cmp_gt_i32_e32 vcc_lo, 5, v1
	v_cmp_ne_u32_e64 s0, s2, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, vcc_lo, s0
	s_cmp_gt_i32 s3, 0
	s_cselect_b32 s1, -1, 0
	s_and_b32 s0, s0, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB2_10
; %bb.5:                                ; %.lr.ph51.preheader
	s_ashr_i32 s5, s4, 31
	s_ashr_i32 s15, s14, 31
	s_lshl_b64 s[12:13], s[4:5], 2
	v_mov_b32_e32 v0, 0
	s_add_i32 s3, s4, s3
	s_lshl_b64 s[0:1], s[14:15], 2
	s_add_u32 s6, s6, s12
	s_addc_u32 s7, s7, s13
.LBB2_6:                                ; %.lr.ph51
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b32 v2, v0, s[6:7]
	s_mov_b32 s5, exec_lo
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u32_e64 v2, v1
	s_cbranch_execz .LBB2_9
; %bb.7:                                ;   in Loop: Header=BB2_6 Depth=1
	s_add_u32 s12, s6, s0
	s_addc_u32 s13, s7, s1
	s_clause 0x1
	global_load_b32 v2, v0, s[12:13]
	global_load_b32 v3, v0, s[10:11]
	s_waitcnt vmcnt(0)
	v_cmp_ge_i32_e32 vcc_lo, v2, v3
	s_cbranch_vccnz .LBB2_9
; %bb.8:                                ;   in Loop: Header=BB2_6 Depth=1
	v_mov_b32_e32 v3, s2
	s_clause 0x1
	global_store_b32 v0, v2, s[10:11]
	global_store_b32 v0, v3, s[8:9]
.LBB2_9:                                ;   in Loop: Header=BB2_6 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	s_add_i32 s4, s4, 1
	s_add_u32 s6, s6, 4
	s_addc_u32 s7, s7, 0
	s_cmp_lt_i32 s4, s3
	s_cbranch_scc1 .LBB2_6
.LBB2_10:                               ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7kernel3PiS_S_S_S_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 4
		.amdhsa_next_free_sgpr 20
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	_Z7kernel3PiS_S_S_S_S_, .Lfunc_end2-_Z7kernel3PiS_S_S_S_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 384
; NumSgprs: 22
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 22
; NumVGPRsForWavesPerEU: 4
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
