#include <iostream>
#include <utility>
#include <algorithm>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <time.h>
//#include "graphfilter.h"

//#include <cutil.h>

//#include <graphfilter_kernel.cu>
#define N 400
#define DEBUG 0

typedef struct _Graph_node_A {
	int adj[N];
} Graph_node_A;

using namespace std;

extern "C"

#ifndef _MATRIXMUL_H_
#define _MATRIXMUL_H_
__global__ void naiveFilterKernel(struct _Graph_node_A *PA, int *relation_count, int *v_start, int *max_id_A)
{
	__shared__ int v_start_adj[N];

	int tid = threadIdx.x;
	int count=0;

	if(tid < N)
		v_start_adj[tid] = PA[(*v_start)-1].adj[tid];
	__syncthreads();

	if(tid == ((*v_start)-1) || tid >= *max_id_A) return;

	int i, j;

	for(i=0;(i<N) && (PA[tid].adj[i] != 0);i++) {
		for(j=0;j<N && v_start_adj[j]!= 0;j++) {
			if(PA[tid].adj[i] == v_start_adj[j]){
				count++;
				break;
			}
		}
	}
	relation_count[tid] = count;
}
#endif

#ifndef _MATRIXMUL_F_
#define _MATRIXMUL_F_
__global__ void fullFilterKernel(struct _Graph_node_A *PA, int *relation_count, int *index_vertice, int *k, int *max_id_A)
{
	__shared__ int index_ref[N];

	int by = blockIdx.y;
	int tx = threadIdx.x;
	int count = 0;

	if((by >= *k) || (tx >= *max_id_A)) return;

	// load data into shared memory
	if(tx < N)
		index_ref[tx] = PA[index_vertice[by]-1].adj[tx];
	__syncthreads();

	for(int i=0;(i<N) && (PA[tx].adj[i] != 0);i++)
		for(int j=0;(j<N) && (index_ref[j]!= 0);j++) {
			if((PA[tx].adj[i] == index_ref[j]) && ((index_vertice[by]-1) != tx)) {
				count++;
				break;
			}
		}

	relation_count[(by+1) * (*max_id_A) + tx] = count;
}
#endif

void filterOnDevice(struct _Graph_node_A *PA, int *relation_count, int *index_vertice, int v_start, int k, int max_id_A);
void filterOnHost(struct _Graph_node_A *PA, int *relation_count_h, int *index_vertice_h, int v_start, int k, int max_id_A);

// function to sort the relations to the start vertice in a descending order
void selSort(int s[], int index[], int length);

//function to compare the result between the host side and device side
bool compare(vector<int> final_resut_h, vector<int> final_result_d);

//static const char* DAT_FILE_NAME = "graph.dat";// file to store the graph struct

int main(int arcg, char** argv)
{
	char tracefilename[30];
	int A, B; //fot the nodes in party A and party B
	int max_id_A;
	int max_id_B;
	int max_weight;
	int i=0, j=0;
	//int m=0, n=0;
	FILE *fp;
	char buf[100];

	struct _Graph_node_A *PA;

	/***********************************************************
	  read in the trace file **********************************
	 ************************************************************/
	printf("Please input the trace file name:");
	scanf("%s", &tracefilename);

	fp = fopen(tracefilename, "r");
	if(fp==NULL){
		printf("Could not open the trace file!\n");
		exit(1);
	}
	printf("Has open the trace successfully!\n");

	while(fgets(buf,100,fp)){
		if(buf[0]=='%') continue;
		if(i==0){
			sscanf(buf, "%d%d%d", &max_id_A, &max_id_B, &max_weight);
			break;
		}
	}

	fclose(fp);

	cout << max_id_A << endl;
	PA = (struct _Graph_node_A *)malloc(sizeof(struct _Graph_node_A) * max_id_A);
	if(PA == NULL)
		cout << "Allocate memory for PA failed" <<endl;
	else
		cout << "Allocate memory for PA successfully" << endl;

	// initialize A and B
	for(i=0;i<max_id_A;i++)
		for(j=0;j<N;j++)
			PA[i].adj[j] = 0;

	cout << "Initialized PA successfully!" << endl;

	fp = fopen(tracefilename, "r");
	if(fp==NULL){
		printf("Could not open the trace file!\n");
		exit(1);
	}
	printf("Has open the trace sucessfully!\n");

	int index[max_id_A];
	for(i=0;i<max_id_A;i++)
		index[i]  = 0;
	cout << "Initilized index successfully" << endl;

	i=0;

	//read in the input file and build the graph
	while(fgets(buf,100,fp)){
		if(buf[0]=='%')
			continue;
		if(i==0){
			sscanf(buf,"%d%d%d", &max_id_A, &max_id_B, &max_weight);
			cout << max_id_A << " " << max_id_B << " " << max_weight << endl;
			i++;
		}else{
			sscanf(buf, "%d%d", &A, &B);
			PA[A-1].adj[index[A-1]++] = B;
		}
	}

	fclose(fp);

	// Naive Graph collaboratie Filtering
	int v_start;// the start vertive for search
	int k;// the k is the number of relational vertices needed to be found

	// read in the start vertex, and value k for ralation depth
	std::cout << "Please input the start vertice as an interger number less than " << max_id_A << " :";
	scanf("%d", &v_start);
	while(v_start<0 || v_start > max_id_A) {
		cout << "Please input a valid start vertice less than " << max_id_A << " :";
		scanf("%d", &v_start);
	}

	std::cout << "Please input the value of k as an interger number less than " << max_id_A << " :";
	scanf("%d", &k);
	while(k < 0 || k > max_id_A) {
		cout << "Please input a valid k less than " << max_id_A << " :";
		scanf("%d", &k);
	}


	int* relation_count = (int*)malloc((k+1)*max_id_A*sizeof(int));
	int* index_vertice = (int*)malloc((k+1)*max_id_A*sizeof(int));

	int* relation_count_h = (int*)malloc((k+1)*max_id_A*sizeof(int));
	int* index_vertice_h = (int*)malloc((k+1)*max_id_A*sizeof(int));

	//initialize the relation_count and vertice index
	for(i=0;i<k+1;i++)
		for(j=0;j<max_id_A;j++){
			relation_count[i * max_id_A + j] = 0;
			relation_count_h[i * max_id_A + j] = 0;
			index_vertice[i * max_id_A + j] = j + 1;
			index_vertice_h[i * max_id_A + j] = j + 1;
		}

	// executing the filtering algorithm on the host side
	clock_t st = clock();
	filterOnHost(PA, relation_count_h, index_vertice_h, v_start, k, max_id_A);
	st = clock() - st;
	printf("CPU execution time is %.5f\n", (float)st/CLOCKS_PER_SEC);

#if DEBUG
	cout << "Relation count on the host side is:" << endl;
	for(i=0;i<k+1;i++){
		for(j=0;j<max_id_A;j++){
			cout << relation_count_h[i*max_id_A+j] << " ";
		}
		cout << endl;
	}
#endif

	// executing the filtering algorithm on the device side
	st = clock();
	filterOnDevice(PA, relation_count, index_vertice, v_start, k, max_id_A);
	st = clock() - st;
	printf("GPU execution time is %.5f\n", (float)st/CLOCKS_PER_SEC);


	//sort the relation in a descending order
	for(i=1;i<k+1;i++) {
		selSort(&relation_count[i*max_id_A], &index_vertice[i*max_id_A], max_id_A);
		selSort(&relation_count_h[i*max_id_A], &index_vertice_h[i*max_id_A], max_id_A);
	}

#if DEBUG
	cout << "The " << k << " related vertices to each vertice are: " << endl;
	for(i=0;i<k+1;i++) {
		for(j=0;j<k;j++) {
			cout << index_vertice[i * max_id_A + j]	<< " ";
			cout << index_vertice_h[i * max_id_A + j] << " ";
		}
		cout << endl;
	}
#endif


	vector<int> final_result_d;// record the final result of collaborative filtering for visualization
	vector<int> final_result_h;
	vector<int>::iterator it;

	// copy the index_vertice to the final_result vector
	for(i=0;i<k+1;i++)
		for(j=0;j<k;j++) {
			final_result_d.push_back(index_vertice[i * max_id_A + j]);
			final_result_h.push_back(index_vertice_h[i * max_id_A + j]);
		}


	// sort the final_result vector in a desending order
	std::sort(final_result_d.begin(), final_result_d.end());
	std::sort(final_result_h.begin(), final_result_h.end());

	// remove the repeated vertices
	for(it=final_result_d.begin()+1, i=final_result_d.front();it!=final_result_d.end();) {
		if(i == *it)
			final_result_d.erase(it);
		else {
			i = *it;
			it++;
		}
	}

	for(it=final_result_h.begin()+1, i=final_result_h.front();it!=final_result_h.end();) {
		if(i == *it)
			final_result_h.erase(it);
		else {
			i = *it;
			it++;
		}
	}

	// compare the result from GPU with the result from CPU to test the correctness
	bool match = compare(final_result_h, final_result_d);
	if(match)
		cout << "Test passed ^^!" << endl;
	else
		cout << "Test failed !!" << endl;

	// output the final result
	cout << "The final Collaborative Filtering result is:" << endl;
	for(it=final_result_d.begin();it!=final_result_d.end();it++)
		cout << *it << " ";
	cout << endl;

	free(relation_count);
	free(relation_count_h);
	free(index_vertice);
	free(index_vertice_h);

	return 0;
}

void filterOnHost(struct _Graph_node_A *PA, int *relation_count, int *index_vertice, int v_start, int k, int max_id_A)
{
	int i, j, m, n;

	// naive collaborative filtering
	for(i=0;i<max_id_A;i++){
		if(i == v_start - 1)	continue;
		for(j=0;j<N && PA[i].adj[j] != 0;j++)
			for(m=0;m<N && PA[v_start-1].adj[m] != 0;m++){
				if(PA[v_start-1].adj[m] == PA[i].adj[j]) {
					relation_count[i]++;
					break;
				}
			}
	}

	// sort the relation in a descending order by selection sort algorithm
	selSort(relation_count, index_vertice, max_id_A);

	// full collaborative filtering
	for(i=0;i<k;i++)
		for(j=0;j<max_id_A;j++)
			for(m=0;m<N && PA[j].adj[m] != 0;m++)
				for(n=0;n<N && PA[index_vertice[i]-1].adj[n] != 0;n++) {
					if(PA[index_vertice[i]-1].adj[n] == PA[j].adj[m] && index_vertice[i] - 1 != j) {
						relation_count[(i+1)*max_id_A + j] ++;
						break;
					}
				}

}

void filterOnDevice(struct _Graph_node_A *PA, int *relation_count, int *index_vertice, int v_start, int k, int max_id_A) {
	struct _Graph_node_A *PA_d;
	int *relation_count_d;
	int *max_id_A_d;
	int *index_vertice_d;
	int *v_start_d;
	int *k_d;
	int size = (k + 1) * max_id_A * sizeof(int);

	cudaMalloc((void**)&(PA_d), sizeof(struct _Graph_node_A) * max_id_A);
	cudaMalloc((void**)&(relation_count_d), size);
	cudaMalloc((void**)&(max_id_A_d), sizeof(int));
	cudaMalloc((void**)&(v_start_d), sizeof(int));
	cudaMalloc((void**)&(k_d), sizeof(int));
	cudaMalloc((void**)&(index_vertice_d), max_id_A * sizeof(int));

	cudaMemcpy(PA_d, PA, sizeof(struct _Graph_node_A) * max_id_A, cudaMemcpyHostToDevice);
	cudaMemcpy(relation_count_d, relation_count, size, cudaMemcpyHostToDevice);
	cudaMemcpy(max_id_A_d, &max_id_A, sizeof(int), cudaMemcpyHostToDevice);
	cudaMemcpy(v_start_d, &v_start, sizeof(int), cudaMemcpyHostToDevice);
	cudaMemcpy(k_d, &k, sizeof(int), cudaMemcpyHostToDevice);

	// naive collaborative filtering
	dim3 dimGrid0(1, 1);
	dim3 dimBlock0(max_id_A, 1);
	naiveFilterKernel<<<dimGrid0, dimBlock0>>>(PA_d, relation_count_d, v_start_d, max_id_A_d);

	cudaMemcpy(relation_count, relation_count_d, max_id_A * sizeof(int), cudaMemcpyDeviceToHost);

#if DEBUG
	cout << "The relation count is:" << endl;
	for(int i=0; i<k+1;i++) {
		for(int j=0;j<max_id_A;j++){
			cout << relation_count[i*max_id_A+j] << " ";
		}
		cout << endl;
	}
#endif

	selSort(relation_count, index_vertice, max_id_A);

#if DEBUG
	cout << "The " << k << " related vertice to " << v_start << " is:" << endl;
	for(int i=0;i<k;i++)
		cout << index_vertice[i] << " ";
	cout << endl;
#endif

	cudaMemcpy(index_vertice_d, index_vertice, max_id_A * sizeof(int), cudaMemcpyHostToDevice);

	// full collaborative filtering
	dim3 dimGrid(1, k);
	dim3 dimBlock(max_id_A, 1);
	fullFilterKernel<<<dimGrid, dimBlock>>>(PA_d, relation_count_d, index_vertice_d, k_d, max_id_A_d);

	cudaMemcpy(relation_count, relation_count_d, size, cudaMemcpyDeviceToHost);

#if DEBUG
	cout << "The relation count is:" << endl;
	for(int i=0; i<k+1;i++) {
		for(int j=0;j<max_id_A;j++){
			cout << relation_count[i*max_id_A+j] << " ";
		}
		cout << endl;
	}
#endif

	cudaFree(PA_d);
	PA_d = NULL;
	cudaFree(relation_count_d);
	relation_count_d = NULL;
	cudaFree(max_id_A_d);
	max_id_A_d = NULL;
	cudaFree(k_d);
	k_d = NULL;
	cudaFree(index_vertice_d);
	index_vertice_d = NULL;
}

// Selection Sort
void selSort(int s[], int index[], int length)
{
	int i, j, maxPos;
	for(i=0;i<length-1;i++) {
		maxPos = i;
		for(j=i+1;j<length;j++)
			if(s[j] > s[maxPos])
				maxPos = j;
		if(i != maxPos) {
			swap(s[i], s[maxPos]);
			swap(index[i], index[maxPos]);
		}
	}
}

bool compare(vector<int> final_result_h, vector<int> final_result_d)
{
	vector<int>::iterator it_h;
	vector<int>::iterator it_d;

	for(it_h=final_result_h.begin(), it_d=final_result_d.begin(); it_h != final_result_h.end() && it_d != final_result_d.end();it_h++, it_d++) {
		if((*it_h) != (*it_d))
			return false;
	}

	return true;
}

	.file	"tmpxft_002e0161_00000000-6_graphfilter_final.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4404:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4404:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.text._ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_.isra.0,"axG",@progbits,_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_,comdat
	.type	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_.isra.0, @function
_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_.isra.0:
.LFB5241:
	.cfi_startproc
	leaq	-1(%rdx), %rax
	movq	%rsi, %r9
	movl	%ecx, %r8d
	movq	%rdx, %rsi
	movl	$2, %ecx
	cqto
	idivq	%rcx
	movq	%r9, %rcx
.L3:
	cmpq	%rax, %rcx
	jge	.L11
	leaq	1(%rcx), %rdx
	addq	%rdx, %rdx
	movl	-4(%rdi,%rdx,4), %r11d
	leaq	-1(%rdx), %r10
	cmpl	%r11d, (%rdi,%rdx,4)
	cmovge	%rdx, %r10
	movl	(%rdi,%r10,4), %edx
	movl	%edx, (%rdi,%rcx,4)
	movq	%r10, %rcx
	jmp	.L3
.L11:
	testl	$1, %esi
	jne	.L6
	leaq	-2(%rsi), %rax
	movl	$2, %esi
	cqto
	idivq	%rsi
	cmpq	%rax, %rcx
	jne	.L6
	leaq	1(%rcx,%rcx), %rax
	movl	(%rdi,%rax,4), %edx
	movl	%edx, (%rdi,%rcx,4)
	movq	%rax, %rcx
.L6:
	leaq	-1(%rcx), %rax
	movl	$2, %esi
.L9:
	cqto
	idivq	%rsi
	leaq	(%rdi,%rcx,4), %rdx
	cmpq	%rcx, %r9
	jge	.L7
	movl	(%rdi,%rax,4), %ecx
	cmpl	%ecx, %r8d
	jle	.L7
	movl	%ecx, (%rdx)
	leaq	-1(%rax), %rdx
	movq	%rax, %rcx
	movq	%rdx, %rax
	jmp	.L9
.L7:
	movl	%r8d, (%rdx)
	ret
	.cfi_endproc
.LFE5241:
	.size	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_.isra.0, .-_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_.isra.0
	.text
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB5243:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE5243:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.section	.text._ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_.isra.0,"axG",@progbits,_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_,comdat
	.type	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_.isra.0, @function
_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_.isra.0:
.LFB5244:
	.cfi_startproc
	cmpq	%rsi, %rdi
	jne	.L25
	ret
.L25:
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$4, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	4(%rdi), %rbx
.L15:
	cmpq	%rbx, %r12
	je	.L29
	movl	(%rbx), %r13d
	movl	0(%rbp), %eax
	cmpl	%eax, %r13d
	jge	.L23
	movq	%rbx, %rdx
	subq	%rbp, %rdx
	cmpq	$4, %rdx
	jle	.L17
	movq	%r14, %rdi
	movq	%rbp, %rsi
	subq	%rdx, %rdi
	addq	%rbx, %rdi
	call	memmove@PLT
	jmp	.L18
.L17:
	jne	.L18
	movl	%eax, (%rbx)
.L18:
	movl	%r13d, 0(%rbp)
	jmp	.L19
.L23:
	movq	%rbx, %rax
.L16:
	movl	-4(%rax), %edx
	cmpl	%edx, %r13d
	jge	.L30
	movl	%edx, (%rax)
	subq	$4, %rax
	jmp	.L16
.L30:
	movl	%r13d, (%rax)
.L19:
	addq	$4, %rbx
	jmp	.L15
.L29:
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5244:
	.size	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_.isra.0, .-_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_.isra.0
	.section	.text._ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_.isra.0,"axG",@progbits,_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_,comdat
	.type	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_.isra.0, @function
_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_.isra.0:
.LFB5246:
	.cfi_startproc
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	4(%rdi), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdi, %rbx
.L32:
	movq	%rbp, %rax
	subq	%rbx, %rax
	cmpq	$64, %rax
	jle	.L31
	movq	%rax, %r13
	sarq	$2, %r13
	testq	%r14, %r14
	jne	.L33
	leaq	-2(%r13), %r12
	sarq	%r12
.L35:
	movl	(%rbx,%r12,4), %ecx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_.isra.0
	testq	%r12, %r12
	je	.L36
	decq	%r12
	jmp	.L35
.L36:
	movq	%rbp, %rax
	subq	$4, %rbp
	subq	%rbx, %rax
	cmpq	$4, %rax
	jle	.L31
	movl	(%rbx), %eax
	movl	0(%rbp), %ecx
	movq	%rbp, %rdx
	xorl	%esi, %esi
	subq	%rbx, %rdx
	movq	%rbx, %rdi
	movl	%eax, 0(%rbp)
	sarq	$2, %rdx
	call	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_.isra.0
	jmp	.L36
.L33:
	sarq	$3, %rax
	movl	4(%rbx), %edi
	movl	-4(%rbp), %ecx
	movq	%r12, %rdx
	leaq	(%rbx,%rax,4), %r8
	movl	(%rbx), %eax
	movl	(%r8), %esi
	cmpl	%esi, %edi
	jge	.L39
	cmpl	%esi, %ecx
	jg	.L45
	cmpl	%edi, %ecx
	jle	.L42
	jmp	.L53
.L39:
	cmpl	%edi, %ecx
	jle	.L44
.L42:
	movl	%edi, (%rbx)
	movl	%eax, 4(%rbx)
.L41:
	movq	%rbp, %rax
	jmp	.L43
.L44:
	cmpl	%esi, %ecx
	jle	.L45
.L53:
	movl	%ecx, (%rbx)
	movl	%eax, -4(%rbp)
	jmp	.L41
.L45:
	movl	%esi, (%rbx)
	movl	%eax, (%r8)
	jmp	.L41
.L48:
	movl	%esi, 0(%r13)
	movl	%ecx, (%rdx)
	leaq	4(%r13), %rdx
.L43:
	movl	(%rbx), %edi
.L46:
	movq	%rdx, %r13
	movl	(%rdx), %ecx
	leaq	4(%rdx), %rdx
	cmpl	%edi, %ecx
	jl	.L46
	subq	$4, %rax
.L47:
	movq	%rax, %rdx
	movl	(%rax), %esi
	subq	$4, %rax
	cmpl	%esi, %edi
	jl	.L47
	movq	%rdx, %rax
	cmpq	%rdx, %r13
	jb	.L48
	decq	%r14
	movq	%rbp, %rsi
	movq	%r13, %rdi
	movq	%r13, %rbp
	movq	%r14, %rdx
	call	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_.isra.0
	jmp	.L32
.L31:
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5246:
	.size	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_.isra.0, .-_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_.isra.0
	.text
	.globl	_Z7selSortPiS_i
	.type	_Z7selSortPiS_i, @function
_Z7selSortPiS_i:
.LFB4399:
	.cfi_startproc
	endbr64
	movl	%edx, %r8d
	xorl	%edx, %edx
	movq	%rdi, %rcx
	leal	-1(%r8), %r10d
	movl	%edx, %eax
	movl	%edx, %r11d
	cmpl	%edx, %r10d
	jg	.L63
	ret
.L63:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
.L60:
	leaq	1(%rdx), %r9
	movq	%r9, %rdi
.L56:
	cmpl	%edi, %r8d
	jle	.L64
	movslq	%eax, %rbx
	movl	(%rcx,%rbx,4), %ebx
	cmpl	%ebx, (%rcx,%rdi,4)
	cmovg	%edi, %eax
	incq	%rdi
	jmp	.L56
.L64:
	cmpl	%r11d, %eax
	je	.L59
	cltq
	movl	(%rcx,%rdx,4), %r11d
	salq	$2, %rax
	leaq	(%rcx,%rax), %rdi
	addq	%rsi, %rax
	movl	(%rdi), %ebx
	movl	%ebx, (%rcx,%rdx,4)
	movl	%r11d, (%rdi)
	movl	(%rsi,%rdx,4), %edi
	movl	(%rax), %r11d
	movl	%r11d, (%rsi,%rdx,4)
	movl	%edi, (%rax)
.L59:
	movq	%r9, %rdx
	movl	%r9d, %eax
	movl	%r9d, %r11d
	cmpl	%r9d, %r10d
	jg	.L60
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4399:
	.size	_Z7selSortPiS_i, .-_Z7selSortPiS_i
	.globl	_Z12filterOnHostP13_Graph_node_APiS1_iii
	.type	_Z12filterOnHostP13_Graph_node_APiS1_iii, @function
_Z12filterOnHostP13_Graph_node_APiS1_iii:
.LFB4397:
	.cfi_startproc
	endbr64
	movslq	%ecx, %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	decl	%ecx
	imulq	$1600, %rax, %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%r8d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	movq	%rdx, %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	-1600(%rdi,%rax), %r11
	movq	%rdi, %rbp
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%r9d, %ebx
	pushq	%r10
	.cfi_def_cfa_offset 64
.L66:
	cmpl	%eax, %ebx
	jle	.L101
	cmpl	%eax, %ecx
	je	.L67
	imulq	$1600, %rax, %r8
	xorl	%edx, %edx
	addq	%rbp, %r8
.L68:
	movl	(%r8,%rdx,4), %r9d
	testl	%r9d, %r9d
	je	.L67
	xorl	%edi, %edi
.L72:
	movl	(%r11,%rdi,4), %r10d
	testl	%r10d, %r10d
	je	.L70
	cmpl	%r9d, %r10d
	jne	.L69
	incl	(%r12,%rax,4)
	jmp	.L70
.L69:
	incq	%rdi
	cmpq	$400, %rdi
	jne	.L72
.L70:
	incq	%rdx
	cmpq	$400, %rdx
	jne	.L68
.L67:
	incq	%rax
	jmp	.L66
.L101:
	movl	%ebx, %edx
	movq	%r12, %rdi
	call	_Z7selSortPiS_i
	movl	%ebx, %r9d
	xorl	%edx, %edx
.L74:
	cmpl	%edx, %r13d
	jle	.L65
	movq	%rbp, %r8
	xorl	%eax, %eax
.L83:
	cmpl	%ebx, %eax
	jge	.L80
	leal	(%rax,%r9), %ecx
	movslq	%ecx, %rcx
	leaq	(%r12,%rcx,4), %r10
	xorl	%ecx, %ecx
.L81:
	movl	(%r8,%rcx,4), %r11d
	testl	%r11d, %r11d
	je	.L78
	movslq	(%rsi,%rdx,4), %rdi
	movq	%rdi, %r14
	imulq	$1600, %rdi, %rdi
	leaq	-1600(%rbp,%rdi), %r15
	leal	-1(%r14), %edi
	movl	%edi, 4(%rsp)
	xorl	%edi, %edi
.L79:
	movl	(%r15,%rdi,4), %r14d
	testl	%r14d, %r14d
	je	.L76
	cmpl	%r11d, %r14d
	jne	.L75
	cmpl	%eax, 4(%rsp)
	je	.L75
	incl	(%r10)
	jmp	.L76
.L75:
	incq	%rdi
	cmpq	$400, %rdi
	jne	.L79
.L76:
	incq	%rcx
	cmpq	$400, %rcx
	jne	.L81
.L78:
	incl	%eax
	addq	$1600, %r8
	jmp	.L83
.L80:
	incq	%rdx
	addl	%ebx, %r9d
	jmp	.L74
.L65:
	popq	%rax
	.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
.LFE4397:
	.size	_Z12filterOnHostP13_Graph_node_APiS1_iii, .-_Z12filterOnHostP13_Graph_node_APiS1_iii
	.globl	_Z7compareSt6vectorIiSaIiEES1_
	.type	_Z7compareSt6vectorIiSaIiEES1_, @function
_Z7compareSt6vectorIiSaIiEES1_:
.LFB4401:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %r8
	movq	(%rsi), %rdx
	movq	(%rdi), %rax
.L104:
	movq	%rax, %rdi
	cmpq	%rax, %r8
	je	.L106
	movq	%rdx, %rcx
	cmpq	%rdx, 8(%rsi)
	je	.L106
	movl	(%rcx), %ecx
	addq	$4, %rdx
	addq	$4, %rax
	cmpl	%ecx, (%rdi)
	je	.L104
	xorl	%eax, %eax
	ret
.L106:
	movb	$1, %al
	ret
	.cfi_endproc
.LFE4401:
	.size	_Z7compareSt6vectorIiSaIiEES1_, .-_Z7compareSt6vectorIiSaIiEES1_
	.globl	_Z59__device_stub__Z17naiveFilterKernelP13_Graph_node_APiS1_S1_P13_Graph_node_APiS1_S1_
	.type	_Z59__device_stub__Z17naiveFilterKernelP13_Graph_node_APiS1_S1_P13_Graph_node_APiS1_S1_, @function
_Z59__device_stub__Z17naiveFilterKernelP13_Graph_node_APiS1_S1_P13_Graph_node_APiS1_S1_:
.LFB4426:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L108
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	naiveFilterKernel(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L108:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L110
	call	__stack_chk_fail@PLT
.L110:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4426:
	.size	_Z59__device_stub__Z17naiveFilterKernelP13_Graph_node_APiS1_S1_P13_Graph_node_APiS1_S1_, .-_Z59__device_stub__Z17naiveFilterKernelP13_Graph_node_APiS1_S1_P13_Graph_node_APiS1_S1_
	.globl	naiveFilterKernel
	.type	naiveFilterKernel, @function
naiveFilterKernel:
.LFB4427:
	.cfi_startproc
	endbr64
	jmp	_Z59__device_stub__Z17naiveFilterKernelP13_Graph_node_APiS1_S1_P13_Graph_node_APiS1_S1_
	.cfi_endproc
.LFE4427:
	.size	naiveFilterKernel, .-naiveFilterKernel
	.globl	_Z61__device_stub__Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_P13_Graph_node_APiS1_S1_S1_
	.type	_Z61__device_stub__Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_P13_Graph_node_APiS1_S1_S1_, @function
_Z61__device_stub__Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_P13_Graph_node_APiS1_S1_S1_:
.LFB4428:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L113
	pushq	56(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 192
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L113:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L115
	call	__stack_chk_fail@PLT
.L115:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4428:
	.size	_Z61__device_stub__Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_P13_Graph_node_APiS1_S1_S1_, .-_Z61__device_stub__Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_P13_Graph_node_APiS1_S1_S1_
	.globl	_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_
	.type	_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_, @function
_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_:
.LFB4429:
	.cfi_startproc
	endbr64
	jmp	_Z61__device_stub__Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_P13_Graph_node_APiS1_S1_S1_
	.cfi_endproc
.LFE4429:
	.size	_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_, .-_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_
	.globl	_Z14filterOnDeviceP13_Graph_node_APiS1_iii
	.type	_Z14filterOnDeviceP13_Graph_node_APiS1_iii, @function
_Z14filterOnDeviceP13_Graph_node_APiS1_iii:
.LFB4398:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rsi, %rbp
	movslq	%r9d, %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$136, %rsp
	.cfi_def_cfa_offset 176
	movl	%r8d, 8(%rsp)
	incl	%r8d
	leaq	24(%rsp), %rdi
	imull	%esi, %r8d
	movl	%r9d, 4(%rsp)
	movl	%ecx, 12(%rsp)
	imulq	$1600, %rsi, %rsi
	leal	0(,%r8,4), %ebx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	movslq	%ebx, %rbx
	call	cudaMalloc@PLT
	leaq	32(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	leaq	40(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	leaq	56(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	leaq	64(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	movslq	4(%rsp), %rsi
	leaq	48(%rsp), %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movslq	4(%rsp), %rdx
	movq	24(%rsp), %rdi
	movq	%r13, %rsi
	movl	$1, %ecx
	imulq	$1600, %rdx, %rdx
	call	cudaMemcpy@PLT
	movq	32(%rsp), %rdi
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rdi
	leaq	4(%rsp), %rsi
	movl	$1, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	56(%rsp), %rdi
	leaq	12(%rsp), %rsi
	movl	$1, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movq	64(%rsp), %rdi
	leaq	8(%rsp), %rsi
	movl	$1, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movl	4(%rsp), %eax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movq	%rdi, 88(%rsp)
	movl	92(%rsp), %ecx
	movl	%eax, 84(%rsp)
	movq	84(%rsp), %rdx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L119
	movq	40(%rsp), %rcx
	movq	56(%rsp), %rdx
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdi
	call	_Z59__device_stub__Z17naiveFilterKernelP13_Graph_node_APiS1_S1_P13_Graph_node_APiS1_S1_
.L119:
	movslq	4(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbp, %rdi
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	4(%rsp), %r13d
	movq	%r12, %rsi
	movq	%rbp, %rdi
	movl	%r13d, %edx
	call	_Z7selSortPiS_i
	movq	48(%rsp), %rdi
	movslq	%r13d, %rdx
	movl	$1, %ecx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movl	8(%rsp), %eax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, 96(%rsp)
	movl	$1, %esi
	movl	%eax, 100(%rsp)
	movl	4(%rsp), %eax
	movq	96(%rsp), %rdi
	movl	%eax, 108(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 112(%rsp)
	movl	116(%rsp), %ecx
	movq	108(%rsp), %rdx
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L120
	movq	40(%rsp), %r8
	movq	64(%rsp), %rcx
	movq	48(%rsp), %rdx
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdi
	call	_Z61__device_stub__Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_P13_Graph_node_APiS1_S1_S1_
.L120:
	movq	32(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdx
	movq	%rbp, %rdi
	call	cudaMemcpy@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	xorl	%eax, %eax
	movq	%rax, 24(%rsp)
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	xorl	%edx, %edx
	movq	%rdx, 32(%rsp)
	call	cudaFree@PLT
	movq	64(%rsp), %rdi
	xorl	%ecx, %ecx
	movq	%rcx, 40(%rsp)
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	xorl	%esi, %esi
	movq	%rsi, 64(%rsp)
	call	cudaFree@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L121
	call	__stack_chk_fail@PLT
.L121:
	addq	$136, %rsp
	.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
.LFE4398:
	.size	_Z14filterOnDeviceP13_Graph_node_APiS1_iii, .-_Z14filterOnDeviceP13_Graph_node_APiS1_iii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_"
.LC1:
	.string	"naiveFilterKernel"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4431:
	.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	.LC0(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_(%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	.LC1(%rip), %rdx
	orl	$-1, %r8d
	leaq	naiveFilterKernel(%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
.LFE4431:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIiSaIiEED2Ev,"axG",@progbits,_ZNSt6vectorIiSaIiEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEED2Ev
	.type	_ZNSt6vectorIiSaIiEED2Ev, @function
_ZNSt6vectorIiSaIiEED2Ev:
.LFB4760:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L125
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L125:
	ret
	.cfi_endproc
.LFE4760:
	.size	_ZNSt6vectorIiSaIiEED2Ev, .-_ZNSt6vectorIiSaIiEED2Ev
	.weak	_ZNSt6vectorIiSaIiEED1Ev
	.set	_ZNSt6vectorIiSaIiEED1Ev,_ZNSt6vectorIiSaIiEED2Ev
	.section	.text._ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_,"axG",@progbits,_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_,comdat
	.weak	_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_
	.type	_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_, @function
_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_:
.LFB4765:
	.cfi_startproc
	endbr64
	cmpq	%rsi, %rdi
	je	.L138
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rsi, %rbx
	subq	%rdi, %rbx
	movq	%rbx, %rax
	sarq	$2, %rax
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	bsrq	%rax, %rdx
	movq	%rdi, 8(%rsp)
	xorq	$63, %rdx
	testq	%rax, %rax
	movl	$64, %eax
	cmovne	%edx, %eax
	movl	$63, %edx
	subl	%eax, %edx
	movslq	%edx, %rdx
	addq	%rdx, %rdx
	call	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_.isra.0
	cmpq	$64, %rbx
	movq	8(%rsp), %rdi
	jle	.L130
	leaq	64(%rdi), %rbx
	movq	%rbx, %rsi
	call	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_.isra.0
	movq	%rbx, %rax
.L131:
	cmpq	%rbp, %rax
	je	.L141
	movl	(%rax), %ecx
	movq	%rax, %rdx
.L132:
	movl	-4(%rdx), %esi
	cmpl	%esi, %ecx
	jge	.L142
	movl	%esi, (%rdx)
	subq	$4, %rdx
	jmp	.L132
.L142:
	movl	%ecx, (%rdx)
	addq	$4, %rax
	jmp	.L131
.L130:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movq	%rbp, %rsi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_.isra.0
.L141:
	.cfi_restore_state
	addq	$24, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L138:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE4765:
	.size	_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_, .-_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_
	.section	.text._ZNSt6vectorIiSaIiEEC2ERKS1_,"axG",@progbits,_ZNSt6vectorIiSaIiEEC5ERKS1_,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEEC2ERKS1_
	.type	_ZNSt6vectorIiSaIiEEC2ERKS1_, @function
_ZNSt6vectorIiSaIiEEC2ERKS1_:
.LFB4776:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	8(%rsi), %rbp
	movq	%rdi, %rbx
	subq	(%rsi), %rbp
	movq	$0, (%rdi)
	movq	$0, 8(%rdi)
	movq	$0, 16(%rdi)
	je	.L148
	movabsq	$9223372036854775804, %rax
	cmpq	%rbp, %rax
	jnb	.L145
	call	_ZSt28__throw_bad_array_new_lengthv@PLT
.L145:
	movq	%rbp, %rdi
	call	_Znwm@PLT
	movq	%rax, %rcx
	jmp	.L144
.L148:
	xorl	%ecx, %ecx
.L144:
	addq	%rcx, %rbp
	movq	%rcx, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rbp, 16(%rbx)
	movq	(%r12), %rsi
	movq	8(%r12), %rbp
	subq	%rsi, %rbp
	cmpq	$4, %rbp
	jle	.L146
	movq	%rcx, %rdi
	movq	%rbp, %rdx
	call	memmove@PLT
	movq	%rax, %rcx
	jmp	.L147
.L146:
	jne	.L147
	movl	(%rsi), %eax
	movl	%eax, (%rcx)
.L147:
	addq	%rbp, %rcx
	movq	%rcx, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4776:
	.size	_ZNSt6vectorIiSaIiEEC2ERKS1_, .-_ZNSt6vectorIiSaIiEEC2ERKS1_
	.weak	_ZNSt6vectorIiSaIiEEC1ERKS1_
	.set	_ZNSt6vectorIiSaIiEEC1ERKS1_,_ZNSt6vectorIiSaIiEEC2ERKS1_
	.section	.rodata._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_.str1.1,"aMS",@progbits,1
.LC2:
	.string	"vector::_M_realloc_insert"
	.section	.text._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.type	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, @function
_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_:
.LFB4937:
	.cfi_startproc
	endbr64
	movabsq	$2305843009213693951, %rcx
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	8(%rdi), %rax
	movq	(%rdi), %r14
	movq	%rax, %rbx
	movq	%rax, (%rsp)
	subq	%r14, %rbx
	sarq	$2, %rbx
	cmpq	%rcx, %rbx
	jne	.L151
	leaq	.LC2(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L151:
	cmpq	%r14, (%rsp)
	movl	$1, %eax
	movq	%rsi, %r15
	movq	%rdi, %r13
	cmovne	%rbx, %rax
	movq	%rsi, %rbp
	addq	%rax, %rbx
	setc	%al
	subq	%r14, %r15
	movzbl	%al, %eax
	testq	%rax, %rax
	jne	.L161
	xorl	%r12d, %r12d
	testq	%rbx, %rbx
	je	.L156
	movabsq	$2305843009213693951, %rax
	cmpq	%rax, %rbx
	cmova	%rax, %rbx
	jmp	.L155
.L161:
	movq	%rcx, %rbx
.L155:
	leaq	0(,%rbx,4), %rdi
	movq	%rdx, 8(%rsp)
	call	_Znwm@PLT
	movq	8(%rsp), %rdx
	movq	%rax, %r12
.L156:
	movl	(%rdx), %eax
	movl	%eax, (%r12,%r15)
	testq	%r15, %r15
	jle	.L157
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	memmove@PLT
.L157:
	movq	(%rsp), %rax
	leaq	4(%r12,%r15), %rdx
	subq	%rbp, %rax
	testq	%rax, %rax
	jle	.L158
	movq	%rdx, %rdi
	movq	%rbp, %rsi
	movq	%rax, %rcx
	rep movsb
.L158:
	leaq	(%rdx,%rax), %rbp
	testq	%r14, %r14
	je	.L159
	movq	16(%r13), %rsi
	movq	%r14, %rdi
	subq	%r14, %rsi
	call	_ZdlPvm@PLT
.L159:
	leaq	(%r12,%rbx,4), %rax
	movq	%r12, 0(%r13)
	movq	%rbp, 8(%r13)
	movq	%rax, 16(%r13)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4937:
	.size	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, .-_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.section	.text._ZNSt6vectorIiSaIiEE9push_backERKi,"axG",@progbits,_ZNSt6vectorIiSaIiEE9push_backERKi,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEE9push_backERKi
	.type	_ZNSt6vectorIiSaIiEE9push_backERKi, @function
_ZNSt6vectorIiSaIiEE9push_backERKi:
.LFB4762:
	.cfi_startproc
	endbr64
	movq	%rsi, %rdx
	movq	8(%rdi), %rsi
	cmpq	16(%rdi), %rsi
	je	.L169
	movl	(%rdx), %eax
	addq	$4, %rsi
	movl	%eax, -4(%rsi)
	movq	%rsi, 8(%rdi)
	ret
.L169:
	jmp	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.cfi_endproc
.LFE4762:
	.size	_ZNSt6vectorIiSaIiEE9push_backERKi, .-_ZNSt6vectorIiSaIiEE9push_backERKi
	.section	.text._ZNSt6vectorIiSaIiEE8_M_eraseEN9__gnu_cxx17__normal_iteratorIPiS1_EE,"axG",@progbits,_ZNSt6vectorIiSaIiEE8_M_eraseEN9__gnu_cxx17__normal_iteratorIPiS1_EE,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEE8_M_eraseEN9__gnu_cxx17__normal_iteratorIPiS1_EE
	.type	_ZNSt6vectorIiSaIiEE8_M_eraseEN9__gnu_cxx17__normal_iteratorIPiS1_EE, @function
_ZNSt6vectorIiSaIiEE8_M_eraseEN9__gnu_cxx17__normal_iteratorIPiS1_EE:
.LFB4948:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	8(%rdi), %rdx
	movq	%rsi, %rcx
	addq	$4, %rsi
	movq	%rdi, %rbx
	cmpq	%rdx, %rsi
	je	.L173
	subq	%rsi, %rdx
	cmpq	$4, %rdx
	jle	.L174
	movq	%rcx, %rdi
	call	memmove@PLT
	movq	%rax, %rcx
	jmp	.L173
.L174:
	jne	.L173
	movl	4(%rcx), %eax
	movl	%eax, (%rcx)
.L173:
	subq	$4, 8(%rbx)
	movq	%rcx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4948:
	.size	_ZNSt6vectorIiSaIiEE8_M_eraseEN9__gnu_cxx17__normal_iteratorIPiS1_EE, .-_ZNSt6vectorIiSaIiEE8_M_eraseEN9__gnu_cxx17__normal_iteratorIPiS1_EE
	.section	.rodata.str1.1
.LC3:
	.string	"Please input the trace file name:"
.LC4:
	.string	"%s"
.LC5:
	.string	"r"
.LC6:
	.string	"Could not open the trace file!\n"
.LC7:
	.string	"Has open the trace successfully!\n"
.LC8:
	.string	"%d%d%d"
.LC9:
	.string	"Allocate memory for PA failed"
.LC10:
	.string	"Allocate memory for PA successfully"
.LC11:
	.string	"Initialized PA successfully!"
.LC12:
	.string	"Has open the trace sucessfully!\n"
.LC13:
	.string	"Initilized index successfully"
.LC14:
	.string	" "
.LC15:
	.string	"%d%d"
.LC16:
	.string	"Please input the start vertice as an interger number less than "
.LC17:
	.string	" :"
.LC18:
	.string	"%d"
.LC19:
	.string	"Please input a valid start vertice less than "
.LC20:
	.string	"Please input the value of k as an interger number less than "
.LC21:
	.string	"Please input a valid k less than "
.LC23:
	.string	"CPU execution time is %.5f\n"
.LC24:
	.string	"GPU execution time is %.5f\n"
.LC25:
	.string	"Test passed ^^!"
.LC26:
	.string	"The final Collaborative Filtering result is:"
.LC27:
	.string	"Test failed !!"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4383:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4383
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	leaq	.LC5(%rip), %r12
	pushq	%rbx
	.cfi_offset 3, -56
	leaq	-186(%rbp), %rbx
	subq	$328, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
.LEHB0:
	call	__printf_chk@PLT
	movq	%rbx, %rsi
	leaq	.LC4(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	fopen@PLT
	testq	%rax, %rax
	jne	.L177
.L185:
	movl	$2, %edi
	leaq	.LC6(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L177:
	movq	%rax, %r13
	leaq	.LC7(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	-156(%rbp), %rax
	movq	%rax, -328(%rbp)
.L178:
	movq	-328(%rbp), %rdi
	movq	%r13, %rcx
	movl	$100, %edx
	movl	$100, %esi
	call	__fgets_chk@PLT
	testq	%rax, %rax
	je	.L179
	cmpb	$37, -156(%rbp)
	je	.L178
	movq	-328(%rbp), %rdi
	leaq	-304(%rbp), %rcx
	xorl	%eax, %eax
	leaq	-308(%rbp), %rdx
	leaq	-300(%rbp), %r8
	leaq	.LC8(%rip), %rsi
	call	__isoc23_sscanf@PLT
.L179:
	movq	%r13, %rdi
	call	fclose@PLT
	movl	-308(%rbp), %esi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movslq	-308(%rbp), %rdi
	imulq	$1600, %rdi, %rdi
	call	malloc@PLT
	leaq	.LC10(%rip), %rsi
	movq	%rax, %r14
	testq	%rax, %rax
	jne	.L240
	leaq	.LC9(%rip), %rsi
.L240:
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	-308(%rbp), %r8d
	xorl	%esi, %esi
	xorl	%eax, %eax
	movq	%r14, %rdx
.L182:
	cmpl	%esi, %r8d
	jle	.L246
	movq	%rdx, %rdi
	movl	$400, %ecx
	incl	%esi
	addq	$1600, %rdx
	rep stosl
	jmp	.L182
.L246:
	leaq	.LC11(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%rbx, %rdi
	movq	%r12, %rsi
	call	fopen@PLT
	movq	%rax, %rbx
	testq	%rax, %rax
	je	.L185
	leaq	.LC12(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	-308(%rbp), %rax
	movq	%rsp, %rsi
	leaq	15(,%rax,4), %rdx
	movq	%rax, %rcx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rsi
.L186:
	cmpq	%rsi, %rsp
	je	.L187
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L186
.L187:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L188
	orq	$0, -8(%rsp,%rax)
.L188:
	movq	%rsp, %r12
	xorl	%eax, %eax
.L189:
	cmpl	%eax, %ecx
	jle	.L247
	xorl	%r10d, %r10d
	movl	%r10d, (%r12,%rax,4)
	incq	%rax
	jmp	.L189
.L247:
	leaq	.LC13(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	xorl	%r13d, %r13d
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	.LC15(%rip), %r15
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L192:
	movq	-328(%rbp), %rdi
	movq	%rbx, %rcx
	movl	$100, %edx
	movl	$100, %esi
	call	__fgets_chk@PLT
	testq	%rax, %rax
	je	.L248
	cmpb	$37, -156(%rbp)
	je	.L192
	testl	%r13d, %r13d
	jne	.L193
	movq	-328(%rbp), %rdi
	leaq	-304(%rbp), %rcx
	xorl	%eax, %eax
	leaq	-308(%rbp), %rdx
	leaq	-300(%rbp), %r8
	leaq	.LC8(%rip), %rsi
	call	__isoc23_sscanf@PLT
	movl	-308(%rbp), %esi
	leaq	_ZSt4cout(%rip), %rdi
	leaq	.LC14(%rip), %r13
	call	_ZNSolsEi@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	-304(%rbp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%r13, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	-300(%rbp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L194
.L193:
	movq	-328(%rbp), %rdi
	leaq	-312(%rbp), %rcx
	movq	%r15, %rsi
	xorl	%eax, %eax
	leaq	-316(%rbp), %rdx
	call	__isoc23_sscanf@PLT
	movslq	-316(%rbp), %rax
	leal	-1(%rax), %ecx
	movslq	%ecx, %rcx
	imulq	$1600, %rax, %rax
	movslq	(%r12,%rcx,4), %rdx
	leal	1(%rdx), %esi
	leaq	-1600(%r14,%rax), %rax
	movl	%esi, (%r12,%rcx,4)
	movl	-312(%rbp), %ecx
	movl	%ecx, (%rax,%rdx,4)
.L194:
	movl	$1, %r13d
	jmp	.L192
.L248:
	movq	%rbx, %rdi
	leaq	.LC17(%rip), %rbx
	leaq	-296(%rbp), %r13
	call	fclose@PLT
	leaq	.LC16(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	-308(%rbp), %esi
	leaq	.LC18(%rip), %r12
	leaq	.LC19(%rip), %r15
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rbx, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
.L196:
	movl	-296(%rbp), %eax
	testl	%eax, %eax
	jns	.L249
.L197:
	movq	%r15, %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	-308(%rbp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rbx, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	jmp	.L196
.L249:
	cmpl	-308(%rbp), %eax
	jg	.L197
	leaq	.LC20(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	-308(%rbp), %esi
	leaq	-292(%rbp), %r13
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rbx, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L241:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	movl	-292(%rbp), %r15d
	testl	%r15d, %r15d
	jns	.L250
.L199:
	leaq	.LC21(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	-308(%rbp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rbx, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L241
.L250:
	movl	-308(%rbp), %esi
	cmpl	%esi, %r15d
	jg	.L199
	leal	1(%r15), %ebx
	movl	%esi, -336(%rbp)
	imull	%esi, %ebx
	movslq	%ebx, %rbx
	salq	$2, %rbx
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, %r13
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, %r12
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, -328(%rbp)
	call	malloc@PLT
	movl	-336(%rbp), %esi
	xorl	%edi, %edi
	xorl	%r8d, %r8d
	movq	%rax, %rbx
.L200:
	movslq	%edi, %rax
	xorl	%edx, %edx
	salq	$2, %rax
.L203:
	cmpl	%edx, %esi
	jle	.L251
	xorl	%ecx, %ecx
	incl	%edx
	xorl	%r9d, %r9d
	movl	%ecx, 0(%r13,%rax)
	movq	-328(%rbp), %rcx
	movl	%edx, (%r12,%rax)
	movl	%r9d, (%rcx,%rax)
	movl	%edx, (%rbx,%rax)
	addq	$4, %rax
	jmp	.L203
.L251:
	incl	%r8d
	addl	%esi, %edi
	cmpl	%r8d, %r15d
	jge	.L200
	call	clock@PLT
	movl	-308(%rbp), %r9d
	movq	%rbx, %rdx
	movl	-292(%rbp), %r8d
	movl	-296(%rbp), %ecx
	movq	-328(%rbp), %rsi
	movq	%r14, %rdi
	movq	%rax, %r15
	call	_Z12filterOnHostP13_Graph_node_APiS1_iii
	call	clock@PLT
	leaq	.LC23(%rip), %rsi
	movl	$2, %edi
	subq	%r15, %rax
	cvtsi2ssq	%rax, %xmm0
	movb	$1, %al
	divss	.LC22(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	call	clock@PLT
	movq	%r12, %rdx
	movq	%r13, %rsi
	movq	%r14, %rdi
	movl	-308(%rbp), %r9d
	movl	-292(%rbp), %r8d
	movq	%rax, %r15
	movl	-296(%rbp), %ecx
	call	_Z14filterOnDeviceP13_Graph_node_APiS1_iii
	call	clock@PLT
	leaq	.LC24(%rip), %rsi
	movl	$2, %edi
	subq	%r15, %rax
	movl	$1, %r15d
	cvtsi2ssq	%rax, %xmm0
	movb	$1, %al
	divss	.LC22(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
.LEHE0:
.L204:
	cmpl	%r15d, -292(%rbp)
	jl	.L252
	movl	-308(%rbp), %edx
	movl	%edx, %r14d
	movl	%edx, -336(%rbp)
	imull	%r15d, %r14d
	incl	%r15d
	movslq	%r14d, %r14
	salq	$2, %r14
	leaq	(%r12,%r14), %rsi
	leaq	0(%r13,%r14), %rdi
	call	_Z7selSortPiS_i
	movq	-328(%rbp), %rax
	movl	-336(%rbp), %edx
	leaq	(%rbx,%r14), %rsi
	leaq	(%rax,%r14), %rdi
	call	_Z7selSortPiS_i
	jmp	.L204
.L252:
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	movq	%rax, -288(%rbp)
	movq	%rax, -280(%rbp)
	movq	%rax, -272(%rbp)
	movq	%rax, -264(%rbp)
	movq	%rax, -256(%rbp)
	movq	%rax, -248(%rbp)
	leaq	-288(%rbp), %rax
	movq	%rax, -336(%rbp)
.L206:
	cmpl	%r14d, -292(%rbp)
	jl	.L253
	xorl	%r15d, %r15d
.L208:
	cmpl	%r15d, -292(%rbp)
	jle	.L254
	movl	-308(%rbp), %eax
	movq	-336(%rbp), %rdi
	imull	%r14d, %eax
	addl	%r15d, %eax
	cltq
	leaq	(%r12,%rax,4), %rsi
.LEHB1:
	call	_ZNSt6vectorIiSaIiEE9push_backERKi
	movl	-308(%rbp), %eax
	leaq	-264(%rbp), %rdi
	imull	%r14d, %eax
	addl	%r15d, %eax
	cltq
	leaq	(%rbx,%rax,4), %rsi
	call	_ZNSt6vectorIiSaIiEE9push_backERKi
	incl	%r15d
	jmp	.L208
.L254:
	incl	%r14d
	jmp	.L206
.L253:
	movq	-288(%rbp), %r15
	movq	-280(%rbp), %rsi
	movq	%r15, %rdi
	call	_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_
	movq	-264(%rbp), %r14
	movq	-256(%rbp), %rsi
	movq	%r14, %rdi
	call	_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_
	leaq	-288(%rbp), %rcx
	movl	(%r15), %eax
	leaq	4(%r15), %rdx
	movq	%rcx, -336(%rbp)
.L209:
	movq	-280(%rbp), %r15
	cmpq	%r15, %rdx
	je	.L255
	movl	(%rdx), %r15d
	cmpl	%eax, %r15d
	jne	.L210
	movq	-336(%rbp), %rdi
	movq	%rdx, %rsi
	movq	%rdx, -344(%rbp)
	call	_ZNSt6vectorIiSaIiEE8_M_eraseEN9__gnu_cxx17__normal_iteratorIPiS1_EE
	movq	-344(%rbp), %rdx
	jmp	.L211
.L210:
	addq	$4, %rdx
.L211:
	movl	%r15d, %eax
	jmp	.L209
.L255:
	leaq	-264(%rbp), %rcx
	movl	(%r14), %eax
	leaq	4(%r14), %rdx
	movq	%rcx, -336(%rbp)
.L213:
	cmpq	-256(%rbp), %rdx
	je	.L256
	movl	(%rdx), %r14d
	cmpl	%eax, %r14d
	jne	.L214
	movq	-336(%rbp), %rdi
	movq	%rdx, %rsi
	movq	%rdx, -344(%rbp)
	call	_ZNSt6vectorIiSaIiEE8_M_eraseEN9__gnu_cxx17__normal_iteratorIPiS1_EE
	movq	-344(%rbp), %rdx
	jmp	.L215
.L214:
	addq	$4, %rdx
.L215:
	movl	%r14d, %eax
	jmp	.L213
.L256:
	leaq	-288(%rbp), %rax
	movq	%rax, -344(%rbp)
	leaq	-216(%rbp), %rax
	movq	-344(%rbp), %rsi
	movq	%rax, %rdi
	movq	%rax, -336(%rbp)
	call	_ZNSt6vectorIiSaIiEEC1ERKS1_
.LEHE1:
	leaq	-264(%rbp), %rax
	leaq	-240(%rbp), %r14
	movq	%rax, %rsi
	movq	%r14, %rdi
	movq	%rax, -352(%rbp)
.LEHB2:
	call	_ZNSt6vectorIiSaIiEEC1ERKS1_
.LEHE2:
	movq	-336(%rbp), %rsi
	movq	%r14, %rdi
	call	_Z7compareSt6vectorIiSaIiEES1_
	movq	%r14, %rdi
	movb	%al, -353(%rbp)
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	-336(%rbp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movb	-353(%rbp), %al
	leaq	.LC27(%rip), %rsi
	testb	%al, %al
	je	.L245
	leaq	.LC25(%rip), %rsi
.L245:
	leaq	_ZSt4cout(%rip), %rdi
.LEHB3:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC26(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	-288(%rbp), %r14
.L220:
	cmpq	%r15, %r14
	je	.L257
	movl	(%r14), %esi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC14(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	addq	$4, %r14
	jmp	.L220
.L257:
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.LEHE3:
	movq	%r13, %rdi
	call	free@PLT
	movq	-328(%rbp), %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	%rbx, %rdi
	call	free@PLT
	movq	-352(%rbp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	-344(%rbp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L225
	jmp	.L238
.L228:
	endbr64
	movq	%rax, %rbx
.L222:
	movq	-336(%rbp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	jmp	.L223
.L227:
	endbr64
	movq	%rax, %rbx
.L223:
	leaq	-264(%rbp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	leaq	-288(%rbp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L238
	movq	%rbx, %rdi
.LEHB4:
	call	_Unwind_Resume@PLT
.LEHE4:
.L238:
	call	__stack_chk_fail@PLT
.L225:
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4383:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4383:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4383-.LLSDACSB4383
.LLSDACSB4383:
	.uleb128 .LEHB0-.LFB4383
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4383
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L227-.LFB4383
	.uleb128 0
	.uleb128 .LEHB2-.LFB4383
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L228-.LFB4383
	.uleb128 0
	.uleb128 .LEHB3-.LFB4383
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L227-.LFB4383
	.uleb128 0
	.uleb128 .LEHB4-.LFB4383
	.uleb128 .LEHE4-.LEHB4
	.uleb128 0
	.uleb128 0
.LLSDACSE4383:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC22:
	.long	1232348160
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.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 <iostream>
#include <utility>
#include <algorithm>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <time.h>
//#include "graphfilter.h"

//#include <cutil.h>

//#include <graphfilter_kernel.cu>
#define N 400
#define DEBUG 0

typedef struct _Graph_node_A {
	int adj[N];
} Graph_node_A;

using namespace std;

extern "C"

#ifndef _MATRIXMUL_H_
#define _MATRIXMUL_H_
__global__ void naiveFilterKernel(struct _Graph_node_A *PA, int *relation_count, int *v_start, int *max_id_A)
{
	__shared__ int v_start_adj[N];

	int tid = threadIdx.x;
	int count=0;

	if(tid < N)
		v_start_adj[tid] = PA[(*v_start)-1].adj[tid];
	__syncthreads();

	if(tid == ((*v_start)-1) || tid >= *max_id_A) return;

	int i, j;

	for(i=0;(i<N) && (PA[tid].adj[i] != 0);i++) {
		for(j=0;j<N && v_start_adj[j]!= 0;j++) {
			if(PA[tid].adj[i] == v_start_adj[j]){
				count++;
				break;
			}
		}
	}
	relation_count[tid] = count;
}
#endif

#ifndef _MATRIXMUL_F_
#define _MATRIXMUL_F_
__global__ void fullFilterKernel(struct _Graph_node_A *PA, int *relation_count, int *index_vertice, int *k, int *max_id_A)
{
	__shared__ int index_ref[N];

	int by = blockIdx.y;
	int tx = threadIdx.x;
	int count = 0;

	if((by >= *k) || (tx >= *max_id_A)) return;

	// load data into shared memory
	if(tx < N)
		index_ref[tx] = PA[index_vertice[by]-1].adj[tx];
	__syncthreads();

	for(int i=0;(i<N) && (PA[tx].adj[i] != 0);i++)
		for(int j=0;(j<N) && (index_ref[j]!= 0);j++) {
			if((PA[tx].adj[i] == index_ref[j]) && ((index_vertice[by]-1) != tx)) {
				count++;
				break;
			}
		}

	relation_count[(by+1) * (*max_id_A) + tx] = count;
}
#endif

void filterOnDevice(struct _Graph_node_A *PA, int *relation_count, int *index_vertice, int v_start, int k, int max_id_A);
void filterOnHost(struct _Graph_node_A *PA, int *relation_count_h, int *index_vertice_h, int v_start, int k, int max_id_A);

// function to sort the relations to the start vertice in a descending order
void selSort(int s[], int index[], int length);

//function to compare the result between the host side and device side
bool compare(vector<int> final_resut_h, vector<int> final_result_d);

//static const char* DAT_FILE_NAME = "graph.dat";// file to store the graph struct

int main(int arcg, char** argv)
{
	char tracefilename[30];
	int A, B; //fot the nodes in party A and party B
	int max_id_A;
	int max_id_B;
	int max_weight;
	int i=0, j=0;
	//int m=0, n=0;
	FILE *fp;
	char buf[100];

	struct _Graph_node_A *PA;

	/***********************************************************
	  read in the trace file **********************************
	 ************************************************************/
	printf("Please input the trace file name:");
	scanf("%s", &tracefilename);

	fp = fopen(tracefilename, "r");
	if(fp==NULL){
		printf("Could not open the trace file!\n");
		exit(1);
	}
	printf("Has open the trace successfully!\n");

	while(fgets(buf,100,fp)){
		if(buf[0]=='%') continue;
		if(i==0){
			sscanf(buf, "%d%d%d", &max_id_A, &max_id_B, &max_weight);
			break;
		}
	}

	fclose(fp);

	cout << max_id_A << endl;
	PA = (struct _Graph_node_A *)malloc(sizeof(struct _Graph_node_A) * max_id_A);
	if(PA == NULL)
		cout << "Allocate memory for PA failed" <<endl;
	else
		cout << "Allocate memory for PA successfully" << endl;

	// initialize A and B
	for(i=0;i<max_id_A;i++)
		for(j=0;j<N;j++)
			PA[i].adj[j] = 0;

	cout << "Initialized PA successfully!" << endl;

	fp = fopen(tracefilename, "r");
	if(fp==NULL){
		printf("Could not open the trace file!\n");
		exit(1);
	}
	printf("Has open the trace sucessfully!\n");

	int index[max_id_A];
	for(i=0;i<max_id_A;i++)
		index[i]  = 0;
	cout << "Initilized index successfully" << endl;

	i=0;

	//read in the input file and build the graph
	while(fgets(buf,100,fp)){
		if(buf[0]=='%')
			continue;
		if(i==0){
			sscanf(buf,"%d%d%d", &max_id_A, &max_id_B, &max_weight);
			cout << max_id_A << " " << max_id_B << " " << max_weight << endl;
			i++;
		}else{
			sscanf(buf, "%d%d", &A, &B);
			PA[A-1].adj[index[A-1]++] = B;
		}
	}

	fclose(fp);

	// Naive Graph collaboratie Filtering
	int v_start;// the start vertive for search
	int k;// the k is the number of relational vertices needed to be found

	// read in the start vertex, and value k for ralation depth
	std::cout << "Please input the start vertice as an interger number less than " << max_id_A << " :";
	scanf("%d", &v_start);
	while(v_start<0 || v_start > max_id_A) {
		cout << "Please input a valid start vertice less than " << max_id_A << " :";
		scanf("%d", &v_start);
	}

	std::cout << "Please input the value of k as an interger number less than " << max_id_A << " :";
	scanf("%d", &k);
	while(k < 0 || k > max_id_A) {
		cout << "Please input a valid k less than " << max_id_A << " :";
		scanf("%d", &k);
	}


	int* relation_count = (int*)malloc((k+1)*max_id_A*sizeof(int));
	int* index_vertice = (int*)malloc((k+1)*max_id_A*sizeof(int));

	int* relation_count_h = (int*)malloc((k+1)*max_id_A*sizeof(int));
	int* index_vertice_h = (int*)malloc((k+1)*max_id_A*sizeof(int));

	//initialize the relation_count and vertice index
	for(i=0;i<k+1;i++)
		for(j=0;j<max_id_A;j++){
			relation_count[i * max_id_A + j] = 0;
			relation_count_h[i * max_id_A + j] = 0;
			index_vertice[i * max_id_A + j] = j + 1;
			index_vertice_h[i * max_id_A + j] = j + 1;
		}

	// executing the filtering algorithm on the host side
	clock_t st = clock();
	filterOnHost(PA, relation_count_h, index_vertice_h, v_start, k, max_id_A);
	st = clock() - st;
	printf("CPU execution time is %.5f\n", (float)st/CLOCKS_PER_SEC);

#if DEBUG
	cout << "Relation count on the host side is:" << endl;
	for(i=0;i<k+1;i++){
		for(j=0;j<max_id_A;j++){
			cout << relation_count_h[i*max_id_A+j] << " ";
		}
		cout << endl;
	}
#endif

	// executing the filtering algorithm on the device side
	st = clock();
	filterOnDevice(PA, relation_count, index_vertice, v_start, k, max_id_A);
	st = clock() - st;
	printf("GPU execution time is %.5f\n", (float)st/CLOCKS_PER_SEC);


	//sort the relation in a descending order
	for(i=1;i<k+1;i++) {
		selSort(&relation_count[i*max_id_A], &index_vertice[i*max_id_A], max_id_A);
		selSort(&relation_count_h[i*max_id_A], &index_vertice_h[i*max_id_A], max_id_A);
	}

#if DEBUG
	cout << "The " << k << " related vertices to each vertice are: " << endl;
	for(i=0;i<k+1;i++) {
		for(j=0;j<k;j++) {
			cout << index_vertice[i * max_id_A + j]	<< " ";
			cout << index_vertice_h[i * max_id_A + j] << " ";
		}
		cout << endl;
	}
#endif


	vector<int> final_result_d;// record the final result of collaborative filtering for visualization
	vector<int> final_result_h;
	vector<int>::iterator it;

	// copy the index_vertice to the final_result vector
	for(i=0;i<k+1;i++)
		for(j=0;j<k;j++) {
			final_result_d.push_back(index_vertice[i * max_id_A + j]);
			final_result_h.push_back(index_vertice_h[i * max_id_A + j]);
		}


	// sort the final_result vector in a desending order
	std::sort(final_result_d.begin(), final_result_d.end());
	std::sort(final_result_h.begin(), final_result_h.end());

	// remove the repeated vertices
	for(it=final_result_d.begin()+1, i=final_result_d.front();it!=final_result_d.end();) {
		if(i == *it)
			final_result_d.erase(it);
		else {
			i = *it;
			it++;
		}
	}

	for(it=final_result_h.begin()+1, i=final_result_h.front();it!=final_result_h.end();) {
		if(i == *it)
			final_result_h.erase(it);
		else {
			i = *it;
			it++;
		}
	}

	// compare the result from GPU with the result from CPU to test the correctness
	bool match = compare(final_result_h, final_result_d);
	if(match)
		cout << "Test passed ^^!" << endl;
	else
		cout << "Test failed !!" << endl;

	// output the final result
	cout << "The final Collaborative Filtering result is:" << endl;
	for(it=final_result_d.begin();it!=final_result_d.end();it++)
		cout << *it << " ";
	cout << endl;

	free(relation_count);
	free(relation_count_h);
	free(index_vertice);
	free(index_vertice_h);

	return 0;
}

void filterOnHost(struct _Graph_node_A *PA, int *relation_count, int *index_vertice, int v_start, int k, int max_id_A)
{
	int i, j, m, n;

	// naive collaborative filtering
	for(i=0;i<max_id_A;i++){
		if(i == v_start - 1)	continue;
		for(j=0;j<N && PA[i].adj[j] != 0;j++)
			for(m=0;m<N && PA[v_start-1].adj[m] != 0;m++){
				if(PA[v_start-1].adj[m] == PA[i].adj[j]) {
					relation_count[i]++;
					break;
				}
			}
	}

	// sort the relation in a descending order by selection sort algorithm
	selSort(relation_count, index_vertice, max_id_A);

	// full collaborative filtering
	for(i=0;i<k;i++)
		for(j=0;j<max_id_A;j++)
			for(m=0;m<N && PA[j].adj[m] != 0;m++)
				for(n=0;n<N && PA[index_vertice[i]-1].adj[n] != 0;n++) {
					if(PA[index_vertice[i]-1].adj[n] == PA[j].adj[m] && index_vertice[i] - 1 != j) {
						relation_count[(i+1)*max_id_A + j] ++;
						break;
					}
				}

}

void filterOnDevice(struct _Graph_node_A *PA, int *relation_count, int *index_vertice, int v_start, int k, int max_id_A) {
	struct _Graph_node_A *PA_d;
	int *relation_count_d;
	int *max_id_A_d;
	int *index_vertice_d;
	int *v_start_d;
	int *k_d;
	int size = (k + 1) * max_id_A * sizeof(int);

	hipMalloc((void**)&(PA_d), sizeof(struct _Graph_node_A) * max_id_A);
	hipMalloc((void**)&(relation_count_d), size);
	hipMalloc((void**)&(max_id_A_d), sizeof(int));
	hipMalloc((void**)&(v_start_d), sizeof(int));
	hipMalloc((void**)&(k_d), sizeof(int));
	hipMalloc((void**)&(index_vertice_d), max_id_A * sizeof(int));

	hipMemcpy(PA_d, PA, sizeof(struct _Graph_node_A) * max_id_A, hipMemcpyHostToDevice);
	hipMemcpy(relation_count_d, relation_count, size, hipMemcpyHostToDevice);
	hipMemcpy(max_id_A_d, &max_id_A, sizeof(int), hipMemcpyHostToDevice);
	hipMemcpy(v_start_d, &v_start, sizeof(int), hipMemcpyHostToDevice);
	hipMemcpy(k_d, &k, sizeof(int), hipMemcpyHostToDevice);

	// naive collaborative filtering
	dim3 dimGrid0(1, 1);
	dim3 dimBlock0(max_id_A, 1);
	naiveFilterKernel<<<dimGrid0, dimBlock0>>>(PA_d, relation_count_d, v_start_d, max_id_A_d);

	hipMemcpy(relation_count, relation_count_d, max_id_A * sizeof(int), hipMemcpyDeviceToHost);

#if DEBUG
	cout << "The relation count is:" << endl;
	for(int i=0; i<k+1;i++) {
		for(int j=0;j<max_id_A;j++){
			cout << relation_count[i*max_id_A+j] << " ";
		}
		cout << endl;
	}
#endif

	selSort(relation_count, index_vertice, max_id_A);

#if DEBUG
	cout << "The " << k << " related vertice to " << v_start << " is:" << endl;
	for(int i=0;i<k;i++)
		cout << index_vertice[i] << " ";
	cout << endl;
#endif

	hipMemcpy(index_vertice_d, index_vertice, max_id_A * sizeof(int), hipMemcpyHostToDevice);

	// full collaborative filtering
	dim3 dimGrid(1, k);
	dim3 dimBlock(max_id_A, 1);
	fullFilterKernel<<<dimGrid, dimBlock>>>(PA_d, relation_count_d, index_vertice_d, k_d, max_id_A_d);

	hipMemcpy(relation_count, relation_count_d, size, hipMemcpyDeviceToHost);

#if DEBUG
	cout << "The relation count is:" << endl;
	for(int i=0; i<k+1;i++) {
		for(int j=0;j<max_id_A;j++){
			cout << relation_count[i*max_id_A+j] << " ";
		}
		cout << endl;
	}
#endif

	hipFree(PA_d);
	PA_d = NULL;
	hipFree(relation_count_d);
	relation_count_d = NULL;
	hipFree(max_id_A_d);
	max_id_A_d = NULL;
	hipFree(k_d);
	k_d = NULL;
	hipFree(index_vertice_d);
	index_vertice_d = NULL;
}

// Selection Sort
void selSort(int s[], int index[], int length)
{
	int i, j, maxPos;
	for(i=0;i<length-1;i++) {
		maxPos = i;
		for(j=i+1;j<length;j++)
			if(s[j] > s[maxPos])
				maxPos = j;
		if(i != maxPos) {
			swap(s[i], s[maxPos]);
			swap(index[i], index[maxPos]);
		}
	}
}

bool compare(vector<int> final_result_h, vector<int> final_result_d)
{
	vector<int>::iterator it_h;
	vector<int>::iterator it_d;

	for(it_h=final_result_h.begin(), it_d=final_result_d.begin(); it_h != final_result_h.end() && it_d != final_result_d.end();it_h++, it_d++) {
		if((*it_h) != (*it_d))
			return false;
	}

	return true;
}

	.text
	.file	"graphfilter_final.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	__device_stub__naiveFilterKernel # -- Begin function __device_stub__naiveFilterKernel
	.type	__device_stub__naiveFilterKernel,@function
__device_stub__naiveFilterKernel:       # @__device_stub__naiveFilterKernel
	.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), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%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	$naiveFilterKernel, %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_end0:
	.size	__device_stub__naiveFilterKernel, .Lfunc_end0-__device_stub__naiveFilterKernel
	.cfi_endproc
                                        # -- End function
	.globl	_Z31__device_stub__fullFilterKernelP13_Graph_node_APiS1_S1_S1_ # -- Begin function _Z31__device_stub__fullFilterKernelP13_Graph_node_APiS1_S1_S1_
	.type	_Z31__device_stub__fullFilterKernelP13_Graph_node_APiS1_S1_S1_,@function
_Z31__device_stub__fullFilterKernelP13_Graph_node_APiS1_S1_S1_: # @_Z31__device_stub__fullFilterKernelP13_Graph_node_APiS1_S1_S1_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$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	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%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	$_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_, %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_end1:
	.size	_Z31__device_stub__fullFilterKernelP13_Graph_node_APiS1_S1_S1_, .Lfunc_end1-_Z31__device_stub__fullFilterKernelP13_Graph_node_APiS1_S1_S1_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI2_0:
	.long	0x49742400                      # float 1.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$360, %rsp                      # imm = 0x168
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$.L.str, %edi
	xorl	%eax, %eax
	callq	printf
	leaq	-288(%rbp), %rbx
	movl	$.L.str.1, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movl	$.L.str.2, %esi
	movq	%rbx, %rdi
	callq	fopen
	testq	%rax, %rax
	je	.LBB2_125
# %bb.1:
	movq	%rax, %rbx
	movl	$.Lstr, %edi
	callq	puts@PLT
	leaq	-400(%rbp), %r14
.LBB2_2:                                # =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	$100, %esi
	movq	%rbx, %rdx
	callq	fgets
	testq	%rax, %rax
	je	.LBB2_5
# %bb.3:                                #   in Loop: Header=BB2_2 Depth=1
	cmpb	$37, -400(%rbp)
	je	.LBB2_2
# %bb.4:
	leaq	-400(%rbp), %rdi
	leaq	-44(%rbp), %rdx
	leaq	-112(%rbp), %rcx
	leaq	-108(%rbp), %r8
	movl	$.L.str.5, %esi
	xorl	%eax, %eax
	callq	__isoc23_sscanf
.LBB2_5:                                # %.loopexit198
	movq	%rbx, %rdi
	callq	fclose
	movl	-44(%rbp), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movslq	-44(%rbp), %rax
	imulq	$1600, %rax, %rdi               # imm = 0x640
	callq	malloc
	movq	%rax, %r14
	movl	$_ZSt4cout, %edi
	testq	%rax, %rax
	je	.LBB2_6
# %bb.7:
	movl	$.L.str.7, %esi
	movl	$35, %edx
	jmp	.LBB2_8
.LBB2_6:
	movl	$.L.str.6, %esi
	movl	$29, %edx
.LBB2_8:
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ebx
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jle	.LBB2_10
# %bb.9:                                # %.preheader197.preheader
	imulq	$1600, %rax, %rdx               # imm = 0x640
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.LBB2_10:                               # %._crit_edge
	movl	$_ZSt4cout, %edi
	movl	$.L.str.8, %esi
	movl	$28, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	leaq	-288(%rbp), %rdi
	movl	$.L.str.2, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB2_125
# %bb.11:
	movq	%rax, %rbx
	movq	%r14, -192(%rbp)                # 8-byte Spill
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	movq	%rsp, -200(%rbp)                # 8-byte Spill
	movl	-44(%rbp), %eax
	movq	%rsp, %r14
	leaq	15(,%rax,4), %rax
	andq	$-16, %rax
	subq	%rax, %r14
	movq	%r14, %rsp
	movl	-44(%rbp), %edx
	testl	%edx, %edx
	jle	.LBB2_13
# %bb.12:                               # %.lr.ph.preheader
	shlq	$2, %rdx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.LBB2_13:                               # %._crit_edge204
	movl	$_ZSt4cout, %r15d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.10, %esi
	movl	$29, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movb	$1, %r13b
	leaq	-400(%rbp), %r15
	leaq	-44(%rbp), %r12
.LBB2_14:                               # =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	$100, %esi
	movq	%rbx, %rdx
	callq	fgets
	testq	%rax, %rax
	je	.LBB2_19
# %bb.15:                               #   in Loop: Header=BB2_14 Depth=1
	cmpb	$37, -400(%rbp)
	je	.LBB2_14
# %bb.16:                               #   in Loop: Header=BB2_14 Depth=1
	testb	$1, %r13b
	je	.LBB2_18
# %bb.17:                               #   in Loop: Header=BB2_14 Depth=1
	xorl	%r13d, %r13d
	movl	$.L.str.5, %esi
	movq	%r15, %rdi
	movq	%r12, %rdx
	leaq	-112(%rbp), %rcx
	leaq	-108(%rbp), %r8
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	movl	-44(%rbp), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %r12
	movl	$.L.str.11, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	-112(%rbp), %esi
	movq	%r12, %rdi
	callq	_ZNSolsEi
	movq	%rax, %r12
	movl	$.L.str.11, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	-108(%rbp), %esi
	movq	%r12, %rdi
	callq	_ZNSolsEi
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r12, %rdi
	leaq	-44(%rbp), %r12
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	jmp	.LBB2_14
.LBB2_18:                               #   in Loop: Header=BB2_14 Depth=1
	xorl	%r13d, %r13d
	movl	$.L.str.12, %esi
	movq	%r15, %rdi
	leaq	-184(%rbp), %rdx
	leaq	-180(%rbp), %rcx
	xorl	%eax, %eax
	callq	__isoc23_sscanf
	movl	-180(%rbp), %eax
	movslq	-184(%rbp), %rcx
	leaq	-1(%rcx), %rdx
	imulq	$1600, %rdx, %rdx               # imm = 0x640
	addq	-192(%rbp), %rdx                # 8-byte Folded Reload
	movslq	-4(%r14,%rcx,4), %rsi
	leal	1(%rsi), %edi
	movl	%edi, -4(%r14,%rcx,4)
	movl	%eax, (%rdx,%rsi,4)
	jmp	.LBB2_14
.LBB2_19:
	movq	%rbx, %rdi
	callq	fclose
	movl	$_ZSt4cout, %edi
	movl	$.L.str.13, %esi
	movl	$63, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	-44(%rbp), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.14, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	leaq	-52(%rbp), %rbx
	movl	$.L.str.15, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movl	(%rbx), %eax
.LBB2_20:                               # =>This Inner Loop Header: Depth=1
	testl	%eax, %eax
	js	.LBB2_22
# %bb.21:                               #   in Loop: Header=BB2_20 Depth=1
	cmpl	-44(%rbp), %eax
	jle	.LBB2_23
.LBB2_22:                               # %.lr.ph206
                                        #   in Loop: Header=BB2_20 Depth=1
	movl	$_ZSt4cout, %edi
	movl	$.L.str.16, %esi
	movl	$45, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	-44(%rbp), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.14, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$.L.str.15, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movl	-52(%rbp), %eax
	jmp	.LBB2_20
.LBB2_23:                               # %._crit_edge207
	movl	$_ZSt4cout, %edi
	movl	$.L.str.17, %esi
	movl	$60, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	-44(%rbp), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.14, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	leaq	-48(%rbp), %rbx
	movl	$.L.str.15, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movl	(%rbx), %eax
.LBB2_24:                               # %._crit_edge207
                                        # =>This Inner Loop Header: Depth=1
	testl	%eax, %eax
	js	.LBB2_26
# %bb.25:                               # %._crit_edge207
                                        #   in Loop: Header=BB2_24 Depth=1
	movl	-44(%rbp), %r14d
	cmpl	%r14d, %eax
	jle	.LBB2_27
.LBB2_26:                               # %.lr.ph209
                                        #   in Loop: Header=BB2_24 Depth=1
	movl	$_ZSt4cout, %edi
	movl	$.L.str.18, %esi
	movl	$33, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	-44(%rbp), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.14, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$.L.str.15, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movl	-48(%rbp), %eax
	jmp	.LBB2_24
.LBB2_27:                               # %.preheader196.lr.ph
	incl	%eax
	movq	%rax, -152(%rbp)                # 8-byte Spill
                                        # kill: def $eax killed $eax killed $rax
	imull	%r14d, %eax
	movslq	%eax, %rbx
	shlq	$2, %rbx
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, -168(%rbp)                # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, -104(%rbp)                # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, -160(%rbp)                # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	movq	-152(%rbp), %rdx                # 8-byte Reload
	movq	%rax, -96(%rbp)                 # 8-byte Spill
	movl	%r14d, %r12d
	leaq	(,%r12,4), %rax
	movq	%rax, -88(%rbp)                 # 8-byte Spill
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
.LBB2_28:                               # %.preheader196
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_30 Depth 2
	testl	%r12d, %r12d
	jle	.LBB2_31
# %bb.29:                               # %.lr.ph213
                                        #   in Loop: Header=BB2_28 Depth=1
	movl	%r13d, %eax
	movq	-96(%rbp), %rcx                 # 8-byte Reload
	leaq	(%rcx,%rax,4), %r15
	movq	-104(%rbp), %rcx                # 8-byte Reload
	leaq	(%rcx,%rax,4), %rbx
	movl	%r12d, %eax
	imull	%r14d, %eax
	movq	-168(%rbp), %rcx                # 8-byte Reload
	leaq	(%rcx,%rax,4), %rdi
	movq	-160(%rbp), %rcx                # 8-byte Reload
	leaq	(%rcx,%rax,4), %rax
	movq	%rax, -176(%rbp)                # 8-byte Spill
	xorl	%esi, %esi
	movq	-88(%rbp), %rdx                 # 8-byte Reload
	callq	memset@PLT
	movq	-176(%rbp), %rdi                # 8-byte Reload
	xorl	%esi, %esi
	movq	-88(%rbp), %rdx                 # 8-byte Reload
	callq	memset@PLT
	movq	-152(%rbp), %rdx                # 8-byte Reload
	xorl	%eax, %eax
.LBB2_30:                               #   Parent Loop BB2_28 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	leaq	1(%rax), %rcx
	movl	%ecx, (%rbx,%rax,4)
	movl	%ecx, (%r15,%rax,4)
	movq	%rcx, %rax
	cmpq	%rcx, %r12
	jne	.LBB2_30
.LBB2_31:                               # %._crit_edge214
                                        #   in Loop: Header=BB2_28 Depth=1
	incq	%r14
	addl	%r12d, %r13d
	cmpq	%rdx, %r14
	jne	.LBB2_28
# %bb.32:                               # %._crit_edge217
	callq	clock
	movq	%rax, %rbx
	movl	-52(%rbp), %ecx
	movl	-48(%rbp), %r8d
	movl	-44(%rbp), %r9d
	movq	-192(%rbp), %r14                # 8-byte Reload
	movq	%r14, %rdi
	movq	-160(%rbp), %rsi                # 8-byte Reload
	movq	-96(%rbp), %rdx                 # 8-byte Reload
	callq	_Z12filterOnHostP13_Graph_node_APiS1_iii
	callq	clock
	subq	%rbx, %rax
	cvtsi2ss	%rax, %xmm0
	divss	.LCPI2_0(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.19, %edi
	movb	$1, %al
	callq	printf
	callq	clock
	movq	%rax, %rbx
	movl	-52(%rbp), %ecx
	movl	-48(%rbp), %r8d
	movl	-44(%rbp), %r9d
	movq	%r14, %rdi
	movq	-168(%rbp), %rsi                # 8-byte Reload
	movq	-104(%rbp), %rdx                # 8-byte Reload
	callq	_Z14filterOnDeviceP13_Graph_node_APiS1_iii
	callq	clock
	subq	%rbx, %rax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%rax, %xmm0
	divss	.LCPI2_0(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.20, %edi
	movb	$1, %al
	callq	printf
	movl	-48(%rbp), %r14d
	testl	%r14d, %r14d
	jle	.LBB2_35
# %bb.33:                               # %.lr.ph221
	movslq	-44(%rbp), %rcx
	leaq	(,%rcx,4), %rax
	movq	%rax, -152(%rbp)                # 8-byte Spill
	movq	-168(%rbp), %rax                # 8-byte Reload
	leaq	(%rax,%rcx,4), %r13
	movq	-104(%rbp), %rax                # 8-byte Reload
	leaq	(%rax,%rcx,4), %r12
	movq	-96(%rbp), %rax                 # 8-byte Reload
	leaq	(%rax,%rcx,4), %rbx
	movq	-160(%rbp), %rax                # 8-byte Reload
	movq	%rcx, -88(%rbp)                 # 8-byte Spill
	leaq	(%rax,%rcx,4), %r15
	movq	%r14, %rax
.LBB2_34:                               # =>This Inner Loop Header: Depth=1
	movq	%rax, -176(%rbp)                # 8-byte Spill
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	-88(%rbp), %rdx                 # 8-byte Reload
                                        # kill: def $edx killed $edx killed $rdx
	callq	_Z7selSortPiS_i
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	-88(%rbp), %rdx                 # 8-byte Reload
                                        # kill: def $edx killed $edx killed $rdx
	callq	_Z7selSortPiS_i
	movq	-152(%rbp), %rax                # 8-byte Reload
	addq	%rax, %r13
	addq	%rax, %r12
	addq	%rax, %rbx
	addq	%rax, %r15
	movq	-176(%rbp), %rax                # 8-byte Reload
	decq	%rax
	jne	.LBB2_34
.LBB2_35:                               # %._crit_edge222
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -80(%rbp)
	xorl	%ebx, %ebx
	movq	%rbx, -64(%rbp)
	movq	%rbx, -128(%rbp)
	movaps	%xmm0, -144(%rbp)
	testl	%r14d, %r14d
	js	.LBB2_53
# %bb.36:                               # %.preheader.lr.ph
	leaq	-80(%rbp), %r13
	leaq	-144(%rbp), %r15
.LBB2_37:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_39 Depth 2
	testl	%r14d, %r14d
	jle	.LBB2_46
# %bb.38:                               # %.lr.ph224.preheader
                                        #   in Loop: Header=BB2_37 Depth=1
	xorl	%r12d, %r12d
.LBB2_39:                               # %.lr.ph224
                                        #   Parent Loop BB2_37 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	-44(%rbp), %eax
	imull	%ebx, %eax
	addl	%r12d, %eax
	cltq
	movq	-104(%rbp), %rcx                # 8-byte Reload
	leaq	(%rcx,%rax,4), %rdx
	movq	-72(%rbp), %rsi
	cmpq	-64(%rbp), %rsi
	je	.LBB2_41
# %bb.40:                               #   in Loop: Header=BB2_39 Depth=2
	movl	(%rdx), %eax
	movl	%eax, (%rsi)
	addq	$4, %rsi
	movq	%rsi, -72(%rbp)
	jmp	.LBB2_42
.LBB2_41:                               #   in Loop: Header=BB2_39 Depth=2
.Ltmp0:
	movq	%r13, %rdi
	callq	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
.Ltmp1:
.LBB2_42:                               # %_ZNSt6vectorIiSaIiEE9push_backERKi.exit
                                        #   in Loop: Header=BB2_39 Depth=2
	movl	-44(%rbp), %eax
	imull	%ebx, %eax
	addl	%r12d, %eax
	cltq
	movq	-96(%rbp), %rcx                 # 8-byte Reload
	leaq	(%rcx,%rax,4), %rdx
	movq	-136(%rbp), %rsi
	cmpq	-128(%rbp), %rsi
	je	.LBB2_44
# %bb.43:                               #   in Loop: Header=BB2_39 Depth=2
	movl	(%rdx), %eax
	movl	%eax, (%rsi)
	addq	$4, %rsi
	movq	%rsi, -136(%rbp)
	jmp	.LBB2_45
.LBB2_44:                               #   in Loop: Header=BB2_39 Depth=2
.Ltmp2:
	movq	%r15, %rdi
	callq	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
.Ltmp3:
.LBB2_45:                               # %_ZNSt6vectorIiSaIiEE9push_backERKi.exit116
                                        #   in Loop: Header=BB2_39 Depth=2
	incl	%r12d
	movl	-48(%rbp), %r14d
	cmpl	%r14d, %r12d
	jl	.LBB2_39
.LBB2_46:                               # %._crit_edge225
                                        #   in Loop: Header=BB2_37 Depth=1
	leal	1(%rbx), %eax
	cmpl	%r14d, %ebx
	movl	%eax, %ebx
	jl	.LBB2_37
# %bb.47:                               # %._crit_edge228
	movq	-80(%rbp), %rbx
	movq	-72(%rbp), %r14
	cmpq	%r14, %rbx
	je	.LBB2_53
# %bb.48:
	movq	%r14, %rax
	subq	%rbx, %rax
	sarq	$2, %rax
	je	.LBB2_49
# %bb.50:                               # %cond.false
	bsrq	%rax, %rax
	xorq	$63, %rax
	jmp	.LBB2_51
.LBB2_49:
	movl	$64, %eax
.LBB2_51:                               # %cond.end
	addq	%rax, %rax
	movl	$126, %edx
	subq	%rax, %rdx
.Ltmp5:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_
.Ltmp6:
# %bb.52:                               # %.noexc117
.Ltmp7:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_
.Ltmp8:
.LBB2_53:                               # %_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_.exit
	movq	-144(%rbp), %rbx
	movq	-136(%rbp), %r14
	cmpq	%r14, %rbx
	je	.LBB2_59
# %bb.54:
	movq	%r14, %rax
	subq	%rbx, %rax
	sarq	$2, %rax
	je	.LBB2_55
# %bb.56:                               # %cond.false316
	bsrq	%rax, %rax
	xorq	$63, %rax
	jmp	.LBB2_57
.LBB2_55:
	movl	$64, %eax
.LBB2_57:                               # %cond.end317
	addq	%rax, %rax
	movl	$126, %edx
	subq	%rax, %rdx
.Ltmp9:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_
.Ltmp10:
# %bb.58:                               # %.noexc120
.Ltmp11:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_
.Ltmp12:
.LBB2_59:                               # %_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_.exit122
	movq	-80(%rbp), %rcx
	movq	-72(%rbp), %rax
	leaq	4(%rcx), %r14
	cmpq	%rax, %r14
	je	.LBB2_70
# %bb.60:                               # %.lr.ph232.preheader
	movl	(%rcx), %ebx
.LBB2_61:                               # %.lr.ph232
                                        # =>This Inner Loop Header: Depth=1
	movl	(%r14), %ecx
	cmpl	%ecx, %ebx
	jne	.LBB2_68
# %bb.62:                               #   in Loop: Header=BB2_61 Depth=1
	leaq	4(%r14), %rsi
	cmpq	%rax, %rsi
	je	.LBB2_67
# %bb.63:                               #   in Loop: Header=BB2_61 Depth=1
	movq	%rax, %rdx
	subq	%rsi, %rdx
	cmpq	$5, %rdx
	jl	.LBB2_65
# %bb.64:                               #   in Loop: Header=BB2_61 Depth=1
	movq	%r14, %rdi
	callq	memmove@PLT
	movq	-72(%rbp), %rax
.LBB2_67:                               # %_ZNSt6vectorIiSaIiEE5eraseEN9__gnu_cxx17__normal_iteratorIPKiS1_EE.exit
                                        #   in Loop: Header=BB2_61 Depth=1
	addq	$-4, %rax
	movq	%rax, -72(%rbp)
	jmp	.LBB2_69
.LBB2_68:                               #   in Loop: Header=BB2_61 Depth=1
	addq	$4, %r14
	movl	%ecx, %ebx
.LBB2_69:                               #   in Loop: Header=BB2_61 Depth=1
	cmpq	%rax, %r14
	jne	.LBB2_61
	jmp	.LBB2_70
.LBB2_65:                               #   in Loop: Header=BB2_61 Depth=1
	cmpq	$4, %rdx
	jne	.LBB2_67
# %bb.66:                               #   in Loop: Header=BB2_61 Depth=1
	movl	4(%r14), %ecx
	movl	%ecx, (%r14)
	jmp	.LBB2_67
.LBB2_70:                               # %._crit_edge233
	movq	-144(%rbp), %rcx
	movq	-136(%rbp), %rax
	leaq	4(%rcx), %r14
	cmpq	%rax, %r14
	je	.LBB2_81
# %bb.71:                               # %.lr.ph238.preheader
	movl	(%rcx), %ebx
.LBB2_72:                               # %.lr.ph238
                                        # =>This Inner Loop Header: Depth=1
	movl	(%r14), %ecx
	cmpl	%ecx, %ebx
	jne	.LBB2_79
# %bb.73:                               #   in Loop: Header=BB2_72 Depth=1
	leaq	4(%r14), %rsi
	cmpq	%rax, %rsi
	je	.LBB2_78
# %bb.74:                               #   in Loop: Header=BB2_72 Depth=1
	movq	%rax, %rdx
	subq	%rsi, %rdx
	cmpq	$5, %rdx
	jl	.LBB2_76
# %bb.75:                               #   in Loop: Header=BB2_72 Depth=1
	movq	%r14, %rdi
	callq	memmove@PLT
	movq	-136(%rbp), %rax
.LBB2_78:                               # %_ZNSt6vectorIiSaIiEE5eraseEN9__gnu_cxx17__normal_iteratorIPKiS1_EE.exit126
                                        #   in Loop: Header=BB2_72 Depth=1
	addq	$-4, %rax
	movq	%rax, -136(%rbp)
	jmp	.LBB2_80
.LBB2_79:                               #   in Loop: Header=BB2_72 Depth=1
	addq	$4, %r14
	movl	%ecx, %ebx
.LBB2_80:                               #   in Loop: Header=BB2_72 Depth=1
	cmpq	%rax, %r14
	jne	.LBB2_72
	jmp	.LBB2_81
.LBB2_76:                               #   in Loop: Header=BB2_72 Depth=1
	cmpq	$4, %rdx
	jne	.LBB2_78
# %bb.77:                               #   in Loop: Header=BB2_72 Depth=1
	movl	4(%r14), %ecx
	movl	%ecx, (%r14)
	jmp	.LBB2_78
.LBB2_81:                               # %._crit_edge239
.Ltmp14:
	leaq	-224(%rbp), %rdi
	leaq	-144(%rbp), %rsi
	callq	_ZNSt6vectorIiSaIiEEC2ERKS1_
.Ltmp15:
# %bb.82:
.Ltmp16:
	leaq	-248(%rbp), %rdi
	leaq	-80(%rbp), %rsi
	callq	_ZNSt6vectorIiSaIiEEC2ERKS1_
.Ltmp17:
# %bb.83:
	movq	-224(%rbp), %rdi
	movq	-216(%rbp), %rcx
	movb	$1, %bl
	movq	-248(%rbp), %rax
	cmpq	%rcx, %rdi
	je	.LBB2_89
# %bb.84:                               # %.lr.ph.i
	movq	-240(%rbp), %rdx
	movq	%rdi, %rsi
	movq	%rax, %r8
.LBB2_85:                               # =>This Inner Loop Header: Depth=1
	cmpq	%rdx, %r8
	je	.LBB2_89
# %bb.86:                               #   in Loop: Header=BB2_85 Depth=1
	movl	(%rsi), %r9d
	cmpl	(%r8), %r9d
	jne	.LBB2_87
# %bb.88:                               #   in Loop: Header=BB2_85 Depth=1
	addq	$4, %rsi
	addq	$4, %r8
	cmpq	%rcx, %rsi
	jne	.LBB2_85
	jmp	.LBB2_89
.LBB2_87:
	xorl	%ebx, %ebx
.LBB2_89:                               # %_Z7compareSt6vectorIiSaIiEES1_.exit
	testq	%rax, %rax
	je	.LBB2_91
# %bb.90:
	movq	%rax, %rdi
	callq	_ZdlPv
	movq	-224(%rbp), %rdi
.LBB2_91:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit
	testq	%rdi, %rdi
	je	.LBB2_93
# %bb.92:
	callq	_ZdlPv
.LBB2_93:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit129
	movl	$.L.str.21, %eax
	movl	$.L.str.22, %esi
	testb	%bl, %bl
	cmovneq	%rax, %rsi
	movzbl	%bl, %edx
	orq	$14, %rdx
.Ltmp19:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp20:
# %bb.94:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit.invoke
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %rbx
.Ltmp21:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp22:
# %bb.95:                               # %.noexc154.invoke
.Ltmp23:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp24:
# %bb.96:                               # %.noexc155.invoke
.Ltmp25:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp26:
# %bb.97:                               # %_ZNSolsEPFRSoS_E.exit
.Ltmp27:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.23, %esi
	movl	$44, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp28:
# %bb.98:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit139
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %rbx
.Ltmp29:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp30:
# %bb.99:                               # %.noexc161
.Ltmp31:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp32:
# %bb.100:                              # %.noexc162
.Ltmp33:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp34:
# %bb.101:                              # %_ZNSolsEPFRSoS_E.exit141
	movq	-80(%rbp), %rbx
.LBB2_102:                              # %_ZNSolsEPFRSoS_E.exit141
                                        # =>This Inner Loop Header: Depth=1
	cmpq	-72(%rbp), %rbx
	je	.LBB2_106
# %bb.103:                              # %.lr.ph242
                                        #   in Loop: Header=BB2_102 Depth=1
	movl	(%rbx), %esi
.Ltmp35:
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
.Ltmp36:
# %bb.104:                              #   in Loop: Header=BB2_102 Depth=1
.Ltmp37:
	movl	$.L.str.11, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp38:
# %bb.105:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit143
                                        #   in Loop: Header=BB2_102 Depth=1
	addq	$4, %rbx
	jmp	.LBB2_102
.LBB2_106:                              # %._crit_edge243
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp40:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp41:
# %bb.107:                              # %.noexc165
.Ltmp42:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp43:
# %bb.108:                              # %.noexc166
.Ltmp44:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp45:
# %bb.109:                              # %_ZNSolsEPFRSoS_E.exit145
	movq	-168(%rbp), %rdi                # 8-byte Reload
	callq	free
	movq	-160(%rbp), %rdi                # 8-byte Reload
	callq	free
	movq	-104(%rbp), %rdi                # 8-byte Reload
	callq	free
	movq	-96(%rbp), %rdi                 # 8-byte Reload
	callq	free
	movq	-144(%rbp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_111
# %bb.110:
	callq	_ZdlPv
.LBB2_111:                              # %_ZNSt6vectorIiSaIiEED2Ev.exit147
	movq	-80(%rbp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_113
# %bb.112:
	callq	_ZdlPv
.LBB2_113:                              # %_ZNSt6vectorIiSaIiEED2Ev.exit149
	movq	-200(%rbp), %rsp                # 8-byte Reload
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.LBB2_125:
	.cfi_def_cfa %rbp, 16
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	movl	$1, %edi
	callq	exit
.LBB2_116:
.Ltmp18:
	movq	%rax, %rbx
	movq	-224(%rbp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_120
# %bb.117:
	callq	_ZdlPv
	jmp	.LBB2_120
.LBB2_126:                              # %.loopexit.split-lp192
.Ltmp13:
	jmp	.LBB2_119
.LBB2_115:                              # %.loopexit.split-lp
.Ltmp46:
	jmp	.LBB2_119
.LBB2_114:                              # %.loopexit
.Ltmp39:
	jmp	.LBB2_119
.LBB2_118:                              # %.loopexit191
.Ltmp4:
.LBB2_119:                              # %_ZNSt6vectorIiSaIiEED2Ev.exit133
	movq	%rax, %rbx
.LBB2_120:                              # %_ZNSt6vectorIiSaIiEED2Ev.exit133
	movq	-144(%rbp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_122
# %bb.121:
	callq	_ZdlPv
.LBB2_122:                              # %_ZNSt6vectorIiSaIiEED2Ev.exit151
	movq	-80(%rbp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_124
# %bb.123:
	callq	_ZdlPv
.LBB2_124:                              # %_ZNSt6vectorIiSaIiEED2Ev.exit153
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp3-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp3
	.uleb128 .Ltmp4-.Lfunc_begin0           #     jumps to .Ltmp4
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp5-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp12-.Ltmp5                 #   Call between .Ltmp5 and .Ltmp12
	.uleb128 .Ltmp13-.Lfunc_begin0          #     jumps to .Ltmp13
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp14-.Ltmp12                #   Call between .Ltmp12 and .Ltmp14
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp14-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp15-.Ltmp14                #   Call between .Ltmp14 and .Ltmp15
	.uleb128 .Ltmp46-.Lfunc_begin0          #     jumps to .Ltmp46
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp16-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp17-.Ltmp16                #   Call between .Ltmp16 and .Ltmp17
	.uleb128 .Ltmp18-.Lfunc_begin0          #     jumps to .Ltmp18
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp19-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp34-.Ltmp19                #   Call between .Ltmp19 and .Ltmp34
	.uleb128 .Ltmp46-.Lfunc_begin0          #     jumps to .Ltmp46
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp35-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp38-.Ltmp35                #   Call between .Ltmp35 and .Ltmp38
	.uleb128 .Ltmp39-.Lfunc_begin0          #     jumps to .Ltmp39
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp40-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp45-.Ltmp40                #   Call between .Ltmp40 and .Ltmp45
	.uleb128 .Ltmp46-.Lfunc_begin0          #     jumps to .Ltmp46
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp45-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Lfunc_end2-.Ltmp45            #   Call between .Ltmp45 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z12filterOnHostP13_Graph_node_APiS1_iii # -- Begin function _Z12filterOnHostP13_Graph_node_APiS1_iii
	.type	_Z12filterOnHostP13_Graph_node_APiS1_iii,@function
_Z12filterOnHostP13_Graph_node_APiS1_iii: # @_Z12filterOnHostP13_Graph_node_APiS1_iii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%r9d, %ebx
	movl	%r8d, %ebp
                                        # kill: def $ecx killed $ecx def $rcx
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movl	%r9d, %r13d
	testl	%r9d, %r9d
	jle	.LBB3_12
# %bb.1:                                # %.lr.ph
	decl	%ecx
	movslq	%ecx, %rax
	imulq	$1600, %rax, %rax               # imm = 0x640
	addq	%r12, %rax
	xorl	%edx, %edx
.LBB3_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_4 Depth 2
                                        #       Child Loop BB3_7 Depth 3
	cmpq	%rcx, %rdx
	je	.LBB3_11
# %bb.3:                                # %.preheader78
                                        #   in Loop: Header=BB3_2 Depth=1
	imulq	$1600, %rdx, %rsi               # imm = 0x640
	addq	%r12, %rsi
	xorl	%edi, %edi
.LBB3_4:                                #   Parent Loop BB3_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB3_7 Depth 3
	movl	(%rsi,%rdi,4), %r8d
	testl	%r8d, %r8d
	je	.LBB3_11
# %bb.5:                                # %.preheader77.preheader
                                        #   in Loop: Header=BB3_4 Depth=2
	xorl	%r9d, %r9d
.LBB3_7:                                # %.preheader77
                                        #   Parent Loop BB3_2 Depth=1
                                        #     Parent Loop BB3_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%rax,%r9,4), %r10d
	testl	%r10d, %r10d
	je	.LBB3_10
# %bb.8:                                #   in Loop: Header=BB3_7 Depth=3
	cmpl	%r8d, %r10d
	je	.LBB3_9
# %bb.6:                                #   in Loop: Header=BB3_7 Depth=3
	incq	%r9
	cmpq	$400, %r9                       # imm = 0x190
	jne	.LBB3_7
	jmp	.LBB3_10
.LBB3_9:                                #   in Loop: Header=BB3_4 Depth=2
	incl	(%r15,%rdx,4)
.LBB3_10:                               # %.critedge2
                                        #   in Loop: Header=BB3_4 Depth=2
	incq	%rdi
	cmpq	$400, %rdi                      # imm = 0x190
	jne	.LBB3_4
.LBB3_11:                               # %.critedge
                                        #   in Loop: Header=BB3_2 Depth=1
	incq	%rdx
	cmpq	%r13, %rdx
	jne	.LBB3_2
.LBB3_12:                               # %._crit_edge
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_Z7selSortPiS_i
	testl	%ebp, %ebp
	jle	.LBB3_29
# %bb.13:                               # %.preheader76.lr.ph
	movl	%ebp, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	xorl	%ecx, %ecx
	movl	%ebx, 12(%rsp)                  # 4-byte Spill
.LBB3_14:                               # %.preheader76
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_17 Depth 2
                                        #       Child Loop BB3_18 Depth 3
                                        #         Child Loop BB3_21 Depth 4
	testl	%ebx, %ebx
	jle	.LBB3_15
# %bb.16:                               # %.preheader75.lr.ph
                                        #   in Loop: Header=BB3_14 Depth=1
	leaq	1(%rcx), %rdx
	movl	%edx, %eax
	imull	%ebx, %eax
	leaq	(%r15,%rax,4), %rsi
	xorl	%edi, %edi
.LBB3_17:                               # %.preheader75
                                        #   Parent Loop BB3_14 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB3_18 Depth 3
                                        #         Child Loop BB3_21 Depth 4
	imulq	$1600, %rdi, %r8                # imm = 0x640
	addq	%r12, %r8
	xorl	%r9d, %r9d
.LBB3_18:                               #   Parent Loop BB3_14 Depth=1
                                        #     Parent Loop BB3_17 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB3_21 Depth 4
	movl	(%r8,%r9,4), %r10d
	testl	%r10d, %r10d
	je	.LBB3_26
# %bb.19:                               # %.preheader
                                        #   in Loop: Header=BB3_18 Depth=3
	movslq	(%r14,%rcx,4), %rax
	leal	-1(%rax), %r11d
	imulq	$1600, %rax, %rbp               # imm = 0x640
	addq	%r12, %rbp
	movq	$-400, %rax                     # imm = 0xFE70
.LBB3_21:                               #   Parent Loop BB3_14 Depth=1
                                        #     Parent Loop BB3_17 Depth=2
                                        #       Parent Loop BB3_18 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movl	(%rbp,%rax,4), %ebx
	testl	%ebx, %ebx
	je	.LBB3_25
# %bb.22:                               #   in Loop: Header=BB3_21 Depth=4
	cmpl	%r10d, %ebx
	jne	.LBB3_20
# %bb.23:                               #   in Loop: Header=BB3_21 Depth=4
	cmpq	%r11, %rdi
	jne	.LBB3_24
.LBB3_20:                               #   in Loop: Header=BB3_21 Depth=4
	incq	%rax
	jne	.LBB3_21
	jmp	.LBB3_25
.LBB3_24:                               #   in Loop: Header=BB3_18 Depth=3
	incl	(%rsi,%rdi,4)
.LBB3_25:                               # %.critedge6
                                        #   in Loop: Header=BB3_18 Depth=3
	incq	%r9
	cmpq	$400, %r9                       # imm = 0x190
	jne	.LBB3_18
.LBB3_26:                               # %.critedge4
                                        #   in Loop: Header=BB3_17 Depth=2
	incq	%rdi
	cmpq	%r13, %rdi
	jne	.LBB3_17
# %bb.27:                               #   in Loop: Header=BB3_14 Depth=1
	movq	%rdx, %rcx
	movl	12(%rsp), %ebx                  # 4-byte Reload
	jmp	.LBB3_28
.LBB3_15:                               # %.preheader76.._crit_edge85_crit_edge
                                        #   in Loop: Header=BB3_14 Depth=1
	incq	%rcx
	movq	%rcx, %rdx
.LBB3_28:                               # %._crit_edge85
                                        #   in Loop: Header=BB3_14 Depth=1
	cmpq	16(%rsp), %rdx                  # 8-byte Folded Reload
	jne	.LBB3_14
.LBB3_29:                               # %._crit_edge87
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z12filterOnHostP13_Graph_node_APiS1_iii, .Lfunc_end3-_Z12filterOnHostP13_Graph_node_APiS1_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z14filterOnDeviceP13_Graph_node_APiS1_iii # -- Begin function _Z14filterOnDeviceP13_Graph_node_APiS1_iii
	.type	_Z14filterOnDeviceP13_Graph_node_APiS1_iii,@function
_Z14filterOnDeviceP13_Graph_node_APiS1_iii: # @_Z14filterOnDeviceP13_Graph_node_APiS1_iii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%r8d, %ebp
	movq	%rdx, 80(%rsp)                  # 8-byte Spill
	movq	%rsi, 72(%rsp)                  # 8-byte Spill
	movq	%rdi, %r13
	leaq	60(%rsp), %rax
	movl	%ecx, (%rax)
	leaq	28(%rsp), %rax
	movl	%r8d, (%rax)
	leaq	4(%rsp), %rax
	movl	%r9d, (%rax)
	incl	%ebp
	imull	%r9d, %ebp
	shll	$2, %ebp
	movslq	%r9d, %rbx
	imulq	$1600, %rbx, %r15               # imm = 0x640
	leaq	40(%rsp), %r12
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	movslq	%ebp, %r14
	leaq	8(%rsp), %rbp
	movq	%rbp, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
	leaq	16(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
	leaq	64(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
	leaq	32(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
	shlq	$2, %rbx
	leaq	48(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	movq	(%r12), %rdi
	movabsq	$4294967296, %r12               # imm = 0x100000000
	movq	%r13, %rsi
	movq	%r15, %rdx
	movq	72(%rsp), %r15                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rbp), %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	16(%rsp), %rax
	movq	(%rax), %rdi
	movl	$4, %edx
	leaq	4(%rsp), %rbx
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	64(%rsp), %rax
	movq	(%rax), %rdi
	movl	$4, %edx
	leaq	60(%rsp), %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	32(%rsp), %rax
	movq	(%rax), %rdi
	movl	$4, %edx
	leaq	28(%rsp), %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movl	(%rbx), %edx
	btsq	$32, %rdx
	leaq	1(%r12), %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_2
# %bb.1:
	movq	40(%rsp), %rdi
	movq	8(%rsp), %rsi
	movq	64(%rsp), %rdx
	movq	16(%rsp), %rcx
	callq	__device_stub__naiveFilterKernel
.LBB4_2:
	movq	8(%rsp), %rsi
	movslq	4(%rsp), %rdx
	shlq	$2, %rdx
	movq	%r15, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movslq	4(%rsp), %rbx
	movq	%r15, %rdi
	movq	80(%rsp), %r13                  # 8-byte Reload
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_Z7selSortPiS_i
	movq	48(%rsp), %rdi
	shlq	$2, %rbx
	movq	%r13, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	28(%rsp), %edi
	shlq	$32, %rdi
	orq	$1, %rdi
	movl	4(%rsp), %edx
	orq	%r12, %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_4
# %bb.3:
	movq	40(%rsp), %rdi
	movq	8(%rsp), %rsi
	movq	48(%rsp), %rdx
	movq	32(%rsp), %rcx
	movq	16(%rsp), %r8
	callq	_Z31__device_stub__fullFilterKernelP13_Graph_node_APiS1_S1_S1_
.LBB4_4:
	movq	8(%rsp), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	40(%rsp), %rdi
	callq	hipFree
	xorl	%ebx, %ebx
	movq	%rbx, 40(%rsp)
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	%rbx, 8(%rsp)
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	%rbx, 16(%rsp)
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	%rbx, 32(%rsp)
	movq	48(%rsp), %rdi
	callq	hipFree
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z14filterOnDeviceP13_Graph_node_APiS1_iii, .Lfunc_end4-_Z14filterOnDeviceP13_Graph_node_APiS1_iii
	.cfi_endproc
                                        # -- End function
	.globl	_Z7selSortPiS_i                 # -- Begin function _Z7selSortPiS_i
	.type	_Z7selSortPiS_i,@function
_Z7selSortPiS_i:                        # @_Z7selSortPiS_i
	.cfi_startproc
# %bb.0:
                                        # kill: def $edx killed $edx def $rdx
	cmpl	$2, %edx
	jl	.LBB5_10
# %bb.1:                                # %.lr.ph28.preheader
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	leal	-1(%rdx), %eax
	movl	%edx, %ecx
	movl	$1, %edx
	xorl	%r8d, %r8d
.LBB5_2:                                # %.lr.ph.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_3 Depth 2
	movq	%r8, %r9
	incq	%r8
	movq	%rdx, %r10
	movl	%r9d, %ebx
.LBB5_3:                                # %.lr.ph
                                        #   Parent Loop BB5_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%rdi,%r10,4), %ebp
	movslq	%ebx, %r14
	movl	%r10d, %r11d
	cmpl	(%rdi,%r14,4), %ebp
	jg	.LBB5_5
# %bb.4:                                # %.lr.ph
                                        #   in Loop: Header=BB5_3 Depth=2
	movl	%ebx, %r11d
.LBB5_5:                                # %.lr.ph
                                        #   in Loop: Header=BB5_3 Depth=2
	incq	%r10
	movl	%r11d, %ebx
	cmpq	%r10, %rcx
	jne	.LBB5_3
# %bb.6:                                # %._crit_edge
                                        #   in Loop: Header=BB5_2 Depth=1
	movl	%r11d, %r10d
	cmpq	%r10, %r9
	je	.LBB5_8
# %bb.7:                                #   in Loop: Header=BB5_2 Depth=1
	movslq	%r11d, %r10
	movl	(%rdi,%r9,4), %r11d
	movl	(%rdi,%r10,4), %ebx
	movl	%ebx, (%rdi,%r9,4)
	movl	%r11d, (%rdi,%r10,4)
	movl	(%rsi,%r9,4), %r11d
	movl	(%rsi,%r10,4), %ebx
	movl	%ebx, (%rsi,%r9,4)
	movl	%r11d, (%rsi,%r10,4)
.LBB5_8:                                #   in Loop: Header=BB5_2 Depth=1
	incq	%rdx
	cmpq	%rax, %r8
	jne	.LBB5_2
# %bb.9:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %rbp
.LBB5_10:                               # %._crit_edge29
	retq
.Lfunc_end5:
	.size	_Z7selSortPiS_i, .Lfunc_end5-_Z7selSortPiS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z7compareSt6vectorIiSaIiEES1_  # -- Begin function _Z7compareSt6vectorIiSaIiEES1_
	.type	_Z7compareSt6vectorIiSaIiEES1_,@function
_Z7compareSt6vectorIiSaIiEES1_:         # @_Z7compareSt6vectorIiSaIiEES1_
	.cfi_startproc
# %bb.0:
	movq	(%rdi), %rcx
	movq	8(%rdi), %rdx
	movb	$1, %al
	cmpq	%rdx, %rcx
	je	.LBB6_5
# %bb.1:                                # %.lr.ph
	movq	(%rsi), %rdi
	movq	8(%rsi), %rsi
.LBB6_2:                                # =>This Inner Loop Header: Depth=1
	cmpq	%rsi, %rdi
	je	.LBB6_5
# %bb.3:                                #   in Loop: Header=BB6_2 Depth=1
	movl	(%rcx), %r8d
	cmpl	(%rdi), %r8d
	jne	.LBB6_6
# %bb.4:                                #   in Loop: Header=BB6_2 Depth=1
	addq	$4, %rcx
	addq	$4, %rdi
	cmpq	%rdx, %rcx
	jne	.LBB6_2
.LBB6_5:                                # %.critedge
                                        # kill: def $al killed $al killed $eax
	retq
.LBB6_6:
	xorl	%eax, %eax
                                        # kill: def $al killed $al killed $eax
	retq
.Lfunc_end6:
	.size	_Z7compareSt6vectorIiSaIiEES1_, .Lfunc_end6-_Z7compareSt6vectorIiSaIiEES1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIiSaIiEEC2ERKS1_,"axG",@progbits,_ZNSt6vectorIiSaIiEEC2ERKS1_,comdat
	.weak	_ZNSt6vectorIiSaIiEEC2ERKS1_    # -- Begin function _ZNSt6vectorIiSaIiEEC2ERKS1_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIiSaIiEEC2ERKS1_,@function
_ZNSt6vectorIiSaIiEEC2ERKS1_:           # @_ZNSt6vectorIiSaIiEEC2ERKS1_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	8(%rsi), %rax
	movq	(%rsi), %rcx
	movq	%rax, %r12
	subq	%rcx, %r12
	sarq	$2, %r12
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	cmpq	%rcx, %rax
	je	.LBB7_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIiE8allocateEmPKv
	movq	%rax, %r15
	jmp	.LBB7_3
.LBB7_1:
	xorl	%r15d, %r15d
.LBB7_3:
	movq	%r15, (%rbx)
	movq	%r15, 8(%rbx)
	leaq	(%r15,%r12,4), %rax
	movq	%rax, 16(%rbx)
	movq	(%r14), %rsi
	movq	8(%r14), %r14
	subq	%rsi, %r14
	cmpq	$5, %r14
	jl	.LBB7_5
# %bb.4:
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	memmove@PLT
.LBB7_7:
	addq	%r14, %r15
	movq	%r15, 8(%rbx)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB7_5:
	.cfi_def_cfa_offset 48
	cmpq	$4, %r14
	jne	.LBB7_7
# %bb.6:
	movl	(%rsi), %eax
	movl	%eax, (%r15)
	jmp	.LBB7_7
.Lfunc_end7:
	.size	_ZNSt6vectorIiSaIiEEC2ERKS1_, .Lfunc_end7-_ZNSt6vectorIiSaIiEEC2ERKS1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,comdat
	.weak	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_ # -- Begin function _ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,@function
_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_: # @_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, (%rsp)                    # 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	$1, %esi
	movl	$.L.str.24, %edx
	callq	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	movq	(%rbx), %r13
	movq	8(%rbx), %r15
	movq	%r12, 8(%rsp)                   # 8-byte Spill
	subq	%r13, %r12
	movq	%r12, %r14
	sarq	$2, %r14
	testq	%rax, %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	je	.LBB8_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIiE8allocateEmPKv
	movq	%rax, %rbp
	jmp	.LBB8_3
.LBB8_1:
	xorl	%ebp, %ebp
.LBB8_3:                                # %_ZNSt12_Vector_baseIiSaIiEE11_M_allocateEm.exit
	movq	(%rsp), %rax                    # 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, (%rbp,%r14,4)
	testq	%r12, %r12
	jle	.LBB8_5
# %bb.4:
	movq	%rbp, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	memmove@PLT
.LBB8_5:                                # %_ZNSt6vectorIiSaIiEE11_S_relocateEPiS2_S2_RS0_.exit
	addq	%rbp, %r12
	addq	$4, %r12
	movq	8(%rsp), %rsi                   # 8-byte Reload
	subq	%rsi, %r15
	testq	%r15, %r15
	jle	.LBB8_7
# %bb.6:
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB8_7:                                # %_ZNSt6vectorIiSaIiEE11_S_relocateEPiS2_S2_RS0_.exit16
	testq	%r13, %r13
	je	.LBB8_9
# %bb.8:
	movq	%r13, %rdi
	callq	_ZdlPv
.LBB8_9:                                # %_ZNSt12_Vector_baseIiSaIiEE13_M_deallocateEPim.exit
	addq	%r15, %r12
	movq	%rbp, (%rbx)
	movq	%r12, 8(%rbx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(,%rax,4), %rax
	addq	%rbp, %rax
	movq	%rax, 16(%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, .Lfunc_end8-_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,@function
_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc: # @_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$2305843009213693951, %rcx      # imm = 0x1FFFFFFFFFFFFFFF
	movq	8(%rdi), %r8
	subq	(%rdi), %r8
	sarq	$2, %r8
	movq	%rcx, %rax
	subq	%r8, %rax
	cmpq	%rsi, %rax
	jb	.LBB9_2
# %bb.1:
	cmpq	%rsi, %r8
	cmovaq	%r8, %rsi
	leaq	(%rsi,%r8), %rax
	cmpq	%rcx, %rax
	cmovaeq	%rcx, %rax
	addq	%r8, %rsi
	cmovbq	%rcx, %rax
	retq
.LBB9_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end9:
	.size	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc, .Lfunc_end9-_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIiE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIiE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIiE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIiE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIiE8allocateEmPKv,@function
_ZNSt15__new_allocatorIiE8allocateEmPKv: # @_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB10_1
# %bb.3:
	shlq	$2, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB10_1:
	.cfi_def_cfa_offset 16
	shrq	$62, %rsi
	je	.LBB10_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB10_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end10:
	.size	_ZNSt15__new_allocatorIiE8allocateEmPKv, .Lfunc_end10-_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_,"axG",@progbits,_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_,comdat
	.weak	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_ # -- Begin function _ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_
	.type	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_,@function
_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_: # @_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r14
	subq	%rdi, %r14
	sarq	$2, %r14
	cmpq	$17, %r14
	jl	.LBB11_12
# %bb.1:                                # %.lr.ph
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	leaq	4(%rdi), %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movq	$-4, %rbp
	subq	%rdi, %rbp
.LBB11_2:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB11_5 Depth 2
                                        #       Child Loop BB11_6 Depth 3
                                        #       Child Loop BB11_8 Depth 3
	subq	$1, %r15
	jb	.LBB11_3
# %bb.4:                                #   in Loop: Header=BB11_2 Depth=1
	andq	$-2, %r14
	leaq	(%rbx,%r14,2), %rdx
	leaq	-4(%r12), %rcx
	movq	%rbx, %rdi
	movq	16(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rsi
	callq	_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_S9_S9_T0_
	movq	%r14, %rax
	movq	%r12, %rcx
.LBB11_5:                               #   Parent Loop BB11_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB11_6 Depth 3
                                        #       Child Loop BB11_8 Depth 3
	movl	(%rbx), %edx
	leaq	(%rax,%rbp), %r14
.LBB11_6:                               #   Parent Loop BB11_2 Depth=1
                                        #     Parent Loop BB11_5 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%rax), %esi
	addq	$4, %rax
	addq	$4, %r14
	cmpl	%edx, %esi
	jl	.LBB11_6
# %bb.7:                                # %.preheader.i.i.preheader
                                        #   in Loop: Header=BB11_5 Depth=2
	leaq	-4(%rax), %r13
.LBB11_8:                               # %.preheader.i.i
                                        #   Parent Loop BB11_2 Depth=1
                                        #     Parent Loop BB11_5 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	-4(%rcx), %edi
	addq	$-4, %rcx
	cmpl	%edi, %edx
	jl	.LBB11_8
# %bb.9:                                #   in Loop: Header=BB11_5 Depth=2
	cmpq	%rcx, %r13
	jae	.LBB11_11
# %bb.10:                               #   in Loop: Header=BB11_5 Depth=2
	movl	%edi, (%r13)
	movl	%esi, (%rcx)
	jmp	.LBB11_5
.LBB11_11:                              # %_ZSt27__unguarded_partition_pivotIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEET_S9_S9_T0_.exit
                                        #   in Loop: Header=BB11_2 Depth=1
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_
	sarq	$2, %r14
	movq	%r13, %r12
	cmpq	$16, %r14
	jg	.LBB11_2
	jmp	.LBB11_12
.LBB11_3:
	leaq	15(%rsp), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_
	leaq	14(%rsp), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_
.LBB11_12:                              # %.loopexit
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end11:
	.size	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_, .Lfunc_end11-_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEElNS0_5__ops15_Iter_less_iterEEvT_S9_T0_T1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_,"axG",@progbits,_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_,comdat
	.weak	_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_ # -- Begin function _ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_
	.type	_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_,@function
_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_: # @_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_
	.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, %rbx
	movq	%rsi, %rax
	subq	%rdi, %rax
	cmpq	$65, %rax
	jl	.LBB12_8
# %bb.1:
	leaq	64(%rdi), %r14
	movq	%r14, %rsi
	callq	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_
.LBB12_2:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB12_5 Depth 2
	cmpq	%rbx, %r14
	je	.LBB12_7
# %bb.3:                                # %.lr.ph.i
                                        #   in Loop: Header=BB12_2 Depth=1
	movl	-4(%r14), %ecx
	movl	(%r14), %eax
	movq	%r14, %rdx
	cmpl	%ecx, %eax
	jge	.LBB12_6
# %bb.4:                                # %.lr.ph.i.i.preheader
                                        #   in Loop: Header=BB12_2 Depth=1
	movq	%r14, %rdx
.LBB12_5:                               # %.lr.ph.i.i
                                        #   Parent Loop BB12_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%ecx, (%rdx)
	movl	-8(%rdx), %ecx
	addq	$-4, %rdx
	cmpl	%ecx, %eax
	jl	.LBB12_5
.LBB12_6:                               # %_ZSt25__unguarded_linear_insertIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops14_Val_less_iterEEvT_T0_.exit.i
                                        #   in Loop: Header=BB12_2 Depth=1
	movl	%eax, (%rdx)
	addq	$4, %r14
	jmp	.LBB12_2
.LBB12_8:
	movq	%rbx, %rsi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_ # TAILCALL
.LBB12_7:                               # %_ZSt26__unguarded_insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_.exit
	.cfi_def_cfa_offset 32
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end12:
	.size	_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_, .Lfunc_end12-_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_,"axG",@progbits,_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_,comdat
	.weak	_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_ # -- Begin function _ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_
	.type	_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_,@function
_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_: # @_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_
	.cfi_startproc
# %bb.0:
	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
	movq	%rsi, %r15
	subq	%rdi, %r15
	cmpq	$5, %r15
	jl	.LBB13_3
# %bb.1:                                # %.lr.ph.preheader
	movq	%rsi, %rbx
	movq	%rdi, %r14
	addq	$-4, %rbx
.LBB13_2:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	(%rbx), %ecx
	movl	(%r14), %eax
	movl	%eax, (%rbx)
	addq	$-4, %r15
	movq	%r15, %rdx
	sarq	$2, %rdx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_
	addq	$-4, %rbx
	cmpq	$4, %r15
	jg	.LBB13_2
.LBB13_3:                               # %._crit_edge
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end13:
	.size	_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_, .Lfunc_end13-_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_,"axG",@progbits,_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_,comdat
	.weak	_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_ # -- Begin function _ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_
	.type	_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_,@function
_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_: # @_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_
	.cfi_startproc
# %bb.0:
	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
	movq	%rsi, %rbx
	subq	%rdi, %rbx
	sarq	$2, %rbx
	cmpq	$2, %rbx
	jl	.LBB14_3
# %bb.1:
	movq	%rdi, %r14
	leaq	-2(%rbx), %r15
	shrq	%r15
.LBB14_2:                               # =>This Inner Loop Header: Depth=1
	movl	(%r14,%r15,4), %ecx
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_
	addq	$-1, %r15
	jb	.LBB14_2
.LBB14_3:                               # %.loopexit
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end14:
	.size	_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_, .Lfunc_end14-_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_RT0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_,"axG",@progbits,_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_,comdat
	.weak	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_ # -- Begin function _ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_
	.type	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_,@function
_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_: # @_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_
	.cfi_startproc
# %bb.0:
	leaq	-1(%rdx), %rax
	shrq	$63, %rax
	leaq	(%rdx,%rax), %r8
	decq	%r8
	sarq	%r8
	movq	%rsi, %rax
	cmpq	%rsi, %r8
	jle	.LBB15_6
# %bb.1:                                # %.lr.ph.preheader
	movq	%rsi, %r9
.LBB15_2:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	leaq	(%r9,%r9), %rax
	movl	8(%rdi,%rax,4), %r10d
	cmpl	4(%rdi,%rax,4), %r10d
	jl	.LBB15_3
# %bb.4:                                # %.lr.ph
                                        #   in Loop: Header=BB15_2 Depth=1
	leaq	2(,%r9,2), %rax
	jmp	.LBB15_5
.LBB15_3:                               #   in Loop: Header=BB15_2 Depth=1
	leaq	1(,%r9,2), %rax
.LBB15_5:                               # %.lr.ph
                                        #   in Loop: Header=BB15_2 Depth=1
	movl	(%rdi,%rax,4), %r10d
	movl	%r10d, (%rdi,%r9,4)
	movq	%rax, %r9
	cmpq	%r8, %rax
	jl	.LBB15_2
.LBB15_6:                               # %._crit_edge
	testb	$1, %dl
	jne	.LBB15_9
# %bb.7:
	addq	$-2, %rdx
	sarq	%rdx
	cmpq	%rdx, %rax
	jne	.LBB15_9
# %bb.8:
	leaq	(%rax,%rax), %rdx
	movl	4(%rdi,%rdx,4), %edx
	movl	%edx, (%rdi,%rax,4)
	leaq	1(,%rax,2), %rax
.LBB15_9:
	cmpq	%rsi, %rax
	jle	.LBB15_10
.LBB15_11:                              # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	leaq	-1(%rax), %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	decq	%rdx
	sarq	%rdx
	movl	(%rdi,%rdx,4), %r8d
	cmpl	%ecx, %r8d
	jge	.LBB15_10
# %bb.12:                               #   in Loop: Header=BB15_11 Depth=1
	movl	%r8d, (%rdi,%rax,4)
	movq	%rdx, %rax
	cmpq	%rsi, %rdx
	jg	.LBB15_11
	jmp	.LBB15_13
.LBB15_10:
	movq	%rax, %rdx
.LBB15_13:                              # %_ZSt11__push_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops14_Iter_less_valEEvT_T0_SA_T1_RT2_.exit
	movl	%ecx, (%rdi,%rdx,4)
	retq
.Lfunc_end15:
	.size	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_, .Lfunc_end15-_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEliNS0_5__ops15_Iter_less_iterEEvT_T0_SA_T1_T2_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_S9_S9_T0_,"axG",@progbits,_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_S9_S9_T0_,comdat
	.weak	_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_S9_S9_T0_ # -- Begin function _ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_S9_S9_T0_
	.type	_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_S9_S9_T0_,@function
_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_S9_S9_T0_: # @_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_S9_S9_T0_
	.cfi_startproc
# %bb.0:
	movl	(%rsi), %r8d
	movl	(%rdx), %r9d
	movl	(%rcx), %eax
	cmpl	%r9d, %r8d
	jge	.LBB16_6
# %bb.1:
	cmpl	%eax, %r9d
	jge	.LBB16_3
# %bb.2:
	movl	(%rdi), %eax
	movl	%r9d, (%rdi)
	movl	%eax, (%rdx)
	retq
.LBB16_6:
	cmpl	%eax, %r8d
	jge	.LBB16_8
# %bb.7:
	movl	(%rdi), %eax
	movl	%r8d, (%rdi)
	movl	%eax, (%rsi)
	retq
.LBB16_3:
	movl	(%rdi), %edx
	cmpl	%eax, %r8d
	jge	.LBB16_5
# %bb.4:
	movl	%eax, (%rdi)
	movl	%edx, (%rcx)
	retq
.LBB16_8:
	movl	(%rdi), %esi
	cmpl	%eax, %r9d
	jge	.LBB16_10
# %bb.9:
	movl	%eax, (%rdi)
	movl	%esi, (%rcx)
	retq
.LBB16_5:
	movl	%r8d, (%rdi)
	movl	%edx, (%rsi)
	retq
.LBB16_10:
	movl	%r9d, (%rdi)
	movl	%esi, (%rdx)
	retq
.Lfunc_end16:
	.size	_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_S9_S9_T0_, .Lfunc_end16-_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_S9_S9_T0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_,"axG",@progbits,_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_,comdat
	.weak	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_ # -- Begin function _ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_
	.type	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_,@function
_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_: # @_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_
	.cfi_startproc
# %bb.0:
	cmpq	%rsi, %rdi
	je	.LBB17_14
# %bb.1:                                # %.preheader
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %rbx
	movq	%rdi, %r14
	leaq	4(%rdi), %rax
	cmpq	%rsi, %rax
	je	.LBB17_13
# %bb.2:                                # %.lr.ph
	movq	%r14, %r15
.LBB17_3:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB17_8 Depth 2
	movq	%r15, %rdi
	movq	%rax, %r15
	movl	4(%rdi), %ebp
	movl	(%r14), %ecx
	cmpl	%ecx, %ebp
	jge	.LBB17_6
# %bb.4:                                #   in Loop: Header=BB17_3 Depth=1
	movq	%r15, %rdx
	subq	%r14, %rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	cmpq	$2, %rax
	jl	.LBB17_10
# %bb.5:                                #   in Loop: Header=BB17_3 Depth=1
	shlq	$2, %rax
	subq	%rax, %rdi
	addq	$8, %rdi
	movq	%r14, %rsi
	callq	memmove@PLT
.LBB17_12:                              # %_ZSt13move_backwardIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEES6_ET0_T_S8_S7_.exit
                                        #   in Loop: Header=BB17_3 Depth=1
	movq	%r14, %rax
	jmp	.LBB17_9
.LBB17_6:                               #   in Loop: Header=BB17_3 Depth=1
	movl	(%rdi), %ecx
	movq	%r15, %rax
	cmpl	%ecx, %ebp
	jge	.LBB17_9
# %bb.7:                                # %.lr.ph.i.preheader
                                        #   in Loop: Header=BB17_3 Depth=1
	movq	%r15, %rax
.LBB17_8:                               # %.lr.ph.i
                                        #   Parent Loop BB17_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%ecx, (%rax)
	movl	-8(%rax), %ecx
	addq	$-4, %rax
	cmpl	%ecx, %ebp
	jl	.LBB17_8
.LBB17_9:                               # %_ZSt13move_backwardIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEES6_ET0_T_S8_S7_.exit
                                        #   in Loop: Header=BB17_3 Depth=1
	movl	%ebp, (%rax)
	leaq	4(%r15), %rax
	cmpq	%rbx, %rax
	jne	.LBB17_3
	jmp	.LBB17_13
.LBB17_10:                              #   in Loop: Header=BB17_3 Depth=1
	movq	%r14, %rax
	cmpq	$4, %rdx
	jne	.LBB17_9
# %bb.11:                               #   in Loop: Header=BB17_3 Depth=1
	movl	%ecx, 4(%rdi)
	jmp	.LBB17_12
.LBB17_13:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB17_14:                              # %.loopexit
	retq
.Lfunc_end17:
	.size	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_, .Lfunc_end17-_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEENS0_5__ops15_Iter_less_iterEEvT_S9_T0_
	.cfi_endproc
                                        # -- End function
	.text
	.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	.LBB18_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB18_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$naiveFilterKernel, %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	$_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %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_end18:
	.size	__hip_module_ctor, .Lfunc_end18-__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	.LBB19_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
.LBB19_2:
	retq
.Lfunc_end19:
	.size	__hip_module_dtor, .Lfunc_end19-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	naiveFilterKernel,@object       # @naiveFilterKernel
	.section	.rodata,"a",@progbits
	.globl	naiveFilterKernel
	.p2align	3, 0x0
naiveFilterKernel:
	.quad	__device_stub__naiveFilterKernel
	.size	naiveFilterKernel, 8

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Please input the trace file name:"
	.size	.L.str, 34

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"%s"
	.size	.L.str.1, 3

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

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

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Allocate memory for PA failed"
	.size	.L.str.6, 30

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Allocate memory for PA successfully"
	.size	.L.str.7, 36

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Initialized PA successfully!"
	.size	.L.str.8, 29

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Initilized index successfully"
	.size	.L.str.10, 30

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

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

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"Please input the start vertice as an interger number less than "
	.size	.L.str.13, 64

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

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

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"Please input a valid start vertice less than "
	.size	.L.str.16, 46

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"Please input the value of k as an interger number less than "
	.size	.L.str.17, 61

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"Please input a valid k less than "
	.size	.L.str.18, 34

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"CPU execution time is %.5f\n"
	.size	.L.str.19, 28

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"GPU execution time is %.5f\n"
	.size	.L.str.20, 28

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"Test passed ^^!"
	.size	.L.str.21, 16

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"Test failed !!"
	.size	.L.str.22, 15

	.type	.L.str.23,@object               # @.str.23
.L.str.23:
	.asciz	"The final Collaborative Filtering result is:"
	.size	.L.str.23, 45

	.type	.L.str.24,@object               # @.str.24
.L.str.24:
	.asciz	"vector::_M_realloc_insert"
	.size	.L.str.24, 26

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"naiveFilterKernel"
	.size	.L__unnamed_1, 18

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_"
	.size	.L__unnamed_2, 48

	.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	"Has open the trace successfully!"
	.size	.Lstr, 33

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"Has open the trace sucessfully!"
	.size	.Lstr.1, 32

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"Could not open the trace file!"
	.size	.Lstr.3, 31

	.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 __device_stub__naiveFilterKernel
	.addrsig_sym _Z31__device_stub__fullFilterKernelP13_Graph_node_APiS1_S1_S1_
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym naiveFilterKernel
	.addrsig_sym _Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	naiveFilterKernel       ; -- Begin function naiveFilterKernel
	.globl	naiveFilterKernel
	.p2align	8
	.type	naiveFilterKernel,@function
naiveFilterKernel:                      ; @naiveFilterKernel
; %bb.0:
	s_load_b256 s[0:7], s[0:1], 0x0
	s_mov_b32 s8, exec_lo
	v_cmpx_gt_u32_e32 0x190, v0
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_waitcnt lgkmcnt(0)
	s_load_b32 s9, s[4:5], 0x0
	v_lshlrev_b32_e32 v1, 2, v0
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s10, s9, 0x640
	s_mul_hi_i32 s9, s9, 0x640
	s_add_u32 s10, s0, s10
	s_addc_u32 s11, s1, s9
	global_load_b32 v2, v1, s[10:11] offset:-1600
	s_waitcnt vmcnt(0)
	ds_store_b32 v1, v2
.LBB0_2:
	s_or_b32 exec_lo, exec_lo, s8
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_load_b32 s4, s[4:5], 0x0
	s_waitcnt lgkmcnt(0)
	s_add_i32 s4, s4, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	v_cmp_ne_u32_e32 vcc_lo, s4, v0
	s_and_saveexec_b32 s4, vcc_lo
	s_cbranch_execz .LBB0_18
; %bb.3:
	s_load_b32 s4, s[6:7], 0x0
	s_waitcnt lgkmcnt(0)
	v_cmp_gt_i32_e32 vcc_lo, s4, v0
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB0_18
; %bb.4:                                ; %.preheader37
	v_mad_u64_u32 v[1:2], null, 0x640, v0, s[0:1]
	v_mov_b32_e32 v3, 0
	s_mov_b32 s1, 0
	s_mov_b32 s4, 0
	s_mov_b32 s0, s1
                                        ; implicit-def: $sgpr5
.LBB0_5:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	s_lshl_b64 s[6:7], s[0:1], 2
	s_or_b32 s5, s5, exec_lo
	v_add_co_u32 v4, vcc_lo, v1, s6
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v2, vcc_lo
	s_mov_b32 s6, exec_lo
	global_load_b32 v4, v[4:5], off
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u32_e32 0, v4
	s_cbranch_execz .LBB0_16
; %bb.6:                                ; %.preheader.preheader
                                        ;   in Loop: Header=BB0_5 Depth=1
	s_mov_b32 s7, 0
	s_mov_b32 s9, 0
                                        ; implicit-def: $sgpr8
                                        ; implicit-def: $sgpr11
                                        ; implicit-def: $sgpr10
.LBB0_7:                                ; %.preheader
                                        ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mov_b32_e32 v5, s9
	s_or_b32 s10, s10, exec_lo
	s_or_b32 s11, s11, exec_lo
	ds_load_b32 v5, v5
	s_waitcnt lgkmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, 0, v5
	s_cbranch_vccnz .LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	s_mov_b32 s11, -1
	s_mov_b32 s12, 0
	s_mov_b32 s13, exec_lo
	v_cmpx_ne_u32_e64 v4, v5
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	s_add_i32 s9, s9, 4
	s_mov_b32 s12, exec_lo
	s_cmpk_eq_i32 s9, 0x640
	s_cselect_b32 s11, -1, 0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_not1_b32 s11, s11, exec_lo
; %bb.10:                               ; %Flow53
                                        ;   in Loop: Header=BB0_7 Depth=2
	s_or_b32 exec_lo, exec_lo, s13
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s10, s10, exec_lo
	s_and_b32 s12, s12, exec_lo
	s_or_b32 s10, s10, s12
	s_branch .LBB0_12
.LBB0_11:                               ;   in Loop: Header=BB0_7 Depth=2
                                        ; implicit-def: $sgpr9
.LBB0_12:                               ; %Flow
                                        ;   in Loop: Header=BB0_7 Depth=2
	s_and_b32 s12, exec_lo, s11
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	s_or_b32 s7, s12, s7
	s_and_not1_b32 s8, s8, exec_lo
	s_and_b32 s12, s10, exec_lo
	s_or_b32 s8, s8, s12
	s_and_not1_b32 exec_lo, exec_lo, s7
	s_cbranch_execnz .LBB0_7
; %bb.13:                               ; %loop.exit.guard
                                        ;   in Loop: Header=BB0_5 Depth=1
	s_or_b32 exec_lo, exec_lo, s7
	s_xor_b32 s7, s8, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_saveexec_b32 s8, s7
	s_xor_b32 s7, exec_lo, s8
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	v_add_nc_u32_e32 v3, 1, v3
; %bb.15:                               ; %.critedge2
                                        ;   in Loop: Header=BB0_5 Depth=1
	s_or_b32 exec_lo, exec_lo, s7
	s_add_i32 s0, s0, 1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(SALU_CYCLE_1)
	s_cmpk_eq_i32 s0, 0x190
	s_cselect_b32 s7, -1, 0
	s_and_not1_b32 s5, s5, exec_lo
	s_and_b32 s7, s7, exec_lo
	s_or_b32 s5, s5, s7
.LBB0_16:                               ; %Flow54
                                        ;   in Loop: Header=BB0_5 Depth=1
	s_or_b32 exec_lo, exec_lo, s6
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s6, exec_lo, s5
	s_or_b32 s4, s6, s4
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s4
	s_cbranch_execnz .LBB0_5
; %bb.17:                               ; %.critedge
	s_or_b32 exec_lo, exec_lo, s4
	v_lshlrev_b32_e32 v0, 2, v0
	global_store_b32 v0, v3, s[2:3]
.LBB0_18:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel naiveFilterKernel
		.amdhsa_group_segment_fixed_size 1600
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 32
		.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 6
		.amdhsa_next_free_sgpr 14
		.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	naiveFilterKernel, .Lfunc_end0-naiveFilterKernel
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 496
; NumSgprs: 16
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 1600 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 16
; NumVGPRsForWavesPerEU: 6
; 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
	.protected	_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_ ; -- Begin function _Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_
	.globl	_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_
	.p2align	8
	.type	_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_,@function
_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_: ; @_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_
; %bb.0:
	s_load_b256 s[4:11], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_load_b32 s3, s[10:11], 0x0
	s_waitcnt lgkmcnt(0)
	s_cmp_ge_i32 s15, s3
	s_cbranch_scc1 .LBB1_22
; %bb.1:
	s_load_b64 s[0:1], s[0:1], 0x20
	s_waitcnt lgkmcnt(0)
	s_load_b32 s3, s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	v_cmp_gt_i32_e32 vcc_lo, s3, v0
	s_and_saveexec_b32 s3, vcc_lo
	s_cbranch_execz .LBB1_22
; %bb.2:
	s_mov_b32 s2, s15
	s_mov_b32 s3, exec_lo
	v_cmpx_lt_u32_e32 0x18f, v0
	s_xor_b32 s10, exec_lo, s3
                                        ; implicit-def: $vgpr2_vgpr3
; %bb.3:                                ; %._crit_edge
	v_mov_b32_e32 v3, 0
	s_ashr_i32 s3, s2, 31
; %bb.4:                                ; %Flow69
	s_or_saveexec_b32 s10, s10
	v_dual_mov_b32 v5, s3 :: v_dual_mov_b32 v4, s2
	s_xor_b32 exec_lo, exec_lo, s10
	s_cbranch_execz .LBB1_6
; %bb.5:
	s_ashr_i32 s3, s2, 31
	v_lshlrev_b32_e32 v1, 2, v0
	s_lshl_b64 s[12:13], s[2:3], 2
	v_dual_mov_b32 v5, s3 :: v_dual_mov_b32 v4, s2
	s_add_u32 s12, s8, s12
	s_addc_u32 s13, s9, s13
	v_mov_b32_e32 v3, 0
	s_load_b32 s11, s[12:13], 0x0
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s12, s11, 0x640
	s_mul_hi_i32 s11, s11, 0x640
	s_add_u32 s12, s4, s12
	s_addc_u32 s13, s5, s11
	global_load_b32 v2, v1, s[12:13] offset:-1600
	s_waitcnt vmcnt(0)
	ds_store_b32 v1, v2
.LBB1_6:
	s_or_b32 exec_lo, exec_lo, s10
	v_mad_u64_u32 v[1:2], null, 0x640, v0, s[4:5]
	v_lshlrev_b64 v[4:5], 2, v[4:5]
	s_mov_b32 s5, 0
	s_mov_b32 s3, 0
	s_mov_b32 s4, s5
	s_waitcnt lgkmcnt(0)
	s_barrier
	s_delay_alu instid0(VALU_DEP_2)
	v_mad_u64_u32 v[6:7], null, 0x640, v3, v[2:3]
	v_add_co_u32 v2, vcc_lo, s8, v4
	v_add_co_ci_u32_e32 v3, vcc_lo, s9, v5, vcc_lo
	buffer_gl0_inv
                                        ; implicit-def: $sgpr8
	v_dual_mov_b32 v4, 0 :: v_dual_mov_b32 v5, v6
.LBB1_7:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_9 Depth 2
	s_lshl_b64 s[10:11], s[4:5], 2
	s_or_b32 s8, s8, exec_lo
	v_add_co_u32 v6, vcc_lo, v1, s10
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v7, vcc_lo, s11, v5, vcc_lo
	s_mov_b32 s9, exec_lo
	global_load_b32 v6, v[6:7], off
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u32_e32 0, v6
	s_cbranch_execz .LBB1_20
; %bb.8:                                ; %.preheader.preheader
                                        ;   in Loop: Header=BB1_7 Depth=1
	s_mov_b32 s10, 0
	s_mov_b32 s12, 0
                                        ; implicit-def: $sgpr11
                                        ; implicit-def: $sgpr14
                                        ; implicit-def: $sgpr13
.LBB1_9:                                ; %.preheader
                                        ;   Parent Loop BB1_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mov_b32_e32 v7, s12
	s_or_b32 s13, s13, exec_lo
	s_or_b32 s14, s14, exec_lo
	ds_load_b32 v7, v7
	s_waitcnt lgkmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, 0, v7
	s_cbranch_vccnz .LBB1_15
; %bb.10:                               ;   in Loop: Header=BB1_9 Depth=2
	s_mov_b32 s14, -1
	s_mov_b32 s16, -1
	s_mov_b32 s15, -1
	s_mov_b32 s17, exec_lo
	v_cmpx_eq_u32_e64 v6, v7
	s_cbranch_execz .LBB1_12
; %bb.11:                               ;   in Loop: Header=BB1_9 Depth=2
	global_load_b32 v7, v[2:3], off
	s_xor_b32 s15, exec_lo, -1
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v7, -1, v7
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_eq_u32_e32 vcc_lo, v7, v0
	s_or_not1_b32 s16, vcc_lo, exec_lo
.LBB1_12:                               ; %Flow66
                                        ;   in Loop: Header=BB1_9 Depth=2
	s_or_b32 exec_lo, exec_lo, s17
	s_and_saveexec_b32 s17, s16
; %bb.13:                               ;   in Loop: Header=BB1_9 Depth=2
	s_add_i32 s12, s12, 4
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmpk_eq_i32 s12, 0x640
	s_cselect_b32 s14, -1, 0
	s_or_b32 s15, s15, exec_lo
	s_or_not1_b32 s14, s14, exec_lo
; %bb.14:                               ; %Flow67
                                        ;   in Loop: Header=BB1_9 Depth=2
	s_or_b32 exec_lo, exec_lo, s17
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s13, s13, exec_lo
	s_and_b32 s15, s15, exec_lo
	s_or_b32 s13, s13, s15
	s_branch .LBB1_16
.LBB1_15:                               ;   in Loop: Header=BB1_9 Depth=2
                                        ; implicit-def: $sgpr12
.LBB1_16:                               ; %Flow
                                        ;   in Loop: Header=BB1_9 Depth=2
	s_and_b32 s15, exec_lo, s14
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	s_or_b32 s10, s15, s10
	s_and_not1_b32 s11, s11, exec_lo
	s_and_b32 s15, s13, exec_lo
	s_or_b32 s11, s11, s15
	s_and_not1_b32 exec_lo, exec_lo, s10
	s_cbranch_execnz .LBB1_9
; %bb.17:                               ; %loop.exit.guard
                                        ;   in Loop: Header=BB1_7 Depth=1
	s_or_b32 exec_lo, exec_lo, s10
	s_xor_b32 s10, s11, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_saveexec_b32 s11, s10
	s_xor_b32 s10, exec_lo, s11
; %bb.18:                               ;   in Loop: Header=BB1_7 Depth=1
	v_add_nc_u32_e32 v4, 1, v4
; %bb.19:                               ; %.critedge2
                                        ;   in Loop: Header=BB1_7 Depth=1
	s_or_b32 exec_lo, exec_lo, s10
	s_add_i32 s4, s4, 1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(SALU_CYCLE_1)
	s_cmpk_eq_i32 s4, 0x190
	s_cselect_b32 s10, -1, 0
	s_and_not1_b32 s8, s8, exec_lo
	s_and_b32 s10, s10, exec_lo
	s_or_b32 s8, s8, s10
.LBB1_20:                               ; %Flow68
                                        ;   in Loop: Header=BB1_7 Depth=1
	s_or_b32 exec_lo, exec_lo, s9
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s9, exec_lo, s8
	s_or_b32 s3, s9, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB1_7
; %bb.21:                               ; %.critedge
	s_or_b32 exec_lo, exec_lo, s3
	s_load_b32 s0, s[0:1], 0x0
	s_add_i32 s1, s2, 1
	s_waitcnt lgkmcnt(0)
	v_mad_u64_u32 v[1:2], null, s0, s1, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v2, 31, v1
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	global_store_b32 v[0:1], v4, off
.LBB1_22:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_
		.amdhsa_group_segment_fixed_size 1600
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 40
		.amdhsa_user_sgpr_count 14
		.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 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 8
		.amdhsa_next_free_sgpr 18
		.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	_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_, .Lfunc_end1-_Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 696
; NumSgprs: 20
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 1600 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 20
; NumVGPRsForWavesPerEU: 8
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; 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
    .group_segment_fixed_size: 1600
    .kernarg_segment_align: 8
    .kernarg_segment_size: 32
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           naiveFilterKernel
    .private_segment_fixed_size: 0
    .sgpr_count:     16
    .sgpr_spill_count: 0
    .symbol:         naiveFilterKernel.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .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
    .group_segment_fixed_size: 1600
    .kernarg_segment_align: 8
    .kernarg_segment_size: 40
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_
    .private_segment_fixed_size: 0
    .sgpr_count:     20
    .sgpr_spill_count: 0
    .symbol:         _Z16fullFilterKernelP13_Graph_node_APiS1_S1_S1_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
