#include "heatmap_update.cuh"
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <cuda.h>
#include <cuda_runtime_api.h>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <omp.h>




__global__
void fadeHeat(int *d_heatmap, int size)
{
    int index = blockIdx.x * blockDim.x + threadIdx.x;
    if (index < size*size)
    {
        d_heatmap[index] = (int)round(d_heatmap[index] * 0.80);
    }
}

__global__
void heatIntensify(int *d_heatmap, int *x, int *y, int agent_size, int size)
{
    int index = blockIdx.x * blockDim.x + threadIdx.x; 
    if (index >= 0 && index < agent_size)
    {
      atomicAdd(&d_heatmap[y[index]*size + x[index]], 40);
    }	
}

__global__
void setMaxHeat(int *d_heatmap, int size)
{
    int index = blockIdx.x * blockDim.x + threadIdx.x;
    if (index < size*size)
    {
      if (d_heatmap[index] >= 255)
      {
          d_heatmap[index] = 255;
      }
    }
}


__global__
void scaleHeatmap(int *d_heatmap, int *d_scaledHeatmap, int size, int cellSize)
{
  int index = blockIdx.x * blockDim.x + threadIdx.x;

  if (index < size*size)
    {
      for (int cellY = 0; cellY < cellSize; cellY++)
	    {
        int scaledBlock = (blockIdx.x * cellSize + cellY) * blockDim.x * cellSize;
        for (int cellX = 0; cellX < cellSize; cellX++)
        {
          int scaledThread = threadIdx.x * cellSize + cellX;
          // atomicExch(&d_scaledHeatmap[scaledBlock + scaledThread], d_heatmap[index]);
          d_scaledHeatmap[scaledBlock + scaledThread] = d_heatmap[index];
          // # if __CUDA_ARCH__>=200
          //   printf("cellY: %d, cellX: %d\n", cellY, cellX);
          // #endif
        }
	    }
    }
}


__global__
void blurHeatmap(int *d_scaledHeatmap, int *d_blurredHeatmap, int scaledSize)
{
    int WEIGHTSUM = 273;
    const int w[5][5] = {
    { 1, 4, 7, 4, 1 },
    { 4, 16, 26, 16, 4 },
    { 7, 26, 41, 26, 7 },
    { 4, 16, 26, 16, 4 },
    { 1, 4, 7, 4, 1 }
  };

     int i = blockIdx.x * blockDim.x;
     int modI = (blockIdx.x * blockDim.x + threadIdx.x) % scaledSize;
     int j = threadIdx.x;
     int sum = 0;
     if(modI >= 2 && modI < scaledSize-2 && i+j >= 2*scaledSize && blockIdx.x < 5*scaledSize-2)
     for (int k = -2; k < 3; k++)
      {
        for (int l = -2; l < 3; l++)
         {       
           if(i+scaledSize*k >= 2*scaledSize && i+scaledSize*k < scaledSize*scaledSize-2*scaledSize)
           sum += w[2 + k][2 + l] * d_scaledHeatmap[(i + k) + (j + l)]; 
         }
      }
     int value = sum / WEIGHTSUM;    
     d_blurredHeatmap[i + j] = 0x00FF0000 | value << 24;
}


int THREADSPERBLOCK = 1024;
// Updates the heatmap according to the agent positions
void updateHeatFade(int *heatmap, int SIZE)
{
  int *d_heatmap;
  cudaMalloc((void **)&d_heatmap, SIZE*SIZE*sizeof(int));
  // printf("after malloc: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaMemcpyAsync(d_heatmap, heatmap, SIZE*SIZE*sizeof(int), cudaMemcpyHostToDevice);
  // printf("after HostToDevice: %s\n", cudaGetErrorString(cudaGetLastError()));
  fadeHeat<<<((SIZE*SIZE)/THREADSPERBLOCK)+1,THREADSPERBLOCK>>>(d_heatmap, SIZE);
  // printf("after fadeHeat: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaMemcpyAsync(heatmap, d_heatmap, SIZE*SIZE*sizeof(int), cudaMemcpyDeviceToHost);
  // printf("after DeviceToHost: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaFree(d_heatmap);
  // printf("after Free: %s\n", cudaGetErrorString(cudaGetLastError()));
}

void updateHeatIntensity(int *heatmap, int *x, int *y, int agent_size, int SIZE)
{
  int *d_heatmap, *d_x, *d_y;
  // printf("before malloc: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaMalloc((void **)&d_heatmap, SIZE*SIZE*sizeof(int));
  cudaMalloc((void **)&d_x, agent_size*sizeof(int));
  cudaMalloc((void **)&d_y, agent_size*sizeof(int));
  // printf("after malloc: %s\n", cudaGetErrorString(cudaGetLastError()));

  cudaMemcpyAsync(d_heatmap, heatmap, SIZE*SIZE*sizeof(int), cudaMemcpyHostToDevice);
  cudaMemcpyAsync(d_x, x, agent_size*sizeof(int), cudaMemcpyHostToDevice);
  cudaMemcpyAsync(d_y, y, agent_size*sizeof(int), cudaMemcpyHostToDevice);
  // printf("after memcpy: %s\n", cudaGetErrorString(cudaGetLastError()));
  heatIntensify<<<((agent_size)/THREADSPERBLOCK)+1,THREADSPERBLOCK>>>(d_heatmap, d_x, d_y, agent_size, SIZE);
  // printf("after function: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaMemcpyAsync(heatmap, d_heatmap, SIZE*SIZE*sizeof(int), cudaMemcpyDeviceToHost);
  // cudaMemcpy(x, d_x, agent_size*sizeof(int), cudaMemcpyDeviceToHost);
  // cudaMemcpy(y, d_y, agent_size*sizeof(int), cudaMemcpyDeviceToHost);
  // printf("after memcpy: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaFree(d_heatmap);
  cudaFree(d_x);
  cudaFree(d_y);
  // printf("after free: %s\n", cudaGetErrorString(cudaGetLastError()));
}

void updateSetMaxHeat(int *heatmap, int SIZE)
{
  int *d_heatmap;
  // printf("before malloc: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaMalloc((void **)&d_heatmap, SIZE*SIZE*sizeof(int));
  // printf("after malloc: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaMemcpyAsync(d_heatmap, heatmap, SIZE*SIZE*sizeof(int), cudaMemcpyHostToDevice);
  // printf("after memcpy: %s\n", cudaGetErrorString(cudaGetLastError()));
  setMaxHeat<<<((SIZE*SIZE)/THREADSPERBLOCK)+1,THREADSPERBLOCK>>>(d_heatmap, SIZE);
  // printf("after function: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaMemcpyAsync(heatmap, d_heatmap, SIZE*SIZE*sizeof(int), cudaMemcpyDeviceToHost);
  // printf("after memcpy: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaFree(d_heatmap);
  // printf("after free: %s\n", cudaGetErrorString(cudaGetLastError()));
}

void updateScaledHeatmap(int *heatmap, int *scaledHeatmap, int SIZE, int cellSize)
{
  int scaledSizeSquared = SIZE*SIZE*cellSize*cellSize;
  int *d_heatmap;
  int *d_scaledHeatmap;
  // printf("before malloc1: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaMalloc((void **)&d_heatmap, SIZE*SIZE*sizeof(int));
  cudaMalloc((void **)&d_scaledHeatmap, scaledSizeSquared*sizeof(int));
  // printf("after malloc2: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaMemcpyAsync(d_heatmap, heatmap, SIZE*SIZE*sizeof(int), cudaMemcpyHostToDevice);
  cudaMemcpyAsync(d_scaledHeatmap, scaledHeatmap, scaledSizeSquared*sizeof(int), cudaMemcpyHostToDevice);
  // printf("after memcpy2: %s\n", cudaGetErrorString(cudaGetLastError()));
  scaleHeatmap<<<(SIZE*SIZE)/THREADSPERBLOCK,THREADSPERBLOCK>>>(d_heatmap, d_scaledHeatmap, SIZE, cellSize);
  // printf("after scaleHeatmap: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaMemcpyAsync(heatmap, d_heatmap, SIZE*SIZE*sizeof(int), cudaMemcpyDeviceToHost);
  cudaMemcpyAsync(scaledHeatmap, d_scaledHeatmap, scaledSizeSquared*sizeof(int), cudaMemcpyDeviceToHost);
  // printf("after memecpy: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaFree(d_heatmap);  
  cudaFree(d_scaledHeatmap);  
  // printf("after free: %s\n", cudaGetErrorString(cudaGetLastError()));
}

void updateBlurredHeatmap(int *scaledHeatmap, int *blurredHeatmap, int scaledSize)
{
  int *d_scaledHeatmap;
  int *d_blurredHeatmap;
  // printf("before malloc1: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaMalloc((void **)&d_scaledHeatmap, scaledSize*scaledSize*sizeof(int));
  cudaMalloc((void **)&d_blurredHeatmap, scaledSize*scaledSize*sizeof(int));
  // printf("after malloc2: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaMemcpyAsync(d_blurredHeatmap, blurredHeatmap, scaledSize*scaledSize*sizeof(int), cudaMemcpyHostToDevice);
  cudaMemcpyAsync(d_scaledHeatmap, scaledHeatmap, scaledSize*scaledSize*sizeof(int), cudaMemcpyHostToDevice);
  // printf("after memcpy2: %s\n", cudaGetErrorString(cudaGetLastError()));
  blurHeatmap<<<(scaledSize*scaledSize)/THREADSPERBLOCK,THREADSPERBLOCK>>>(d_scaledHeatmap, d_blurredHeatmap, scaledSize);
  // printf("after scaleHeatmap: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaMemcpyAsync(blurredHeatmap, d_blurredHeatmap, scaledSize*scaledSize*sizeof(int), cudaMemcpyDeviceToHost);
  cudaMemcpyAsync(scaledHeatmap, d_scaledHeatmap, scaledSize*scaledSize*sizeof(int), cudaMemcpyDeviceToHost);
  // printf("after memecpy: %s\n", cudaGetErrorString(cudaGetLastError()));
  cudaFree(d_blurredHeatmap);  
  cudaFree(d_scaledHeatmap);  
  // printf("after free: %s\n", cudaGetErrorString(cudaGetLastError()));  
}
	.file	"tmpxft_0037f989_00000000-6_heatmap_update.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3642:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3642:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z28__device_stub__Z8fadeHeatPiiPii
	.type	_Z28__device_stub__Z8fadeHeatPiiPii, @function
_Z28__device_stub__Z8fadeHeatPiiPii:
.LFB3664:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movl	%esi, 4(%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z8fadeHeatPii(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L2:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3664:
	.size	_Z28__device_stub__Z8fadeHeatPiiPii, .-_Z28__device_stub__Z8fadeHeatPiiPii
	.globl	_Z8fadeHeatPii
	.type	_Z8fadeHeatPii, @function
_Z8fadeHeatPii:
.LFB3665:
	.cfi_startproc
	endbr64
	jmp	_Z28__device_stub__Z8fadeHeatPiiPii
	.cfi_endproc
.LFE3665:
	.size	_Z8fadeHeatPii, .-_Z8fadeHeatPii
	.globl	_Z14updateHeatFadePii
	.type	_Z14updateHeatFadePii, @function
_Z14updateHeatFadePii:
.LFB3635:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%esi, %ebx
	imull	%esi, %ebx
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movslq	%ebx, %rbp
	leaq	8(%rsp), %rdi
	salq	$2, %rbp
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	movq	8(%rsp), %rdi
	xorl	%r8d, %r8d
	movq	%rbp, %rdx
	movl	$1, %ecx
	movq	%r13, %rsi
	call	cudaMemcpyAsync@PLT
	movl	THREADSPERBLOCK(%rip), %ecx
	movl	%ebx, %eax
	xorl	%r9d, %r9d
	movabsq	$4294967297, %rsi
	cltd
	xorl	%r8d, %r8d
	idivl	%ecx
	movq	%rsi, 32(%rsp)
	movl	%ecx, 28(%rsp)
	movl	36(%rsp), %ecx
	movq	%rsi, 20(%rsp)
	movq	28(%rsp), %rdx
	movl	24(%rsp), %esi
	incl	%eax
	movl	%eax, 16(%rsp)
	movq	16(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L9
	movq	8(%rsp), %rdi
	movl	%r12d, %esi
	call	_Z28__device_stub__Z8fadeHeatPiiPii
.L9:
	movq	8(%rsp), %rsi
	xorl	%r8d, %r8d
	movq	%r13, %rdi
	movl	$2, %ecx
	movq	%rbp, %rdx
	call	cudaMemcpyAsync@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$56, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3635:
	.size	_Z14updateHeatFadePii, .-_Z14updateHeatFadePii
	.globl	_Z39__device_stub__Z13heatIntensifyPiS_S_iiPiS_S_ii
	.type	_Z39__device_stub__Z13heatIntensifyPiS_S_iiPiS_S_ii, @function
_Z39__device_stub__Z13heatIntensifyPiS_S_iiPiS_S_ii:
.LFB3666:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	40(%rsp), %rcx
	movl	%r8d, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L12
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z13heatIntensifyPiS_S_ii(%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
.L12:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3666:
	.size	_Z39__device_stub__Z13heatIntensifyPiS_S_iiPiS_S_ii, .-_Z39__device_stub__Z13heatIntensifyPiS_S_iiPiS_S_ii
	.globl	_Z13heatIntensifyPiS_S_ii
	.type	_Z13heatIntensifyPiS_S_ii, @function
_Z13heatIntensifyPiS_S_ii:
.LFB3667:
	.cfi_startproc
	endbr64
	jmp	_Z39__device_stub__Z13heatIntensifyPiS_S_iiPiS_S_ii
	.cfi_endproc
.LFE3667:
	.size	_Z13heatIntensifyPiS_S_ii, .-_Z13heatIntensifyPiS_S_ii
	.globl	_Z19updateHeatIntensityPiS_S_ii
	.type	_Z19updateHeatIntensityPiS_S_ii, @function
_Z19updateHeatIntensityPiS_S_ii:
.LFB3636:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rsi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%r8d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movslq	%ecx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rbp
	salq	$2, %r12
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%r8d, %ebx
	imull	%r8d, %ebx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 8(%rsp)
	movslq	%ebx, %rbx
	leaq	24(%rsp), %rdi
	salq	$2, %rbx
	movq	%rbx, %rsi
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	call	cudaMalloc@PLT
	leaq	32(%rsp), %rdi
	movq	%r12, %rsi
	call	cudaMalloc@PLT
	leaq	40(%rsp), %rdi
	movq	%r12, %rsi
	call	cudaMalloc@PLT
	movq	8(%rsp), %rsi
	xorl	%r8d, %r8d
	movq	%rbx, %rdx
	movq	24(%rsp), %rdi
	movl	$1, %ecx
	call	cudaMemcpyAsync@PLT
	movq	32(%rsp), %rdi
	xorl	%r8d, %r8d
	movq	%r12, %rdx
	movl	$1, %ecx
	movq	%r15, %rsi
	call	cudaMemcpyAsync@PLT
	movq	40(%rsp), %rdi
	xorl	%r8d, %r8d
	movq	%r12, %rdx
	movl	$1, %ecx
	movq	%r14, %rsi
	call	cudaMemcpyAsync@PLT
	movl	THREADSPERBLOCK(%rip), %ecx
	movl	%ebp, %eax
	xorl	%r9d, %r9d
	movabsq	$4294967297, %rsi
	cltd
	xorl	%r8d, %r8d
	idivl	%ecx
	movq	%rsi, 64(%rsp)
	movl	%ecx, 60(%rsp)
	movl	68(%rsp), %ecx
	movq	%rsi, 52(%rsp)
	movq	60(%rsp), %rdx
	movl	56(%rsp), %esi
	incl	%eax
	movl	%eax, 48(%rsp)
	movq	48(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L18
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	%r13d, %r8d
	movl	%ebp, %ecx
	movq	24(%rsp), %rdi
	call	_Z39__device_stub__Z13heatIntensifyPiS_S_iiPiS_S_ii
.L18:
	movq	24(%rsp), %rsi
	movq	8(%rsp), %rdi
	xorl	%r8d, %r8d
	movq	%rbx, %rdx
	movl	$2, %ecx
	call	cudaMemcpyAsync@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	addq	$88, %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
.LFE3636:
	.size	_Z19updateHeatIntensityPiS_S_ii, .-_Z19updateHeatIntensityPiS_S_ii
	.globl	_Z31__device_stub__Z10setMaxHeatPiiPii
	.type	_Z31__device_stub__Z10setMaxHeatPiiPii, @function
_Z31__device_stub__Z10setMaxHeatPiiPii:
.LFB3668:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movl	%esi, 4(%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L21
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z10setMaxHeatPii(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L21:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3668:
	.size	_Z31__device_stub__Z10setMaxHeatPiiPii, .-_Z31__device_stub__Z10setMaxHeatPiiPii
	.globl	_Z10setMaxHeatPii
	.type	_Z10setMaxHeatPii, @function
_Z10setMaxHeatPii:
.LFB3669:
	.cfi_startproc
	endbr64
	jmp	_Z31__device_stub__Z10setMaxHeatPiiPii
	.cfi_endproc
.LFE3669:
	.size	_Z10setMaxHeatPii, .-_Z10setMaxHeatPii
	.globl	_Z16updateSetMaxHeatPii
	.type	_Z16updateSetMaxHeatPii, @function
_Z16updateSetMaxHeatPii:
.LFB3637:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%esi, %ebx
	imull	%esi, %ebx
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movslq	%ebx, %rbp
	leaq	8(%rsp), %rdi
	salq	$2, %rbp
	movq	%rbp, %rsi
	call	cudaMalloc@PLT
	movq	8(%rsp), %rdi
	xorl	%r8d, %r8d
	movq	%rbp, %rdx
	movl	$1, %ecx
	movq	%r13, %rsi
	call	cudaMemcpyAsync@PLT
	movl	THREADSPERBLOCK(%rip), %ecx
	movl	%ebx, %eax
	xorl	%r9d, %r9d
	movabsq	$4294967297, %rsi
	cltd
	xorl	%r8d, %r8d
	idivl	%ecx
	movq	%rsi, 32(%rsp)
	movl	%ecx, 28(%rsp)
	movl	36(%rsp), %ecx
	movq	%rsi, 20(%rsp)
	movq	28(%rsp), %rdx
	movl	24(%rsp), %esi
	incl	%eax
	movl	%eax, 16(%rsp)
	movq	16(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L27
	movq	8(%rsp), %rdi
	movl	%r12d, %esi
	call	_Z31__device_stub__Z10setMaxHeatPiiPii
.L27:
	movq	8(%rsp), %rsi
	xorl	%r8d, %r8d
	movq	%r13, %rdi
	movl	$2, %ecx
	movq	%rbp, %rdx
	call	cudaMemcpyAsync@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	addq	$56, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3637:
	.size	_Z16updateSetMaxHeatPii, .-_Z16updateSetMaxHeatPii
	.globl	_Z36__device_stub__Z12scaleHeatmapPiS_iiPiS_ii
	.type	_Z36__device_stub__Z12scaleHeatmapPiS_iiPiS_ii, @function
_Z36__device_stub__Z12scaleHeatmapPiS_iiPiS_ii:
.LFB3670:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L30
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z12scaleHeatmapPiS_ii(%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
.L30:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3670:
	.size	_Z36__device_stub__Z12scaleHeatmapPiS_iiPiS_ii, .-_Z36__device_stub__Z12scaleHeatmapPiS_iiPiS_ii
	.globl	_Z12scaleHeatmapPiS_ii
	.type	_Z12scaleHeatmapPiS_ii, @function
_Z12scaleHeatmapPiS_ii:
.LFB3671:
	.cfi_startproc
	endbr64
	jmp	_Z36__device_stub__Z12scaleHeatmapPiS_iiPiS_ii
	.cfi_endproc
.LFE3671:
	.size	_Z12scaleHeatmapPiS_ii, .-_Z12scaleHeatmapPiS_ii
	.globl	_Z19updateScaledHeatmapPiS_ii
	.type	_Z19updateScaledHeatmapPiS_ii, @function
_Z19updateScaledHeatmapPiS_ii:
.LFB3638:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edx, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%ecx, %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
	imull	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%ebp, %ebx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movslq	%ebp, %r12
	imull	%ecx, %ebx
	movq	%rsi, 8(%rsp)
	salq	$2, %r12
	leaq	16(%rsp), %rdi
	movq	%r12, %rsi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	imull	%ecx, %ebx
	call	cudaMalloc@PLT
	leaq	24(%rsp), %rdi
	movslq	%ebx, %rbx
	salq	$2, %rbx
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	16(%rsp), %rdi
	xorl	%r8d, %r8d
	movq	%r12, %rdx
	movl	$1, %ecx
	movq	%r14, %rsi
	call	cudaMemcpyAsync@PLT
	movq	8(%rsp), %rsi
	xorl	%r8d, %r8d
	movq	%rbx, %rdx
	movq	24(%rsp), %rdi
	movl	$1, %ecx
	call	cudaMemcpyAsync@PLT
	movl	THREADSPERBLOCK(%rip), %ecx
	movl	%ebp, %eax
	xorl	%r9d, %r9d
	movabsq	$4294967297, %rsi
	cltd
	xorl	%r8d, %r8d
	idivl	%ecx
	movq	%rsi, 48(%rsp)
	movl	%ecx, 44(%rsp)
	movl	52(%rsp), %ecx
	movq	%rsi, 36(%rsp)
	movq	44(%rsp), %rdx
	movl	40(%rsp), %esi
	movl	%eax, 32(%rsp)
	movq	32(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L36
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdi
	movl	%r13d, %ecx
	movl	%r15d, %edx
	call	_Z36__device_stub__Z12scaleHeatmapPiS_iiPiS_ii
.L36:
	movq	16(%rsp), %rsi
	xorl	%r8d, %r8d
	movl	$2, %ecx
	movq	%r12, %rdx
	movq	%r14, %rdi
	call	cudaMemcpyAsync@PLT
	movq	24(%rsp), %rsi
	xorl	%r8d, %r8d
	movq	%rbx, %rdx
	movq	8(%rsp), %rdi
	movl	$2, %ecx
	call	cudaMemcpyAsync@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L37
	call	__stack_chk_fail@PLT
.L37:
	addq	$72, %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
.LFE3638:
	.size	_Z19updateScaledHeatmapPiS_ii, .-_Z19updateScaledHeatmapPiS_ii
	.globl	_Z34__device_stub__Z11blurHeatmapPiS_iPiS_i
	.type	_Z34__device_stub__Z11blurHeatmapPiS_iPiS_i, @function
_Z34__device_stub__Z11blurHeatmapPiS_iPiS_i:
.LFB3672:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L39
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z11blurHeatmapPiS_i(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	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 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L39:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3672:
	.size	_Z34__device_stub__Z11blurHeatmapPiS_iPiS_i, .-_Z34__device_stub__Z11blurHeatmapPiS_iPiS_i
	.globl	_Z11blurHeatmapPiS_i
	.type	_Z11blurHeatmapPiS_i, @function
_Z11blurHeatmapPiS_i:
.LFB3673:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z11blurHeatmapPiS_iPiS_i
	.cfi_endproc
.LFE3673:
	.size	_Z11blurHeatmapPiS_i, .-_Z11blurHeatmapPiS_i
	.globl	_Z20updateBlurredHeatmapPiS_i
	.type	_Z20updateBlurredHeatmapPiS_i, @function
_Z20updateBlurredHeatmapPiS_i:
.LFB3639:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rsi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movl	%edx, %r12d
	imull	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movslq	%r12d, %rbx
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	salq	$2, %rbx
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	leaq	8(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	8(%rsp), %rdi
	xorl	%r8d, %r8d
	movq	%rbx, %rdx
	movl	$1, %ecx
	movq	%r14, %rsi
	call	cudaMemcpyAsync@PLT
	movq	(%rsp), %rdi
	xorl	%r8d, %r8d
	movq	%rbx, %rdx
	movl	$1, %ecx
	movq	%r13, %rsi
	call	cudaMemcpyAsync@PLT
	movl	%r12d, %eax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	THREADSPERBLOCK(%rip), %ecx
	cltd
	movabsq	$4294967297, %rsi
	movq	%rsi, 32(%rsp)
	idivl	%ecx
	movl	%ecx, 28(%rsp)
	movl	36(%rsp), %ecx
	movq	%rsi, 20(%rsp)
	movq	28(%rsp), %rdx
	movl	24(%rsp), %esi
	movl	%eax, 16(%rsp)
	movq	16(%rsp), %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L45
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	%ebp, %edx
	call	_Z34__device_stub__Z11blurHeatmapPiS_iPiS_i
.L45:
	movq	8(%rsp), %rsi
	xorl	%r8d, %r8d
	movl	$2, %ecx
	movq	%rbx, %rdx
	movq	%r14, %rdi
	call	cudaMemcpyAsync@PLT
	movq	(%rsp), %rsi
	xorl	%r8d, %r8d
	movq	%rbx, %rdx
	movl	$2, %ecx
	movq	%r13, %rdi
	call	cudaMemcpyAsync@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L46
	call	__stack_chk_fail@PLT
.L46:
	addq	$48, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3639:
	.size	_Z20updateBlurredHeatmapPiS_i, .-_Z20updateBlurredHeatmapPiS_i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z11blurHeatmapPiS_i"
.LC1:
	.string	"_Z12scaleHeatmapPiS_ii"
.LC2:
	.string	"_Z10setMaxHeatPii"
.LC3:
	.string	"_Z13heatIntensifyPiS_S_ii"
.LC4:
	.string	"_Z8fadeHeatPii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3675:
	.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	_Z11blurHeatmapPiS_i(%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	.LC1(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z12scaleHeatmapPiS_ii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC2(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z10setMaxHeatPii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC3(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z13heatIntensifyPiS_S_ii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC4(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z8fadeHeatPii(%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
.LFE3675:
	.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
	.globl	THREADSPERBLOCK
	.data
	.align 4
	.type	THREADSPERBLOCK, @object
	.size	THREADSPERBLOCK, 4
THREADSPERBLOCK:
	.long	1024
	.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 "ped_model.h"

void updateHeatFade(int *heatmap, int size);
void updateHeatIntensity(int *heatmap, int *x, int *y, int agent_size, int size);
void updateSetMaxHeat(int *heatmap, int size);
void updateScaledHeatmap(int *heatmap, int *scaledHeatmap, int size, int cellSize);
void updateBlurredHeatmap(int *scaledHeatmap, int *blurredHeatmap, int scaledSize);
	.text
	.file	"heatmap_update.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
