////////////////////////////////////////////////////////////////////////////
//
// Copyright 1993-2015 NVIDIA Corporation.  All rights reserved.
//
// Please refer to the NVIDIA end user license agreement (EULA) associated
// with this source code for terms and conditions that govern your use of
// this software. Any use, reproduction, disclosure, or distribution of
// this software and related documentation outside the terms of the EULA
// is strictly prohibited.
//
////////////////////////////////////////////////////////////////////////////

/* Template project which demonstrates the basics on how to setup a project
* example application.
* Host code.
*/

// includes, system
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <iostream>
// includes CUDA
#include <cuda_runtime.h>

// includes, project// helper functions for SDK examples
#include "tree.cuh"
#include <algorithm>
#include <fstream>
using namespace std;



bool findHost(int val)
{
	int* result = NULL;
	int host1[] = {2};
	cudaError_t err = cudaMalloc((void **)&result, 1 * sizeof(int));
	if (err != cudaSuccess)
		cout<<"result "<<cudaGetErrorString(err)<<endl;
	cudaMemcpy(result, host1, 1*sizeof(int), cudaMemcpyHostToDevice);
	cout<<host1[0]<<endl;
	while(host1[0] < 5)
	{
		searchBetter<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(val , result);
		err = cudaThreadSynchronize();
		cudaMemcpy(host1, result, 1*sizeof(int),  cudaMemcpyDeviceToHost);
		err = cudaThreadSynchronize();
		if(host1[0] > 0)
			cout<<host1[0]<<endl;
	}
	containsBetter<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(val, result);
	err = cudaThreadSynchronize();
	cudaMemcpy(host1, result, 1*sizeof(int),  cudaMemcpyDeviceToHost);
	err = cudaThreadSynchronize();
	if(host1[0] == 1)
	{
		cout<<"FOUND"<<endl;
		return true;
	}
	else
	{
		cout<<"NOT FOUND"<<endl;
		return false;
	}
}

void splitHost(node* node1)
{
	node* nn;
	createNewNode<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(nn);
	cudaThreadSynchronize();
	copyToNewNode<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(nn);
	cudaThreadSynchronize();
}

void insertHost(node* node)
{
	int* fullDevice = NULL;
	int fullHost[1];
	cudaError_t err = cudaMalloc((void **)&fullDevice, 1 * sizeof(int));
	cudaThreadSynchronize();
	copyNode<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(node, fullDevice);
	cudaMemcpy(fullHost, fullDevice, 1*sizeof(int),  cudaMemcpyDeviceToHost);
	cudaThreadSynchronize();
	addValue<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(node);
	cudaThreadSynchronize();
	if(fullHost[0])
		splitHost(node);
}

void splitHost(int val)
{
	node* newNode;
	createNewNode<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(newNode);
	cudaThreadSynchronize();
	copyToNewNode<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(newNode);
	cudaThreadSynchronize();
	insertHost(newNode);
}

void insertHost(int val)
{
	if(findHost(val))
		return;
	int* fullDevice = NULL;
	int fullHost[1];
	cudaError_t err = cudaMalloc((void **)&fullDevice, 1 * sizeof(int));
	cudaThreadSynchronize();
	copyNode<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(val, fullDevice);
	cudaMemcpy(fullHost, fullDevice, 1*sizeof(int),  cudaMemcpyDeviceToHost);
	cudaThreadSynchronize();
	addValue<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(val);
	cudaThreadSynchronize();
	if(fullHost[0])
		splitHost(val);
}

int main(int argc, char **argv)
{
	string filename="/home/piotr/Uczelnia/Cuda/BTree/testfile";
	int* initValues = (int*)malloc(INPUTSIZE*sizeof(int));
	node* root;
	ifstream file(filename.c_str());
	string line;
	int i =0;
	while(getline(file, line))
	{
		initValues[i] = atoi(line.c_str());
		i++;
	}
	sort(initValues, initValues+INPUTSIZE);
    int* input = NULL;
    int* result = NULL;
    int* results = NULL;
    int* values = NULL;
    int myArray[3] = { -1, 898386, 40156 };
    int host[1], hostResults[3];
    cudaError_t err = cudaMalloc((void **)&input, INPUTSIZE * sizeof(int));
    if (err != cudaSuccess)
    	cout<<"input "<<cudaGetErrorString(err)<<endl;
    err = cudaMalloc((void **)&root, sizeof(node));
	if (err != cudaSuccess)
		cout<<"root "<<cudaGetErrorString(err)<<endl;
    err = cudaMalloc((void **)&result, 1 * sizeof(int));
    if (err != cudaSuccess)
    	cout<<"result "<<cudaGetErrorString(err)<<endl;
    err = cudaMalloc((void **)&results, 3 * sizeof(int));
	if (err != cudaSuccess)
		cout<<"results "<<cudaGetErrorString(err)<<endl;
	err = cudaMalloc((void **)&values, 3 * sizeof(int));
	if (err != cudaSuccess)
		cout<<"values "<<cudaGetErrorString(err)<<endl;
    err = cudaMemcpy(input, initValues, INPUTSIZE*sizeof(int), cudaMemcpyHostToDevice);
	if (err != cudaSuccess)
		cout<<"copy input "<<cudaGetErrorString(err)<<endl;
	err = cudaMemcpy(values, myArray, 3*sizeof(int), cudaMemcpyHostToDevice);
	if (err != cudaSuccess)
			cout<<"copy values "<<cudaGetErrorString(err)<<endl;
	cudaDeviceSetLimit(cudaLimitMallocHeapSize, 512000000);
    buildLeaves<<<INPUTSIZE/BLOCKSIZE + 1, BLOCKSIZE>>>(root, input, result);
    err = cudaThreadSynchronize();
    if (err != cudaSuccess)
    	cout<<"buildLeaves "<<cudaGetErrorString(err)<<endl;
    fillLeaves<<<INPUTSIZE/BLOCKSIZE + 1, BLOCKSIZE>>>(root, input, result);
    err = cudaThreadSynchronize();
    if (err != cudaSuccess)
    	cout<<"fillLeaves "<<cudaGetErrorString(err)<<endl;
    int size = INPUTSIZE / ((ORDER/2)-1);
    int sw = 1;
    int level =0;
    while(size > ORDER)
    {
    	cout<<"Size of level "<<level<<": "<<size<<endl;
    	buildLevel<<<INPUTSIZE/BLOCKSIZE + 1, BLOCKSIZE>>>(root, input, result, size, sw);
    	err = cudaThreadSynchronize();
		if (err != cudaSuccess)
			cout<<"buildlevel "<<cudaGetErrorString(err)<<endl;
    	fillLevel<<<INPUTSIZE/BLOCKSIZE + 1, BLOCKSIZE>>>(root, input, result, size, sw);
    	err = cudaThreadSynchronize();
		if (err != cudaSuccess)
			cout<<"filllevel "<<cudaGetErrorString(err)<<endl;
    	size = size /(ORDER/2);
    	sw = 1 - sw;
    	level++;
    }
    cout<<"Size of level "<<level<<": "<<size<<endl;
    buildRoot<<<INPUTSIZE/BLOCKSIZE + 1, BLOCKSIZE>>>(root, input, result);
	err = cudaThreadSynchronize();
	if (err != cudaSuccess)
		cout<<"build root "<<cudaGetErrorString(err)<<endl;
	fillRoot<<<INPUTSIZE/BLOCKSIZE + 1, BLOCKSIZE>>>(root, input, result, size, sw);
	if (err != cudaSuccess)
		cout<<"fill root "<<cudaGetErrorString(err)<<endl;
	err = cudaThreadSynchronize();
    //test<<<(INPUTSIZE/BLOCKSIZE), BLOCKSIZE>>>(root, input, result);
	int v = -1;
	findHost(97861);
	insertHost(-1);
	findHost(-1);
	search<<<1, BLOCKSIZE>>>(v, result);
    err = cudaThreadSynchronize();
    if (err != cudaSuccess)
       	cout<<"1st search call "<<cudaGetErrorString(err)<<endl;
    cudaMemcpy(host, result, 1*sizeof(int), cudaMemcpyDeviceToHost);
    if (err != cudaSuccess)
        	cout<<"copying result "<<cudaGetErrorString(err)<<endl;

    int f = 0;
    for(int i=0; i<INPUTSIZE; i++)
    {
    	if(initValues[i] == v)
    		f = 1;
    }
    cout<<host[0]<<" "<<f<<endl;
    search<<<3, BLOCKSIZE>>>(values, results, 3);
    err = cudaThreadSynchronize();
    if (err != cudaSuccess)
    		cout<<"multiple search call "<<cudaGetErrorString(err)<<endl;
    cudaMemcpy(hostResults, results, 3*sizeof(int), cudaMemcpyDeviceToHost);
    for(int i=0; i<3; i++)
    	cout<<hostResults[i]<<endl;
    insertVal<<<1, BLOCKSIZE>>>(v);
    err = cudaThreadSynchronize();
    if (err != cudaSuccess)
    	cout<<"insert call "<<cudaGetErrorString(err)<<endl;
    search<<<1, BLOCKSIZE>>>(v, result);
    err = cudaThreadSynchronize();
    if (err != cudaSuccess)
		cout<<"2nd search call "<<cudaGetErrorString(err)<<endl;
    cudaMemcpy(host, result, 1*sizeof(int), cudaMemcpyDeviceToHost);
    if (err != cudaSuccess)
    	cout<<"copying result "<<cudaGetErrorString(err)<<endl;
    cout<<host[0]<<endl;
    cout<<"end"<<endl;
    cudaFree(input);
    cudaFree(result);
}

	.file	"tmpxft_00283a52_00000000-6_main.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4029:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4029:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.text._ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_.isra.0,"axG",@progbits,_ZSt4sortIPiEvT_S1_,comdat
	.type	_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_.isra.0, @function
_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_.isra.0:
.LFB4780:
	.cfi_startproc
	leaq	-1(%rdx), %rax
	movq	%rsi, %r9
	movl	%ecx, %r8d
	movq	%rdx, %rsi
	movl	$2, %ecx
	cqto
	idivq	%rcx
	movq	%r9, %rcx
.L3:
	cmpq	%rax, %rcx
	jge	.L11
	leaq	1(%rcx), %r10
	movl	-4(%rdi,%r10,8), %r11d
	leaq	(%r10,%r10), %rdx
	cmpl	%r11d, (%rdi,%r10,8)
	jge	.L4
	decq	%rdx
.L4:
	movl	(%rdi,%rdx,4), %r10d
	movl	%r10d, (%rdi,%rcx,4)
	movq	%rdx, %rcx
	jmp	.L3
.L11:
	testl	$1, %esi
	jne	.L6
	leaq	-2(%rsi), %rax
	movl	$2, %esi
	cqto
	idivq	%rsi
	cmpq	%rax, %rcx
	jne	.L6
	leaq	1(%rcx), %rax
	addq	%rax, %rax
	movl	-4(%rdi,%rax,4), %edx
	movl	%edx, (%rdi,%rcx,4)
	leaq	-1(%rax), %rcx
.L6:
	leaq	-1(%rcx), %rax
	movl	$2, %esi
.L9:
	cqto
	idivq	%rsi
	leaq	(%rdi,%rcx,4), %rdx
	cmpq	%rcx, %r9
	jge	.L7
	movl	(%rdi,%rax,4), %ecx
	cmpl	%ecx, %r8d
	jle	.L7
	movl	%ecx, (%rdx)
	leaq	-1(%rax), %rdx
	movq	%rax, %rcx
	movq	%rdx, %rax
	jmp	.L9
.L7:
	movl	%r8d, (%rdx)
	ret
	.cfi_endproc
.LFE4780:
	.size	_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_.isra.0, .-_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_.isra.0
	.text
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB4782:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4782:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.section	.text._ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.isra.0,"axG",@progbits,_ZSt4sortIPiEvT_S1_,comdat
	.type	_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.isra.0, @function
_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.isra.0:
.LFB4783:
	.cfi_startproc
	cmpq	%rsi, %rdi
	jne	.L25
	ret
.L25:
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$4, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	4(%rdi), %rbx
.L15:
	cmpq	%rbx, %r12
	je	.L29
	movl	(%rbx), %r13d
	movl	0(%rbp), %eax
	cmpl	%eax, %r13d
	jge	.L23
	movq	%rbx, %rdx
	subq	%rbp, %rdx
	cmpq	$4, %rdx
	jle	.L17
	movq	%r14, %rdi
	movq	%rbp, %rsi
	subq	%rdx, %rdi
	addq	%rbx, %rdi
	call	memmove@PLT
	jmp	.L18
.L17:
	jne	.L18
	movl	%eax, (%rbx)
.L18:
	movl	%r13d, 0(%rbp)
	jmp	.L19
.L23:
	movq	%rbx, %rax
.L16:
	movl	-4(%rax), %edx
	cmpl	%edx, %r13d
	jge	.L30
	movl	%edx, (%rax)
	subq	$4, %rax
	jmp	.L16
.L30:
	movl	%r13d, (%rax)
.L19:
	addq	$4, %rbx
	jmp	.L15
.L29:
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4783:
	.size	_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.isra.0, .-_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.isra.0
	.section	.text._ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_.isra.0,"axG",@progbits,_ZSt4sortIPiEvT_S1_,comdat
	.type	_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_.isra.0, @function
_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_.isra.0:
.LFB4787:
	.cfi_startproc
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	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
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdi, %rbx
.L32:
	movq	%rbp, %rax
	subq	%rbx, %rax
	cmpq	$64, %rax
	jle	.L31
	movq	%rax, %r14
	sarq	$2, %r14
	testq	%r13, %r13
	jne	.L33
	leaq	-2(%r14), %r12
	sarq	%r12
.L35:
	movl	(%rbx,%r12,4), %ecx
	movq	%r14, %rdx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_.isra.0
	testq	%r12, %r12
	je	.L34
	decq	%r12
	jmp	.L35
.L34:
	movq	%rbp, %rax
	subq	%rbx, %rax
	cmpq	$4, %rax
	jle	.L31
	movl	(%rbx), %eax
	subq	$4, %rbp
	movl	0(%rbp), %ecx
	xorl	%esi, %esi
	movq	%rbp, %rdx
	movq	%rbx, %rdi
	movl	%eax, 0(%rbp)
	subq	%rbx, %rdx
	sarq	$2, %rdx
	call	_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_.isra.0
	jmp	.L34
.L33:
	sarq	$3, %rax
	movl	4(%rbx), %esi
	movl	-4(%rbp), %edx
	leaq	4(%rbx), %r12
	leaq	(%rbx,%rax,4), %rdi
	movl	(%rbx), %eax
	movl	(%rdi), %ecx
	cmpl	%ecx, %esi
	jge	.L37
	cmpl	%edx, %ecx
	jge	.L38
.L55:
	movl	%ecx, (%rbx)
	movl	%eax, (%rdi)
.L41:
	movq	%rbp, %rax
	jmp	.L39
.L38:
	cmpl	%edx, %esi
	jge	.L56
	jmp	.L54
.L37:
	cmpl	%edx, %esi
	jge	.L42
.L56:
	movl	%esi, (%rbx)
	movl	%eax, 4(%rbx)
	jmp	.L41
.L42:
	cmpl	%edx, %ecx
	jge	.L55
.L54:
	movl	%edx, (%rbx)
	movl	%eax, -4(%rbp)
	jmp	.L41
.L48:
	movl	%ecx, (%r12)
	addq	$4, %r12
	movl	%edx, (%rax)
.L39:
	movl	(%rbx), %esi
.L44:
	movl	(%r12), %edx
	cmpl	%esi, %edx
	jge	.L47
	addq	$4, %r12
	jmp	.L44
.L47:
	movl	-4(%rax), %ecx
	subq	$4, %rax
	cmpl	%ecx, %esi
	jl	.L47
	cmpq	%rax, %r12
	jb	.L48
	decq	%r13
	movq	%rbp, %rsi
	movq	%r12, %rdi
	movq	%r12, %rbp
	movq	%r13, %rdx
	call	_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_.isra.0
	jmp	.L32
.L31:
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4787:
	.size	_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_.isra.0, .-_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_.isra.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"result "
.LC1:
	.string	"FOUND"
.LC2:
	.string	"NOT FOUND"
	.text
	.globl	_Z8findHosti
	.type	_Z8findHosti, @function
_Z8findHosti:
.LFB4020:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$4, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	_ZSt4cout(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rdi
	xorl	%eax, %eax
	movl	$2, 36(%rsp)
	movq	%rax, (%rsp)
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L58
	leaq	.LC0(%rip), %rsi
	movl	%eax, %r12d
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %r13
	call	cudaGetErrorString@PLT
	movq	%r13, %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L58:
	movq	(%rsp), %rdi
	leaq	36(%rsp), %r13
	movl	$1, %ecx
	movl	$4, %edx
	movabsq	$4294968320, %r12
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movl	36(%rsp), %esi
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L61:
	cmpl	$4, 36(%rsp)
	movq	%r12, 24(%rsp)
	movabsq	$4294967297, %rdi
	movl	$0, %r9d
	movl	$1, 32(%rsp)
	movl	$0, %r8d
	movq	%r12, %rdx
	movl	$1, %ecx
	movq	%rdi, 12(%rsp)
	movl	$1, %esi
	movl	$1, 20(%rsp)
	jg	.L72
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L60
	movq	(%rsp), %rsi
	movl	%ebp, %edi
	call	_Z12searchBetteriPi@PLT
.L60:
	call	cudaThreadSynchronize@PLT
	movq	(%rsp), %rsi
	movl	$2, %ecx
	movq	%r13, %rdi
	movl	$4, %edx
	call	cudaMemcpy@PLT
	call	cudaThreadSynchronize@PLT
	movl	36(%rsp), %esi
	testl	%esi, %esi
	jle	.L61
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L61
.L72:
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L63
	movq	(%rsp), %rsi
	movl	%ebp, %edi
	call	_Z14containsBetteriPi@PLT
.L63:
	call	cudaThreadSynchronize@PLT
	movq	(%rsp), %rsi
	movl	$2, %ecx
	movq	%r13, %rdi
	movl	$4, %edx
	call	cudaMemcpy@PLT
	call	cudaThreadSynchronize@PLT
	cmpl	$1, 36(%rsp)
	jne	.L64
	leaq	.LC1(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movb	$1, %al
	jmp	.L57
.L64:
	leaq	.LC2(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	xorl	%eax, %eax
.L57:
	movq	40(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L66
	call	__stack_chk_fail@PLT
.L66:
	addq	$56, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4020:
	.size	_Z8findHosti, .-_Z8findHosti
	.globl	_Z9splitHostP4node
	.type	_Z9splitHostP4node, @function
_Z9splitHostP4node:
.LFB4021:
	.cfi_startproc
	endbr64
	movl	$4194305, %edx
	subq	$56, %rsp
	.cfi_def_cfa_offset 64
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$10, %rdx
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	%rdx, 28(%rsp)
	movl	$1, 36(%rsp)
	movq	%rdi, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L74
	leaq	8(%rsp), %rdi
	call	_Z13createNewNodeRP4node@PLT
.L74:
	call	cudaThreadSynchronize@PLT
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$10, %rdx
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movq	%rdx, 28(%rsp)
	movl	$1, 36(%rsp)
	movq	%rdi, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L75
	leaq	8(%rsp), %rdi
	call	_Z13copyToNewNodeRP4node@PLT
.L75:
	call	cudaThreadSynchronize@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L76
	call	__stack_chk_fail@PLT
.L76:
	addq	$56, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4021:
	.size	_Z9splitHostP4node, .-_Z9splitHostP4node
	.globl	_Z10insertHostP4node
	.type	_Z10insertHostP4node, @function
_Z10insertHostP4node:
.LFB4022:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$4, %esi
	movq	%rdi, %rbx
	subq	$48, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rdi
	xorl	%eax, %eax
	movq	%rax, (%rsp)
	call	cudaMalloc@PLT
	call	cudaThreadSynchronize@PLT
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$10, %rdx
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movq	%rdx, 24(%rsp)
	movl	$1, 32(%rsp)
	movq	%rdi, 12(%rsp)
	movl	$1, 20(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L79
	movq	(%rsp), %rsi
	movq	%rbx, %rdi
	call	_Z8copyNodeP4nodePi@PLT
.L79:
	movq	(%rsp), %rsi
	leaq	36(%rsp), %rdi
	movl	$2, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	call	cudaThreadSynchronize@PLT
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$10, %rdx
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movq	%rdx, 24(%rsp)
	movl	$1, 32(%rsp)
	movq	%rdi, 12(%rsp)
	movl	$1, 20(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L80
	movq	%rbx, %rdi
	call	_Z8addValueP4node@PLT
.L80:
	call	cudaThreadSynchronize@PLT
	cmpl	$0, 36(%rsp)
	je	.L78
	movq	%rbx, %rdi
	call	_Z9splitHostP4node
.L78:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L82
	call	__stack_chk_fail@PLT
.L82:
	addq	$48, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4022:
	.size	_Z10insertHostP4node, .-_Z10insertHostP4node
	.globl	_Z9splitHosti
	.type	_Z9splitHosti, @function
_Z9splitHosti:
.LFB4023:
	.cfi_startproc
	endbr64
	movl	$4194305, %edx
	subq	$56, %rsp
	.cfi_def_cfa_offset 64
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$10, %rdx
	movl	$1, %ecx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	%rdx, 28(%rsp)
	movl	$1, 36(%rsp)
	movq	%rdi, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L85
	leaq	8(%rsp), %rdi
	call	_Z13createNewNodeRP4node@PLT
.L85:
	call	cudaThreadSynchronize@PLT
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$10, %rdx
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movq	%rdx, 28(%rsp)
	movl	$1, 36(%rsp)
	movq	%rdi, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L86
	leaq	8(%rsp), %rdi
	call	_Z13copyToNewNodeRP4node@PLT
.L86:
	call	cudaThreadSynchronize@PLT
	movq	8(%rsp), %rdi
	call	_Z10insertHostP4node
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L87
	call	__stack_chk_fail@PLT
.L87:
	addq	$56, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4023:
	.size	_Z9splitHosti, .-_Z9splitHosti
	.globl	_Z10insertHosti
	.type	_Z10insertHosti, @function
_Z10insertHosti:
.LFB4024:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%edi, %ebx
	subq	$48, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	_Z8findHosti
	testb	%al, %al
	jne	.L89
	xorl	%eax, %eax
	movq	%rsp, %rdi
	movl	$4, %esi
	movq	%rax, (%rsp)
	call	cudaMalloc@PLT
	call	cudaThreadSynchronize@PLT
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$10, %rdx
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movq	%rdx, 12(%rsp)
	movl	$1, 20(%rsp)
	movq	%rdi, 24(%rsp)
	movl	$1, 32(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L91
	movq	(%rsp), %rsi
	movl	%ebx, %edi
	call	_Z8copyNodeiPi@PLT
.L91:
	movq	(%rsp), %rsi
	leaq	36(%rsp), %rdi
	movl	$2, %ecx
	movl	$4, %edx
	call	cudaMemcpy@PLT
	call	cudaThreadSynchronize@PLT
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$10, %rdx
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movq	%rdx, 12(%rsp)
	movl	$1, 20(%rsp)
	movq	%rdi, 24(%rsp)
	movl	$1, 32(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L92
	movl	%ebx, %edi
	call	_Z8addValuei@PLT
.L92:
	call	cudaThreadSynchronize@PLT
	cmpl	$0, 36(%rsp)
	je	.L89
	movl	%ebx, %edi
	call	_Z9splitHosti
.L89:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L94
	call	__stack_chk_fail@PLT
.L94:
	addq	$48, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4024:
	.size	_Z10insertHosti, .-_Z10insertHosti
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4052:
	.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
.LFE4052:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZSt4sortIPiEvT_S1_,"axG",@progbits,_ZSt4sortIPiEvT_S1_,comdat
	.weak	_ZSt4sortIPiEvT_S1_
	.type	_ZSt4sortIPiEvT_S1_, @function
_ZSt4sortIPiEvT_S1_:
.LFB4386:
	.cfi_startproc
	endbr64
	cmpq	%rsi, %rdi
	je	.L110
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	subq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rsi, %rbx
	movq	%rbp, %rax
	sarq	$2, %rax
	subq	$24, %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_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_.isra.0
	cmpq	$64, %rbp
	movq	8(%rsp), %rdi
	jle	.L102
	leaq	64(%rdi), %rbp
	movq	%rbp, %rsi
	call	_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.isra.0
.L103:
	cmpq	%rbp, %rbx
	je	.L113
	movl	0(%rbp), %edx
	movq	%rbp, %rax
.L104:
	movl	-4(%rax), %ecx
	cmpl	%ecx, %edx
	jge	.L114
	movl	%ecx, (%rax)
	subq	$4, %rax
	jmp	.L104
.L114:
	movl	%edx, (%rax)
	addq	$4, %rbp
	jmp	.L103
.L102:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movq	%rbx, %rsi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.isra.0
.L113:
	.cfi_restore_state
	addq	$24, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L110:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE4386:
	.size	_ZSt4sortIPiEvT_S1_, .-_ZSt4sortIPiEvT_S1_
	.section	.rodata.str1.1
.LC3:
	.string	"/home/piotr/Uczelnia/Cuda/BTree/testfile"
.LC4:
	.string	"input "
.LC5:
	.string	"root "
.LC6:
	.string	"results "
.LC7:
	.string	"values "
.LC8:
	.string	"copy input "
.LC9:
	.string	"copy values "
.LC10:
	.string	"buildLeaves "
.LC11:
	.string	"Size of level "
.LC12:
	.string	"fillLeaves "
.LC13:
	.string	": "
.LC14:
	.string	"buildlevel "
.LC15:
	.string	"filllevel "
.LC16:
	.string	"build root "
.LC17:
	.string	"fill root "
.LC18:
	.string	"1st search call "
.LC19:
	.string	"copying result "
.LC20:
	.string	" "
.LC21:
	.string	"multiple search call "
.LC22:
	.string	"insert call "
.LC23:
	.string	"2nd search call "
.LC24:
	.string	"end"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4025:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4025
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%edx, %edx
	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	$728, %rsp
	.cfi_def_cfa_offset 784
	movq	%fs:40, %rax
	movq	%rax, 712(%rsp)
	xorl	%eax, %eax
	leaq	128(%rsp), %rax
	leaq	88(%rsp), %rsi
	movq	$40, 88(%rsp)
	movq	%rax, 16(%rsp)
	movq	16(%rsp), %rdi
	leaq	144(%rsp), %rax
	movq	%rax, 128(%rsp)
.LEHB0:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
.LEHE0:
	leaq	40+.LC3(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, 128(%rsp)
	movq	88(%rsp), %rax
	leaq	-40(%rdx), %rsi
	movq	%rax, 144(%rsp)
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	88(%rsp), %rax
	movl	$4000000, %edi
	movq	128(%rsp), %rdx
	movq	%rax, 136(%rsp)
	movb	$0, (%rdx,%rax)
	call	malloc@PLT
	movq	128(%rsp), %rsi
	movl	$8, %edx
	movq	%rax, %rbp
	leaq	192(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
.LEHB1:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE1:
	leaq	176(%rsp), %rax
	xorl	%edx, %edx
	movb	$0, 176(%rsp)
	movq	%rbp, %rbx
	movq	%rax, 160(%rsp)
	leaq	160(%rsp), %rax
	movq	%rdx, 168(%rsp)
	movq	%rax, 24(%rsp)
.L116:
	movq	24(%rsp), %rsi
	movq	8(%rsp), %rdi
.LEHB2:
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L225
	movq	160(%rsp), %rdi
	addq	$4, %rbx
	call	atoi@PLT
	movl	%eax, -4(%rbx)
	jmp	.L116
.L225:
	leaq	4000000(%rbp), %rsi
	movq	%rbp, %rdi
	call	_ZSt4sortIPiEvT_S1_
	xorl	%eax, %eax
	leaq	40(%rsp), %rdi
	movl	$4000000, %esi
	movq	%rax, 40(%rsp)
	movq	%rax, 48(%rsp)
	movq	%rax, 56(%rsp)
	movq	%rax, 64(%rsp)
	movabsq	$3858542784151551, %rax
	movq	%rax, 104(%rsp)
	movl	$40156, 112(%rsp)
	call	cudaMalloc@PLT
	testl	%eax, %eax
	movl	%eax, %r12d
	leaq	_ZSt4cout(%rip), %rbx
	jne	.L118
.L120:
	leaq	32(%rsp), %r12
	movl	$40, %esi
	movq	%r12, %rdi
	call	cudaMalloc@PLT
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	.L121
	jmp	.L123
.L118:
	leaq	.LC4(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %r13
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L120
.L121:
	leaq	.LC5(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %edi
	movq	%rax, %r14
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L123:
	leaq	48(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	movl	%eax, %r13d
	testl	%eax, %eax
	je	.L126
	leaq	.LC0(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %edi
	movq	%rax, %r14
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L126:
	leaq	56(%rsp), %rdi
	movl	$12, %esi
	call	cudaMalloc@PLT
	movl	%eax, %r13d
	testl	%eax, %eax
	je	.L129
	leaq	.LC6(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %edi
	movq	%rax, %r14
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L129:
	leaq	64(%rsp), %rdi
	movl	$12, %esi
	call	cudaMalloc@PLT
	movl	%eax, %r13d
	testl	%eax, %eax
	je	.L132
	leaq	.LC7(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %edi
	movq	%rax, %r14
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L132:
	movq	40(%rsp), %rdi
	movl	$1, %ecx
	movl	$4000000, %edx
	movq	%rbp, %rsi
	call	cudaMemcpy@PLT
	movl	%eax, %r13d
	testl	%eax, %eax
	je	.L135
	leaq	.LC8(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %edi
	movq	%rax, %r14
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L135:
	movq	64(%rsp), %rdi
	leaq	104(%rsp), %rsi
	movl	$1, %ecx
	movl	$12, %edx
	call	cudaMemcpy@PLT
	movl	%eax, %r13d
	testl	%eax, %eax
	je	.L138
	leaq	.LC9(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %edi
	movq	%rax, %r14
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L138:
	movl	$512000000, %esi
	movl	$2, %edi
	call	cudaDeviceSetLimit@PLT
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$10, %rdx
	movl	$1, %esi
	movabsq	$4294968273, %rdi
	movl	$1, 96(%rsp)
	movq	%rdx, 88(%rsp)
	movq	%rdi, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L139
.L141:
	call	cudaThreadSynchronize@PLT
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	.L142
	jmp	.L144
.L139:
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rsi
	movq	%r12, %rdi
	call	_Z11buildLeavesRP4nodePiS2_@PLT
	jmp	.L141
.L142:
	leaq	.LC10(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %edi
	movq	%rax, %r14
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L144:
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$10, %rdx
	movl	$1, %esi
	movabsq	$4294968273, %rdi
	movl	$1, 96(%rsp)
	movq	%rdx, 88(%rsp)
	movq	%rdi, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L147
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rsi
	movq	%r12, %rdi
	call	_Z10fillLeavesRP4nodePiS2_@PLT
.L147:
	call	cudaThreadSynchronize@PLT
	movl	%eax, %r13d
	testl	%eax, %eax
	je	.L150
	leaq	.LC12(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %edi
	movq	%rax, %r14
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L150:
	leaq	.LC11(%rip), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	xorl	%esi, %esi
	call	_ZNSolsEi@PLT
	leaq	.LC13(%rip), %r13
	movq	%rax, %rdi
	movq	%r13, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$3921, %esi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$10, %rdx
	movl	$1, %esi
	movabsq	$4294968273, %rdi
	movl	$1, 96(%rsp)
	movq	%rdx, 88(%rsp)
	movq	%rdi, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L151
.L153:
	call	cudaThreadSynchronize@PLT
	testl	%eax, %eax
	movl	%eax, %r12d
	leaq	_ZSt4cout(%rip), %rbx
	jne	.L154
	jmp	.L156
.L151:
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rsi
	movl	$3921, %ecx
	movq	%r12, %rdi
	movl	$1, %r8d
	call	_Z10buildLevelRP4nodePiS2_ii@PLT
	jmp	.L153
.L154:
	leaq	.LC14(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %r15
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L156:
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$10, %rdx
	movl	$1, %esi
	movabsq	$4294968273, %rdi
	movl	$1, 96(%rsp)
	movq	%rdx, 88(%rsp)
	movq	%rdi, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L159
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rsi
	leaq	32(%rsp), %rdi
	movl	$1, %r8d
	movl	$3921, %ecx
	call	_Z9fillLevelRP4nodePiS2_ii@PLT
.L159:
	call	cudaThreadSynchronize@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L162
	leaq	.LC15(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %r15
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r15, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L162:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$1, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movq	%r13, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$15, %esi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$10, %rdx
	movl	$1, %esi
	movabsq	$4294968273, %rdi
	movl	$1, 96(%rsp)
	movq	%rdx, 88(%rsp)
	movq	%rdi, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L163
.L165:
	call	cudaThreadSynchronize@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	.L166
	jmp	.L168
.L163:
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rsi
	leaq	32(%rsp), %rdi
	call	_Z9buildRootRP4nodePiS2_@PLT
	jmp	.L165
.L166:
	leaq	.LC16(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %r13
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L168:
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$10, %rdx
	movl	$1, %esi
	movabsq	$4294968273, %rdi
	movl	$1, 96(%rsp)
	movq	%rdx, 88(%rsp)
	movq	%rdi, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L172
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rsi
	leaq	32(%rsp), %rdi
	xorl	%r8d, %r8d
	movl	$15, %ecx
	call	_Z8fillRootRP4nodePiS2_ii@PLT
.L172:
	testl	%r12d, %r12d
	je	.L171
	leaq	.LC17(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %r13
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L171:
	call	cudaThreadSynchronize@PLT
	movl	$97861, %edi
	call	_Z8findHosti
	orl	$-1, %edi
	call	_Z10insertHosti
	orl	$-1, %edi
	call	_Z8findHosti
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$10, %rdx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 96(%rsp)
	movq	%rdx, 88(%rsp)
	movq	%rdi, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L174
.L176:
	call	cudaThreadSynchronize@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	.L177
	jmp	.L179
.L174:
	movq	48(%rsp), %rsi
	orl	$-1, %edi
	call	_Z6searchiPi@PLT
	jmp	.L176
.L177:
	leaq	.LC18(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %r13
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L179:
	leaq	100(%rsp), %r14
	movq	48(%rsp), %rsi
	movl	$2, %ecx
	movl	$4, %edx
	movq	%r14, %rdi
	call	cudaMemcpy@PLT
	testl	%r12d, %r12d
	jne	.L180
.L182:
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	movl	$1, %edx
	jmp	.L181
.L180:
	leaq	.LC19(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %r13
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L182
.L181:
	cmpl	$-1, 0(%rbp,%rax,4)
	cmove	%edx, %r12d
	incq	%rax
	cmpq	$1000000, %rax
	jne	.L181
	movl	100(%rsp), %esi
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC20(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%r12d, %esi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$10, %rdx
	movl	$1, %esi
	movabsq	$4294967299, %rdi
	movl	$1, 96(%rsp)
	movq	%rdx, 88(%rsp)
	movq	%rdi, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L184
.L186:
	call	cudaThreadSynchronize@PLT
	testl	%eax, %eax
	movl	%eax, %ebp
	leaq	_ZSt4cout(%rip), %rbx
	jne	.L187
	jmp	.L189
.L184:
	movq	56(%rsp), %rsi
	movq	64(%rsp), %rdi
	movl	$3, %edx
	call	_Z6searchPiS_i@PLT
	jmp	.L186
.L187:
	leaq	.LC21(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %edi
	movq	%rax, %r12
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L189:
	leaq	116(%rsp), %r12
	movq	56(%rsp), %rsi
	movl	$2, %ecx
	movl	$12, %edx
	movq	%r12, %rdi
	call	cudaMemcpy@PLT
	xorl	%ebp, %ebp
	jmp	.L188
.L227:
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	incq	%rbp
	cmpq	$3, %rbp
	je	.L226
.L188:
	movl	(%r12,%rbp,4), %esi
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	jmp	.L227
.L226:
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$10, %rdx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 96(%rsp)
	movq	%rdx, 88(%rsp)
	movq	%rdi, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L190
.L192:
	call	cudaThreadSynchronize@PLT
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.L193
	jmp	.L195
.L190:
	orl	$-1, %edi
	call	_Z9insertVali@PLT
	jmp	.L192
.L193:
	leaq	.LC22(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %edi
	movq	%rax, %r12
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L195:
	movl	$4194305, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$10, %rdx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 96(%rsp)
	movq	%rdx, 88(%rsp)
	movq	%rdi, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L198
	movq	48(%rsp), %rsi
	orl	$-1, %edi
	call	_Z6searchiPi@PLT
.L198:
	call	cudaThreadSynchronize@PLT
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L201
	leaq	.LC23(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %edi
	movq	%rax, %r12
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L201:
	movq	48(%rsp), %rsi
	movl	$2, %ecx
	movl	$4, %edx
	movq	%r14, %rdi
	call	cudaMemcpy@PLT
	testl	%ebp, %ebp
	jne	.L202
.L204:
	movl	100(%rsp), %esi
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L228
.L202:
	leaq	.LC19(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %edi
	movq	%rax, %r12
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L204
.L228:
	leaq	.LC24(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
.LEHE2:
	leaq	160(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	leaq	192(%rsp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	leaq	128(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	712(%rsp), %rax
	subq	%fs:40, %rax
	je	.L208
	jmp	.L223
.L212:
	endbr64
	movq	%rax, %rbx
.L205:
	movq	24(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L206
.L211:
	endbr64
	movq	%rax, %rbx
.L206:
	movq	16(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	712(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L223
	movq	%rbx, %rdi
.LEHB3:
	call	_Unwind_Resume@PLT
.LEHE3:
.L223:
	call	__stack_chk_fail@PLT
.L208:
	addq	$728, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4025:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4025:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4025-.LLSDACSB4025
.LLSDACSB4025:
	.uleb128 .LEHB0-.LFB4025
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4025
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L211-.LFB4025
	.uleb128 0
	.uleb128 .LEHB2-.LFB4025
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L212-.LFB4025
	.uleb128 0
	.uleb128 .LEHB3-.LFB4025
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
.LLSDACSE4025:
	.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
	.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:

////////////////////////////////////////////////////////////////////////////
//
// Copyright 1993-2015 NVIDIA Corporation.  All rights reserved.
//
// Please refer to the NVIDIA end user license agreement (EULA) associated
// with this source code for terms and conditions that govern your use of
// this software. Any use, reproduction, disclosure, or distribution of
// this software and related documentation outside the terms of the EULA
// is strictly prohibited.
//
////////////////////////////////////////////////////////////////////////////

/* Template project which demonstrates the basics on how to setup a project
* example application.
* Host code.
*/

// includes, system
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <iostream>
// includes CUDA
#include <hip/hip_runtime.h>

// includes, project// helper functions for SDK examples
#include "tree.cuh"
#include <algorithm>
#include <fstream>
using namespace std;



bool findHost(int val)
{
	int* result = NULL;
	int host1[] = {2};
	hipError_t err = hipMalloc((void **)&result, 1 * sizeof(int));
	if (err != hipSuccess)
		cout<<"result "<<hipGetErrorString(err)<<endl;
	hipMemcpy(result, host1, 1*sizeof(int), hipMemcpyHostToDevice);
	cout<<host1[0]<<endl;
	while(host1[0] < 5)
	{
		searchBetter<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(val , result);
		err = hipDeviceSynchronize();
		hipMemcpy(host1, result, 1*sizeof(int),  hipMemcpyDeviceToHost);
		err = hipDeviceSynchronize();
		if(host1[0] > 0)
			cout<<host1[0]<<endl;
	}
	containsBetter<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(val, result);
	err = hipDeviceSynchronize();
	hipMemcpy(host1, result, 1*sizeof(int),  hipMemcpyDeviceToHost);
	err = hipDeviceSynchronize();
	if(host1[0] == 1)
	{
		cout<<"FOUND"<<endl;
		return true;
	}
	else
	{
		cout<<"NOT FOUND"<<endl;
		return false;
	}
}

void splitHost(node* node1)
{
	node* nn;
	createNewNode<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(nn);
	hipDeviceSynchronize();
	copyToNewNode<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(nn);
	hipDeviceSynchronize();
}

void insertHost(node* node)
{
	int* fullDevice = NULL;
	int fullHost[1];
	hipError_t err = hipMalloc((void **)&fullDevice, 1 * sizeof(int));
	hipDeviceSynchronize();
	copyNode<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(node, fullDevice);
	hipMemcpy(fullHost, fullDevice, 1*sizeof(int),  hipMemcpyDeviceToHost);
	hipDeviceSynchronize();
	addValue<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(node);
	hipDeviceSynchronize();
	if(fullHost[0])
		splitHost(node);
}

void splitHost(int val)
{
	node* newNode;
	createNewNode<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(newNode);
	hipDeviceSynchronize();
	copyToNewNode<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(newNode);
	hipDeviceSynchronize();
	insertHost(newNode);
}

void insertHost(int val)
{
	if(findHost(val))
		return;
	int* fullDevice = NULL;
	int fullHost[1];
	hipError_t err = hipMalloc((void **)&fullDevice, 1 * sizeof(int));
	hipDeviceSynchronize();
	copyNode<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(val, fullDevice);
	hipMemcpy(fullHost, fullDevice, 1*sizeof(int),  hipMemcpyDeviceToHost);
	hipDeviceSynchronize();
	addValue<<<(ORDER + BLOCKSIZE -1) / BLOCKSIZE, BLOCKSIZE>>>(val);
	hipDeviceSynchronize();
	if(fullHost[0])
		splitHost(val);
}

int main(int argc, char **argv)
{
	string filename="/home/piotr/Uczelnia/Cuda/BTree/testfile";
	int* initValues = (int*)malloc(INPUTSIZE*sizeof(int));
	node* root;
	ifstream file(filename.c_str());
	string line;
	int i =0;
	while(getline(file, line))
	{
		initValues[i] = atoi(line.c_str());
		i++;
	}
	sort(initValues, initValues+INPUTSIZE);
    int* input = NULL;
    int* result = NULL;
    int* results = NULL;
    int* values = NULL;
    int myArray[3] = { -1, 898386, 40156 };
    int host[1], hostResults[3];
    hipError_t err = hipMalloc((void **)&input, INPUTSIZE * sizeof(int));
    if (err != hipSuccess)
    	cout<<"input "<<hipGetErrorString(err)<<endl;
    err = hipMalloc((void **)&root, sizeof(node));
	if (err != hipSuccess)
		cout<<"root "<<hipGetErrorString(err)<<endl;
    err = hipMalloc((void **)&result, 1 * sizeof(int));
    if (err != hipSuccess)
    	cout<<"result "<<hipGetErrorString(err)<<endl;
    err = hipMalloc((void **)&results, 3 * sizeof(int));
	if (err != hipSuccess)
		cout<<"results "<<hipGetErrorString(err)<<endl;
	err = hipMalloc((void **)&values, 3 * sizeof(int));
	if (err != hipSuccess)
		cout<<"values "<<hipGetErrorString(err)<<endl;
    err = hipMemcpy(input, initValues, INPUTSIZE*sizeof(int), hipMemcpyHostToDevice);
	if (err != hipSuccess)
		cout<<"copy input "<<hipGetErrorString(err)<<endl;
	err = hipMemcpy(values, myArray, 3*sizeof(int), hipMemcpyHostToDevice);
	if (err != hipSuccess)
			cout<<"copy values "<<hipGetErrorString(err)<<endl;
	hipDeviceSetLimit(hipLimitMallocHeapSize, 512000000);
    buildLeaves<<<INPUTSIZE/BLOCKSIZE + 1, BLOCKSIZE>>>(root, input, result);
    err = hipDeviceSynchronize();
    if (err != hipSuccess)
    	cout<<"buildLeaves "<<hipGetErrorString(err)<<endl;
    fillLeaves<<<INPUTSIZE/BLOCKSIZE + 1, BLOCKSIZE>>>(root, input, result);
    err = hipDeviceSynchronize();
    if (err != hipSuccess)
    	cout<<"fillLeaves "<<hipGetErrorString(err)<<endl;
    int size = INPUTSIZE / ((ORDER/2)-1);
    int sw = 1;
    int level =0;
    while(size > ORDER)
    {
    	cout<<"Size of level "<<level<<": "<<size<<endl;
    	buildLevel<<<INPUTSIZE/BLOCKSIZE + 1, BLOCKSIZE>>>(root, input, result, size, sw);
    	err = hipDeviceSynchronize();
		if (err != hipSuccess)
			cout<<"buildlevel "<<hipGetErrorString(err)<<endl;
    	fillLevel<<<INPUTSIZE/BLOCKSIZE + 1, BLOCKSIZE>>>(root, input, result, size, sw);
    	err = hipDeviceSynchronize();
		if (err != hipSuccess)
			cout<<"filllevel "<<hipGetErrorString(err)<<endl;
    	size = size /(ORDER/2);
    	sw = 1 - sw;
    	level++;
    }
    cout<<"Size of level "<<level<<": "<<size<<endl;
    buildRoot<<<INPUTSIZE/BLOCKSIZE + 1, BLOCKSIZE>>>(root, input, result);
	err = hipDeviceSynchronize();
	if (err != hipSuccess)
		cout<<"build root "<<hipGetErrorString(err)<<endl;
	fillRoot<<<INPUTSIZE/BLOCKSIZE + 1, BLOCKSIZE>>>(root, input, result, size, sw);
	if (err != hipSuccess)
		cout<<"fill root "<<hipGetErrorString(err)<<endl;
	err = hipDeviceSynchronize();
    //test<<<(INPUTSIZE/BLOCKSIZE), BLOCKSIZE>>>(root, input, result);
	int v = -1;
	findHost(97861);
	insertHost(-1);
	findHost(-1);
	search<<<1, BLOCKSIZE>>>(v, result);
    err = hipDeviceSynchronize();
    if (err != hipSuccess)
       	cout<<"1st search call "<<hipGetErrorString(err)<<endl;
    hipMemcpy(host, result, 1*sizeof(int), hipMemcpyDeviceToHost);
    if (err != hipSuccess)
        	cout<<"copying result "<<hipGetErrorString(err)<<endl;

    int f = 0;
    for(int i=0; i<INPUTSIZE; i++)
    {
    	if(initValues[i] == v)
    		f = 1;
    }
    cout<<host[0]<<" "<<f<<endl;
    search<<<3, BLOCKSIZE>>>(values, results, 3);
    err = hipDeviceSynchronize();
    if (err != hipSuccess)
    		cout<<"multiple search call "<<hipGetErrorString(err)<<endl;
    hipMemcpy(hostResults, results, 3*sizeof(int), hipMemcpyDeviceToHost);
    for(int i=0; i<3; i++)
    	cout<<hostResults[i]<<endl;
    insertVal<<<1, BLOCKSIZE>>>(v);
    err = hipDeviceSynchronize();
    if (err != hipSuccess)
    	cout<<"insert call "<<hipGetErrorString(err)<<endl;
    search<<<1, BLOCKSIZE>>>(v, result);
    err = hipDeviceSynchronize();
    if (err != hipSuccess)
		cout<<"2nd search call "<<hipGetErrorString(err)<<endl;
    hipMemcpy(host, result, 1*sizeof(int), hipMemcpyDeviceToHost);
    if (err != hipSuccess)
    	cout<<"copying result "<<hipGetErrorString(err)<<endl;
    cout<<host[0]<<endl;
    cout<<"end"<<endl;
    hipFree(input);
    hipFree(result);
}

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

                                        # End of file scope inline assembly
	.globl	_Z8findHosti                    # -- Begin function _Z8findHosti
	.type	_Z8findHosti,@function
_Z8findHosti:                           # @_Z8findHosti
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edi, %ebx
	leaq	16(%rsp), %rdi
	movq	$0, (%rdi)
	movl	$2, 12(%rsp)
	movl	$4, %esi
	callq	hipMalloc
	testl	%eax, %eax
	je	.LBB0_5
# %bb.1:
	movl	%eax, %ebp
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	%ebp, %edi
	callq	hipGetErrorString
	testq	%rax, %rax
	je	.LBB0_2
# %bb.3:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	strlen
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB0_4
.LBB0_2:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.LBB0_4:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.LBB0_5:
	movabsq	$4294967297, %r14               # imm = 0x100000001
	movq	16(%rsp), %rdi
	leaq	12(%rsp), %r15
	movl	$4, %edx
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movl	(%r15), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	cmpl	$4, (%r15)
	jg	.LBB0_12
# %bb.6:                                # %.lr.ph.preheader
	leaq	1023(%r14), %r15
	leaq	12(%rsp), %r12
.LBB0_7:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB0_9
# %bb.8:                                #   in Loop: Header=BB0_7 Depth=1
	movq	16(%rsp), %rsi
	movl	%ebx, %edi
	callq	_Z27__device_stub__searchBetteriPi
.LBB0_9:                                #   in Loop: Header=BB0_7 Depth=1
	callq	hipDeviceSynchronize
	movq	16(%rsp), %rsi
	movl	$4, %edx
	movq	%r12, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	callq	hipDeviceSynchronize
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jle	.LBB0_11
# %bb.10:                               #   in Loop: Header=BB0_7 Depth=1
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r13, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	12(%rsp), %esi
.LBB0_11:                               #   in Loop: Header=BB0_7 Depth=1
	cmpl	$5, %esi
	jl	.LBB0_7
.LBB0_12:                               # %._crit_edge
	leaq	1023(%r14), %rdx
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB0_14
# %bb.13:
	movq	16(%rsp), %rsi
	movl	%ebx, %edi
	callq	_Z29__device_stub__containsBetteriPi
.LBB0_14:
	callq	hipDeviceSynchronize
	movq	16(%rsp), %rsi
	leaq	12(%rsp), %rbx
	movl	$4, %edx
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	callq	hipDeviceSynchronize
	movl	(%rbx), %ebx
	movl	$_ZSt4cout, %edi
	cmpl	$1, %ebx
	jne	.LBB0_16
# %bb.15:
	movl	$.L.str.1, %esi
	movl	$5, %edx
	jmp	.LBB0_17
.LBB0_16:
	movl	$.L.str.2, %esi
	movl	$9, %edx
.LBB0_17:
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	cmpl	$1, %ebx
	sete	%bl
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	%ebx, %eax
	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_end0:
	.size	_Z8findHosti, .Lfunc_end0-_Z8findHosti
	.cfi_endproc
                                        # -- End function
	.globl	_Z9splitHostP4node              # -- Begin function _Z9splitHostP4node
	.type	_Z9splitHostP4node,@function
_Z9splitHostP4node:                     # @_Z9splitHostP4node
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movabsq	$4294967297, %r14               # imm = 0x100000001
	leaq	1023(%r14), %rbx
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_2
# %bb.1:
	movq	%rsp, %rdi
	callq	_Z28__device_stub__createNewNodeRP4node
.LBB1_2:
	callq	hipDeviceSynchronize
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB1_4
# %bb.3:
	movq	%rsp, %rdi
	callq	_Z28__device_stub__copyToNewNodeRP4node
.LBB1_4:
	callq	hipDeviceSynchronize
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z9splitHostP4node, .Lfunc_end1-_Z9splitHostP4node
	.cfi_endproc
                                        # -- End function
	.globl	_Z10insertHostP4node            # -- Begin function _Z10insertHostP4node
	.type	_Z10insertHostP4node,@function
_Z10insertHostP4node:                   # @_Z10insertHostP4node
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movabsq	$4294967297, %r14               # imm = 0x100000001
	leaq	8(%rsp), %rdi
	movq	$0, (%rdi)
	movl	$4, %esi
	callq	hipMalloc
	callq	hipDeviceSynchronize
	leaq	1023(%r14), %r15
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_2
# %bb.1:
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	callq	_Z23__device_stub__copyNodeP4nodePi
.LBB2_2:
	movq	8(%rsp), %rsi
	leaq	4(%rsp), %rdi
	movl	$4, %edx
	movl	$2, %ecx
	callq	hipMemcpy
	callq	hipDeviceSynchronize
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_4
# %bb.3:
	movq	%rbx, %rdi
	callq	_Z23__device_stub__addValueP4node
.LBB2_4:
	callq	hipDeviceSynchronize
	cmpl	$0, 4(%rsp)
	je	.LBB2_6
# %bb.5:
	callq	_Z9splitHostP4node
.LBB2_6:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z10insertHostP4node, .Lfunc_end2-_Z10insertHostP4node
	.cfi_endproc
                                        # -- End function
	.globl	_Z9splitHosti                   # -- Begin function _Z9splitHosti
	.type	_Z9splitHosti,@function
_Z9splitHosti:                          # @_Z9splitHosti
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movabsq	$4294967297, %r14               # imm = 0x100000001
	leaq	1023(%r14), %rbx
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_2
# %bb.1:
	movq	%rsp, %rdi
	callq	_Z28__device_stub__createNewNodeRP4node
.LBB3_2:
	callq	hipDeviceSynchronize
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_4
# %bb.3:
	movq	%rsp, %rdi
	callq	_Z28__device_stub__copyToNewNodeRP4node
.LBB3_4:
	callq	hipDeviceSynchronize
	movq	(%rsp), %rdi
	callq	_Z10insertHostP4node
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z9splitHosti, .Lfunc_end3-_Z9splitHosti
	.cfi_endproc
                                        # -- End function
	.globl	_Z10insertHosti                 # -- Begin function _Z10insertHosti
	.type	_Z10insertHosti,@function
_Z10insertHosti:                        # @_Z10insertHosti
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	%edi, %ebx
	callq	_Z8findHosti
	testb	%al, %al
	jne	.LBB4_7
# %bb.1:
	movabsq	$4294967297, %r14               # imm = 0x100000001
	leaq	8(%rsp), %rdi
	movq	$0, (%rdi)
	movl	$4, %esi
	callq	hipMalloc
	callq	hipDeviceSynchronize
	leaq	1023(%r14), %r15
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_3
# %bb.2:
	movq	8(%rsp), %rsi
	movl	%ebx, %edi
	callq	_Z23__device_stub__copyNodeiPi
.LBB4_3:
	movq	8(%rsp), %rsi
	leaq	4(%rsp), %rdi
	movl	$4, %edx
	movl	$2, %ecx
	callq	hipMemcpy
	callq	hipDeviceSynchronize
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_5
# %bb.4:
	movl	%ebx, %edi
	callq	_Z23__device_stub__addValuei
.LBB4_5:
	callq	hipDeviceSynchronize
	cmpl	$0, 4(%rsp)
	je	.LBB4_7
# %bb.6:
	callq	_Z9splitHosti
.LBB4_7:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z10insertHosti, .Lfunc_end4-_Z10insertHosti
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit
	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	$664, %rsp                      # imm = 0x298
	.cfi_def_cfa_offset 720
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	leaq	80(%rsp), %rax
	movq	%rax, -16(%rax)
	leaq	64(%rsp), %rbx
	movl	$.L.str.3, %esi
	movl	$.L.str.3+40, %edx
	movq	%rbx, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	movl	$4000000, %edi                  # imm = 0x3D0900
	callq	malloc
	movq	%rax, %r14
	movq	(%rbx), %rsi
.Ltmp0:
	leaq	144(%rsp), %r15
	movq	%r15, %rdi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp1:
# %bb.1:
	movq	%r14, %rbx
	leaq	128(%rsp), %r13
	movq	%r13, -16(%r13)
	movq	$0, -8(%r13)
	movb	$0, (%r13)
	leaq	112(%rsp), %r12
	movq	%r14, %rbp
.LBB5_2:                                # =>This Inner Loop Header: Depth=1
	movq	144(%rsp), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
.Ltmp3:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp4:
# %bb.3:                                # %.noexc
                                        #   in Loop: Header=BB5_2 Depth=1
.Ltmp5:
	movsbl	%al, %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp6:
# %bb.4:                                #   in Loop: Header=BB5_2 Depth=1
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	jne	.LBB5_9
# %bb.5:                                #   in Loop: Header=BB5_2 Depth=1
	movq	112(%rsp), %rdi
	callq	atoi
	movl	%eax, (%rbp)
	addq	$4, %rbp
	jmp	.LBB5_2
.LBB5_9:
	addq	$4000000, %r14                  # imm = 0x3D0900
.Ltmp8:
	movl	$38, %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_
.Ltmp9:
# %bb.10:                               # %.noexc178
.Ltmp10:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ZSt22__final_insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
.Ltmp11:
# %bb.11:                               # %_ZSt4sortIPiEvT_S1_.exit
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	movq	%rax, (%rdi)
	movq	%rax, (%rsp)
	movq	%rax, 40(%rsp)
	movq	%rax, 32(%rsp)
	movabsq	$3858542784151551, %rax         # imm = 0xDB552FFFFFFFF
	movq	%rax, 52(%rsp)
	movl	$40156, 60(%rsp)                # imm = 0x9CDC
.Ltmp13:
	movl	$4000000, %esi                  # imm = 0x3D0900
	callq	hipMalloc
.Ltmp14:
# %bb.12:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB5_21
# %bb.13:
.Ltmp15:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp16:
# %bb.14:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp17:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp18:
# %bb.15:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_16
# %bb.17:
	movq	%r14, %rdi
	callq	strlen
.Ltmp19:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp20:
	jmp	.LBB5_18
.LBB5_16:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp21:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp22:
.LBB5_18:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit184
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp23:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp24:
# %bb.19:                               # %.noexc363
.Ltmp25:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp26:
# %bb.20:                               # %.noexc364
.Ltmp27:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp28:
.LBB5_21:                               # %_ZNSolsEPFRSoS_E.exit
.Ltmp29:
	leaq	24(%rsp), %rdi
	movl	$40, %esi
	callq	hipMalloc
.Ltmp30:
# %bb.22:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB5_31
# %bb.23:
.Ltmp31:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$5, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp32:
# %bb.24:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit187
.Ltmp33:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp34:
# %bb.25:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_26
# %bb.27:
	movq	%r14, %rdi
	callq	strlen
.Ltmp35:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp36:
	jmp	.LBB5_28
.LBB5_26:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp37:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp38:
.LBB5_28:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit191
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp39:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp40:
# %bb.29:                               # %.noexc366
.Ltmp41:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp42:
# %bb.30:                               # %.noexc367
.Ltmp43:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp44:
.LBB5_31:                               # %_ZNSolsEPFRSoS_E.exit193
.Ltmp45:
	movq	%rsp, %rdi
	movl	$4, %esi
	callq	hipMalloc
.Ltmp46:
# %bb.32:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB5_41
# %bb.33:
.Ltmp47:
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp48:
# %bb.34:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit195
.Ltmp49:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp50:
# %bb.35:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_36
# %bb.37:
	movq	%r14, %rdi
	callq	strlen
.Ltmp51:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp52:
	jmp	.LBB5_38
.LBB5_36:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp53:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp54:
.LBB5_38:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit199
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp55:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp56:
# %bb.39:                               # %.noexc370
.Ltmp57:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp58:
# %bb.40:                               # %.noexc371
.Ltmp59:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp60:
.LBB5_41:                               # %_ZNSolsEPFRSoS_E.exit201
.Ltmp61:
	leaq	40(%rsp), %rdi
	movl	$12, %esi
	callq	hipMalloc
.Ltmp62:
# %bb.42:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB5_51
# %bb.43:
.Ltmp63:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$8, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp64:
# %bb.44:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit203
.Ltmp65:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp66:
# %bb.45:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_46
# %bb.47:
	movq	%r14, %rdi
	callq	strlen
.Ltmp67:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp68:
	jmp	.LBB5_48
.LBB5_46:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp69:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp70:
.LBB5_48:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit207
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp71:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp72:
# %bb.49:                               # %.noexc374
.Ltmp73:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp74:
# %bb.50:                               # %.noexc375
.Ltmp75:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp76:
.LBB5_51:                               # %_ZNSolsEPFRSoS_E.exit209
.Ltmp77:
	leaq	32(%rsp), %rdi
	movl	$12, %esi
	callq	hipMalloc
.Ltmp78:
# %bb.52:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB5_61
# %bb.53:
.Ltmp79:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp80:
# %bb.54:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit211
.Ltmp81:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp82:
# %bb.55:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_56
# %bb.57:
	movq	%r14, %rdi
	callq	strlen
.Ltmp83:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp84:
	jmp	.LBB5_58
.LBB5_56:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp85:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp86:
.LBB5_58:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit215
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp87:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp88:
# %bb.59:                               # %.noexc378
.Ltmp89:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp90:
# %bb.60:                               # %.noexc379
.Ltmp91:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp92:
.LBB5_61:                               # %_ZNSolsEPFRSoS_E.exit217
	movq	8(%rsp), %rdi
.Ltmp93:
	movl	$4000000, %edx                  # imm = 0x3D0900
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp94:
# %bb.62:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB5_71
# %bb.63:
.Ltmp95:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.8, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp96:
# %bb.64:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit219
.Ltmp97:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp98:
# %bb.65:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_66
# %bb.67:
	movq	%r14, %rdi
	callq	strlen
.Ltmp99:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp100:
	jmp	.LBB5_68
.LBB5_66:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp101:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp102:
.LBB5_68:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit223
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp103:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp104:
# %bb.69:                               # %.noexc382
.Ltmp105:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp106:
# %bb.70:                               # %.noexc383
.Ltmp107:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp108:
.LBB5_71:                               # %_ZNSolsEPFRSoS_E.exit225
	movq	32(%rsp), %rdi
.Ltmp109:
	leaq	52(%rsp), %rsi
	movl	$12, %edx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp110:
# %bb.72:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB5_81
# %bb.73:
.Ltmp111:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.9, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp112:
# %bb.74:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit227
.Ltmp113:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp114:
# %bb.75:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_76
# %bb.77:
	movq	%r14, %rdi
	callq	strlen
.Ltmp115:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp116:
	jmp	.LBB5_78
.LBB5_76:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp117:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp118:
.LBB5_78:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit231
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp119:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp120:
# %bb.79:                               # %.noexc386
.Ltmp121:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp122:
# %bb.80:                               # %.noexc387
.Ltmp123:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp124:
.LBB5_81:                               # %_ZNSolsEPFRSoS_E.exit233
.Ltmp125:
	movl	$512000000, %esi                # imm = 0x1E848000
	movl	$2, %edi
	callq	hipDeviceSetLimit
.Ltmp126:
# %bb.82:
.Ltmp127:
	movabsq	$4294968273, %rdi               # imm = 0x1000003D1
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp128:
# %bb.83:
	testl	%eax, %eax
	jne	.LBB5_85
# %bb.84:
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
.Ltmp129:
	leaq	24(%rsp), %rdi
	callq	_Z26__device_stub__buildLeavesRP4nodePiS2_
.Ltmp130:
.LBB5_85:
.Ltmp131:
	callq	hipDeviceSynchronize
.Ltmp132:
# %bb.86:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB5_95
# %bb.87:
.Ltmp133:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.10, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp134:
# %bb.88:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit235
.Ltmp135:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp136:
# %bb.89:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_90
# %bb.91:
	movq	%r14, %rdi
	callq	strlen
.Ltmp137:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp138:
	jmp	.LBB5_92
.LBB5_90:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp139:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp140:
.LBB5_92:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit239
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp141:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp142:
# %bb.93:                               # %.noexc390
.Ltmp143:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp144:
# %bb.94:                               # %.noexc391
.Ltmp145:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp146:
.LBB5_95:                               # %_ZNSolsEPFRSoS_E.exit241
.Ltmp147:
	movabsq	$4294968273, %rdi               # imm = 0x1000003D1
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp148:
# %bb.96:
	testl	%eax, %eax
	jne	.LBB5_98
# %bb.97:
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
.Ltmp149:
	leaq	24(%rsp), %rdi
	callq	_Z25__device_stub__fillLeavesRP4nodePiS2_
.Ltmp150:
.LBB5_98:
.Ltmp151:
	callq	hipDeviceSynchronize
.Ltmp152:
# %bb.99:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB5_108
# %bb.100:
.Ltmp153:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.11, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp154:
# %bb.101:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit243
.Ltmp155:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp156:
# %bb.102:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_103
# %bb.104:
	movq	%r14, %rdi
	callq	strlen
.Ltmp157:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp158:
	jmp	.LBB5_105
.LBB5_103:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp159:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp160:
.LBB5_105:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit247
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp161:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp162:
# %bb.106:                              # %.noexc394
.Ltmp163:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp164:
# %bb.107:                              # %.noexc395
.Ltmp165:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp166:
.LBB5_108:                              # %_ZNSolsEPFRSoS_E.exit249
.Ltmp168:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.12, %esi
	movl	$14, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp169:
# %bb.109:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit251
.Ltmp170:
	movl	$_ZSt4cout, %edi
	xorl	%esi, %esi
	callq	_ZNSolsEi
.Ltmp171:
# %bb.110:
.Ltmp172:
	movq	%rax, %r14
	movl	$.L.str.13, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp173:
# %bb.111:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit253
.Ltmp174:
	movq	%r14, %rdi
	movl	$3921, %esi                     # imm = 0xF51
	callq	_ZNSolsEi
.Ltmp175:
# %bb.112:
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
.Ltmp176:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp177:
# %bb.113:                              # %.noexc398
.Ltmp178:
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
.Ltmp179:
# %bb.114:                              # %.noexc399
.Ltmp180:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp181:
# %bb.115:                              # %_ZNSolsEPFRSoS_E.exit255
.Ltmp182:
	movabsq	$4294968273, %rdi               # imm = 0x1000003D1
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp183:
# %bb.116:
	testl	%eax, %eax
	jne	.LBB5_118
# %bb.117:
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
.Ltmp184:
	leaq	24(%rsp), %rdi
	movl	$3921, %ecx                     # imm = 0xF51
	movl	$1, %r8d
	callq	_Z25__device_stub__buildLevelRP4nodePiS2_ii
.Ltmp185:
.LBB5_118:
.Ltmp186:
	callq	hipDeviceSynchronize
.Ltmp187:
# %bb.119:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB5_130
# %bb.120:
.Ltmp188:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.14, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp189:
# %bb.121:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit257
.Ltmp190:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp191:
# %bb.122:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_123
# %bb.126:
	movq	%r14, %rdi
	callq	strlen
.Ltmp192:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp193:
	jmp	.LBB5_127
.LBB5_123:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp194:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp195:
.LBB5_127:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit261
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp196:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp197:
# %bb.128:                              # %.noexc402
.Ltmp198:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp199:
# %bb.129:                              # %.noexc403
.Ltmp200:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp201:
.LBB5_130:                              # %_ZNSolsEPFRSoS_E.exit263
.Ltmp202:
	movabsq	$4294968273, %rdi               # imm = 0x1000003D1
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp203:
# %bb.131:
	testl	%eax, %eax
	jne	.LBB5_133
# %bb.132:
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
.Ltmp204:
	leaq	24(%rsp), %rdi
	movl	$3921, %ecx                     # imm = 0xF51
	movl	$1, %r8d
	callq	_Z24__device_stub__fillLevelRP4nodePiS2_ii
.Ltmp205:
.LBB5_133:
.Ltmp206:
	callq	hipDeviceSynchronize
.Ltmp207:
# %bb.134:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB5_143
# %bb.135:
.Ltmp208:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.15, %esi
	movl	$10, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp209:
# %bb.136:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit265
.Ltmp210:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp211:
# %bb.137:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_138
# %bb.139:
	movq	%r14, %rdi
	callq	strlen
.Ltmp212:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp213:
	jmp	.LBB5_140
.LBB5_138:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp214:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp215:
.LBB5_140:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit269
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp216:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp217:
# %bb.141:                              # %.noexc406
.Ltmp218:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp219:
# %bb.142:                              # %.noexc407
.Ltmp220:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp221:
.LBB5_143:                              # %_ZNSolsEPFRSoS_E.exit271
.Ltmp223:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.12, %esi
	movl	$14, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp224:
# %bb.144:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit273
.Ltmp225:
	movl	$_ZSt4cout, %edi
	movl	$1, %esi
	callq	_ZNSolsEi
.Ltmp226:
# %bb.145:
.Ltmp227:
	movq	%rax, %r14
	movl	$.L.str.13, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp228:
# %bb.146:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit275
.Ltmp229:
	movq	%r14, %rdi
	movl	$15, %esi
	callq	_ZNSolsEi
.Ltmp230:
# %bb.147:
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
.Ltmp231:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp232:
# %bb.148:                              # %.noexc410
.Ltmp233:
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
.Ltmp234:
# %bb.149:                              # %.noexc411
.Ltmp235:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp236:
# %bb.150:                              # %_ZNSolsEPFRSoS_E.exit277
.Ltmp237:
	movabsq	$4294968273, %rdi               # imm = 0x1000003D1
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp238:
# %bb.151:
	testl	%eax, %eax
	jne	.LBB5_153
# %bb.152:
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
.Ltmp239:
	leaq	24(%rsp), %rdi
	callq	_Z24__device_stub__buildRootRP4nodePiS2_
.Ltmp240:
.LBB5_153:
.Ltmp241:
	callq	hipDeviceSynchronize
.Ltmp242:
# %bb.154:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB5_163
# %bb.155:
.Ltmp243:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.16, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp244:
# %bb.156:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit279
.Ltmp245:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp246:
# %bb.157:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_158
# %bb.159:
	movq	%r14, %rdi
	callq	strlen
.Ltmp247:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp248:
	jmp	.LBB5_160
.LBB5_158:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp249:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp250:
.LBB5_160:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit283
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp251:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp252:
# %bb.161:                              # %.noexc414
.Ltmp253:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp254:
# %bb.162:                              # %.noexc415
.Ltmp255:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp256:
.LBB5_163:                              # %_ZNSolsEPFRSoS_E.exit285
.Ltmp257:
	movabsq	$4294968273, %rdi               # imm = 0x1000003D1
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp258:
# %bb.164:
	testl	%eax, %eax
	jne	.LBB5_166
# %bb.165:
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdx
.Ltmp259:
	leaq	24(%rsp), %rdi
	movl	$15, %ecx
	xorl	%r8d, %r8d
	callq	_Z23__device_stub__fillRootRP4nodePiS2_ii
.Ltmp260:
.LBB5_166:
	testl	%ebp, %ebp
	je	.LBB5_175
# %bb.167:
.Ltmp261:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.17, %esi
	movl	$10, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp262:
# %bb.168:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit287
.Ltmp263:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp264:
# %bb.169:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_170
# %bb.171:
	movq	%r14, %rdi
	callq	strlen
.Ltmp265:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp266:
	jmp	.LBB5_172
.LBB5_170:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp267:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp268:
.LBB5_172:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit291
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp269:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp270:
# %bb.173:                              # %.noexc418
.Ltmp271:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp272:
# %bb.174:                              # %.noexc419
.Ltmp273:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp274:
.LBB5_175:                              # %_ZNSolsEPFRSoS_E.exit293
.Ltmp275:
	callq	hipDeviceSynchronize
.Ltmp276:
# %bb.176:
.Ltmp278:
	movl	$97861, %edi                    # imm = 0x17E45
	callq	_Z8findHosti
.Ltmp279:
# %bb.177:
.Ltmp280:
	movl	$-1, %edi
	callq	_Z10insertHosti
.Ltmp281:
# %bb.178:
.Ltmp282:
	movl	$-1, %edi
	callq	_Z8findHosti
.Ltmp283:
# %bb.179:
.Ltmp284:
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp285:
# %bb.180:
	testl	%eax, %eax
	jne	.LBB5_182
# %bb.181:
	movq	(%rsp), %rsi
.Ltmp286:
	movl	$-1, %edi
	callq	_Z21__device_stub__searchiPi
.Ltmp287:
.LBB5_182:
.Ltmp288:
	callq	hipDeviceSynchronize
.Ltmp289:
# %bb.183:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB5_192
# %bb.184:
.Ltmp290:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.18, %esi
	movl	$16, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp291:
# %bb.185:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit295
.Ltmp292:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp293:
# %bb.186:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_187
# %bb.188:
	movq	%r14, %rdi
	callq	strlen
.Ltmp294:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp295:
	jmp	.LBB5_189
.LBB5_187:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp296:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp297:
.LBB5_189:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit299
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp298:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp299:
# %bb.190:                              # %.noexc422
.Ltmp300:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp301:
# %bb.191:                              # %.noexc423
.Ltmp302:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp303:
.LBB5_192:                              # %_ZNSolsEPFRSoS_E.exit301
	movq	(%rsp), %rsi
.Ltmp304:
	leaq	20(%rsp), %rdi
	movl	$4, %edx
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp305:
# %bb.193:
	testl	%ebp, %ebp
	je	.LBB5_194
# %bb.211:
.Ltmp306:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.19, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp307:
# %bb.212:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit303
.Ltmp308:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp309:
# %bb.213:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_214
# %bb.215:
	movq	%r14, %rdi
	callq	strlen
.Ltmp310:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp311:
	jmp	.LBB5_216
.LBB5_214:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp312:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp313:
.LBB5_216:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit307
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp314:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp315:
# %bb.217:                              # %.noexc426
.Ltmp316:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp317:
# %bb.218:                              # %.noexc427
.Ltmp318:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp319:
.LBB5_194:                              # %_ZNSolsEPFRSoS_E.exit309.preheader
	xorl	%eax, %eax
	movl	$1, %ecx
	xorl	%ebp, %ebp
.LBB5_195:                              # %_ZNSolsEPFRSoS_E.exit309
                                        # =>This Inner Loop Header: Depth=1
	cmpl	$-1, (%rbx,%rax,4)
	cmovel	%ecx, %ebp
	incq	%rax
	cmpq	$1000000, %rax                  # imm = 0xF4240
	jne	.LBB5_195
# %bb.196:
	movl	20(%rsp), %esi
.Ltmp321:
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
.Ltmp322:
# %bb.197:
.Ltmp323:
	movq	%rax, %rbx
	movl	$.L.str.20, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp324:
# %bb.198:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit311
.Ltmp325:
	movq	%rbx, %rdi
	movl	%ebp, %esi
	callq	_ZNSolsEi
.Ltmp326:
# %bb.199:
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp327:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp328:
# %bb.200:                              # %.noexc430
.Ltmp329:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp330:
# %bb.201:                              # %.noexc431
.Ltmp331:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp332:
# %bb.202:                              # %_ZNSolsEPFRSoS_E.exit313
.Ltmp333:
	movabsq	$4294967299, %rdi               # imm = 0x100000003
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp334:
# %bb.203:
	testl	%eax, %eax
	jne	.LBB5_205
# %bb.204:
	movq	32(%rsp), %rdi
	movq	40(%rsp), %rsi
.Ltmp335:
	movl	$3, %edx
	callq	_Z21__device_stub__searchPiS_i
.Ltmp336:
.LBB5_205:
.Ltmp337:
	callq	hipDeviceSynchronize
.Ltmp338:
# %bb.206:
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.LBB5_223
# %bb.207:
.Ltmp339:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.21, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp340:
# %bb.208:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit315
.Ltmp341:
	movl	%ebx, %edi
	callq	hipGetErrorString
.Ltmp342:
# %bb.209:
	movq	%rax, %rbx
	testq	%rax, %rax
	je	.LBB5_210
# %bb.219:
	movq	%rbx, %rdi
	callq	strlen
.Ltmp343:
	movl	$_ZSt4cout, %edi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp344:
	jmp	.LBB5_220
.LBB5_210:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp345:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp346:
.LBB5_220:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit319
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp347:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp348:
# %bb.221:                              # %.noexc434
.Ltmp349:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp350:
# %bb.222:                              # %.noexc435
.Ltmp351:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp352:
.LBB5_223:                              # %_ZNSolsEPFRSoS_E.exit321
	movq	40(%rsp), %rsi
.Ltmp353:
	leaq	100(%rsp), %rdi
	movl	$12, %edx
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp354:
# %bb.224:                              # %.preheader.preheader
	xorl	%r14d, %r14d
.LBB5_225:                              # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movl	100(%rsp,%r14,4), %esi
.Ltmp355:
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
.Ltmp356:
# %bb.226:                              #   in Loop: Header=BB5_225 Depth=1
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp357:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp358:
# %bb.227:                              # %.noexc438
                                        #   in Loop: Header=BB5_225 Depth=1
.Ltmp359:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp360:
# %bb.228:                              # %.noexc439
                                        #   in Loop: Header=BB5_225 Depth=1
.Ltmp361:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp362:
# %bb.229:                              # %_ZNSolsEPFRSoS_E.exit323
                                        #   in Loop: Header=BB5_225 Depth=1
	incq	%r14
	cmpq	$3, %r14
	jne	.LBB5_225
# %bb.230:
.Ltmp364:
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp365:
# %bb.231:
	testl	%eax, %eax
	jne	.LBB5_233
# %bb.232:
.Ltmp366:
	movl	$-1, %edi
	callq	_Z24__device_stub__insertVali
.Ltmp367:
.LBB5_233:
.Ltmp368:
	callq	hipDeviceSynchronize
.Ltmp369:
# %bb.234:
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.LBB5_243
# %bb.235:
.Ltmp370:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.22, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp371:
# %bb.236:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit325
.Ltmp372:
	movl	%ebx, %edi
	callq	hipGetErrorString
.Ltmp373:
# %bb.237:
	movq	%rax, %rbx
	testq	%rax, %rax
	je	.LBB5_238
# %bb.239:
	movq	%rbx, %rdi
	callq	strlen
.Ltmp374:
	movl	$_ZSt4cout, %edi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp375:
	jmp	.LBB5_240
.LBB5_238:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp376:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp377:
.LBB5_240:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit329
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp378:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp379:
# %bb.241:                              # %.noexc442
.Ltmp380:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp381:
# %bb.242:                              # %.noexc443
.Ltmp382:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp383:
.LBB5_243:                              # %_ZNSolsEPFRSoS_E.exit331
.Ltmp384:
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp385:
# %bb.244:
	testl	%eax, %eax
	jne	.LBB5_246
# %bb.245:
	movq	(%rsp), %rsi
.Ltmp386:
	movl	$-1, %edi
	callq	_Z21__device_stub__searchiPi
.Ltmp387:
.LBB5_246:
.Ltmp388:
	callq	hipDeviceSynchronize
.Ltmp389:
# %bb.247:
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.LBB5_256
# %bb.248:
.Ltmp390:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.23, %esi
	movl	$16, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp391:
# %bb.249:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit333
.Ltmp392:
	movl	%ebx, %edi
	callq	hipGetErrorString
.Ltmp393:
# %bb.250:
	movq	%rax, %r14
	testq	%rax, %rax
	je	.LBB5_251
# %bb.252:
	movq	%r14, %rdi
	callq	strlen
.Ltmp394:
	movl	$_ZSt4cout, %edi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp395:
	jmp	.LBB5_253
.LBB5_251:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp396:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp397:
.LBB5_253:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit337
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp398:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp399:
# %bb.254:                              # %.noexc446
.Ltmp400:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp401:
# %bb.255:                              # %.noexc447
.Ltmp402:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp403:
.LBB5_256:                              # %_ZNSolsEPFRSoS_E.exit339
	movq	(%rsp), %rsi
.Ltmp404:
	leaq	20(%rsp), %rdi
	movl	$4, %edx
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp405:
# %bb.257:
	testl	%ebx, %ebx
	je	.LBB5_266
# %bb.258:
.Ltmp406:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.19, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp407:
# %bb.259:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit341
.Ltmp408:
	movl	%ebx, %edi
	callq	hipGetErrorString
.Ltmp409:
# %bb.260:
	movq	%rax, %rbx
	testq	%rax, %rax
	je	.LBB5_261
# %bb.262:
	movq	%rbx, %rdi
	callq	strlen
.Ltmp410:
	movl	$_ZSt4cout, %edi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp411:
	jmp	.LBB5_263
.LBB5_261:
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cout(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp412:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp413:
.LBB5_263:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit345
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp414:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp415:
# %bb.264:                              # %.noexc450
.Ltmp416:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp417:
# %bb.265:                              # %.noexc451
.Ltmp418:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp419:
.LBB5_266:                              # %_ZNSolsEPFRSoS_E.exit347
	movl	20(%rsp), %esi
.Ltmp420:
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
.Ltmp421:
# %bb.267:
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp422:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp423:
# %bb.268:                              # %.noexc454
.Ltmp424:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp425:
# %bb.269:                              # %.noexc455
.Ltmp426:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp427:
# %bb.270:                              # %_ZNSolsEPFRSoS_E.exit349
.Ltmp428:
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.24, %esi
	movl	$3, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp429:
# %bb.271:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit351
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %rbx
.Ltmp430:
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp431:
# %bb.272:                              # %.noexc458
.Ltmp432:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp433:
# %bb.273:                              # %.noexc459
.Ltmp434:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp435:
# %bb.274:                              # %_ZNSolsEPFRSoS_E.exit353
	movq	8(%rsp), %rdi
.Ltmp436:
	callq	hipFree
.Ltmp437:
# %bb.275:
	movq	(%rsp), %rdi
.Ltmp438:
	callq	hipFree
.Ltmp439:
# %bb.276:
	movq	112(%rsp), %rdi
	cmpq	%r13, %rdi
	je	.LBB5_278
# %bb.277:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB5_278:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	leaq	144(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	64(%rsp), %rdi
	leaq	80(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB5_280
# %bb.279:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i354
	callq	_ZdlPv
.LBB5_280:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit356
	xorl	%eax, %eax
	addq	$664, %rsp                      # imm = 0x298
	.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
.LBB5_6:
	.cfi_def_cfa_offset 720
.Ltmp2:
	movq	%rax, %rbx
	jmp	.LBB5_285
.LBB5_8:                                # %.loopexit.split-lp521
.Ltmp12:
	jmp	.LBB5_282
.LBB5_288:
.Ltmp320:
	jmp	.LBB5_282
.LBB5_125:                              # %.loopexit.split-lp
.Ltmp277:
	jmp	.LBB5_282
.LBB5_124:                              # %.loopexit
.Ltmp222:
	jmp	.LBB5_282
.LBB5_289:
.Ltmp440:
	jmp	.LBB5_282
.LBB5_281:
.Ltmp167:
	jmp	.LBB5_282
.LBB5_7:                                # %.loopexit520
.Ltmp7:
	jmp	.LBB5_282
.LBB5_290:
.Ltmp363:
.LBB5_282:
	movq	%rax, %rbx
	movq	112(%rsp), %rdi
	cmpq	%r13, %rdi
	je	.LBB5_284
# %bb.283:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i357
	callq	_ZdlPv
.LBB5_284:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit359
	leaq	144(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
.LBB5_285:
	movq	64(%rsp), %rdi
	leaq	80(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB5_287
# %bb.286:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i360
	callq	_ZdlPv
.LBB5_287:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit362
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end5:
	.size	main, .Lfunc_end5-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table5:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp6-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp6
	.uleb128 .Ltmp7-.Lfunc_begin0           #     jumps to .Ltmp7
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp8-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp11-.Ltmp8                 #   Call between .Ltmp8 and .Ltmp11
	.uleb128 .Ltmp12-.Lfunc_begin0          #     jumps to .Ltmp12
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp13-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp166-.Ltmp13               #   Call between .Ltmp13 and .Ltmp166
	.uleb128 .Ltmp167-.Lfunc_begin0         #     jumps to .Ltmp167
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp168-.Lfunc_begin0         # >> Call Site 6 <<
	.uleb128 .Ltmp221-.Ltmp168              #   Call between .Ltmp168 and .Ltmp221
	.uleb128 .Ltmp222-.Lfunc_begin0         #     jumps to .Ltmp222
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp223-.Lfunc_begin0         # >> Call Site 7 <<
	.uleb128 .Ltmp276-.Ltmp223              #   Call between .Ltmp223 and .Ltmp276
	.uleb128 .Ltmp277-.Lfunc_begin0         #     jumps to .Ltmp277
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp278-.Lfunc_begin0         # >> Call Site 8 <<
	.uleb128 .Ltmp319-.Ltmp278              #   Call between .Ltmp278 and .Ltmp319
	.uleb128 .Ltmp320-.Lfunc_begin0         #     jumps to .Ltmp320
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp321-.Lfunc_begin0         # >> Call Site 9 <<
	.uleb128 .Ltmp354-.Ltmp321              #   Call between .Ltmp321 and .Ltmp354
	.uleb128 .Ltmp440-.Lfunc_begin0         #     jumps to .Ltmp440
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp355-.Lfunc_begin0         # >> Call Site 10 <<
	.uleb128 .Ltmp362-.Ltmp355              #   Call between .Ltmp355 and .Ltmp362
	.uleb128 .Ltmp363-.Lfunc_begin0         #     jumps to .Ltmp363
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp364-.Lfunc_begin0         # >> Call Site 11 <<
	.uleb128 .Ltmp439-.Ltmp364              #   Call between .Ltmp364 and .Ltmp439
	.uleb128 .Ltmp440-.Lfunc_begin0         #     jumps to .Ltmp440
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp439-.Lfunc_begin0         # >> Call Site 12 <<
	.uleb128 .Lfunc_end5-.Ltmp439           #   Call between .Ltmp439 and .Lfunc_end5
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.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, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	subq	%rsi, %r14
	movq	%r14, (%rsp)
	cmpq	$15, %r14
	jbe	.LBB6_1
# %bb.2:
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, (%rbx)
	movq	(%r12), %rcx
	movq	%rcx, 16(%rbx)
	jmp	.LBB6_3
.LBB6_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB6_3:
	testq	%r14, %r14
	je	.LBB6_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB6_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB6_7
.LBB6_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB6_7:                                # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	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_end6:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end6-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_,"axG",@progbits,_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_,comdat
	.weak	_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_ # -- Begin function _ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_
	.type	_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_,@function
_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_: # @_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r14
	subq	%rdi, %r14
	cmpq	$65, %r14
	jl	.LBB7_12
# %bb.1:                                # %.lr.ph
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	leaq	4(%rdi), %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movq	$-4, %rbp
	subq	%rdi, %rbp
.LBB7_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_5 Depth 2
                                        #       Child Loop BB7_6 Depth 3
                                        #       Child Loop BB7_8 Depth 3
	subq	$1, %r15
	jb	.LBB7_3
# %bb.4:                                #   in Loop: Header=BB7_2 Depth=1
	shrq	$3, %r14
	leaq	(%rbx,%r14,4), %rdx
	leaq	-4(%r12), %rcx
	movq	%rbx, %rdi
	movq	16(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rsi
	callq	_ZSt22__move_median_to_firstIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_
	movq	%r12, %rax
	movq	%r14, %rcx
.LBB7_5:                                #   Parent Loop BB7_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB7_6 Depth 3
                                        #       Child Loop BB7_8 Depth 3
	movl	(%rbx), %edx
	leaq	(%rcx,%rbp), %r14
.LBB7_6:                                #   Parent Loop BB7_2 Depth=1
                                        #     Parent Loop BB7_5 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%rcx), %esi
	addq	$4, %rcx
	addq	$4, %r14
	cmpl	%edx, %esi
	jl	.LBB7_6
# %bb.7:                                # %.preheader.i.i.preheader
                                        #   in Loop: Header=BB7_5 Depth=2
	leaq	-4(%rcx), %r13
.LBB7_8:                                # %.preheader.i.i
                                        #   Parent Loop BB7_2 Depth=1
                                        #     Parent Loop BB7_5 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	-4(%rax), %edi
	addq	$-4, %rax
	cmpl	%edi, %edx
	jl	.LBB7_8
# %bb.9:                                #   in Loop: Header=BB7_5 Depth=2
	cmpq	%rax, %r13
	jae	.LBB7_11
# %bb.10:                               #   in Loop: Header=BB7_5 Depth=2
	movl	%edi, (%r13)
	movl	%esi, (%rax)
	jmp	.LBB7_5
.LBB7_11:                               # %_ZSt27__unguarded_partition_pivotIPiN9__gnu_cxx5__ops15_Iter_less_iterEET_S4_S4_T0_.exit
                                        #   in Loop: Header=BB7_2 Depth=1
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_
	movq	%r13, %r12
	cmpq	$64, %r14
	jg	.LBB7_2
	jmp	.LBB7_12
.LBB7_3:
	leaq	15(%rsp), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ZSt11__make_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	leaq	14(%rsp), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ZSt11__sort_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
.LBB7_12:                               # %.loopexit
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_, .Lfunc_end7-_ZSt16__introsort_loopIPilN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_T1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt22__final_insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_,"axG",@progbits,_ZSt22__final_insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_,comdat
	.weak	_ZSt22__final_insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_ # -- Begin function _ZSt22__final_insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
	.type	_ZSt22__final_insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_,@function
_ZSt22__final_insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_: # @_ZSt22__final_insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rsi, %rbx
	movq	%rsi, %rax
	subq	%rdi, %rax
	cmpq	$65, %rax
	jl	.LBB8_8
# %bb.1:
	leaq	64(%rdi), %r14
	movq	%r14, %rsi
	callq	_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
.LBB8_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB8_5 Depth 2
	cmpq	%rbx, %r14
	je	.LBB8_7
# %bb.3:                                # %.lr.ph.i
                                        #   in Loop: Header=BB8_2 Depth=1
	movl	-4(%r14), %ecx
	movl	(%r14), %eax
	movq	%r14, %rdx
	cmpl	%ecx, %eax
	jge	.LBB8_6
# %bb.4:                                # %.lr.ph.i.i.preheader
                                        #   in Loop: Header=BB8_2 Depth=1
	movq	%r14, %rdx
.LBB8_5:                                # %.lr.ph.i.i
                                        #   Parent Loop BB8_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%ecx, (%rdx)
	movl	-8(%rdx), %ecx
	addq	$-4, %rdx
	cmpl	%ecx, %eax
	jl	.LBB8_5
.LBB8_6:                                # %_ZSt25__unguarded_linear_insertIPiN9__gnu_cxx5__ops14_Val_less_iterEEvT_T0_.exit.i
                                        #   in Loop: Header=BB8_2 Depth=1
	movl	%eax, (%rdx)
	addq	$4, %r14
	jmp	.LBB8_2
.LBB8_8:
	movq	%rbx, %rsi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_ # TAILCALL
.LBB8_7:                                # %_ZSt26__unguarded_insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_.exit
	.cfi_def_cfa_offset 32
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	_ZSt22__final_insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_, .Lfunc_end8-_ZSt22__final_insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt11__sort_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_,"axG",@progbits,_ZSt11__sort_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_,comdat
	.weak	_ZSt11__sort_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_ # -- Begin function _ZSt11__sort_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	.type	_ZSt11__sort_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_,@function
_ZSt11__sort_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_: # @_ZSt11__sort_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %r15
	subq	%rdi, %r15
	cmpq	$5, %r15
	jl	.LBB9_3
# %bb.1:                                # %.lr.ph.preheader
	movq	%rsi, %rbx
	movq	%rdi, %r14
	addq	$-4, %rbx
.LBB9_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	(%rbx), %ecx
	movl	(%r14), %eax
	movl	%eax, (%rbx)
	addq	$-4, %r15
	movq	%r15, %rdx
	sarq	$2, %rdx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_
	addq	$-4, %rbx
	cmpq	$4, %r15
	jg	.LBB9_2
.LBB9_3:                                # %._crit_edge
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_ZSt11__sort_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_, .Lfunc_end9-_ZSt11__sort_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt11__make_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_,"axG",@progbits,_ZSt11__make_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_,comdat
	.weak	_ZSt11__make_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_ # -- Begin function _ZSt11__make_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	.type	_ZSt11__make_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_,@function
_ZSt11__make_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_: # @_ZSt11__make_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rbx
	subq	%rdi, %rbx
	sarq	$2, %rbx
	cmpq	$2, %rbx
	jl	.LBB10_3
# %bb.1:
	movq	%rdi, %r14
	leaq	-2(%rbx), %r15
	shrq	%r15
.LBB10_2:                               # =>This Inner Loop Header: Depth=1
	movl	(%r14,%r15,4), %ecx
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_
	addq	$-1, %r15
	jb	.LBB10_2
.LBB10_3:                               # %.loopexit
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end10:
	.size	_ZSt11__make_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_, .Lfunc_end10-_ZSt11__make_heapIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_RT0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_,"axG",@progbits,_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_,comdat
	.weak	_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_ # -- Begin function _ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_
	.type	_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_,@function
_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_: # @_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_
	.cfi_startproc
# %bb.0:
	leaq	-1(%rdx), %rax
	shrq	$63, %rax
	leaq	(%rdx,%rax), %r8
	decq	%r8
	sarq	%r8
	movq	%rsi, %rax
	cmpq	%rsi, %r8
	jle	.LBB11_6
# %bb.1:                                # %.lr.ph.preheader
	movq	%rsi, %r9
.LBB11_2:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	leaq	(%r9,%r9), %rax
	movl	8(%rdi,%rax,4), %r10d
	cmpl	4(%rdi,%rax,4), %r10d
	jl	.LBB11_3
# %bb.4:                                # %.lr.ph
                                        #   in Loop: Header=BB11_2 Depth=1
	leaq	2(,%r9,2), %rax
	jmp	.LBB11_5
.LBB11_3:                               #   in Loop: Header=BB11_2 Depth=1
	leaq	1(,%r9,2), %rax
.LBB11_5:                               # %.lr.ph
                                        #   in Loop: Header=BB11_2 Depth=1
	movl	(%rdi,%rax,4), %r10d
	movl	%r10d, (%rdi,%r9,4)
	movq	%rax, %r9
	cmpq	%r8, %rax
	jl	.LBB11_2
.LBB11_6:                               # %._crit_edge
	testb	$1, %dl
	jne	.LBB11_9
# %bb.7:
	addq	$-2, %rdx
	sarq	%rdx
	cmpq	%rdx, %rax
	jne	.LBB11_9
# %bb.8:
	leaq	(%rax,%rax), %rdx
	movl	4(%rdi,%rdx,4), %edx
	movl	%edx, (%rdi,%rax,4)
	leaq	1(,%rax,2), %rax
.LBB11_9:
	cmpq	%rsi, %rax
	jle	.LBB11_10
.LBB11_11:                              # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	leaq	-1(%rax), %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	decq	%rdx
	sarq	%rdx
	movl	(%rdi,%rdx,4), %r8d
	cmpl	%ecx, %r8d
	jge	.LBB11_10
# %bb.12:                               #   in Loop: Header=BB11_11 Depth=1
	movl	%r8d, (%rdi,%rax,4)
	movq	%rdx, %rax
	cmpq	%rsi, %rdx
	jg	.LBB11_11
	jmp	.LBB11_13
.LBB11_10:
	movq	%rax, %rdx
.LBB11_13:                              # %_ZSt11__push_heapIPiliN9__gnu_cxx5__ops14_Iter_less_valEEvT_T0_S5_T1_RT2_.exit
	movl	%ecx, (%rdi,%rdx,4)
	retq
.Lfunc_end11:
	.size	_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_, .Lfunc_end11-_ZSt13__adjust_heapIPiliN9__gnu_cxx5__ops15_Iter_less_iterEEvT_T0_S5_T1_T2_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt22__move_median_to_firstIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_,"axG",@progbits,_ZSt22__move_median_to_firstIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_,comdat
	.weak	_ZSt22__move_median_to_firstIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_ # -- Begin function _ZSt22__move_median_to_firstIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_
	.type	_ZSt22__move_median_to_firstIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_,@function
_ZSt22__move_median_to_firstIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_: # @_ZSt22__move_median_to_firstIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_
	.cfi_startproc
# %bb.0:
	movl	(%rsi), %r8d
	movl	(%rdx), %r9d
	movl	(%rcx), %eax
	cmpl	%r9d, %r8d
	jge	.LBB12_6
# %bb.1:
	cmpl	%eax, %r9d
	jge	.LBB12_3
# %bb.2:
	movl	(%rdi), %eax
	movl	%r9d, (%rdi)
	movl	%eax, (%rdx)
	retq
.LBB12_6:
	cmpl	%eax, %r8d
	jge	.LBB12_8
# %bb.7:
	movl	(%rdi), %eax
	movl	%r8d, (%rdi)
	movl	%eax, (%rsi)
	retq
.LBB12_3:
	movl	(%rdi), %edx
	cmpl	%eax, %r8d
	jge	.LBB12_5
# %bb.4:
	movl	%eax, (%rdi)
	movl	%edx, (%rcx)
	retq
.LBB12_8:
	movl	(%rdi), %esi
	cmpl	%eax, %r9d
	jge	.LBB12_10
# %bb.9:
	movl	%eax, (%rdi)
	movl	%esi, (%rcx)
	retq
.LBB12_5:
	movl	%r8d, (%rdi)
	movl	%edx, (%rsi)
	retq
.LBB12_10:
	movl	%r9d, (%rdi)
	movl	%esi, (%rdx)
	retq
.Lfunc_end12:
	.size	_ZSt22__move_median_to_firstIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_, .Lfunc_end12-_ZSt22__move_median_to_firstIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_S4_S4_T0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_,"axG",@progbits,_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_,comdat
	.weak	_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_ # -- Begin function _ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
	.type	_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_,@function
_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_: # @_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
	.cfi_startproc
# %bb.0:
	cmpq	%rsi, %rdi
	je	.LBB13_14
# %bb.1:                                # %.preheader
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %rbx
	movq	%rdi, %r14
	leaq	4(%rdi), %rax
	cmpq	%rsi, %rax
	je	.LBB13_13
# %bb.2:                                # %.lr.ph
	movq	%r14, %r15
.LBB13_3:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB13_8 Depth 2
	movq	%r15, %rdi
	movq	%rax, %r15
	movl	4(%rdi), %ebp
	movl	(%r14), %ecx
	cmpl	%ecx, %ebp
	jge	.LBB13_6
# %bb.4:                                #   in Loop: Header=BB13_3 Depth=1
	movq	%r15, %rdx
	subq	%r14, %rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	cmpq	$2, %rax
	jl	.LBB13_10
# %bb.5:                                #   in Loop: Header=BB13_3 Depth=1
	shlq	$2, %rax
	subq	%rax, %rdi
	addq	$8, %rdi
	movq	%r14, %rsi
	callq	memmove@PLT
.LBB13_12:                              # %_ZSt13move_backwardIPiS0_ET0_T_S2_S1_.exit
                                        #   in Loop: Header=BB13_3 Depth=1
	movq	%r14, %rax
	jmp	.LBB13_9
.LBB13_6:                               #   in Loop: Header=BB13_3 Depth=1
	movl	(%rdi), %ecx
	movq	%r15, %rax
	cmpl	%ecx, %ebp
	jge	.LBB13_9
# %bb.7:                                # %.lr.ph.i.preheader
                                        #   in Loop: Header=BB13_3 Depth=1
	movq	%r15, %rax
.LBB13_8:                               # %.lr.ph.i
                                        #   Parent Loop BB13_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%ecx, (%rax)
	movl	-8(%rax), %ecx
	addq	$-4, %rax
	cmpl	%ecx, %ebp
	jl	.LBB13_8
.LBB13_9:                               # %_ZSt13move_backwardIPiS0_ET0_T_S2_S1_.exit
                                        #   in Loop: Header=BB13_3 Depth=1
	movl	%ebp, (%rax)
	leaq	4(%r15), %rax
	cmpq	%rbx, %rax
	jne	.LBB13_3
	jmp	.LBB13_13
.LBB13_10:                              #   in Loop: Header=BB13_3 Depth=1
	movq	%r14, %rax
	cmpq	$4, %rdx
	jne	.LBB13_9
# %bb.11:                               #   in Loop: Header=BB13_3 Depth=1
	movl	%ecx, 4(%rdi)
	jmp	.LBB13_12
.LBB13_13:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB13_14:                              # %.loopexit
	retq
.Lfunc_end13:
	.size	_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_, .Lfunc_end13-_ZSt16__insertion_sortIPiN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S4_T0_
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"result "
	.size	.L.str, 8

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"FOUND"
	.size	.L.str.1, 6

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"NOT FOUND"
	.size	.L.str.2, 10

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"/home/piotr/Uczelnia/Cuda/BTree/testfile"
	.size	.L.str.3, 41

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"input "
	.size	.L.str.4, 7

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"root "
	.size	.L.str.5, 6

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"results "
	.size	.L.str.6, 9

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"values "
	.size	.L.str.7, 8

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"copy input "
	.size	.L.str.8, 12

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"copy values "
	.size	.L.str.9, 13

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"buildLeaves "
	.size	.L.str.10, 13

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

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Size of level "
	.size	.L.str.12, 15

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

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

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

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"build root "
	.size	.L.str.16, 12

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"fill root "
	.size	.L.str.17, 11

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"1st search call "
	.size	.L.str.18, 17

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"copying result "
	.size	.L.str.19, 16

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

	.type	.L.str.21,@object               # @.str.21
.L.str.21:
	.asciz	"multiple search call "
	.size	.L.str.21, 22

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"insert call "
	.size	.L.str.22, 13

	.type	.L.str.23,@object               # @.str.23
.L.str.23:
	.asciz	"2nd search call "
	.size	.L.str.23, 17

	.type	.L.str.24,@object               # @.str.24
.L.str.24:
	.asciz	"end"
	.size	.L.str.24, 4

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

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZSt4cout
	.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
