#include "CudaEuler.cuh"
#include <stdio.h>

__device__ int modulo(int a, int b){
        int r = a%b;
        return r< 0 ? r + b : r;
}

__global__ void CudaCalculateDerivative(inttype N, fptype rate, fptype* derivative, fptype* mass, fptype* val, inttype* ia, inttype* ja, inttype* map, inttype offset)
{
    int index  = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;

    for (int i = index; i < N; i+= stride ){
      int i_r = map[i+offset];
      fptype dr = 0.;
      for(unsigned int j = ia[i]; j < ia[i+1]; j++){
          int j_m = map[ja[j]+offset];
          dr += val[j]*mass[j_m];
      }
      dr -= mass[i_r];
      derivative[i_r] += rate*dr;
    }
}

__global__ void CudaSingleTransformStep(inttype N, fptype* derivative, fptype* mass, fptype* val, inttype* ia, inttype* ja, inttype* map, inttype offset)
{
    int index  = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;

    for (int i = index; i < N; i+= stride ){
      int i_r = map[i+offset];
      fptype dr = 0.;
      for(unsigned int j = ia[i]; j < ia[i+1]; j++){
          int j_m = map[ja[j]+offset];
          dr += val[j]*mass[j_m];
      }
      dr -= mass[i_r];
      derivative[i_r] += dr;
    }
}


// Performing this calculation per iteration doubles the simulation time.
// This function shouldn't be used in that way but it a good example in case you want to
// include some kind of variable efficacy.
__global__ void CudaCalculateGridEfficacies(inttype N,
  fptype efficacy, fptype grid_cell_width,
  fptype* stays, fptype* goes, int* offset1s, int* offset2s)
{
  int index  = blockIdx.x * blockDim.x + threadIdx.x;
  int stride = blockDim.x * gridDim.x;

  for (int i = index; i < N; i+= stride ){
    inttype ofs = (inttype)abs(efficacy / grid_cell_width);
    fptype g = (fptype)fabs(efficacy / grid_cell_width) - ofs;
    fptype s = 1.0 - g;

    int o1 = efficacy > 0 ? ofs : -ofs;
    int o2 = efficacy > 0 ? (ofs+1) : (ofs-1);

    stays[modulo(i+o1,N)] = s;
    goes[modulo(i+o2,N)] = g;
    offset1s[modulo(i+o1,N)] = -o1;
    offset2s[modulo(i+o2,N)] = -o2;
  }
}

// As above, this function should not be used per iteration as the efficacy doesn't
// change during simulation.
__global__ void CudaCalculateGridEfficaciesWithConductance(inttype N,
  fptype efficacy, fptype grid_cell_width, fptype* cell_vs, fptype cond_stable,
  fptype* stays, fptype* goes, int* offset1s, int* offset2s, inttype vs_offset)
{
  int index  = blockIdx.x * blockDim.x + threadIdx.x;
  int stride = blockDim.x * gridDim.x;

  for (int i = index; i < N; i+= stride ){
    // WARNING! If the offset changes from, say, 0 and 1 to 1 and 2 along
    // a strip (due to changing V), there will be an overwrite of goes and stays
    // which will lead to mass loss.
    // Solution must be to allow multiple stays and goes into each cell. There
    // should be a github bug report for this.
    fptype eff = efficacy * (cell_vs[i + vs_offset] - cond_stable);
    inttype ofs = (inttype)abs(eff / grid_cell_width);
    fptype g = (fptype)fabs(eff / grid_cell_width) - ofs;
    fptype s = 1.0 - g;

    int o1 = efficacy > 0 ? ofs : -ofs;
    int o2 = efficacy > 0 ? (ofs+1) : (ofs-1);

    stays[modulo(i+o1,N)] = s;
    goes[modulo(i+o2,N)] = g;
    offset1s[modulo(i+o1,N)] = -o1;
    offset2s[modulo(i+o2,N)] = -o2;
  }
}

__global__ void CudaCalculateGridDerivative(inttype N, fptype rate, fptype stays,
  fptype goes, int offset_1, int offset_2,
  fptype* derivative, fptype* mass, inttype offset)
{
    int index  = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;

    for (int i = index; i < N; i+= stride ){
      int io = i+offset;
      fptype dr = 0.;

      dr += stays*mass[(modulo(io+offset_1,N))+offset];
  		dr += goes*mass[(modulo(io+offset_2,N))+offset];
      dr -= mass[io];
      derivative[io] += rate*dr;
    }
}

__global__ void CudaCalculateGridDerivativeWithEfficacy(inttype N, fptype rate, fptype* stays,
  fptype* goes, int* offset_1, int* offset_2,
  fptype* derivative, fptype* mass, inttype offset)
{
  int index  = blockIdx.x * blockDim.x + threadIdx.x;
  int stride = blockDim.x * gridDim.x;

  for (int i = index; i < N; i+= stride ){
    int io = i+offset;
    fptype dr = 0.;
    dr += stays[i]*mass[(modulo(io+offset_1[i],N))+offset];
    dr += goes[i]*mass[(modulo(io+offset_2[i],N))+offset];
    dr -= mass[io];
    derivative[io] += rate*dr;
  }
}

__global__ void EulerStep(inttype N, fptype* derivative, fptype* mass, fptype timestep)
{
    int index  = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;

    for (int i = index; i < N; i+= stride ){
       mass[i] += derivative[i]*timestep;
    }
}

__global__ void CheckDerivativeEqualsZero(inttype N, fptype* derivative)
{
  fptype total = 0.;

  for (int i = 0; i < N; i++){
     total += derivative[i];
     printf("add : %i %f : %f\n", i, derivative[i], total);

  }

  printf("data : %f\n", total);
}

__global__ void MapReversal(unsigned int n_reversal, unsigned int* rev_from, unsigned int* rev_to, fptype* rev_alpha, fptype* mass, unsigned int* map)
{
    int index  = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;
    for (int i = index; i < n_reversal; i+= stride){
        fptype m = mass[map[rev_from[i]]];
        mass[map[rev_from[i]]] = 0.;
        mass[map[rev_to[i]]] += m;
    }
}

__global__ void MapResetToRefractory(unsigned int n_reset, unsigned int* res_from, fptype* mass, unsigned int* map, fptype* refactory_mass){
  int index  = blockIdx.x * blockDim.x + threadIdx.x;
  int stride = blockDim.x * gridDim.x;

  for (int i = index; i < n_reset; i += stride){
    refactory_mass[i] = mass[map[res_from[i]]];
  }
}

__global__ void MapResetShiftRefractory(unsigned int n_reset, fptype* refactory_mass, inttype offset){
  int index  = blockIdx.x * blockDim.x + threadIdx.x;
  int stride = blockDim.x * gridDim.x;

  for (int i = offset+index; i < offset+n_reset; i+=stride){
    refactory_mass[i+n_reset] = refactory_mass[i];
  }
}

__global__ void MapResetThreaded(unsigned int n_reset, fptype* mass, fptype* refactory_mass, inttype ref_offset,
 unsigned int* rev_to, fptype* rev_alpha, inttype* rev_offsets, inttype* rev_counts, unsigned int* map, fptype proportion){
   int index  = blockIdx.x * blockDim.x + threadIdx.x;
   int stride = blockDim.x * gridDim.x;

   for (int i = index; i < n_reset; i+= stride ){
     int i_r = map[rev_to[i]];
     fptype dr = 0.;
     for(unsigned int j = rev_offsets[i]; j < rev_offsets[i]+rev_counts[i]; j++){
         dr += rev_alpha[j]*refactory_mass[ref_offset+j]*proportion;

     }
     mass[i_r] += dr;
   }
}

__global__ void GetResetMass(unsigned int n_reset, fptype* sum, fptype* refactory_mass,
 fptype* rev_alpha, inttype* rev_offsets, inttype* rev_counts){
   int index  = blockIdx.x * blockDim.x + threadIdx.x;
   int stride = blockDim.x * gridDim.x;

   for (int i = index; i < n_reset; i+= stride ){
     fptype dr = 0.;
     for(unsigned int j = rev_offsets[i]; j < rev_offsets[i]+rev_counts[i]; j++){
         dr += rev_alpha[j]*refactory_mass[j];
     }
     sum[i] = dr;
   }
}

 __global__ void SumReset(unsigned int n_sum, fptype* sum, fptype* rate){
   extern __shared__ fptype sdata[];
  // each thread loads one element from global to shared mem
  unsigned int tid = threadIdx.x;
  unsigned int i = blockIdx.x*blockDim.x + threadIdx.x;

  if(i >= n_sum){
    sdata[tid] = 0.;
    return;
  }


  sdata[tid] = sum[i];
  __syncthreads();
  // do reduction in shared mem
  for (unsigned int s=blockDim.x/2; s>0; s>>=1) {
    if (tid < s) {
      sdata[tid] += sdata[tid + s];
    }
    __syncthreads();
  }
  // write result for this block to global mem
  if (tid == 0) {
    rate[blockIdx.x] = sdata[0];
  }
 }

__global__ void ResetFinishThreaded(inttype n_reset, inttype* res_from, fptype* mass, inttype* map){
  int index  = blockIdx.x * blockDim.x + threadIdx.x;
  int stride = blockDim.x * gridDim.x;

  for (int i = index; i < n_reset; i+= stride){
    mass[map[res_from[i]]] = 0.;
  }
}

__global__ void Remap(int N, unsigned int* i_1, unsigned int t, unsigned int *map, unsigned int* first, unsigned int* length)
{
  unsigned int i_start = *i_1;

  int index  = blockIdx.x * blockDim.x + threadIdx.x;
  int stride = blockDim.x * gridDim.x;

    for (int i = index; i < N; i+= stride)
      if (i >= i_start)
          map[i] =  modulo((i - t - first[i]),length[i]) + first[i];
}

__global__ void CudaClearDerivative(inttype N, fptype* dydt, fptype* mass){
    int index  = blockIdx.x * blockDim.x + threadIdx.x;
    int stride = blockDim.x * gridDim.x;
    for (int i = index; i < N; i+= stride)
        dydt[i]  = 0.;
}

	.file	"tmpxft_0023ee97_00000000-6_CudaEuler.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2030:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2030:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0, @function
_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0:
.LFB2203:
	.cfi_startproc
	jmp	cudaLaunchKernel@PLT
	.cfi_endproc
.LFE2203:
	.size	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0, .-_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	.globl	_Z6moduloii
	.type	_Z6moduloii, @function
_Z6moduloii:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2027:
	.size	_Z6moduloii, .-_Z6moduloii
	.globl	_Z58__device_stub__Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_jjfPfS_S_PjS0_S0_j
	.type	_Z58__device_stub__Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_jjfPfS_S_PjS0_S0_j, @function
_Z58__device_stub__Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_jjfPfS_S_PjS0_S0_j:
.LFB2052:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movq	208(%rsp), %rax
	movl	%edi, 60(%rsp)
	leaq	88(%rsp), %rdi
	movq	%rsi, 48(%rsp)
	leaq	100(%rsp), %rsi
	movq	%rdx, 40(%rsp)
	leaq	72(%rsp), %rdx
	movq	%rcx, 32(%rsp)
	leaq	80(%rsp), %rcx
	movq	%r8, 24(%rsp)
	movq	%r9, 16(%rsp)
	movq	%rax, 8(%rsp)
	movss	%xmm0, 56(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rax
	movl	$1, 96(%rsp)
	movq	%rax, 112(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	216(%rsp), %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 88(%rsp)
	movq	%rax, 100(%rsp)
	movl	$1, 108(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L5
	pushq	80(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_j(%rip), %rdi
	pushq	80(%rsp)
	.cfi_def_cfa_offset 224
	movq	116(%rsp), %rcx
	movl	124(%rsp), %r8d
	movq	104(%rsp), %rsi
	movl	112(%rsp), %edx
	leaq	128(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L5:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2052:
	.size	_Z58__device_stub__Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_jjfPfS_S_PjS0_S0_j, .-_Z58__device_stub__Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_jjfPfS_S_PjS0_S0_j
	.globl	_Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_j
	.type	_Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_j, @function
_Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_j:
.LFB2053:
	.cfi_startproc
	endbr64
	jmp	_Z58__device_stub__Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_jjfPfS_S_PjS0_S0_j
	.cfi_endproc
.LFE2053:
	.size	_Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_j, .-_Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_j
	.globl	_Z57__device_stub__Z23CudaSingleTransformStepjPfS_S_PjS0_S0_jjPfS_S_PjS0_S0_j
	.type	_Z57__device_stub__Z23CudaSingleTransformStepjPfS_S_PjS0_S0_jjPfS_S_PjS0_S0_j, @function
_Z57__device_stub__Z23CudaSingleTransformStepjPfS_S_PjS0_S0_jjPfS_S_PjS0_S0_j:
.LFB2054:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	192(%rsp), %rax
	movl	%edi, 60(%rsp)
	leaq	80(%rsp), %rdi
	movq	%rsi, 48(%rsp)
	leaq	92(%rsp), %rsi
	movq	%rdx, 40(%rsp)
	leaq	64(%rsp), %rdx
	movq	%rcx, 32(%rsp)
	leaq	72(%rsp), %rcx
	movq	%r8, 24(%rsp)
	movq	%r9, 16(%rsp)
	movq	%rax, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rax
	movl	$1, 88(%rsp)
	movq	%rax, 104(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	200(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 80(%rsp)
	movq	%rax, 92(%rsp)
	movl	$1, 100(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L11
	pushq	72(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z23CudaSingleTransformStepjPfS_S_PjS0_S0_j(%rip), %rdi
	pushq	72(%rsp)
	.cfi_def_cfa_offset 208
	movq	108(%rsp), %rcx
	movl	116(%rsp), %r8d
	movq	96(%rsp), %rsi
	movl	104(%rsp), %edx
	leaq	120(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L11:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2054:
	.size	_Z57__device_stub__Z23CudaSingleTransformStepjPfS_S_PjS0_S0_jjPfS_S_PjS0_S0_j, .-_Z57__device_stub__Z23CudaSingleTransformStepjPfS_S_PjS0_S0_jjPfS_S_PjS0_S0_j
	.globl	_Z23CudaSingleTransformStepjPfS_S_PjS0_S0_j
	.type	_Z23CudaSingleTransformStepjPfS_S_PjS0_S0_j, @function
_Z23CudaSingleTransformStepjPfS_S_PjS0_S0_j:
.LFB2055:
	.cfi_startproc
	endbr64
	jmp	_Z57__device_stub__Z23CudaSingleTransformStepjPfS_S_PjS0_S0_jjPfS_S_PjS0_S0_j
	.cfi_endproc
.LFE2055:
	.size	_Z23CudaSingleTransformStepjPfS_S_PjS0_S0_j, .-_Z23CudaSingleTransformStepjPfS_S_PjS0_S0_j
	.globl	_Z57__device_stub__Z27CudaCalculateGridEfficaciesjffPfS_PiS0_jffPfS_PiS0_
	.type	_Z57__device_stub__Z27CudaCalculateGridEfficaciesjffPfS_PiS0_jffPfS_PiS0_, @function
_Z57__device_stub__Z27CudaCalculateGridEfficaciesjffPfS_PiS0_jffPfS_PiS0_:
.LFB2056:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movl	%edi, 44(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 24(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 16(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 8(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, (%rsp)
	movss	%xmm0, 40(%rsp)
	movss	%xmm1, 36(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 96(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	36(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 136(%rsp)
	movq	%rsp, %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	pushq	64(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_Z27CudaCalculateGridEfficaciesjffPfS_PiS0_(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 192
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	112(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L16:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2056:
	.size	_Z57__device_stub__Z27CudaCalculateGridEfficaciesjffPfS_PiS0_jffPfS_PiS0_, .-_Z57__device_stub__Z27CudaCalculateGridEfficaciesjffPfS_PiS0_jffPfS_PiS0_
	.globl	_Z27CudaCalculateGridEfficaciesjffPfS_PiS0_
	.type	_Z27CudaCalculateGridEfficaciesjffPfS_PiS0_, @function
_Z27CudaCalculateGridEfficaciesjffPfS_PiS0_:
.LFB2057:
	.cfi_startproc
	endbr64
	jmp	_Z57__device_stub__Z27CudaCalculateGridEfficaciesjffPfS_PiS0_jffPfS_PiS0_
	.cfi_endproc
.LFE2057:
	.size	_Z27CudaCalculateGridEfficaciesjffPfS_PiS0_, .-_Z27CudaCalculateGridEfficaciesjffPfS_PiS0_
	.globl	_Z76__device_stub__Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_jjffPffS_S_PiS0_j
	.type	_Z76__device_stub__Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_jjffPffS_S_PiS0_j, @function
_Z76__device_stub__Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_jjffPffS_S_PiS0_j:
.LFB2058:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movl	%edi, 60(%rsp)
	leaq	80(%rsp), %rdi
	movq	%rsi, 40(%rsp)
	leaq	92(%rsp), %rsi
	movq	%rdx, 32(%rsp)
	leaq	64(%rsp), %rdx
	movq	%rcx, 24(%rsp)
	leaq	72(%rsp), %rcx
	movq	%r8, 16(%rsp)
	movq	%r9, 8(%rsp)
	movss	%xmm0, 56(%rsp)
	movss	%xmm1, 52(%rsp)
	movss	%xmm2, 48(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rax
	movl	$1, 88(%rsp)
	movq	%rax, 104(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	52(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	208(%rsp), %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 80(%rsp)
	movq	%rax, 92(%rsp)
	movl	$1, 100(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L21
	pushq	72(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_j(%rip), %rdi
	pushq	72(%rsp)
	.cfi_def_cfa_offset 224
	movq	108(%rsp), %rcx
	movl	116(%rsp), %r8d
	movq	96(%rsp), %rsi
	movl	104(%rsp), %edx
	leaq	120(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L21:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2058:
	.size	_Z76__device_stub__Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_jjffPffS_S_PiS0_j, .-_Z76__device_stub__Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_jjffPffS_S_PiS0_j
	.globl	_Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_j
	.type	_Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_j, @function
_Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_j:
.LFB2059:
	.cfi_startproc
	endbr64
	jmp	_Z76__device_stub__Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_jjffPffS_S_PiS0_j
	.cfi_endproc
.LFE2059:
	.size	_Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_j, .-_Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_j
	.globl	_Z56__device_stub__Z27CudaCalculateGridDerivativejfffiiPfS_jjfffiiPfS_j
	.type	_Z56__device_stub__Z27CudaCalculateGridDerivativejfffiiPfS_jjfffiiPfS_j, @function
_Z56__device_stub__Z27CudaCalculateGridDerivativejfffiiPfS_jjfffiiPfS_j:
.LFB2060:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movl	%edi, 44(%rsp)
	leaq	72(%rsp), %rdi
	movl	%esi, 28(%rsp)
	leaq	84(%rsp), %rsi
	movl	%edx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movl	%r9d, 4(%rsp)
	movss	%xmm0, 40(%rsp)
	movss	%xmm1, 36(%rsp)
	movss	%xmm2, 32(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 96(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	36(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L26
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z27CudaCalculateGridDerivativejfffiiPfS_j(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	112(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L26:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2060:
	.size	_Z56__device_stub__Z27CudaCalculateGridDerivativejfffiiPfS_jjfffiiPfS_j, .-_Z56__device_stub__Z27CudaCalculateGridDerivativejfffiiPfS_jjfffiiPfS_j
	.globl	_Z27CudaCalculateGridDerivativejfffiiPfS_j
	.type	_Z27CudaCalculateGridDerivativejfffiiPfS_j, @function
_Z27CudaCalculateGridDerivativejfffiiPfS_j:
.LFB2061:
	.cfi_startproc
	endbr64
	jmp	_Z56__device_stub__Z27CudaCalculateGridDerivativejfffiiPfS_jjfffiiPfS_j
	.cfi_endproc
.LFE2061:
	.size	_Z27CudaCalculateGridDerivativejfffiiPfS_j, .-_Z27CudaCalculateGridDerivativejfffiiPfS_j
	.globl	_Z73__device_stub__Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_jjfPfS_PiS0_S_S_j
	.type	_Z73__device_stub__Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_jjfPfS_PiS0_S_S_j, @function
_Z73__device_stub__Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_jjfPfS_PiS0_S_S_j:
.LFB2062:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movq	208(%rsp), %rax
	movl	%edi, 60(%rsp)
	leaq	88(%rsp), %rdi
	movq	%rsi, 48(%rsp)
	leaq	100(%rsp), %rsi
	movq	%rdx, 40(%rsp)
	leaq	72(%rsp), %rdx
	movq	%rcx, 32(%rsp)
	leaq	80(%rsp), %rcx
	movq	%r8, 24(%rsp)
	movq	%r9, 16(%rsp)
	movq	%rax, 8(%rsp)
	movss	%xmm0, 56(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rax
	movl	$1, 96(%rsp)
	movq	%rax, 112(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	216(%rsp), %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 88(%rsp)
	movq	%rax, 100(%rsp)
	movl	$1, 108(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L31
	pushq	80(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_j(%rip), %rdi
	pushq	80(%rsp)
	.cfi_def_cfa_offset 224
	movq	116(%rsp), %rcx
	movl	124(%rsp), %r8d
	movq	104(%rsp), %rsi
	movl	112(%rsp), %edx
	leaq	128(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L31:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2062:
	.size	_Z73__device_stub__Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_jjfPfS_PiS0_S_S_j, .-_Z73__device_stub__Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_jjfPfS_PiS0_S_S_j
	.globl	_Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_j
	.type	_Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_j, @function
_Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_j:
.LFB2063:
	.cfi_startproc
	endbr64
	jmp	_Z73__device_stub__Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_jjfPfS_PiS0_S_S_j
	.cfi_endproc
.LFE2063:
	.size	_Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_j, .-_Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_j
	.globl	_Z32__device_stub__Z9EulerStepjPfS_fjPfS_f
	.type	_Z32__device_stub__Z9EulerStepjPfS_fjPfS_f, @function
_Z32__device_stub__Z9EulerStepjPfS_fjPfS_f:
.LFB2064:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movl	%edi, 28(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movss	%xmm0, 24(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 72(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 80(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 88(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L36
	pushq	40(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z9EulerStepjPfS_f(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 144
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	88(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L36:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2064:
	.size	_Z32__device_stub__Z9EulerStepjPfS_fjPfS_f, .-_Z32__device_stub__Z9EulerStepjPfS_fjPfS_f
	.globl	_Z9EulerStepjPfS_f
	.type	_Z9EulerStepjPfS_f, @function
_Z9EulerStepjPfS_f:
.LFB2065:
	.cfi_startproc
	endbr64
	jmp	_Z32__device_stub__Z9EulerStepjPfS_fjPfS_f
	.cfi_endproc
.LFE2065:
	.size	_Z9EulerStepjPfS_f, .-_Z9EulerStepjPfS_f
	.globl	_Z46__device_stub__Z25CheckDerivativeEqualsZerojPfjPf
	.type	_Z46__device_stub__Z25CheckDerivativeEqualsZerojPfjPf, @function
_Z46__device_stub__Z25CheckDerivativeEqualsZerojPfjPf:
.LFB2066:
	.cfi_startproc
	endbr64
	subq	$88, %rsp
	.cfi_def_cfa_offset 96
	movl	%edi, 12(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	movq	%rsi, (%rsp)
	leaq	32(%rsp), %rdi
	leaq	44(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 56(%rsp)
	movq	%rsp, %rax
	movq	%rax, 64(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L41
	pushq	24(%rsp)
	.cfi_def_cfa_offset 104
	leaq	_Z25CheckDerivativeEqualsZerojPf(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 112
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	72(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 104
	popq	%rdx
	.cfi_def_cfa_offset 96
.L41:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L43
	call	__stack_chk_fail@PLT
.L43:
	addq	$88, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2066:
	.size	_Z46__device_stub__Z25CheckDerivativeEqualsZerojPfjPf, .-_Z46__device_stub__Z25CheckDerivativeEqualsZerojPfjPf
	.globl	_Z25CheckDerivativeEqualsZerojPf
	.type	_Z25CheckDerivativeEqualsZerojPf, @function
_Z25CheckDerivativeEqualsZerojPf:
.LFB2067:
	.cfi_startproc
	endbr64
	jmp	_Z46__device_stub__Z25CheckDerivativeEqualsZerojPfjPf
	.cfi_endproc
.LFE2067:
	.size	_Z25CheckDerivativeEqualsZerojPf, .-_Z25CheckDerivativeEqualsZerojPf
	.globl	_Z41__device_stub__Z11MapReversaljPjS_PfS0_S_jPjS_PfS0_S_
	.type	_Z41__device_stub__Z11MapReversaljPjS_PfS0_S_jPjS_PfS0_S_, @function
_Z41__device_stub__Z11MapReversaljPjS_PfS0_S_jPjS_PfS0_S_:
.LFB2068:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 44(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 88(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 96(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L46
	pushq	56(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z11MapReversaljPjS_PfS0_S_(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 176
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	104(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L46:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L48
	call	__stack_chk_fail@PLT
.L48:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2068:
	.size	_Z41__device_stub__Z11MapReversaljPjS_PfS0_S_jPjS_PfS0_S_, .-_Z41__device_stub__Z11MapReversaljPjS_PfS0_S_jPjS_PfS0_S_
	.globl	_Z11MapReversaljPjS_PfS0_S_
	.type	_Z11MapReversaljPjS_PfS0_S_, @function
_Z11MapReversaljPjS_PfS0_S_:
.LFB2069:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z11MapReversaljPjS_PfS0_S_jPjS_PfS0_S_
	.cfi_endproc
.LFE2069:
	.size	_Z11MapReversaljPjS_PfS0_S_, .-_Z11MapReversaljPjS_PfS0_S_
	.globl	_Z48__device_stub__Z20MapResetToRefractoryjPjPfS_S0_jPjPfS_S0_
	.type	_Z48__device_stub__Z20MapResetToRefractoryjPjPfS_S0_jPjPfS_S0_, @function
_Z48__device_stub__Z20MapResetToRefractoryjPjPfS_S0_jPjPfS_S0_:
.LFB2070:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 44(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 96(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L51
	pushq	64(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z20MapResetToRefractoryjPjPfS_S0_(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 176
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	112(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L51:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L53
	call	__stack_chk_fail@PLT
.L53:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2070:
	.size	_Z48__device_stub__Z20MapResetToRefractoryjPjPfS_S0_jPjPfS_S0_, .-_Z48__device_stub__Z20MapResetToRefractoryjPjPfS_S0_jPjPfS_S0_
	.globl	_Z20MapResetToRefractoryjPjPfS_S0_
	.type	_Z20MapResetToRefractoryjPjPfS_S0_, @function
_Z20MapResetToRefractoryjPjPfS_S0_:
.LFB2071:
	.cfi_startproc
	endbr64
	jmp	_Z48__device_stub__Z20MapResetToRefractoryjPjPfS_S0_jPjPfS_S0_
	.cfi_endproc
.LFE2071:
	.size	_Z20MapResetToRefractoryjPjPfS_S0_, .-_Z20MapResetToRefractoryjPjPfS_S0_
	.globl	_Z45__device_stub__Z23MapResetShiftRefractoryjPfjjPfj
	.type	_Z45__device_stub__Z23MapResetShiftRefractoryjPfjjPfj, @function
_Z45__device_stub__Z23MapResetShiftRefractoryjPfjjPfj:
.LFB2072:
	.cfi_startproc
	endbr64
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movl	%edi, 12(%rsp)
	leaq	32(%rsp), %rcx
	leaq	40(%rsp), %rdi
	movq	%rsi, (%rsp)
	leaq	52(%rsp), %rsi
	movl	%edx, 8(%rsp)
	leaq	24(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 64(%rsp)
	movq	%rsp, %rax
	movq	%rax, 72(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 80(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L56
	pushq	32(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z23MapResetShiftRefractoryjPfj(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 128
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	80(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L56:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L58
	call	__stack_chk_fail@PLT
.L58:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2072:
	.size	_Z45__device_stub__Z23MapResetShiftRefractoryjPfjjPfj, .-_Z45__device_stub__Z23MapResetShiftRefractoryjPfjjPfj
	.globl	_Z23MapResetShiftRefractoryjPfj
	.type	_Z23MapResetShiftRefractoryjPfj, @function
_Z23MapResetShiftRefractoryjPfj:
.LFB2073:
	.cfi_startproc
	endbr64
	jmp	_Z45__device_stub__Z23MapResetShiftRefractoryjPfjjPfj
	.cfi_endproc
.LFE2073:
	.size	_Z23MapResetShiftRefractoryjPfj, .-_Z23MapResetShiftRefractoryjPfj
	.globl	_Z54__device_stub__Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_fjPfS_jPjS_S0_S0_S0_f
	.type	_Z54__device_stub__Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_fjPfS_jPjS_S0_S0_S0_f, @function
_Z54__device_stub__Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_fjPfS_jPjS_S0_S0_S0_f:
.LFB2074:
	.cfi_startproc
	endbr64
	subq	$216, %rsp
	.cfi_def_cfa_offset 224
	movq	224(%rsp), %rax
	movl	%edi, 76(%rsp)
	leaq	96(%rsp), %rdi
	movq	%rsi, 64(%rsp)
	leaq	108(%rsp), %rsi
	movq	%rax, 32(%rsp)
	movq	232(%rsp), %rax
	movq	%rdx, 56(%rsp)
	leaq	80(%rsp), %rdx
	movq	%rax, 24(%rsp)
	movq	240(%rsp), %rax
	movl	%ecx, 72(%rsp)
	leaq	88(%rsp), %rcx
	movq	%r8, 48(%rsp)
	movq	%r9, 40(%rsp)
	movq	%rax, 16(%rsp)
	movss	%xmm0, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	76(%rsp), %rax
	movl	$1, 104(%rsp)
	movq	%rax, 120(%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	72(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 184(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 192(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 96(%rsp)
	movq	%rax, 108(%rsp)
	movl	$1, 116(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L61
	pushq	88(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_f(%rip), %rdi
	pushq	88(%rsp)
	.cfi_def_cfa_offset 240
	movq	124(%rsp), %rcx
	movl	132(%rsp), %r8d
	movq	112(%rsp), %rsi
	movl	120(%rsp), %edx
	leaq	136(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 232
	popq	%rdx
	.cfi_def_cfa_offset 224
.L61:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L63
	call	__stack_chk_fail@PLT
.L63:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2074:
	.size	_Z54__device_stub__Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_fjPfS_jPjS_S0_S0_S0_f, .-_Z54__device_stub__Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_fjPfS_jPjS_S0_S0_S0_f
	.globl	_Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_f
	.type	_Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_f, @function
_Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_f:
.LFB2075:
	.cfi_startproc
	endbr64
	jmp	_Z54__device_stub__Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_fjPfS_jPjS_S0_S0_S0_f
	.cfi_endproc
.LFE2075:
	.size	_Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_f, .-_Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_f
	.globl	_Z42__device_stub__Z12GetResetMassjPfS_S_PjS0_jPfS_S_PjS0_
	.type	_Z42__device_stub__Z12GetResetMassjPfS_S_PjS0_jPfS_S_PjS0_, @function
_Z42__device_stub__Z12GetResetMassjPfS_S_PjS0_jPfS_S_PjS0_:
.LFB2076:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 44(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 88(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 96(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L66
	pushq	56(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z12GetResetMassjPfS_S_PjS0_(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 176
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	104(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L66:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L68
	call	__stack_chk_fail@PLT
.L68:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2076:
	.size	_Z42__device_stub__Z12GetResetMassjPfS_S_PjS0_jPfS_S_PjS0_, .-_Z42__device_stub__Z12GetResetMassjPfS_S_PjS0_jPfS_S_PjS0_
	.globl	_Z12GetResetMassjPfS_S_PjS0_
	.type	_Z12GetResetMassjPfS_S_PjS0_, @function
_Z12GetResetMassjPfS_S_PjS0_:
.LFB2077:
	.cfi_startproc
	endbr64
	jmp	_Z42__device_stub__Z12GetResetMassjPfS_S_PjS0_jPfS_S_PjS0_
	.cfi_endproc
.LFE2077:
	.size	_Z12GetResetMassjPfS_S_PjS0_, .-_Z12GetResetMassjPfS_S_PjS0_
	.globl	_Z30__device_stub__Z8SumResetjPfS_jPfS_
	.type	_Z30__device_stub__Z8SumResetjPfS_jPfS_, @function
_Z30__device_stub__Z8SumResetjPfS_jPfS_:
.LFB2078:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movl	%edi, 28(%rsp)
	leaq	48(%rsp), %rcx
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 80(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 88(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L71
	pushq	48(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z8SumResetjPfS_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 144
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	96(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L71:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L73
	call	__stack_chk_fail@PLT
.L73:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2078:
	.size	_Z30__device_stub__Z8SumResetjPfS_jPfS_, .-_Z30__device_stub__Z8SumResetjPfS_jPfS_
	.globl	_Z8SumResetjPfS_
	.type	_Z8SumResetjPfS_, @function
_Z8SumResetjPfS_:
.LFB2079:
	.cfi_startproc
	endbr64
	jmp	_Z30__device_stub__Z8SumResetjPfS_jPfS_
	.cfi_endproc
.LFE2079:
	.size	_Z8SumResetjPfS_, .-_Z8SumResetjPfS_
	.globl	_Z44__device_stub__Z19ResetFinishThreadedjPjPfS_jPjPfS_
	.type	_Z44__device_stub__Z19ResetFinishThreadedjPjPfS_jPjPfS_, @function
_Z44__device_stub__Z19ResetFinishThreadedjPjPfS_jPjPfS_:
.LFB2080:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movl	%edi, 28(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	40(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 72(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 80(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L76
	pushq	40(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z19ResetFinishThreadedjPjPfS_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 144
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	88(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L76:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L78
	call	__stack_chk_fail@PLT
.L78:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2080:
	.size	_Z44__device_stub__Z19ResetFinishThreadedjPjPfS_jPjPfS_, .-_Z44__device_stub__Z19ResetFinishThreadedjPjPfS_jPjPfS_
	.globl	_Z19ResetFinishThreadedjPjPfS_
	.type	_Z19ResetFinishThreadedjPjPfS_, @function
_Z19ResetFinishThreadedjPjPfS_:
.LFB2081:
	.cfi_startproc
	endbr64
	jmp	_Z44__device_stub__Z19ResetFinishThreadedjPjPfS_jPjPfS_
	.cfi_endproc
.LFE2081:
	.size	_Z19ResetFinishThreadedjPjPfS_, .-_Z19ResetFinishThreadedjPjPfS_
	.globl	_Z32__device_stub__Z5RemapiPjjS_S_S_iPjjS_S_S_
	.type	_Z32__device_stub__Z5RemapiPjjS_S_S_iPjjS_S_S_, @function
_Z32__device_stub__Z5RemapiPjjS_S_S_iPjjS_S_S_:
.LFB2082:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 44(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movl	%edx, 40(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 24(%rsp)
	leaq	56(%rsp), %rcx
	movq	%r8, 16(%rsp)
	movq	%r9, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 88(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 96(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L81
	pushq	56(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z5RemapiPjjS_S_S_(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 176
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	104(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L81:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L83
	call	__stack_chk_fail@PLT
.L83:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2082:
	.size	_Z32__device_stub__Z5RemapiPjjS_S_S_iPjjS_S_S_, .-_Z32__device_stub__Z5RemapiPjjS_S_S_iPjjS_S_S_
	.globl	_Z5RemapiPjjS_S_S_
	.type	_Z5RemapiPjjS_S_S_, @function
_Z5RemapiPjjS_S_S_:
.LFB2083:
	.cfi_startproc
	endbr64
	jmp	_Z32__device_stub__Z5RemapiPjjS_S_S_iPjjS_S_S_
	.cfi_endproc
.LFE2083:
	.size	_Z5RemapiPjjS_S_S_, .-_Z5RemapiPjjS_S_S_
	.globl	_Z42__device_stub__Z19CudaClearDerivativejPfS_jPfS_
	.type	_Z42__device_stub__Z19CudaClearDerivativejPfS_jPfS_, @function
_Z42__device_stub__Z19CudaClearDerivativejPfS_jPfS_:
.LFB2084:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movl	%edi, 28(%rsp)
	leaq	48(%rsp), %rcx
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 80(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 88(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L86
	pushq	48(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z19CudaClearDerivativejPfS_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 144
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	96(%rsp), %r9
	call	_Z16cudaLaunchKernelIcE9cudaErrorPT_4dim3S3_PPvmP11CUstream_st.isra.0
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L86:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L88
	call	__stack_chk_fail@PLT
.L88:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2084:
	.size	_Z42__device_stub__Z19CudaClearDerivativejPfS_jPfS_, .-_Z42__device_stub__Z19CudaClearDerivativejPfS_jPfS_
	.globl	_Z19CudaClearDerivativejPfS_
	.type	_Z19CudaClearDerivativejPfS_, @function
_Z19CudaClearDerivativejPfS_:
.LFB2085:
	.cfi_startproc
	endbr64
	jmp	_Z42__device_stub__Z19CudaClearDerivativejPfS_jPfS_
	.cfi_endproc
.LFE2085:
	.size	_Z19CudaClearDerivativejPfS_, .-_Z19CudaClearDerivativejPfS_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z19CudaClearDerivativejPfS_"
.LC1:
	.string	"_Z5RemapiPjjS_S_S_"
.LC2:
	.string	"_Z19ResetFinishThreadedjPjPfS_"
.LC3:
	.string	"_Z8SumResetjPfS_"
.LC4:
	.string	"_Z12GetResetMassjPfS_S_PjS0_"
.LC5:
	.string	"_Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_f"
.LC6:
	.string	"_Z23MapResetShiftRefractoryjPfj"
.LC7:
	.string	"_Z20MapResetToRefractoryjPjPfS_S0_"
.LC8:
	.string	"_Z11MapReversaljPjS_PfS0_S_"
.LC9:
	.string	"_Z25CheckDerivativeEqualsZerojPf"
.LC10:
	.string	"_Z9EulerStepjPfS_f"
.LC11:
	.string	"_Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_j"
.LC12:
	.string	"_Z27CudaCalculateGridDerivativejfffiiPfS_j"
.LC13:
	.string	"_Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_j"
.LC14:
	.string	"_Z27CudaCalculateGridEfficaciesjffPfS_PiS0_"
.LC15:
	.string	"_Z23CudaSingleTransformStepjPfS_S_PjS0_S0_j"
.LC16:
	.string	"_Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_j"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2087:
	.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	.LC0(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z19CudaClearDerivativejPfS_(%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
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC1(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z5RemapiPjjS_S_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC2(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z19ResetFinishThreadedjPjPfS_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC3(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z8SumResetjPfS_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC4(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z12GetResetMassjPfS_S_PjS0_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC5(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z16MapResetThreadedjPfS_jPjS_S0_S0_S0_f(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC6(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z23MapResetShiftRefractoryjPfj(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC7(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z20MapResetToRefractoryjPjPfS_S0_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	leaq	.LC8(%rip), %rdx
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	_Z11MapReversaljPjS_PfS0_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC9(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z25CheckDerivativeEqualsZerojPf(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC10(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z9EulerStepjPfS_f(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC11(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z39CudaCalculateGridDerivativeWithEfficacyjfPfS_PiS0_S_S_j(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC12(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z27CudaCalculateGridDerivativejfffiiPfS_j(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC13(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z42CudaCalculateGridEfficaciesWithConductancejffPffS_S_PiS0_j(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC14(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z27CudaCalculateGridEfficaciesjffPfS_PiS0_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC15(%rip), %rdx
	movq	%rbx, %rdi
	leaq	_Z23CudaSingleTransformStepjPfS_S_PjS0_S0_j(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	leaq	.LC16(%rip), %rdx
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	_Z23CudaCalculateDerivativejfPfS_S_PjS0_S0_j(%rip), %rsi
	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
.LFE2087:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.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
	.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:

#ifndef CUEMTESTCUH
#define CUEMTESTCUH

typedef unsigned int inttype;
typedef float fptype;

__global__ void CudaCalculateDerivative(inttype N, fptype rate, fptype* derivative, fptype* mass, fptype* val, inttype* ia, inttype* ja, inttype* map, inttype offset);
__global__ void CudaSingleTransformStep(inttype N, fptype* derivative, fptype* mass, fptype* val, inttype* ia, inttype* ja, inttype* map, inttype offset);
__global__ void CudaCalculateGridDerivative(inttype N, fptype rate, fptype stays, fptype goes, int offset_1, int offset_2, fptype* derivative, fptype* mass, inttype offset);
__global__ void EulerStep(inttype N, fptype* derivative, fptype* mass, fptype timestep);
__global__ void MapReversal(unsigned int n_reversal, unsigned int* rev_from, unsigned int* rev_to, fptype* rev_alpha, fptype* mass, unsigned int* map);
__global__ void MapResetToRefractory(unsigned int n_reset, unsigned int* res_from, fptype* mass, unsigned int* map, fptype* refactory_mass);
__global__ void MapResetShiftRefractory(unsigned int n_reset, fptype* refactory_mass, inttype offset);
__global__ void MapResetThreaded(unsigned int n_reset, fptype* mass, fptype* refactory_mass, inttype ref_offset, unsigned int* rev_to, fptype* rev_alpha, inttype* rev_offsets, inttype* rev_counts, unsigned int* map, fptype proportion);
__global__ void GetResetMass(unsigned int n_reset, fptype* sum, fptype* refactory_mass, fptype* rev_alpha, inttype* rev_offsets, inttype* rev_counts);
__global__ void SumReset(unsigned int n_sum, fptype* sum, fptype* rate);
__global__ void Remap(int N, unsigned int* i_1, unsigned int t, unsigned int *map, unsigned int* first, unsigned int* length);
__global__ void ResetFinishThreaded(inttype n_reset, inttype* res_from, fptype* mass, inttype* map);
__global__ void CudaClearDerivative(inttype N, fptype* dydt, fptype* mass);
__global__ void CheckDerivativeEqualsZero(inttype N, fptype* derivative);
__device__ int modulo(int a, int b);

__global__ void CudaCalculateGridDerivativeWithEfficacy(inttype N, fptype rate, fptype* stays, fptype* goes, int* offset_1, int* offset_2, fptype* derivative, fptype* mass, inttype offset);
__global__ void CudaCalculateGridEfficaciesWithConductance(inttype N, fptype efficacy, fptype grid_cell_width, fptype* cell_vs, fptype cond_stable, fptype* stays, fptype* goes, int* offset1s, int* offset2s, inttype vs_offset);
__global__ void CudaCalculateGridEfficacies(inttype N, fptype efficacy, fptype grid_cell_width, fptype* stays, fptype* goes, int* offset1s, int* offset2s);
#endif

	.text
	.file	"CudaEuler.hip"
	.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 __hip_cuid_

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

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

	.end_amdgpu_metadata
