
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <iostream>
#include <fstream>
#include <chrono>
#include <string>
using namespace std;
#include <stdio.h>
#include <assert.h>
#include <math.h>
#define ll long long int


const ll m = 0x5DEECE66Dll;
const ll mask = (1ll << 48) - 1;

#define advance1(s) s = (s * m + 11ll) & mask
#define advance3759(s) s = (s*0x6fe85c031f25ll + 0x8f50ecff899ll)&mask
#define advance16(s) s = (s*0x6dc260740241ll + 0xd0352014d90ll)&mask
#define advance387(s) s = (s*0x5fe2bcef32b5ll + 0xb072b3bf0cbdll)&mask
#define advance774(s) s = (s*0xf8d900133f9ll + 0x5738cac2f85ell)&mask
#define advance11(s) s = (s*0x53bce7b8c655ll + 0x3bb194f24a25ll)&mask
#define advance3(s) s = (s*0xd498bd0ac4b5ll + 0xaa8544e593dll)&mask
#define advance17(s) s = (s*0xee96bd575badll + 0xc45d76fd665bll)&mask

#define regress1(s) s = (s*0xdfe05bcb1365ll + 0x615c0e462aa9ll)&mask
#define regress3(s) s = (s*0x13a1f16f099dll + 0x95756c5d2097ll)&mask
#define regress3759(s) s = (s*0x63a9985be4adll + 0xa9aa8da9bc9bll)&mask
#define advance2(s) s = (s*0xbb20b4600a69ll + 0x40942de6ball)&mask

#define getNextInt(x, s) advance1(s); x = (int)(s>>16)

// need spare longs temp1 and temp2
#define getNextLong(x, s) getNextInt(temp1, s); getNextInt(temp2, s); x = (temp1 << 32) + temp2

#define getIntBounded(x, s, n) if ((n&(-n))==n) {advance1(s); x = (int)((n*(s>>17)) >> 31);} else {do{advance1(s); bits = s>>17; val = bits%n;}while(bits-val+(n-1)<0); x=val;}

#define getBits(x, s, n) advance1(s); x = (int) (s >> (48-n));

#define setSeed(s, x) s = x^m&mask


#define MAX_TREES 12 // can change this later (performance & output is not very sensitive to this parameter)

#define x_1 9
#define z_1 2
const int x_2 = x_1 - 7;
const int z_2 = z_1 + 1;

#define SMALL_TREE_SPACING 2
#define BIG_TREE_SPACING 7 

__device__ __managed__ unsigned long long int num_found = 0;
#define memsz 100000
__device__ __managed__ ll ret[memsz];

__device__ __managed__ char table[16][16]; // can a tree spawn here
// 0 : no
// 1 : tree_1's territory
// 2 : tree_2's territory
// 3 : joint tree_1 and tree_2
// 8 : a small tree's leaves
// 9 : I don't know (assume yes)
__device__ __managed__ int visited = 0;



__device__ void output_seed(ll s) {
	regress1(s);
	ll id = atomicAdd(&num_found, 1ull); // dw about red underline
	ret[id] = s;
}

// coordinates are relative to tree_1 position
void add_unseen(int sz, int ez, int x) {
	sz -= 2; // fudge factor for safety
	int i = x + x_1;
	for (int j = sz + z_1; j < ez + z_1; j++) {
		if ((i & 15) == i && (j & 15) == j)
		{
			table[i][j] = 9;
		}
	}
}

// fill a rectangle with a number (1 or 2 or 3)
void fill_rect(int sx, int sz, int ex, int ez, int fill) {
	assert(fill == 1 || fill == 2 || fill == 3);
	for (int i = max(0, x_1 + sx); i < min(16, x_1 + ex); i++) {
		for (int j = max(0, z_1 + sz); j < min(16, z_1 + ez); ++j)
		{
			table[i][j] = fill;
		}
	}
}

void init_table() {
	for (int i = 0; i < 16; ++i)
	{
		for (int j = 0; j < 16; ++j)
		{
			table[i][j] = 0;
		}
	}
	/*
	// big tree leaves
	fill_rect(-1, -2, 5, 10, 1);
	fill_rect(-6, -2, -1, 10, 3);
	fill_rect(-13, 0, -6, 10, 2);
	// small pieces of tree:
	fill_rect(1, -3, 4, -2, 1);
	fill_rect(5, 2, 6, 3, 1);
	fill_rect(5, 5, 6, 7, 1);
	fill_rect(-8, -1, -6, 0, 2);
	*/
	for (int i = max(0, x_1 - BIG_TREE_SPACING); i <= min(15, x_1 + BIG_TREE_SPACING); ++i)
	{
		for (int j = max(0, z_1 - BIG_TREE_SPACING); j <= min(15, z_1 + BIG_TREE_SPACING); ++j)
		{
			table[i][j] |= 1;
		}
	}
	for (int i = max(0, x_2 - BIG_TREE_SPACING); i <= min(15, x_2 + BIG_TREE_SPACING); ++i)
	{
		for (int j = max(0, z_2 - BIG_TREE_SPACING); j <= min(15, z_2 + BIG_TREE_SPACING); ++j)
		{
			table[i][j] |= 2;
		}
	}

	// add locations where it's unclear if there is a tree or not



	add_unseen(4, 14, 6);
	add_unseen(7, 14, 5);
	add_unseen(8, 14, 4);
	add_unseen(9, 14, 3);
	add_unseen(10, 14, 2);
	add_unseen(11, 14, 1);
	add_unseen(12, 14, 0);
	add_unseen(12, 14, -1);
	add_unseen(12, 14, -2);
	add_unseen(13, 14, -3);
	add_unseen(13, 14, -4);
	add_unseen(13, 14, -5);
	add_unseen(14, 14, -6);
	add_unseen(14, 14, -7);
	add_unseen(14, 14, -8);
	add_unseen(14, 14, -9);
	add_unseen(14, 14, -10);
	add_unseen(14, 14, -11);
	add_unseen(14, 14, -12);
	add_unseen(14, 14, -13);

	// near a small tree 3
	int x_3 = x_1 - 12;
	int z_3 = z_1 - 7;
	for (int i = max(0, x_3 - SMALL_TREE_SPACING); i <= min(15, x_3 + SMALL_TREE_SPACING); ++i)
	{
		for (int j = max(0, z_3 - SMALL_TREE_SPACING); j <= min(15, z_3 + SMALL_TREE_SPACING); ++j)
		{
			table[i][j] = 8;
		}
	}
	// near a small tree 4
	int x_4 = x_1 - 10;
	int z_4 = z_1 - 12;
	for (int i = max(0, x_4 - SMALL_TREE_SPACING); i <= min(15, x_4 + SMALL_TREE_SPACING); ++i)
	{
		for (int j = max(0, z_4 - SMALL_TREE_SPACING); j <= min(15, z_4 + SMALL_TREE_SPACING); ++j)
		{
			table[i][j] = 8;
		}
	}
	// near a small tree 5
	int x_5 = x_1 - 5;
	int z_5 = z_1 - 15;
	for (int i = max(0, x_5 - SMALL_TREE_SPACING); i <= min(15, x_5 + SMALL_TREE_SPACING); ++i)
	{
		for (int j = max(0, z_5 - SMALL_TREE_SPACING); j <= min(15, z_5 + SMALL_TREE_SPACING); ++j)
		{
			table[i][j] = 8;
		}
	}

	for (int i = 15; i >= 0; --i)
	{
		for (int j = 0; j < 16; ++j)
		{
			printf("%d ", table[i][j]);
		}
		printf("\n");
	}
	printf("\n");
}




int file_num = 0;
ofstream get_next_file() {
	string path("_inter21/_intermediate");
	path = path + to_string(file_num++) + ".txt";
	ofstream of(path);
	return of;
}


// todo: work this out
__device__ int is_field_878_e_ok(int field_878_e) {
	//return 1;
	return field_878_e == 11;// || field_878_e == 12;
	//return field_878_e >= 11 && field_878_e <= 12;
}

// we get a 48-bit candidate; (it's given that this is a big tree chunk) 
__device__ void check_tree_seed(ll s, char s_table[16][16]) {
	ll original = s;
	int found_1 = 0;
	int found_2 = 0;
	int tree_x, tree_z;
	int bits, val;
	ll temp1, temp2;
	ll saved_seed;
	for (int i = 0; i < MAX_TREES; ++i) {
		getBits(tree_x, s, 4);
		getBits(tree_z, s, 4);
		if (i == 0) {
			saved_seed = s; // save for tree-height check
		}
		advance2(s);

		if (!found_1 && tree_x == x_1 && tree_z == z_1) {
			if (found_2) {
				output_seed(original);
				return;
			}
			found_1 = 1;
		}
		else if (!found_2 && tree_x == x_2 && tree_z == z_2) {
			if (found_1) {
				output_seed(original);
				return;
			}
			found_2 = 1;
		}
		else {
			char lookup = s_table[tree_x][tree_z];
			if ((lookup == 0) || (lookup == 1 && !found_1) || (lookup == 2 && !found_2) || (lookup == 3 && !found_1 && !found_2)) {
				return; // seed is eliminated
			}
		}
		if (i == 0) {
			// we do this check as late as possible because it is more expensive
			ll internal_big_tree_seed;
			getNextLong(internal_big_tree_seed, saved_seed);
			setSeed(internal_big_tree_seed, internal_big_tree_seed);
			int field_878_e;
			getIntBounded(field_878_e, internal_big_tree_seed, 12);
			if (!is_field_878_e_ok(field_878_e + 5)) {
				return; // wrong tree-size
			}
		}

	}
}

__global__ void treeKernel(ll global_id) {
	__shared__ char s_table[16][16];
	ll tid = threadIdx.x;
	s_table[tid % 16][tid / 16] = table[tid % 16][tid / 16];
	__syncthreads();
	ll bid = blockIdx.x;
	

	ll div_ten = ((global_id << 25) | (bid << 17));
	ll upper31 = mask & (10ll*div_ten); // upper 31 bits of seed are multiple of ten
	if (upper31 < div_ten) {
		return; // overflowed the 48 bits (happens on final few blocks)
	}
	ll upper39 = upper31 | (tid << 9);

	for (ll lower9 = 0; lower9 < (1ll << 9); lower9++) {
		ll seed = upper39 | lower9;
		check_tree_seed(seed, s_table);
	}
 }


#define RUN_ID 200
cudaError_t do_work() {

	
	ofstream log("big_tree_log_200.txt");
	cudaError_t cudaStatus;

	// Choose which GPU to run on, change this on a multi-GPU system.
	cudaStatus = cudaSetDevice(0);
	if (cudaStatus != cudaSuccess) {
		fprintf(stderr, "cudaSetDevice failed!  Do you have a CUDA-capable GPU installed?");
		return cudaStatus;
	}




	int threads_per_block = 256;
	int num_blocks = 256;        // can't change these without breaking code

	// Check for any errors launching the kernel
	cudaStatus = cudaGetLastError();
	if (cudaStatus != cudaSuccess) {
		fprintf(stderr, "big tree kernel launch failed: %s\n", cudaGetErrorString(cudaStatus));
		return cudaStatus;
	}
	//ll num_found = 0;
	printf("begin xyz\n");
	auto start = chrono::steady_clock::now();
	int num_written = 0;
	ll NUM_ITERS = 838861; // ceil(2^31 / 2^8 / 10)
	//NUM_ITERS = 10000;
	for (ll o = 0; o < NUM_ITERS; o ++) {
		treeKernel <<<num_blocks, threads_per_block >>> (o);
		if (o % 100 == 0) {
			ofstream fout = get_next_file();
			cudaDeviceSynchronize();
			fout << RUN_ID << endl;
			fout << x_1 << endl << z_1 << endl;
			fout << num_found << endl;
			for (int i = 0; i < num_found; i++) {
				fout << ret[i] << endl;
				num_written++;
			}
			fout.close();
			num_found = 0;
			//printf("%lld\n", o);
			auto end = chrono::steady_clock::now();
			ll time = (chrono::duration_cast<chrono::microseconds>(end - start).count());
			float eta = ((838861-o) / ((float)o)) * ((float)time) / 3600.0 / 1000000.0;
			log << "doing " << o << " time taken us =" << time << " eta (hrs) = " << eta << endl;
			log.flush();
		}
		

	}
	
	// cudaDeviceSynchronize waits for the kernel to finish, and returns
    // any errors encountered during the launch.
	cudaStatus = cudaDeviceSynchronize();
	if (cudaStatus != cudaSuccess) {
		fprintf(stderr, "cuda not sync: %s\n", cudaGetErrorString(cudaStatus));
		return cudaStatus;
	}
	auto end = chrono::steady_clock::now();
	cout << "time taken us =" << chrono::duration_cast<chrono::microseconds>(end - start).count() << endl;

	ofstream fout = get_next_file();
	fout << RUN_ID << endl;
	fout << x_1 << endl << z_1 << endl;
	fout << num_found << endl;
	for (int i = 0; i < num_found; i++) {
		fout << ret[i] << endl;
		num_written++;
	}
	fout.close();
	cout << "total seeds written=" << num_written << endl;

	

	if (cudaStatus != cudaSuccess) {
		fprintf(stderr, "cudaDeviceSynchronize returned error code %d after launching big tree kernel!\n", cudaStatus);
	}

	return cudaStatus;
}


int main()
{
	init_table();
	// Add vectors in parallel.
	cudaError_t cudaStatus = do_work();
	if (cudaStatus != cudaSuccess) {
		fprintf(stderr, "cuda failed!");
		return 1;
	}
	// cudaDeviceReset must be called before exiting in order for profiling and
	// tracing tools such as Nsight and Visual Profiler to show complete traces.
	cudaStatus = cudaDeviceReset();
	if (cudaStatus != cudaSuccess) {
		fprintf(stderr, "cudaDeviceReset failed!");
		return 1;
	}

	return 0;
}
	.file	"tmpxft_00384605_00000000-6_kernel.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL20__nv_init_managed_rtv, @function
_ZL20__nv_init_managed_rtv:
.LFB1:
	.cfi_startproc
	movb	_ZL22__nv_inited_managed_rt(%rip), %al
	testb	%al, %al
	jne	.L4
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	_ZL32__nv_fatbinhandle_for_managed_rt(%rip), %rdi
	call	__cudaInitModule@PLT
	movb	%al, _ZL22__nv_inited_managed_rt(%rip)
	popq	%rdx
	.cfi_def_cfa_offset 8
	ret
.L4:
	movb	%al, _ZL22__nv_inited_managed_rt(%rip)
	ret
	.cfi_endproc
.LFE1:
	.size	_ZL20__nv_init_managed_rtv, .-_ZL20__nv_init_managed_rtv
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3881:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3881:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z11output_seedx
	.type	_Z11output_seedx, @function
_Z11output_seedx:
.LFB3865:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3865:
	.size	_Z11output_seedx, .-_Z11output_seedx
	.globl	_Z10add_unseeniii
	.type	_Z10add_unseeniii, @function
_Z10add_unseeniii:
.LFB3866:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leal	9(%rdx), %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movslq	%ebp, %r13
	movslq	%edi, %rbx
	pushq	%rcx
	.cfi_def_cfa_offset 48
.L12:
	leal	1(%r12), %eax
	movl	%ebx, %edx
	cmpl	%ebx, %eax
	jl	.L23
	cmpl	$15, %ebp
	ja	.L13
	cmpl	$15, %edx
	ja	.L13
	cmpb	$0, _ZL22__nv_inited_managed_rt(%rip)
	jne	.L14
	call	_ZL20__nv_init_managed_rtv
.L14:
	movq	%r13, %rdx
	movslq	%ebx, %rax
	salq	$4, %rdx
	addq	_ZL5table(%rip), %rdx
	movb	$9, (%rdx,%rax)
.L13:
	incq	%rbx
	jmp	.L12
.L23:
	popq	%rax
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3866:
	.size	_Z10add_unseeniii, .-_Z10add_unseeniii
	.globl	_Z9fill_rectiiiii
	.type	_Z9fill_rectiiiii, @function
_Z9fill_rectiiiii:
.LFB3867:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	movl	%esi, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%ecx, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leal	9(%rdi), %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	testl	%ebx, %ebx
	cmovs	%eax, %ebx
.L25:
	leal	9(%r12), %eax
	movl	$16, %ecx
	cmpl	%ecx, %eax
	cmovg	%ecx, %eax
	cmpl	%eax, %ebx
	jge	.L31
	leal	2(%r15), %ebp
	xorl	%eax, %eax
	testl	%ebp, %ebp
	cmovs	%eax, %ebp
	movslq	%ebx, %rax
	movq	%rax, (%rsp)
	movslq	%ebp, %rbp
.L26:
	leal	2(%r14), %eax
	movl	$16, %ecx
	movslq	%ebp, %r13
	cmpl	%ecx, %eax
	cmovg	%ecx, %eax
	cmpl	%ebp, %eax
	jle	.L32
	cmpb	$0, _ZL22__nv_inited_managed_rt(%rip)
	jne	.L27
	movl	%r8d, 12(%rsp)
	call	_ZL20__nv_init_managed_rtv
	movl	12(%rsp), %r8d
.L27:
	movq	(%rsp), %rax
	incq	%rbp
	salq	$4, %rax
	addq	_ZL5table(%rip), %rax
	movb	%r8b, (%rax,%r13)
	jmp	.L26
.L32:
	incl	%ebx
	jmp	.L25
.L31:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3867:
	.size	_Z9fill_rectiiiii, .-_Z9fill_rectiiiii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d "
.LC1:
	.string	"\n"
	.text
	.globl	_Z10init_tablev
	.type	_Z10init_tablev, @function
_Z10init_tablev:
.LFB3868:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	pushq	%rcx
	.cfi_def_cfa_offset 48
.L34:
	movslq	%ebx, %r12
	xorl	%ebp, %ebp
	salq	$4, %r12
.L36:
	cmpb	$0, _ZL22__nv_inited_managed_rt(%rip)
	jne	.L35
	call	_ZL20__nv_init_managed_rtv
.L35:
	movq	_ZL5table(%rip), %rdx
	movslq	%ebp, %rax
	incl	%ebp
	addq	%r12, %rdx
	movb	$0, (%rdx,%rax)
	cmpl	$16, %ebp
	jne	.L36
	incl	%ebx
	cmpl	$16, %ebx
	jne	.L34
	movl	$2, %ebx
.L37:
	movslq	%ebx, %r12
	xorl	%ebp, %ebp
	salq	$4, %r12
.L39:
	cmpb	$0, _ZL22__nv_inited_managed_rt(%rip)
	jne	.L38
	call	_ZL20__nv_init_managed_rtv
.L38:
	movq	_ZL5table(%rip), %rdx
	movslq	%ebp, %rax
	incl	%ebp
	addq	%r12, %rdx
	orb	$1, (%rdx,%rax)
	cmpl	$10, %ebp
	jne	.L39
	incl	%ebx
	cmpl	$16, %ebx
	jne	.L37
	xorl	%ebx, %ebx
.L40:
	movslq	%ebx, %r12
	xorl	%ebp, %ebp
	salq	$4, %r12
.L42:
	cmpb	$0, _ZL22__nv_inited_managed_rt(%rip)
	jne	.L41
	call	_ZL20__nv_init_managed_rtv
.L41:
	movq	_ZL5table(%rip), %rdx
	movslq	%ebp, %rax
	incl	%ebp
	addq	%r12, %rdx
	orb	$2, (%rdx,%rax)
	cmpl	$11, %ebp
	jne	.L42
	incl	%ebx
	cmpl	$10, %ebx
	jne	.L40
	movl	$6, %edx
	movl	$14, %esi
	movl	$4, %edi
	movl	$15, %ebx
	call	_Z10add_unseeniii
	movl	$5, %edx
	movl	$14, %esi
	movl	$7, %edi
	call	_Z10add_unseeniii
	movl	$4, %edx
	movl	$14, %esi
	movl	$8, %edi
	call	_Z10add_unseeniii
	movl	$3, %edx
	movl	$14, %esi
	movl	$9, %edi
	call	_Z10add_unseeniii
	movl	$2, %edx
	movl	$14, %esi
	movl	$10, %edi
	call	_Z10add_unseeniii
	movl	$1, %edx
	movl	$14, %esi
	movl	$11, %edi
	call	_Z10add_unseeniii
	xorl	%edx, %edx
	movl	$14, %esi
	movl	$12, %edi
	call	_Z10add_unseeniii
	orl	$-1, %edx
	movl	$14, %esi
	movl	$12, %edi
	call	_Z10add_unseeniii
	movl	$-2, %edx
	movl	$14, %esi
	movl	$12, %edi
	call	_Z10add_unseeniii
	movl	$-3, %edx
	movl	$14, %esi
	movl	$13, %edi
	call	_Z10add_unseeniii
	movl	$-4, %edx
	movl	$14, %esi
	movl	$13, %edi
	call	_Z10add_unseeniii
	movl	$-5, %edx
	movl	$14, %esi
	movl	$13, %edi
	call	_Z10add_unseeniii
	movl	$-6, %edx
	movl	$14, %esi
	movl	$14, %edi
	call	_Z10add_unseeniii
	movl	$-7, %edx
	movl	$14, %esi
	movl	$14, %edi
	call	_Z10add_unseeniii
	movl	$-8, %edx
	movl	$14, %esi
	movl	$14, %edi
	call	_Z10add_unseeniii
	movl	$-9, %edx
	movl	$14, %esi
	movl	$14, %edi
	call	_Z10add_unseeniii
	movl	$-10, %edx
	movl	$14, %esi
	movl	$14, %edi
	call	_Z10add_unseeniii
	movl	$-11, %edx
	movl	$14, %esi
	movl	$14, %edi
	call	_Z10add_unseeniii
	movl	$-12, %edx
	movl	$14, %esi
	movl	$14, %edi
	call	_Z10add_unseeniii
	movl	$-13, %edx
	movl	$14, %esi
	movl	$14, %edi
	call	_Z10add_unseeniii
	leaq	.LC0(%rip), %r13
.L44:
	movslq	%ebx, %r12
	xorl	%ebp, %ebp
	salq	$4, %r12
.L46:
	cmpb	$0, _ZL22__nv_inited_managed_rt(%rip)
	jne	.L45
	call	_ZL20__nv_init_managed_rtv
.L45:
	movq	_ZL5table(%rip), %rdx
	movslq	%ebp, %rax
	movq	%r13, %rsi
	movl	$2, %edi
	incl	%ebp
	addq	%r12, %rdx
	movsbl	(%rdx,%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$16, %ebp
	jne	.L46
	leaq	.LC1(%rip), %rbp
	xorl	%eax, %eax
	movl	$2, %edi
	movq	%rbp, %rsi
	call	__printf_chk@PLT
	subl	$1, %ebx
	jnb	.L44
	popq	%rdx
	.cfi_def_cfa_offset 40
	movq	%rbp, %rsi
	popq	%rbx
	.cfi_def_cfa_offset 32
	movl	$2, %edi
	popq	%rbp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE3868:
	.size	_Z10init_tablev, .-_Z10init_tablev
	.section	.rodata.str1.1
.LC2:
	.string	"_inter21/_intermediate"
.LC4:
	.string	".txt"
.LC3:
	.string	"00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899"
	.text
	.globl	_Z13get_next_filev
	.type	_Z13get_next_filev, @function
_Z13get_next_filev:
.LFB3869:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3869
	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
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	$1, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$376, %rsp
	.cfi_def_cfa_offset 432
	movq	%fs:40, %rax
	movq	%rax, 360(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	leaq	16(%rsp), %rsi
	movq	$22, 16(%rsp)
	movq	%rax, (%rsp)
	movq	(%rsp), %rdi
	leaq	40(%rsp), %rax
	movq	%rax, 24(%rsp)
.LEHB0:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
.LEHE0:
	leaq	22+.LC2(%rip), %rdx
	movq	%rax, 24(%rsp)
	movq	%rax, %rdi
	movq	16(%rsp), %rax
	leaq	-22(%rdx), %rsi
	movq	%rax, 40(%rsp)
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	16(%rsp), %rax
	movq	24(%rsp), %rdx
	movl	$10000, %ecx
	movq	%rax, 32(%rsp)
	movb	$0, (%rdx,%rax)
	movl	file_num(%rip), %eax
	movl	%eax, %r12d
	movl	%eax, %ebx
	leal	1(%rax), %edx
	shrl	$31, %r12d
	negl	%ebx
	movl	%edx, file_num(%rip)
	cmovs	%eax, %ebx
	movl	%ebx, %eax
.L62:
	cmpl	$9, %eax
	jbe	.L58
	cmpl	$99, %eax
	ja	.L59
	incl	%ebp
	jmp	.L58
.L59:
	cmpl	$999, %eax
	ja	.L60
	addl	$2, %ebp
	jmp	.L58
.L60:
	cmpl	$9999, %eax
	ja	.L61
	addl	$3, %ebp
	jmp	.L58
.L61:
	movl	%eax, %eax
	xorl	%edx, %edx
	addl	$4, %ebp
	divq	%rcx
	jmp	.L62
.L58:
	leaq	56(%rsp), %r13
	leal	(%r12,%rbp), %esi
	movl	$45, %edx
	decl	%ebp
	leaq	72(%rsp), %rax
	movq	%r13, %rdi
	movq	%rax, 56(%rsp)
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructEmc@PLT
	movzbl	%r12b, %r8d
	movl	$201, %ecx
	leaq	159(%rsp), %rdi
	leaq	.LC3(%rip), %rsi
	addq	56(%rsp), %r8
	rep movsb
	movl	$100, %ecx
.L63:
	cmpl	$99, %ebx
	jbe	.L86
	movl	%ebx, %eax
	xorl	%edx, %edx
	movl	%ebp, %esi
	divl	%ecx
	addl	%edx, %edx
	movl	%eax, %ebx
	leal	1(%rdx), %eax
	movb	159(%rsp,%rdx), %dl
	movb	159(%rsp,%rax), %al
	movb	%al, (%r8,%rsi)
	leal	-1(%rbp), %eax
	subl	$2, %ebp
	movb	%dl, (%r8,%rax)
	jmp	.L63
.L86:
	leal	48(%rbx), %eax
	cmpl	$9, %ebx
	jbe	.L66
	addl	%ebx, %ebx
	leal	1(%rbx), %eax
	movb	159(%rsp,%rax), %al
	movb	%al, 1(%r8)
	movb	159(%rsp,%rbx), %al
.L66:
	movb	%al, (%r8)
	movq	(%rsp), %rdx
	xorl	%esi, %esi
	movq	%r13, %rdi
.LEHB1:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6insertEmRKS4_@PLT
.LEHE1:
	leaq	88(%rsp), %rbp
	movq	%rax, %rsi
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EOS4_@PLT
	leaq	.LC4(%rip), %rsi
	movq	%rbp, %rdi
.LEHB2:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc@PLT
.LEHE2:
	leaq	120(%rsp), %rbx
	movq	%rax, %rsi
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EOS4_@PLT
	movq	%rbx, %rdi
	call	_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv@PLT
	movq	128(%rsp), %rdx
	testb	%al, %al
	je	.L67
	testq	%rdx, %rdx
	je	.L68
	movq	120(%rsp), %rsi
	movq	24(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7_S_copyEPcPKcm@PLT
.L68:
	movq	128(%rsp), %rax
	movq	24(%rsp), %rdx
	movq	%rax, 32(%rsp)
	movb	$0, (%rdx,%rax)
	jmp	.L69
.L67:
	movq	(%rsp), %rdi
	movq	%rdx, 8(%rsp)
	call	_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv@PLT
	movq	8(%rsp), %rdx
	movl	%eax, %ecx
	xorl	%eax, %eax
	testb	%cl, %cl
	jne	.L70
	movq	24(%rsp), %rax
	movq	40(%rsp), %r15
.L70:
	movq	%rdx, 32(%rsp)
	movq	120(%rsp), %rcx
	movq	136(%rsp), %rdx
	movq	%rcx, 24(%rsp)
	movq	%rdx, 40(%rsp)
	testq	%rax, %rax
	je	.L71
	movq	%rax, 120(%rsp)
	movq	%r15, 136(%rsp)
	jmp	.L69
.L71:
	leaq	136(%rsp), %rax
	movq	%rax, 120(%rsp)
.L69:
	xorl	%eax, %eax
	movq	%rbx, %rdi
	movq	%rax, 128(%rsp)
	movq	120(%rsp), %rax
	movb	$0, (%rax)
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r13, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	(%rsp), %rsi
	movl	$16, %edx
	movq	%r14, %rdi
.LEHB3:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1ERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode@PLT
.LEHE3:
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	360(%rsp), %rax
	subq	%fs:40, %rax
	je	.L76
	jmp	.L84
.L79:
	endbr64
	movq	%rax, %rbx
.L72:
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L73
.L78:
	endbr64
	movq	%rax, %rbx
.L73:
	movq	%r13, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L74
.L80:
	endbr64
	movq	%rax, %rbx
.L74:
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	360(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L84
	movq	%rbx, %rdi
.LEHB4:
	call	_Unwind_Resume@PLT
.LEHE4:
.L84:
	call	__stack_chk_fail@PLT
.L76:
	addq	$376, %rsp
	.cfi_def_cfa_offset 56
	movq	%r14, %rax
	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
.LFE3869:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3869:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3869-.LLSDACSB3869
.LLSDACSB3869:
	.uleb128 .LEHB0-.LFB3869
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3869
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L78-.LFB3869
	.uleb128 0
	.uleb128 .LEHB2-.LFB3869
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L79-.LFB3869
	.uleb128 0
	.uleb128 .LEHB3-.LFB3869
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L80-.LFB3869
	.uleb128 0
	.uleb128 .LEHB4-.LFB3869
	.uleb128 .LEHE4-.LEHB4
	.uleb128 0
	.uleb128 0
.LLSDACSE3869:
	.text
	.size	_Z13get_next_filev, .-_Z13get_next_filev
	.globl	_Z17is_field_878_e_oki
	.type	_Z17is_field_878_e_oki, @function
_Z17is_field_878_e_oki:
.LFB3873:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3873:
	.size	_Z17is_field_878_e_oki, .-_Z17is_field_878_e_oki
	.globl	_Z15check_tree_seedxPA16_c
	.type	_Z15check_tree_seedxPA16_c, @function
_Z15check_tree_seedxPA16_c:
.LFB3874:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3874:
	.size	_Z15check_tree_seedxPA16_c, .-_Z15check_tree_seedxPA16_c
	.globl	_Z29__device_stub__Z10treeKernelxx
	.type	_Z29__device_stub__Z10treeKernelxx, @function
_Z29__device_stub__Z10treeKernelxx:
.LFB3903:
	.cfi_startproc
	endbr64
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movq	%rdi, 8(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	44(%rsp), %rsi
	leaq	32(%rsp), %rdi
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L91
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z10treeKernelx(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 128
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L91:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L93
	call	__stack_chk_fail@PLT
.L93:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3903:
	.size	_Z29__device_stub__Z10treeKernelxx, .-_Z29__device_stub__Z10treeKernelxx
	.globl	_Z10treeKernelx
	.type	_Z10treeKernelx, @function
_Z10treeKernelx:
.LFB3904:
	.cfi_startproc
	endbr64
	jmp	_Z29__device_stub__Z10treeKernelxx
	.cfi_endproc
.LFE3904:
	.size	_Z10treeKernelx, .-_Z10treeKernelx
	.section	.rodata.str1.1
.LC5:
	.string	"_Z10treeKernelx"
.LC6:
	.string	"num_found"
.LC7:
	.string	"ret"
.LC8:
	.string	"table"
.LC9:
	.string	"visited"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3906:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC5(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z10treeKernelx(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	movq	%rax, _ZL32__nv_fatbinhandle_for_managed_rt(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC6(%rip), %rdx
	movl	$8, %r9d
	leaq	_ZL9num_found(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterManagedVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC7(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$800000, %r9d
	leaq	_ZL3ret(%rip), %rsi
	call	__cudaRegisterManagedVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC8(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$256, %r9d
	leaq	_ZL5table(%rip), %rsi
	call	__cudaRegisterManagedVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	popq	%r8
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC9(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movl	$4, %r9d
	movq	%rdx, %rcx
	leaq	_ZL7visited(%rip), %rsi
	call	__cudaRegisterManagedVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%r9
	.cfi_def_cfa_offset 24
	popq	%r10
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3906:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1
.LC10:
	.string	"big_tree_log_200.txt"
.LC11:
	.string	"cudaSetDevice failed!  Do you have a CUDA-capable GPU installed?"
.LC12:
	.string	"big tree kernel launch failed: %s\n"
.LC13:
	.string	"begin xyz\n"
.LC16:
	.string	"doing "
.LC17:
	.string	" time taken us ="
.LC18:
	.string	" eta (hrs) = "
.LC19:
	.string	"cuda not sync: %s\n"
.LC20:
	.string	"time taken us ="
.LC21:
	.string	"total seeds written="
	.text
	.globl	_Z7do_workv
	.type	_Z7do_workv, @function
_Z7do_workv:
.LFB3875:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3875
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$16, %edx
	leaq	.LC10(%rip), %rsi
	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	$1096, %rsp
	.cfi_def_cfa_offset 1152
	movq	%fs:40, %rax
	movq	%rax, 1080(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
.LEHB5:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE5:
	xorl	%edi, %edi
.LEHB6:
	call	cudaSetDevice@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L99
	movq	stderr(%rip), %rdi
	leaq	.LC11(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	jmp	.L100
.L99:
	call	cudaGetLastError@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L101
	movl	%eax, %edi
	call	cudaGetErrorString@PLT
	movq	%rax, %rcx
	leaq	.LC12(%rip), %rdx
	jmp	.L154
.L101:
	leaq	.LC13(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	call	_ZNSt6chrono3_V212steady_clock3nowEv@PLT
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
	movabsq	$4294967552, %r14
	movq	%rax, %r13
.L120:
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r14, %rdx
	movl	$1, %ecx
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r14, 44(%rsp)
	movl	$1, 52(%rsp)
	movq	%r14, 32(%rsp)
	movl	$1, 40(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L102
.L105:
	movq	%rbx, %rax
	movl	$100, %ecx
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L104
	jmp	.L156
.L102:
	movq	%rbx, %rdi
	call	_Z29__device_stub__Z10treeKernelxx
	jmp	.L105
.L156:
	leaq	568(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	_Z13get_next_filev
.LEHE6:
.LEHB7:
	call	cudaDeviceSynchronize@PLT
	movq	8(%rsp), %rdi
	movl	$200, %esi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	8(%rsp), %rdi
	movl	$9, %esi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	%rax, %rdi
	movl	$2, %esi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	cmpb	$0, _ZL22__nv_inited_managed_rt(%rip)
	je	.L106
.L108:
	movq	_ZL9num_found(%rip), %rax
	movq	8(%rsp), %rdi
	movq	(%rax), %rsi
	call	_ZNSo9_M_insertIyEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	xorl	%r12d, %r12d
	jmp	.L109
.L106:
	call	_ZL20__nv_init_managed_rtv
	jmp	.L108
.L113:
	call	_ZL20__nv_init_managed_rtv
.L116:
	movq	_ZL9num_found(%rip), %rax
	cmpq	(%rax), %r12
	jnb	.L157
	cmpb	$0, _ZL22__nv_inited_managed_rt(%rip)
	je	.L110
.L112:
	movq	_ZL3ret(%rip), %rax
	movq	8(%rsp), %rdi
	movq	(%rax,%r15,8), %rsi
	call	_ZNSo9_M_insertIxEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	incq	%r12
.L109:
	cmpb	$0, _ZL22__nv_inited_managed_rt(%rip)
	movslq	%r12d, %r15
	jne	.L116
	jmp	.L113
.L110:
	call	_ZL20__nv_init_managed_rtv
	jmp	.L112
.L157:
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
	cmpb	$0, _ZL22__nv_inited_managed_rt(%rip)
	je	.L117
.L119:
	movq	_ZL9num_found(%rip), %rax
	xorl	%edx, %edx
	movq	%rdx, (%rax)
	call	_ZNSt6chrono3_V212steady_clock3nowEv@PLT
	movl	$1000, %ecx
	cvtsi2ssq	%rbx, %xmm1
	movq	16(%rsp), %rdi
	subq	%r13, %rax
	leaq	.LC16(%rip), %rsi
	cqto
	idivq	%rcx
	movq	%rax, %r15
	movl	$838861, %eax
	subq	%rbx, %rax
	cvtsi2ssq	%rax, %xmm0
	divss	%xmm1, %xmm0
	cvtsi2ssq	%r15, %xmm1
	mulss	%xmm1, %xmm0
	cvtss2sd	%xmm0, %xmm0
	divsd	.LC14(%rip), %xmm0
	divsd	.LC15(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm2
	movss	%xmm2, 28(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%rbx, %rsi
	call	_ZNSo9_M_insertIxEERSoT_@PLT
	jmp	.L158
.L117:
	call	_ZL20__nv_init_managed_rtv
	jmp	.L119
.L158:
	movq	%rax, %rdi
	leaq	.LC17(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%r15, %rsi
	call	_ZNSo9_M_insertIxEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC18(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	cvtss2sd	28(%rsp), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	56(%rsp), %rdi
	call	_ZNSo5flushEv@PLT
.LEHE7:
	movq	8(%rsp), %rdi
	addl	%r12d, %ebp
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
.L104:
	incq	%rbx
	cmpq	$838861, %rbx
	jne	.L120
.LEHB8:
	call	cudaDeviceSynchronize@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L121
	movl	%eax, %edi
	call	cudaGetErrorString@PLT
	movq	%rax, %rcx
	leaq	.LC19(%rip), %rdx
.L154:
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	jmp	.L100
.L121:
	call	_ZNSt6chrono3_V212steady_clock3nowEv@PLT
	leaq	_ZSt4cout(%rip), %r14
	leaq	.LC20(%rip), %rsi
	movq	%r14, %rdi
	movq	%rax, %r12
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	%r12, %rax
	movl	$1000, %ecx
	subq	%r13, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	568(%rsp), %r12
	movq	%r12, %rdi
	call	_Z13get_next_filev
.LEHE8:
	movl	$200, %esi
	movq	%r12, %rdi
.LEHB9:
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movl	$9, %esi
	movq	%r12, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	%rax, %rdi
	movl	$2, %esi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	cmpb	$0, _ZL22__nv_inited_managed_rt(%rip)
	je	.L122
.L124:
	movq	_ZL9num_found(%rip), %rax
	movq	%r12, %rdi
	movq	(%rax), %rsi
	call	_ZNSo9_M_insertIyEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	xorl	%r13d, %r13d
	jmp	.L125
.L122:
	call	_ZL20__nv_init_managed_rtv
	jmp	.L124
.L129:
	call	_ZL20__nv_init_managed_rtv
.L132:
	movq	_ZL9num_found(%rip), %rax
	cmpq	(%rax), %r13
	jnb	.L159
	cmpb	$0, _ZL22__nv_inited_managed_rt(%rip)
	je	.L126
.L128:
	movq	_ZL3ret(%rip), %rax
	movq	%r12, %rdi
	movq	(%rax,%r15,8), %rsi
	call	_ZNSo9_M_insertIxEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	incq	%r13
.L125:
	cmpb	$0, _ZL22__nv_inited_managed_rt(%rip)
	movslq	%r13d, %r15
	jne	.L132
	jmp	.L129
.L126:
	call	_ZL20__nv_init_managed_rtv
	jmp	.L128
.L159:
	movq	%r12, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
	leaq	.LC21(%rip), %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leal	0(%rbp,%r13), %esi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
.LEHE9:
	movq	%r12, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
.L100:
	movq	16(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	1080(%rsp), %rax
	subq	%fs:40, %rax
	je	.L137
	jmp	.L151
.L141:
	endbr64
	movq	%rax, %rbx
.L133:
	movq	8(%rsp), %rdi
	jmp	.L155
.L142:
	endbr64
	movq	%rax, %rbx
.L135:
	movq	%r12, %rdi
.L155:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L134
.L140:
	endbr64
	movq	%rax, %rbx
.L134:
	movq	16(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	1080(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L151
	movq	%rbx, %rdi
.LEHB10:
	call	_Unwind_Resume@PLT
.LEHE10:
.L151:
	call	__stack_chk_fail@PLT
.L137:
	addq	$1096, %rsp
	.cfi_def_cfa_offset 56
	movl	%ebx, %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
.LFE3875:
	.section	.gcc_except_table
.LLSDA3875:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3875-.LLSDACSB3875
.LLSDACSB3875:
	.uleb128 .LEHB5-.LFB3875
	.uleb128 .LEHE5-.LEHB5
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB6-.LFB3875
	.uleb128 .LEHE6-.LEHB6
	.uleb128 .L140-.LFB3875
	.uleb128 0
	.uleb128 .LEHB7-.LFB3875
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L141-.LFB3875
	.uleb128 0
	.uleb128 .LEHB8-.LFB3875
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L140-.LFB3875
	.uleb128 0
	.uleb128 .LEHB9-.LFB3875
	.uleb128 .LEHE9-.LEHB9
	.uleb128 .L142-.LFB3875
	.uleb128 0
	.uleb128 .LEHB10-.LFB3875
	.uleb128 .LEHE10-.LEHB10
	.uleb128 0
	.uleb128 0
.LLSDACSE3875:
	.text
	.size	_Z7do_workv, .-_Z7do_workv
	.section	.rodata.str1.1
.LC22:
	.string	"cuda failed!"
.LC23:
	.string	"cudaDeviceReset failed!"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3878:
	.cfi_startproc
	endbr64
	pushq	%rcx
	.cfi_def_cfa_offset 16
	call	_Z10init_tablev
	call	_Z7do_workv
	testl	%eax, %eax
	je	.L161
	movq	stderr(%rip), %rdi
	leaq	.LC22(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	jmp	.L167
.L161:
	call	cudaDeviceReset@PLT
	movl	%eax, %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	je	.L160
	movq	stderr(%rip), %rdi
	leaq	.LC23(%rip), %rdx
	movl	$2, %esi
.L167:
	call	__fprintf_chk@PLT
	movl	$1, %eax
.L160:
	popq	%rdx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3878:
	.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
	.globl	file_num
	.bss
	.align 4
	.type	file_num, @object
	.size	file_num, 4
file_num:
	.zero	4
	.section	__nv_managed_data__,"aw"
	.align 8
	.type	_ZL7visited, @object
	.size	_ZL7visited, 8
_ZL7visited:
	.zero	8
	.align 8
	.type	_ZL5table, @object
	.size	_ZL5table, 8
_ZL5table:
	.zero	8
	.align 8
	.type	_ZL3ret, @object
	.size	_ZL3ret, 8
_ZL3ret:
	.zero	8
	.align 8
	.type	_ZL9num_found, @object
	.size	_ZL9num_found, 8
_ZL9num_found:
	.zero	8
	.local	_ZL32__nv_fatbinhandle_for_managed_rt
	.comm	_ZL32__nv_fatbinhandle_for_managed_rt,8,8
	.local	_ZL22__nv_inited_managed_rt
	.comm	_ZL22__nv_inited_managed_rt,1,1
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC14:
	.long	0
	.long	1085022208
	.align 8
.LC15:
	.long	0
	.long	1093567616
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include "hip/hip_runtime.h"

#include <iostream>
#include <fstream>
#include <chrono>
#include <string>
using namespace std;
#include <stdio.h>
#include <assert.h>
#include <math.h>
#define ll long long int


const ll m = 0x5DEECE66Dll;
const ll mask = (1ll << 48) - 1;

#define advance1(s) s = (s * m + 11ll) & mask
#define advance3759(s) s = (s*0x6fe85c031f25ll + 0x8f50ecff899ll)&mask
#define advance16(s) s = (s*0x6dc260740241ll + 0xd0352014d90ll)&mask
#define advance387(s) s = (s*0x5fe2bcef32b5ll + 0xb072b3bf0cbdll)&mask
#define advance774(s) s = (s*0xf8d900133f9ll + 0x5738cac2f85ell)&mask
#define advance11(s) s = (s*0x53bce7b8c655ll + 0x3bb194f24a25ll)&mask
#define advance3(s) s = (s*0xd498bd0ac4b5ll + 0xaa8544e593dll)&mask
#define advance17(s) s = (s*0xee96bd575badll + 0xc45d76fd665bll)&mask

#define regress1(s) s = (s*0xdfe05bcb1365ll + 0x615c0e462aa9ll)&mask
#define regress3(s) s = (s*0x13a1f16f099dll + 0x95756c5d2097ll)&mask
#define regress3759(s) s = (s*0x63a9985be4adll + 0xa9aa8da9bc9bll)&mask
#define advance2(s) s = (s*0xbb20b4600a69ll + 0x40942de6ball)&mask

#define getNextInt(x, s) advance1(s); x = (int)(s>>16)

// need spare longs temp1 and temp2
#define getNextLong(x, s) getNextInt(temp1, s); getNextInt(temp2, s); x = (temp1 << 32) + temp2

#define getIntBounded(x, s, n) if ((n&(-n))==n) {advance1(s); x = (int)((n*(s>>17)) >> 31);} else {do{advance1(s); bits = s>>17; val = bits%n;}while(bits-val+(n-1)<0); x=val;}

#define getBits(x, s, n) advance1(s); x = (int) (s >> (48-n));

#define setSeed(s, x) s = x^m&mask


#define MAX_TREES 12 // can change this later (performance & output is not very sensitive to this parameter)

#define x_1 9
#define z_1 2
const int x_2 = x_1 - 7;
const int z_2 = z_1 + 1;

#define SMALL_TREE_SPACING 2
#define BIG_TREE_SPACING 7 

__device__ __managed__ unsigned long long int num_found = 0;
#define memsz 100000
__device__ __managed__ ll ret[memsz];

__device__ __managed__ char table[16][16]; // can a tree spawn here
// 0 : no
// 1 : tree_1's territory
// 2 : tree_2's territory
// 3 : joint tree_1 and tree_2
// 8 : a small tree's leaves
// 9 : I don't know (assume yes)
__device__ __managed__ int visited = 0;



__device__ void output_seed(ll s) {
	regress1(s);
	ll id = atomicAdd(&num_found, 1ull); // dw about red underline
	ret[id] = s;
}

// coordinates are relative to tree_1 position
void add_unseen(int sz, int ez, int x) {
	sz -= 2; // fudge factor for safety
	int i = x + x_1;
	for (int j = sz + z_1; j < ez + z_1; j++) {
		if ((i & 15) == i && (j & 15) == j)
		{
			table[i][j] = 9;
		}
	}
}

// fill a rectangle with a number (1 or 2 or 3)
void fill_rect(int sx, int sz, int ex, int ez, int fill) {
	assert(fill == 1 || fill == 2 || fill == 3);
	for (int i = max(0, x_1 + sx); i < min(16, x_1 + ex); i++) {
		for (int j = max(0, z_1 + sz); j < min(16, z_1 + ez); ++j)
		{
			table[i][j] = fill;
		}
	}
}

void init_table() {
	for (int i = 0; i < 16; ++i)
	{
		for (int j = 0; j < 16; ++j)
		{
			table[i][j] = 0;
		}
	}
	/*
	// big tree leaves
	fill_rect(-1, -2, 5, 10, 1);
	fill_rect(-6, -2, -1, 10, 3);
	fill_rect(-13, 0, -6, 10, 2);
	// small pieces of tree:
	fill_rect(1, -3, 4, -2, 1);
	fill_rect(5, 2, 6, 3, 1);
	fill_rect(5, 5, 6, 7, 1);
	fill_rect(-8, -1, -6, 0, 2);
	*/
	for (int i = max(0, x_1 - BIG_TREE_SPACING); i <= min(15, x_1 + BIG_TREE_SPACING); ++i)
	{
		for (int j = max(0, z_1 - BIG_TREE_SPACING); j <= min(15, z_1 + BIG_TREE_SPACING); ++j)
		{
			table[i][j] |= 1;
		}
	}
	for (int i = max(0, x_2 - BIG_TREE_SPACING); i <= min(15, x_2 + BIG_TREE_SPACING); ++i)
	{
		for (int j = max(0, z_2 - BIG_TREE_SPACING); j <= min(15, z_2 + BIG_TREE_SPACING); ++j)
		{
			table[i][j] |= 2;
		}
	}

	// add locations where it's unclear if there is a tree or not



	add_unseen(4, 14, 6);
	add_unseen(7, 14, 5);
	add_unseen(8, 14, 4);
	add_unseen(9, 14, 3);
	add_unseen(10, 14, 2);
	add_unseen(11, 14, 1);
	add_unseen(12, 14, 0);
	add_unseen(12, 14, -1);
	add_unseen(12, 14, -2);
	add_unseen(13, 14, -3);
	add_unseen(13, 14, -4);
	add_unseen(13, 14, -5);
	add_unseen(14, 14, -6);
	add_unseen(14, 14, -7);
	add_unseen(14, 14, -8);
	add_unseen(14, 14, -9);
	add_unseen(14, 14, -10);
	add_unseen(14, 14, -11);
	add_unseen(14, 14, -12);
	add_unseen(14, 14, -13);

	// near a small tree 3
	int x_3 = x_1 - 12;
	int z_3 = z_1 - 7;
	for (int i = max(0, x_3 - SMALL_TREE_SPACING); i <= min(15, x_3 + SMALL_TREE_SPACING); ++i)
	{
		for (int j = max(0, z_3 - SMALL_TREE_SPACING); j <= min(15, z_3 + SMALL_TREE_SPACING); ++j)
		{
			table[i][j] = 8;
		}
	}
	// near a small tree 4
	int x_4 = x_1 - 10;
	int z_4 = z_1 - 12;
	for (int i = max(0, x_4 - SMALL_TREE_SPACING); i <= min(15, x_4 + SMALL_TREE_SPACING); ++i)
	{
		for (int j = max(0, z_4 - SMALL_TREE_SPACING); j <= min(15, z_4 + SMALL_TREE_SPACING); ++j)
		{
			table[i][j] = 8;
		}
	}
	// near a small tree 5
	int x_5 = x_1 - 5;
	int z_5 = z_1 - 15;
	for (int i = max(0, x_5 - SMALL_TREE_SPACING); i <= min(15, x_5 + SMALL_TREE_SPACING); ++i)
	{
		for (int j = max(0, z_5 - SMALL_TREE_SPACING); j <= min(15, z_5 + SMALL_TREE_SPACING); ++j)
		{
			table[i][j] = 8;
		}
	}

	for (int i = 15; i >= 0; --i)
	{
		for (int j = 0; j < 16; ++j)
		{
			printf("%d ", table[i][j]);
		}
		printf("\n");
	}
	printf("\n");
}




int file_num = 0;
ofstream get_next_file() {
	string path("_inter21/_intermediate");
	path = path + to_string(file_num++) + ".txt";
	ofstream of(path);
	return of;
}


// todo: work this out
__device__ int is_field_878_e_ok(int field_878_e) {
	//return 1;
	return field_878_e == 11;// || field_878_e == 12;
	//return field_878_e >= 11 && field_878_e <= 12;
}

// we get a 48-bit candidate; (it's given that this is a big tree chunk) 
__device__ void check_tree_seed(ll s, char s_table[16][16]) {
	ll original = s;
	int found_1 = 0;
	int found_2 = 0;
	int tree_x, tree_z;
	int bits, val;
	ll temp1, temp2;
	ll saved_seed;
	for (int i = 0; i < MAX_TREES; ++i) {
		getBits(tree_x, s, 4);
		getBits(tree_z, s, 4);
		if (i == 0) {
			saved_seed = s; // save for tree-height check
		}
		advance2(s);

		if (!found_1 && tree_x == x_1 && tree_z == z_1) {
			if (found_2) {
				output_seed(original);
				return;
			}
			found_1 = 1;
		}
		else if (!found_2 && tree_x == x_2 && tree_z == z_2) {
			if (found_1) {
				output_seed(original);
				return;
			}
			found_2 = 1;
		}
		else {
			char lookup = s_table[tree_x][tree_z];
			if ((lookup == 0) || (lookup == 1 && !found_1) || (lookup == 2 && !found_2) || (lookup == 3 && !found_1 && !found_2)) {
				return; // seed is eliminated
			}
		}
		if (i == 0) {
			// we do this check as late as possible because it is more expensive
			ll internal_big_tree_seed;
			getNextLong(internal_big_tree_seed, saved_seed);
			setSeed(internal_big_tree_seed, internal_big_tree_seed);
			int field_878_e;
			getIntBounded(field_878_e, internal_big_tree_seed, 12);
			if (!is_field_878_e_ok(field_878_e + 5)) {
				return; // wrong tree-size
			}
		}

	}
}

__global__ void treeKernel(ll global_id) {
	__shared__ char s_table[16][16];
	ll tid = threadIdx.x;
	s_table[tid % 16][tid / 16] = table[tid % 16][tid / 16];
	__syncthreads();
	ll bid = blockIdx.x;
	

	ll div_ten = ((global_id << 25) | (bid << 17));
	ll upper31 = mask & (10ll*div_ten); // upper 31 bits of seed are multiple of ten
	if (upper31 < div_ten) {
		return; // overflowed the 48 bits (happens on final few blocks)
	}
	ll upper39 = upper31 | (tid << 9);

	for (ll lower9 = 0; lower9 < (1ll << 9); lower9++) {
		ll seed = upper39 | lower9;
		check_tree_seed(seed, s_table);
	}
 }


#define RUN_ID 200
hipError_t do_work() {

	
	ofstream log("big_tree_log_200.txt");
	hipError_t cudaStatus;

	// Choose which GPU to run on, change this on a multi-GPU system.
	cudaStatus = hipSetDevice(0);
	if (cudaStatus != hipSuccess) {
		fprintf(stderr, "hipSetDevice failed!  Do you have a CUDA-capable GPU installed?");
		return cudaStatus;
	}




	int threads_per_block = 256;
	int num_blocks = 256;        // can't change these without breaking code

	// Check for any errors launching the kernel
	cudaStatus = hipGetLastError();
	if (cudaStatus != hipSuccess) {
		fprintf(stderr, "big tree kernel launch failed: %s\n", hipGetErrorString(cudaStatus));
		return cudaStatus;
	}
	//ll num_found = 0;
	printf("begin xyz\n");
	auto start = chrono::steady_clock::now();
	int num_written = 0;
	ll NUM_ITERS = 838861; // ceil(2^31 / 2^8 / 10)
	//NUM_ITERS = 10000;
	for (ll o = 0; o < NUM_ITERS; o ++) {
		treeKernel <<<num_blocks, threads_per_block >>> (o);
		if (o % 100 == 0) {
			ofstream fout = get_next_file();
			hipDeviceSynchronize();
			fout << RUN_ID << endl;
			fout << x_1 << endl << z_1 << endl;
			fout << num_found << endl;
			for (int i = 0; i < num_found; i++) {
				fout << ret[i] << endl;
				num_written++;
			}
			fout.close();
			num_found = 0;
			//printf("%lld\n", o);
			auto end = chrono::steady_clock::now();
			ll time = (chrono::duration_cast<chrono::microseconds>(end - start).count());
			float eta = ((838861-o) / ((float)o)) * ((float)time) / 3600.0 / 1000000.0;
			log << "doing " << o << " time taken us =" << time << " eta (hrs) = " << eta << endl;
			log.flush();
		}
		

	}
	
	// cudaDeviceSynchronize waits for the kernel to finish, and returns
    // any errors encountered during the launch.
	cudaStatus = hipDeviceSynchronize();
	if (cudaStatus != hipSuccess) {
		fprintf(stderr, "cuda not sync: %s\n", hipGetErrorString(cudaStatus));
		return cudaStatus;
	}
	auto end = chrono::steady_clock::now();
	cout << "time taken us =" << chrono::duration_cast<chrono::microseconds>(end - start).count() << endl;

	ofstream fout = get_next_file();
	fout << RUN_ID << endl;
	fout << x_1 << endl << z_1 << endl;
	fout << num_found << endl;
	for (int i = 0; i < num_found; i++) {
		fout << ret[i] << endl;
		num_written++;
	}
	fout.close();
	cout << "total seeds written=" << num_written << endl;

	

	if (cudaStatus != hipSuccess) {
		fprintf(stderr, "hipDeviceSynchronize returned error code %d after launching big tree kernel!\n", cudaStatus);
	}

	return cudaStatus;
}


int main()
{
	init_table();
	// Add vectors in parallel.
	hipError_t cudaStatus = do_work();
	if (cudaStatus != hipSuccess) {
		fprintf(stderr, "cuda failed!");
		return 1;
	}
	// cudaDeviceReset must be called before exiting in order for profiling and
	// tracing tools such as Nsight and Visual Profiler to show complete traces.
	cudaStatus = hipDeviceReset();
	if (cudaStatus != hipSuccess) {
		fprintf(stderr, "hipDeviceReset failed!");
		return 1;
	}

	return 0;
}
	.text
	.file	"kernel.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z10add_unseeniii               # -- Begin function _Z10add_unseeniii
	.type	_Z10add_unseeniii,@function
_Z10add_unseeniii:                      # @_Z10add_unseeniii
	.cfi_startproc
# %bb.0:
	addl	$2, %esi
	cmpl	%edi, %esi
	jle	.LBB0_5
# %bb.1:                                # %.lr.ph
	addl	$9, %edx
	movl	%edx, %eax
	shlq	$4, %rax
.LBB0_2:                                # =>This Inner Loop Header: Depth=1
	movl	%edi, %ecx
	orl	%edx, %ecx
	cmpl	$15, %ecx
	ja	.LBB0_4
# %bb.3:                                #   in Loop: Header=BB0_2 Depth=1
	movl	%edi, %ecx
	movq	table(%rip), %r8
	addq	%rax, %r8
	movb	$9, (%rcx,%r8)
.LBB0_4:                                #   in Loop: Header=BB0_2 Depth=1
	incl	%edi
	cmpl	%edi, %esi
	jne	.LBB0_2
.LBB0_5:                                # %._crit_edge
	retq
.Lfunc_end0:
	.size	_Z10add_unseeniii, .Lfunc_end0-_Z10add_unseeniii
	.cfi_endproc
                                        # -- End function
	.globl	_Z9fill_rectiiiii               # -- Begin function _Z9fill_rectiiiii
	.type	_Z9fill_rectiiiii,@function
_Z9fill_rectiiiii:                      # @_Z9fill_rectiiiii
	.cfi_startproc
# %bb.0:
	cmpl	$-8, %edi
	movl	$-9, %eax
	cmovgel	%edi, %eax
	cmpl	$7, %edx
	movl	$7, %r9d
	cmovll	%edx, %r9d
	cmpl	%r9d, %eax
	jge	.LBB1_5
# %bb.1:                                # %.lr.ph15
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	addl	$9, %eax
	cmpl	$-1, %esi
	movl	$-2, %edx
	cmovgel	%esi, %edx
	cmpl	$14, %ecx
	movl	$14, %esi
	cmovll	%ecx, %esi
	leal	2(%rdx), %ecx
	movslq	%ecx, %rcx
	movslq	%esi, %rdi
	addl	$8, %r9d
	movslq	%r9d, %r9
	decq	%rcx
	movq	%rax, %r10
	shlq	$4, %r10
.LBB1_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_6 Depth 2
	movq	%rcx, %r11
	cmpl	%esi, %edx
	jge	.LBB1_3
.LBB1_6:                                # %.lr.ph
                                        #   Parent Loop BB1_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	table(%rip), %rbx
	addq	%r10, %rbx
	movb	%r8b, 1(%r11,%rbx)
	incq	%r11
	cmpq	%rdi, %r11
	jle	.LBB1_6
.LBB1_3:                                # %._crit_edge
                                        #   in Loop: Header=BB1_2 Depth=1
	leaq	1(%rax), %r11
	addq	$16, %r10
	cmpq	%r9, %rax
	movq	%r11, %rax
	jl	.LBB1_2
# %bb.4:
	popq	%rbx
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
.LBB1_5:                                # %._crit_edge16
	retq
.Lfunc_end1:
	.size	_Z9fill_rectiiiii, .Lfunc_end1-_Z9fill_rectiiiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z10init_tablev                 # -- Begin function _Z10init_tablev
	.type	_Z10init_tablev,@function
_Z10init_tablev:                        # @_Z10init_tablev
	.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
	xorl	%eax, %eax
	xorl	%ecx, %ecx
.LBB2_1:                                # %.preheader160
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_2 Depth 2
	xorl	%edx, %edx
.LBB2_2:                                #   Parent Loop BB2_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	table(%rip), %rsi
	addq	%rax, %rsi
	movb	$0, (%rdx,%rsi)
	incq	%rdx
	cmpq	$16, %rdx
	jne	.LBB2_2
# %bb.3:                                #   in Loop: Header=BB2_1 Depth=1
	incq	%rcx
	addq	$16, %rax
	cmpq	$16, %rcx
	jne	.LBB2_1
# %bb.4:                                # %.preheader158.preheader
	movl	$2, %eax
	movl	$32, %ecx
.LBB2_5:                                # %.preheader158
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_6 Depth 2
	xorl	%edx, %edx
.LBB2_6:                                #   Parent Loop BB2_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	table(%rip), %rsi
	addq	%rcx, %rsi
	orb	$1, (%rdx,%rsi)
	incq	%rdx
	cmpq	$10, %rdx
	jne	.LBB2_6
# %bb.7:                                #   in Loop: Header=BB2_5 Depth=1
	incq	%rax
	addq	$16, %rcx
	cmpq	$16, %rax
	jne	.LBB2_5
# %bb.8:                                # %.preheader156.preheader
	xorl	%eax, %eax
	xorl	%ecx, %ecx
.LBB2_9:                                # %.preheader156
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_10 Depth 2
	xorl	%edx, %edx
.LBB2_10:                               #   Parent Loop BB2_9 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	table(%rip), %rsi
	addq	%rax, %rsi
	orb	$2, (%rdx,%rsi)
	incq	%rdx
	cmpq	$11, %rdx
	jne	.LBB2_10
# %bb.11:                               #   in Loop: Header=BB2_9 Depth=1
	incq	%rcx
	addq	$16, %rax
	cmpq	$10, %rcx
	jne	.LBB2_9
# %bb.12:                               # %.preheader155.preheader.preheader
	xorl	%eax, %eax
.LBB2_13:                               # %.preheader155.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	table(%rip), %rcx
	movb	$9, 244(%rcx,%rax)
	incq	%rax
	cmpq	$12, %rax
	jne	.LBB2_13
# %bb.14:                               # %_Z10add_unseeniii.exit.preheader.preheader
	xorl	%eax, %eax
.LBB2_15:                               # %_Z10add_unseeniii.exit.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	table(%rip), %rcx
	movb	$9, 231(%rcx,%rax)
	incq	%rax
	cmpq	$9, %rax
	jne	.LBB2_15
# %bb.16:                               # %_Z10add_unseeniii.exit80.preheader.preheader
	xorl	%eax, %eax
.LBB2_17:                               # %_Z10add_unseeniii.exit80.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	table(%rip), %rcx
	movb	$9, 216(%rcx,%rax)
	incq	%rax
	cmpq	$8, %rax
	jne	.LBB2_17
# %bb.18:                               # %_Z10add_unseeniii.exit84.preheader.preheader
	xorl	%eax, %eax
.LBB2_19:                               # %_Z10add_unseeniii.exit84.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	table(%rip), %rcx
	movb	$9, 201(%rcx,%rax)
	incq	%rax
	cmpq	$7, %rax
	jne	.LBB2_19
# %bb.20:                               # %_Z10add_unseeniii.exit88.preheader.preheader
	xorl	%eax, %eax
.LBB2_21:                               # %_Z10add_unseeniii.exit88.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	table(%rip), %rcx
	movb	$9, 186(%rcx,%rax)
	incq	%rax
	cmpq	$6, %rax
	jne	.LBB2_21
# %bb.22:                               # %_Z10add_unseeniii.exit92.preheader.preheader
	xorl	%eax, %eax
.LBB2_23:                               # %_Z10add_unseeniii.exit92.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	table(%rip), %rcx
	movb	$9, 171(%rcx,%rax)
	incq	%rax
	cmpq	$5, %rax
	jne	.LBB2_23
# %bb.24:                               # %_Z10add_unseeniii.exit96.preheader.preheader
	xorl	%eax, %eax
.LBB2_25:                               # %_Z10add_unseeniii.exit96.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	table(%rip), %rcx
	movb	$9, 156(%rcx,%rax)
	incq	%rax
	cmpq	$4, %rax
	jne	.LBB2_25
# %bb.26:                               # %_Z10add_unseeniii.exit100.preheader.preheader
	xorl	%eax, %eax
.LBB2_27:                               # %_Z10add_unseeniii.exit100.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	table(%rip), %rcx
	movb	$9, 140(%rcx,%rax)
	incq	%rax
	cmpq	$4, %rax
	jne	.LBB2_27
# %bb.28:                               # %_Z10add_unseeniii.exit104.preheader.preheader
	xorl	%eax, %eax
.LBB2_29:                               # %_Z10add_unseeniii.exit104.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	table(%rip), %rcx
	movb	$9, 124(%rcx,%rax)
	incq	%rax
	cmpq	$4, %rax
	jne	.LBB2_29
# %bb.30:                               # %_Z10add_unseeniii.exit108.preheader.preheader
	xorl	%eax, %eax
.LBB2_31:                               # %_Z10add_unseeniii.exit108.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	table(%rip), %rcx
	movb	$9, 109(%rcx,%rax)
	incq	%rax
	cmpq	$3, %rax
	jne	.LBB2_31
# %bb.32:                               # %_Z10add_unseeniii.exit112.preheader.preheader
	xorl	%eax, %eax
.LBB2_33:                               # %_Z10add_unseeniii.exit112.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	table(%rip), %rcx
	movb	$9, 93(%rcx,%rax)
	incq	%rax
	cmpq	$3, %rax
	jne	.LBB2_33
# %bb.34:                               # %_Z10add_unseeniii.exit116.preheader.preheader
	xorl	%eax, %eax
.LBB2_35:                               # %_Z10add_unseeniii.exit116.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	table(%rip), %rcx
	movb	$9, 77(%rcx,%rax)
	incq	%rax
	cmpq	$3, %rax
	jne	.LBB2_35
# %bb.36:                               # %_Z10add_unseeniii.exit136.preheader
	movq	table(%rip), %rax
	movw	$2313, %cx                      # imm = 0x909
	movw	%cx, 62(%rax)
	movb	$9, %dl
	movb	%dl, 46(%rax)
	movq	table(%rip), %rax
	movb	%dl, 47(%rax)
	movw	%cx, 30(%rax)
	movq	table(%rip), %rax
	movw	%cx, 14(%rax)
	movl	$15, %ebx
	movl	$240, %r14d
.LBB2_37:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_38 Depth 2
	xorl	%r15d, %r15d
.LBB2_38:                               #   Parent Loop BB2_37 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	table(%rip), %rax
	addq	%r14, %rax
	movsbl	(%r15,%rax), %esi
	movl	$.L.str, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r15
	cmpq	$16, %r15
	jne	.LBB2_38
# %bb.39:                               #   in Loop: Header=BB2_37 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	addq	$-16, %r14
	subq	$1, %rbx
	jae	.LBB2_37
# %bb.40:
	movl	$10, %edi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT                     # TAILCALL
.Lfunc_end2:
	.size	_Z10init_tablev, .Lfunc_end2-_Z10init_tablev
	.cfi_endproc
                                        # -- End function
	.globl	_Z13get_next_filev              # -- Begin function _Z13get_next_filev
	.type	_Z13get_next_filev,@function
_Z13get_next_filev:                     # @_Z13get_next_filev
.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	$136, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, %rbx
	leaq	24(%rsp), %rax
	movq	%rax, -16(%rax)
	leaq	8(%rsp), %rdi
	movl	$.L.str.2, %esi
	movl	$.L.str.2+22, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	movl	file_num(%rip), %r14d
	leal	1(%r14), %eax
	movl	%eax, file_num(%rip)
	movl	%r14d, %ebp
	negl	%ebp
	cmovsl	%r14d, %ebp
	movl	$1, %r15d
	cmpl	$10, %ebp
	jb	.LBB3_9
# %bb.1:                                # %.lr.ph.i.i.preheader
	movl	$4, %r15d
	movl	$3518437209, %eax               # imm = 0xD1B71759
	movl	%ebp, %ecx
.LBB3_2:                                # %.lr.ph.i.i
                                        # =>This Inner Loop Header: Depth=1
	cmpl	$99, %ecx
	jbe	.LBB3_3
# %bb.4:                                #   in Loop: Header=BB3_2 Depth=1
	cmpl	$999, %ecx                      # imm = 0x3E7
	jbe	.LBB3_5
# %bb.6:                                #   in Loop: Header=BB3_2 Depth=1
	cmpl	$10000, %ecx                    # imm = 0x2710
	jb	.LBB3_9
# %bb.7:                                #   in Loop: Header=BB3_2 Depth=1
	movl	%ecx, %edx
	imulq	%rax, %rdx
	shrq	$45, %rdx
	addl	$4, %r15d
	cmpl	$99999, %ecx                    # imm = 0x1869F
	movl	%edx, %ecx
	ja	.LBB3_2
# %bb.8:                                # %_ZNSt8__detail14__to_chars_lenIjEEjT_i.exit.i.loopexit
	addl	$-3, %r15d
	jmp	.LBB3_9
.LBB3_3:
	addl	$-2, %r15d
	jmp	.LBB3_9
.LBB3_5:
	decl	%r15d
.LBB3_9:                                # %_ZNSt8__detail14__to_chars_lenIjEEjT_i.exit.i
	shrl	$31, %r14d
	leal	(%r15,%r14), %esi
	leaq	88(%rsp), %rax
	movq	%rax, -16(%rax)
.Ltmp0:
	leaq	72(%rsp), %rdi
	movl	$45, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructEmc
.Ltmp1:
# %bb.10:                               # %_ZNSt7__cxx119to_stringEi.exit
	leaq	72(%rsp), %r12
	addq	(%r12), %r14
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%ebp, %edx
	callq	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
	movq	8(%rsp), %rcx
	movq	16(%rsp), %r8
.Ltmp3:
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmPKcm
.Ltmp4:
# %bb.11:                               # %.noexc
	movq	%rax, %r15
	leaq	56(%rsp), %rdi
	movq	%rdi, -16(%rdi)
	movq	(%rax), %rsi
	movq	%rax, %r12
	addq	$16, %r12
	cmpq	%r12, %rsi
	je	.LBB3_12
# %bb.13:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	movq	%rsi, 40(%rsp)
	movq	16(%r15), %rax
	movq	%rax, 56(%rsp)
	movq	8(%r15), %r13
	jmp	.LBB3_14
.LBB3_12:
	movq	8(%r15), %r13
	leaq	1(%r13), %rdx
	callq	memcpy@PLT
.LBB3_14:
	leaq	40(%rsp), %rdi
	movq	%r13, 8(%rdi)
	movq	%r12, (%r15)
	movq	$0, 8(%r15)
	movb	$0, 16(%r15)
.Ltmp6:
	movl	$.L.str.3, %esi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc
.Ltmp7:
# %bb.15:                               # %.noexc12
	movq	%rax, %r12
	movq	%rbx, %r14
	leaq	120(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	(%rax), %rsi
	movq	%rax, %rbp
	addq	$16, %rbp
	cmpq	%rbp, %rsi
	je	.LBB3_16
# %bb.17:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i9
	movq	%rsi, 104(%rsp)
	movq	16(%r12), %rax
	movq	%rax, 120(%rsp)
	movq	8(%r12), %rbx
	jmp	.LBB3_18
.LBB3_16:
	movq	8(%r12), %rbx
	leaq	1(%rbx), %rdx
	movq	%r15, %rdi
	callq	memcpy@PLT
.LBB3_18:
	leaq	104(%rsp), %r13
	movq	%rbx, 8(%r13)
	movq	%rbp, (%r12)
	movq	$0, 8(%r12)
	movb	$0, 16(%r12)
	leaq	8(%rsp), %rdi
	movq	%r13, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_
	movq	(%r13), %rdi
	cmpq	%r15, %rdi
	je	.LBB3_20
# %bb.19:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i13
	callq	_ZdlPv
.LBB3_20:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movq	40(%rsp), %rdi
	leaq	56(%rsp), %rax
	cmpq	%rax, %rdi
	movq	%r14, %rbx
	leaq	88(%rsp), %r14
	je	.LBB3_22
# %bb.21:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i14
	callq	_ZdlPv
.LBB3_22:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit16
	movq	72(%rsp), %rdi
	cmpq	%r14, %rdi
	je	.LBB3_24
# %bb.23:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i17
	callq	_ZdlPv
.LBB3_24:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit19
.Ltmp9:
	leaq	8(%rsp), %rsi
	movq	%rbx, %rdi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1ERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode
.Ltmp10:
# %bb.25:
	movq	8(%rsp), %rdi
	leaq	24(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB3_27
# %bb.26:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i26
	callq	_ZdlPv
.LBB3_27:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit28
	movq	%rbx, %rax
	addq	$136, %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
.LBB3_33:
	.cfi_def_cfa_offset 192
.Ltmp11:
	movq	%rax, %rbx
	jmp	.LBB3_34
.LBB3_29:
.Ltmp8:
	movq	%rax, %rbx
	movq	40(%rsp), %rdi
	leaq	56(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB3_31
# %bb.30:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i20
	callq	_ZdlPv
	jmp	.LBB3_31
.LBB3_28:
.Ltmp5:
	movq	%rax, %rbx
.LBB3_31:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit22
	movq	72(%rsp), %rdi
	leaq	88(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB3_34
# %bb.32:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i23
	callq	_ZdlPv
.LBB3_34:
	movq	8(%rsp), %rdi
	leaq	24(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB3_36
# %bb.35:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i29
	callq	_ZdlPv
.LBB3_36:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit31
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.LBB3_37:
.Ltmp2:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end3:
	.size	_Z13get_next_filev, .Lfunc_end3-_Z13get_next_filev
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table3:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.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	1                               #   On action: 1
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp4-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp6-.Ltmp4                  #   Call between .Ltmp4 and .Ltmp6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 5 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin0           #     jumps to .Ltmp8
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp7-.Lfunc_begin0           # >> Call Site 6 <<
	.uleb128 .Ltmp9-.Ltmp7                  #   Call between .Ltmp7 and .Ltmp9
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 7 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-.Lfunc_begin0          #     jumps to .Ltmp11
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp10-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Lfunc_end3-.Ltmp10            #   Call between .Ltmp10 and .Lfunc_end3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z25__device_stub__treeKernelx  # -- Begin function _Z25__device_stub__treeKernelx
	.type	_Z25__device_stub__treeKernelx,@function
_Z25__device_stub__treeKernelx:         # @_Z25__device_stub__treeKernelx
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$64, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	movq	%rsp, %rbx
	movq	%rax, (%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z10treeKernelx, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$80, %rsp
	.cfi_adjust_cfa_offset -80
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z25__device_stub__treeKernelx, .Lfunc_end4-_Z25__device_stub__treeKernelx
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z7do_workv
.LCPI5_0:
	.quad	0x40ac200000000000              # double 3600
.LCPI5_1:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	_Z7do_workv
	.type	_Z7do_workv,@function
_Z7do_workv:                            # @_Z7do_workv
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %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	$1048, %rsp                     # imm = 0x418
	.cfi_def_cfa_offset 1104
	.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	536(%rsp), %rdi
	movl	$.L.str.4, %esi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp12:
	xorl	%edi, %edi
	callq	hipSetDevice
.Ltmp13:
# %bb.1:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB5_2
# %bb.4:
.Ltmp15:
	callq	hipGetLastError
.Ltmp16:
# %bb.5:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB5_6
# %bb.10:
	movl	$.Lstr, %edi
	callq	puts@PLT
	callq	_ZNSt6chrono3_V212steady_clock3nowEv
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, (%rsp)                    # 8-byte Spill
	movabsq	$4294967552, %r13               # imm = 0x100000100
	leaq	24(%rsp), %rbp
	leaq	536(%rsp), %r15
	xorl	%r12d, %r12d
.LBB5_11:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_35 Depth 2
.Ltmp20:
	movq	%r13, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp21:
# %bb.12:                               #   in Loop: Header=BB5_11 Depth=1
	testl	%eax, %eax
	jne	.LBB5_14
# %bb.13:                               #   in Loop: Header=BB5_11 Depth=1
.Ltmp22:
	movq	%r12, %rdi
	callq	_Z25__device_stub__treeKernelx
.Ltmp23:
.LBB5_14:                               #   in Loop: Header=BB5_11 Depth=1
	imull	$-1030792151, %r12d, %eax       # imm = 0xC28F5C29
	rorl	$2, %eax
	cmpl	$42949672, %eax                 # imm = 0x28F5C28
	ja	.LBB5_53
# %bb.15:                               #   in Loop: Header=BB5_11 Depth=1
.Ltmp25:
	movq	%rbp, %rdi
	callq	_Z13get_next_filev
.Ltmp26:
# %bb.16:                               #   in Loop: Header=BB5_11 Depth=1
.Ltmp28:
	callq	hipDeviceSynchronize
.Ltmp29:
# %bb.17:                               #   in Loop: Header=BB5_11 Depth=1
.Ltmp30:
	movq	%rbp, %rdi
	movl	$200, %esi
	callq	_ZNSolsEi
.Ltmp31:
# %bb.18:                               #   in Loop: Header=BB5_11 Depth=1
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp32:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp33:
# %bb.19:                               # %.noexc
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp34:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp35:
# %bb.20:                               # %.noexc101
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp36:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp37:
# %bb.21:                               # %_ZNSolsEPFRSoS_E.exit
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp38:
	movq	%rbp, %rdi
	movl	$9, %esi
	callq	_ZNSolsEi
.Ltmp39:
# %bb.22:                               #   in Loop: Header=BB5_11 Depth=1
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp40:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp41:
# %bb.23:                               # %.noexc103
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp42:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp43:
# %bb.24:                               # %.noexc104
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp44:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp45:
# %bb.25:                               # %_ZNSolsEPFRSoS_E.exit79
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp46:
	movq	%rax, %rdi
	movl	$2, %esi
	callq	_ZNSolsEi
.Ltmp47:
# %bb.26:                               #   in Loop: Header=BB5_11 Depth=1
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp48:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp49:
# %bb.27:                               # %.noexc107
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp50:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp51:
# %bb.28:                               # %.noexc108
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp52:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp53:
# %bb.29:                               # %_ZNSolsEPFRSoS_E.exit80
                                        #   in Loop: Header=BB5_11 Depth=1
	movq	num_found(%rip), %rax
	movq	(%rax), %rsi
.Ltmp54:
	movq	%rbp, %rdi
	callq	_ZNSo9_M_insertIyEERSoT_
.Ltmp55:
# %bb.30:                               # %_ZNSolsEy.exit
                                        #   in Loop: Header=BB5_11 Depth=1
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp56:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp57:
# %bb.31:                               # %.noexc111
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp58:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp59:
# %bb.32:                               # %.noexc112
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp60:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp61:
# %bb.33:                               # %_ZNSolsEPFRSoS_E.exit81.preheader
                                        #   in Loop: Header=BB5_11 Depth=1
	movq	num_found(%rip), %rax
	cmpq	$0, (%rax)
	je	.LBB5_41
# %bb.34:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB5_11 Depth=1
	xorl	%r14d, %r14d
.LBB5_35:                               # %.lr.ph
                                        #   Parent Loop BB5_11 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	ret(%rip), %rax
	movq	(%rax,%r14,8), %rsi
.Ltmp62:
	movq	%rbp, %rdi
	callq	_ZNSo9_M_insertIxEERSoT_
.Ltmp63:
# %bb.36:                               # %_ZNSolsEx.exit
                                        #   in Loop: Header=BB5_35 Depth=2
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp64:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp65:
# %bb.37:                               # %.noexc115
                                        #   in Loop: Header=BB5_35 Depth=2
.Ltmp66:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp67:
# %bb.38:                               # %.noexc116
                                        #   in Loop: Header=BB5_35 Depth=2
.Ltmp68:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp69:
# %bb.39:                               # %_ZNSolsEPFRSoS_E.exit82
                                        #   in Loop: Header=BB5_35 Depth=2
	incq	%r14
	movq	num_found(%rip), %rax
	cmpq	%r14, (%rax)
	ja	.LBB5_35
# %bb.40:                               # %_ZNSolsEPFRSoS_E.exit81._crit_edge.loopexit
                                        #   in Loop: Header=BB5_11 Depth=1
	movq	(%rsp), %rax                    # 8-byte Reload
	addl	%r14d, %eax
	movq	%rax, (%rsp)                    # 8-byte Spill
.LBB5_41:                               # %_ZNSolsEPFRSoS_E.exit81._crit_edge
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp71:
	movq	%rbp, %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv
.Ltmp72:
# %bb.42:                               #   in Loop: Header=BB5_11 Depth=1
	movq	num_found(%rip), %rax
	movq	$0, (%rax)
	callq	_ZNSt6chrono3_V212steady_clock3nowEv
	subq	8(%rsp), %rax                   # 8-byte Folded Reload
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	imulq	%rcx
	movq	%rdx, %rbx
	movl	$838861, %eax                   # imm = 0xCCCCD
	subq	%r12, %rax
	cvtsi2ss	%rax, %xmm0
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$7, %rbx
	addq	%rax, %rbx
	cvtsi2ss	%r12, %xmm1
	divss	%xmm1, %xmm0
	xorps	%xmm1, %xmm1
	cvtsi2ss	%rbx, %xmm1
	mulss	%xmm0, %xmm1
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm0
	divsd	.LCPI5_0(%rip), %xmm0
	divsd	.LCPI5_1(%rip), %xmm0
	movsd	%xmm0, 16(%rsp)                 # 8-byte Spill
.Ltmp74:
	movl	$.L.str.8, %esi
	movl	$6, %edx
	movq	%r15, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp75:
# %bb.43:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp76:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_ZNSo9_M_insertIxEERSoT_
.Ltmp77:
# %bb.44:                               # %_ZNSolsEx.exit83
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp78:
	movq	%rax, %r14
	movl	$.L.str.9, %esi
	movl	$16, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp79:
# %bb.45:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit84
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp80:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ZNSo9_M_insertIxEERSoT_
.Ltmp81:
# %bb.46:                               # %_ZNSolsEx.exit85
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp82:
	movq	%rax, %rbx
	movl	$.L.str.10, %esi
	movl	$13, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp83:
# %bb.47:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit86
                                        #   in Loop: Header=BB5_11 Depth=1
	xorps	%xmm0, %xmm0
	cvtsd2ss	16(%rsp), %xmm0                 # 8-byte Folded Reload
	cvtss2sd	%xmm0, %xmm0
.Ltmp84:
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp85:
# %bb.48:                               # %_ZNSolsEf.exit
                                        #   in Loop: Header=BB5_11 Depth=1
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp86:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp87:
# %bb.49:                               # %.noexc119
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp88:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp89:
# %bb.50:                               # %.noexc120
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp90:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp91:
# %bb.51:                               # %_ZNSolsEPFRSoS_E.exit87
                                        #   in Loop: Header=BB5_11 Depth=1
.Ltmp92:
	movq	%r15, %rdi
	callq	_ZNSo5flushEv
.Ltmp93:
# %bb.52:                               #   in Loop: Header=BB5_11 Depth=1
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	movq	%rax, 24(%rsp)
	movq	-24(%rax), %rax
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	%rcx, 24(%rsp,%rax)
	leaq	32(%rsp), %rdi
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	272(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
.LBB5_53:                               #   in Loop: Header=BB5_11 Depth=1
	incq	%r12
	cmpq	$838861, %r12                   # imm = 0xCCCCD
	jne	.LBB5_11
# %bb.54:
.Ltmp95:
	callq	hipDeviceSynchronize
.Ltmp96:
# %bb.55:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB5_56
# %bb.64:
	callq	_ZNSt6chrono3_V212steady_clock3nowEv
	movq	%rax, %rbx
.Ltmp100:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.12, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp101:
# %bb.65:
	subq	8(%rsp), %rbx                   # 8-byte Folded Reload
	movq	%rbx, %rax
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	imulq	%rcx
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$7, %rdx
	addq	%rdx, %rsi
.Ltmp103:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIlEERSoT_
.Ltmp104:
	movq	(%rsp), %r12                    # 8-byte Reload
# %bb.66:                               # %_ZNSolsEl.exit
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp105:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp106:
# %bb.67:                               # %.noexc123
.Ltmp107:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp108:
# %bb.68:                               # %.noexc124
.Ltmp109:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp110:
# %bb.69:                               # %_ZNSolsEPFRSoS_E.exit91
.Ltmp112:
	leaq	24(%rsp), %rdi
	callq	_Z13get_next_filev
.Ltmp113:
# %bb.70:
.Ltmp115:
	leaq	24(%rsp), %rdi
	movl	$200, %esi
	callq	_ZNSolsEi
.Ltmp116:
# %bb.71:
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp117:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp118:
# %bb.72:                               # %.noexc127
.Ltmp119:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp120:
# %bb.73:                               # %.noexc128
.Ltmp121:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp122:
# %bb.74:                               # %_ZNSolsEPFRSoS_E.exit92
.Ltmp123:
	leaq	24(%rsp), %rdi
	movl	$9, %esi
	callq	_ZNSolsEi
.Ltmp124:
# %bb.75:
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp125:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp126:
# %bb.76:                               # %.noexc131
.Ltmp127:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp128:
# %bb.77:                               # %.noexc132
.Ltmp129:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp130:
# %bb.78:                               # %_ZNSolsEPFRSoS_E.exit93
.Ltmp131:
	movq	%rax, %rdi
	movl	$2, %esi
	callq	_ZNSolsEi
.Ltmp132:
# %bb.79:
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp133:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp134:
# %bb.80:                               # %.noexc135
.Ltmp135:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp136:
# %bb.81:                               # %.noexc136
.Ltmp137:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp138:
# %bb.82:                               # %_ZNSolsEPFRSoS_E.exit94
	movq	num_found(%rip), %rax
	movq	(%rax), %rsi
.Ltmp139:
	leaq	24(%rsp), %rdi
	callq	_ZNSo9_M_insertIyEERSoT_
.Ltmp140:
# %bb.83:                               # %_ZNSolsEy.exit95
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp141:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp142:
# %bb.84:                               # %.noexc139
.Ltmp143:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp144:
# %bb.85:                               # %.noexc140
.Ltmp145:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp146:
# %bb.86:                               # %_ZNSolsEPFRSoS_E.exit96.preheader
	movq	num_found(%rip), %rax
	cmpq	$0, (%rax)
	je	.LBB5_94
# %bb.87:                               # %.lr.ph175.preheader
	xorl	%r15d, %r15d
	leaq	24(%rsp), %rbx
.LBB5_88:                               # %.lr.ph175
                                        # =>This Inner Loop Header: Depth=1
	movq	ret(%rip), %rax
	movq	(%rax,%r15,8), %rsi
.Ltmp147:
	movq	%rbx, %rdi
	callq	_ZNSo9_M_insertIxEERSoT_
.Ltmp148:
# %bb.89:                               # %_ZNSolsEx.exit97
                                        #   in Loop: Header=BB5_88 Depth=1
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
.Ltmp149:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp150:
# %bb.90:                               # %.noexc143
                                        #   in Loop: Header=BB5_88 Depth=1
.Ltmp151:
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
.Ltmp152:
# %bb.91:                               # %.noexc144
                                        #   in Loop: Header=BB5_88 Depth=1
.Ltmp153:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp154:
# %bb.92:                               # %_ZNSolsEPFRSoS_E.exit98
                                        #   in Loop: Header=BB5_88 Depth=1
	incq	%r15
	movq	num_found(%rip), %rax
	cmpq	%r15, (%rax)
	ja	.LBB5_88
# %bb.93:                               # %_ZNSolsEPFRSoS_E.exit96._crit_edge.loopexit
	addl	%r15d, %r12d
.LBB5_94:                               # %_ZNSolsEPFRSoS_E.exit96._crit_edge
.Ltmp156:
	leaq	24(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv
.Ltmp157:
# %bb.95:
.Ltmp158:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.13, %esi
	movl	$20, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp159:
# %bb.96:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit99
.Ltmp160:
	movl	$_ZSt4cout, %edi
	movl	%r12d, %esi
	callq	_ZNSolsEi
.Ltmp161:
# %bb.97:
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp162:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp163:
# %bb.98:                               # %.noexc147
.Ltmp164:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp165:
# %bb.99:                               # %.noexc148
.Ltmp166:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp167:
# %bb.100:                              # %_ZNSolsEPFRSoS_E.exit100
	leaq	32(%rsp), %rdi
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	movq	%rax, -8(%rdi)
	movq	-24(%rax), %rax
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	%rcx, 24(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	272(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	xorl	%ebp, %ebp
.LBB5_3:
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	leaq	544(%rsp), %rdi
	movq	%rax, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	-24(%rax), %rax
	movq	%rcx, 536(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	784(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	movl	%ebp, %eax
	addq	$1048, %rsp                     # imm = 0x418
	.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_2:
	.cfi_def_cfa_offset 1104
	movq	stderr(%rip), %rcx
	movl	$.L.str.5, %edi
	movl	$63, %esi
	movl	$1, %edx
	callq	fwrite@PLT
	jmp	.LBB5_3
.LBB5_6:
	movq	stderr(%rip), %rbx
.Ltmp17:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp18:
# %bb.7:
	movl	$.L.str.6, %esi
	jmp	.LBB5_8
.LBB5_56:
	movq	stderr(%rip), %rbx
.Ltmp97:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp98:
# %bb.57:
	movl	$.L.str.11, %esi
.LBB5_8:
	movq	%rbx, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB5_3
.LBB5_103:
.Ltmp114:
	jmp	.LBB5_107
.LBB5_101:
.Ltmp102:
	jmp	.LBB5_107
.LBB5_106:
.Ltmp14:
	jmp	.LBB5_107
.LBB5_63:
.Ltmp99:
	jmp	.LBB5_107
.LBB5_9:
.Ltmp19:
	jmp	.LBB5_107
.LBB5_102:
.Ltmp111:
	jmp	.LBB5_107
.LBB5_58:
.Ltmp27:
	jmp	.LBB5_107
.LBB5_105:
.Ltmp168:
	jmp	.LBB5_62
.LBB5_109:
.Ltmp24:
.LBB5_107:
	movq	%rax, %rbx
	jmp	.LBB5_108
.LBB5_104:
.Ltmp155:
	jmp	.LBB5_62
.LBB5_61:
.Ltmp94:
	jmp	.LBB5_62
.LBB5_59:
.Ltmp73:
	jmp	.LBB5_62
.LBB5_60:
.Ltmp70:
.LBB5_62:
	movq	%rax, %rbx
	leaq	24(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
.LBB5_108:
	leaq	536(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end5:
	.size	_Z7do_workv, .Lfunc_end5-_Z7do_workv
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table5:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp12-.Lfunc_begin1          #   Call between .Lfunc_begin1 and .Ltmp12
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp13-.Ltmp12                #   Call between .Ltmp12 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin1          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp16-.Ltmp15                #   Call between .Ltmp15 and .Ltmp16
	.uleb128 .Ltmp19-.Lfunc_begin1          #     jumps to .Ltmp19
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp20-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Ltmp23-.Ltmp20                #   Call between .Ltmp20 and .Ltmp23
	.uleb128 .Ltmp24-.Lfunc_begin1          #     jumps to .Ltmp24
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp25-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp26-.Ltmp25                #   Call between .Ltmp25 and .Ltmp26
	.uleb128 .Ltmp27-.Lfunc_begin1          #     jumps to .Ltmp27
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp28-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Ltmp61-.Ltmp28                #   Call between .Ltmp28 and .Ltmp61
	.uleb128 .Ltmp73-.Lfunc_begin1          #     jumps to .Ltmp73
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp62-.Lfunc_begin1          # >> Call Site 7 <<
	.uleb128 .Ltmp69-.Ltmp62                #   Call between .Ltmp62 and .Ltmp69
	.uleb128 .Ltmp70-.Lfunc_begin1          #     jumps to .Ltmp70
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp71-.Lfunc_begin1          # >> Call Site 8 <<
	.uleb128 .Ltmp72-.Ltmp71                #   Call between .Ltmp71 and .Ltmp72
	.uleb128 .Ltmp73-.Lfunc_begin1          #     jumps to .Ltmp73
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp74-.Lfunc_begin1          # >> Call Site 9 <<
	.uleb128 .Ltmp93-.Ltmp74                #   Call between .Ltmp74 and .Ltmp93
	.uleb128 .Ltmp94-.Lfunc_begin1          #     jumps to .Ltmp94
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp95-.Lfunc_begin1          # >> Call Site 10 <<
	.uleb128 .Ltmp96-.Ltmp95                #   Call between .Ltmp95 and .Ltmp96
	.uleb128 .Ltmp99-.Lfunc_begin1          #     jumps to .Ltmp99
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp100-.Lfunc_begin1         # >> Call Site 11 <<
	.uleb128 .Ltmp101-.Ltmp100              #   Call between .Ltmp100 and .Ltmp101
	.uleb128 .Ltmp102-.Lfunc_begin1         #     jumps to .Ltmp102
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp103-.Lfunc_begin1         # >> Call Site 12 <<
	.uleb128 .Ltmp110-.Ltmp103              #   Call between .Ltmp103 and .Ltmp110
	.uleb128 .Ltmp111-.Lfunc_begin1         #     jumps to .Ltmp111
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp112-.Lfunc_begin1         # >> Call Site 13 <<
	.uleb128 .Ltmp113-.Ltmp112              #   Call between .Ltmp112 and .Ltmp113
	.uleb128 .Ltmp114-.Lfunc_begin1         #     jumps to .Ltmp114
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp115-.Lfunc_begin1         # >> Call Site 14 <<
	.uleb128 .Ltmp146-.Ltmp115              #   Call between .Ltmp115 and .Ltmp146
	.uleb128 .Ltmp168-.Lfunc_begin1         #     jumps to .Ltmp168
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp147-.Lfunc_begin1         # >> Call Site 15 <<
	.uleb128 .Ltmp154-.Ltmp147              #   Call between .Ltmp147 and .Ltmp154
	.uleb128 .Ltmp155-.Lfunc_begin1         #     jumps to .Ltmp155
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp156-.Lfunc_begin1         # >> Call Site 16 <<
	.uleb128 .Ltmp167-.Ltmp156              #   Call between .Ltmp156 and .Ltmp167
	.uleb128 .Ltmp168-.Lfunc_begin1         #     jumps to .Ltmp168
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp17-.Lfunc_begin1          # >> Call Site 17 <<
	.uleb128 .Ltmp18-.Ltmp17                #   Call between .Ltmp17 and .Ltmp18
	.uleb128 .Ltmp19-.Lfunc_begin1          #     jumps to .Ltmp19
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp97-.Lfunc_begin1          # >> Call Site 18 <<
	.uleb128 .Ltmp98-.Ltmp97                #   Call between .Ltmp97 and .Ltmp98
	.uleb128 .Ltmp99-.Lfunc_begin1          #     jumps to .Ltmp99
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp98-.Lfunc_begin1          # >> Call Site 19 <<
	.uleb128 .Lfunc_end5-.Ltmp98            #   Call between .Ltmp98 and .Lfunc_end5
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	_Z10init_tablev
	callq	_Z7do_workv
	testl	%eax, %eax
	jne	.LBB6_1
# %bb.2:
	callq	hipDeviceReset
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	.LBB6_3
.LBB6_5:
	popq	%rcx
	.cfi_def_cfa_offset 8
	retq
.LBB6_1:
	.cfi_def_cfa_offset 16
	movq	stderr(%rip), %rcx
	movl	$.L.str.15, %edi
	movl	$12, %esi
	jmp	.LBB6_4
.LBB6_3:
	movq	stderr(%rip), %rcx
	movl	$.L.str.16, %edi
	movl	$22, %esi
.LBB6_4:
	movl	$1, %edx
	callq	fwrite@PLT
	movl	$1, %eax
	jmp	.LBB6_5
.Lfunc_end6:
	.size	main, .Lfunc_end6-main
	.cfi_endproc
                                        # -- End function
	.section	.text.__clang_call_terminate,"axG",@progbits,__clang_call_terminate,comdat
	.hidden	__clang_call_terminate          # -- Begin function __clang_call_terminate
	.weak	__clang_call_terminate
	.type	__clang_call_terminate,@function
__clang_call_terminate:                 # @__clang_call_terminate
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__cxa_begin_catch
	callq	_ZSt9terminatev
.Lfunc_end7:
	.size	__clang_call_terminate, .Lfunc_end7-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_,"axG",@progbits,_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_,comdat
	.weak	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_ # -- Begin function _ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
	.type	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_,@function
_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_: # @_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
	.cfi_startproc
# %bb.0:
                                        # kill: def $esi killed $esi def $rsi
	cmpl	$100, %edx
	jb	.LBB8_1
# %bb.2:                                # %.lr.ph.preheader
	decl	%esi
.LBB8_3:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	%edx, %eax
	imulq	$1374389535, %rax, %rax         # imm = 0x51EB851F
	shrq	$37, %rax
	imull	$100, %eax, %ecx
	movl	%edx, %r8d
	subl	%ecx, %r8d
	movb	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits+1(%r8,%r8), %cl
	movl	%esi, %r9d
	movb	%cl, (%rdi,%r9)
	movb	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits(%r8,%r8), %cl
	leal	-1(%rsi), %r8d
	movb	%cl, (%rdi,%r8)
	addl	$-2, %esi
	cmpl	$9999, %edx                     # imm = 0x270F
	movl	%eax, %edx
	ja	.LBB8_3
	jmp	.LBB8_4
.LBB8_1:
	movl	%edx, %eax
.LBB8_4:                                # %._crit_edge
	cmpl	$10, %eax
	jb	.LBB8_6
# %bb.5:
	movl	%eax, %eax
	leaq	(%rax,%rax), %rcx
	movl	%ecx, %ecx
	movb	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits+1(%rcx), %cl
	movb	%cl, 1(%rdi)
	movb	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits(%rax,%rax), %al
	jmp	.LBB8_7
.LBB8_6:
	orb	$48, %al
.LBB8_7:
	movb	%al, (%rdi)
	retq
.Lfunc_end8:
	.size	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_, .Lfunc_end8-_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
	.cfi_endproc
                                        # -- 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	.LBB9_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	.LBB9_3
.LBB9_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB9_3:
	testq	%r14, %r14
	je	.LBB9_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB9_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB9_7
.LBB9_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB9_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_end9:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end9-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB10_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB10_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z10treeKernelx, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$num_found, %esi
	movl	$num_found.managed, %edx
	movl	$.L__unnamed_2, %ecx
	movl	$8, %r8d
	movq	%rbx, %rdi
	movl	$8, %r9d
	callq	__hipRegisterManagedVar
	movl	$ret, %esi
	movl	$ret.managed, %edx
	movl	$.L__unnamed_3, %ecx
	movl	$800000, %r8d                   # imm = 0xC3500
	movq	%rbx, %rdi
	movl	$16, %r9d
	callq	__hipRegisterManagedVar
	movl	$table, %esi
	movl	$table.managed, %edx
	movl	$.L__unnamed_4, %ecx
	movl	$256, %r8d                      # imm = 0x100
	movq	%rbx, %rdi
	movl	$16, %r9d
	callq	__hipRegisterManagedVar
	movl	$visited, %esi
	movl	$visited.managed, %edx
	movl	$.L__unnamed_5, %ecx
	movl	$4, %r8d
	movq	%rbx, %rdi
	movl	$4, %r9d
	callq	__hipRegisterManagedVar
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end10:
	.size	__hip_module_ctor, .Lfunc_end10-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB11_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB11_2:
	retq
.Lfunc_end11:
	.size	__hip_module_dtor, .Lfunc_end11-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	num_found.managed,@object       # @num_found.managed
	.local	num_found.managed
	.comm	num_found.managed,8,8
	.type	ret.managed,@object             # @ret.managed
	.local	ret.managed
	.comm	ret.managed,800000,16
	.type	table.managed,@object           # @table.managed
	.local	table.managed
	.comm	table.managed,256,16
	.type	visited.managed,@object         # @visited.managed
	.local	visited.managed
	.comm	visited.managed,4,4
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"%d "
	.size	.L.str, 4

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

	.type	.L.str.2,@object                # @.str.2
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.2:
	.asciz	"_inter21/_intermediate"
	.size	.L.str.2, 23

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

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

	.type	.L.str.4,@object                # @.str.4
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.4:
	.asciz	"big_tree_log_200.txt"
	.size	.L.str.4, 21

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"hipSetDevice failed!  Do you have a CUDA-capable GPU installed?"
	.size	.L.str.5, 64

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"big tree kernel launch failed: %s\n"
	.size	.L.str.6, 35

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

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	" time taken us ="
	.size	.L.str.9, 17

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	" eta (hrs) = "
	.size	.L.str.10, 14

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"cuda not sync: %s\n"
	.size	.L.str.11, 19

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"time taken us ="
	.size	.L.str.12, 16

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"total seeds written="
	.size	.L.str.13, 21

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"cuda failed!"
	.size	.L.str.15, 13

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"hipDeviceReset failed!"
	.size	.L.str.16, 23

	.type	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits,@object # @__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits
	.section	.rodata.str1.16,"aMS",@progbits,1
	.p2align	4, 0x0
.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits:
	.asciz	"00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899"
	.size	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits, 201

	.type	.L__unnamed_1,@object           # @0
	.section	.rodata.str1.1,"aMS",@progbits,1
.L__unnamed_1:
	.asciz	"_Z10treeKernelx"
	.size	.L__unnamed_1, 16

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"num_found"
	.size	.L__unnamed_2, 10

	.type	num_found,@object               # @num_found
	.local	num_found
	.comm	num_found,8,8
	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"ret"
	.size	.L__unnamed_3, 4

	.type	ret,@object                     # @ret
	.local	ret
	.comm	ret,8,8
	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"table"
	.size	.L__unnamed_4, 6

	.type	table,@object                   # @table
	.local	table
	.comm	table,8,8
	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"visited"
	.size	.L__unnamed_5, 8

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

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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"begin xyz"
	.size	.Lstr, 10

	.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 _Z25__device_stub__treeKernelx
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym num_found.managed
	.addrsig_sym ret.managed
	.addrsig_sym table.managed
	.addrsig_sym visited.managed
	.addrsig_sym _Z10treeKernelx
	.addrsig_sym _ZSt4cout
	.addrsig_sym num_found
	.addrsig_sym ret
	.addrsig_sym table
	.addrsig_sym visited
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z10treeKernelx         ; -- Begin function _Z10treeKernelx
	.globl	_Z10treeKernelx
	.p2align	8
	.type	_Z10treeKernelx,@function
_Z10treeKernelx:                        ; @_Z10treeKernelx
; %bb.0:
	s_getpc_b64 s[4:5]
	s_add_u32 s4, s4, table@rel32@lo+4
	s_addc_u32 s5, s5, table@rel32@hi+12
	v_and_b32_e32 v1, 15, v0
	s_load_b64 s[4:5], s[4:5], 0x0
	v_lshrrev_b32_e32 v4, 4, v0
	s_load_b64 s[0:1], s[0:1], 0x0
	s_mov_b32 s2, s15
	v_lshlrev_b32_e32 v3, 4, v1
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v1, s3, s4, v3
	v_add_co_ci_u32_e64 v2, null, s5, 0, s3
	s_mov_b32 s3, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v1, vcc_lo, v1, v4
	v_add_co_ci_u32_e32 v2, vcc_lo, 0, v2, vcc_lo
	s_lshl_b64 s[2:3], s[2:3], 17
	s_lshl_b64 s[0:1], s[0:1], 25
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b64 s[2:3], s[0:1], s[2:3]
	global_load_u8 v1, v[1:2], off
	s_mul_i32 s0, s3, 10
	s_mul_hi_u32 s1, s2, 10
	v_add_nc_u32_e32 v2, v3, v4
	s_add_i32 s1, s1, s0
	s_mul_i32 s0, s2, 10
	s_and_b32 s1, s1, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_i64_e64 s2, s[0:1], s[2:3]
	s_and_b32 vcc_lo, exec_lo, s2
	s_waitcnt vmcnt(0)
	ds_store_b8 v2, v1
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_vccnz .LBB0_32
; %bb.1:
	v_lshl_or_b32 v7, v0, 9, s0
	v_dual_mov_b32 v8, s1 :: v_dual_mov_b32 v1, 0
	s_mov_b32 s6, 0x942de6ba
	s_mov_b32 s8, 0xe462aa9
	s_mov_b64 s[4:5], 0xb0000
	s_mov_b32 s7, 64
	s_movk_i32 s9, 0x615c
	s_mov_b64 s[10:11], 0
.LBB0_2:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	s_delay_alu instid0(SALU_CYCLE_1)
	v_or_b32_e32 v3, s11, v8
	v_or_b32_e32 v2, s10, v7
	v_mov_b32_e32 v0, 0
	s_mov_b32 s12, 0
	s_mov_b32 s13, 0
	v_dual_mov_b32 v6, v3 :: v_dual_mov_b32 v9, 0
	v_mov_b32_e32 v5, v2
                                        ; implicit-def: $sgpr14
                                        ; implicit-def: $sgpr15
.LBB0_3:                                ; %.backedge.i
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mad_u64_u32 v[10:11], null, 0xdeece66d, v5, 11
	v_mul_lo_u32 v4, 0xdeece66d, v6
	v_lshl_add_u32 v5, v5, 2, v5
	v_cmp_ne_u32_e64 s1, 0, v0
	v_cmp_eq_u32_e64 s0, 0, v0
	v_cmp_eq_u32_e32 vcc_lo, 0, v9
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_add3_u32 v6, v4, v11, v5
	v_mad_u64_u32 v[4:5], null, 0xdeece66d, v10, 11
	v_lshl_add_u32 v10, v10, 2, v10
	v_mul_lo_u32 v11, 0xdeece66d, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add3_u32 v10, v11, v5, v10
	v_bfe_u32 v5, v6, 12, 4
	v_bfe_u32 v6, v10, 12, 4
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_ne_u32_e64 s2, 9, v5
	v_cmp_ne_u32_e64 s3, 2, v6
	s_delay_alu instid0(VALU_DEP_2)
	s_or_b32 s1, s1, s2
                                        ; implicit-def: $sgpr2
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_or_b32 s3, s1, s3
	s_mov_b32 s1, 0
	s_and_saveexec_b32 s16, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s16, exec_lo, s16
	s_cbranch_execz .LBB0_15
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=2
	v_cmp_ne_u32_e64 s1, 2, v5
	v_cmp_ne_u32_e64 s2, 3, v6
	s_xor_b32 s3, vcc_lo, -1
	s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)
	s_or_b32 s1, s3, s1
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_or_b32 s3, s1, s2
	s_mov_b32 s1, 0
                                        ; implicit-def: $sgpr2
	s_and_saveexec_b32 s17, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s17, exec_lo, s17
	s_cbranch_execz .LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=2
	v_lshl_or_b32 v5, v5, 4, v6
	s_mov_b32 s3, 0
	s_mov_b32 s18, exec_lo
	ds_load_u8 v5, v5
	s_waitcnt lgkmcnt(0)
	v_cmpx_ne_u16_e32 0, v5
	s_cbranch_execz .LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=2
	v_cmp_ne_u16_e64 s2, 1, v5
	v_cmp_ne_u32_e64 s1, 0, v0
	s_delay_alu instid0(VALU_DEP_1)
	s_or_b32 s3, s1, s2
	s_mov_b32 s2, 0
	s_and_saveexec_b32 s19, s3
	s_cbranch_execz .LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=2
	v_cmp_ne_u16_e64 s3, 2, v5
	v_cmp_ne_u32_e64 s2, 0, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	s_or_b32 s20, s3, s2
	s_mov_b32 s3, 0
	s_and_saveexec_b32 s21, s20
	s_xor_b32 s20, exec_lo, s21
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=2
	v_cmp_ne_u16_e64 s3, 3, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s1, s1, s3
	s_or_b32 s1, s1, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s3, s1, exec_lo
; %bb.9:                                ; %Flow24
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s20
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s2, s3, exec_lo
.LBB0_10:                               ; %Flow23
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s19
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s3, s2, exec_lo
.LBB0_11:                               ; %Flow22
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s18
	s_mov_b32 s2, -1
	s_and_b32 s1, s3, exec_lo
.LBB0_12:                               ; %Flow21
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_and_not1_saveexec_b32 s3, s17
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=2
	s_and_not1_b32 s1, s1, exec_lo
	s_and_b32 s0, s0, exec_lo
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v9, 1
	s_and_not1_b32 s2, s2, exec_lo
	s_or_b32 s1, s1, s0
; %bb.14:                               ; %Flow25
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s2, s2, exec_lo
	s_and_b32 s1, s1, exec_lo
.LBB0_15:                               ; %Flow20
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_and_not1_saveexec_b32 s0, s16
; %bb.16:                               ;   in Loop: Header=BB0_3 Depth=2
	v_dual_mov_b32 v0, 1 :: v_dual_mov_b32 v9, 0
	s_and_not1_b32 s1, s1, exec_lo
	s_and_b32 s3, vcc_lo, exec_lo
	s_and_not1_b32 s2, s2, exec_lo
	s_or_b32 s1, s1, s3
; %bb.17:                               ; %Flow26
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s0, s15, exec_lo
	s_and_b32 s3, s2, exec_lo
	s_mov_b32 s2, -1
	s_or_b32 s15, s0, s3
                                        ; implicit-def: $vgpr5_vgpr6
	s_and_saveexec_b32 s0, s1
	s_cbranch_execz .LBB0_26
; %bb.18:                               ; %.critedge.i
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_cmp_lg_u32 s13, 0
	s_cbranch_scc0 .LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_3 Depth=2
	s_cmp_lt_u32 s13, 11
	s_mov_b32 s3, 0
	s_cselect_b32 s1, -1, 0
	s_branch .LBB0_21
.LBB0_20:                               ;   in Loop: Header=BB0_3 Depth=2
	s_mov_b32 s3, -1
	s_mov_b32 s1, 0
                                        ; implicit-def: $sgpr2
.LBB0_21:                               ; %Flow28
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_and_not1_b32 vcc_lo, exec_lo, s3
	s_cbranch_vccnz .LBB0_23
; %bb.22:                               ;   in Loop: Header=BB0_3 Depth=2
	v_and_b32_e32 v11, 0xffff, v10
	v_mad_u64_u32 v[5:6], null, 0xdeece66d, v4, 11
	v_lshl_add_u32 v12, v4, 2, v4
	s_and_not1_b32 s1, s1, exec_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_lo_u32 v11, 0xdeece66d, v11
	s_mov_b32 s2, -1
	v_mul_lo_u32 v14, 0x5deec, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_add3_u32 v13, v11, v6, v12
	v_mad_u64_u32 v[11:12], null, 0xe66d0000, v5, s[4:5]
	v_lshlrev_b64 v[5:6], 16, v[5:6]
	v_mul_lo_u32 v11, 0xe66d0000, v13
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_and_b32_e32 v6, 0xffff, v6
	v_add3_u32 v5, v11, v12, v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v11, 31, v5
	v_add_co_u32 v5, vcc_lo, v5, 0
	v_add_co_ci_u32_e32 v6, vcc_lo, v11, v6, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_xor_b32_e32 v11, 0xdeece66d, v5
	v_xor_b32_e32 v6, 5, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mul_lo_u32 v12, 0xdeece66d, v6
	v_mad_u64_u32 v[5:6], null, 0xdeece66d, v11, 11
	v_lshl_add_u32 v11, v11, 2, v11
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add3_u32 v6, v12, v6, v11
	v_alignbit_b32 v5, v6, v5, 17
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v11, 0x7fffffff, v5
	v_mad_u64_u32 v[5:6], null, 0xaaaaaaab, v11, -2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_alignbit_b32 v5, v5, v5, 2
	v_cmp_gt_u32_e32 vcc_lo, 0x15555555, v5
	s_and_b32 s3, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s1, s1, s3
.LBB0_23:                               ; %Flow29
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_mov_b32 s3, -1
                                        ; implicit-def: $vgpr5_vgpr6
	s_and_saveexec_b32 s16, s1
; %bb.24:                               ; %.backedge.i.backedge
                                        ;   in Loop: Header=BB0_3 Depth=2
	v_mul_lo_u32 v11, 0xbb20, v4
	v_mul_lo_u32 v10, 0xb4600a69, v10
	v_mad_u64_u32 v[5:6], null, 0xb4600a69, v4, s[6:7]
	s_add_i32 s13, s13, 1
	s_xor_b32 s3, exec_lo, -1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add3_u32 v4, v10, v6, v11
	v_and_b32_e32 v6, 0xffff, v4
; %bb.25:                               ; %Flow30
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s16
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s1, s15, exec_lo
	s_and_b32 s2, s2, exec_lo
	s_or_b32 s15, s1, s2
	s_or_not1_b32 s2, s3, exec_lo
.LBB0_26:                               ; %Flow27
                                        ;   in Loop: Header=BB0_3 Depth=2
	s_or_b32 exec_lo, exec_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, exec_lo, s2
	s_or_b32 s12, s0, s12
	s_and_not1_b32 s0, s14, exec_lo
	s_and_b32 s1, s15, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s14, s0, s1
	s_and_not1_b32 exec_lo, exec_lo, s12
	s_cbranch_execnz .LBB0_3
; %bb.27:                               ; %loop.exit.guard
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
	s_xor_b32 s0, s14, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_saveexec_b32 s1, s0
	s_xor_b32 s0, exec_lo, s1
	s_cbranch_execz .LBB0_31
; %bb.28:                               ; %.loopexit.sink.split.i
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_mov_b32 s2, exec_lo
	s_mov_b32 s1, exec_lo
	v_mbcnt_lo_u32_b32 v6, s2, 0
                                        ; implicit-def: $vgpr4_vgpr5
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 0, v6
	s_cbranch_execz .LBB0_30
; %bb.29:                               ;   in Loop: Header=BB0_2 Depth=1
	s_getpc_b64 s[12:13]
	s_add_u32 s12, s12, num_found@rel32@lo+4
	s_addc_u32 s13, s13, num_found@rel32@hi+12
	s_bcnt1_i32_b32 s2, s2
	global_load_b64 v[4:5], v1, s[12:13]
	v_mov_b32_e32 v0, s2
	s_waitcnt vmcnt(0)
	global_atomic_add_u64 v[4:5], v[4:5], v[0:1], off glc
.LBB0_30:                               ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, ret@rel32@lo+4
	s_addc_u32 s3, s3, ret@rel32@hi+12
	s_waitcnt vmcnt(0)
	v_readfirstlane_b32 s1, v4
	global_load_b64 v[9:10], v1, s[2:3]
	v_readfirstlane_b32 s2, v5
	v_mul_lo_u32 v0, 0xdfe0, v2
	v_mul_lo_u32 v11, 0x5bcb1365, v3
	v_add_co_u32 v5, s1, s1, v6
	v_mad_u64_u32 v[3:4], null, 0x5bcb1365, v2, s[8:9]
	v_add_co_ci_u32_e64 v6, null, s2, 0, s1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[5:6], 3, v[5:6]
	v_add3_u32 v0, v11, v4, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_and_b32_e32 v4, 0xffff, v0
	s_waitcnt vmcnt(0)
	v_add_co_u32 v5, vcc_lo, v9, v5
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v6, vcc_lo, v10, v6, vcc_lo
	global_store_b64 v[5:6], v[3:4], off
.LBB0_31:                               ; %Flow
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s0
	s_add_u32 s10, s10, 1
	s_addc_u32 s11, s11, 0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u64 s[10:11], 0x200
	s_cbranch_scc1 .LBB0_2
.LBB0_32:                               ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z10treeKernelx
		.amdhsa_group_segment_fixed_size 256
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 8
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 15
		.amdhsa_next_free_sgpr 22
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z10treeKernelx, .Lfunc_end0-_Z10treeKernelx
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1548
; NumSgprs: 24
; NumVgprs: 15
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 256 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 24
; NumVGPRsForWavesPerEU: 15
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.protected	num_found.managed       ; @num_found.managed
	.type	num_found.managed,@object
	.section	.bss,"aw",@nobits
	.globl	num_found.managed
	.p2align	3, 0x0
num_found.managed:
	.quad	0                               ; 0x0
	.size	num_found.managed, 8

	.protected	ret.managed             ; @ret.managed
	.type	ret.managed,@object
	.globl	ret.managed
	.p2align	4, 0x0
ret.managed:
	.zero	800000
	.size	ret.managed, 800000

	.protected	table.managed           ; @table.managed
	.type	table.managed,@object
	.globl	table.managed
	.p2align	4, 0x0
table.managed:
	.zero	256
	.size	table.managed, 256

	.protected	visited.managed         ; @visited.managed
	.type	visited.managed,@object
	.globl	visited.managed
	.p2align	2, 0x0
visited.managed:
	.long	0                               ; 0x0
	.size	visited.managed, 4

	.protected	num_found               ; @num_found
	.type	num_found,@object
	.globl	num_found
	.p2align	3, 0x0
num_found:
	.quad	0
	.size	num_found, 8

	.protected	ret                     ; @ret
	.type	ret,@object
	.globl	ret
	.p2align	3, 0x0
ret:
	.quad	0
	.size	ret, 8

	.protected	table                   ; @table
	.type	table,@object
	.globl	table
	.p2align	3, 0x0
table:
	.quad	0
	.size	table, 8

	.protected	visited                 ; @visited
	.type	visited,@object
	.globl	visited
	.p2align	3, 0x0
visited:
	.quad	0
	.size	visited, 8

	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.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 num_found.managed
	.addrsig_sym ret.managed
	.addrsig_sym table.managed
	.addrsig_sym visited.managed
	.addrsig_sym num_found
	.addrsig_sym ret
	.addrsig_sym table
	.addrsig_sym visited
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .offset:         0
        .size:           8
        .value_kind:     by_value
    .group_segment_fixed_size: 256
    .kernarg_segment_align: 8
    .kernarg_segment_size: 8
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z10treeKernelx
    .private_segment_fixed_size: 0
    .sgpr_count:     24
    .sgpr_spill_count: 0
    .symbol:         _Z10treeKernelx.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     15
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
