#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <unistd.h>
#include <vector>
#include <complex>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <math.h>
#include <map>
#include <stdexcept>
#include <cuda.h>
#include <cufft.h>

//#include <helper_functions.h>
//#include <helper_cuda.h>

#define gpuErrchk(ans) { gpuAssert((ans), __FILE__, __LINE__); }
inline void gpuAssert(cudaError_t code, char *file, int line, bool abort=true)
{
   if (code != cudaSuccess) 
   {
      fprintf(stderr,"CUDA_ERROR:\ncode:%s\nfile: %s\nline:%d\n", cudaGetErrorString(code), file, line);
      if (abort) exit(code);
   }
}

///////////////////////////////////////////////////////////////////////////////////////////////
////
////    Constants & Typedefs
////
///////////////////////////////////////////////////////////////////////////////////////////////

#define PI 3.14159265359
#define BLOCK_SIZE 4096
#define SIGNAL_THRESHOLD 200
#define MAX_TRANSMISSIONS 200

//172MHz gives us CB
#define SAMPLE_RATE 172089331.259
#define BATCH_SIZE 1

#define HzInMHz 1000000

typedef char byte;
typedef float2 Complex;

///////////////////////////////////////////////////////////////////////////////////////////////
////
////    Device Variables
////
///////////////////////////////////////////////////////////////////////////////////////////////

__device__ int transmissionCount;

__device__ int timeStep;

///////////////////////////////////////////////////////////////////////////////////////////////
////
////    Kernels
////
///////////////////////////////////////////////////////////////////////////////////////////////

void __device__ createTransmission( int idx ,
		int* transmissionBins,
		cufftReal* scaledResultBuffer,
		cufftReal* transmissionFrequencies,
		cufftReal* transmissionStarts,
		cufftReal* transmissionStrengths,
		bool* activeTransmissions
	)
{

	transmissionBins[ transmissionCount - 1 ] = idx;

	//frequency in MHz
	transmissionFrequencies[ transmissionCount - 1 ] = idx * SAMPLE_RATE / BLOCK_SIZE / HzInMHz;

	transmissionStarts[ transmissionCount - 1 ] = timeStep / SAMPLE_RATE;

	transmissionStrengths[ transmissionCount - 1 ] = scaledResultBuffer[ idx ];

	activeTransmissions[ idx ] = true;

}

void __device__ finishTransmission( int idx,
		int* transmissionBins,
		cufftReal* transmissionEnds,
		bool* activeTransmissions
	)
{

	for( int i = transmissionCount - 1 ; i >= 0 ; i-- )
	{

		if( transmissionBins[ i ] == idx )
		{

			transmissionEnds[ i ] = timeStep / SAMPLE_RATE;

			activeTransmissions[ idx ] = false;

			return;

		}

	}

}

void __global__ scaleResult( cufftReal* scaledResultBuffer , cufftComplex* resultBuffer )
{

	int idx = blockIdx.x * blockDim.x + threadIdx.x;

	if( idx < BLOCK_SIZE )
	{

		scaledResultBuffer[ idx ] = sqrt( resultBuffer[ idx ].x * resultBuffer[ idx ].x * +
										  resultBuffer[ idx ].y * resultBuffer[ idx ].y      );

		scaledResultBuffer[ idx ] = 20 * log10( scaledResultBuffer[ idx ] );

	}

}

void __global__ initTransmissionArray( bool* activeTransmissions )
{

	int idx = blockIdx.x * blockDim.x + threadIdx.x;

	transmissionCount = 0;

	if( idx < BLOCK_SIZE )

		activeTransmissions[ idx ] = false;

}

void __global__ findTransmissions(
		cufftReal* scaledResultBuffer ,
		int* deviceBins,
		cufftReal *deviceFrequencies,
		cufftReal *deviceStarts,
		cufftReal *deviceEnds,
		cufftReal *deviceStrengths,
		bool* activeTransmissions
	)
{

	int idx = blockIdx.x * blockDim.x + threadIdx.x;

	if( idx < BLOCK_SIZE && idx != 0 )
	{

		if( scaledResultBuffer[ idx ] > SIGNAL_THRESHOLD && activeTransmissions[ idx ] == false )
		{

			atomicAdd( &transmissionCount , 1 );

			createTransmission( idx , deviceBins , scaledResultBuffer , deviceFrequencies , deviceStarts , deviceStrengths, activeTransmissions );

		}

		if( scaledResultBuffer[ idx ] < SIGNAL_THRESHOLD && activeTransmissions[ idx ] == true )
		{

			finishTransmission( idx , deviceBins , deviceEnds , activeTransmissions );

		}

	}

	//timeStep += BLOCK_SIZE;

	atomicAdd( &timeStep , 1 );

}

///////////////////////////////////////////////////////////////////////////////////////////////
////
////    Device Pointers
////
///////////////////////////////////////////////////////////////////////////////////////////////

cufftComplex *deviceResult = 0;

cufftReal *deviceSource = 0;

cufftReal *deviceScaledResult = 0;

int* deviceBins = 0;

cufftReal *deviceFrequencies = 0;

cufftReal *deviceStarts = 0;

cufftReal *deviceEnds = 0;

cufftReal *deviceStrengths = 0;

bool* deviceActiveTransmissions = 0;

int* deviceCount = 0;

///////////////////////////////////////////////////////////////////////////////////////////////
////
////    Host Variables
////
///////////////////////////////////////////////////////////////////////////////////////////////

int* hostBins;

cufftReal *hostFrequencies;

cufftReal *hostStarts;

cufftReal *hostEnds;

cufftReal *hostStrengths;

///////////////////////////////////////////////////////////////////////////////////////////////
////
////    Functions
////
///////////////////////////////////////////////////////////////////////////////////////////////

int main( int argc , char** argv )
{
	
	std::string filename = std::string( argv[1] );

	std::ifstream f;

	struct stat filestatus;

	stat( filename.c_str() , &filestatus );

	size_t filesize = filestatus.st_size;

	f.open( filename.c_str() , std::ios::in | std::ios::binary );

	if( !f.good() )
	{
	
		std::cerr << "Can't open file" << std::endl;

		exit( 1 );

	}

	cufftReal* original = new cufftReal[ filesize ];

	for( unsigned int i = 0 ; i < filesize ; i++ )
	{
	
		original[i] = (cufftReal) (byte) f.get();

	}

	f.close();

	int fft_size = BLOCK_SIZE;

	int max_transmissions = MAX_TRANSMISSIONS;

	cudaGetSymbolAddress( (void**) &deviceCount , transmissionCount );

	gpuErrchk( cudaMalloc( &deviceSource , filesize * sizeof(cufftReal) ));

	gpuErrchk( cudaMalloc( &deviceResult ,  fft_size * sizeof(cufftComplex) ));

	gpuErrchk( cudaMalloc( &deviceScaledResult ,  fft_size * sizeof(cufftReal) ));

	gpuErrchk( cudaMalloc( &deviceBins , max_transmissions * sizeof(int) ));

	gpuErrchk( cudaMalloc( &deviceFrequencies ,  max_transmissions * sizeof(cufftReal) ));

	gpuErrchk( cudaMalloc( &deviceStarts , max_transmissions * sizeof(cufftReal) ));

	gpuErrchk( cudaMalloc( &deviceEnds ,  max_transmissions * sizeof(cufftReal) ));

	gpuErrchk( cudaMalloc( &deviceStrengths ,  max_transmissions * sizeof(cufftReal) ));

	gpuErrchk( cudaMalloc( &deviceActiveTransmissions ,  fft_size * sizeof(bool) ));

	// TODO: This giant memcpy will become a pipelined streaming thingy
	gpuErrchk( cudaMemcpy( deviceSource , original , filesize * sizeof( cufftReal ) , cudaMemcpyHostToDevice ));

	initTransmissionArray<<< 32 , 64 >>>( deviceActiveTransmissions );

	//prepare the FFT
	cufftHandle p;

	cufftResult_t fft_result;

	fft_result = cufftPlan1d( &p , BLOCK_SIZE , CUFFT_R2C , BATCH_SIZE );

	if( fft_result != CUFFT_SUCCESS )

		exit(1);


	for( unsigned int j = 0 ; j < filesize * 0.25 - fft_size  ; j += fft_size )
	{
		
		fft_result = cufftExecR2C( p , deviceSource + j * sizeof( cufftReal ) , deviceResult );
		
		if( fft_result != CUFFT_SUCCESS )

			exit(2);

		// num blocks * num threads = fftsize / 2 ... nyquist limit
		scaleResult<<< 32 , 64 >>>( deviceScaledResult , deviceResult );

		gpuErrchk( cudaPeekAtLastError() );

		findTransmissions<<< 32 , 64 >>>(
				deviceScaledResult,
				deviceBins,
				deviceFrequencies,
				deviceStarts,
				deviceEnds,
				deviceStrengths,
				deviceActiveTransmissions
			);

		gpuErrchk( cudaPeekAtLastError() );

	}

	//Copy all that crap back
	int* hostCount = new int;

	hostBins = new int[ MAX_TRANSMISSIONS ];

	hostFrequencies = new cufftReal[ MAX_TRANSMISSIONS ];

	hostStarts = new cufftReal[ MAX_TRANSMISSIONS ];

	hostEnds = new cufftReal[ MAX_TRANSMISSIONS ];

	hostStrengths = new cufftReal[ MAX_TRANSMISSIONS ];

	std::cout << "LOLZ" << std::endl;

	gpuErrchk( cudaMemcpy( hostBins , deviceBins , MAX_TRANSMISSIONS * sizeof( int ) , cudaMemcpyDeviceToHost ));

	gpuErrchk( cudaMemcpy( hostFrequencies , deviceFrequencies , MAX_TRANSMISSIONS * sizeof( cufftReal ) , cudaMemcpyDeviceToHost ));

	gpuErrchk( cudaMemcpy( hostStarts , deviceStarts , MAX_TRANSMISSIONS * sizeof( cufftReal ) , cudaMemcpyDeviceToHost ));

	gpuErrchk( cudaMemcpy( hostEnds , deviceEnds , MAX_TRANSMISSIONS * sizeof( cufftReal ) , cudaMemcpyDeviceToHost ));

	gpuErrchk( cudaMemcpy( hostStrengths , deviceStrengths , MAX_TRANSMISSIONS * sizeof( cufftReal ) , cudaMemcpyDeviceToHost ));

	gpuErrchk( cudaMemcpy( hostCount , deviceCount , sizeof( int ) , cudaMemcpyDeviceToHost ) );

	std::cout << *hostCount << std::endl;

	std::ofstream fo;

	fo.open( "spikes.txt" );

	for( unsigned int i = 0 ; i < *hostCount ; i++ )
	{

		fo << "==== TRANSMISSION ====" << "\n";

		//In MHz
		fo << "Bin             : " << hostBins[ i ] << " \n";
		fo << "Frequency       : " << hostFrequencies[ i ] << " MHz\n";
		fo << "Signal strength : " << hostStrengths[ i ] << " dB\n";
		fo << "Time start      : " << hostStarts[ i ] << " s\n";
		fo << "Time end        : " << hostEnds[ i ] << " s\n";

	}

	return 0;

}

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

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4875:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4875:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata._Z9gpuAssert9cudaErrorPcib.str1.1,"aMS",@progbits,1
.LC0:
	.string	"CUDA_ERROR:\ncode:%s\nfile: %s\nline:%d\n"
	.section	.text._Z9gpuAssert9cudaErrorPcib,"axG",@progbits,_Z9gpuAssert9cudaErrorPcib,comdat
	.weak	_Z9gpuAssert9cudaErrorPcib
	.type	_Z9gpuAssert9cudaErrorPcib, @function
_Z9gpuAssert9cudaErrorPcib:
.LFB4869:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	je	.L8
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%ecx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%edi, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movl	%edx, 12(%rsp)
	movq	%rsi, (%rsp)
	call	cudaGetErrorString@PLT
	movl	12(%rsp), %r9d
	movq	(%rsp), %r8
	leaq	.LC0(%rip), %rdx
	movq	stderr(%rip), %rdi
	movq	%rax, %rcx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	testb	%bpl, %bpl
	je	.L2
	movl	%ebx, %edi
	call	exit@PLT
.L2:
	addq	$24, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE4869:
	.size	_Z9gpuAssert9cudaErrorPcib, .-_Z9gpuAssert9cudaErrorPcib
	.text
	.globl	_Z18createTransmissioniPiPfS0_S0_S0_Pb
	.type	_Z18createTransmissioniPiPfS0_S0_S0_Pb, @function
_Z18createTransmissioniPiPfS0_S0_S0_Pb:
.LFB4870:
	.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
.LFE4870:
	.size	_Z18createTransmissioniPiPfS0_S0_S0_Pb, .-_Z18createTransmissioniPiPfS0_S0_S0_Pb
	.globl	_Z18finishTransmissioniPiPfPb
	.type	_Z18finishTransmissioniPiPfPb, @function
_Z18finishTransmissioniPiPfPb:
.LFB4871:
	.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
.LFE4871:
	.size	_Z18finishTransmissioniPiPfPb, .-_Z18finishTransmissioniPiPfPb
	.globl	_Z39__device_stub__Z11scaleResultPfP6float2PfP6float2
	.type	_Z39__device_stub__Z11scaleResultPfP6float2PfP6float2, @function
_Z39__device_stub__Z11scaleResultPfP6float2PfP6float2:
.LFB4897:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movq	%rsi, (%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z11scaleResultPfP6float2(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L16:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4897:
	.size	_Z39__device_stub__Z11scaleResultPfP6float2PfP6float2, .-_Z39__device_stub__Z11scaleResultPfP6float2PfP6float2
	.globl	_Z11scaleResultPfP6float2
	.type	_Z11scaleResultPfP6float2, @function
_Z11scaleResultPfP6float2:
.LFB4898:
	.cfi_startproc
	endbr64
	jmp	_Z39__device_stub__Z11scaleResultPfP6float2PfP6float2
	.cfi_endproc
.LFE4898:
	.size	_Z11scaleResultPfP6float2, .-_Z11scaleResultPfP6float2
	.globl	_Z41__device_stub__Z21initTransmissionArrayPbPb
	.type	_Z41__device_stub__Z21initTransmissionArrayPbPb, @function
_Z41__device_stub__Z21initTransmissionArrayPbPb:
.LFB4899:
	.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	.L21
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z21initTransmissionArrayPb(%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
.L21:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4899:
	.size	_Z41__device_stub__Z21initTransmissionArrayPbPb, .-_Z41__device_stub__Z21initTransmissionArrayPbPb
	.globl	_Z21initTransmissionArrayPb
	.type	_Z21initTransmissionArrayPb, @function
_Z21initTransmissionArrayPb:
.LFB4900:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z21initTransmissionArrayPbPb
	.cfi_endproc
.LFE4900:
	.size	_Z21initTransmissionArrayPb, .-_Z21initTransmissionArrayPb
	.globl	_Z49__device_stub__Z17findTransmissionsPfPiS_S_S_S_PbPfPiS_S_S_S_Pb
	.type	_Z49__device_stub__Z17findTransmissionsPfPiS_S_S_S_PbPfPiS_S_S_S_Pb, @function
_Z49__device_stub__Z17findTransmissionsPfPiS_S_S_S_PbPfPiS_S_S_S_Pb:
.LFB4901:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movq	208(%rsp), %rax
	movq	%rdi, 56(%rsp)
	leaq	80(%rsp), %rdi
	movq	%rsi, 48(%rsp)
	leaq	92(%rsp), %rsi
	movq	%rdx, 40(%rsp)
	leaq	64(%rsp), %rdx
	movq	%rcx, 32(%rsp)
	leaq	72(%rsp), %rcx
	movq	%r8, 24(%rsp)
	movq	%r9, 16(%rsp)
	movq	%rax, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	movl	$1, 88(%rsp)
	movq	%rax, 128(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 80(%rsp)
	movq	%rax, 92(%rsp)
	movl	$1, 100(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L26
	pushq	72(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z17findTransmissionsPfPiS_S_S_S_Pb(%rip), %rdi
	pushq	72(%rsp)
	.cfi_def_cfa_offset 224
	movq	108(%rsp), %rcx
	movl	116(%rsp), %r8d
	movq	96(%rsp), %rsi
	movl	104(%rsp), %edx
	leaq	144(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L26:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4901:
	.size	_Z49__device_stub__Z17findTransmissionsPfPiS_S_S_S_PbPfPiS_S_S_S_Pb, .-_Z49__device_stub__Z17findTransmissionsPfPiS_S_S_S_PbPfPiS_S_S_S_Pb
	.globl	_Z17findTransmissionsPfPiS_S_S_S_Pb
	.type	_Z17findTransmissionsPfPiS_S_S_S_Pb, @function
_Z17findTransmissionsPfPiS_S_S_S_Pb:
.LFB4902:
	.cfi_startproc
	endbr64
	jmp	_Z49__device_stub__Z17findTransmissionsPfPiS_S_S_S_PbPfPiS_S_S_S_Pb
	.cfi_endproc
.LFE4902:
	.size	_Z17findTransmissionsPfPiS_S_S_S_Pb, .-_Z17findTransmissionsPfPiS_S_S_S_Pb
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"_Z17findTransmissionsPfPiS_S_S_S_Pb"
.LC2:
	.string	"_Z21initTransmissionArrayPb"
.LC3:
	.string	"_Z11scaleResultPfP6float2"
.LC4:
	.string	"transmissionCount"
.LC5:
	.string	"timeStep"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4904:
	.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	.LC1(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z17findTransmissionsPfPiS_S_S_S_Pb(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC2(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z21initTransmissionArrayPb(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC3(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z11scaleResultPfP6float2(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC4(%rip), %rdx
	movl	$4, %r9d
	leaq	_ZL17transmissionCount(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@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	.LC5(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL8timeStep(%rip), %rsi
	call	__cudaRegisterVar@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.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
.LFE4904:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1
.LC6:
	.string	"basic_string: construction from null is not valid"
.LC7:
	.string	"Can't open file"
.LC8:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/nathanjordan/CudaRogueSignalDetection/master/main.cu"
.LC11:
	.string	"LOLZ"
.LC12:
	.string	"spikes.txt"
.LC13:
	.string	"==== TRANSMISSION ===="
.LC14:
	.string	"\n"
.LC15:
	.string	"Bin             : "
.LC16:
	.string	" \n"
.LC17:
	.string	"Frequency       : "
.LC18:
	.string	" MHz\n"
.LC19:
	.string	"Signal strength : "
.LC20:
	.string	" dB\n"
.LC21:
	.string	"Time start      : "
.LC22:
	.string	" s\n"
.LC23:
	.string	"Time end        : "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4872:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4872
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$1288, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	8(%rsi), %rbx
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-1264(%rbp), %rax
	movq	%rax, -1320(%rbp)
	leaq	-1248(%rbp), %rax
	movq	%rax, -1264(%rbp)
	testq	%rbx, %rbx
	jne	.L34
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L71
	leaq	.LC6(%rip), %rdi
.LEHB0:
	call	_ZSt19__throw_logic_errorPKc@PLT
.L34:
	movq	%rbx, %rdi
	call	strlen@PLT
	leaq	(%rbx,%rax), %rcx
	movq	%rax, -1280(%rbp)
	movq	%rcx, %r15
	cmpq	$15, %rax
	jbe	.L36
	movq	-1320(%rbp), %rdi
	leaq	-1280(%rbp), %rsi
	xorl	%edx, %edx
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
.LEHE0:
	movq	%rax, -1264(%rbp)
	movq	-1280(%rbp), %rax
	movq	%rax, -1248(%rbp)
.L36:
	movq	-1264(%rbp), %rdi
	movq	%r15, %rdx
	movq	%rbx, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	-1280(%rbp), %rax
	movq	-1264(%rbp), %rdx
	movq	%rax, -1256(%rbp)
	movb	$0, (%rdx,%rax)
	leaq	-576(%rbp), %rax
	movq	%rax, %rdi
	movq	%rax, -1304(%rbp)
.LEHB1:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev@PLT
.LEHE1:
	movq	-1264(%rbp), %rdi
	leaq	-1232(%rbp), %rsi
	call	stat@PLT
	movq	-1264(%rbp), %rsi
	movq	-1304(%rbp), %rdi
	movl	$12, %edx
	movq	-1184(%rbp), %r12
.LEHB2:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
	cmpl	$0, -288(%rbp)
	je	.L37
	leaq	.LC7(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
.L45:
	movl	$1, %edi
	jmp	.L74
.L37:
	movabsq	$2305843009213693950, %rax
	cmpq	%r12, %rax
	jb	.L38
	leaq	0(,%r12,4), %r13
	movq	%r13, %rdi
	call	_Znam@PLT
	movq	%rax, %r15
	xorl	%ebx, %ebx
	jmp	.L39
.L38:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L71
	call	__cxa_throw_bad_array_new_length@PLT
.L41:
	call	_ZNSi3getEv@PLT
	movsbl	%al, %eax
	incl	%ebx
	cvtsi2ssl	%eax, %xmm0
	movss	%xmm0, (%r15,%r14,4)
.L39:
	movl	%ebx, %r14d
	movq	-1304(%rbp), %rdi
	cmpq	%r12, %r14
	jb	.L41
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv@PLT
	leaq	_ZL17transmissionCount(%rip), %rsi
	leaq	deviceCount(%rip), %rdi
	call	cudaGetSymbolAddress@PLT
	movq	%r13, %rsi
	leaq	deviceSource(%rip), %rdi
	call	cudaMalloc@PLT
	leaq	.LC8(%rip), %rbx
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$272, %edx
	movq	%rbx, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movl	$32768, %esi
	leaq	deviceResult(%rip), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$274, %edx
	movq	%rbx, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movl	$16384, %esi
	leaq	deviceScaledResult(%rip), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$276, %edx
	movq	%rbx, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movl	$800, %esi
	leaq	deviceBins(%rip), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$278, %edx
	movq	%rbx, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movl	$800, %esi
	leaq	deviceFrequencies(%rip), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$280, %edx
	movq	%rbx, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movl	$800, %esi
	leaq	deviceStarts(%rip), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$282, %edx
	movq	%rbx, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movl	$800, %esi
	leaq	deviceEnds(%rip), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$284, %edx
	movq	%rbx, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movl	$800, %esi
	leaq	deviceStrengths(%rip), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$286, %edx
	movq	%rbx, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movl	$4096, %esi
	leaq	deviceActiveTransmissions(%rip), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$288, %edx
	movq	%rbx, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movq	deviceSource(%rip), %rdi
	movl	$1, %ecx
	movq	%r13, %rdx
	movq	%r15, %rsi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$291, %edx
	movq	%rbx, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movl	$67108865, %edx
	movl	$134217729, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$6, %rdx
	salq	$5, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, -1280(%rbp)
	movl	$1, -1272(%rbp)
	movq	%rdi, -1292(%rbp)
	movl	$1, -1284(%rbp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L42
.L44:
	movl	$1, %ecx
	movl	$42, %edx
	movl	$4096, %esi
	leaq	-1296(%rbp), %rdi
	call	cufftPlan1d@PLT
	movl	%eax, -1308(%rbp)
	testl	%eax, %eax
	jne	.L45
	cvtsi2sdq	%r12, %xmm0
	mulsd	.LC9(%rip), %xmm0
	xorl	%r14d, %r14d
	subsd	.LC10(%rip), %xmm0
	leaq	.LC8(%rip), %r13
	movq	%xmm0, %r12
	jmp	.L46
.L42:
	movq	deviceActiveTransmissions(%rip), %rdi
	call	_Z41__device_stub__Z21initTransmissionArrayPbPb
	jmp	.L44
.L47:
	movl	$67108865, %edx
	movl	$134217729, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$6, %rdx
	salq	$5, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, -1280(%rbp)
	movl	$1, -1272(%rbp)
	movq	%rdi, -1292(%rbp)
	movl	$1, -1284(%rbp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L48
.L50:
	call	cudaPeekAtLastError@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$319, %edx
	movq	%rbx, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movl	$67108865, %edx
	movl	$134217729, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$6, %rdx
	salq	$5, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, -1280(%rbp)
	movl	$1, -1272(%rbp)
	movq	%rdi, -1292(%rbp)
	movl	$1, -1284(%rbp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L51
.L53:
	call	cudaPeekAtLastError@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$331, %edx
	movq	%r13, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	addl	$4096, %r14d
.L46:
	movl	%r14d, %esi
	movq	%r12, %xmm1
	cvtsi2sdq	%rsi, %xmm0
	comisd	%xmm0, %xmm1
	jbe	.L75
	movq	deviceResult(%rip), %rdx
	movl	-1296(%rbp), %edi
	salq	$4, %rsi
	addq	deviceSource(%rip), %rsi
	call	cufftExecR2C@PLT
	testl	%eax, %eax
	je	.L47
	movl	$2, %edi
.L74:
	call	exit@PLT
.L48:
	movq	deviceResult(%rip), %rsi
	movq	deviceScaledResult(%rip), %rdi
	call	_Z39__device_stub__Z11scaleResultPfP6float2PfP6float2
	jmp	.L50
.L51:
	pushq	%rcx
	movq	deviceStrengths(%rip), %r9
	pushq	deviceActiveTransmissions(%rip)
	movq	deviceEnds(%rip), %r8
	movq	deviceStarts(%rip), %rcx
	movq	deviceFrequencies(%rip), %rdx
	movq	deviceBins(%rip), %rsi
	movq	deviceScaledResult(%rip), %rdi
	.cfi_escape 0x2e,0x10
	call	_Z49__device_stub__Z17findTransmissionsPfPiS_S_S_S_PbPfPiS_S_S_S_Pb
	popq	%rax
	popq	%rdx
	jmp	.L53
.L75:
	movl	$4, %edi
	.cfi_escape 0x2e,0
	call	_Znwm@PLT
	movl	$800, %edi
	movq	%rax, %r12
	call	_Znam@PLT
	movl	$800, %edi
	movq	%rax, hostBins(%rip)
	call	_Znam@PLT
	movl	$800, %edi
	movq	%rax, hostFrequencies(%rip)
	call	_Znam@PLT
	movl	$800, %edi
	movq	%rax, hostStarts(%rip)
	call	_Znam@PLT
	movl	$800, %edi
	movq	%rax, hostEnds(%rip)
	call	_Znam@PLT
	leaq	_ZSt4cout(%rip), %rbx
	leaq	.LC11(%rip), %rsi
	movq	%rax, hostStrengths(%rip)
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	movq	deviceBins(%rip), %rsi
	movl	$2, %ecx
	movl	$800, %edx
	movq	hostBins(%rip), %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$350, %edx
	movq	%r13, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movq	deviceFrequencies(%rip), %rsi
	movl	$2, %ecx
	movl	$800, %edx
	movq	hostFrequencies(%rip), %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$352, %edx
	movq	%r13, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movq	deviceStarts(%rip), %rsi
	movl	$2, %ecx
	movl	$800, %edx
	movq	hostStarts(%rip), %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$354, %edx
	movq	%r13, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movq	deviceEnds(%rip), %rsi
	movl	$2, %ecx
	movl	$800, %edx
	movq	hostEnds(%rip), %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$356, %edx
	movq	%r13, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movq	deviceStrengths(%rip), %rsi
	movl	$2, %ecx
	movl	$800, %edx
	movq	hostStrengths(%rip), %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$358, %edx
	movq	%r13, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movq	deviceCount(%rip), %rsi
	movl	$2, %ecx
	movl	$4, %edx
	movq	%r12, %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	movl	$1, %ecx
	movl	$360, %edx
	movq	%r13, %rsi
	call	_Z9gpuAssert9cudaErrorPcib
	movl	(%r12), %esi
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	leaq	-1088(%rbp), %rbx
	movq	%rbx, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev@PLT
.LEHE2:
	movl	$16, %edx
	leaq	.LC12(%rip), %rsi
	movq	%rbx, %rdi
.LEHB3:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
	leaq	.LC13(%rip), %r15
.L57:
	movl	-1308(%rbp), %eax
	cmpl	(%r12), %eax
	jnb	.L76
	movq	%r15, %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC14(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC15(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	-1308(%rbp), %r13d
	movq	%rax, %rdi
	movq	hostBins(%rip), %rax
	movl	(%rax,%r13,4), %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC16(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC17(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	hostFrequencies(%rip), %rax
	cvtss2sd	(%rax,%r13,4), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC18(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC19(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	hostStrengths(%rip), %rax
	cvtss2sd	(%rax,%r13,4), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC20(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC21(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	hostStarts(%rip), %rax
	cvtss2sd	(%rax,%r13,4), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC22(%rip), %r14
	movq	%rax, %rdi
	movq	%r14, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC23(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	hostEnds(%rip), %rax
	cvtss2sd	(%rax,%r13,4), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	movq	%r14, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.LEHE3:
	incl	-1308(%rbp)
	jmp	.L57
.L76:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	leaq	-576(%rbp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	leaq	-1264(%rbp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L63
	jmp	.L71
.L67:
	endbr64
	movq	%rax, %r15
.L59:
	movq	%rbx, %rdi
	movq	%r15, %rbx
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L60
.L66:
	endbr64
	movq	%rax, %rbx
.L60:
	movq	-1304(%rbp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L61
.L65:
	endbr64
	movq	%rax, %rbx
.L61:
	movq	-1320(%rbp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L71
	movq	%rbx, %rdi
.LEHB4:
	call	_Unwind_Resume@PLT
.LEHE4:
.L71:
	call	__stack_chk_fail@PLT
.L63:
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4872:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4872:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4872-.LLSDACSB4872
.LLSDACSB4872:
	.uleb128 .LEHB0-.LFB4872
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4872
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L65-.LFB4872
	.uleb128 0
	.uleb128 .LEHB2-.LFB4872
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L66-.LFB4872
	.uleb128 0
	.uleb128 .LEHB3-.LFB4872
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L67-.LFB4872
	.uleb128 0
	.uleb128 .LEHB4-.LFB4872
	.uleb128 .LEHE4-.LEHB4
	.uleb128 0
	.uleb128 0
.LLSDACSE4872:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.globl	hostStrengths
	.bss
	.align 8
	.type	hostStrengths, @object
	.size	hostStrengths, 8
hostStrengths:
	.zero	8
	.globl	hostEnds
	.align 8
	.type	hostEnds, @object
	.size	hostEnds, 8
hostEnds:
	.zero	8
	.globl	hostStarts
	.align 8
	.type	hostStarts, @object
	.size	hostStarts, 8
hostStarts:
	.zero	8
	.globl	hostFrequencies
	.align 8
	.type	hostFrequencies, @object
	.size	hostFrequencies, 8
hostFrequencies:
	.zero	8
	.globl	hostBins
	.align 8
	.type	hostBins, @object
	.size	hostBins, 8
hostBins:
	.zero	8
	.globl	deviceCount
	.align 8
	.type	deviceCount, @object
	.size	deviceCount, 8
deviceCount:
	.zero	8
	.globl	deviceActiveTransmissions
	.align 8
	.type	deviceActiveTransmissions, @object
	.size	deviceActiveTransmissions, 8
deviceActiveTransmissions:
	.zero	8
	.globl	deviceStrengths
	.align 8
	.type	deviceStrengths, @object
	.size	deviceStrengths, 8
deviceStrengths:
	.zero	8
	.globl	deviceEnds
	.align 8
	.type	deviceEnds, @object
	.size	deviceEnds, 8
deviceEnds:
	.zero	8
	.globl	deviceStarts
	.align 8
	.type	deviceStarts, @object
	.size	deviceStarts, 8
deviceStarts:
	.zero	8
	.globl	deviceFrequencies
	.align 8
	.type	deviceFrequencies, @object
	.size	deviceFrequencies, 8
deviceFrequencies:
	.zero	8
	.globl	deviceBins
	.align 8
	.type	deviceBins, @object
	.size	deviceBins, 8
deviceBins:
	.zero	8
	.globl	deviceScaledResult
	.align 8
	.type	deviceScaledResult, @object
	.size	deviceScaledResult, 8
deviceScaledResult:
	.zero	8
	.globl	deviceSource
	.align 8
	.type	deviceSource, @object
	.size	deviceSource, 8
deviceSource:
	.zero	8
	.globl	deviceResult
	.align 8
	.type	deviceResult, @object
	.size	deviceResult, 8
deviceResult:
	.zero	8
	.local	_ZL8timeStep
	.comm	_ZL8timeStep,4,4
	.local	_ZL17transmissionCount
	.comm	_ZL17transmissionCount,4,4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC9:
	.long	0
	.long	1070596096
	.align 8
.LC10:
	.long	0
	.long	1085276160
	.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 <iostream>
#include <fstream>
#include <stdlib.h>
#include <unistd.h>
#include <vector>
#include <complex>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <math.h>
#include <map>
#include <stdexcept>
#include <hip/hip_runtime.h>
#include <hipfft/hipfft.h>

//#include <helper_functions.h>
//#include <helper_cuda.h>

#define gpuErrchk(ans) { gpuAssert((ans), __FILE__, __LINE__); }
inline void gpuAssert(hipError_t code, char *file, int line, bool abort=true)
{
   if (code != hipSuccess) 
   {
      fprintf(stderr,"CUDA_ERROR:\ncode:%s\nfile: %s\nline:%d\n", hipGetErrorString(code), file, line);
      if (abort) exit(code);
   }
}

///////////////////////////////////////////////////////////////////////////////////////////////
////
////    Constants & Typedefs
////
///////////////////////////////////////////////////////////////////////////////////////////////

#define PI 3.14159265359
#define BLOCK_SIZE 4096
#define SIGNAL_THRESHOLD 200
#define MAX_TRANSMISSIONS 200

//172MHz gives us CB
#define SAMPLE_RATE 172089331.259
#define BATCH_SIZE 1

#define HzInMHz 1000000

typedef char byte;
typedef float2 Complex;

///////////////////////////////////////////////////////////////////////////////////////////////
////
////    Device Variables
////
///////////////////////////////////////////////////////////////////////////////////////////////

__device__ int transmissionCount;

__device__ int timeStep;

///////////////////////////////////////////////////////////////////////////////////////////////
////
////    Kernels
////
///////////////////////////////////////////////////////////////////////////////////////////////

void __device__ createTransmission( int idx ,
		int* transmissionBins,
		hipfftReal* scaledResultBuffer,
		hipfftReal* transmissionFrequencies,
		hipfftReal* transmissionStarts,
		hipfftReal* transmissionStrengths,
		bool* activeTransmissions
	)
{

	transmissionBins[ transmissionCount - 1 ] = idx;

	//frequency in MHz
	transmissionFrequencies[ transmissionCount - 1 ] = idx * SAMPLE_RATE / BLOCK_SIZE / HzInMHz;

	transmissionStarts[ transmissionCount - 1 ] = timeStep / SAMPLE_RATE;

	transmissionStrengths[ transmissionCount - 1 ] = scaledResultBuffer[ idx ];

	activeTransmissions[ idx ] = true;

}

void __device__ finishTransmission( int idx,
		int* transmissionBins,
		hipfftReal* transmissionEnds,
		bool* activeTransmissions
	)
{

	for( int i = transmissionCount - 1 ; i >= 0 ; i-- )
	{

		if( transmissionBins[ i ] == idx )
		{

			transmissionEnds[ i ] = timeStep / SAMPLE_RATE;

			activeTransmissions[ idx ] = false;

			return;

		}

	}

}

void __global__ scaleResult( hipfftReal* scaledResultBuffer , hipfftComplex* resultBuffer )
{

	int idx = blockIdx.x * blockDim.x + threadIdx.x;

	if( idx < BLOCK_SIZE )
	{

		scaledResultBuffer[ idx ] = sqrt( resultBuffer[ idx ].x * resultBuffer[ idx ].x * +
										  resultBuffer[ idx ].y * resultBuffer[ idx ].y      );

		scaledResultBuffer[ idx ] = 20 * log10( scaledResultBuffer[ idx ] );

	}

}

void __global__ initTransmissionArray( bool* activeTransmissions )
{

	int idx = blockIdx.x * blockDim.x + threadIdx.x;

	transmissionCount = 0;

	if( idx < BLOCK_SIZE )

		activeTransmissions[ idx ] = false;

}

void __global__ findTransmissions(
		hipfftReal* scaledResultBuffer ,
		int* deviceBins,
		hipfftReal *deviceFrequencies,
		hipfftReal *deviceStarts,
		hipfftReal *deviceEnds,
		hipfftReal *deviceStrengths,
		bool* activeTransmissions
	)
{

	int idx = blockIdx.x * blockDim.x + threadIdx.x;

	if( idx < BLOCK_SIZE && idx != 0 )
	{

		if( scaledResultBuffer[ idx ] > SIGNAL_THRESHOLD && activeTransmissions[ idx ] == false )
		{

			atomicAdd( &transmissionCount , 1 );

			createTransmission( idx , deviceBins , scaledResultBuffer , deviceFrequencies , deviceStarts , deviceStrengths, activeTransmissions );

		}

		if( scaledResultBuffer[ idx ] < SIGNAL_THRESHOLD && activeTransmissions[ idx ] == true )
		{

			finishTransmission( idx , deviceBins , deviceEnds , activeTransmissions );

		}

	}

	//timeStep += BLOCK_SIZE;

	atomicAdd( &timeStep , 1 );

}

///////////////////////////////////////////////////////////////////////////////////////////////
////
////    Device Pointers
////
///////////////////////////////////////////////////////////////////////////////////////////////

hipfftComplex *deviceResult = 0;

hipfftReal *deviceSource = 0;

hipfftReal *deviceScaledResult = 0;

int* deviceBins = 0;

hipfftReal *deviceFrequencies = 0;

hipfftReal *deviceStarts = 0;

hipfftReal *deviceEnds = 0;

hipfftReal *deviceStrengths = 0;

bool* deviceActiveTransmissions = 0;

int* deviceCount = 0;

///////////////////////////////////////////////////////////////////////////////////////////////
////
////    Host Variables
////
///////////////////////////////////////////////////////////////////////////////////////////////

int* hostBins;

hipfftReal *hostFrequencies;

hipfftReal *hostStarts;

hipfftReal *hostEnds;

hipfftReal *hostStrengths;

///////////////////////////////////////////////////////////////////////////////////////////////
////
////    Functions
////
///////////////////////////////////////////////////////////////////////////////////////////////

int main( int argc , char** argv )
{
	
	std::string filename = std::string( argv[1] );

	std::ifstream f;

	struct stat filestatus;

	stat( filename.c_str() , &filestatus );

	size_t filesize = filestatus.st_size;

	f.open( filename.c_str() , std::ios::in | std::ios::binary );

	if( !f.good() )
	{
	
		std::cerr << "Can't open file" << std::endl;

		exit( 1 );

	}

	hipfftReal* original = new hipfftReal[ filesize ];

	for( unsigned int i = 0 ; i < filesize ; i++ )
	{
	
		original[i] = (hipfftReal) (byte) f.get();

	}

	f.close();

	int fft_size = BLOCK_SIZE;

	int max_transmissions = MAX_TRANSMISSIONS;

	hipGetSymbolAddress( (void**) &deviceCount , HIP_SYMBOL(transmissionCount) );

	gpuErrchk( hipMalloc( &deviceSource , filesize * sizeof(hipfftReal) ));

	gpuErrchk( hipMalloc( &deviceResult ,  fft_size * sizeof(hipfftComplex) ));

	gpuErrchk( hipMalloc( &deviceScaledResult ,  fft_size * sizeof(hipfftReal) ));

	gpuErrchk( hipMalloc( &deviceBins , max_transmissions * sizeof(int) ));

	gpuErrchk( hipMalloc( &deviceFrequencies ,  max_transmissions * sizeof(hipfftReal) ));

	gpuErrchk( hipMalloc( &deviceStarts , max_transmissions * sizeof(hipfftReal) ));

	gpuErrchk( hipMalloc( &deviceEnds ,  max_transmissions * sizeof(hipfftReal) ));

	gpuErrchk( hipMalloc( &deviceStrengths ,  max_transmissions * sizeof(hipfftReal) ));

	gpuErrchk( hipMalloc( &deviceActiveTransmissions ,  fft_size * sizeof(bool) ));

	// TODO: This giant memcpy will become a pipelined streaming thingy
	gpuErrchk( hipMemcpy( deviceSource , original , filesize * sizeof( hipfftReal ) , hipMemcpyHostToDevice ));

	initTransmissionArray<<< 32 , 64 >>>( deviceActiveTransmissions );

	//prepare the FFT
	hipfftHandle p;

	hipfftResult_t fft_result;

	fft_result = hipfftPlan1d( &p , BLOCK_SIZE , HIPFFT_R2C , BATCH_SIZE );

	if( fft_result != HIPFFT_SUCCESS )

		exit(1);


	for( unsigned int j = 0 ; j < filesize * 0.25 - fft_size  ; j += fft_size )
	{
		
		fft_result = hipfftExecR2C( p , deviceSource + j * sizeof( hipfftReal ) , deviceResult );
		
		if( fft_result != HIPFFT_SUCCESS )

			exit(2);

		// num blocks * num threads = fftsize / 2 ... nyquist limit
		scaleResult<<< 32 , 64 >>>( deviceScaledResult , deviceResult );

		gpuErrchk( hipPeekAtLastError() );

		findTransmissions<<< 32 , 64 >>>(
				deviceScaledResult,
				deviceBins,
				deviceFrequencies,
				deviceStarts,
				deviceEnds,
				deviceStrengths,
				deviceActiveTransmissions
			);

		gpuErrchk( hipPeekAtLastError() );

	}

	//Copy all that crap back
	int* hostCount = new int;

	hostBins = new int[ MAX_TRANSMISSIONS ];

	hostFrequencies = new hipfftReal[ MAX_TRANSMISSIONS ];

	hostStarts = new hipfftReal[ MAX_TRANSMISSIONS ];

	hostEnds = new hipfftReal[ MAX_TRANSMISSIONS ];

	hostStrengths = new hipfftReal[ MAX_TRANSMISSIONS ];

	std::cout << "LOLZ" << std::endl;

	gpuErrchk( hipMemcpy( hostBins , deviceBins , MAX_TRANSMISSIONS * sizeof( int ) , hipMemcpyDeviceToHost ));

	gpuErrchk( hipMemcpy( hostFrequencies , deviceFrequencies , MAX_TRANSMISSIONS * sizeof( hipfftReal ) , hipMemcpyDeviceToHost ));

	gpuErrchk( hipMemcpy( hostStarts , deviceStarts , MAX_TRANSMISSIONS * sizeof( hipfftReal ) , hipMemcpyDeviceToHost ));

	gpuErrchk( hipMemcpy( hostEnds , deviceEnds , MAX_TRANSMISSIONS * sizeof( hipfftReal ) , hipMemcpyDeviceToHost ));

	gpuErrchk( hipMemcpy( hostStrengths , deviceStrengths , MAX_TRANSMISSIONS * sizeof( hipfftReal ) , hipMemcpyDeviceToHost ));

	gpuErrchk( hipMemcpy( hostCount , deviceCount , sizeof( int ) , hipMemcpyDeviceToHost ) );

	std::cout << *hostCount << std::endl;

	std::ofstream fo;

	fo.open( "spikes.txt" );

	for( unsigned int i = 0 ; i < *hostCount ; i++ )
	{

		fo << "==== TRANSMISSION ====" << "\n";

		//In MHz
		fo << "Bin             : " << hostBins[ i ] << " \n";
		fo << "Frequency       : " << hostFrequencies[ i ] << " MHz\n";
		fo << "Signal strength : " << hostStrengths[ i ] << " dB\n";
		fo << "Time start      : " << hostStarts[ i ] << " s\n";
		fo << "Time end        : " << hostEnds[ i ] << " s\n";

	}

	return 0;

}

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

                                        # End of file scope inline assembly
	.globl	_Z26__device_stub__scaleResultPfP15HIP_vector_typeIfLj2EE # -- Begin function _Z26__device_stub__scaleResultPfP15HIP_vector_typeIfLj2EE
	.type	_Z26__device_stub__scaleResultPfP15HIP_vector_typeIfLj2EE,@function
_Z26__device_stub__scaleResultPfP15HIP_vector_typeIfLj2EE: # @_Z26__device_stub__scaleResultPfP15HIP_vector_typeIfLj2EE
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.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)
	leaq	16(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z11scaleResultPfP15HIP_vector_typeIfLj2EE, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z26__device_stub__scaleResultPfP15HIP_vector_typeIfLj2EE, .Lfunc_end0-_Z26__device_stub__scaleResultPfP15HIP_vector_typeIfLj2EE
	.cfi_endproc
                                        # -- End function
	.globl	_Z36__device_stub__initTransmissionArrayPb # -- Begin function _Z36__device_stub__initTransmissionArrayPb
	.type	_Z36__device_stub__initTransmissionArrayPb,@function
_Z36__device_stub__initTransmissionArrayPb: # @_Z36__device_stub__initTransmissionArrayPb
	.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	$_Z21initTransmissionArrayPb, %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_end1:
	.size	_Z36__device_stub__initTransmissionArrayPb, .Lfunc_end1-_Z36__device_stub__initTransmissionArrayPb
	.cfi_endproc
                                        # -- End function
	.globl	_Z32__device_stub__findTransmissionsPfPiS_S_S_S_Pb # -- Begin function _Z32__device_stub__findTransmissionsPfPiS_S_S_S_Pb
	.type	_Z32__device_stub__findTransmissionsPfPiS_S_S_S_Pb,@function
_Z32__device_stub__findTransmissionsPfPiS_S_S_S_Pb: # @_Z32__device_stub__findTransmissionsPfPiS_S_S_S_Pb
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	16(%rsp), %r8
	movq	%r9, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	208(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%rsp, %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z17findTransmissionsPfPiS_S_S_S_Pb, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z32__device_stub__findTransmissionsPfPiS_S_S_S_Pb, .Lfunc_end2-_Z32__device_stub__findTransmissionsPfPiS_S_S_S_Pb
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function main
.LCPI3_0:
	.long	1127219200                      # 0x43300000
	.long	1160773632                      # 0x45300000
	.long	0                               # 0x0
	.long	0                               # 0x0
.LCPI3_1:
	.quad	0x4330000000000000              # double 4503599627370496
	.quad	0x4530000000000000              # double 1.9342813113834067E+25
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI3_2:
	.quad	0x3fd0000000000000              # double 0.25
.LCPI3_3:
	.quad	0xc0b0000000000000              # double -4096
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$1240, %rsp                     # imm = 0x4D8
	.cfi_def_cfa_offset 1296
	.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	8(%rsi), %rsi
	leaq	16(%rsp), %rdi
	leaq	64(%rsp), %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
.Ltmp0:
	leaq	64(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev
.Ltmp1:
# %bb.1:
	movq	16(%rsp), %rdi
	leaq	1096(%rsp), %rbx
	movq	%rbx, %rsi
	callq	stat
	movq	48(%rbx), %r12
	movq	16(%rsp), %rsi
.Ltmp3:
	leaq	64(%rsp), %rdi
	movl	$12, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
.Ltmp4:
# %bb.2:
	movq	64(%rsp), %rax
	movq	-24(%rax), %rax
	cmpl	$0, 96(%rsp,%rax)
	jne	.LBB3_107
# %bb.3:
	movq	%r12, %rax
	shrq	$62, %rax
	leaq	(,%r12,4), %rbx
	xorl	%edi, %edi
	negq	%rax
	sbbq	%rdi, %rdi
	orq	%rbx, %rdi
.Ltmp10:
	callq	_Znam
.Ltmp11:
# %bb.4:                                # %.preheader204
	movq	%rax, %r14
	testq	%r12, %r12
	je	.LBB3_8
# %bb.5:                                # %.lr.ph.preheader
	movl	$1, %ebp
	xorl	%r13d, %r13d
	leaq	64(%rsp), %r15
.LBB3_6:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
.Ltmp12:
	movq	%r15, %rdi
	callq	_ZNSi3getEv
.Ltmp13:
# %bb.7:                                #   in Loop: Header=BB3_6 Depth=1
	movsbl	%al, %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movss	%xmm0, (%r14,%r13,4)
	movl	%ebp, %r13d
	incl	%ebp
	cmpq	%r13, %r12
	ja	.LBB3_6
.LBB3_8:                                # %._crit_edge
.Ltmp15:
	leaq	64(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
.Ltmp16:
# %bb.9:
.Ltmp18:
	movl	$deviceCount, %edi
	movl	$transmissionCount, %esi
	callq	hipGetSymbolAddress
.Ltmp19:
# %bb.10:                               # %_Z19hipGetSymbolAddressIiE10hipError_tPPvRKT_.exit
.Ltmp20:
	movl	$deviceSource, %edi
	movq	%rbx, %rsi
	callq	hipMalloc
.Ltmp21:
# %bb.11:                               # %_ZL9hipMallocIfE10hipError_tPPT_m.exit
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_110
# %bb.12:                               # %_Z9gpuAssert10hipError_tPcib.exit
.Ltmp24:
	movl	$deviceResult, %edi
	movl	$32768, %esi                    # imm = 0x8000
	callq	hipMalloc
.Ltmp25:
# %bb.13:                               # %_ZL9hipMallocI15HIP_vector_typeIfLj2EEE10hipError_tPPT_m.exit
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_112
# %bb.14:                               # %_Z9gpuAssert10hipError_tPcib.exit80
.Ltmp28:
	movl	$deviceScaledResult, %edi
	movl	$16384, %esi                    # imm = 0x4000
	callq	hipMalloc
.Ltmp29:
# %bb.15:                               # %_ZL9hipMallocIfE10hipError_tPPT_m.exit82
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_114
# %bb.16:                               # %_Z9gpuAssert10hipError_tPcib.exit85
.Ltmp32:
	movl	$deviceBins, %edi
	movl	$800, %esi                      # imm = 0x320
	callq	hipMalloc
.Ltmp33:
# %bb.17:                               # %_ZL9hipMallocIiE10hipError_tPPT_m.exit
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_116
# %bb.18:                               # %_Z9gpuAssert10hipError_tPcib.exit89
.Ltmp36:
	movl	$deviceFrequencies, %edi
	movl	$800, %esi                      # imm = 0x320
	callq	hipMalloc
.Ltmp37:
# %bb.19:                               # %_ZL9hipMallocIfE10hipError_tPPT_m.exit91
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_118
# %bb.20:                               # %_Z9gpuAssert10hipError_tPcib.exit94
.Ltmp40:
	movl	$deviceStarts, %edi
	movl	$800, %esi                      # imm = 0x320
	callq	hipMalloc
.Ltmp41:
# %bb.21:                               # %_ZL9hipMallocIfE10hipError_tPPT_m.exit96
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_120
# %bb.22:                               # %_Z9gpuAssert10hipError_tPcib.exit99
.Ltmp44:
	movl	$deviceEnds, %edi
	movl	$800, %esi                      # imm = 0x320
	callq	hipMalloc
.Ltmp45:
# %bb.23:                               # %_ZL9hipMallocIfE10hipError_tPPT_m.exit101
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_122
# %bb.24:                               # %_Z9gpuAssert10hipError_tPcib.exit104
.Ltmp48:
	movl	$deviceStrengths, %edi
	movl	$800, %esi                      # imm = 0x320
	callq	hipMalloc
.Ltmp49:
# %bb.25:                               # %_ZL9hipMallocIfE10hipError_tPPT_m.exit106
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_124
# %bb.26:                               # %_Z9gpuAssert10hipError_tPcib.exit109
.Ltmp52:
	movl	$deviceActiveTransmissions, %edi
	movl	$4096, %esi                     # imm = 0x1000
	callq	hipMalloc
.Ltmp53:
# %bb.27:                               # %_ZL9hipMallocIbE10hipError_tPPT_m.exit
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_126
# %bb.28:                               # %_Z9gpuAssert10hipError_tPcib.exit113
	movq	deviceSource(%rip), %rdi
.Ltmp56:
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp57:
# %bb.29:
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.LBB3_128
# %bb.30:                               # %_Z9gpuAssert10hipError_tPcib.exit116
.Ltmp60:
	movabsq	$4294967328, %rdi               # imm = 0x100000020
	movabsq	$4294967360, %rdx               # imm = 0x100000040
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp61:
# %bb.31:
	testl	%eax, %eax
	jne	.LBB3_33
# %bb.32:
	movq	deviceActiveTransmissions(%rip), %rdi
.Ltmp62:
	callq	_Z36__device_stub__initTransmissionArrayPb
.Ltmp63:
.LBB3_33:
.Ltmp65:
	leaq	8(%rsp), %rdi
	movl	$4096, %esi                     # imm = 0x1000
	movl	$42, %edx
	movl	$1, %ecx
	callq	hipfftPlan1d
.Ltmp66:
# %bb.34:
	testl	%eax, %eax
	jne	.LBB3_109
# %bb.35:                               # %.preheader203
	movq	%r12, %xmm0
	punpckldq	.LCPI3_0(%rip), %xmm0   # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
	subpd	.LCPI3_1(%rip), %xmm0
	movapd	%xmm0, %xmm1
	unpckhpd	%xmm0, %xmm1                    # xmm1 = xmm1[1],xmm0[1]
	addsd	%xmm0, %xmm1
	mulsd	.LCPI3_2(%rip), %xmm1
	addsd	.LCPI3_3(%rip), %xmm1
	xorpd	%xmm0, %xmm0
	movapd	%xmm1, 48(%rsp)                 # 16-byte Spill
	ucomisd	%xmm0, %xmm1
	jbe	.LBB3_50
# %bb.36:                               # %.lr.ph209.preheader
	xorl	%r15d, %r15d
	movabsq	$4294967328, %rbx               # imm = 0x100000020
	movabsq	$4294967360, %r14               # imm = 0x100000040
.LBB3_37:                               # %.lr.ph209
                                        # =>This Inner Loop Header: Depth=1
	movq	8(%rsp), %rdi
	movl	%r15d, %esi
	shlq	$4, %rsi
	addq	deviceSource(%rip), %rsi
	movq	deviceResult(%rip), %rdx
.Ltmp68:
	callq	hipfftExecR2C
.Ltmp69:
# %bb.38:                               #   in Loop: Header=BB3_37 Depth=1
	testl	%eax, %eax
	jne	.LBB3_106
# %bb.39:                               #   in Loop: Header=BB3_37 Depth=1
.Ltmp70:
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp71:
# %bb.40:                               #   in Loop: Header=BB3_37 Depth=1
	testl	%eax, %eax
	jne	.LBB3_42
# %bb.41:                               #   in Loop: Header=BB3_37 Depth=1
	movq	deviceScaledResult(%rip), %rdi
	movq	deviceResult(%rip), %rsi
.Ltmp72:
	callq	_Z26__device_stub__scaleResultPfP15HIP_vector_typeIfLj2EE
.Ltmp73:
.LBB3_42:                               #   in Loop: Header=BB3_37 Depth=1
.Ltmp74:
	callq	hipPeekAtLastError
.Ltmp75:
# %bb.43:                               #   in Loop: Header=BB3_37 Depth=1
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_103
# %bb.44:                               # %_Z9gpuAssert10hipError_tPcib.exit119
                                        #   in Loop: Header=BB3_37 Depth=1
.Ltmp78:
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp79:
# %bb.45:                               #   in Loop: Header=BB3_37 Depth=1
	testl	%eax, %eax
	jne	.LBB3_47
# %bb.46:                               #   in Loop: Header=BB3_37 Depth=1
	movq	deviceScaledResult(%rip), %rdi
	movq	deviceBins(%rip), %rsi
	movq	deviceFrequencies(%rip), %rdx
	movq	deviceStarts(%rip), %rcx
	movq	deviceEnds(%rip), %r8
	movq	deviceStrengths(%rip), %r9
	movq	deviceActiveTransmissions(%rip), %rax
.Ltmp80:
	movq	%rax, (%rsp)
	callq	_Z32__device_stub__findTransmissionsPfPiS_S_S_S_Pb
.Ltmp81:
.LBB3_47:                               #   in Loop: Header=BB3_37 Depth=1
.Ltmp82:
	callq	hipPeekAtLastError
.Ltmp83:
# %bb.48:                               # %_Z9gpuAssert10hipError_tPcib.exit122
                                        #   in Loop: Header=BB3_37 Depth=1
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_101
# %bb.49:                               #   in Loop: Header=BB3_37 Depth=1
	addl	$4096, %r15d                    # imm = 0x1000
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r15, %xmm0
	movapd	48(%rsp), %xmm1                 # 16-byte Reload
	ucomisd	%xmm0, %xmm1
	ja	.LBB3_37
.LBB3_50:                               # %._crit_edge210
.Ltmp88:
	movl	$4, %edi
	callq	_Znwm
.Ltmp89:
# %bb.51:
.Ltmp90:
	movq	%rax, %rbx
	movl	$800, %edi                      # imm = 0x320
	callq	_Znam
.Ltmp91:
# %bb.52:
	movq	%rax, hostBins(%rip)
.Ltmp92:
	movl	$800, %edi                      # imm = 0x320
	callq	_Znam
.Ltmp93:
# %bb.53:
	movq	%rax, hostFrequencies(%rip)
.Ltmp94:
	movl	$800, %edi                      # imm = 0x320
	callq	_Znam
.Ltmp95:
# %bb.54:
	movq	%rax, hostStarts(%rip)
.Ltmp96:
	movl	$800, %edi                      # imm = 0x320
	callq	_Znam
.Ltmp97:
# %bb.55:
	movq	%rax, hostEnds(%rip)
.Ltmp98:
	movl	$800, %edi                      # imm = 0x320
	callq	_Znam
.Ltmp99:
# %bb.56:
	movq	%rax, hostStrengths(%rip)
.Ltmp100:
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$4, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp101:
# %bb.57:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit124
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %r14
.Ltmp102:
	movq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp103:
# %bb.58:                               # %.noexc181
.Ltmp104:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp105:
# %bb.59:                               # %.noexc182
.Ltmp106:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp107:
# %bb.60:                               # %_ZNSolsEPFRSoS_E.exit126
	movq	hostBins(%rip), %rdi
	movq	deviceBins(%rip), %rsi
.Ltmp108:
	movl	$800, %edx                      # imm = 0x320
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp109:
# %bb.61:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_130
# %bb.62:                               # %_Z9gpuAssert10hipError_tPcib.exit129
	movq	hostFrequencies(%rip), %rdi
	movq	deviceFrequencies(%rip), %rsi
.Ltmp112:
	movl	$800, %edx                      # imm = 0x320
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp113:
# %bb.63:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_132
# %bb.64:                               # %_Z9gpuAssert10hipError_tPcib.exit132
	movq	hostStarts(%rip), %rdi
	movq	deviceStarts(%rip), %rsi
.Ltmp116:
	movl	$800, %edx                      # imm = 0x320
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp117:
# %bb.65:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_134
# %bb.66:                               # %_Z9gpuAssert10hipError_tPcib.exit135
	movq	hostEnds(%rip), %rdi
	movq	deviceEnds(%rip), %rsi
.Ltmp120:
	movl	$800, %edx                      # imm = 0x320
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp121:
# %bb.67:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_136
# %bb.68:                               # %_Z9gpuAssert10hipError_tPcib.exit138
	movq	hostStrengths(%rip), %rdi
	movq	deviceStrengths(%rip), %rsi
.Ltmp124:
	movl	$800, %edx                      # imm = 0x320
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp125:
# %bb.69:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_138
# %bb.70:                               # %_Z9gpuAssert10hipError_tPcib.exit141
	movq	deviceCount(%rip), %rsi
.Ltmp128:
	movl	$4, %edx
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp129:
# %bb.71:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB3_140
# %bb.72:                               # %_Z9gpuAssert10hipError_tPcib.exit144
	movl	(%rbx), %esi
.Ltmp132:
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
.Ltmp133:
# %bb.73:
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
.Ltmp134:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp135:
# %bb.74:                               # %.noexc184
.Ltmp136:
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
.Ltmp137:
# %bb.75:                               # %.noexc185
.Ltmp138:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp139:
# %bb.76:                               # %_ZNSolsEPFRSoS_E.exit146
.Ltmp141:
	leaq	584(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev
.Ltmp142:
# %bb.77:
.Ltmp144:
	leaq	584(%rsp), %rdi
	movl	$.L.str.3, %esi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
.Ltmp145:
# %bb.78:                               # %.preheader
	cmpl	$0, (%rbx)
	je	.LBB3_98
# %bb.79:                               # %.lr.ph212.preheader
	xorl	%r15d, %r15d
	leaq	584(%rsp), %r14
.LBB3_80:                               # %.lr.ph212
                                        # =>This Inner Loop Header: Depth=1
.Ltmp147:
	movl	$.L.str.4, %esi
	movl	$22, %edx
	movq	%r14, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp148:
# %bb.81:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit148
                                        #   in Loop: Header=BB3_80 Depth=1
.Ltmp149:
	movl	$.L.str.5, %esi
	movl	$1, %edx
	movq	%r14, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp150:
# %bb.82:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit150
                                        #   in Loop: Header=BB3_80 Depth=1
.Ltmp151:
	movl	$.L.str.6, %esi
	movl	$18, %edx
	movq	%r14, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp152:
# %bb.83:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit152
                                        #   in Loop: Header=BB3_80 Depth=1
	movq	hostBins(%rip), %rax
	movl	(%rax,%r15,4), %esi
.Ltmp153:
	movq	%r14, %rdi
	callq	_ZNSolsEi
.Ltmp154:
# %bb.84:                               #   in Loop: Header=BB3_80 Depth=1
.Ltmp155:
	movl	$.L.str.7, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp156:
# %bb.85:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit154
                                        #   in Loop: Header=BB3_80 Depth=1
.Ltmp157:
	movl	$.L.str.8, %esi
	movl	$18, %edx
	movq	%r14, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp158:
# %bb.86:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit156
                                        #   in Loop: Header=BB3_80 Depth=1
	movq	hostFrequencies(%rip), %rax
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rax,%r15,4), %xmm0
.Ltmp159:
	movq	%r14, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp160:
# %bb.87:                               # %_ZNSolsEf.exit
                                        #   in Loop: Header=BB3_80 Depth=1
.Ltmp161:
	movl	$.L.str.9, %esi
	movl	$5, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp162:
# %bb.88:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit159
                                        #   in Loop: Header=BB3_80 Depth=1
.Ltmp163:
	movl	$.L.str.10, %esi
	movl	$18, %edx
	movq	%r14, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp164:
# %bb.89:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit161
                                        #   in Loop: Header=BB3_80 Depth=1
	movq	hostStrengths(%rip), %rax
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rax,%r15,4), %xmm0
.Ltmp165:
	movq	%r14, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp166:
# %bb.90:                               # %_ZNSolsEf.exit163
                                        #   in Loop: Header=BB3_80 Depth=1
.Ltmp167:
	movl	$.L.str.11, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp168:
# %bb.91:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit165
                                        #   in Loop: Header=BB3_80 Depth=1
.Ltmp169:
	movl	$.L.str.12, %esi
	movl	$18, %edx
	movq	%r14, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp170:
# %bb.92:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit167
                                        #   in Loop: Header=BB3_80 Depth=1
	movq	hostStarts(%rip), %rax
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rax,%r15,4), %xmm0
.Ltmp171:
	movq	%r14, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp172:
# %bb.93:                               # %_ZNSolsEf.exit169
                                        #   in Loop: Header=BB3_80 Depth=1
.Ltmp173:
	movl	$.L.str.13, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp174:
# %bb.94:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit171
                                        #   in Loop: Header=BB3_80 Depth=1
.Ltmp175:
	movl	$.L.str.14, %esi
	movl	$18, %edx
	movq	%r14, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp176:
# %bb.95:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit173
                                        #   in Loop: Header=BB3_80 Depth=1
	movq	hostEnds(%rip), %rax
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rax,%r15,4), %xmm0
.Ltmp177:
	movq	%r14, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp178:
# %bb.96:                               # %_ZNSolsEf.exit175
                                        #   in Loop: Header=BB3_80 Depth=1
.Ltmp179:
	movl	$.L.str.13, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp180:
# %bb.97:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit177
                                        #   in Loop: Header=BB3_80 Depth=1
	incq	%r15
	movl	(%rbx), %eax
	cmpq	%rax, %r15
	jb	.LBB3_80
.LBB3_98:                               # %._crit_edge213
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	leaq	592(%rsp), %rdi
	movq	%rax, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	-24(%rax), %rax
	movq	%rcx, 584(%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	832(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	leaq	64(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	leaq	32(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB3_100
# %bb.99:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB3_100:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	xorl	%eax, %eax
	addq	$1240, %rsp                     # imm = 0x4D8
	.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_101:
	.cfi_def_cfa_offset 1296
	movq	stderr(%rip), %rbx
.Ltmp85:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp86:
# %bb.102:                              # %.noexc121
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$331, %r8d                      # imm = 0x14B
	jmp	.LBB3_105
.LBB3_103:
	movq	stderr(%rip), %rbx
.Ltmp76:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp77:
# %bb.104:                              # %.noexc118
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$319, %r8d                      # imm = 0x13F
.LBB3_105:                              # %.noexc
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebp, %edi
	callq	exit
.LBB3_106:
	movl	$2, %edi
	callq	exit
.LBB3_107:
.Ltmp5:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp6:
# %bb.108:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp7:
	movl	$_ZSt4cerr, %edi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp8:
.LBB3_109:                              # %_ZNSolsEPFRSoS_E.exit
	movl	$1, %edi
	callq	exit
.LBB3_110:
	movq	stderr(%rip), %rbx
.Ltmp22:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp23:
# %bb.111:                              # %.noexc
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$272, %r8d                      # imm = 0x110
	jmp	.LBB3_105
.LBB3_112:
	movq	stderr(%rip), %rbx
.Ltmp26:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp27:
# %bb.113:                              # %.noexc79
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$274, %r8d                      # imm = 0x112
	jmp	.LBB3_105
.LBB3_114:
	movq	stderr(%rip), %rbx
.Ltmp30:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp31:
# %bb.115:                              # %.noexc84
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$276, %r8d                      # imm = 0x114
	jmp	.LBB3_105
.LBB3_116:
	movq	stderr(%rip), %rbx
.Ltmp34:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp35:
# %bb.117:                              # %.noexc88
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$278, %r8d                      # imm = 0x116
	jmp	.LBB3_105
.LBB3_118:
	movq	stderr(%rip), %rbx
.Ltmp38:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp39:
# %bb.119:                              # %.noexc93
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$280, %r8d                      # imm = 0x118
	jmp	.LBB3_105
.LBB3_120:
	movq	stderr(%rip), %rbx
.Ltmp42:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp43:
# %bb.121:                              # %.noexc98
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$282, %r8d                      # imm = 0x11A
	jmp	.LBB3_105
.LBB3_122:
	movq	stderr(%rip), %rbx
.Ltmp46:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp47:
# %bb.123:                              # %.noexc103
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$284, %r8d                      # imm = 0x11C
	jmp	.LBB3_105
.LBB3_124:
	movq	stderr(%rip), %rbx
.Ltmp50:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp51:
# %bb.125:                              # %.noexc108
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$286, %r8d                      # imm = 0x11E
	jmp	.LBB3_105
.LBB3_126:
	movq	stderr(%rip), %rbx
.Ltmp54:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp55:
# %bb.127:                              # %.noexc112
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$288, %r8d                      # imm = 0x120
	jmp	.LBB3_105
.LBB3_128:
	movq	stderr(%rip), %r14
.Ltmp58:
	movl	%ebx, %edi
	callq	hipGetErrorString
.Ltmp59:
# %bb.129:                              # %.noexc115
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%r14, %rdi
	movq	%rax, %rdx
	movl	$291, %r8d                      # imm = 0x123
	xorl	%eax, %eax
	callq	fprintf
	movl	%ebx, %edi
	callq	exit
.LBB3_130:
	movq	stderr(%rip), %rbx
.Ltmp110:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp111:
# %bb.131:                              # %.noexc128
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$350, %r8d                      # imm = 0x15E
	jmp	.LBB3_105
.LBB3_132:
	movq	stderr(%rip), %rbx
.Ltmp114:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp115:
# %bb.133:                              # %.noexc131
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$352, %r8d                      # imm = 0x160
	jmp	.LBB3_105
.LBB3_134:
	movq	stderr(%rip), %rbx
.Ltmp118:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp119:
# %bb.135:                              # %.noexc134
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$354, %r8d                      # imm = 0x162
	jmp	.LBB3_105
.LBB3_136:
	movq	stderr(%rip), %rbx
.Ltmp122:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp123:
# %bb.137:                              # %.noexc137
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$356, %r8d                      # imm = 0x164
	jmp	.LBB3_105
.LBB3_138:
	movq	stderr(%rip), %rbx
.Ltmp126:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp127:
# %bb.139:                              # %.noexc140
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$358, %r8d                      # imm = 0x166
	jmp	.LBB3_105
.LBB3_140:
	movq	stderr(%rip), %rbx
.Ltmp130:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp131:
# %bb.141:                              # %.noexc143
	movl	$.L.str.15, %esi
	movl	$.L.str.1, %ecx
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$360, %r8d                      # imm = 0x168
	jmp	.LBB3_105
.LBB3_142:
.Ltmp146:
	jmp	.LBB3_155
.LBB3_143:
.Ltmp143:
	jmp	.LBB3_147
.LBB3_144:
.Ltmp67:
	jmp	.LBB3_147
.LBB3_145:
.Ltmp2:
	movq	%rax, %rbx
	jmp	.LBB3_157
.LBB3_146:
.Ltmp9:
	jmp	.LBB3_147
.LBB3_148:
.Ltmp17:
	jmp	.LBB3_147
.LBB3_149:                              # %.loopexit.split-lp
.Ltmp87:
	jmp	.LBB3_147
.LBB3_150:
.Ltmp64:
	jmp	.LBB3_147
.LBB3_151:
.Ltmp14:
	jmp	.LBB3_147
.LBB3_152:
.Ltmp140:
	jmp	.LBB3_147
.LBB3_153:                              # %.loopexit
.Ltmp84:
.LBB3_147:
	movq	%rax, %rbx
	jmp	.LBB3_156
.LBB3_154:
.Ltmp181:
.LBB3_155:
	movq	%rax, %rbx
	leaq	584(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
.LBB3_156:
	leaq	64(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
.LBB3_157:
	leaq	32(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB3_159
# %bb.158:                              # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i178
	callq	_ZdlPv
.LBB3_159:                              # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit180
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end3:
	.size	main, .Lfunc_end3-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table3:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp9-.Lfunc_begin0           #     jumps to .Ltmp9
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp10-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp11-.Ltmp10                #   Call between .Ltmp10 and .Ltmp11
	.uleb128 .Ltmp17-.Lfunc_begin0          #     jumps to .Ltmp17
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp13-.Ltmp12                #   Call between .Ltmp12 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp16-.Ltmp15                #   Call between .Ltmp15 and .Ltmp16
	.uleb128 .Ltmp17-.Lfunc_begin0          #     jumps to .Ltmp17
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp18-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp63-.Ltmp18                #   Call between .Ltmp18 and .Ltmp63
	.uleb128 .Ltmp64-.Lfunc_begin0          #     jumps to .Ltmp64
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp65-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp66-.Ltmp65                #   Call between .Ltmp65 and .Ltmp66
	.uleb128 .Ltmp67-.Lfunc_begin0          #     jumps to .Ltmp67
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp68-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp83-.Ltmp68                #   Call between .Ltmp68 and .Ltmp83
	.uleb128 .Ltmp84-.Lfunc_begin0          #     jumps to .Ltmp84
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp88-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp139-.Ltmp88               #   Call between .Ltmp88 and .Ltmp139
	.uleb128 .Ltmp140-.Lfunc_begin0         #     jumps to .Ltmp140
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp141-.Lfunc_begin0         # >> Call Site 11 <<
	.uleb128 .Ltmp142-.Ltmp141              #   Call between .Ltmp141 and .Ltmp142
	.uleb128 .Ltmp143-.Lfunc_begin0         #     jumps to .Ltmp143
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp144-.Lfunc_begin0         # >> Call Site 12 <<
	.uleb128 .Ltmp145-.Ltmp144              #   Call between .Ltmp144 and .Ltmp145
	.uleb128 .Ltmp146-.Lfunc_begin0         #     jumps to .Ltmp146
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp147-.Lfunc_begin0         # >> Call Site 13 <<
	.uleb128 .Ltmp180-.Ltmp147              #   Call between .Ltmp147 and .Ltmp180
	.uleb128 .Ltmp181-.Lfunc_begin0         #     jumps to .Ltmp181
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp85-.Lfunc_begin0          # >> Call Site 14 <<
	.uleb128 .Ltmp77-.Ltmp85                #   Call between .Ltmp85 and .Ltmp77
	.uleb128 .Ltmp87-.Lfunc_begin0          #     jumps to .Ltmp87
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp5-.Lfunc_begin0           # >> Call Site 15 <<
	.uleb128 .Ltmp8-.Ltmp5                  #   Call between .Ltmp5 and .Ltmp8
	.uleb128 .Ltmp9-.Lfunc_begin0           #     jumps to .Ltmp9
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp22-.Lfunc_begin0          # >> Call Site 16 <<
	.uleb128 .Ltmp59-.Ltmp22                #   Call between .Ltmp22 and .Ltmp59
	.uleb128 .Ltmp64-.Lfunc_begin0          #     jumps to .Ltmp64
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp110-.Lfunc_begin0         # >> Call Site 17 <<
	.uleb128 .Ltmp131-.Ltmp110              #   Call between .Ltmp110 and .Ltmp131
	.uleb128 .Ltmp140-.Lfunc_begin0         #     jumps to .Ltmp140
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp131-.Lfunc_begin0         # >> Call Site 18 <<
	.uleb128 .Lfunc_end3-.Ltmp131           #   Call between .Ltmp131 and .Lfunc_end3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_ # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	leaq	16(%rdi), %rax
	movq	%rax, (%rdi)
	testq	%rsi, %rsi
	je	.LBB4_1
# %bb.2:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	strlen
	leaq	(%rax,%rbx), %rdx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # TAILCALL
.LBB4_1:
	.cfi_def_cfa_offset 32
	movl	$.L.str.16, %edi
	callq	_ZSt19__throw_logic_errorPKc
.Lfunc_end4:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .Lfunc_end4-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.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	.LBB5_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	.LBB5_3
.LBB5_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB5_3:
	testq	%r14, %r14
	je	.LBB5_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB5_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB5_7
.LBB5_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB5_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_end5:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end5-_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	.LBB6_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB6_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z11scaleResultPfP15HIP_vector_typeIfLj2EE, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z21initTransmissionArrayPb, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z17findTransmissionsPfPiS_S_S_S_Pb, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$0, 8(%rsp)
	movl	$0, (%rsp)
	movl	$transmissionCount, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	__hipRegisterVar
	movl	$0, 8(%rsp)
	movl	$0, (%rsp)
	movl	$timeStep, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	__hipRegisterVar
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end6:
	.size	__hip_module_ctor, .Lfunc_end6-__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	.LBB7_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
.LBB7_2:
	retq
.Lfunc_end7:
	.size	__hip_module_dtor, .Lfunc_end7-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	transmissionCount,@object       # @transmissionCount
	.local	transmissionCount
	.comm	transmissionCount,4,4
	.type	timeStep,@object                # @timeStep
	.local	timeStep
	.comm	timeStep,4,4
	.type	_Z11scaleResultPfP15HIP_vector_typeIfLj2EE,@object # @_Z11scaleResultPfP15HIP_vector_typeIfLj2EE
	.section	.rodata,"a",@progbits
	.globl	_Z11scaleResultPfP15HIP_vector_typeIfLj2EE
	.p2align	3, 0x0
_Z11scaleResultPfP15HIP_vector_typeIfLj2EE:
	.quad	_Z26__device_stub__scaleResultPfP15HIP_vector_typeIfLj2EE
	.size	_Z11scaleResultPfP15HIP_vector_typeIfLj2EE, 8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Can't open file"
	.size	.L.str, 16

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/nathanjordan/CudaRogueSignalDetection/master/main.hip"
	.size	.L.str.1, 116

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

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"==== TRANSMISSION ===="
	.size	.L.str.4, 23

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

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Bin             : "
	.size	.L.str.6, 19

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	" \n"
	.size	.L.str.7, 3

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Frequency       : "
	.size	.L.str.8, 19

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	" MHz\n"
	.size	.L.str.9, 6

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Signal strength : "
	.size	.L.str.10, 19

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

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"Time start      : "
	.size	.L.str.12, 19

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

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"Time end        : "
	.size	.L.str.14, 19

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"CUDA_ERROR:\ncode:%s\nfile: %s\nline:%d\n"
	.size	.L.str.15, 38

	.type	.L.str.16,@object               # @.str.16
.L.str.16:
	.asciz	"basic_string: construction from null is not valid"
	.size	.L.str.16, 50

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z11scaleResultPfP15HIP_vector_typeIfLj2EE"
	.size	.L__unnamed_1, 43

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z21initTransmissionArrayPb"
	.size	.L__unnamed_2, 28

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z17findTransmissionsPfPiS_S_S_S_Pb"
	.size	.L__unnamed_3, 36

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"transmissionCount"
	.size	.L__unnamed_4, 18

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"timeStep"
	.size	.L__unnamed_5, 9

	.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

	.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 _Z26__device_stub__scaleResultPfP15HIP_vector_typeIfLj2EE
	.addrsig_sym _Z36__device_stub__initTransmissionArrayPb
	.addrsig_sym _Z32__device_stub__findTransmissionsPfPiS_S_S_S_Pb
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym transmissionCount
	.addrsig_sym timeStep
	.addrsig_sym _Z11scaleResultPfP15HIP_vector_typeIfLj2EE
	.addrsig_sym _Z21initTransmissionArrayPb
	.addrsig_sym _Z17findTransmissionsPfPiS_S_S_S_Pb
	.addrsig_sym deviceResult
	.addrsig_sym deviceSource
	.addrsig_sym deviceScaledResult
	.addrsig_sym deviceBins
	.addrsig_sym deviceFrequencies
	.addrsig_sym deviceStarts
	.addrsig_sym deviceEnds
	.addrsig_sym deviceStrengths
	.addrsig_sym deviceActiveTransmissions
	.addrsig_sym deviceCount
	.addrsig_sym _ZSt4cerr
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z11scaleResultPfP15HIP_vector_typeIfLj2EE ; -- Begin function _Z11scaleResultPfP15HIP_vector_typeIfLj2EE
	.globl	_Z11scaleResultPfP15HIP_vector_typeIfLj2EE
	.p2align	8
	.type	_Z11scaleResultPfP15HIP_vector_typeIfLj2EE,@function
_Z11scaleResultPfP15HIP_vector_typeIfLj2EE: ; @_Z11scaleResultPfP15HIP_vector_typeIfLj2EE
; %bb.0:
	s_load_b32 s2, s[0:1], 0x1c
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e32 0x1000, v1
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[3:4], 3, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v3, vcc_lo, s6, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v4, vcc_lo, s7, v4, vcc_lo
	global_load_b64 v[3:4], v[3:4], off
	s_waitcnt vmcnt(0)
	v_mul_f32_e32 v0, v3, v3
	v_mul_f32_e32 v0, v0, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v0, v4, v0
	v_mul_f32_e32 v3, 0x4f800000, v0
	v_cmp_gt_f32_e32 vcc_lo, 0xf800000, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v0, v3, vcc_lo
	v_sqrt_f32_e32 v3, v0
	s_waitcnt_depctr 0xfff
	v_add_nc_u32_e32 v4, -1, v3
	v_add_nc_u32_e32 v5, 1, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v6, -v4, v3, v0
	v_fma_f32 v7, -v5, v3, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ge_f32_e64 s0, 0, v6
	v_cndmask_b32_e64 v3, v3, v4, s0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_f32_e64 s0, 0, v7
	v_cndmask_b32_e64 v3, v3, v5, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v4, 0x37800000, v3
	v_cndmask_b32_e32 v3, v3, v4, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v0, 0x260
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, v3, v0, vcc_lo
	v_cmp_gt_f32_e32 vcc_lo, 0x800000, v0
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e64 v3, 1.0, 0x4f800000, vcc_lo
	v_cndmask_b32_e64 v4, 0, 0x411a209b, vcc_lo
	v_mul_f32_e32 v0, v0, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_2)
	v_log_f32_e32 v0, v0
	s_waitcnt_depctr 0xfff
	v_mul_f32_e32 v3, 0x3e9a209a, v0
	v_cmp_gt_f32_e64 s0, 0x7f800000, |v0|
	v_fma_f32 v3, 0x3e9a209a, v0, -v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmamk_f32 v3, v0, 0x3284fbcf, v3
	v_fmac_f32_e32 v3, 0x3e9a209a, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e64 v3, v0, v3, s0
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	v_sub_f32_e32 v2, v3, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v0, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	s_delay_alu instid0(VALU_DEP_3)
	v_mul_f32_e32 v2, 0x41a00000, v2
	global_store_b32 v[0:1], v2, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11scaleResultPfP15HIP_vector_typeIfLj2EE
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.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 8
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z11scaleResultPfP15HIP_vector_typeIfLj2EE, .Lfunc_end0-_Z11scaleResultPfP15HIP_vector_typeIfLj2EE
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 432
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 8
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z21initTransmissionArrayPb ; -- Begin function _Z21initTransmissionArrayPb
	.globl	_Z21initTransmissionArrayPb
	.p2align	8
	.type	_Z21initTransmissionArrayPb,@function
_Z21initTransmissionArrayPb:            ; @_Z21initTransmissionArrayPb
; %bb.0:
	s_load_b32 s2, s[0:1], 0x14
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	v_mov_b32_e32 v0, 0
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, transmissionCount@rel32@lo+4
	s_addc_u32 s3, s3, transmissionCount@rel32@hi+12
	global_store_b32 v0, v0, s[2:3]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e32 0x1000, v1
	s_cbranch_execz .LBB1_2
; %bb.1:
	s_load_b64 s[0:1], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v1, vcc_lo, s0, v1
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v2, vcc_lo, s1, v2, vcc_lo
	global_store_b8 v[1:2], v0, off
.LBB1_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z21initTransmissionArrayPb
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 264
		.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 3
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z21initTransmissionArrayPb, .Lfunc_end1-_Z21initTransmissionArrayPb
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 132
; NumSgprs: 18
; NumVgprs: 3
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 3
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z17findTransmissionsPfPiS_S_S_S_Pb ; -- Begin function _Z17findTransmissionsPfPiS_S_S_S_Pb
	.globl	_Z17findTransmissionsPfPiS_S_S_S_Pb
	.p2align	8
	.type	_Z17findTransmissionsPfPiS_S_S_S_Pb,@function
_Z17findTransmissionsPfPiS_S_S_S_Pb:    ; @_Z17findTransmissionsPfPiS_S_S_S_Pb
; %bb.0:
	s_load_b32 s2, s[0:1], 0x44
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	v_cmp_gt_i32_e32 vcc_lo, 0x1000, v1
	v_cmp_ne_u32_e64 s2, 0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s3, vcc_lo, s2
	s_and_saveexec_b32 s2, s3
	s_cbranch_execz .LBB2_16
; %bb.1:
	s_load_b256 s[12:19], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_load_b256 s[4:11], s[0:1], 0x20
	s_mov_b32 s1, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[3:4], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v3, vcc_lo, s12, v3
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v4, vcc_lo, s13, v4, vcc_lo
	global_load_b32 v0, v[3:4], off
	s_waitcnt vmcnt(0)
	v_cmpx_lt_f32_e32 0x43480000, v0
	s_cbranch_execz .LBB2_7
; %bb.2:
	v_add_co_u32 v5, vcc_lo, s8, v1
	v_add_co_ci_u32_e32 v6, vcc_lo, s9, v2, vcc_lo
	s_mov_b32 s3, exec_lo
	global_load_u8 v7, v[5:6], off
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u16_e32 0, v7
	s_cbranch_execz .LBB2_6
; %bb.3:
	s_mov_b32 s10, exec_lo
	s_mov_b32 s0, exec_lo
	v_mbcnt_lo_u32_b32 v0, s10, 0
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB2_5
; %bb.4:
	s_bcnt1_i32_b32 s12, s10
	s_delay_alu instid0(SALU_CYCLE_1)
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v7, s12
	s_getpc_b64 s[10:11]
	s_add_u32 s10, s10, transmissionCount@rel32@lo+4
	s_addc_u32 s11, s11, transmissionCount@rel32@hi+12
	global_atomic_add_u32 v0, v7, s[10:11]
.LBB2_5:
	s_or_b32 exec_lo, exec_lo, s0
	v_mov_b32_e32 v0, 0
	s_getpc_b64 s[10:11]
	s_add_u32 s10, s10, transmissionCount@rel32@lo+4
	s_addc_u32 s11, s11, transmissionCount@rel32@hi+12
	s_getpc_b64 s[12:13]
	s_add_u32 s12, s12, timeStep@rel32@lo+4
	s_addc_u32 s13, s13, timeStep@rel32@hi+12
	global_load_b32 v7, v0, s[10:11]
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v8, 31, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[7:8], 2, v[7:8]
	v_add_co_u32 v7, vcc_lo, s14, v7
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v8, vcc_lo, s15, v8, vcc_lo
	global_store_b32 v[7:8], v1, off offset:-4
	s_clause 0x1
	global_load_b32 v9, v0, s[12:13]
	global_load_b32 v21, v0, s[10:11]
	v_cvt_f64_i32_e32 v[7:8], v1
	s_mov_b32 s12, 0xe6849ba6
	s_mov_b32 s13, 0x41a483bf
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mul_f64 v[7:8], v[7:8], s[12:13]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ldexp_f64 v[7:8], v[7:8], -12
	v_div_scale_f64 v[11:12], null, 0x412e8480, 0x412e8480, v[7:8]
	v_div_scale_f64 v[24:25], vcc_lo, v[7:8], 0x412e8480, v[7:8]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f64_e32 v[15:16], v[11:12]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[19:20], -v[11:12], v[15:16], 1.0
	v_fma_f64 v[15:16], v[15:16], v[19:20], v[15:16]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[19:20], -v[11:12], v[15:16], 1.0
	v_fma_f64 v[15:16], v[15:16], v[19:20], v[15:16]
	s_waitcnt vmcnt(1)
	v_cvt_f64_i32_e32 v[9:10], v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f64 v[13:14], null, s[12:13], s[12:13], v[9:10]
	v_div_scale_f64 v[19:20], s0, v[9:10], s[12:13], v[9:10]
	v_rcp_f64_e32 v[17:18], v[13:14]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[22:23], -v[13:14], v[17:18], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[17:18], v[17:18], v[22:23], v[17:18]
	v_fma_f64 v[22:23], -v[13:14], v[17:18], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fma_f64 v[17:18], v[17:18], v[22:23], v[17:18]
	v_mul_f64 v[22:23], v[24:25], v[15:16]
	v_mul_f64 v[26:27], v[19:20], v[17:18]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f64 v[11:12], -v[11:12], v[22:23], v[24:25]
	v_fma_f64 v[13:14], -v[13:14], v[26:27], v[19:20]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_div_fmas_f64 v[11:12], v[11:12], v[15:16], v[22:23]
	s_mov_b32 vcc_lo, s0
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v22, 31, v21
	v_div_fmas_f64 v[13:14], v[13:14], v[17:18], v[26:27]
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_div_fixup_f64 v[7:8], v[11:12], 0x412e8480, v[7:8]
	v_div_fixup_f64 v[9:10], v[13:14], s[12:13], v[9:10]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_cvt_f32_f64_e32 v0, v[7:8]
	v_lshlrev_b64 v[7:8], 2, v[21:22]
	v_cvt_f32_f64_e32 v13, v[9:10]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v9, vcc_lo, s16, v7
	v_add_co_ci_u32_e32 v10, vcc_lo, s17, v8, vcc_lo
	v_add_co_u32 v11, vcc_lo, s18, v7
	v_add_co_ci_u32_e32 v12, vcc_lo, s19, v8, vcc_lo
	global_store_b32 v[9:10], v0, off offset:-4
	global_store_b32 v[11:12], v13, off offset:-4
	global_load_b32 v0, v[3:4], off
	v_add_co_u32 v3, vcc_lo, s6, v7
	v_add_co_ci_u32_e32 v4, vcc_lo, s7, v8, vcc_lo
	v_mov_b32_e32 v7, 1
	s_waitcnt vmcnt(0)
	global_store_b32 v[3:4], v0, off offset:-4
	global_store_b8 v[5:6], v7, off
.LBB2_6:                                ; %Flow51
	s_or_b32 exec_lo, exec_lo, s3
.LBB2_7:
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s1
	v_cmp_gt_f32_e32 vcc_lo, 0x43480000, v0
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB2_16
; %bb.8:
	v_add_co_u32 v3, vcc_lo, s8, v1
	v_add_co_ci_u32_e32 v4, vcc_lo, s9, v2, vcc_lo
	s_mov_b32 s3, 0
	global_load_u8 v0, v[3:4], off
	s_waitcnt vmcnt(0)
	v_cmp_ne_u16_e32 vcc_lo, 0, v0
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB2_16
; %bb.9:
	v_mov_b32_e32 v0, 0
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, transmissionCount@rel32@lo+4
	s_addc_u32 s1, s1, transmissionCount@rel32@hi+12
                                        ; implicit-def: $sgpr6
                                        ; implicit-def: $sgpr7
	global_load_b32 v2, v0, s[0:1]
	s_waitcnt vmcnt(0)
	v_readfirstlane_b32 s0, v2
.LBB2_10:                               ; =>This Inner Loop Header: Depth=1
	s_or_b32 s7, s7, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	s_cmp_lt_i32 s0, 1
	s_cbranch_scc1 .LBB2_12
; %bb.11:                               ;   in Loop: Header=BB2_10 Depth=1
	s_add_i32 s0, s0, -1
	s_mov_b32 s1, 0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[8:9], s[0:1], 2
	s_add_u32 s8, s14, s8
	s_addc_u32 s9, s15, s9
	s_and_not1_b32 s7, s7, exec_lo
	global_load_b32 v2, v0, s[8:9]
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, v2, v1
	s_and_b32 s8, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s7, s7, s8
	s_branch .LBB2_13
.LBB2_12:                               ;   in Loop: Header=BB2_10 Depth=1
	s_mov_b32 s1, -1
.LBB2_13:                               ; %Flow48
                                        ;   in Loop: Header=BB2_10 Depth=1
	s_and_b32 s8, exec_lo, s7
	v_dual_mov_b32 v6, s1 :: v_dual_mov_b32 v5, s0
	s_or_b32 s3, s8, s3
	s_and_not1_b32 s6, s6, exec_lo
	s_and_b32 s1, s1, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s6, s6, s1
	s_and_not1_b32 exec_lo, exec_lo, s3
	s_cbranch_execnz .LBB2_10
; %bb.14:                               ; %loop.exit.guard
	s_or_b32 exec_lo, exec_lo, s3
	s_xor_b32 s0, s6, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_saveexec_b32 s1, s0
	s_xor_b32 s1, exec_lo, s1
	s_cbranch_execz .LBB2_16
; %bb.15:
	v_mov_b32_e32 v2, 0
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, timeStep@rel32@lo+4
	s_addc_u32 s1, s1, timeStep@rel32@hi+12
	global_load_b32 v0, v2, s[0:1]
	s_mov_b32 s0, 0xe6849ba6
	s_mov_b32 s1, 0x41a483bf
	s_waitcnt vmcnt(0)
	v_cvt_f64_i32_e32 v[0:1], v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f64 v[7:8], null, s[0:1], s[0:1], v[0:1]
	v_div_scale_f64 v[13:14], vcc_lo, v[0:1], s[0:1], v[0:1]
	v_rcp_f64_e32 v[9:10], v[7:8]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[11:12], -v[7:8], v[9:10], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[9:10], v[9:10], v[11:12], v[9:10]
	v_fma_f64 v[11:12], -v[7:8], v[9:10], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[9:10], v[9:10], v[11:12], v[9:10]
	v_mul_f64 v[11:12], v[13:14], v[9:10]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[7:8], -v[7:8], v[11:12], v[13:14]
	v_div_fmas_f64 v[7:8], v[7:8], v[9:10], v[11:12]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fixup_f64 v[0:1], v[7:8], s[0:1], v[0:1]
	v_cvt_f32_f64_e32 v7, v[0:1]
	v_lshlrev_b64 v[0:1], 2, v[5:6]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	global_store_b32 v[0:1], v7, off
	global_store_b8 v[3:4], v2, off
.LBB2_16:                               ; %Flow52
	s_or_b32 exec_lo, exec_lo, s2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	s_mov_b32 s0, exec_lo
	s_mov_b32 s1, exec_lo
	v_mbcnt_lo_u32_b32 v0, s0, 0
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB2_18
; %bb.17:
	s_bcnt1_i32_b32 s2, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, s2
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, timeStep@rel32@lo+4
	s_addc_u32 s1, s1, timeStep@rel32@hi+12
	global_atomic_add_u32 v0, v1, s[0:1]
.LBB2_18:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17findTransmissionsPfPiS_S_S_S_Pb
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 312
		.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 28
		.amdhsa_next_free_sgpr 20
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	_Z17findTransmissionsPfPiS_S_S_S_Pb, .Lfunc_end2-_Z17findTransmissionsPfPiS_S_S_S_Pb
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1312
; NumSgprs: 22
; NumVgprs: 28
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 3
; NumSGPRsForWavesPerEU: 22
; NumVGPRsForWavesPerEU: 28
; 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	transmissionCount       ; @transmissionCount
	.type	transmissionCount,@object
	.section	.bss,"aw",@nobits
	.globl	transmissionCount
	.p2align	2, 0x0
transmissionCount:
	.long	0                               ; 0x0
	.size	transmissionCount, 4

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

	.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 transmissionCount
	.addrsig_sym timeStep
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         20
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         28
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         30
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         32
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         34
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         36
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         38
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         80
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 272
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11scaleResultPfP15HIP_vector_typeIfLj2EE
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11scaleResultPfP15HIP_vector_typeIfLj2EE.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         12
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         20
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         22
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         24
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         26
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         28
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         30
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         48
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         72
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 264
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z21initTransmissionArrayPb
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z21initTransmissionArrayPb.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     3
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         48
        .size:           8
        .value_kind:     global_buffer
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         60
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         64
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         68
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         70
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         72
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         74
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         76
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         78
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         112
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         120
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 312
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z17findTransmissionsPfPiS_S_S_S_Pb
    .private_segment_fixed_size: 0
    .sgpr_count:     22
    .sgpr_spill_count: 0
    .symbol:         _Z17findTransmissionsPfPiS_S_S_S_Pb.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     28
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
