#include <iterator>
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <stdint.h>

#define BLOCK_SIZE 32
#define SECTION_SIZE (BLOCK_SIZE*2)

#define cudaCheck(stmt) do {                               \
        cudaError_t err = stmt;                            \
        if (err != cudaSuccess) {                          \
            std::cerr << "Failed to run stmt " #stmt       \
            << " on line " << __LINE__                     \
            << ": " << cudaGetErrorString(err) << "\n";    \
            exit(-1);                                      \
        }                                                  \
    } while(0)

template < typename T, typename Operator >
__global__ void apply( T* input, int len, Operator op, const T* val )
{
   int i = blockIdx.x * blockDim.x + threadIdx.x;
   if( i < len )
      input[i] = op( input[i], *val );
}

template < typename T, typename Operator >
__global__ void scan(T* input, T* output, int len, T* sums, Operator op )
{
   __shared__ T tmp[ SECTION_SIZE ];

   int t = threadIdx.x;
   int i = blockIdx.x * SECTION_SIZE + t;

   tmp[ t ] = .0;
   tmp[ t+blockDim.x ] = .0;
   if( i < len )
   {
      tmp[t] = input[i];
      if( i+blockDim.x < len )
         tmp[t+blockDim.x] = input[i+blockDim.x];

      for( int stride = 1; stride <= BLOCK_SIZE; stride *= 2 )
      {
         int index = (t+1)*stride*2-1;
         if( index < SECTION_SIZE )
            tmp[index] = op( tmp[index], tmp[index-stride] );
         __syncthreads();
      }
      for( int stride = BLOCK_SIZE/2; stride > 0; stride /= 2 )
      {
         __syncthreads();
         int index = (t+1)*stride*2-1;
         if( index+stride < SECTION_SIZE )
            tmp[index+stride] = op( tmp[index+stride], tmp[index] );
      }
      __syncthreads();
      #ifdef DEBUG
      printf( "(%d:%d) output[%d] = tmp[%d] (%f)\n", blockIdx.x, t, i, t, tmp[t] );
      #endif
      output[i] = tmp[t];
      if( i+blockDim.x < len )
      {
         #ifdef DEBUG
         printf( "(%d:%d) (2) output[%d] = tmp[%d] (%f) (blockDim=%d)\n", blockIdx.x, t
            , i+blockDim.x, t+blockDim.x, tmp[t+blockDim.x], blockDim.x );
         #endif
         output[i+blockDim.x] = tmp[t+blockDim.x];
      }
   }
   if( t == blockDim.x - 1 && sums )
   {
      //printf( "(%d:%d) assigning sum (%f) to sums\n", blockIdx.x, t, tmp[SECTION_SIZE-1] );
      sums[blockIdx.x] = tmp[SECTION_SIZE-1];
   }
}

/**
* @input and @output must already be in device memory.
*/
template < typename T, typename Operator >
void scanner( T* input, T* output, int numElements, Operator op ) 
{
   int numBlocks( ::ceil(static_cast<double>(numElements)/SECTION_SIZE) );

   std::cout << "scanner: numBlocks: " << numBlocks << "\n";

   int iterations = ::ceil(static_cast<double>(numBlocks)/0x400);
   int remainder  = numBlocks%0x400;
   for( int itr = 0; itr < iterations; ++itr )
   {
      T* sums;
      cudaCheck(cudaMalloc( (void**)&sums, numBlocks*sizeof(T) ));

      dim3 dimGrid( itr==iterations-1? remainder : numBlocks );
      scan<<< dimGrid, BLOCK_SIZE >>>( input, output, numElements, sums, op );
      cudaCheck( cudaGetLastError() );
      cudaDeviceSynchronize();

      #ifdef DEBUG
      {
         std::vector<T> s( numElements );
         cudaCheck(cudaMemcpy(&s[0],output,numElements*sizeof(T), cudaMemcpyDeviceToHost ));
         std::cout << " ============= Temporary output =============\n";
         std::copy( s.begin(), s.end()
            , std::ostream_iterator<T>(std::cout," ") );
         std::cout << "\n ============================================\n";
      }
      #endif

      if( numElements > SECTION_SIZE )
      {
      #ifdef DEBUG
         {
            std::vector<T> s( numBlocks );
            cudaCheck(cudaMemcpy( &s[0], sums, numBlocks*sizeof(T), cudaMemcpyDeviceToHost ));
            std::cout << " =========== Sums pre scan ============= \n";
            std::copy( s.begin(), s.end()
            , std::ostream_iterator<T>(std::cout," ") );
            std::cout << "\n ============================================\n";
         }
      #endif
         T* scannedSums;
         cudaCheck( cudaMalloc( (void**)&scannedSums, numBlocks*sizeof(T) ) );
         cudaMemset( scannedSums, 0, numBlocks*sizeof(T) );
         scanner( sums, scannedSums, numBlocks, op );
      #ifdef DEBUG
            std::vector<T> s( numBlocks );
            cudaCheck(cudaMemcpy( &s[0], scannedSums, numBlocks*sizeof(T), cudaMemcpyDeviceToHost ));
            std::cout << " =========== Sums post scan ============= \n";
            std::copy( s.begin(), s.end()
            , std::ostream_iterator<T>(std::cout," ") );
            std::cout << "\n ============================================\n";
      #endif
         int remaining = numElements - SECTION_SIZE;
         for( int i = 1; i < numBlocks; ++i )
         {
            dim3 dGrid( ceil((double)SECTION_SIZE/BLOCK_SIZE) );
            dim3 dBlock( BLOCK_SIZE );
            apply<<< dGrid, dBlock >>>
               ( output+(SECTION_SIZE*i)
               , remaining < SECTION_SIZE ? remaining : SECTION_SIZE
               , op
               , scannedSums+i-1 );
            cudaCheck( cudaGetLastError() );
            cudaDeviceSynchronize();
            remaining -= SECTION_SIZE;
         }
         cudaCheck( cudaFree(scannedSums) );
      }
      cudaCheck( cudaFree(sums) );
   }
}

struct Adder
{
   template < typename T >
   __device__ T operator()( T a, T b ) const { return a+b; }
};

template < typename T >
std::vector<T> importVector( const std::string& filename )
{
   std::ifstream ifs( filename.c_str() );
   if( !ifs ) return std::vector<T>();
   std::istream_iterator<T> it( ifs );
   std::vector< T > v;
   for( ; std::istream_iterator<T>() != it; ++it )
      v.push_back( *it );
      return v;
}

int main(int argc, char ** argv) 
{
   uint64_t* deviceInput;
   uint64_t* deviceOutput;
   int numElements; // number of elements in the list

   std::vector<uint64_t> hostOutput;
   std::vector<uint64_t> hostInput(importVector<uint64_t>(argv[1]));
   numElements = (int)hostInput.size();

   std::cout << "numElements: " << numElements << std::endl;

   hostOutput.resize( numElements );

   cudaCheck(cudaMalloc((void**)&deviceInput
   , numElements*sizeof(uint64_t)));
   cudaCheck(cudaMalloc((void**)&deviceOutput
   , numElements*sizeof(uint64_t)));
   cudaCheck(cudaMemset(deviceOutput, 0
   , numElements*sizeof(uint64_t)));

   cudaCheck(cudaMemcpy(deviceInput, &(hostInput[0])
   , numElements*sizeof(uint64_t), cudaMemcpyHostToDevice));

   std::cout << "Launching scanner.\n";
   scanner( deviceInput, deviceOutput, numElements, Adder() );

   cudaCheck(cudaMemcpy(&(hostOutput[0]), deviceOutput
   , numElements*sizeof(uint64_t), cudaMemcpyDeviceToHost));

   if( numElements < 100 )
      std::copy( hostOutput.begin(), hostOutput.end()
      , std::ostream_iterator<uint64_t>(std::cout,"\n") );
   else std::cout << "Last element: " << hostOutput.back() << "\n";

   cudaFree(deviceInput);
   cudaFree(deviceOutput);

   return 0;
}


	.file	"tmpxft_0035d801_00000000-6_scan_test.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4167:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4167:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSt12_Vector_baseImSaImEE11_M_allocateEm.isra.0, @function
_ZNSt12_Vector_baseImSaImEE11_M_allocateEm.isra.0:
.LFB5022:
	.cfi_startproc
	testq	%rdi, %rdi
	je	.L3
	movabsq	$1152921504606846975, %rax
	cmpq	%rdi, %rax
	jnb	.L4
	pushq	%rax
	.cfi_def_cfa_offset 16
	movabsq	$2305843009213693951, %rax
	cmpq	%rdi, %rax
	jnb	.L5
	call	_ZSt28__throw_bad_array_new_lengthv@PLT
.L5:
	call	_ZSt17__throw_bad_allocv@PLT
.L4:
	.cfi_def_cfa_offset 8
	salq	$3, %rdi
	jmp	_Znwm@PLT
.L3:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE5022:
	.size	_ZNSt12_Vector_baseImSaImEE11_M_allocateEm.isra.0, .-_ZNSt12_Vector_baseImSaImEE11_M_allocateEm.isra.0
	.type	_ZL44__device_stub__Z4scanIm5AdderEvPT_S2_iS2_T0_PmS_iS_R5Adder, @function
_ZL44__device_stub__Z4scanIm5AdderEvPT_S2_iS2_T0_PmS_iS_R5Adder:
.LFB4189:
	.cfi_startproc
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	40(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%r8, 128(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movq	%rsp, %rax
	movq	%rax, 120(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movl	$1, 56(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L10
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z4scanIm5AdderEvPT_S2_iS2_T0_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L10:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4189:
	.size	_ZL44__device_stub__Z4scanIm5AdderEvPT_S2_iS2_T0_PmS_iS_R5Adder, .-_ZL44__device_stub__Z4scanIm5AdderEvPT_S2_iS2_T0_PmS_iS_R5Adder
	.type	_ZL44__device_stub__Z5applyIm5AdderEvPT_iT0_PKS1_PmiR5AdderPKm, @function
_ZL44__device_stub__Z5applyIm5AdderEvPT_iT0_PKS1_PmiR5AdderPKm:
.LFB4191:
	.cfi_startproc
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movl	%esi, 20(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rcx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rdx, 120(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rax, 104(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movl	$1, 64(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L14
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z5applyIm5AdderEvPT_iT0_PKS1_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L14:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4191:
	.size	_ZL44__device_stub__Z5applyIm5AdderEvPT_iT0_PKS1_PmiR5AdderPKm, .-_ZL44__device_stub__Z5applyIm5AdderEvPT_iT0_PKS1_PmiR5AdderPKm
	.section	.text._Z5applyIm5AdderEvPT_iT0_PKS1_,"axG",@progbits,_Z5applyIm5AdderEvPT_iT0_PKS1_,comdat
	.weak	_Z5applyIm5AdderEvPT_iT0_PKS1_
	.type	_Z5applyIm5AdderEvPT_iT0_PKS1_, @function
_Z5applyIm5AdderEvPT_iT0_PKS1_:
.LFB4550:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	leaq	15(%rsp), %rdx
	call	_ZL44__device_stub__Z5applyIm5AdderEvPT_iT0_PKS1_PmiR5AdderPKm
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4550:
	.size	_Z5applyIm5AdderEvPT_iT0_PKS1_, .-_Z5applyIm5AdderEvPT_iT0_PKS1_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"scanner: numBlocks: "
.LC2:
	.string	"\n"
.LC4:
	.string	"Failed to run stmt cudaMalloc( (void**)&sums, numBlocks*sizeof(T) )"
.LC5:
	.string	" on line "
.LC6:
	.string	": "
.LC7:
	.string	"Failed to run stmt cudaGetLastError()"
.LC8:
	.string	"Failed to run stmt cudaMalloc( (void**)&scannedSums, numBlocks*sizeof(T) )"
.LC9:
	.string	"Failed to run stmt cudaFree(scannedSums)"
.LC10:
	.string	"Failed to run stmt cudaFree(sums)"
	.text
	.type	_Z7scannerIm5AdderEvPT_S2_iT0_.isra.0, @function
_Z7scannerIm5AdderEvPT_S2_iT0_.isra.0:
.LFB5027:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	cvtsi2sdl	%edx, %xmm0
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	mulsd	.LC0(%rip), %xmm0
	movq	%rdi, 16(%rsp)
	movq	%rsi, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	call	ceil@PLT
	leaq	.LC1(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	cvttsd2sil	%xmm0, %ebx
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%ebx, %esi
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtsi2sdl	%ebx, %xmm0
	mulsd	.LC3(%rip), %xmm0
	call	ceil@PLT
	movl	%ebx, %eax
	movl	$1024, %ecx
	cltd
	cvttsd2sil	%xmm0, %r15d
	idivl	%ecx
	movslq	%ebx, %rax
	salq	$3, %rax
	movq	%rax, (%rsp)
	movl	%edx, 28(%rsp)
.L21:
	cmpl	%r13d, %r15d
	jle	.L43
	movq	(%rsp), %rsi
	leaq	48(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L22
	leaq	.LC4(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$95, %esi
	movq	%rax, %rdi
	jmp	.L41
.L22:
	leal	-1(%r15), %eax
	movl	$134217729, %edx
	movl	$1, %ecx
	movl	$1, 100(%rsp)
	cmpl	%r13d, %eax
	movl	28(%rsp), %eax
	cmovne	%ebx, %eax
	salq	$5, %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rdx, 92(%rsp)
	movl	%eax, 68(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	68(%rsp), %rdi
	movl	76(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L25
	movq	48(%rsp), %rcx
	movq	8(%rsp), %rsi
	leaq	80(%rsp), %r8
	movl	%ebp, %edx
	movq	16(%rsp), %rdi
	call	_ZL44__device_stub__Z4scanIm5AdderEvPT_S2_iS2_T0_PmS_iS_R5Adder
.L25:
	call	cudaGetLastError@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L26
	leaq	.LC7(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$99, %esi
	movq	%rax, %rdi
.L41:
	call	_ZNSolsEi@PLT
	leaq	.LC6(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %rbx
.L42:
	call	cudaGetErrorString@PLT
	movq	%rbx, %rdi
	movq	%rax, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	orl	$-1, %edi
	call	exit@PLT
.L26:
	call	cudaDeviceSynchronize@PLT
	cmpl	$64, %ebp
	jle	.L27
	movq	(%rsp), %rsi
	leaq	56(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L28
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$126, %esi
	movq	%rax, %rdi
	jmp	.L41
.L28:
	movq	(%rsp), %rdx
	movq	56(%rsp), %rdi
	xorl	%esi, %esi
	leal	-64(%rbp), %r12d
	xorl	%r14d, %r14d
	call	cudaMemset@PLT
	movq	56(%rsp), %rsi
	movq	48(%rsp), %rdi
	movl	%ebx, %edx
	call	_Z7scannerIm5AdderEvPT_S2_iT0_.isra.0
.L29:
	leal	1(%r14), %eax
	cmpl	%eax, %ebx
	jle	.L44
	movl	$2147483649, %eax
	movl	$134217729, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	addq	%rax, %rax
	salq	$5, %rdx
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rax, %rdi
	movq	%rax, 80(%rsp)
	movl	$1, 88(%rsp)
	movq	%rdx, 92(%rsp)
	movl	$1, 100(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L30
	movq	56(%rsp), %rax
	movl	$64, %esi
	movq	8(%rsp), %rdi
	leaq	47(%rsp), %rdx
	cmpl	%esi, %r12d
	leaq	(%rax,%r14,8), %rcx
	movl	%ebp, %eax
	cmovle	%r12d, %esi
	subl	%r12d, %eax
	cltq
	leaq	(%rdi,%rax,8), %rdi
	call	_ZL44__device_stub__Z5applyIm5AdderEvPT_iT0_PKS1_PmiR5AdderPKm
.L30:
	call	cudaGetLastError@PLT
	incq	%r14
	testl	%eax, %eax
	je	.L31
	leaq	.LC7(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	movl	%eax, (%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$147, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC6(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	(%rsp), %edi
	movq	%rax, %rbx
	jmp	.L42
.L31:
	call	cudaDeviceSynchronize@PLT
	subl	$64, %r12d
	jmp	.L29
.L44:
	movq	56(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L27
	leaq	.LC9(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$151, %esi
	movq	%rax, %rdi
	jmp	.L41
.L27:
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L34
	leaq	.LC10(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$153, %esi
	movq	%rax, %rdi
	jmp	.L41
.L34:
	incl	%r13d
	jmp	.L21
.L43:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	addq	$120, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5027:
	.size	_Z7scannerIm5AdderEvPT_S2_iT0_.isra.0, .-_Z7scannerIm5AdderEvPT_S2_iT0_.isra.0
	.section	.text._Z4scanIm5AdderEvPT_S2_iS2_T0_,"axG",@progbits,_Z4scanIm5AdderEvPT_S2_iS2_T0_,comdat
	.weak	_Z4scanIm5AdderEvPT_S2_iS2_T0_
	.type	_Z4scanIm5AdderEvPT_S2_iS2_T0_, @function
_Z4scanIm5AdderEvPT_S2_iS2_T0_:
.LFB4548:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	15(%rsp), %r8
	call	_ZL44__device_stub__Z4scanIm5AdderEvPT_S2_iS2_T0_PmS_iS_R5Adder
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4548:
	.size	_Z4scanIm5AdderEvPT_S2_iS2_T0_, .-_Z4scanIm5AdderEvPT_S2_iS2_T0_
	.section	.rodata.str1.1
.LC11:
	.string	"_Z5applyIm5AdderEvPT_iT0_PKS1_"
.LC12:
	.string	"_Z4scanIm5AdderEvPT_S2_iS2_T0_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4194:
	.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	.LC11(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z5applyIm5AdderEvPT_iT0_PKS1_(%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	.LC12(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z4scanIm5AdderEvPT_S2_iS2_T0_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4194:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorImSaImEED2Ev,"axG",@progbits,_ZNSt6vectorImSaImEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorImSaImEED2Ev
	.type	_ZNSt6vectorImSaImEED2Ev, @function
_ZNSt6vectorImSaImEED2Ev:
.LFB4520:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L49
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L49:
	ret
	.cfi_endproc
.LFE4520:
	.size	_ZNSt6vectorImSaImEED2Ev, .-_ZNSt6vectorImSaImEED2Ev
	.weak	_ZNSt6vectorImSaImEED1Ev
	.set	_ZNSt6vectorImSaImEED1Ev,_ZNSt6vectorImSaImEED2Ev
	.section	.text._ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv,"axG",@progbits,_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv,comdat
	.align 2
	.weak	_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv
	.type	_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv, @function
_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv:
.LFB4859:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	.L51
	leaq	8(%rbx), %rsi
	call	_ZNSi10_M_extractImEERSiRT_@PLT
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	je	.L51
	xorl	%eax, %eax
	movb	$0, 16(%rbx)
	movq	%rax, (%rbx)
.L51:
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4859:
	.size	_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv, .-_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv
	.section	.text._ZNKSt6vectorImSaImEE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc,comdat
	.align 2
	.weak	_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc
	.type	_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc, @function
_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc:
.LFB4874:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movq	%rdx, %rdi
	movq	8(%rax), %rcx
	subq	(%rax), %rcx
	movabsq	$1152921504606846975, %rax
	sarq	$3, %rcx
	movq	%rax, %rdx
	subq	%rcx, %rdx
	cmpq	%rsi, %rdx
	jnb	.L60
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_ZSt20__throw_length_errorPKc@PLT
.L60:
	.cfi_def_cfa_offset 8
	cmpq	%rcx, %rsi
	cmovb	%rcx, %rsi
	addq	%rsi, %rcx
	jc	.L59
	movabsq	$1152921504606846975, %rax
	cmpq	%rax, %rcx
	cmovbe	%rcx, %rax
.L59:
	ret
	.cfi_endproc
.LFE4874:
	.size	_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc, .-_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc
	.section	.text._ZNSt27__uninitialized_default_n_1ILb1EE18__uninit_default_nIPmmEET_S3_T0_,"axG",@progbits,_ZNSt27__uninitialized_default_n_1ILb1EE18__uninit_default_nIPmmEET_S3_T0_,comdat
	.weak	_ZNSt27__uninitialized_default_n_1ILb1EE18__uninit_default_nIPmmEET_S3_T0_
	.type	_ZNSt27__uninitialized_default_n_1ILb1EE18__uninit_default_nIPmmEET_S3_T0_, @function
_ZNSt27__uninitialized_default_n_1ILb1EE18__uninit_default_nIPmmEET_S3_T0_:
.LFB4984:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	testq	%rsi, %rsi
	je	.L68
	xorl	%r8d, %r8d
	leaq	8(%rdi), %rax
	movq	%r8, (%rdi)
	decq	%rsi
	je	.L68
	leaq	(%rax,%rsi,8), %rdx
	movq	%rax, %rcx
.L70:
	cmpq	%rcx, %rdx
	je	.L77
	xorl	%esi, %esi
	addq	$8, %rcx
	movq	%rsi, -8(%rcx)
	jmp	.L70
.L77:
	subq	%rdi, %rdx
	leaq	-8(%rax,%rdx), %rax
.L68:
	ret
	.cfi_endproc
.LFE4984:
	.size	_ZNSt27__uninitialized_default_n_1ILb1EE18__uninit_default_nIPmmEET_S3_T0_, .-_ZNSt27__uninitialized_default_n_1ILb1EE18__uninit_default_nIPmmEET_S3_T0_
	.section	.rodata._ZNSt6vectorImSaImEE17_M_default_appendEm.str1.1,"aMS",@progbits,1
.LC13:
	.string	"vector::_M_default_append"
	.section	.text._ZNSt6vectorImSaImEE17_M_default_appendEm,"axG",@progbits,_ZNSt6vectorImSaImEE17_M_default_appendEm,comdat
	.align 2
	.weak	_ZNSt6vectorImSaImEE17_M_default_appendEm
	.type	_ZNSt6vectorImSaImEE17_M_default_appendEm, @function
_ZNSt6vectorImSaImEE17_M_default_appendEm:
.LFB4728:
	.cfi_startproc
	endbr64
	testq	%rsi, %rsi
	je	.L91
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rsi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	pushq	%rdx
	.cfi_def_cfa_offset 64
	movq	8(%rdi), %rdi
	movq	16(%rbp), %rax
	movq	0(%rbp), %r15
	subq	%rdi, %rax
	sarq	$3, %rax
	cmpq	%rsi, %rax
	jb	.L80
	call	_ZNSt27__uninitialized_default_n_1ILb1EE18__uninit_default_nIPmmEET_S3_T0_
	movq	%rax, 8(%rbp)
	jmp	.L78
.L80:
	movq	%rdi, %rbx
	leaq	.LC13(%rip), %rdx
	movq	%rbp, %rdi
	call	_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc
	subq	%r15, %rbx
	movq	%rax, %rdi
	movq	%rax, %r13
	call	_ZNSt12_Vector_baseImSaImEE11_M_allocateEm.isra.0
	movq	%r14, %rsi
	leaq	(%rax,%rbx), %rdi
	movq	%rax, %r12
	call	_ZNSt27__uninitialized_default_n_1ILb1EE18__uninit_default_nIPmmEET_S3_T0_
	testq	%rbx, %rbx
	je	.L81
	movq	%rbx, %rdx
	movq	%r15, %rsi
	movq	%r12, %rdi
	call	memmove@PLT
	jmp	.L82
.L81:
	testq	%r15, %r15
	je	.L83
.L82:
	movq	16(%rbp), %rsi
	movq	%r15, %rdi
	subq	%r15, %rsi
	call	_ZdlPvm@PLT
.L83:
	sarq	$3, %rbx
	movq	%r12, 0(%rbp)
	addq	%r14, %rbx
	leaq	(%r12,%rbx,8), %rax
	movq	%rax, 8(%rbp)
	leaq	(%r12,%r13,8), %rax
	movq	%rax, 16(%rbp)
.L78:
	popq	%rax
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L91:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE4728:
	.size	_ZNSt6vectorImSaImEE17_M_default_appendEm, .-_ZNSt6vectorImSaImEE17_M_default_appendEm
	.section	.rodata.str1.1
.LC14:
	.string	"basic_string: construction from null is not valid"
.LC15:
	.string	"vector::_M_realloc_insert"
.LC16:
	.string	"numElements: "
.LC17:
	.string	"Failed to run stmt cudaMalloc((void**)&deviceInput , numElements*sizeof(uint64_t))"
.LC18:
	.string	"Failed to run stmt cudaMalloc((void**)&deviceOutput , numElements*sizeof(uint64_t))"
.LC19:
	.string	"Failed to run stmt cudaMemset(deviceOutput, 0 , numElements*sizeof(uint64_t))"
.LC20:
	.string	"Failed to run stmt cudaMemcpy(deviceInput, &(hostInput[0]) , numElements*sizeof(uint64_t), cudaMemcpyHostToDevice)"
.LC21:
	.string	"Launching scanner.\n"
.LC22:
	.string	"Failed to run stmt cudaMemcpy(&(hostOutput[0]), deviceOutput , numElements*sizeof(uint64_t), cudaMemcpyDeviceToHost)"
.LC23:
	.string	"Last element: "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4154:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4154
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%ecx, %ecx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$680, %rsp
	.cfi_def_cfa_offset 736
	movq	8(%rsi), %rbx
	movq	%fs:40, %rax
	movq	%rax, 664(%rsp)
	xorl	%eax, %eax
	leaq	112(%rsp), %rax
	movq	%rcx, 16(%rsp)
	movq	%rax, (%rsp)
	leaq	128(%rsp), %rax
	movq	%rcx, 24(%rsp)
	movq	%rcx, 32(%rsp)
	movq	%rax, 112(%rsp)
	testq	%rbx, %rbx
	jne	.L95
	movq	664(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L139
	leaq	.LC14(%rip), %rdi
.LEHB0:
	call	_ZSt19__throw_logic_errorPKc@PLT
.L95:
	movq	%rbx, %rdi
	call	strlen@PLT
	movq	%rax, 88(%rsp)
	leaq	(%rbx,%rax), %rbp
	cmpq	$15, %rax
	jbe	.L97
	movq	(%rsp), %rdi
	leaq	88(%rsp), %rsi
	xorl	%edx, %edx
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
.LEHE0:
	movq	%rax, 112(%rsp)
	movq	88(%rsp), %rax
	movq	%rax, 128(%rsp)
.L97:
	movq	112(%rsp), %rdi
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	leaq	144(%rsp), %r13
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	88(%rsp), %rax
	movq	112(%rsp), %rdx
	movq	%r13, %rdi
	movq	%rax, 120(%rsp)
	movb	$0, (%rdx,%rax)
	movq	112(%rsp), %rsi
	movl	$8, %edx
.LEHB1:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE1:
	leaq	64(%rsp), %rax
	testb	$5, 432(%rsp)
	movq	%rax, 8(%rsp)
	je	.L98
	leaq	40(%rsp), %rdi
	movl	$6, %ecx
	xorl	%eax, %eax
	rep stosl
	jmp	.L99
.L98:
	movq	8(%rsp), %rdi
	movq	%r13, 64(%rsp)
	movb	$1, 80(%rsp)
.LEHB2:
	call	_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv
.LEHE2:
	xorl	%edx, %edx
	movq	%rdx, 88(%rsp)
	movq	%rdx, 96(%rsp)
	movq	%rdx, 104(%rsp)
.L100:
	cmpb	$0, 80(%rsp)
	movq	96(%rsp), %rbx
	movq	104(%rsp), %rbp
	je	.L104
	cmpq	%rbx, %rbp
	je	.L164
	movq	72(%rsp), %rax
	addq	$8, %rbx
	movq	%rax, -8(%rbx)
	movq	%rbx, 96(%rsp)
	jmp	.L101
.L164:
	leaq	88(%rsp), %rdi
	leaq	.LC15(%rip), %rdx
	movl	$1, %esi
.LEHB3:
	call	_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc
	movq	88(%rsp), %r12
	movq	%rax, %rdi
	movq	%rax, %r14
	subq	%r12, %rbx
	call	_ZNSt12_Vector_baseImSaImEE11_M_allocateEm.isra.0
	movq	%rax, %r15
	movq	72(%rsp), %rax
	movq	%rax, (%r15,%rbx)
	testq	%rbx, %rbx
	jle	.L102
	movq	%rbx, %rdx
	movq	%r12, %rsi
	movq	%r15, %rdi
	call	memmove@PLT
.L102:
	leaq	8(%r15,%rbx), %rbx
	testq	%r12, %r12
	je	.L103
	movq	%rbp, %rsi
	movq	%r12, %rdi
	subq	%r12, %rsi
	call	_ZdlPvm@PLT
.L103:
	leaq	(%r15,%r14,8), %rax
	movq	%r15, 88(%rsp)
	movq	%rbx, 96(%rsp)
	movq	%rax, 104(%rsp)
.L101:
	movq	8(%rsp), %rdi
	call	_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv
.LEHE3:
	jmp	.L100
.L104:
	movq	88(%rsp), %rax
	leaq	88(%rsp), %rdi
	movq	%rbx, 48(%rsp)
	movq	%rbp, 56(%rsp)
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	%rax, 104(%rsp)
	movq	%rax, 96(%rsp)
	movq	%rax, 88(%rsp)
	call	_ZNSt6vectorImSaImEED1Ev
.L99:
	movq	%r13, %rdi
	leaq	_ZSt4cout(%rip), %r12
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	40(%rsp), %r13
	movq	48(%rsp), %rbp
	movq	%r12, %rdi
	leaq	.LC16(%rip), %rsi
	subq	%r13, %rbp
	sarq	$3, %rbp
	movl	%ebp, %r14d
.LEHB4:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%ebp, %esi
	call	_ZNSolsEi@PLT
	jmp	.L165
.L130:
	endbr64
	movq	%rax, %rbx
.L108:
	leaq	88(%rsp), %rdi
	call	_ZNSt6vectorImSaImEED1Ev
	jmp	.L109
.L129:
	endbr64
	movq	%rax, %rbx
.L109:
	movq	%r13, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L110
.L165:
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	movslq	%ebp, %rbx
	testq	%rbx, %rbx
	je	.L111
	leaq	16(%rsp), %rdi
	movq	%rbx, %rsi
	call	_ZNSt6vectorImSaImEE17_M_default_appendEm
.L111:
	salq	$3, %rbx
	movq	8(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movl	%eax, %r15d
	testl	%eax, %eax
	je	.L112
	leaq	.LC17(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC5(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$189, %esi
.L162:
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC6(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rbx
	movl	%r15d, %edi
.L154:
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbx, %rdi
.L152:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC2(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	orl	$-1, %edi
	call	exit@PLT
.L112:
	leaq	88(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movl	%eax, %r15d
	testl	%eax, %eax
	je	.L113
	leaq	.LC18(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC5(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$191, %esi
	jmp	.L162
.L113:
	movq	88(%rsp), %rdi
	movq	%rbx, %rdx
	xorl	%esi, %esi
	call	cudaMemset@PLT
	movl	%eax, %r15d
	testl	%eax, %eax
	je	.L115
	leaq	.LC19(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC5(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$193, %esi
	jmp	.L162
.L115:
	movq	64(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rdx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movl	%eax, %r13d
	testl	%eax, %eax
	je	.L116
	leaq	.LC20(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC5(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$196, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC6(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rbx
	movl	%r13d, %edi
	jmp	.L154
.L116:
	leaq	.LC21(%rip), %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	88(%rsp), %rsi
	movq	64(%rsp), %rdi
	movl	%r14d, %edx
	call	_Z7scannerIm5AdderEvPT_S2_iT0_.isra.0
	movq	16(%rsp), %r13
	movq	88(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdx
	movq	%r13, %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L117
	leaq	.LC22(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	leaq	.LC5(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$202, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC6(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbp, %rdi
	jmp	.L152
.L117:
	cmpl	$99, %ebp
	jg	.L118
	movq	24(%rsp), %rbx
	leaq	.LC2(%rip), %rbp
	subq	%r13, %rbx
	sarq	$3, %rbx
.L119:
	testq	%rbx, %rbx
	jle	.L121
	movq	0(%r13), %rsi
	movq	%r12, %rdi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	addq	$8, %r13
	decq	%rbx
	jmp	.L119
.L118:
	leaq	.LC23(%rip), %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	24(%rsp), %rax
	movq	-8(%rax), %rsi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC2(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L121:
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
.LEHE4:
	leaq	40(%rsp), %rdi
	call	_ZNSt6vectorImSaImEED1Ev
	leaq	16(%rsp), %rdi
	call	_ZNSt6vectorImSaImEED1Ev
	movq	664(%rsp), %rax
	subq	%fs:40, %rax
	je	.L125
	jmp	.L139
.L126:
	endbr64
	movq	%rax, %rbx
.L110:
	movq	(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L122
.L128:
	endbr64
	movq	%rax, %rbx
.L123:
	leaq	40(%rsp), %rdi
	call	_ZNSt6vectorImSaImEED1Ev
	jmp	.L122
.L127:
	endbr64
	movq	%rax, %rbx
.L122:
	leaq	16(%rsp), %rdi
	call	_ZNSt6vectorImSaImEED1Ev
	movq	664(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L139
	movq	%rbx, %rdi
.LEHB5:
	call	_Unwind_Resume@PLT
.LEHE5:
.L139:
	call	__stack_chk_fail@PLT
.L125:
	addq	$680, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4154:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4154:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4154-.LLSDACSB4154
.LLSDACSB4154:
	.uleb128 .LEHB0-.LFB4154
	.uleb128 .LEHE0-.LEHB0
	.uleb128 .L127-.LFB4154
	.uleb128 0
	.uleb128 .LEHB1-.LFB4154
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L126-.LFB4154
	.uleb128 0
	.uleb128 .LEHB2-.LFB4154
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L129-.LFB4154
	.uleb128 0
	.uleb128 .LEHB3-.LFB4154
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L130-.LFB4154
	.uleb128 0
	.uleb128 .LEHB4-.LFB4154
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L128-.LFB4154
	.uleb128 0
	.uleb128 .LEHB5-.LFB4154
	.uleb128 .LEHE5-.LEHB5
	.uleb128 0
	.uleb128 0
.LLSDACSE4154:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1066401792
	.align 8
.LC3:
	.long	0
	.long	1062207488
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <iterator>
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <stdint.h>

#define BLOCK_SIZE 32
#define SECTION_SIZE (BLOCK_SIZE*2)

#define cudaCheck(stmt) do {                               \
        hipError_t err = stmt;                            \
        if (err != hipSuccess) {                          \
            std::cerr << "Failed to run stmt " #stmt       \
            << " on line " << __LINE__                     \
            << ": " << hipGetErrorString(err) << "\n";    \
            exit(-1);                                      \
        }                                                  \
    } while(0)

template < typename T, typename Operator >
__global__ void apply( T* input, int len, Operator op, const T* val )
{
   int i = blockIdx.x * blockDim.x + threadIdx.x;
   if( i < len )
      input[i] = op( input[i], *val );
}

template < typename T, typename Operator >
__global__ void scan(T* input, T* output, int len, T* sums, Operator op )
{
   __shared__ T tmp[ SECTION_SIZE ];

   int t = threadIdx.x;
   int i = blockIdx.x * SECTION_SIZE + t;

   tmp[ t ] = .0;
   tmp[ t+blockDim.x ] = .0;
   if( i < len )
   {
      tmp[t] = input[i];
      if( i+blockDim.x < len )
         tmp[t+blockDim.x] = input[i+blockDim.x];

      for( int stride = 1; stride <= BLOCK_SIZE; stride *= 2 )
      {
         int index = (t+1)*stride*2-1;
         if( index < SECTION_SIZE )
            tmp[index] = op( tmp[index], tmp[index-stride] );
         __syncthreads();
      }
      for( int stride = BLOCK_SIZE/2; stride > 0; stride /= 2 )
      {
         __syncthreads();
         int index = (t+1)*stride*2-1;
         if( index+stride < SECTION_SIZE )
            tmp[index+stride] = op( tmp[index+stride], tmp[index] );
      }
      __syncthreads();
      #ifdef DEBUG
      printf( "(%d:%d) output[%d] = tmp[%d] (%f)\n", blockIdx.x, t, i, t, tmp[t] );
      #endif
      output[i] = tmp[t];
      if( i+blockDim.x < len )
      {
         #ifdef DEBUG
         printf( "(%d:%d) (2) output[%d] = tmp[%d] (%f) (blockDim=%d)\n", blockIdx.x, t
            , i+blockDim.x, t+blockDim.x, tmp[t+blockDim.x], blockDim.x );
         #endif
         output[i+blockDim.x] = tmp[t+blockDim.x];
      }
   }
   if( t == blockDim.x - 1 && sums )
   {
      //printf( "(%d:%d) assigning sum (%f) to sums\n", blockIdx.x, t, tmp[SECTION_SIZE-1] );
      sums[blockIdx.x] = tmp[SECTION_SIZE-1];
   }
}

/**
* @input and @output must already be in device memory.
*/
template < typename T, typename Operator >
void scanner( T* input, T* output, int numElements, Operator op ) 
{
   int numBlocks( ::ceil(static_cast<double>(numElements)/SECTION_SIZE) );

   std::cout << "scanner: numBlocks: " << numBlocks << "\n";

   int iterations = ::ceil(static_cast<double>(numBlocks)/0x400);
   int remainder  = numBlocks%0x400;
   for( int itr = 0; itr < iterations; ++itr )
   {
      T* sums;
      cudaCheck(hipMalloc( (void**)&sums, numBlocks*sizeof(T) ));

      dim3 dimGrid( itr==iterations-1? remainder : numBlocks );
      scan<<< dimGrid, BLOCK_SIZE >>>( input, output, numElements, sums, op );
      cudaCheck( hipGetLastError() );
      hipDeviceSynchronize();

      #ifdef DEBUG
      {
         std::vector<T> s( numElements );
         cudaCheck(hipMemcpy(&s[0],output,numElements*sizeof(T), hipMemcpyDeviceToHost ));
         std::cout << " ============= Temporary output =============\n";
         std::copy( s.begin(), s.end()
            , std::ostream_iterator<T>(std::cout," ") );
         std::cout << "\n ============================================\n";
      }
      #endif

      if( numElements > SECTION_SIZE )
      {
      #ifdef DEBUG
         {
            std::vector<T> s( numBlocks );
            cudaCheck(hipMemcpy( &s[0], sums, numBlocks*sizeof(T), hipMemcpyDeviceToHost ));
            std::cout << " =========== Sums pre scan ============= \n";
            std::copy( s.begin(), s.end()
            , std::ostream_iterator<T>(std::cout," ") );
            std::cout << "\n ============================================\n";
         }
      #endif
         T* scannedSums;
         cudaCheck( hipMalloc( (void**)&scannedSums, numBlocks*sizeof(T) ) );
         hipMemset( scannedSums, 0, numBlocks*sizeof(T) );
         scanner( sums, scannedSums, numBlocks, op );
      #ifdef DEBUG
            std::vector<T> s( numBlocks );
            cudaCheck(hipMemcpy( &s[0], scannedSums, numBlocks*sizeof(T), hipMemcpyDeviceToHost ));
            std::cout << " =========== Sums post scan ============= \n";
            std::copy( s.begin(), s.end()
            , std::ostream_iterator<T>(std::cout," ") );
            std::cout << "\n ============================================\n";
      #endif
         int remaining = numElements - SECTION_SIZE;
         for( int i = 1; i < numBlocks; ++i )
         {
            dim3 dGrid( ceil((double)SECTION_SIZE/BLOCK_SIZE) );
            dim3 dBlock( BLOCK_SIZE );
            apply<<< dGrid, dBlock >>>
               ( output+(SECTION_SIZE*i)
               , remaining < SECTION_SIZE ? remaining : SECTION_SIZE
               , op
               , scannedSums+i-1 );
            cudaCheck( hipGetLastError() );
            hipDeviceSynchronize();
            remaining -= SECTION_SIZE;
         }
         cudaCheck( hipFree(scannedSums) );
      }
      cudaCheck( hipFree(sums) );
   }
}

struct Adder
{
   template < typename T >
   __device__ T operator()( T a, T b ) const { return a+b; }
};

template < typename T >
std::vector<T> importVector( const std::string& filename )
{
   std::ifstream ifs( filename.c_str() );
   if( !ifs ) return std::vector<T>();
   std::istream_iterator<T> it( ifs );
   std::vector< T > v;
   for( ; std::istream_iterator<T>() != it; ++it )
      v.push_back( *it );
      return v;
}

int main(int argc, char ** argv) 
{
   uint64_t* deviceInput;
   uint64_t* deviceOutput;
   int numElements; // number of elements in the list

   std::vector<uint64_t> hostOutput;
   std::vector<uint64_t> hostInput(importVector<uint64_t>(argv[1]));
   numElements = (int)hostInput.size();

   std::cout << "numElements: " << numElements << std::endl;

   hostOutput.resize( numElements );

   cudaCheck(hipMalloc((void**)&deviceInput
   , numElements*sizeof(uint64_t)));
   cudaCheck(hipMalloc((void**)&deviceOutput
   , numElements*sizeof(uint64_t)));
   cudaCheck(hipMemset(deviceOutput, 0
   , numElements*sizeof(uint64_t)));

   cudaCheck(hipMemcpy(deviceInput, &(hostInput[0])
   , numElements*sizeof(uint64_t), hipMemcpyHostToDevice));

   std::cout << "Launching scanner.\n";
   scanner( deviceInput, deviceOutput, numElements, Adder() );

   cudaCheck(hipMemcpy(&(hostOutput[0]), deviceOutput
   , numElements*sizeof(uint64_t), hipMemcpyDeviceToHost));

   if( numElements < 100 )
      std::copy( hostOutput.begin(), hostOutput.end()
      , std::ostream_iterator<uint64_t>(std::cout,"\n") );
   else std::cout << "Last element: " << hostOutput.back() << "\n";

   hipFree(deviceInput);
   hipFree(deviceOutput);

   return 0;
}


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

                                        # End of file scope inline assembly
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$120, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	xorps	%xmm0, %xmm0
	movaps	%xmm0, 32(%rsp)
	movq	$0, 48(%rsp)
	movq	8(%rsi), %rsi
.Ltmp0:
	leaq	88(%rsp), %rdi
	leaq	15(%rsp), %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
.Ltmp1:
# %bb.1:
.Ltmp3:
	leaq	64(%rsp), %rdi
	leaq	88(%rsp), %rsi
	callq	_Z12importVectorImESt6vectorIT_SaIS1_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp4:
# %bb.2:
	leaq	104(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB0_4
# %bb.3:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB0_4:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movq	72(%rsp), %rbx
	subq	64(%rsp), %rbx
.Ltmp6:
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$13, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp7:
# %bb.5:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp8:
	movq	%rbx, %r14
	shrq	$3, %r14
	movl	$_ZSt4cout, %edi
	movl	%r14d, %esi
	callq	_ZNSolsEi
.Ltmp9:
# %bb.6:
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
.Ltmp10:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp11:
# %bb.7:                                # %.noexc69
.Ltmp12:
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
.Ltmp13:
# %bb.8:                                # %.noexc70
.Ltmp14:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp15:
# %bb.9:                                # %_ZNSolsEPFRSoS_E.exit
	movslq	%r14d, %rsi
.Ltmp16:
	leaq	32(%rsp), %rdi
	callq	_ZNSt6vectorImSaImEE6resizeEm
.Ltmp17:
# %bb.10:
	shlq	$29, %rbx
	sarq	$29, %rbx
.Ltmp18:
	leaq	24(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
.Ltmp19:
# %bb.11:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB0_12
# %bb.23:
.Ltmp35:
	leaq	16(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
.Ltmp36:
# %bb.24:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB0_25
# %bb.33:
	movq	16(%rsp), %rdi
.Ltmp52:
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	hipMemset
.Ltmp53:
# %bb.34:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB0_35
# %bb.43:
	movq	24(%rsp), %rdi
	movq	64(%rsp), %rsi
.Ltmp69:
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp70:
# %bb.44:
	movl	%eax, %ebp
	testl	%eax, %eax
	jne	.LBB0_45
# %bb.53:
.Ltmp86:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.8, %esi
	movl	$19, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp87:
# %bb.54:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit54
	movq	24(%rsp), %rdi
	movq	16(%rsp), %rsi
.Ltmp88:
	movl	%r14d, %edx
	callq	_Z7scannerIm5AdderEvPT_S2_iT0_
.Ltmp89:
# %bb.55:
	movq	32(%rsp), %rdi
	movq	16(%rsp), %rsi
.Ltmp90:
	movq	%rbx, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp91:
# %bb.56:
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	.LBB0_57
# %bb.65:
	cmpl	$99, %r14d
	jg	.LBB0_71
# %bb.66:
	movq	32(%rsp), %rbx
	movq	40(%rsp), %r15
	movq	$_ZSt4cout, 88(%rsp)
	movq	$.L.str.4, 96(%rsp)
	subq	%rbx, %r15
	sarq	$3, %r15
	testq	%r15, %r15
	jle	.LBB0_74
# %bb.67:                               # %.lr.ph.i.i.i.i.i.preheader
	incq	%r15
	leaq	88(%rsp), %r14
.LBB0_68:                               # %.lr.ph.i.i.i.i.i
                                        # =>This Inner Loop Header: Depth=1
.Ltmp113:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ZNSt16ostream_iteratorImcSt11char_traitsIcEEaSERKm
.Ltmp114:
# %bb.69:                               # %.noexc
                                        #   in Loop: Header=BB0_68 Depth=1
	addq	$8, %rbx
	decq	%r15
	cmpq	$1, %r15
	ja	.LBB0_68
	jmp	.LBB0_74
.LBB0_71:
.Ltmp107:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.10, %esi
	movl	$14, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp108:
# %bb.72:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit59
	movq	40(%rsp), %rax
	movq	-8(%rax), %rsi
.Ltmp109:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertImEERSoT_
.Ltmp110:
# %bb.73:                               # %_ZNSolsEm.exit
.Ltmp111:
	movl	$.L.str.4, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp112:
.LBB0_74:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit62
	movq	24(%rsp), %rdi
.Ltmp116:
	callq	hipFree
.Ltmp117:
# %bb.75:
	movq	16(%rsp), %rdi
.Ltmp118:
	callq	hipFree
.Ltmp119:
# %bb.76:
	movq	64(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB0_78
# %bb.77:
	callq	_ZdlPv
.LBB0_78:                               # %_ZNSt6vectorImSaImEED2Ev.exit
	movq	32(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB0_80
# %bb.79:
	callq	_ZdlPv
.LBB0_80:                               # %_ZNSt6vectorImSaImEED2Ev.exit64
	xorl	%eax, %eax
	addq	$120, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB0_12:
	.cfi_def_cfa_offset 160
.Ltmp20:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.1, %esi
	movl	$81, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp21:
# %bb.13:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit39
.Ltmp22:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.2, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp23:
# %bb.14:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit40
.Ltmp24:
	movl	$_ZSt4cerr, %edi
	movl	$192, %esi
	callq	_ZNSolsEi
.Ltmp25:
# %bb.15:
.Ltmp26:
	movq	%rax, %rbx
	movl	$.L.str.3, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp27:
# %bb.16:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit41
.Ltmp28:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp29:
# %bb.17:
.Ltmp30:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp31:
# %bb.18:
.Ltmp32:
	movl	$.L.str.4, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp33:
	jmp	.LBB0_19
.LBB0_25:
.Ltmp37:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.5, %esi
	movl	$82, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp38:
# %bb.26:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit45
.Ltmp39:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.2, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp40:
# %bb.27:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit46
.Ltmp41:
	movl	$_ZSt4cerr, %edi
	movl	$194, %esi
	callq	_ZNSolsEi
.Ltmp42:
# %bb.28:
.Ltmp43:
	movq	%rax, %rbx
	movl	$.L.str.3, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp44:
# %bb.29:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit47
.Ltmp45:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp46:
# %bb.30:
.Ltmp47:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp48:
# %bb.31:
.Ltmp49:
	movl	$.L.str.4, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp50:
	jmp	.LBB0_19
.LBB0_35:
.Ltmp54:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.6, %esi
	movl	$76, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp55:
# %bb.36:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit48
.Ltmp56:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.2, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp57:
# %bb.37:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit49
.Ltmp58:
	movl	$_ZSt4cerr, %edi
	movl	$196, %esi
	callq	_ZNSolsEi
.Ltmp59:
# %bb.38:
.Ltmp60:
	movq	%rax, %rbx
	movl	$.L.str.3, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp61:
# %bb.39:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit50
.Ltmp62:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp63:
# %bb.40:
.Ltmp64:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp65:
# %bb.41:
.Ltmp66:
	movl	$.L.str.4, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp67:
	jmp	.LBB0_19
.LBB0_45:
.Ltmp71:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.7, %esi
	movl	$112, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp72:
# %bb.46:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit51
.Ltmp73:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.2, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp74:
# %bb.47:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit52
.Ltmp75:
	movl	$_ZSt4cerr, %edi
	movl	$199, %esi
	callq	_ZNSolsEi
.Ltmp76:
# %bb.48:
.Ltmp77:
	movq	%rax, %rbx
	movl	$.L.str.3, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp78:
# %bb.49:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit53
.Ltmp79:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp80:
# %bb.50:
.Ltmp81:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp82:
# %bb.51:
.Ltmp83:
	movl	$.L.str.4, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp84:
	jmp	.LBB0_19
.LBB0_57:
.Ltmp92:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.9, %esi
	movl	$114, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp93:
# %bb.58:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit55
.Ltmp94:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.2, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp95:
# %bb.59:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit56
.Ltmp96:
	movl	$_ZSt4cerr, %edi
	movl	$205, %esi
	callq	_ZNSolsEi
.Ltmp97:
# %bb.60:
.Ltmp98:
	movq	%rax, %r14
	movl	$.L.str.3, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp99:
# %bb.61:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit57
.Ltmp100:
	movl	%ebx, %edi
	callq	hipGetErrorString
.Ltmp101:
# %bb.62:
.Ltmp102:
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp103:
# %bb.63:
.Ltmp104:
	movl	$.L.str.4, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp105:
.LBB0_19:
	movl	$-1, %edi
	callq	exit
.LBB0_21:
.Ltmp5:
	movq	%rax, %rbx
	leaq	104(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	jne	.LBB0_83
	jmp	.LBB0_84
.LBB0_20:
.Ltmp2:
	movq	%rax, %rbx
	jmp	.LBB0_84
.LBB0_64:
.Ltmp106:
	jmp	.LBB0_82
.LBB0_52:
.Ltmp85:
	jmp	.LBB0_82
.LBB0_42:
.Ltmp68:
	jmp	.LBB0_82
.LBB0_32:
.Ltmp51:
	jmp	.LBB0_82
.LBB0_22:
.Ltmp34:
	jmp	.LBB0_82
.LBB0_70:
.Ltmp115:
	jmp	.LBB0_82
.LBB0_81:
.Ltmp120:
.LBB0_82:
	movq	%rax, %rbx
	movq	64(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB0_84
.LBB0_83:
	callq	_ZdlPv
.LBB0_84:                               # %_ZNSt6vectorImSaImEED2Ev.exit66
	movq	32(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB0_86
# %bb.85:
	callq	_ZdlPv
.LBB0_86:                               # %_ZNSt6vectorImSaImEED2Ev.exit68
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end0:
	.size	main, .Lfunc_end0-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table0:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 1 <<
	.uleb128 .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 2 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp17-.Ltmp6                 #   Call between .Ltmp6 and .Ltmp17
	.uleb128 .Ltmp120-.Lfunc_begin0         #     jumps to .Ltmp120
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp18-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp19-.Ltmp18                #   Call between .Ltmp18 and .Ltmp19
	.uleb128 .Ltmp34-.Lfunc_begin0          #     jumps to .Ltmp34
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp35-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp36-.Ltmp35                #   Call between .Ltmp35 and .Ltmp36
	.uleb128 .Ltmp51-.Lfunc_begin0          #     jumps to .Ltmp51
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp52-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp53-.Ltmp52                #   Call between .Ltmp52 and .Ltmp53
	.uleb128 .Ltmp68-.Lfunc_begin0          #     jumps to .Ltmp68
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp69-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp70-.Ltmp69                #   Call between .Ltmp69 and .Ltmp70
	.uleb128 .Ltmp85-.Lfunc_begin0          #     jumps to .Ltmp85
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp86-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp89-.Ltmp86                #   Call between .Ltmp86 and .Ltmp89
	.uleb128 .Ltmp120-.Lfunc_begin0         #     jumps to .Ltmp120
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp90-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp91-.Ltmp90                #   Call between .Ltmp90 and .Ltmp91
	.uleb128 .Ltmp106-.Lfunc_begin0         #     jumps to .Ltmp106
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp113-.Lfunc_begin0         # >> Call Site 10 <<
	.uleb128 .Ltmp114-.Ltmp113              #   Call between .Ltmp113 and .Ltmp114
	.uleb128 .Ltmp115-.Lfunc_begin0         #     jumps to .Ltmp115
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp107-.Lfunc_begin0         # >> Call Site 11 <<
	.uleb128 .Ltmp119-.Ltmp107              #   Call between .Ltmp107 and .Ltmp119
	.uleb128 .Ltmp120-.Lfunc_begin0         #     jumps to .Ltmp120
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp20-.Lfunc_begin0          # >> Call Site 12 <<
	.uleb128 .Ltmp33-.Ltmp20                #   Call between .Ltmp20 and .Ltmp33
	.uleb128 .Ltmp34-.Lfunc_begin0          #     jumps to .Ltmp34
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp37-.Lfunc_begin0          # >> Call Site 13 <<
	.uleb128 .Ltmp50-.Ltmp37                #   Call between .Ltmp37 and .Ltmp50
	.uleb128 .Ltmp51-.Lfunc_begin0          #     jumps to .Ltmp51
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp54-.Lfunc_begin0          # >> Call Site 14 <<
	.uleb128 .Ltmp67-.Ltmp54                #   Call between .Ltmp54 and .Ltmp67
	.uleb128 .Ltmp68-.Lfunc_begin0          #     jumps to .Ltmp68
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp71-.Lfunc_begin0          # >> Call Site 15 <<
	.uleb128 .Ltmp84-.Ltmp71                #   Call between .Ltmp71 and .Ltmp84
	.uleb128 .Ltmp85-.Lfunc_begin0          #     jumps to .Ltmp85
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp92-.Lfunc_begin0          # >> Call Site 16 <<
	.uleb128 .Ltmp105-.Ltmp92               #   Call between .Ltmp92 and .Ltmp105
	.uleb128 .Ltmp106-.Lfunc_begin0         #     jumps to .Ltmp106
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp105-.Lfunc_begin0         # >> Call Site 17 <<
	.uleb128 .Lfunc_end0-.Ltmp105           #   Call between .Ltmp105 and .Lfunc_end0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._Z12importVectorImESt6vectorIT_SaIS1_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE,"axG",@progbits,_Z12importVectorImESt6vectorIT_SaIS1_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE,comdat
	.weak	_Z12importVectorImESt6vectorIT_SaIS1_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE # -- Begin function _Z12importVectorImESt6vectorIT_SaIS1_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.type	_Z12importVectorImESt6vectorIT_SaIS1_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE,@function
_Z12importVectorImESt6vectorIT_SaIS1_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: # @_Z12importVectorImESt6vectorIT_SaIS1_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$544, %rsp                      # imm = 0x220
	.cfi_def_cfa_offset 576
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movq	(%rsi), %rsi
	leaq	24(%rsp), %r14
	movq	%r14, %rdi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
	movq	(%r14), %rax
	movq	-24(%rax), %rax
	testb	$5, 56(%rsp,%rax)
	je	.LBB1_3
# %bb.1:
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
	movq	$0, 16(%rbx)
.LBB1_2:
	leaq	24(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rax
	addq	$544, %rsp                      # imm = 0x220
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB1_3:
	.cfi_def_cfa_offset 576
	movq	%rsp, %rdi
	movq	%r14, (%rdi)
	movb	$1, 16(%rdi)
.Ltmp121:
	callq	_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv
.Ltmp122:
# %bb.4:                                # %_ZNSt16istream_iteratorImcSt11char_traitsIcElEC2ERSi.exit
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
	movq	$0, 16(%rbx)
	leaq	8(%rsp), %r14
	movq	%rsp, %r15
.LBB1_5:                                # %_ZNSt16istream_iteratorImcSt11char_traitsIcElEppEv.exit
                                        # =>This Inner Loop Header: Depth=1
	cmpb	$0, 16(%rsp)
	je	.LBB1_2
# %bb.6:                                #   in Loop: Header=BB1_5 Depth=1
	movq	8(%rbx), %rsi
	cmpq	16(%rbx), %rsi
	je	.LBB1_8
# %bb.7:                                #   in Loop: Header=BB1_5 Depth=1
	movq	8(%rsp), %rax
	movq	%rax, (%rsi)
	addq	$8, %rsi
	movq	%rsi, 8(%rbx)
	jmp	.LBB1_9
.LBB1_8:                                #   in Loop: Header=BB1_5 Depth=1
.Ltmp124:
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_ZNSt6vectorImSaImEE17_M_realloc_insertIJRKmEEEvN9__gnu_cxx17__normal_iteratorIPmS1_EEDpOT_
.Ltmp125:
.LBB1_9:                                # %_ZNSt6vectorImSaImEE9push_backERKm.exit
                                        #   in Loop: Header=BB1_5 Depth=1
.Ltmp126:
	movq	%r15, %rdi
	callq	_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv
.Ltmp127:
	jmp	.LBB1_5
.LBB1_12:
.Ltmp123:
	movq	%rax, %r14
	jmp	.LBB1_13
.LBB1_10:
.Ltmp128:
	movq	%rax, %r14
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.LBB1_13
# %bb.11:
	callq	_ZdlPv
.LBB1_13:                               # %_ZNSt6vectorImSaImEED2Ev.exit
	leaq	24(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end1:
	.size	_Z12importVectorImESt6vectorIT_SaIS1_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, .Lfunc_end1-_Z12importVectorImESt6vectorIT_SaIS1_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.cfi_endproc
	.section	.gcc_except_table._Z12importVectorImESt6vectorIT_SaIS1_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE,"aG",@progbits,_Z12importVectorImESt6vectorIT_SaIS1_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE,comdat
	.p2align	2, 0x0
GCC_except_table1:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp121-.Lfunc_begin1         #   Call between .Lfunc_begin1 and .Ltmp121
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp121-.Lfunc_begin1         # >> Call Site 2 <<
	.uleb128 .Ltmp122-.Ltmp121              #   Call between .Ltmp121 and .Ltmp122
	.uleb128 .Ltmp123-.Lfunc_begin1         #     jumps to .Ltmp123
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp124-.Lfunc_begin1         # >> Call Site 3 <<
	.uleb128 .Ltmp127-.Ltmp124              #   Call between .Ltmp124 and .Ltmp127
	.uleb128 .Ltmp128-.Lfunc_begin1         #     jumps to .Ltmp128
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp127-.Lfunc_begin1         # >> Call Site 4 <<
	.uleb128 .Lfunc_end1-.Ltmp127           #   Call between .Ltmp127 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.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	.LBB2_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
.LBB2_1:
	.cfi_def_cfa_offset 32
	movl	$.L.str.12, %edi
	callq	_ZSt19__throw_logic_errorPKc
.Lfunc_end2:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .Lfunc_end2-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorImSaImEE6resizeEm,"axG",@progbits,_ZNSt6vectorImSaImEE6resizeEm,comdat
	.weak	_ZNSt6vectorImSaImEE6resizeEm   # -- Begin function _ZNSt6vectorImSaImEE6resizeEm
	.p2align	1, 0x90
	.type	_ZNSt6vectorImSaImEE6resizeEm,@function
_ZNSt6vectorImSaImEE6resizeEm:          # @_ZNSt6vectorImSaImEE6resizeEm
	.cfi_startproc
# %bb.0:
	movq	(%rdi), %rdx
	movq	8(%rdi), %rcx
	movq	%rcx, %r8
	subq	%rdx, %r8
	sarq	$3, %r8
	movq	%rsi, %rax
	subq	%r8, %rax
	jbe	.LBB3_1
# %bb.5:
	movq	%rax, %rsi
	jmp	_ZNSt6vectorImSaImEE17_M_default_appendEm # TAILCALL
.LBB3_1:
	jae	.LBB3_4
# %bb.2:
	leaq	(%rdx,%rsi,8), %rax
	cmpq	%rax, %rcx
	je	.LBB3_4
# %bb.3:
	movq	%rax, 8(%rdi)
.LBB3_4:                                # %_ZNSt6vectorImSaImEE15_M_erase_at_endEPm.exit
	retq
.Lfunc_end3:
	.size	_ZNSt6vectorImSaImEE6resizeEm, .Lfunc_end3-_ZNSt6vectorImSaImEE6resizeEm
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z7scannerIm5AdderEvPT_S2_iT0_
.LCPI4_0:
	.quad	0x3f90000000000000              # double 0.015625
.LCPI4_1:
	.quad	0x3f50000000000000              # double 9.765625E-4
	.section	.text._Z7scannerIm5AdderEvPT_S2_iT0_,"axG",@progbits,_Z7scannerIm5AdderEvPT_S2_iT0_,comdat
	.weak	_Z7scannerIm5AdderEvPT_S2_iT0_
	.type	_Z7scannerIm5AdderEvPT_S2_iT0_,@function
_Z7scannerIm5AdderEvPT_S2_iT0_:         # @_Z7scannerIm5AdderEvPT_S2_iT0_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%edx, %r14d
	movq	%rsi, 40(%rsp)                  # 8-byte Spill
	movq	%rdi, 72(%rsp)                  # 8-byte Spill
	cvtsi2sd	%edx, %xmm0
	mulsd	.LCPI4_0(%rip), %xmm0
	callq	ceil@PLT
	movapd	%xmm0, 48(%rsp)                 # 16-byte Spill
	cvttsd2si	%xmm0, %r13d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.14, %esi
	movl	$20, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%r13d, %esi
	callq	_ZNSolsEi
	movl	$.L.str.4, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	cvttpd2dq	48(%rsp), %xmm0         # 16-byte Folded Reload
	cvtdq2pd	%xmm0, %xmm0
	mulsd	.LCPI4_1(%rip), %xmm0
	callq	ceil@PLT
	cvttsd2si	%xmm0, %ecx
	leal	1023(%r13), %eax
	testl	%r13d, %r13d
	cmovnsl	%r13d, %eax
	movq	%rcx, 32(%rsp)                  # 8-byte Spill
	testl	%ecx, %ecx
	jle	.LBB4_25
# %bb.1:                                # %.lr.ph100
	andl	$-1024, %eax                    # imm = 0xFC00
	movl	%r13d, %ecx
	subl	%eax, %ecx
	movl	%ecx, 28(%rsp)                  # 4-byte Spill
	movabsq	$4294967328, %rcx               # imm = 0x100000020
	movslq	%r13d, %rax
	shlq	$3, %rax
	movq	%rax, 48(%rsp)                  # 8-byte Spill
	movq	32(%rsp), %rax                  # 8-byte Reload
	decl	%eax
	movl	%eax, 24(%rsp)                  # 4-byte Spill
	movl	%r13d, %r12d
	xorl	%ebp, %ebp
	leaq	-30(%rcx), %r15
	movl	%r14d, 4(%rsp)                  # 4-byte Spill
	movq	%r13, 80(%rsp)                  # 8-byte Spill
.LBB4_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_14 Depth 2
	leaq	16(%rsp), %rdi
	movq	48(%rsp), %rsi                  # 8-byte Reload
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB4_3
# %bb.5:                                #   in Loop: Header=BB4_2 Depth=1
	cmpl	24(%rsp), %ebp                  # 4-byte Folded Reload
	movl	%r13d, %eax
	cmovel	28(%rsp), %eax                  # 4-byte Folded Reload
	movabsq	$4294967328, %rdx               # imm = 0x100000020
	leaq	(%rdx,%rax), %rdi
	addq	$-32, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_7
# %bb.6:                                #   in Loop: Header=BB4_2 Depth=1
	movq	16(%rsp), %rcx
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movq	40(%rsp), %rsi                  # 8-byte Reload
	movl	%r14d, %edx
	callq	_Z19__device_stub__scanIm5AdderEvPT_S2_iS2_T0_
.LBB4_7:                                #   in Loop: Header=BB4_2 Depth=1
	callq	hipGetLastError
	testl	%eax, %eax
	jne	.LBB4_8
# %bb.9:                                #   in Loop: Header=BB4_2 Depth=1
	callq	hipDeviceSynchronize
	cmpl	$65, %r14d
	jl	.LBB4_22
# %bb.10:                               #   in Loop: Header=BB4_2 Depth=1
	leaq	8(%rsp), %rdi
	movq	48(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rsi
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB4_11
# %bb.12:                               #   in Loop: Header=BB4_2 Depth=1
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	hipMemset
	movq	16(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	%r13d, %edx
	callq	_Z7scannerIm5AdderEvPT_S2_iT0_
	cmpl	$2, %r13d
	jl	.LBB4_19
# %bb.13:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB4_2 Depth=1
	movl	$1, %r14d
	movl	4(%rsp), %r13d                  # 4-byte Reload
.LBB4_14:                               # %.lr.ph
                                        #   Parent Loop BB4_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	addl	$-64, %r13d
	movq	%r15, %rdi
	movl	$1, %esi
	movabsq	$4294967328, %rdx               # imm = 0x100000020
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_16
# %bb.15:                               #   in Loop: Header=BB4_14 Depth=2
	movl	%r14d, %eax
	shll	$6, %eax
	movq	40(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,8), %rdi
	cmpl	$64, %r13d
	movl	$64, %esi
	cmovll	%r13d, %esi
	movq	8(%rsp), %rax
	leaq	(%rax,%r14,8), %rdx
	addq	$-8, %rdx
	callq	_Z20__device_stub__applyIm5AdderEvPT_iT0_PKS1_
.LBB4_16:                               #   in Loop: Header=BB4_14 Depth=2
	callq	hipGetLastError
	testl	%eax, %eax
	jne	.LBB4_17
# %bb.18:                               #   in Loop: Header=BB4_14 Depth=2
	callq	hipDeviceSynchronize
	incq	%r14
	cmpq	%r12, %r14
	jne	.LBB4_14
.LBB4_19:                               # %._crit_edge
                                        #   in Loop: Header=BB4_2 Depth=1
	movq	8(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB4_20
# %bb.21:                               #   in Loop: Header=BB4_2 Depth=1
	movl	4(%rsp), %r14d                  # 4-byte Reload
	movq	80(%rsp), %r13                  # 8-byte Reload
.LBB4_22:                               #   in Loop: Header=BB4_2 Depth=1
	movq	16(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB4_23
# %bb.24:                               #   in Loop: Header=BB4_2 Depth=1
	incl	%ebp
	cmpl	32(%rsp), %ebp                  # 4-byte Folded Reload
	jne	.LBB4_2
.LBB4_25:                               # %._crit_edge101
	addq	$88, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB4_17:
	.cfi_def_cfa_offset 144
	movl	%eax, %ebx
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.16, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	movl	$149, %esi
.LBB4_4:
	callq	_ZNSolsEi
	movl	$.L.str.3, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %r14
	movl	%ebx, %edi
	callq	hipGetErrorString
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.4, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$-1, %edi
	callq	exit
.LBB4_23:
	movl	%eax, %ebx
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.19, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	movl	$155, %esi
	jmp	.LBB4_4
.LBB4_8:
	movl	%eax, %ebx
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.16, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	movl	$101, %esi
	jmp	.LBB4_4
.LBB4_3:
	movl	%eax, %ebx
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.15, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	movl	$97, %esi
	jmp	.LBB4_4
.LBB4_20:
	movl	%eax, %ebx
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.18, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	movl	$153, %esi
	jmp	.LBB4_4
.LBB4_11:
	movl	%eax, %ebx
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.17, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	movl	$128, %esi
	jmp	.LBB4_4
.Lfunc_end4:
	.size	_Z7scannerIm5AdderEvPT_S2_iT0_, .Lfunc_end4-_Z7scannerIm5AdderEvPT_S2_iT0_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv,"axG",@progbits,_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv,comdat
	.weak	_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv # -- Begin function _ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv
	.p2align	1, 0x90
	.type	_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv,@function
_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv: # @_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	.LBB5_3
# %bb.1:
	leaq	8(%rbx), %rsi
	callq	_ZNSi10_M_extractImEERSiRT_
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	je	.LBB5_3
# %bb.2:
	movq	$0, (%rbx)
	movb	$0, 16(%rbx)
.LBB5_3:
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv, .Lfunc_end5-_ZNSt16istream_iteratorImcSt11char_traitsIcElE7_M_readEv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorImSaImEE17_M_realloc_insertIJRKmEEEvN9__gnu_cxx17__normal_iteratorIPmS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorImSaImEE17_M_realloc_insertIJRKmEEEvN9__gnu_cxx17__normal_iteratorIPmS1_EEDpOT_,comdat
	.weak	_ZNSt6vectorImSaImEE17_M_realloc_insertIJRKmEEEvN9__gnu_cxx17__normal_iteratorIPmS1_EEDpOT_ # -- Begin function _ZNSt6vectorImSaImEE17_M_realloc_insertIJRKmEEEvN9__gnu_cxx17__normal_iteratorIPmS1_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorImSaImEE17_M_realloc_insertIJRKmEEEvN9__gnu_cxx17__normal_iteratorIPmS1_EEDpOT_,@function
_ZNSt6vectorImSaImEE17_M_realloc_insertIJRKmEEEvN9__gnu_cxx17__normal_iteratorIPmS1_EEDpOT_: # @_ZNSt6vectorImSaImEE17_M_realloc_insertIJRKmEEEvN9__gnu_cxx17__normal_iteratorIPmS1_EEDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, (%rsp)                    # 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	$1, %esi
	movl	$.L.str.11, %edx
	callq	_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc
	movq	(%rbx), %r13
	movq	8(%rbx), %r15
	movq	%r12, 8(%rsp)                   # 8-byte Spill
	subq	%r13, %r12
	movq	%r12, %r14
	sarq	$3, %r14
	testq	%rax, %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	je	.LBB6_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorImE8allocateEmPKv
	movq	%rax, %rbp
	jmp	.LBB6_3
.LBB6_1:
	xorl	%ebp, %ebp
.LBB6_3:                                # %_ZNSt12_Vector_baseImSaImEE11_M_allocateEm.exit
	movq	(%rsp), %rax                    # 8-byte Reload
	movq	(%rax), %rax
	movq	%rax, (%rbp,%r14,8)
	testq	%r12, %r12
	jle	.LBB6_5
# %bb.4:
	movq	%rbp, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	memmove@PLT
.LBB6_5:                                # %_ZNSt6vectorImSaImEE11_S_relocateEPmS2_S2_RS0_.exit
	addq	%rbp, %r12
	addq	$8, %r12
	movq	8(%rsp), %rsi                   # 8-byte Reload
	subq	%rsi, %r15
	testq	%r15, %r15
	jle	.LBB6_7
# %bb.6:
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB6_7:                                # %_ZNSt6vectorImSaImEE11_S_relocateEPmS2_S2_RS0_.exit16
	testq	%r13, %r13
	je	.LBB6_9
# %bb.8:
	movq	%r13, %rdi
	callq	_ZdlPv
.LBB6_9:                                # %_ZNSt12_Vector_baseImSaImEE13_M_deallocateEPmm.exit
	addq	%r15, %r12
	movq	%rbp, (%rbx)
	movq	%r12, 8(%rbx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(,%rax,8), %rax
	addq	%rbp, %rax
	movq	%rax, 16(%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_ZNSt6vectorImSaImEE17_M_realloc_insertIJRKmEEEvN9__gnu_cxx17__normal_iteratorIPmS1_EEDpOT_, .Lfunc_end6-_ZNSt6vectorImSaImEE17_M_realloc_insertIJRKmEEEvN9__gnu_cxx17__normal_iteratorIPmS1_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorImSaImEE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorImSaImEE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc,@function
_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc: # @_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$1152921504606846975, %rcx      # imm = 0xFFFFFFFFFFFFFFF
	movq	8(%rdi), %r8
	subq	(%rdi), %r8
	sarq	$3, %r8
	movq	%rcx, %rax
	subq	%r8, %rax
	cmpq	%rsi, %rax
	jb	.LBB7_2
# %bb.1:
	cmpq	%rsi, %r8
	cmovaq	%r8, %rsi
	leaq	(%rsi,%r8), %rax
	cmpq	%rcx, %rax
	cmovaeq	%rcx, %rax
	addq	%r8, %rsi
	cmovbq	%rcx, %rax
	retq
.LBB7_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end7:
	.size	_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc, .Lfunc_end7-_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorImE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorImE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorImE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorImE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorImE8allocateEmPKv,@function
_ZNSt15__new_allocatorImE8allocateEmPKv: # @_ZNSt15__new_allocatorImE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB8_1
# %bb.3:
	shlq	$3, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB8_1:
	.cfi_def_cfa_offset 16
	shrq	$61, %rsi
	je	.LBB8_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB8_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end8:
	.size	_ZNSt15__new_allocatorImE8allocateEmPKv, .Lfunc_end8-_ZNSt15__new_allocatorImE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	subq	%rsi, %r14
	movq	%r14, (%rsp)
	cmpq	$15, %r14
	jbe	.LBB9_1
# %bb.2:
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, (%rbx)
	movq	(%r12), %rcx
	movq	%rcx, 16(%rbx)
	jmp	.LBB9_3
.LBB9_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB9_3:
	testq	%r14, %r14
	je	.LBB9_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB9_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB9_7
.LBB9_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB9_7:                                # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end9-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorImSaImEE17_M_default_appendEm,"axG",@progbits,_ZNSt6vectorImSaImEE17_M_default_appendEm,comdat
	.weak	_ZNSt6vectorImSaImEE17_M_default_appendEm # -- Begin function _ZNSt6vectorImSaImEE17_M_default_appendEm
	.p2align	1, 0x90
	.type	_ZNSt6vectorImSaImEE17_M_default_appendEm,@function
_ZNSt6vectorImSaImEE17_M_default_appendEm: # @_ZNSt6vectorImSaImEE17_M_default_appendEm
	.cfi_startproc
# %bb.0:
	testq	%rsi, %rsi
	je	.LBB10_16
# %bb.1:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	8(%rdi), %r15
	movq	16(%rdi), %rax
	subq	%r15, %rax
	sarq	$3, %rax
	cmpq	%rsi, %rax
	jae	.LBB10_2
# %bb.5:
	movq	(%rbx), %r12
	subq	%r12, %r15
	movq	%r15, %r13
	sarq	$3, %r13
	movl	$.L.str.13, %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ZNKSt6vectorImSaImEE12_M_check_lenEmPKc
	testq	%rax, %rax
	movq	%rax, (%rsp)                    # 8-byte Spill
	je	.LBB10_6
# %bb.7:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorImE8allocateEmPKv
	movq	%rax, %rbp
	jmp	.LBB10_8
.LBB10_2:
	movq	$0, (%r15)
	leaq	8(%r15), %rdi
	cmpq	$1, %r14
	je	.LBB10_4
# %bb.3:                                # %_ZSt6fill_nIPmmmET_S1_T0_RKT1_.exit.loopexit.i.i.i
	leaq	-8(,%r14,8), %rdx
	xorl	%esi, %esi
	callq	memset@PLT
	leaq	(%r15,%r14,8), %rdi
.LBB10_4:                               # %_ZSt27__uninitialized_default_n_aIPmmmET_S1_T0_RSaIT1_E.exit
	movq	%rdi, 8(%rbx)
	jmp	.LBB10_15
.LBB10_6:
	xorl	%ebp, %ebp
.LBB10_8:
	leaq	(,%r13,8), %r13
	addq	%rbp, %r13
	movq	$0, (%r13)
	cmpq	$1, %r14
	je	.LBB10_10
# %bb.9:                                # %_ZSt6fill_nIPmmmET_S1_T0_RKT1_.exit.loopexit.i.i.i30
	leaq	8(%r13), %rdi
	leaq	-8(,%r14,8), %rdx
	xorl	%esi, %esi
	callq	memset@PLT
.LBB10_10:                              # %_ZSt27__uninitialized_default_n_aIPmmmET_S1_T0_RSaIT1_E.exit32
	testq	%r15, %r15
	jle	.LBB10_12
# %bb.11:
	movq	%rbp, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB10_12:                              # %_ZNSt6vectorImSaImEE11_S_relocateEPmS2_S2_RS0_.exit
	testq	%r12, %r12
	je	.LBB10_14
# %bb.13:
	movq	%r12, %rdi
	callq	_ZdlPv
.LBB10_14:                              # %_ZNSt12_Vector_baseImSaImEE13_M_deallocateEPmm.exit35
	movq	%rbp, (%rbx)
	leaq	(,%r14,8), %rax
	addq	%r13, %rax
	movq	%rax, 8(%rbx)
	movq	(%rsp), %rax                    # 8-byte Reload
	leaq	(,%rax,8), %rax
	addq	%rbp, %rax
	movq	%rax, 16(%rbx)
.LBB10_15:
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB10_16:
	retq
.Lfunc_end10:
	.size	_ZNSt6vectorImSaImEE17_M_default_appendEm, .Lfunc_end10-_ZNSt6vectorImSaImEE17_M_default_appendEm
	.cfi_endproc
                                        # -- End function
	.section	.text._Z19__device_stub__scanIm5AdderEvPT_S2_iS2_T0_,"axG",@progbits,_Z19__device_stub__scanIm5AdderEvPT_S2_iS2_T0_,comdat
	.weak	_Z19__device_stub__scanIm5AdderEvPT_S2_iS2_T0_ # -- Begin function _Z19__device_stub__scanIm5AdderEvPT_S2_iS2_T0_
	.type	_Z19__device_stub__scanIm5AdderEvPT_S2_iS2_T0_,@function
_Z19__device_stub__scanIm5AdderEvPT_S2_iS2_T0_: # @_Z19__device_stub__scanIm5AdderEvPT_S2_iS2_T0_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	4(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	24(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	3(%rsp), %rax
	movq	%rax, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%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	$_Z4scanIm5AdderEvPT_S2_iS2_T0_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end11:
	.size	_Z19__device_stub__scanIm5AdderEvPT_S2_iS2_T0_, .Lfunc_end11-_Z19__device_stub__scanIm5AdderEvPT_S2_iS2_T0_
	.cfi_endproc
                                        # -- End function
	.section	.text._Z20__device_stub__applyIm5AdderEvPT_iT0_PKS1_,"axG",@progbits,_Z20__device_stub__applyIm5AdderEvPT_iT0_PKS1_,comdat
	.weak	_Z20__device_stub__applyIm5AdderEvPT_iT0_PKS1_ # -- Begin function _Z20__device_stub__applyIm5AdderEvPT_iT0_PKS1_
	.type	_Z20__device_stub__applyIm5AdderEvPT_iT0_PKS1_,@function
_Z20__device_stub__applyIm5AdderEvPT_iT0_PKS1_: # @_Z20__device_stub__applyIm5AdderEvPT_iT0_PKS1_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	12(%rsp), %rcx
	movl	%esi, (%rcx)
	leaq	32(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	11(%rsp), %rax
	movq	%rax, 16(%rbx)
	movq	%rsi, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%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	$_Z5applyIm5AdderEvPT_iT0_PKS1_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end12:
	.size	_Z20__device_stub__applyIm5AdderEvPT_iT0_PKS1_, .Lfunc_end12-_Z20__device_stub__applyIm5AdderEvPT_iT0_PKS1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt16ostream_iteratorImcSt11char_traitsIcEEaSERKm,"axG",@progbits,_ZNSt16ostream_iteratorImcSt11char_traitsIcEEaSERKm,comdat
	.weak	_ZNSt16ostream_iteratorImcSt11char_traitsIcEEaSERKm # -- Begin function _ZNSt16ostream_iteratorImcSt11char_traitsIcEEaSERKm
	.p2align	1, 0x90
	.type	_ZNSt16ostream_iteratorImcSt11char_traitsIcEEaSERKm,@function
_ZNSt16ostream_iteratorImcSt11char_traitsIcEEaSERKm: # @_ZNSt16ostream_iteratorImcSt11char_traitsIcEEaSERKm
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	movq	(%rsi), %rsi
	callq	_ZNSo9_M_insertImEERSoT_
	movq	8(%rbx), %r14
	testq	%r14, %r14
	je	.LBB13_2
# %bb.1:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movq	(%rbx), %r15
	movq	%r14, %rdi
	callq	strlen
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.LBB13_2:
	movq	%rbx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end13:
	.size	_ZNSt16ostream_iteratorImcSt11char_traitsIcEEaSERKm, .Lfunc_end13-_ZNSt16ostream_iteratorImcSt11char_traitsIcEEaSERKm
	.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	.LBB14_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB14_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z4scanIm5AdderEvPT_S2_iS2_T0_, %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	$_Z5applyIm5AdderEvPT_iT0_PKS1_, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end14:
	.size	__hip_module_ctor, .Lfunc_end14-__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	.LBB15_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
.LBB15_2:
	retq
.Lfunc_end15:
	.size	__hip_module_dtor, .Lfunc_end15-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"numElements: "
	.size	.L.str, 14

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Failed to run stmt hipMalloc((void**)&deviceInput , numElements*sizeof(uint64_t))"
	.size	.L.str.1, 82

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	" on line "
	.size	.L.str.2, 10

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

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

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Failed to run stmt hipMalloc((void**)&deviceOutput , numElements*sizeof(uint64_t))"
	.size	.L.str.5, 83

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Failed to run stmt hipMemset(deviceOutput, 0 , numElements*sizeof(uint64_t))"
	.size	.L.str.6, 77

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Failed to run stmt hipMemcpy(deviceInput, &(hostInput[0]) , numElements*sizeof(uint64_t), hipMemcpyHostToDevice)"
	.size	.L.str.7, 113

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Launching scanner.\n"
	.size	.L.str.8, 20

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Failed to run stmt hipMemcpy(&(hostOutput[0]), deviceOutput , numElements*sizeof(uint64_t), hipMemcpyDeviceToHost)"
	.size	.L.str.9, 115

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"Last element: "
	.size	.L.str.10, 15

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

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

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"vector::_M_default_append"
	.size	.L.str.13, 26

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"scanner: numBlocks: "
	.size	.L.str.14, 21

	.type	.L.str.15,@object               # @.str.15
.L.str.15:
	.asciz	"Failed to run stmt hipMalloc( (void**)&sums, numBlocks*sizeof(T) )"
	.size	.L.str.15, 67

	.type	_Z4scanIm5AdderEvPT_S2_iS2_T0_,@object # @_Z4scanIm5AdderEvPT_S2_iS2_T0_
	.section	.rodata._Z4scanIm5AdderEvPT_S2_iS2_T0_,"aG",@progbits,_Z4scanIm5AdderEvPT_S2_iS2_T0_,comdat
	.weak	_Z4scanIm5AdderEvPT_S2_iS2_T0_
	.p2align	3, 0x0
_Z4scanIm5AdderEvPT_S2_iS2_T0_:
	.quad	_Z19__device_stub__scanIm5AdderEvPT_S2_iS2_T0_
	.size	_Z4scanIm5AdderEvPT_S2_iS2_T0_, 8

	.type	.L.str.16,@object               # @.str.16
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.16:
	.asciz	"Failed to run stmt hipGetLastError()"
	.size	.L.str.16, 37

	.type	.L.str.17,@object               # @.str.17
.L.str.17:
	.asciz	"Failed to run stmt hipMalloc( (void**)&scannedSums, numBlocks*sizeof(T) )"
	.size	.L.str.17, 74

	.type	_Z5applyIm5AdderEvPT_iT0_PKS1_,@object # @_Z5applyIm5AdderEvPT_iT0_PKS1_
	.section	.rodata._Z5applyIm5AdderEvPT_iT0_PKS1_,"aG",@progbits,_Z5applyIm5AdderEvPT_iT0_PKS1_,comdat
	.weak	_Z5applyIm5AdderEvPT_iT0_PKS1_
	.p2align	3, 0x0
_Z5applyIm5AdderEvPT_iT0_PKS1_:
	.quad	_Z20__device_stub__applyIm5AdderEvPT_iT0_PKS1_
	.size	_Z5applyIm5AdderEvPT_iT0_PKS1_, 8

	.type	.L.str.18,@object               # @.str.18
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.18:
	.asciz	"Failed to run stmt hipFree(scannedSums)"
	.size	.L.str.18, 40

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"Failed to run stmt hipFree(sums)"
	.size	.L.str.19, 33

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z4scanIm5AdderEvPT_S2_iS2_T0_"
	.size	.L__unnamed_1, 31

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z5applyIm5AdderEvPT_iT0_PKS1_"
	.size	.L__unnamed_2, 31

	.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 __gxx_personality_v0
	.addrsig_sym _Z19__device_stub__scanIm5AdderEvPT_S2_iS2_T0_
	.addrsig_sym _Z20__device_stub__applyIm5AdderEvPT_iT0_PKS1_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZSt4cout
	.addrsig_sym _ZSt4cerr
	.addrsig_sym _Z4scanIm5AdderEvPT_S2_iS2_T0_
	.addrsig_sym _Z5applyIm5AdderEvPT_iT0_PKS1_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.section	.text._Z4scanIm5AdderEvPT_S2_iS2_T0_,"axG",@progbits,_Z4scanIm5AdderEvPT_S2_iS2_T0_,comdat
	.protected	_Z4scanIm5AdderEvPT_S2_iS2_T0_ ; -- Begin function _Z4scanIm5AdderEvPT_S2_iS2_T0_
	.globl	_Z4scanIm5AdderEvPT_S2_iS2_T0_
	.p2align	8
	.type	_Z4scanIm5AdderEvPT_S2_iS2_T0_,@function
_Z4scanIm5AdderEvPT_S2_iS2_T0_:         ; @_Z4scanIm5AdderEvPT_S2_iS2_T0_
; %bb.0:
	s_clause 0x1
	s_load_b32 s3, s[0:1], 0x34
	s_load_b32 s2, s[0:1], 0x10
	s_mov_b32 s4, 0
	s_mov_b32 s8, s15
	s_mov_b32 s5, s4
	v_lshlrev_b32_e32 v6, 3, v0
	v_dual_mov_b32 v2, s4 :: v_dual_mov_b32 v3, s5
	v_lshl_add_u32 v1, s8, 6, v0
	s_mov_b32 s9, exec_lo
	s_waitcnt lgkmcnt(0)
	s_and_b32 s3, s3, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1)
	v_lshl_add_u32 v5, s3, 3, v6
	ds_store_b64 v6, v[2:3]
	ds_store_b64 v5, v[2:3]
	v_cmpx_gt_i32_e64 s2, v1
	s_cbranch_execz .LBB0_13
; %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_2) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[3:4], 3, v[1:2]
	v_add_nc_u32_e32 v1, s3, v1
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v7, vcc_lo, s4, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v8, vcc_lo, s5, v4, vcc_lo
	v_cmp_gt_u32_e32 vcc_lo, s2, v1
	global_load_b64 v[7:8], v[7:8], off
	s_waitcnt vmcnt(0)
	ds_store_b64 v6, v[7:8]
	s_and_saveexec_b32 s10, vcc_lo
	s_cbranch_execz .LBB0_3
; %bb.2:
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[7:8], 3, v[1:2]
	v_add_co_u32 v7, s2, s4, v7
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v8, s2, s5, v8, s2
	global_load_b64 v[7:8], v[7:8], off
	s_waitcnt vmcnt(0)
	ds_store_b64 v5, v[7:8]
.LBB0_3:
	s_or_b32 exec_lo, exec_lo, s10
	v_add_nc_u32_e32 v2, 1, v0
	s_mov_b32 s4, 1
.LBB0_4:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mul_lo_u32 v7, s4, v2
	s_mov_b32 s5, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u32_e32 33, v7
	s_cbranch_execz .LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	v_lshl_add_u32 v7, v7, 1, -1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_subrev_nc_u32_e32 v8, s4, v7
	v_lshlrev_b32_e32 v11, 3, v7
	v_lshlrev_b32_e32 v9, 3, v8
	ds_load_b64 v[7:8], v11
	ds_load_b64 v[9:10], v9
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v7, s2, v9, v7
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v8, s2, v10, v8, s2
	ds_store_b64 v11, v[7:8]
.LBB0_6:                                ;   in Loop: Header=BB0_4 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	s_lshl_b32 s2, s4, 1
	s_cmp_gt_u32 s4, 16
	s_mov_b32 s4, s2
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc0 .LBB0_4
; %bb.7:                                ; %.preheader
	v_lshl_add_u32 v2, v0, 1, 2
	s_mov_b32 s4, 16
.LBB0_8:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u32_u24 v7, v2, s4, -1
	s_mov_b32 s5, exec_lo
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	v_add_nc_u32_e32 v8, s4, v7
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e32 64, v8
	s_cbranch_execz .LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	v_lshlrev_b32_e32 v9, 3, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_lshl_add_u32 v11, s4, 3, v9
	ds_load_b64 v[7:8], v11
	ds_load_b64 v[9:10], v9
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v7, s2, v9, v7
	v_add_co_ci_u32_e64 v8, s2, v10, v8, s2
	ds_store_b64 v11, v[7:8]
.LBB0_10:                               ;   in Loop: Header=BB0_8 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	s_lshr_b32 s2, s4, 1
	s_cmp_lt_u32 s4, 2
	s_mov_b32 s4, s2
	s_cbranch_scc0 .LBB0_8
; %bb.11:
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	ds_load_b64 v[6:7], v6
	v_add_co_u32 v2, s2, s6, v3
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v3, s2, s7, v4, s2
	s_waitcnt lgkmcnt(0)
	global_store_b64 v[2:3], v[6:7], off
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB0_13
; %bb.12:
	ds_load_b64 v[3:4], v5
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[1:2], 3, v[1:2]
	v_add_co_u32 v1, vcc_lo, s6, v1
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v2, vcc_lo, s7, v2, vcc_lo
	s_waitcnt lgkmcnt(0)
	global_store_b64 v[1:2], v[3:4], off
.LBB0_13:                               ; %Flow64
	s_or_b32 exec_lo, exec_lo, s9
	s_load_b64 s[0:1], s[0:1], 0x18
	s_add_i32 s3, s3, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(SALU_CYCLE_1)
	v_cmp_eq_u32_e32 vcc_lo, s3, v0
	s_waitcnt lgkmcnt(0)
	s_cmp_lg_u64 s[0:1], 0
	s_cselect_b32 s2, -1, 0
	s_and_b32 s2, s2, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_15
; %bb.14:
	v_mov_b32_e32 v2, 0
	s_mov_b32 s9, 0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[2:3], s[8:9], 3
	s_add_u32 s0, s0, s2
	ds_load_b64 v[0:1], v2 offset:504
	s_addc_u32 s1, s1, s3
	s_waitcnt lgkmcnt(0)
	global_store_b64 v2, v[0:1], s[0:1]
.LBB0_15:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z4scanIm5AdderEvPT_S2_iS2_T0_
		.amdhsa_group_segment_fixed_size 512
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.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 12
		.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
	.section	.text._Z4scanIm5AdderEvPT_S2_iS2_T0_,"axG",@progbits,_Z4scanIm5AdderEvPT_S2_iS2_T0_,comdat
.Lfunc_end0:
	.size	_Z4scanIm5AdderEvPT_S2_iS2_T0_, .Lfunc_end0-_Z4scanIm5AdderEvPT_S2_iS2_T0_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 756
; NumSgprs: 18
; NumVgprs: 12
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 512 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 12
; 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
	.section	.text._Z5applyIm5AdderEvPT_iT0_PKS1_,"axG",@progbits,_Z5applyIm5AdderEvPT_iT0_PKS1_,comdat
	.protected	_Z5applyIm5AdderEvPT_iT0_PKS1_ ; -- Begin function _Z5applyIm5AdderEvPT_iT0_PKS1_
	.globl	_Z5applyIm5AdderEvPT_iT0_PKS1_
	.p2align	8
	.type	_Z5applyIm5AdderEvPT_iT0_PKS1_,@function
_Z5applyIm5AdderEvPT_iT0_PKS1_:         ; @_Z5applyIm5AdderEvPT_iT0_PKS1_
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b32 s3, s[0:1], 0x8
	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_e64 s3, v1
	s_cbranch_execz .LBB1_2
; %bb.1:
	s_load_b64 s[2:3], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_load_b64 s[0:1], s[0:1], 0x10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 3, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s2, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v1, vcc_lo
	s_load_b64 s[0:1], s[0:1], 0x0
	global_load_b64 v[2:3], v[0:1], off
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s0, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v3, vcc_lo
	global_store_b64 v[0:1], v[2:3], off
.LBB1_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z5applyIm5AdderEvPT_iT0_PKS1_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.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 4
		.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
	.section	.text._Z5applyIm5AdderEvPT_iT0_PKS1_,"axG",@progbits,_Z5applyIm5AdderEvPT_iT0_PKS1_,comdat
.Lfunc_end1:
	.size	_Z5applyIm5AdderEvPT_iT0_PKS1_, .Lfunc_end1-_Z5applyIm5AdderEvPT_iT0_PKS1_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 164
; NumSgprs: 18
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 4
; 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
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           1
        .value_kind:     by_value
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 512
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z4scanIm5AdderEvPT_S2_iS2_T0_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z4scanIm5AdderEvPT_S2_iS2_T0_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     12
    .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:     by_value
      - .offset:         12
        .size:           1
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z5applyIm5AdderEvPT_iT0_PKS1_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z5applyIm5AdderEvPT_iT0_PKS1_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
