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

#include <algorithm>
#include <vector>

using namespace std;


#define CUDA_CHECK(cmd) {\
	cudaError_t err = cmd; \
	if(err != cudaSuccess) fprintf(stderr, "Error in %s (%d) - Name: %s - String: %s\n", __FILE__, __LINE__, cudaGetErrorName(err), cudaGetErrorString(err)); \
}


#define GET_CLOCK(t) if(clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t) != 0) {fprintf(stderr, "%s (%d): Error in timer.\n", __FILE__, __LINE__); exit(1);}
#define COMPUTE_DELTA_T(diff, t2, t1) diff = (t2.tv_sec - t1.tv_sec) * 1E9 + (t2.tv_nsec - t1.tv_nsec);


#ifdef PINNED
#define CUDA_ALLOC cudaMallocHost
#define CUDA_FREE cudaFreeHost
#else
#define CUDA_ALLOC cudaMalloc
#define CUDA_FREE cudaFree
#endif




bool cmpfunc (double a, double b) { return a < b; }



void measure_data_transfer(int NumberOfDoubleValuesAsVector, int NumberOfVectors, int InnerIterationCount, int OuterIterationCount, 
		vector<double> *timings_h2d, vector<double> *timings_d2h) {


	int sz = sizeof(double) * NumberOfDoubleValuesAsVector;

	struct timespec t1, t2;
	double diff;



	double **data_host;
	data_host = (double **) malloc(sizeof(double*) * NumberOfVectors);

	double **data_device;
	data_device = (double **) malloc(sizeof(double*) * NumberOfVectors);

	for(int i=0;i<NumberOfVectors;i++) {
		data_host[i] = (double *) malloc(sz);
	}

	// Allocation on GPU
	for(int i=0;i<NumberOfVectors;i++) {
		double *d;
		CUDA_CHECK(CUDA_ALLOC((void**)&d, sz));
		data_device[i] = d;
	}



	for(int q=0;q < OuterIterationCount; q++) {


		GET_CLOCK(t1);
		// Host to device
		for(int i=0;i<InnerIterationCount;i++) {
			CUDA_CHECK(cudaMemcpy(data_device[i % NumberOfVectors], data_host[i % NumberOfVectors], sz, cudaMemcpyHostToDevice));
			CUDA_CHECK(cudaDeviceSynchronize());
		}
		GET_CLOCK(t2);
		COMPUTE_DELTA_T(diff, t2, t1);
		timings_h2d->push_back(diff / InnerIterationCount);



		GET_CLOCK(t1);
		// Device to host
		for(int i=0;i<InnerIterationCount;i++) {
			CUDA_CHECK(cudaMemcpy(data_host[i % NumberOfVectors], data_device[i % NumberOfVectors], sz, cudaMemcpyDeviceToHost));
			CUDA_CHECK(cudaDeviceSynchronize());
		}
		GET_CLOCK(t2);
		COMPUTE_DELTA_T(diff, t2, t1);
		timings_d2h->push_back(diff / InnerIterationCount);


	}	



	for(int i=0;i<NumberOfVectors;i++) {
		free(data_host[i]);
		CUDA_FREE(data_device[i]);
	}

	free(data_host);
	free(data_device);


}

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

	if(argc < 5) {
		fprintf(stderr, "Usage: %s <NumberOfDoubleValuesAsVector> <NumberOfVectors> <InnerIterationCount> <OuterIterationCount>\n", argv[0]);
		return 1;
	}

	int NumberOfDoubleValuesAsVector = atoi(argv[1]);
	int NumberOfVectors = atoi(argv[2]);
	int InnerIterationCount = atoi(argv[3]);
	int OuterIterationCount = atoi(argv[4]);

	if(NumberOfVectors < 2) {
		fprintf(stderr, "Unacceptable value for <NumberOfVectors> parameter.\n");
		return 1;
	}

	printf("\n\n");
	printf("------------------------\n");
	printf("NumberOfDoubleValuesAsVector: %d\n", NumberOfDoubleValuesAsVector);
	printf("NumberOfVectors: %d\n", NumberOfVectors);
	printf("InnerIterationCount: %d\n", InnerIterationCount);
	printf("OuterIterationCount: %d\n", OuterIterationCount);
	printf("------------------------\n");
	printf("\n\n");

	// double *timings_h2d = (double*) malloc(sizeof(double) * NumberOfVectors);
	// double *timings_d2h = (double*) malloc(sizeof(double) * NumberOfVectors);
	vector<double> timings_d2h, timings_h2d;

	fprintf(stderr, "Warmup...\n");
	measure_data_transfer(NumberOfDoubleValuesAsVector, NumberOfVectors, 5, 5, &timings_h2d, &timings_d2h)	;
	fprintf(stderr, "Warmup...Done\n");

	timings_h2d.clear();
	timings_d2h.clear();


	fprintf(stderr, "Main operations...\n");
	measure_data_transfer(NumberOfDoubleValuesAsVector, NumberOfVectors, InnerIterationCount, OuterIterationCount, &timings_h2d, &timings_d2h)	;
	fprintf(stderr, "Main operations...Done\n");


	sort(timings_h2d.begin(), timings_h2d.end(), cmpfunc);
	sort(timings_d2h.begin(), timings_d2h.end(), cmpfunc);


	double t_h2d, t_d2h;
	if(NumberOfVectors % 2 == 1) {
		t_h2d = timings_h2d[NumberOfVectors/2];
		t_d2h = timings_d2h[NumberOfVectors/2];
	} else {
		t_h2d = timings_h2d[NumberOfVectors/2];
		t_h2d += timings_h2d[NumberOfVectors/2 - 1];
		t_h2d /= 2;

		t_d2h = timings_d2h[NumberOfVectors/2];
		t_d2h += timings_d2h[NumberOfVectors/2 - 1];
		t_d2h /= 2;
	}

	int sz = NumberOfDoubleValuesAsVector * sizeof(double);

	printf("\n\nResults:\n");
	printf("========================\n");
	printf("Vector size: %d Bytes\n", sz);
	printf("========================\n");

	printf("H2D median: %.2fus\n", t_h2d / 1E3);
	printf("D2H median: %.2fus\n", t_d2h / 1E3);

	printf("------------------------\n");

	printf("H2D median: %.2fms\n", t_h2d / 1E6);
	printf("D2H median: %.2fms\n", t_d2h / 1E6);

	printf("------------------------\n");

	printf("csv_output,%dB,%.2fKB,%.2fMB,%.2fGB,%.2fus,%.2fus\n", sz, 1.0*sz/1024, 1.0*sz/(1024*1024), 1.0*sz/(1024*1024*1024), t_h2d / 1E3, t_d2h / 1E3);

	printf("------------------------\n");

	return 0;
}

	.file	"tmpxft_0023873f_00000000-6_bw.cudafe1.cpp"
	.text
#APP

#NO_APP
	.globl	_Z7cmpfuncdd
	.type	_Z7cmpfuncdd, @function
_Z7cmpfuncdd:
.LFB3150:
	.cfi_startproc
	endbr64
	comisd	%xmm0, %xmm1
	seta	%al
	ret
	.cfi_endproc
.LFE3150:
	.size	_Z7cmpfuncdd, .-_Z7cmpfuncdd
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3166:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3166:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZN9__gnu_cxx5__ops15_Iter_comp_iterIPFbddEEclINS_17__normal_iteratorIPdSt6vectorIdSaIdEEEESB_EEbT_T0_.isra.0, @function
_ZN9__gnu_cxx5__ops15_Iter_comp_iterIPFbddEEclINS_17__normal_iteratorIPdSt6vectorIdSaIdEEEESB_EEbT_T0_.isra.0:
.LFB3435:
	.cfi_startproc
	movsd	(%rdx), %xmm1
	movsd	(%rsi), %xmm0
	jmp	*%rdi
	.cfi_endproc
.LFE3435:
	.size	_ZN9__gnu_cxx5__ops15_Iter_comp_iterIPFbddEEclINS_17__normal_iteratorIPdSt6vectorIdSaIdEEEESB_EEbT_T0_.isra.0, .-_ZN9__gnu_cxx5__ops15_Iter_comp_iterIPFbddEEclINS_17__normal_iteratorIPdSt6vectorIdSaIdEEEESB_EEbT_T0_.isra.0
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3189:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3189:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIdSaIdEED2Ev,"axG",@progbits,_ZNSt6vectorIdSaIdEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIdSaIdEED2Ev
	.type	_ZNSt6vectorIdSaIdEED2Ev, @function
_ZNSt6vectorIdSaIdEED2Ev:
.LFB3248:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L6
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L6:
	ret
	.cfi_endproc
.LFE3248:
	.size	_ZNSt6vectorIdSaIdEED2Ev, .-_ZNSt6vectorIdSaIdEED2Ev
	.weak	_ZNSt6vectorIdSaIdEED1Ev
	.set	_ZNSt6vectorIdSaIdEED1Ev,_ZNSt6vectorIdSaIdEED2Ev
	.section	.rodata._ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_.str1.1,"aMS",@progbits,1
.LC0:
	.string	"vector::_M_realloc_insert"
	.section	.text._ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_,comdat
	.align 2
	.weak	_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_
	.type	_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_, @function
_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_:
.LFB3337:
	.cfi_startproc
	endbr64
	movabsq	$1152921504606846975, %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	$3, %rbx
	cmpq	%rcx, %rbx
	jne	.L10
	leaq	.LC0(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L10:
	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	.L20
	xorl	%r12d, %r12d
	testq	%rbx, %rbx
	je	.L15
	movabsq	$1152921504606846975, %rax
	cmpq	%rax, %rbx
	cmova	%rax, %rbx
	jmp	.L14
.L20:
	movq	%rcx, %rbx
.L14:
	leaq	0(,%rbx,8), %rdi
	movq	%rdx, 8(%rsp)
	call	_Znwm@PLT
	movq	8(%rsp), %rdx
	movq	%rax, %r12
.L15:
	movsd	(%rdx), %xmm0
	movsd	%xmm0, (%r12,%r15)
	testq	%r15, %r15
	jle	.L16
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	memmove@PLT
.L16:
	movq	(%rsp), %rax
	leaq	8(%r12,%r15), %rdx
	subq	%rbp, %rax
	testq	%rax, %rax
	jle	.L17
	movq	%rdx, %rdi
	movq	%rbp, %rsi
	movq	%rax, %rcx
	rep movsb
.L17:
	leaq	(%rdx,%rax), %rbp
	testq	%r14, %r14
	je	.L18
	movq	16(%r13), %rsi
	movq	%r14, %rdi
	subq	%r14, %rsi
	call	_ZdlPvm@PLT
.L18:
	leaq	(%r12,%rbx,8), %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
.LFE3337:
	.size	_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_, .-_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_
	.text
	.align 2
	.type	_ZNSt6vectorIdSaIdEE12emplace_backIJdEEERdDpOT_.isra.0, @function
_ZNSt6vectorIdSaIdEE12emplace_backIJdEEERdDpOT_.isra.0:
.LFB3443:
	.cfi_startproc
	movq	%rsi, %rdx
	movq	8(%rdi), %rsi
	cmpq	16(%rdi), %rsi
	je	.L28
	movsd	(%rdx), %xmm0
	addq	$8, %rsi
	movsd	%xmm0, -8(%rsi)
	movq	%rsi, 8(%rdi)
	ret
.L28:
	jmp	_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_
	.cfi_endproc
.LFE3443:
	.size	_ZNSt6vectorIdSaIdEE12emplace_backIJdEEERdDpOT_.isra.0, .-_ZNSt6vectorIdSaIdEE12emplace_backIJdEEERdDpOT_.isra.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/milladgit/cuda-bandwidth/master/bw.cu"
.LC2:
	.string	"Error in %s (%d) - Name: %s - String: %s\n"
.LC3:
	.string	"%s (%d): Error in timer.\n"
	.text
	.globl	_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_
	.type	_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_, @function
_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_:
.LFB3151:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%edx, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movslq	%esi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leal	0(,%rdi,8), %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r12, %rbx
	salq	$3, %r12
	movq	%r12, %rdi
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movl	%ecx, 40(%rsp)
	movq	%r8, 16(%rsp)
	movq	%r9, 24(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	call	malloc@PLT
	movq	%r12, %rdi
	movq	%rax, %r13
	call	malloc@PLT
	movq	%rax, %r12
	movslq	%ebp, %rax
	movq	%rax, (%rsp)
.L32:
	cmpl	%r15d, %ebx
	jle	.L72
	movq	(%rsp), %rdi
	call	malloc@PLT
	movq	%rax, 0(%r13,%r15,8)
	incq	%r15
	jmp	.L32
.L72:
	movslq	%ebp, %rax
	xorl	%r15d, %r15d
	movq	%rax, (%rsp)
.L34:
	cmpl	%r15d, %ebx
	jle	.L73
	movq	(%rsp), %rsi
	leaq	72(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L35
	movl	%eax, 32(%rsp)
	call	cudaGetErrorString@PLT
	movl	32(%rsp), %edi
	movq	%rax, 8(%rsp)
	call	cudaGetErrorName@PLT
	movl	$2, %esi
	movq	stderr(%rip), %rdi
	movl	$62, %r8d
	pushq	%rcx
	.cfi_def_cfa_offset 168
	movq	16(%rsp), %rdx
	movq	%rax, %r9
	leaq	.LC1(%rip), %rcx
	xorl	%eax, %eax
	pushq	%rdx
	.cfi_def_cfa_offset 176
	leaq	.LC2(%rip), %rdx
	call	__fprintf_chk@PLT
	popq	%rsi
	.cfi_def_cfa_offset 168
	popq	%rdi
	.cfi_def_cfa_offset 160
.L35:
	movq	72(%rsp), %rax
	movq	%rax, (%r12,%r15,8)
	incq	%r15
	jmp	.L34
.L73:
	movslq	%ebp, %rax
	xorl	%r15d, %r15d
	movq	%rax, 8(%rsp)
.L37:
	movl	40(%rsp), %eax
	cmpl	%eax, %r15d
	jge	.L74
	leaq	56(%rsp), %rsi
	movl	$2, %edi
	call	clock_gettime@PLT
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L38
	movl	$71, %r8d
	jmp	.L71
.L41:
	movl	%ebp, %eax
	movl	$1, %ecx
	cltd
	idivl	%ebx
	movslq	%edx, %rdx
	movq	(%r12,%rdx,8), %rdi
	movq	0(%r13,%rdx,8), %rsi
	movq	8(%rsp), %rdx
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L39
	movl	%eax, 32(%rsp)
	call	cudaGetErrorString@PLT
	movl	32(%rsp), %edi
	movq	%rax, (%rsp)
	call	cudaGetErrorName@PLT
	movl	$74, %r8d
	movl	$2, %esi
	movq	stderr(%rip), %rdi
	movq	%rax, %r9
	pushq	%rax
	.cfi_def_cfa_offset 168
	movq	8(%rsp), %rdx
	leaq	.LC1(%rip), %rcx
	xorl	%eax, %eax
	pushq	%rdx
	.cfi_def_cfa_offset 176
	leaq	.LC2(%rip), %rdx
	call	__fprintf_chk@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L39:
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L40
	movl	%eax, 32(%rsp)
	call	cudaGetErrorString@PLT
	movl	32(%rsp), %edi
	movq	%rax, (%rsp)
	call	cudaGetErrorName@PLT
	movl	$75, %r8d
	movl	$2, %esi
	movq	stderr(%rip), %rdi
	pushq	%r10
	.cfi_def_cfa_offset 168
	movq	8(%rsp), %rdx
	movq	%rax, %r9
	leaq	.LC1(%rip), %rcx
	xorl	%eax, %eax
	pushq	%rdx
	.cfi_def_cfa_offset 176
	leaq	.LC2(%rip), %rdx
	call	__fprintf_chk@PLT
	popq	%r11
	.cfi_def_cfa_offset 168
	popq	%rax
	.cfi_def_cfa_offset 160
.L40:
	incl	%ebp
.L38:
	cmpl	%r14d, %ebp
	jl	.L41
	leaq	72(%rsp), %rsi
	movl	$2, %edi
	call	clock_gettime@PLT
	testl	%eax, %eax
	je	.L42
	movl	$77, %r8d
.L71:
	movq	stderr(%rip), %rdi
	leaq	.LC1(%rip), %rcx
	leaq	.LC3(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	call	__fprintf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L42:
	movq	72(%rsp), %rax
	subq	56(%rsp), %rax
	cvtsi2sdl	%r14d, %xmm2
	leaq	48(%rsp), %rsi
	cvtsi2sdq	%rax, %xmm0
	movq	80(%rsp), %rax
	subq	64(%rsp), %rax
	mulsd	.LC4(%rip), %xmm0
	cvtsi2sdq	%rax, %xmm1
	movq	16(%rsp), %rdi
	movsd	%xmm2, (%rsp)
	addsd	%xmm1, %xmm0
	divsd	%xmm2, %xmm0
	movsd	%xmm0, 48(%rsp)
	call	_ZNSt6vectorIdSaIdEE12emplace_backIJdEEERdDpOT_.isra.0
	leaq	56(%rsp), %rsi
	movl	$2, %edi
	call	clock_gettime@PLT
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L43
	movl	$83, %r8d
	jmp	.L71
.L46:
	movl	%ebp, %eax
	movl	$2, %ecx
	cltd
	idivl	%ebx
	movslq	%edx, %rdx
	movq	0(%r13,%rdx,8), %rdi
	movq	(%r12,%rdx,8), %rsi
	movq	8(%rsp), %rdx
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L44
	movl	%eax, 44(%rsp)
	call	cudaGetErrorString@PLT
	movl	44(%rsp), %edi
	movq	%rax, 32(%rsp)
	call	cudaGetErrorName@PLT
	movq	stderr(%rip), %rdi
	movl	$86, %r8d
	leaq	.LC1(%rip), %rcx
	pushq	%rsi
	.cfi_def_cfa_offset 168
	movq	40(%rsp), %rdx
	movq	%rax, %r9
	movl	$2, %esi
	xorl	%eax, %eax
	pushq	%rdx
	.cfi_def_cfa_offset 176
	leaq	.LC2(%rip), %rdx
	call	__fprintf_chk@PLT
	popq	%rdi
	.cfi_def_cfa_offset 168
	popq	%r8
	.cfi_def_cfa_offset 160
.L44:
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L45
	movl	%eax, 44(%rsp)
	call	cudaGetErrorString@PLT
	movl	44(%rsp), %edi
	movq	%rax, 32(%rsp)
	call	cudaGetErrorName@PLT
	movl	$87, %r8d
	movl	$2, %esi
	movq	stderr(%rip), %rdi
	movq	%rax, %r9
	pushq	%rax
	.cfi_def_cfa_offset 168
	movq	40(%rsp), %rdx
	leaq	.LC1(%rip), %rcx
	xorl	%eax, %eax
	pushq	%rdx
	.cfi_def_cfa_offset 176
	leaq	.LC2(%rip), %rdx
	call	__fprintf_chk@PLT
	popq	%rdx
	.cfi_def_cfa_offset 168
	popq	%rcx
	.cfi_def_cfa_offset 160
.L45:
	incl	%ebp
.L43:
	cmpl	%r14d, %ebp
	jl	.L46
	leaq	72(%rsp), %rsi
	movl	$2, %edi
	call	clock_gettime@PLT
	testl	%eax, %eax
	je	.L47
	movl	$89, %r8d
	jmp	.L71
.L47:
	movq	72(%rsp), %rax
	subq	56(%rsp), %rax
	leaq	48(%rsp), %rsi
	incl	%r15d
	cvtsi2sdq	%rax, %xmm0
	movq	80(%rsp), %rax
	subq	64(%rsp), %rax
	mulsd	.LC4(%rip), %xmm0
	cvtsi2sdq	%rax, %xmm1
	movq	24(%rsp), %rdi
	addsd	%xmm1, %xmm0
	divsd	(%rsp), %xmm0
	movsd	%xmm0, 48(%rsp)
	call	_ZNSt6vectorIdSaIdEE12emplace_backIJdEEERdDpOT_.isra.0
	jmp	.L37
.L74:
	xorl	%ebp, %ebp
.L49:
	cmpl	%ebp, %ebx
	jle	.L75
	movq	0(%r13,%rbp,8), %rdi
	call	free@PLT
	movq	(%r12,%rbp,8), %rdi
	incq	%rbp
	call	cudaFree@PLT
	jmp	.L49
.L75:
	movq	%r13, %rdi
	call	free@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L51
	call	__stack_chk_fail@PLT
.L51:
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	movq	%r12, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE3151:
	.size	_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_, .-_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_
	.section	.text._ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_,"axG",@progbits,_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_,comdat
	.weak	_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_
	.type	_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_, @function
_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_:
.LFB3391:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%r8, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdi, %rbx
	movq	%r8, %rdi
	call	_ZN9__gnu_cxx5__ops15_Iter_comp_iterIPFbddEEclINS_17__normal_iteratorIPdSt6vectorIdSaIdEEEESB_EEbT_T0_.isra.0
	movq	%rbp, %rdx
	testb	%al, %al
	je	.L77
	movq	%r12, %rsi
	movq	%r14, %rdi
	call	_ZN9__gnu_cxx5__ops15_Iter_comp_iterIPFbddEEclINS_17__normal_iteratorIPdSt6vectorIdSaIdEEEESB_EEbT_T0_.isra.0
	testb	%al, %al
	je	.L78
	movsd	(%rbx), %xmm0
	jmp	.L82
.L78:
	movq	%rbp, %rdx
	movq	%r13, %rsi
	movq	%r14, %rdi
	call	_ZN9__gnu_cxx5__ops15_Iter_comp_iterIPFbddEEclINS_17__normal_iteratorIPdSt6vectorIdSaIdEEEESB_EEbT_T0_.isra.0
	movsd	(%rbx), %xmm0
	testb	%al, %al
	je	.L85
	jmp	.L84
.L77:
	movq	%r13, %rsi
	movq	%r14, %rdi
	call	_ZN9__gnu_cxx5__ops15_Iter_comp_iterIPFbddEEclINS_17__normal_iteratorIPdSt6vectorIdSaIdEEEESB_EEbT_T0_.isra.0
	testb	%al, %al
	je	.L81
	movsd	(%rbx), %xmm0
.L85:
	movsd	0(%r13), %xmm1
	movsd	%xmm1, (%rbx)
	movsd	%xmm0, 0(%r13)
	jmp	.L76
.L81:
	movq	%rbp, %rdx
	movq	%r12, %rsi
	movq	%r14, %rdi
	call	_ZN9__gnu_cxx5__ops15_Iter_comp_iterIPFbddEEclINS_17__normal_iteratorIPdSt6vectorIdSaIdEEEESB_EEbT_T0_.isra.0
	movsd	(%rbx), %xmm0
	testb	%al, %al
	je	.L82
.L84:
	movsd	0(%rbp), %xmm1
	movsd	%xmm1, (%rbx)
	movsd	%xmm0, 0(%rbp)
	jmp	.L76
.L82:
	movsd	(%r12), %xmm1
	movsd	%xmm1, (%rbx)
	movsd	%xmm0, (%r12)
.L76:
	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
.LFE3391:
	.size	_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_, .-_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_
	.section	.text._ZSt25__unguarded_linear_insertIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops14_Val_comp_iterIPFbddEEEEvT_T0_,"axG",@progbits,_ZSt25__unguarded_linear_insertIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops14_Val_comp_iterIPFbddEEEEvT_T0_,comdat
	.weak	_ZSt25__unguarded_linear_insertIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops14_Val_comp_iterIPFbddEEEEvT_T0_
	.type	_ZSt25__unguarded_linear_insertIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops14_Val_comp_iterIPFbddEEEEvT_T0_, @function
_ZSt25__unguarded_linear_insertIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops14_Val_comp_iterIPFbddEEEEvT_T0_:
.LFB3398:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movsd	(%rdi), %xmm0
.L87:
	movsd	-8(%rbx), %xmm1
	movsd	%xmm0, 8(%rsp)
	movq	%rbx, %r12
	subq	$8, %rbx
	call	*%rbp
	movsd	8(%rsp), %xmm0
	testb	%al, %al
	je	.L90
	movsd	(%rbx), %xmm1
	movsd	%xmm1, 8(%rbx)
	jmp	.L87
.L90:
	movsd	%xmm0, (%r12)
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3398:
	.size	_ZSt25__unguarded_linear_insertIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops14_Val_comp_iterIPFbddEEEEvT_T0_, .-_ZSt25__unguarded_linear_insertIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops14_Val_comp_iterIPFbddEEEEvT_T0_
	.section	.text._ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_,"axG",@progbits,_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_,comdat
	.weak	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_
	.type	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_, @function
_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_:
.LFB3380:
	.cfi_startproc
	endbr64
	cmpq	%rdi, %rsi
	jne	.L101
	ret
.L101:
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$8, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rdx, %r13
	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	8(%rdi), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
.L93:
	cmpq	%rbx, %r12
	je	.L105
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	call	_ZN9__gnu_cxx5__ops15_Iter_comp_iterIPFbddEEclINS_17__normal_iteratorIPdSt6vectorIdSaIdEEEESB_EEbT_T0_.isra.0
	testb	%al, %al
	je	.L94
	movq	%rbx, %rdx
	movsd	(%rbx), %xmm0
	subq	%rbp, %rdx
	cmpq	$8, %rdx
	jle	.L95
	movq	%r14, %rdi
	movq	%rbp, %rsi
	movsd	%xmm0, 8(%rsp)
	subq	%rdx, %rdi
	addq	%rbx, %rdi
	call	memmove@PLT
	movsd	8(%rsp), %xmm0
	jmp	.L96
.L95:
	jne	.L96
	movsd	0(%rbp), %xmm1
	movsd	%xmm1, (%rbx)
.L96:
	movsd	%xmm0, 0(%rbp)
	jmp	.L97
.L94:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	call	_ZSt25__unguarded_linear_insertIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops14_Val_comp_iterIPFbddEEEEvT_T0_
.L97:
	addq	$8, %rbx
	jmp	.L93
.L105:
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	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
.LFE3380:
	.size	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_, .-_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_
	.section	.text._ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_,"axG",@progbits,_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_,comdat
	.weak	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_
	.type	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_, @function
_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_:
.LFB3419:
	.cfi_startproc
	endbr64
	leaq	-1(%rdx), %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movaps	%xmm0, %xmm1
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rsi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rcx, %r13
	movl	$2, %ecx
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdx, %r12
	cqto
	idivq	%rcx
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rdi, %rbp
	movq	%rsi, %rbx
	movq	%rax, 8(%rsp)
.L107:
	cmpq	%rbx, 8(%rsp)
	jle	.L118
	leaq	1(%rbx), %rcx
	movq	%r13, %rdi
	movsd	%xmm1, 24(%rsp)
	addq	%rcx, %rcx
	leaq	-1(%rcx), %r15
	leaq	0(%rbp,%rcx,8), %rsi
	movq	%rcx, 16(%rsp)
	leaq	0(%rbp,%r15,8), %rdx
	call	_ZN9__gnu_cxx5__ops15_Iter_comp_iterIPFbddEEclINS_17__normal_iteratorIPdSt6vectorIdSaIdEEEESB_EEbT_T0_.isra.0
	movq	16(%rsp), %rcx
	movsd	24(%rsp), %xmm1
	testb	%al, %al
	cmove	%rcx, %r15
	movsd	0(%rbp,%r15,8), %xmm0
	movsd	%xmm0, 0(%rbp,%rbx,8)
	movq	%r15, %rbx
	jmp	.L107
.L118:
	testl	$1, %r12d
	jne	.L110
	leaq	-2(%r12), %rax
	movl	$2, %ecx
	cqto
	idivq	%rcx
	cmpq	%rbx, %rax
	jne	.L110
	leaq	1(%rbx,%rbx), %rax
	movsd	0(%rbp,%rax,8), %xmm0
	movsd	%xmm0, 0(%rbp,%rbx,8)
	movq	%rax, %rbx
.L110:
	leaq	-1(%rbx), %rax
	movl	$2, %ecx
	cqto
	idivq	%rcx
.L117:
	movq	%rax, %r12
	leaq	0(%rbp,%rbx,8), %r15
	cmpq	%rbx, %r14
	jge	.L111
	leaq	0(%rbp,%rax,8), %rbx
	movsd	%xmm1, 8(%rsp)
	movsd	(%rbx), %xmm0
	call	*%r13
	movsd	8(%rsp), %xmm1
	testb	%al, %al
	je	.L111
	movsd	(%rbx), %xmm0
	leaq	-1(%r12), %rax
	movl	$2, %edi
	movq	%r12, %rbx
	cqto
	idivq	%rdi
	movsd	%xmm0, (%r15)
	jmp	.L117
.L111:
	movsd	%xmm1, (%r15)
	addq	$40, %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
.LFE3419:
	.size	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_, .-_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_
	.section	.text._ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_,"axG",@progbits,_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_,comdat
	.weak	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_
	.type	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_, @function
_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_:
.LFB3354:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	8(%rdi), %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%rcx, (%rsp)
	movq	%rax, 8(%rsp)
.L120:
	movq	%rbx, %rax
	subq	%rbp, %rax
	cmpq	$128, %rax
	jle	.L119
	movq	%rax, %r13
	sarq	$3, %r13
	testq	%r14, %r14
	jne	.L121
	leaq	-2(%r13), %r14
	sarq	%r14
.L123:
	movsd	0(%rbp,%r14,8), %xmm0
	movq	%r13, %rdx
	movq	%r14, %rsi
	movq	%rbp, %rdi
	movq	(%rsp), %rcx
	call	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_
	testq	%r14, %r14
	je	.L124
	decq	%r14
	jmp	.L123
.L124:
	movq	%rbx, %rax
	subq	$8, %rbx
	subq	%rbp, %rax
	cmpq	$8, %rax
	jle	.L119
	movsd	0(%rbp), %xmm1
	movq	%rbx, %rdx
	movsd	(%rbx), %xmm0
	xorl	%esi, %esi
	subq	%rbp, %rdx
	movq	(%rsp), %rcx
	movq	%rbp, %rdi
	movsd	%xmm1, (%rbx)
	sarq	$3, %rdx
	call	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_
	jmp	.L124
.L121:
	movq	8(%rsp), %r13
	sarq	$4, %rax
	movq	(%rsp), %r8
	movq	%rbp, %rdi
	leaq	0(%rbp,%rax,8), %rdx
	leaq	-8(%rbx), %rcx
	movq	%rbx, %r12
	movq	%r13, %rsi
	call	_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_
.L130:
	movq	%r13, %rax
.L127:
	movq	(%rsp), %rdi
	movq	%rbp, %rdx
	movq	%rax, %rsi
	movq	%rax, %r13
	call	_ZN9__gnu_cxx5__ops15_Iter_comp_iterIPFbddEEclINS_17__normal_iteratorIPdSt6vectorIdSaIdEEEESB_EEbT_T0_.isra.0
	movl	%eax, %edx
	leaq	8(%r13), %rax
	testb	%dl, %dl
	jne	.L127
	leaq	-8(%r12), %r15
.L128:
	movq	(%rsp), %rdi
	movq	%r15, %rdx
	movq	%rbp, %rsi
	movq	%r15, %r12
	subq	$8, %r15
	call	_ZN9__gnu_cxx5__ops15_Iter_comp_iterIPFbddEEclINS_17__normal_iteratorIPdSt6vectorIdSaIdEEEESB_EEbT_T0_.isra.0
	testb	%al, %al
	jne	.L128
	cmpq	%r12, %r13
	jb	.L129
	movq	(%rsp), %rcx
	decq	%r14
	movq	%rbx, %rsi
	movq	%r13, %rdi
	movq	%r14, %rdx
	movq	%r13, %rbx
	call	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_
	jmp	.L120
.L129:
	movsd	0(%r13), %xmm0
	movsd	(%r12), %xmm1
	addq	$8, %r13
	movsd	%xmm1, -8(%r13)
	movsd	%xmm0, (%r12)
	jmp	.L130
.L119:
	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
.LFE3354:
	.size	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_, .-_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_
	.section	.text._ZSt4sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEPFbddEEvT_S9_T0_,"axG",@progbits,_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEPFbddEEvT_S9_T0_,comdat
	.weak	_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEPFbddEEvT_S9_T0_
	.type	_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEPFbddEEvT_S9_T0_, @function
_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEPFbddEEvT_S9_T0_:
.LFB3253:
	.cfi_startproc
	endbr64
	cmpq	%rdi, %rsi
	je	.L144
	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
	subq	%rdi, %r12
	movq	%rdx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%r12, %rax
	movq	%rbp, %rcx
	movq	%rsi, %rbx
	sarq	$3, %rax
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	bsrq	%rax, %rdx
	xorq	$63, %rdx
	testq	%rax, %rax
	movl	$64, %eax
	movq	%rdi, 8(%rsp)
	cmovne	%edx, %eax
	movl	$63, %edx
	subl	%eax, %edx
	movslq	%edx, %rdx
	addq	%rdx, %rdx
	call	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_
	cmpq	$128, %r12
	movq	8(%rsp), %rdi
	jle	.L138
	leaq	128(%rdi), %r12
	movq	%rbp, %rdx
	movq	%r12, %rsi
	call	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_
.L139:
	cmpq	%rbx, %r12
	je	.L147
	movq	%r12, %rdi
	movq	%rbp, %rsi
	addq	$8, %r12
	call	_ZSt25__unguarded_linear_insertIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops14_Val_comp_iterIPFbddEEEEvT_T0_
	jmp	.L139
.L138:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_restore 12
	.cfi_def_cfa_offset 8
	jmp	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_
.L147:
	.cfi_restore_state
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L144:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	ret
	.cfi_endproc
.LFE3253:
	.size	_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEPFbddEEvT_S9_T0_, .-_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEPFbddEEvT_S9_T0_
	.section	.rodata.str1.1
.LC5:
	.string	"Usage: %s <NumberOfDoubleValuesAsVector> <NumberOfVectors> <InnerIterationCount> <OuterIterationCount>\n"
.LC6:
	.string	"Unacceptable value for <NumberOfVectors> parameter.\n"
.LC7:
	.string	"\n\n"
.LC8:
	.string	"------------------------\n"
.LC9:
	.string	"NumberOfDoubleValuesAsVector: %d\n"
.LC10:
	.string	"NumberOfVectors: %d\n"
.LC11:
	.string	"InnerIterationCount: %d\n"
.LC12:
	.string	"OuterIterationCount: %d\n"
.LC13:
	.string	"Warmup...\n"
.LC14:
	.string	"Warmup...Done\n"
.LC15:
	.string	"Main operations...\n"
.LC16:
	.string	"Main operations...Done\n"
.LC18:
	.string	"\n\nResults:\n"
.LC19:
	.string	"========================\n"
.LC20:
	.string	"Vector size: %d Bytes\n"
.LC22:
	.string	"H2D median: %.2fus\n"
.LC23:
	.string	"D2H median: %.2fus\n"
.LC25:
	.string	"H2D median: %.2fms\n"
.LC26:
	.string	"D2H median: %.2fms\n"
.LC30:
	.string	"csv_output,%dB,%.2fKB,%.2fMB,%.2fGB,%.2fus,%.2fus\n"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3152:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3152
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	cmpl	$4, %edi
	jg	.L149
	movq	(%rsi), %rcx
	movq	stderr(%rip), %rdi
	leaq	.LC5(%rip), %rdx
	movl	$2, %esi
.LEHB0:
	call	__fprintf_chk@PLT
	jmp	.L150
.L149:
	movq	8(%rsi), %rdi
	call	atoi@PLT
	movq	16(%r12), %rdi
	movl	%eax, %ebx
	call	atoi@PLT
	movq	24(%r12), %rdi
	movl	%eax, %ebp
	call	atoi@PLT
	movq	32(%r12), %rdi
	movl	%eax, %r13d
	call	atoi@PLT
	movl	%eax, %r14d
	cmpl	$1, %ebp
	jg	.L151
	movq	stderr(%rip), %rdi
	leaq	.LC6(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L150:
	movl	$1, %eax
	jmp	.L148
.L151:
	leaq	.LC7(%rip), %r15
	movl	$2, %edi
	leaq	.LC8(%rip), %r12
	xorl	%eax, %eax
	movq	%r15, %rsi
	call	__printf_chk@PLT
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%ebx, %edx
	leaq	.LC9(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	%ebp, %edx
	leaq	.LC10(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	%r13d, %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC11(%rip), %rsi
	call	__printf_chk@PLT
	movl	%r14d, %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC12(%rip), %rsi
	call	__printf_chk@PLT
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r15, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.LEHE0:
	xorl	%eax, %eax
	movl	$2, %esi
	movq	stderr(%rip), %rdi
	movq	%rax, 40(%rsp)
	leaq	.LC13(%rip), %rdx
	movq	%rax, 48(%rsp)
	movq	%rax, 56(%rsp)
	movq	%rax, 64(%rsp)
	movq	%rax, 72(%rsp)
	movq	%rax, 80(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 16(%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
.LEHB1:
	call	__fprintf_chk@PLT
	movq	16(%rsp), %r9
	movq	24(%rsp), %r8
	movl	%ebp, %esi
	movl	%ebx, %edi
	movl	$5, %ecx
	movl	$5, %edx
	call	_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_
	movq	stderr(%rip), %rdi
	leaq	.LC14(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	64(%rsp), %rax
	cmpq	72(%rsp), %rax
	je	.L153
	movq	%rax, 72(%rsp)
.L153:
	movq	40(%rsp), %rax
	cmpq	48(%rsp), %rax
	je	.L154
	movq	%rax, 48(%rsp)
.L154:
	movq	stderr(%rip), %rdi
	leaq	.LC15(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	16(%rsp), %r9
	movq	24(%rsp), %r8
	movl	%r14d, %ecx
	movl	%r13d, %edx
	movl	%ebp, %esi
	movl	%ebx, %edi
	call	_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_
	movq	stderr(%rip), %rdi
	leaq	.LC16(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movq	64(%rsp), %r14
	leaq	_Z7cmpfuncdd(%rip), %r15
	movq	72(%rsp), %rsi
	movq	%r15, %rdx
	movq	%r14, %rdi
	call	_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEPFbddEEvT_S9_T0_
	movq	40(%rsp), %r13
	movq	48(%rsp), %rsi
	movq	%r15, %rdx
	movq	%r13, %rdi
	call	_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEPFbddEEvT_S9_T0_
	movl	%ebp, %eax
	sarl	%eax
	andl	$1, %ebp
	cltq
	movsd	0(%r13,%rax,8), %xmm7
	movq	(%r14,%rax,8), %r15
	leaq	0(,%rax,8), %rdx
	movsd	%xmm7, 8(%rsp)
	jne	.L155
	movq	%r15, %xmm1
	addsd	-8(%r14,%rdx), %xmm1
	movsd	.LC17(%rip), %xmm0
	mulsd	%xmm0, %xmm1
	movq	%xmm1, %r15
	movsd	-8(%r13,%rdx), %xmm1
	addsd	%xmm7, %xmm1
	mulsd	%xmm0, %xmm1
	movsd	%xmm1, 8(%rsp)
.L155:
	leaq	.LC18(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	sall	$3, %ebx
	call	__printf_chk@PLT
	leaq	.LC19(%rip), %rbp
	movl	$2, %edi
	xorl	%eax, %eax
	movq	%rbp, %rsi
	call	__printf_chk@PLT
	movl	%ebx, %edx
	leaq	.LC20(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r15, %xmm5
	leaq	.LC22(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	divsd	.LC21(%rip), %xmm5
	movaps	%xmm5, %xmm0
	movq	%xmm5, %rbp
	call	__printf_chk@PLT
	movsd	8(%rsp), %xmm6
	leaq	.LC23(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	divsd	.LC21(%rip), %xmm6
	movaps	%xmm6, %xmm0
	movq	%xmm6, %r13
	call	__printf_chk@PLT
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC25(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	movq	%r15, %xmm0
	divsd	.LC24(%rip), %xmm0
	call	__printf_chk@PLT
	leaq	.LC26(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	movsd	8(%rsp), %xmm0
	divsd	.LC24(%rip), %xmm0
	call	__printf_chk@PLT
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cvtsi2sdl	%ebx, %xmm1
	movsd	.LC29(%rip), %xmm0
	movl	%ebx, %edx
	movb	$5, %al
	movq	%r13, %xmm4
	movsd	.LC27(%rip), %xmm2
	movq	%rbp, %xmm3
	leaq	.LC30(%rip), %rsi
	movl	$2, %edi
	mulsd	%xmm1, %xmm0
	mulsd	%xmm1, %xmm2
	mulsd	.LC28(%rip), %xmm1
	call	__printf_chk@PLT
	movq	%r12, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.LEHE1:
	movq	24(%rsp), %rdi
	call	_ZNSt6vectorIdSaIdEED1Ev
	movq	16(%rsp), %rdi
	call	_ZNSt6vectorIdSaIdEED1Ev
	xorl	%eax, %eax
	jmp	.L148
.L159:
	endbr64
	movq	%rax, %rbx
.L156:
	movq	24(%rsp), %rdi
	call	_ZNSt6vectorIdSaIdEED1Ev
	movq	16(%rsp), %rdi
	call	_ZNSt6vectorIdSaIdEED1Ev
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L161
	movq	%rbx, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L148:
	movq	88(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L158
.L161:
	call	__stack_chk_fail@PLT
.L158:
	addq	$104, %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
.LFE3152:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3152:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3152-.LLSDACSB3152
.LLSDACSB3152:
	.uleb128 .LEHB0-.LFB3152
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3152
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L159-.LFB3152
	.uleb128 0
	.uleb128 .LEHB2-.LFB3152
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE3152:
	.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.cst8,"aM",@progbits,8
	.align 8
.LC4:
	.long	0
	.long	1104006501
	.align 8
.LC17:
	.long	0
	.long	1071644672
	.align 8
.LC21:
	.long	0
	.long	1083129856
	.align 8
.LC24:
	.long	0
	.long	1093567616
	.align 8
.LC27:
	.long	0
	.long	1041235968
	.align 8
.LC28:
	.long	0
	.long	1051721728
	.align 8
.LC29:
	.long	0
	.long	1062207488
	.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 <stdio.h>
#include <stdlib.h>
#include <time.h>

#include <algorithm>
#include <vector>

using namespace std;


#define CUDA_CHECK(cmd) {\
	hipError_t err = cmd; \
	if(err != hipSuccess) fprintf(stderr, "Error in %s (%d) - Name: %s - String: %s\n", __FILE__, __LINE__, hipGetErrorName(err), hipGetErrorString(err)); \
}


#define GET_CLOCK(t) if(clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t) != 0) {fprintf(stderr, "%s (%d): Error in timer.\n", __FILE__, __LINE__); exit(1);}
#define COMPUTE_DELTA_T(diff, t2, t1) diff = (t2.tv_sec - t1.tv_sec) * 1E9 + (t2.tv_nsec - t1.tv_nsec);


#ifdef PINNED
#define CUDA_ALLOC hipHostMalloc
#define CUDA_FREE hipHostFree
#else
#define CUDA_ALLOC hipMalloc
#define CUDA_FREE hipFree
#endif




bool cmpfunc (double a, double b) { return a < b; }



void measure_data_transfer(int NumberOfDoubleValuesAsVector, int NumberOfVectors, int InnerIterationCount, int OuterIterationCount, 
		vector<double> *timings_h2d, vector<double> *timings_d2h) {


	int sz = sizeof(double) * NumberOfDoubleValuesAsVector;

	struct timespec t1, t2;
	double diff;



	double **data_host;
	data_host = (double **) malloc(sizeof(double*) * NumberOfVectors);

	double **data_device;
	data_device = (double **) malloc(sizeof(double*) * NumberOfVectors);

	for(int i=0;i<NumberOfVectors;i++) {
		data_host[i] = (double *) malloc(sz);
	}

	// Allocation on GPU
	for(int i=0;i<NumberOfVectors;i++) {
		double *d;
		CUDA_CHECK(CUDA_ALLOC((void**)&d, sz));
		data_device[i] = d;
	}



	for(int q=0;q < OuterIterationCount; q++) {


		GET_CLOCK(t1);
		// Host to device
		for(int i=0;i<InnerIterationCount;i++) {
			CUDA_CHECK(hipMemcpy(data_device[i % NumberOfVectors], data_host[i % NumberOfVectors], sz, hipMemcpyHostToDevice));
			CUDA_CHECK(hipDeviceSynchronize());
		}
		GET_CLOCK(t2);
		COMPUTE_DELTA_T(diff, t2, t1);
		timings_h2d->push_back(diff / InnerIterationCount);



		GET_CLOCK(t1);
		// Device to host
		for(int i=0;i<InnerIterationCount;i++) {
			CUDA_CHECK(hipMemcpy(data_host[i % NumberOfVectors], data_device[i % NumberOfVectors], sz, hipMemcpyDeviceToHost));
			CUDA_CHECK(hipDeviceSynchronize());
		}
		GET_CLOCK(t2);
		COMPUTE_DELTA_T(diff, t2, t1);
		timings_d2h->push_back(diff / InnerIterationCount);


	}	



	for(int i=0;i<NumberOfVectors;i++) {
		free(data_host[i]);
		CUDA_FREE(data_device[i]);
	}

	free(data_host);
	free(data_device);


}

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

	if(argc < 5) {
		fprintf(stderr, "Usage: %s <NumberOfDoubleValuesAsVector> <NumberOfVectors> <InnerIterationCount> <OuterIterationCount>\n", argv[0]);
		return 1;
	}

	int NumberOfDoubleValuesAsVector = atoi(argv[1]);
	int NumberOfVectors = atoi(argv[2]);
	int InnerIterationCount = atoi(argv[3]);
	int OuterIterationCount = atoi(argv[4]);

	if(NumberOfVectors < 2) {
		fprintf(stderr, "Unacceptable value for <NumberOfVectors> parameter.\n");
		return 1;
	}

	printf("\n\n");
	printf("------------------------\n");
	printf("NumberOfDoubleValuesAsVector: %d\n", NumberOfDoubleValuesAsVector);
	printf("NumberOfVectors: %d\n", NumberOfVectors);
	printf("InnerIterationCount: %d\n", InnerIterationCount);
	printf("OuterIterationCount: %d\n", OuterIterationCount);
	printf("------------------------\n");
	printf("\n\n");

	// double *timings_h2d = (double*) malloc(sizeof(double) * NumberOfVectors);
	// double *timings_d2h = (double*) malloc(sizeof(double) * NumberOfVectors);
	vector<double> timings_d2h, timings_h2d;

	fprintf(stderr, "Warmup...\n");
	measure_data_transfer(NumberOfDoubleValuesAsVector, NumberOfVectors, 5, 5, &timings_h2d, &timings_d2h)	;
	fprintf(stderr, "Warmup...Done\n");

	timings_h2d.clear();
	timings_d2h.clear();


	fprintf(stderr, "Main operations...\n");
	measure_data_transfer(NumberOfDoubleValuesAsVector, NumberOfVectors, InnerIterationCount, OuterIterationCount, &timings_h2d, &timings_d2h)	;
	fprintf(stderr, "Main operations...Done\n");


	sort(timings_h2d.begin(), timings_h2d.end(), cmpfunc);
	sort(timings_d2h.begin(), timings_d2h.end(), cmpfunc);


	double t_h2d, t_d2h;
	if(NumberOfVectors % 2 == 1) {
		t_h2d = timings_h2d[NumberOfVectors/2];
		t_d2h = timings_d2h[NumberOfVectors/2];
	} else {
		t_h2d = timings_h2d[NumberOfVectors/2];
		t_h2d += timings_h2d[NumberOfVectors/2 - 1];
		t_h2d /= 2;

		t_d2h = timings_d2h[NumberOfVectors/2];
		t_d2h += timings_d2h[NumberOfVectors/2 - 1];
		t_d2h /= 2;
	}

	int sz = NumberOfDoubleValuesAsVector * sizeof(double);

	printf("\n\nResults:\n");
	printf("========================\n");
	printf("Vector size: %d Bytes\n", sz);
	printf("========================\n");

	printf("H2D median: %.2fus\n", t_h2d / 1E3);
	printf("D2H median: %.2fus\n", t_d2h / 1E3);

	printf("------------------------\n");

	printf("H2D median: %.2fms\n", t_h2d / 1E6);
	printf("D2H median: %.2fms\n", t_d2h / 1E6);

	printf("------------------------\n");

	printf("csv_output,%dB,%.2fKB,%.2fMB,%.2fGB,%.2fus,%.2fus\n", sz, 1.0*sz/1024, 1.0*sz/(1024*1024), 1.0*sz/(1024*1024*1024), t_h2d / 1E3, t_d2h / 1E3);

	printf("------------------------\n");

	return 0;
}

	.text
	.file	"bw.hip"
	.globl	_Z7cmpfuncdd                    # -- Begin function _Z7cmpfuncdd
	.type	_Z7cmpfuncdd,@function
_Z7cmpfuncdd:                           # @_Z7cmpfuncdd
	.cfi_startproc
# %bb.0:
	ucomisd	%xmm0, %xmm1
	seta	%al
	retq
.Lfunc_end0:
	.size	_Z7cmpfuncdd, .Lfunc_end0-_Z7cmpfuncdd
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_
.LCPI1_0:
	.quad	0x41cdcd6500000000              # double 1.0E+9
	.text
	.globl	_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_
	.type	_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_,@function
_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_: # @_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_
	.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	$104, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, 56(%rsp)                   # 8-byte Spill
	movq	%r8, 96(%rsp)                   # 8-byte Spill
	movl	%ecx, 16(%rsp)                  # 4-byte Spill
	movl	%edx, %ebp
	movl	%esi, %r12d
	movl	%edi, %r14d
	shll	$3, %r14d
	movslq	%esi, %rax
	movq	%rax, (%rsp)                    # 8-byte Spill
	leaq	(,%rax,8), %r15
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, %r13
	movslq	%r14d, %r15
	movl	%r12d, %ebx
	movl	%r12d, %eax
	cmpl	$0, (%rsp)                      # 4-byte Folded Reload
	movq	%rax, %r12
	movq	%rax, 64(%rsp)                  # 8-byte Spill
	jle	.LBB1_8
# %bb.1:                                # %.lr.ph
	xorl	%r14d, %r14d
.LBB1_2:                                # =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	malloc
	movq	24(%rsp), %rcx                  # 8-byte Reload
	movq	%rax, (%rcx,%r14,8)
	incq	%r14
	cmpq	%r14, %r12
	jne	.LBB1_2
# %bb.3:                                # %.preheader92
	testl	%ebx, %ebx
	jle	.LBB1_8
# %bb.4:                                # %.lr.ph95
	xorl	%r14d, %r14d
.LBB1_5:                                # =>This Inner Loop Header: Depth=1
	leaq	40(%rsp), %rdi
	movq	%r15, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB1_6
.LBB1_7:                                #   in Loop: Header=BB1_5 Depth=1
	movq	40(%rsp), %rax
	movq	%rax, (%r13,%r14,8)
	incq	%r14
	movq	64(%rsp), %r12                  # 8-byte Reload
	cmpq	%r14, %r12
	jne	.LBB1_5
	jmp	.LBB1_8
.LBB1_6:                                #   in Loop: Header=BB1_5 Depth=1
	movl	%eax, %r12d
	movq	stderr(%rip), %rax
	movq	%rax, (%rsp)                    # 8-byte Spill
	movl	%r12d, %edi
	callq	hipGetErrorName
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movl	%r12d, %edi
	callq	hipGetErrorString
	movl	$.L.str, %esi
	movl	$.L.str.1, %edx
	movq	(%rsp), %rdi                    # 8-byte Reload
	movl	$62, %ecx
	movq	8(%rsp), %r8                    # 8-byte Reload
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB1_7
.LBB1_8:                                # %.preheader91
	cmpl	$0, 16(%rsp)                    # 4-byte Folded Reload
	jle	.LBB1_20
# %bb.9:                                # %.lr.ph102
	cvtsi2sd	%ebp, %xmm0
	movsd	%xmm0, 72(%rsp)                 # 8-byte Spill
	xorl	%eax, %eax
.LBB1_10:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_13 Depth 2
                                        #     Child Loop BB1_32 Depth 2
	movl	%eax, 20(%rsp)                  # 4-byte Spill
	movl	$2, %edi
	leaq	40(%rsp), %rsi
	callq	clock_gettime
	testl	%eax, %eax
	jne	.LBB1_24
# %bb.11:                               # %.preheader90
                                        #   in Loop: Header=BB1_10 Depth=1
	testl	%ebp, %ebp
	jle	.LBB1_18
# %bb.12:                               # %.lr.ph97.preheader
                                        #   in Loop: Header=BB1_10 Depth=1
	xorl	%r12d, %r12d
.LBB1_13:                               # %.lr.ph97
                                        #   Parent Loop BB1_10 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%r12d, %eax
	cltd
	idivl	%ebx
                                        # kill: def $edx killed $edx def $rdx
	movq	(%r13,%rdx,8), %rdi
	movq	24(%rsp), %rax                  # 8-byte Reload
	movq	(%rax,%rdx,8), %rsi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB1_14
.LBB1_15:                               #   in Loop: Header=BB1_13 Depth=2
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB1_16
.LBB1_17:                               #   in Loop: Header=BB1_13 Depth=2
	incl	%r12d
	cmpl	%r12d, %ebp
	jne	.LBB1_13
	jmp	.LBB1_18
.LBB1_14:                               #   in Loop: Header=BB1_13 Depth=2
	movl	%eax, %r14d
	movq	stderr(%rip), %rax
	movq	%rax, (%rsp)                    # 8-byte Spill
	movl	%r14d, %edi
	callq	hipGetErrorName
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movl	%r14d, %edi
	callq	hipGetErrorString
	movl	$.L.str, %esi
	movl	$.L.str.1, %edx
	movq	(%rsp), %rdi                    # 8-byte Reload
	movl	$74, %ecx
	movq	8(%rsp), %r8                    # 8-byte Reload
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB1_15
.LBB1_16:                               #   in Loop: Header=BB1_13 Depth=2
	movl	%eax, %r14d
	movq	stderr(%rip), %rax
	movq	%rax, (%rsp)                    # 8-byte Spill
	movl	%r14d, %edi
	callq	hipGetErrorName
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movl	%r14d, %edi
	callq	hipGetErrorString
	movl	$.L.str, %esi
	movl	$.L.str.1, %edx
	movq	(%rsp), %rdi                    # 8-byte Reload
	movl	$75, %ecx
	movq	8(%rsp), %r8                    # 8-byte Reload
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB1_17
.LBB1_18:                               # %._crit_edge
                                        #   in Loop: Header=BB1_10 Depth=1
	movl	$2, %edi
	leaq	80(%rsp), %rsi
	callq	clock_gettime
	testl	%eax, %eax
	jne	.LBB1_19
# %bb.26:                               #   in Loop: Header=BB1_10 Depth=1
	movq	80(%rsp), %rax
	subq	40(%rsp), %rax
	xorps	%xmm1, %xmm1
	cvtsi2sd	%rax, %xmm1
	movq	88(%rsp), %rax
	mulsd	.LCPI1_0(%rip), %xmm1
	subq	48(%rsp), %rax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	addsd	%xmm1, %xmm0
	divsd	72(%rsp), %xmm0                 # 8-byte Folded Reload
	movsd	%xmm0, 32(%rsp)
	movq	96(%rsp), %rdi                  # 8-byte Reload
	movq	8(%rdi), %rsi
	cmpq	16(%rdi), %rsi
	je	.LBB1_28
# %bb.27:                               #   in Loop: Header=BB1_10 Depth=1
	movsd	%xmm0, (%rsi)
	addq	$8, %rsi
	movq	%rsi, 8(%rdi)
	jmp	.LBB1_29
.LBB1_28:                               #   in Loop: Header=BB1_10 Depth=1
	leaq	32(%rsp), %rdx
	callq	_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_
.LBB1_29:                               # %_ZNSt6vectorIdSaIdEE9push_backEOd.exit
                                        #   in Loop: Header=BB1_10 Depth=1
	movl	$2, %edi
	leaq	40(%rsp), %rsi
	callq	clock_gettime
	testl	%eax, %eax
	jne	.LBB1_43
# %bb.30:                               # %.preheader89
                                        #   in Loop: Header=BB1_10 Depth=1
	testl	%ebp, %ebp
	jle	.LBB1_37
# %bb.31:                               # %.lr.ph99.preheader
                                        #   in Loop: Header=BB1_10 Depth=1
	xorl	%r12d, %r12d
.LBB1_32:                               # %.lr.ph99
                                        #   Parent Loop BB1_10 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%r12d, %eax
	cltd
	idivl	%ebx
                                        # kill: def $edx killed $edx def $rdx
	movq	24(%rsp), %rax                  # 8-byte Reload
	movq	(%rax,%rdx,8), %rdi
	movq	(%r13,%rdx,8), %rsi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB1_33
.LBB1_34:                               #   in Loop: Header=BB1_32 Depth=2
	callq	hipDeviceSynchronize
	testl	%eax, %eax
	jne	.LBB1_35
.LBB1_36:                               #   in Loop: Header=BB1_32 Depth=2
	incl	%r12d
	cmpl	%r12d, %ebp
	jne	.LBB1_32
	jmp	.LBB1_37
.LBB1_33:                               #   in Loop: Header=BB1_32 Depth=2
	movl	%eax, %r14d
	movq	stderr(%rip), %rax
	movq	%rax, (%rsp)                    # 8-byte Spill
	movl	%r14d, %edi
	callq	hipGetErrorName
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movl	%r14d, %edi
	callq	hipGetErrorString
	movl	$.L.str, %esi
	movl	$.L.str.1, %edx
	movq	(%rsp), %rdi                    # 8-byte Reload
	movl	$86, %ecx
	movq	8(%rsp), %r8                    # 8-byte Reload
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB1_34
.LBB1_35:                               #   in Loop: Header=BB1_32 Depth=2
	movl	%eax, %r14d
	movq	stderr(%rip), %rax
	movq	%rax, (%rsp)                    # 8-byte Spill
	movl	%r14d, %edi
	callq	hipGetErrorName
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movl	%r14d, %edi
	callq	hipGetErrorString
	movl	$.L.str, %esi
	movl	$.L.str.1, %edx
	movq	(%rsp), %rdi                    # 8-byte Reload
	movl	$87, %ecx
	movq	8(%rsp), %r8                    # 8-byte Reload
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB1_36
.LBB1_37:                               # %._crit_edge100
                                        #   in Loop: Header=BB1_10 Depth=1
	movl	$2, %edi
	leaq	80(%rsp), %rsi
	callq	clock_gettime
	testl	%eax, %eax
	jne	.LBB1_38
# %bb.39:                               #   in Loop: Header=BB1_10 Depth=1
	movq	80(%rsp), %rax
	subq	40(%rsp), %rax
	xorps	%xmm1, %xmm1
	cvtsi2sd	%rax, %xmm1
	movq	88(%rsp), %rax
	mulsd	.LCPI1_0(%rip), %xmm1
	subq	48(%rsp), %rax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	addsd	%xmm1, %xmm0
	divsd	72(%rsp), %xmm0                 # 8-byte Folded Reload
	movsd	%xmm0, 32(%rsp)
	movq	56(%rsp), %rax                  # 8-byte Reload
	movq	8(%rax), %rsi
	cmpq	16(%rax), %rsi
	movq	64(%rsp), %r12                  # 8-byte Reload
	je	.LBB1_41
# %bb.40:                               #   in Loop: Header=BB1_10 Depth=1
	movsd	%xmm0, (%rsi)
	addq	$8, %rsi
	movq	%rsi, 8(%rax)
	jmp	.LBB1_42
.LBB1_41:                               #   in Loop: Header=BB1_10 Depth=1
	movq	56(%rsp), %rdi                  # 8-byte Reload
	leaq	32(%rsp), %rdx
	callq	_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_
.LBB1_42:                               # %_ZNSt6vectorIdSaIdEE9push_backEOd.exit88
                                        #   in Loop: Header=BB1_10 Depth=1
	movl	20(%rsp), %eax                  # 4-byte Reload
	incl	%eax
	cmpl	16(%rsp), %eax                  # 4-byte Folded Reload
	jne	.LBB1_10
.LBB1_20:                               # %.preheader
	testl	%ebx, %ebx
	movq	24(%rsp), %rbx                  # 8-byte Reload
	jle	.LBB1_23
# %bb.21:                               # %.lr.ph104.preheader
	xorl	%r14d, %r14d
.LBB1_22:                               # %.lr.ph104
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rbx,%r14,8), %rdi
	callq	free
	movq	(%r13,%r14,8), %rdi
	callq	hipFree
	incq	%r14
	cmpq	%r14, %r12
	jne	.LBB1_22
.LBB1_23:                               # %._crit_edge105
	movq	%rbx, %rdi
	callq	free
	movq	%r13, %rdi
	callq	free
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB1_38:
	.cfi_def_cfa_offset 160
	movq	stderr(%rip), %rdi
	movl	$.L.str.2, %esi
	movl	$.L.str.1, %edx
	movl	$89, %ecx
	jmp	.LBB1_25
.LBB1_43:
	movq	stderr(%rip), %rdi
	movl	$.L.str.2, %esi
	movl	$.L.str.1, %edx
	movl	$83, %ecx
	jmp	.LBB1_25
.LBB1_19:
	movq	stderr(%rip), %rdi
	movl	$.L.str.2, %esi
	movl	$.L.str.1, %edx
	movl	$77, %ecx
	jmp	.LBB1_25
.LBB1_24:
	movq	stderr(%rip), %rdi
	movl	$.L.str.2, %esi
	movl	$.L.str.1, %edx
	movl	$71, %ecx
.LBB1_25:
	xorl	%eax, %eax
	callq	fprintf
	movl	$1, %edi
	callq	exit
.Lfunc_end1:
	.size	_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_, .Lfunc_end1-_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI2_0:
	.quad	0x3fe0000000000000              # double 0.5
.LCPI2_1:
	.quad	0x408f400000000000              # double 1000
.LCPI2_2:
	.quad	0x412e848000000000              # double 1.0E+6
.LCPI2_3:
	.quad	0x3f50000000000000              # double 9.765625E-4
.LCPI2_4:
	.quad	0x3eb0000000000000              # double 9.5367431640625E-7
.LCPI2_5:
	.quad	0x3e10000000000000              # double 9.3132257461547852E-10
	.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
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r15
	cmpl	$4, %edi
	jg	.LBB2_2
# %bb.1:
	movq	stderr(%rip), %rdi
	movq	(%r15), %rdx
	movl	$.L.str.3, %esi
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB2_4
.LBB2_2:
	movq	8(%r15), %rdi
	callq	atoi
	movl	%eax, %ebx
	movq	16(%r15), %rdi
	callq	atoi
	movl	%eax, %ebp
	movq	24(%r15), %rdi
	callq	atoi
	movl	%eax, %r14d
	movq	32(%r15), %rdi
	callq	atoi
	cmpl	$1, %ebp
	jg	.LBB2_5
# %bb.3:
	movq	stderr(%rip), %rcx
	movl	$.L.str.4, %edi
	movl	$52, %esi
	movl	$1, %edx
	callq	fwrite@PLT
.LBB2_4:
	movl	$1, %eax
	jmp	.LBB2_31
.LBB2_5:
	movl	%eax, %r15d
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	movl	$.Lstr.9, %edi
	callq	puts@PLT
	movl	$.L.str.7, %edi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.8, %edi
	movl	%ebp, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.9, %edi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.L.str.10, %edi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.Lstr.9, %edi
	callq	puts@PLT
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	leaq	16(%rsp), %r12
	xorl	%eax, %eax
	movq	%rax, 16(%r12)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, (%r12)
	leaq	48(%rsp), %r13
	movq	%rax, 16(%r13)
	movaps	%xmm0, (%r13)
	movq	stderr(%rip), %rcx
	movl	$.L.str.11, %edi
	movl	$10, %esi
	movl	$1, %edx
	callq	fwrite@PLT
.Ltmp0:
	movl	%ebx, %edi
	movl	%ebp, %esi
	movl	$5, %edx
	movl	$5, %ecx
	movq	%r13, %r8
	movq	%r12, %r9
	callq	_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_
.Ltmp1:
# %bb.6:
	movq	stderr(%rip), %rcx
	movl	$.L.str.12, %edi
	movl	$14, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movq	48(%rsp), %rax
	cmpq	%rax, 56(%rsp)
	je	.LBB2_8
# %bb.7:
	movq	%rax, 56(%rsp)
.LBB2_8:                                # %_ZNSt6vectorIdSaIdEE5clearEv.exit
	movq	16(%rsp), %rax
	cmpq	%rax, 24(%rsp)
	je	.LBB2_10
# %bb.9:
	movq	%rax, 24(%rsp)
.LBB2_10:                               # %_ZNSt6vectorIdSaIdEE5clearEv.exit58
	movq	stderr(%rip), %rcx
	movl	$.L.str.13, %edi
	movl	$19, %esi
	movl	$1, %edx
	callq	fwrite@PLT
.Ltmp2:
	leaq	48(%rsp), %r8
	leaq	16(%rsp), %r9
	movl	%ebx, %edi
	movl	%ebp, %esi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	callq	_Z21measure_data_transferiiiiPSt6vectorIdSaIdEES2_
.Ltmp3:
# %bb.11:
	movq	stderr(%rip), %rcx
	movl	$.L.str.14, %edi
	movl	$23, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	movq	48(%rsp), %r14
	movq	56(%rsp), %r15
	cmpq	%r15, %r14
	je	.LBB2_17
# %bb.12:
	movq	%r15, %rax
	subq	%r14, %rax
	sarq	$3, %rax
	je	.LBB2_14
# %bb.13:                               # %cond.false
	bsrq	%rax, %rax
	xorq	$63, %rax
	jmp	.LBB2_15
.LBB2_14:
	movl	$64, %eax
.LBB2_15:                               # %cond.end
	addq	%rax, %rax
	movl	$126, %edx
	subq	%rax, %rdx
.Ltmp4:
	movl	$_Z7cmpfuncdd, %ecx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_
.Ltmp5:
# %bb.16:                               # %.noexc
.Ltmp6:
	movl	$_Z7cmpfuncdd, %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_
.Ltmp7:
.LBB2_17:                               # %_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEPFbddEEvT_S9_T0_.exit
	movq	16(%rsp), %r14
	movq	24(%rsp), %r15
	cmpq	%r15, %r14
	je	.LBB2_23
# %bb.18:
	movq	%r15, %rax
	subq	%r14, %rax
	sarq	$3, %rax
	je	.LBB2_20
# %bb.19:                               # %cond.false74
	bsrq	%rax, %rax
	xorq	$63, %rax
	jmp	.LBB2_21
.LBB2_20:
	movl	$64, %eax
.LBB2_21:                               # %cond.end75
	addq	%rax, %rax
	movl	$126, %edx
	subq	%rax, %rdx
.Ltmp8:
	movl	$_Z7cmpfuncdd, %ecx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_
.Ltmp9:
# %bb.22:                               # %.noexc62
.Ltmp10:
	movl	$_Z7cmpfuncdd, %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_
.Ltmp11:
.LBB2_23:                               # %_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEPFbddEEvT_S9_T0_.exit64
	movl	%ebp, %eax
	shrl	%eax
	movq	48(%rsp), %rcx
	movsd	(%rcx,%rax,8), %xmm1            # xmm1 = mem[0],zero
	testb	$1, %bpl
	jne	.LBB2_25
# %bb.24:
	leal	-1(%rax), %edx
	addsd	(%rcx,%rdx,8), %xmm1
	movsd	.LCPI2_0(%rip), %xmm0           # xmm0 = mem[0],zero
	mulsd	%xmm0, %xmm1
	movsd	%xmm1, (%rsp)                   # 8-byte Spill
	movq	16(%rsp), %rcx
	movsd	(%rcx,%rax,8), %xmm2            # xmm2 = mem[0],zero
	addsd	(%rcx,%rdx,8), %xmm2
	mulsd	%xmm0, %xmm2
	movsd	%xmm2, 8(%rsp)                  # 8-byte Spill
	jmp	.LBB2_26
.LBB2_25:
	movq	16(%rsp), %rcx
	movsd	(%rcx,%rax,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	movsd	%xmm1, (%rsp)                   # 8-byte Spill
.LBB2_26:
	shll	$3, %ebx
	movl	$.Lstr.4, %edi
	callq	puts@PLT
	movl	$.Lstr.6, %edi
	callq	puts@PLT
	movl	$.L.str.17, %edi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	printf
	movl	$.Lstr.6, %edi
	callq	puts@PLT
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	divsd	.LCPI2_1(%rip), %xmm0
	movsd	%xmm0, 80(%rsp)                 # 8-byte Spill
	movl	$.L.str.18, %edi
	movb	$1, %al
	callq	printf
	movsd	8(%rsp), %xmm0                  # 8-byte Reload
                                        # xmm0 = mem[0],zero
	divsd	.LCPI2_1(%rip), %xmm0
	movsd	%xmm0, 72(%rsp)                 # 8-byte Spill
	movl	$.L.str.19, %edi
	movb	$1, %al
	callq	printf
	movl	$.Lstr.9, %edi
	callq	puts@PLT
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	divsd	.LCPI2_2(%rip), %xmm0
	movl	$.L.str.20, %edi
	movb	$1, %al
	callq	printf
	movsd	8(%rsp), %xmm0                  # 8-byte Reload
                                        # xmm0 = mem[0],zero
	divsd	.LCPI2_2(%rip), %xmm0
	movl	$.L.str.21, %edi
	movb	$1, %al
	callq	printf
	movl	$.Lstr.9, %edi
	callq	puts@PLT
	xorps	%xmm2, %xmm2
	cvtsi2sd	%ebx, %xmm2
	movsd	.LCPI2_3(%rip), %xmm0           # xmm0 = mem[0],zero
	mulsd	%xmm2, %xmm0
	movsd	.LCPI2_4(%rip), %xmm1           # xmm1 = mem[0],zero
	mulsd	%xmm2, %xmm1
	mulsd	.LCPI2_5(%rip), %xmm2
	movl	$.L.str.22, %edi
	movl	%ebx, %esi
	movsd	80(%rsp), %xmm3                 # 8-byte Reload
                                        # xmm3 = mem[0],zero
	movsd	72(%rsp), %xmm4                 # 8-byte Reload
                                        # xmm4 = mem[0],zero
	movb	$5, %al
	callq	printf
	movl	$.Lstr.9, %edi
	callq	puts@PLT
	movq	48(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_28
# %bb.27:
	callq	_ZdlPv
.LBB2_28:                               # %_ZNSt6vectorIdSaIdEED2Ev.exit68
	movq	16(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_30
# %bb.29:
	callq	_ZdlPv
.LBB2_30:                               # %_ZNSt6vectorIdSaIdEED2Ev.exit70
	xorl	%eax, %eax
.LBB2_31:
	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
.LBB2_32:
	.cfi_def_cfa_offset 144
.Ltmp12:
	movq	%rax, %rbx
	movq	48(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_34
# %bb.33:
	callq	_ZdlPv
.LBB2_34:                               # %_ZNSt6vectorIdSaIdEED2Ev.exit
	movq	16(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB2_36
# %bb.35:
	callq	_ZdlPv
.LBB2_36:                               # %_ZNSt6vectorIdSaIdEED2Ev.exit66
	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 .Ltmp0-.Lfunc_begin0           # >> Call Site 1 <<
	.uleb128 .Ltmp11-.Ltmp0                 #   Call between .Ltmp0 and .Ltmp11
	.uleb128 .Ltmp12-.Lfunc_begin0          #     jumps to .Ltmp12
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp11-.Lfunc_begin0          # >> Call Site 2 <<
	.uleb128 .Lfunc_end2-.Ltmp11            #   Call between .Ltmp11 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_,comdat
	.weak	_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_ # -- Begin function _ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_,@function
_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_: # @_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_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.23, %edx
	callq	_ZNKSt6vectorIdSaIdEE12_M_check_lenEmPKc
	movq	(%rbx), %r13
	movq	8(%rbx), %r15
	movq	%r12, 8(%rsp)                   # 8-byte Spill
	subq	%r13, %r12
	movq	%r12, %r14
	sarq	$3, %r14
	testq	%rax, %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	je	.LBB3_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIdE8allocateEmPKv
	movq	%rax, %rbp
	jmp	.LBB3_3
.LBB3_1:
	xorl	%ebp, %ebp
.LBB3_3:                                # %_ZNSt12_Vector_baseIdSaIdEE11_M_allocateEm.exit
	movq	(%rsp), %rax                    # 8-byte Reload
	movsd	(%rax), %xmm0                   # xmm0 = mem[0],zero
	movsd	%xmm0, (%rbp,%r14,8)
	testq	%r12, %r12
	jle	.LBB3_5
# %bb.4:
	movq	%rbp, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	memmove@PLT
.LBB3_5:                                # %_ZNSt6vectorIdSaIdEE11_S_relocateEPdS2_S2_RS0_.exit
	addq	%rbp, %r12
	addq	$8, %r12
	movq	8(%rsp), %rsi                   # 8-byte Reload
	subq	%rsi, %r15
	testq	%r15, %r15
	jle	.LBB3_7
# %bb.6:
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB3_7:                                # %_ZNSt6vectorIdSaIdEE11_S_relocateEPdS2_S2_RS0_.exit16
	testq	%r13, %r13
	je	.LBB3_9
# %bb.8:
	movq	%r13, %rdi
	callq	_ZdlPv
.LBB3_9:                                # %_ZNSt12_Vector_baseIdSaIdEE13_M_deallocateEPdm.exit
	addq	%r15, %r12
	movq	%rbp, (%rbx)
	movq	%r12, 8(%rbx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(,%rax,8), %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_end3:
	.size	_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_, .Lfunc_end3-_ZNSt6vectorIdSaIdEE17_M_realloc_insertIJdEEEvN9__gnu_cxx17__normal_iteratorIPdS1_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorIdSaIdEE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorIdSaIdEE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorIdSaIdEE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorIdSaIdEE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorIdSaIdEE12_M_check_lenEmPKc,@function
_ZNKSt6vectorIdSaIdEE12_M_check_lenEmPKc: # @_ZNKSt6vectorIdSaIdEE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$1152921504606846975, %rcx      # imm = 0xFFFFFFFFFFFFFFF
	movq	8(%rdi), %r8
	subq	(%rdi), %r8
	sarq	$3, %r8
	movq	%rcx, %rax
	subq	%r8, %rax
	cmpq	%rsi, %rax
	jb	.LBB4_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
.LBB4_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end4:
	.size	_ZNKSt6vectorIdSaIdEE12_M_check_lenEmPKc, .Lfunc_end4-_ZNKSt6vectorIdSaIdEE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIdE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIdE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIdE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIdE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIdE8allocateEmPKv,@function
_ZNSt15__new_allocatorIdE8allocateEmPKv: # @_ZNSt15__new_allocatorIdE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB5_1
# %bb.3:
	shlq	$3, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB5_1:
	.cfi_def_cfa_offset 16
	shrq	$61, %rsi
	je	.LBB5_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB5_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end5:
	.size	_ZNSt15__new_allocatorIdE8allocateEmPKv, .Lfunc_end5-_ZNSt15__new_allocatorIdE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_,"axG",@progbits,_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_,comdat
	.weak	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_ # -- Begin function _ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_
	.type	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_,@function
_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_: # @_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_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	$56, %rsp
	.cfi_def_cfa_offset 112
	.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, %r15
	subq	%rdi, %r15
	sarq	$3, %r15
	cmpq	$17, %r15
	jl	.LBB6_12
# %bb.1:                                # %.lr.ph
	movq	%rcx, %r14
	movq	%rdx, %r12
	movq	%rsi, %rbp
	movq	%rdi, %rbx
	leaq	8(%rdi), %rax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movq	$-8, %rax
	subq	%rdi, %rax
	movq	%rax, 32(%rsp)                  # 8-byte Spill
.LBB6_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_5 Depth 2
                                        #       Child Loop BB6_6 Depth 3
                                        #       Child Loop BB6_8 Depth 3
	subq	$1, %r12
	jb	.LBB6_3
# %bb.4:                                #   in Loop: Header=BB6_2 Depth=1
	movq	%r12, 16(%rsp)                  # 8-byte Spill
	andq	$-2, %r15
	leaq	(%rbx,%r15,4), %rdx
	leaq	-8(%rbp), %rcx
	movq	%rbx, %rdi
	movq	8(%rsp), %r13                   # 8-byte Reload
	movq	%r13, %rsi
	movq	%r14, %r8
	callq	_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_
	movq	%rbp, 24(%rsp)                  # 8-byte Spill
	movq	%rbp, %r12
.LBB6_5:                                #   Parent Loop BB6_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB6_6 Depth 3
                                        #       Child Loop BB6_8 Depth 3
	movq	32(%rsp), %rax                  # 8-byte Reload
	leaq	(%rax,%r13), %r15
	addq	$-8, %r13
	movq	%r13, %rbp
.LBB6_6:                                #   Parent Loop BB6_2 Depth=1
                                        #     Parent Loop BB6_5 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movsd	8(%rbp), %xmm0                  # xmm0 = mem[0],zero
	addq	$8, %rbp
	movsd	(%rbx), %xmm1                   # xmm1 = mem[0],zero
	callq	*%r14
	addq	$8, %r15
	testb	%al, %al
	jne	.LBB6_6
# %bb.7:                                # %.preheader.i.i.preheader
                                        #   in Loop: Header=BB6_5 Depth=2
	leaq	8(%rbp), %r13
.LBB6_8:                                # %.preheader.i.i
                                        #   Parent Loop BB6_2 Depth=1
                                        #     Parent Loop BB6_5 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movsd	(%rbx), %xmm0                   # xmm0 = mem[0],zero
	movsd	-8(%r12), %xmm1                 # xmm1 = mem[0],zero
	addq	$-8, %r12
	callq	*%r14
	testb	%al, %al
	jne	.LBB6_8
# %bb.9:                                #   in Loop: Header=BB6_5 Depth=2
	cmpq	%r12, %rbp
	jae	.LBB6_11
# %bb.10:                               #   in Loop: Header=BB6_5 Depth=2
	movsd	(%rbp), %xmm0                   # xmm0 = mem[0],zero
	movsd	(%r12), %xmm1                   # xmm1 = mem[0],zero
	movsd	%xmm1, (%rbp)
	movsd	%xmm0, (%r12)
	jmp	.LBB6_5
.LBB6_11:                               # %_ZSt27__unguarded_partition_pivotIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEET_SC_SC_T0_.exit
                                        #   in Loop: Header=BB6_2 Depth=1
	movq	%rbp, %rdi
	movq	24(%rsp), %rsi                  # 8-byte Reload
	movq	16(%rsp), %r12                  # 8-byte Reload
	movq	%r12, %rdx
	movq	%r14, %rcx
	callq	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_
	sarq	$3, %r15
	cmpq	$16, %r15
	jg	.LBB6_2
	jmp	.LBB6_12
.LBB6_3:
	leaq	40(%rsp), %r12
	movq	%r14, (%r12)
	leaq	48(%rsp), %rdx
	movq	%r14, (%rdx)
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	callq	_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_
	movq	%rbx, %rdi
	movq	%rbp, %rsi
	movq	%r12, %rdx
	callq	_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_
.LBB6_12:                               # %.loopexit
	addq	$56, %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_end6:
	.size	_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_, .Lfunc_end6-_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEElNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_T1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_,"axG",@progbits,_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_,comdat
	.weak	_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_ # -- Begin function _ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_
	.type	_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_,@function
_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_: # @_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_
	.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	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rsi, %rax
	subq	%rdi, %rax
	cmpq	$129, %rax
	jl	.LBB7_8
# %bb.1:
	leaq	128(%rdi), %r15
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_
.LBB7_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_5 Depth 2
	cmpq	%r14, %r15
	je	.LBB7_7
# %bb.3:                                # %.lr.ph.i
                                        #   in Loop: Header=BB7_2 Depth=1
	movsd	-8(%r15), %xmm1                 # xmm1 = mem[0],zero
	movsd	(%r15), %xmm0                   # xmm0 = mem[0],zero
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	callq	*%rbx
	movq	%r15, %r12
	testb	%al, %al
	je	.LBB7_6
# %bb.4:                                # %.lr.ph.i.i.preheader
                                        #   in Loop: Header=BB7_2 Depth=1
	movq	%r15, %rcx
.LBB7_5:                                # %.lr.ph.i.i
                                        #   Parent Loop BB7_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	leaq	-8(%rcx), %r12
	movsd	-16(%rcx), %xmm1                # xmm1 = mem[0],zero
	movsd	-8(%rcx), %xmm0                 # xmm0 = mem[0],zero
	movsd	%xmm0, (%rcx)
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	*%rbx
	movq	%r12, %rcx
	testb	%al, %al
	jne	.LBB7_5
.LBB7_6:                                # %_ZSt25__unguarded_linear_insertIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops14_Val_comp_iterIPFbddEEEEvT_T0_.exit.i
                                        #   in Loop: Header=BB7_2 Depth=1
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movsd	%xmm0, (%r12)
	addq	$8, %r15
	jmp	.LBB7_2
.LBB7_8:
	movq	%r14, %rsi
	movq	%rbx, %rdx
	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
	jmp	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_ # TAILCALL
.LBB7_7:                                # %_ZSt26__unguarded_insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_.exit
	.cfi_def_cfa_offset 48
	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
.Lfunc_end7:
	.size	_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_, .Lfunc_end7-_ZSt22__final_insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_,"axG",@progbits,_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_,comdat
	.weak	_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_ # -- Begin function _ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_
	.type	_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_,@function
_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_: # @_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_
	.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, %r12
	subq	%rdi, %r12
	cmpq	$9, %r12
	jl	.LBB8_3
# %bb.1:                                # %.lr.ph.preheader
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	addq	$-8, %r14
.LBB8_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movsd	(%r14), %xmm0                   # xmm0 = mem[0],zero
	movsd	(%r15), %xmm1                   # xmm1 = mem[0],zero
	movsd	%xmm1, (%r14)
	addq	$-8, %r12
	movq	%r12, %rdx
	sarq	$3, %rdx
	movq	(%rbx), %rcx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_
	addq	$-8, %r14
	cmpq	$8, %r12
	jg	.LBB8_2
.LBB8_3:                                # %._crit_edge
	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
.Lfunc_end8:
	.size	_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_, .Lfunc_end8-_ZSt11__sort_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_,"axG",@progbits,_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_,comdat
	.weak	_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_ # -- Begin function _ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_
	.type	_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_,@function
_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_: # @_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_
	.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
	subq	%rdi, %r14
	sarq	$3, %r14
	cmpq	$2, %r14
	jl	.LBB9_3
# %bb.1:
	movq	%rdx, %rbx
	movq	%rdi, %r15
	leaq	-2(%r14), %r12
	shrq	%r12
.LBB9_2:                                # =>This Inner Loop Header: Depth=1
	movsd	(%r15,%r12,8), %xmm0            # xmm0 = mem[0],zero
	movq	(%rbx), %rcx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_
	addq	$-1, %r12
	jb	.LBB9_2
.LBB9_3:                                # %.loopexit
	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
.Lfunc_end9:
	.size	_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_, .Lfunc_end9-_ZSt11__make_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_RT0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_,"axG",@progbits,_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_,comdat
	.weak	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_ # -- Begin function _ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_
	.type	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_,@function
_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_: # @_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_
	.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	%rcx, %r14
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	leaq	-1(%rdx), %rax
	shrq	$63, %rax
	movq	%rdx, 16(%rsp)                  # 8-byte Spill
	leaq	(%rdx,%rax), %rbp
	decq	%rbp
	sarq	%rbp
	movq	%rsi, %r15
	cmpq	%rsi, %rbp
	jle	.LBB10_6
# %bb.1:                                # %.lr.ph.preheader
	movq	%r12, %r13
.LBB10_2:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	leaq	(,%r13,2), %rax
	movsd	8(%rbx,%rax,8), %xmm1           # xmm1 = mem[0],zero
	movsd	16(%rbx,%rax,8), %xmm0          # xmm0 = mem[0],zero
	callq	*%r14
	testb	%al, %al
	jne	.LBB10_3
# %bb.4:                                # %.lr.ph
                                        #   in Loop: Header=BB10_2 Depth=1
	leaq	2(,%r13,2), %r15
	jmp	.LBB10_5
.LBB10_3:                               #   in Loop: Header=BB10_2 Depth=1
	leaq	1(,%r13,2), %r15
.LBB10_5:                               # %.lr.ph
                                        #   in Loop: Header=BB10_2 Depth=1
	movsd	(%rbx,%r15,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, (%rbx,%r13,8)
	movq	%r15, %r13
	cmpq	%rbp, %r15
	jl	.LBB10_2
.LBB10_6:                               # %._crit_edge
	movq	16(%rsp), %rax                  # 8-byte Reload
	testb	$1, %al
	jne	.LBB10_9
# %bb.7:
	addq	$-2, %rax
	sarq	%rax
	cmpq	%rax, %r15
	jne	.LBB10_9
# %bb.8:
	leaq	(%r15,%r15), %rax
	movsd	8(%rbx,%rax,8), %xmm0           # xmm0 = mem[0],zero
	movsd	%xmm0, (%rbx,%r15,8)
	leaq	1(,%r15,2), %r15
.LBB10_9:
	cmpq	%r12, %r15
	jle	.LBB10_10
.LBB10_11:                              # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	leaq	-1(%r15), %rax
	shrq	$63, %rax
	leaq	(%r15,%rax), %r13
	decq	%r13
	sarq	%r13
	movsd	(%rbx,%r13,8), %xmm0            # xmm0 = mem[0],zero
	movsd	8(%rsp), %xmm1                  # 8-byte Reload
                                        # xmm1 = mem[0],zero
	callq	*%r14
	testb	%al, %al
	je	.LBB10_10
# %bb.12:                               #   in Loop: Header=BB10_11 Depth=1
	movsd	(%rbx,%r13,8), %xmm0            # xmm0 = mem[0],zero
	movsd	%xmm0, (%rbx,%r15,8)
	movq	%r13, %r15
	cmpq	%r12, %r13
	jg	.LBB10_11
	jmp	.LBB10_13
.LBB10_10:
	movq	%r15, %r13
.LBB10_13:                              # %_ZSt11__push_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops14_Iter_comp_valIPFbddEEEEvT_T0_SD_T1_RT2_.exit
	movsd	8(%rsp), %xmm0                  # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movsd	%xmm0, (%rbx,%r13,8)
	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_end10:
	.size	_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_, .Lfunc_end10-_ZSt13__adjust_heapIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEldNS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_T0_SD_T1_T2_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_,"axG",@progbits,_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_,comdat
	.weak	_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_ # -- Begin function _ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_
	.type	_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_,@function
_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_: # @_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%r8, %r13
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movsd	(%rsi), %xmm0                   # xmm0 = mem[0],zero
	movsd	(%rdx), %xmm1                   # xmm1 = mem[0],zero
	callq	*%r8
	movsd	(%r14), %xmm1                   # xmm1 = mem[0],zero
	testb	%al, %al
	je	.LBB11_5
# %bb.1:
	movsd	(%r15), %xmm0                   # xmm0 = mem[0],zero
	callq	*%r13
	testb	%al, %al
	je	.LBB11_3
# %bb.2:
	movsd	(%rbx), %xmm0                   # xmm0 = mem[0],zero
	jmp	.LBB11_9
.LBB11_5:
	movsd	(%r12), %xmm0                   # xmm0 = mem[0],zero
	callq	*%r13
	testb	%al, %al
	je	.LBB11_8
# %bb.6:
	movsd	(%rbx), %xmm0                   # xmm0 = mem[0],zero
	jmp	.LBB11_7
.LBB11_3:
	movsd	(%r12), %xmm0                   # xmm0 = mem[0],zero
	movsd	(%r14), %xmm1                   # xmm1 = mem[0],zero
	callq	*%r13
	movsd	(%rbx), %xmm0                   # xmm0 = mem[0],zero
	testb	%al, %al
	jne	.LBB11_4
.LBB11_7:
	movsd	(%r12), %xmm1                   # xmm1 = mem[0],zero
	movsd	%xmm1, (%rbx)
	movsd	%xmm0, (%r12)
	jmp	.LBB11_10
.LBB11_8:
	movsd	(%r15), %xmm0                   # xmm0 = mem[0],zero
	movsd	(%r14), %xmm1                   # xmm1 = mem[0],zero
	callq	*%r13
	movsd	(%rbx), %xmm0                   # xmm0 = mem[0],zero
	testb	%al, %al
	je	.LBB11_9
.LBB11_4:
	movsd	(%r14), %xmm1                   # xmm1 = mem[0],zero
	movsd	%xmm1, (%rbx)
	movsd	%xmm0, (%r14)
	jmp	.LBB11_10
.LBB11_9:
	movsd	(%r15), %xmm1                   # xmm1 = mem[0],zero
	movsd	%xmm1, (%rbx)
	movsd	%xmm0, (%r15)
.LBB11_10:
	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_end11:
	.size	_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_, .Lfunc_end11-_ZSt22__move_median_to_firstIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_SC_SC_T0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_,"axG",@progbits,_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_,comdat
	.weak	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_ # -- Begin function _ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_
	.type	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_,@function
_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_: # @_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_
	.cfi_startproc
# %bb.0:
	cmpq	%rsi, %rdi
	je	.LBB12_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	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.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
	movq	%rdi, %r15
	leaq	8(%rdi), %rax
	cmpq	%rsi, %rax
	je	.LBB12_13
# %bb.2:                                # %.lr.ph
	movq	%rdx, %rbx
	movq	%r15, %r13
.LBB12_3:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB12_8 Depth 2
	movq	%r13, %r12
	movq	%rax, %r13
	movsd	8(%r12), %xmm0                  # xmm0 = mem[0],zero
	movsd	(%r15), %xmm1                   # xmm1 = mem[0],zero
	callq	*%rbx
	movsd	8(%r12), %xmm0                  # xmm0 = mem[0],zero
	testb	%al, %al
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	je	.LBB12_6
# %bb.4:                                #   in Loop: Header=BB12_3 Depth=1
	movq	%r13, %rdx
	subq	%r15, %rdx
	movq	%rdx, %rax
	sarq	$3, %rax
	cmpq	$2, %rax
	jl	.LBB12_10
# %bb.5:                                #   in Loop: Header=BB12_3 Depth=1
	shlq	$3, %rax
	subq	%rax, %r12
	addq	$16, %r12
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	memmove@PLT
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
.LBB12_12:                              # %_ZSt13move_backwardIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES6_ET0_T_S8_S7_.exit
                                        #   in Loop: Header=BB12_3 Depth=1
	movq	%r15, %rbp
	jmp	.LBB12_9
.LBB12_6:                               #   in Loop: Header=BB12_3 Depth=1
	movsd	(%r12), %xmm1                   # xmm1 = mem[0],zero
	callq	*%rbx
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movq	%r13, %rbp
	testb	%al, %al
	je	.LBB12_9
# %bb.7:                                # %.lr.ph.i.preheader
                                        #   in Loop: Header=BB12_3 Depth=1
	movq	%r13, %rcx
.LBB12_8:                               # %.lr.ph.i
                                        #   Parent Loop BB12_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	leaq	-8(%rcx), %rbp
	movsd	-16(%rcx), %xmm1                # xmm1 = mem[0],zero
	movsd	-8(%rcx), %xmm2                 # xmm2 = mem[0],zero
	movsd	%xmm2, (%rcx)
	callq	*%rbx
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movq	%rbp, %rcx
	testb	%al, %al
	jne	.LBB12_8
.LBB12_9:                               # %_ZSt13move_backwardIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES6_ET0_T_S8_S7_.exit
                                        #   in Loop: Header=BB12_3 Depth=1
	movsd	%xmm0, (%rbp)
	leaq	8(%r13), %rax
	cmpq	%r14, %rax
	jne	.LBB12_3
	jmp	.LBB12_13
.LBB12_10:                              #   in Loop: Header=BB12_3 Depth=1
	movq	%r15, %rbp
	cmpq	$8, %rdx
	jne	.LBB12_9
# %bb.11:                               #   in Loop: Header=BB12_3 Depth=1
	movsd	(%r15), %xmm1                   # xmm1 = mem[0],zero
	movsd	%xmm1, 8(%r12)
	jmp	.LBB12_12
.LBB12_13:
	addq	$8, %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
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB12_14:                              # %.loopexit
	retq
.Lfunc_end12:
	.size	_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_, .Lfunc_end12-_ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEENS0_5__ops15_Iter_comp_iterIPFbddEEEEvT_SC_T0_
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Error in %s (%d) - Name: %s - String: %s\n"
	.size	.L.str, 42

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/milladgit/cuda-bandwidth/master/bw.hip"
	.size	.L.str.1, 101

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"%s (%d): Error in timer.\n"
	.size	.L.str.2, 26

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Usage: %s <NumberOfDoubleValuesAsVector> <NumberOfVectors> <InnerIterationCount> <OuterIterationCount>\n"
	.size	.L.str.3, 104

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Unacceptable value for <NumberOfVectors> parameter.\n"
	.size	.L.str.4, 53

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"NumberOfDoubleValuesAsVector: %d\n"
	.size	.L.str.7, 34

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"NumberOfVectors: %d\n"
	.size	.L.str.8, 21

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"InnerIterationCount: %d\n"
	.size	.L.str.9, 25

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"OuterIterationCount: %d\n"
	.size	.L.str.10, 25

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"Warmup...\n"
	.size	.L.str.11, 11

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Warmup...Done\n"
	.size	.L.str.12, 15

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"Main operations...\n"
	.size	.L.str.13, 20

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"Main operations...Done\n"
	.size	.L.str.14, 24

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"Vector size: %d Bytes\n"
	.size	.L.str.17, 23

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"H2D median: %.2fus\n"
	.size	.L.str.18, 20

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"D2H median: %.2fus\n"
	.size	.L.str.19, 20

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"H2D median: %.2fms\n"
	.size	.L.str.20, 20

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"D2H median: %.2fms\n"
	.size	.L.str.21, 20

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"csv_output,%dB,%.2fKB,%.2fMB,%.2fGB,%.2fus,%.2fus\n"
	.size	.L.str.22, 51

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

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

	.type	.Lstr.3,@object                 # @str.3
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr.3:
	.asciz	"\n"
	.size	.Lstr.3, 2

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"\n\nResults:"
	.size	.Lstr.4, 11

	.type	.Lstr.6,@object                 # @str.6
.Lstr.6:
	.asciz	"========================"
	.size	.Lstr.6, 25

	.type	.Lstr.9,@object                 # @str.9
.Lstr.9:
	.asciz	"------------------------"
	.size	.Lstr.9, 25

	.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 _Z7cmpfuncdd
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym _Unwind_Resume
	.addrsig_sym __hip_cuid_

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

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

	.end_amdgpu_metadata
