#define BLOCK_SIZE 512
#include <stdio.h>
#include <cuda.h>
#include <math.h>

__constant__ float sigma;
__constant__ float rcut;
__constant__ float vrcut;
__constant__ float dvrc12;
__constant__ float dvrcut;
__constant__ int mx;
__constant__ int my;
__constant__ int mz;
__constant__ int natoms;
__constant__ int step;
__constant__ float sfx;
__constant__ float sfy;
__constant__ float sfz;

void copySigma(float *sig)
{
  cudaMemcpyToSymbol("sigma", sig, sizeof(float));
}

void copyRcut(float *rcu)
{
  cudaMemcpyToSymbol("rcut", rcu, sizeof(float));
}

void copyVrcut(float *vrc)
{
  cudaMemcpyToSymbol("vrcut", vrc, sizeof(float));
}

void copyDvrc12(float *dvr)
{
  cudaMemcpyToSymbol("dvrc12", dvr, sizeof(float));
}

void copyDvrcut(float *dvrc)
{
  cudaMemcpyToSymbol("dvrcut", dvrc, sizeof(float));
}

void copyMx(int * m)
{
  cudaMemcpyToSymbol("mx", m, sizeof(int));
}

void copyMy(int *mm)
{
  cudaMemcpyToSymbol("my", mm, sizeof(int));
}

void copyMz(int *mmm)
{
  cudaMemcpyToSymbol("mz", mmm, sizeof(int));
}

void copyNatoms(int *nat)
{
  cudaMemcpyToSymbol("natoms", nat, sizeof(int));
}

void copyStep(int *ste)
{
  cudaMemcpyToSymbol("step", ste, sizeof(int));
}

void copySfx(float *sf)
{
  cudaMemcpyToSymbol("sfx", sf, sizeof(float));
}

void copySfy(float *sff)
{
  cudaMemcpyToSymbol("sfy", sff, sizeof(float));
}

void copySfz(float *sfff)
{
  cudaMemcpyToSymbol("sfz", sfff, sizeof(float));
}



__global__ 
void force (float *virialArray, float *potentialArray, float *rx, float *ry, float *rz, float *fx, float *fy, float *fz, float sigma, float rcut, float vrcut, float dvrc12, float dvrcut, int *head, int *list, int mx, int my, int mz, int natoms, float sfx, float sfy, float sfz)
{
   int element = blockIdx.x * blockDim.x + threadIdx.x;
   /**
   if (element == (natoms - 1))
   {
    printf("\n------------------------------------START------------------------------\n");
    printf("SIGMA: %f\n", sigma);
   }
   */
   float sigsq, rcutsq;
   float rxi, ryi, rzi, fxi, fyi, fzi;
   float rxij, ryij, rzij, rijsq;
   float rij, sr2, sr6, vij, wij, fij, fxij, fyij, fzij;
   int j, jcell;
   float potential, virial;
   int xi, yi, zi, ix, jx, kx, xcell, ycell, zcell;
   __shared__ float vArray[BLOCK_SIZE];
   __shared__ float pArray[BLOCK_SIZE];
   sigsq  = __fmul_rn(sigma, sigma);
   rcutsq = __fmul_rn(rcut,rcut);
   potential = (float)0.0;
   virial = (float)0.0;
   vArray[threadIdx.x] = (float)0.0;
   pArray[threadIdx.x] = (float)0.0;
   if (element < natoms)
   {
  	 rxi = rx[element];
  	 ryi = ry[element];
  	 rzi = rz[element];
     /**
     if (element == (natoms - 1))
     {
       printf("%d: rxi=%f\n",element, rxi);
       printf("%d: ryi=%f\n",element, ryi);
       printf("%d: rzi=%f\n",element, rzi);
     }
     */
     
  	 fxi = (float)0.0;
  	 fyi = (float)0.0;
  	 fzi = (float)0.0;
     //(int)((rxi+0.5)/sfx) + 1;
     //
     xi = (int)( (rxi + (float)0.5) / sfx);
     xi += 1;
  	 yi = (int)( (ryi + (float)0.5) / sfy);
     yi += 1;
  	 zi = (int)( (rzi + (float)0.5) / sfz);
     zi += 1;
     
     /**
     if (element == (natoms - 1))
     {
        printf("%d: xi=%d\n", element, xi);
        printf("%d: yi=%d\n", element, yi);
        printf("%d: zi=%d\n", element, zi);
     } 
     */
     
           if(xi > mx) 
           {
              xi = mx;  
           }
           if(yi > my)
           {
             yi = my;
           }
           if(zi > mz)
           {
             zi = mz;
           }
     
     /**
     if (element == (natoms - 1))
     {
        printf("%d: xi=%d\n", element, xi);
        printf("%d: yi=%d\n", element, yi);
        printf("%d: zi=%d\n", element, zi);
     } 
     */
    
     //CHANGED THIS
     //xi + (mx+2)*(yi+zi*(my+2))
     //icell = __float2int_rn(__fadd_rn(xi,  __fmul_rn(__fadd_rn(mx,2), __fadd_rn(yi, __fmul_rn(zi, __fadd_rn(my,2))))));
     //TO THIS
     //icell = xi;
     
     /**
     if (element == (natoms - 1))
     {
        printf("%d: icell=%d\n",element, icell);
     }
     */
      //icell += (mx+2)*(yi+zi*(my+2));
     
     /**
     if (element == (natoms - 1))
     {
        printf("%d: icell=%d\n",element, icell);
     }
     */

     
  //	 if (xi<0 || xi> mx) printf("\nxi = %d\n",xi);
  //	 if (yi<0 || yi> my) printf("\nyi = %d\n",yi);
  //	 if (zi<0 || zi> mz) printf("\nzi = %d\n",zi);
  //	 if(icell<0||icell>(mx+2)*(my+2)*(mz+2)-1) printf("\nicell = %d\n",icell);
  //	if(step==92&&i==4680){ printf("Particle %5d, (xi,yi,zi) = %d,%d,%d, icell = %5d\n",i,xi,yi,zi,icell);
  //		printf("rx = %f, ry = %f, rz = %f\n",rxi,ryi,rzi);
  //		fflush(stdout);
  //	}
           for (ix=-1;ix<=1;ix++)
               for (jx=-1;jx<=1;jx++)
                   for (kx=-1;kx<=1;kx++){
  		     xcell = ix+xi;
  		     ycell = jx+yi;
  		     zcell = kx+zi;
          /**   
          if (element == (natoms - 1))
          {
            printf("%d: xcell=%d\n",element, xcell);
            printf("%d: ycell=%d\n",element, ycell);
            printf("%d: zcell=%d\n",element, zcell);
                        
          }
          */

                       //CHANGED THIS
                      //jcell = xcell + (mx+2)*(ycell+(my+2)*zcell);
                      //jcell = __float2int_rn(__fadd_rn(xcell, __fmul_rn(__fadd_rn(mx,2),__fadd_rn(ycell,__fmul_rn(__fadd_rn(my,2),zcell)))));
                       jcell = xcell + (mx+2)*(ycell+(my+2)*zcell);
                       //TO THIS
                       //jcell = xcell;
                      /**
                      if (element == (natoms - 1))
                      {
                        printf("%d: jcell=%d\n",element, jcell);              
                      }
                            
                      // jcell += (mx+2)*(ycell+(my+2)*zcell);
                      
                      if (element == (natoms - 1))
                      {
                        printf("%d: jcell=%d\n",element, jcell);              
                      }
                      */
                      
  //	printf("%d (%d,%d,%d); ",jcell,xcell,ycell,zcell);
                       j = head[jcell];
                       /**
                       if (element == (natoms - 1))
                       {
                          printf("%d: j=%d\n",element, j);              
                       }
                       */
  //	 if(jcell<0||jcell>(mx+2)*(my+2)*(mz+2)-1) printf("\njcell = %d\n",jcell);
                       while (j>=0) 
                       {
  //			 if(j<0 || j>ntot-1) printf("\nj = %d\n",j);
                           if (j!=element) 
                           {
                               rxij = __fadd_rn(rxi, -rx[j]);
                               ryij = __fadd_rn(ryi, -ry[j]);
                               rzij = __fadd_rn(rzi, -rz[j]);
                               
                               /**     
                               if (element == (natoms - 1))
                               {
                                  printf("%d: rxij=%f\n",element,rxij);
                                  printf("%d: ryij=%f\n",element,ryij);
                                  printf("%d: rzij=%f\n",element,rzij);
                               }
                               */
                               
                               //rijsq = (rxij*rxij) + (ryij*ryij) + (rzij*rzij);
                               rijsq = __fadd_rn(__fadd_rn(__fmul_rn(rxij,rxij), __fmul_rn(ryij,ryij)), __fmul_rn(rzij,rzij));
                               //TO THIS
                               //rijsq = rxij*rxij;
                               //rijsq += ryij*ryij;
                               //rijsq += rzij*rzij;
                               
                               /**
                               if (element == (natoms - 1))
                               {
                                  printf("%d: rijsq=%f\n",element, rijsq);
                                  printf("%d: rijsq=%f\n",element, rijsq);
                                  printf("%d: rijsq=%f\n",element, rijsq);
                               }
                               */
                               
                               if (rijsq < rcutsq) 
                               {
  			                           //START FORCE_IJ
                                    
                                    rij = __fsqrt_rn(rijsq);
                                    sr2 = __fdiv_rn(sigsq,rijsq);
                                    sr6 = __fmul_rn(__fmul_rn(sr2,sr2),sr2);
                                    //CHANGED THIS
                                    //*vij = sr6*(sr6-1.0) - vrcut - dvrc12*(rij-rcut);
                                    vij = __fadd_rn(__fadd_rn(__fmul_rn(sr6,__fadd_rn(sr6,(float)-1.0)), -vrcut), __fmul_rn(-dvrc12, __fadd_rn(rij,-rcut)));
                                    //TO THIS
                                    //vij = sr6*(sr6-1.0);
                                    //vij -= vrcut;
                                    //vij -= dvrc12*(rij - rcut);
                                    //*wij = sr6*(sr6-0.5) + dvrcut*rij;
                                    wij = __fadd_rn(__fmul_rn(sr6,__fadd_rn(sr6,(float)-0.5)), __fmul_rn(dvrcut,rij));
                                    //TO THIS
                                    //wij = sr6*(sr6-0.5);
                                    //wij += dvrcut*rij;
                                    fij = __fdiv_rn(wij, rijsq);
                                    fxij = __fmul_rn(fij, rxij);
                                    fyij = __fmul_rn(fij, ryij);
                                    fzij = __fmul_rn(fij, rzij);
                                   //END FORCE_IJ
                                   wij = __fmul_rn(wij, (float)0.5);
                                   vij = __fmul_rn(vij, (float)0.5);
                                   potential = __fadd_rn(potential, vij);
                                   virial    = __fadd_rn(virial, wij);
                                   fxi       += fxij;
                                   fyi       += fyij;
                                   fzi       += fzij;
                                  
                                  /**
                                  if (element == (natoms - 1))
                                  {
                                    printf("%d: rij=%f\n",element, rij);
                                    printf("%d: sr2=%f\n",element, sr2);
                                    printf("%d: sr6=%f\n",element, sr6);
                                    printf("%d: vij=%f\n",element, vij);
                                    printf("%d: wij=%f\n",element, wij);
                                    printf("%d: fij=%f\n",element, fij);
                                    printf("%d: fxij=%f\n",element, fxij);
                                    printf("%d: fyij=%f\n",element, fyij);
                                    printf("%d: fzij=%f\n",element, fzij);
                                    printf("%d: potential=%f\n",element, potential);
                                    printf("%d: virial=%f\n",element, virial);
                                    printf("%d: fxi=%f\n",element, fxi);
                                    printf("%d: fyi=%f\n",element, fyi);
                                    printf("%d: fzi=%f\n",element, fzi);
                                  }
                                  */
                               }
  			                    }
                           j = list[j];
                           /**
                           if (element == (natoms - 1))
                           {
                              printf("%d j=%d\n",element, j);
                           }
                           */
                        }
  	         }
           *(fx+element) = __fmul_rn((float)48.0, fxi);
           *(fy+element) = __fmul_rn((float)48.0, fyi);
           *(fz+element) = __fmul_rn((float)48.0, fzi);
            
            /**
            if (element == (natoms - 1))
            {
              printf("%d: fx+element= %f\n",element, *(fx+element));
              printf("%d: fy+element= %f\n",element, *(fy+element));
              printf("%d: fz+element= %f\n",element, *(fz+element));
            }
            */

            vArray[threadIdx.x] = virial;
            //pArray[threadIdx.x] = potential;
            pArray[threadIdx.x] = potential;
            unsigned int t = threadIdx.x;
            unsigned int stride;
            for(stride = blockDim.x / 2; stride >0; stride >>= 1)
            {
               __syncthreads();
               if (t<stride)
               {
                  vArray[t]+= vArray[t+stride];
                  pArray[t]+= pArray[t+stride];
                  //vArray[t]+= vArray[t+stride];
               }
            }
            
            /**
            __syncthreads();
            if (t < 32)
            {
              vArray[t] += vArray[t + 32];
              vArray[t] += vArray[t + 16];
              vArray[t] += vArray[t + 8];
              vArray[t] += vArray[t + 4];
              vArray[t] += vArray[t + 2];
              vArray[t] += vArray[t + 1];
              pArray[t] += pArray[t + 32];
              pArray[t] += pArray[t + 16];
              pArray[t] += pArray[t + 8];
              pArray[t] += pArray[t + 4];
              pArray[t] += pArray[t + 2];
              pArray[t] += pArray[t + 1];
            }
            */
            __syncthreads();
            if (threadIdx.x == 0)
            {
               virialArray[blockIdx.x] = vArray[0];
               potentialArray[blockIdx.x] = pArray[0];
            }            
            /**
            if ((element == 0) || (element == 512))
            {
              printf("%d: vArray[0]= %f\n", element, vArray[0]);
              printf("%d: pArray[0]= %f\n", element, pArray[0]);
            }
            */
            
            /**if (element == (natoms - 1))
            {
              printf("------------------------------------END------------------------------\n");
            }
            */
     }
     //return;

}
	.file	"tmpxft_002d8248_00000000-6_force.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2042:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2042:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0, @function
_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0:
.LFB2189:
	.cfi_startproc
	movl	$1, %r8d
	xorl	%ecx, %ecx
	movl	$4, %edx
	jmp	cudaMemcpyToSymbol@PLT
	.cfi_endproc
.LFE2189:
	.size	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0, .-_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"sigma"
	.text
	.globl	_Z9copySigmaPf
	.type	_Z9copySigmaPf, @function
_Z9copySigmaPf:
.LFB2027:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	.LC0(%rip), %rdi
	jmp	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.cfi_endproc
.LFE2027:
	.size	_Z9copySigmaPf, .-_Z9copySigmaPf
	.section	.rodata.str1.1
.LC1:
	.string	"rcut"
	.text
	.globl	_Z8copyRcutPf
	.type	_Z8copyRcutPf, @function
_Z8copyRcutPf:
.LFB2028:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	.LC1(%rip), %rdi
	jmp	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.cfi_endproc
.LFE2028:
	.size	_Z8copyRcutPf, .-_Z8copyRcutPf
	.section	.rodata.str1.1
.LC2:
	.string	"vrcut"
	.text
	.globl	_Z9copyVrcutPf
	.type	_Z9copyVrcutPf, @function
_Z9copyVrcutPf:
.LFB2029:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	.LC2(%rip), %rdi
	jmp	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.cfi_endproc
.LFE2029:
	.size	_Z9copyVrcutPf, .-_Z9copyVrcutPf
	.section	.rodata.str1.1
.LC3:
	.string	"dvrc12"
	.text
	.globl	_Z10copyDvrc12Pf
	.type	_Z10copyDvrc12Pf, @function
_Z10copyDvrc12Pf:
.LFB2030:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	.LC3(%rip), %rdi
	jmp	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.cfi_endproc
.LFE2030:
	.size	_Z10copyDvrc12Pf, .-_Z10copyDvrc12Pf
	.section	.rodata.str1.1
.LC4:
	.string	"dvrcut"
	.text
	.globl	_Z10copyDvrcutPf
	.type	_Z10copyDvrcutPf, @function
_Z10copyDvrcutPf:
.LFB2031:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	.LC4(%rip), %rdi
	jmp	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.cfi_endproc
.LFE2031:
	.size	_Z10copyDvrcutPf, .-_Z10copyDvrcutPf
	.section	.rodata.str1.1
.LC5:
	.string	"mx"
	.text
	.globl	_Z6copyMxPi
	.type	_Z6copyMxPi, @function
_Z6copyMxPi:
.LFB2032:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	.LC5(%rip), %rdi
	jmp	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.cfi_endproc
.LFE2032:
	.size	_Z6copyMxPi, .-_Z6copyMxPi
	.section	.rodata.str1.1
.LC6:
	.string	"my"
	.text
	.globl	_Z6copyMyPi
	.type	_Z6copyMyPi, @function
_Z6copyMyPi:
.LFB2033:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	.LC6(%rip), %rdi
	jmp	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.cfi_endproc
.LFE2033:
	.size	_Z6copyMyPi, .-_Z6copyMyPi
	.section	.rodata.str1.1
.LC7:
	.string	"mz"
	.text
	.globl	_Z6copyMzPi
	.type	_Z6copyMzPi, @function
_Z6copyMzPi:
.LFB2034:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	.LC7(%rip), %rdi
	jmp	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.cfi_endproc
.LFE2034:
	.size	_Z6copyMzPi, .-_Z6copyMzPi
	.section	.rodata.str1.1
.LC8:
	.string	"natoms"
	.text
	.globl	_Z10copyNatomsPi
	.type	_Z10copyNatomsPi, @function
_Z10copyNatomsPi:
.LFB2035:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	.LC8(%rip), %rdi
	jmp	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.cfi_endproc
.LFE2035:
	.size	_Z10copyNatomsPi, .-_Z10copyNatomsPi
	.section	.rodata.str1.1
.LC9:
	.string	"step"
	.text
	.globl	_Z8copyStepPi
	.type	_Z8copyStepPi, @function
_Z8copyStepPi:
.LFB2036:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	.LC9(%rip), %rdi
	jmp	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.cfi_endproc
.LFE2036:
	.size	_Z8copyStepPi, .-_Z8copyStepPi
	.section	.rodata.str1.1
.LC10:
	.string	"sfx"
	.text
	.globl	_Z7copySfxPf
	.type	_Z7copySfxPf, @function
_Z7copySfxPf:
.LFB2037:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	.LC10(%rip), %rdi
	jmp	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.cfi_endproc
.LFE2037:
	.size	_Z7copySfxPf, .-_Z7copySfxPf
	.section	.rodata.str1.1
.LC11:
	.string	"sfy"
	.text
	.globl	_Z7copySfyPf
	.type	_Z7copySfyPf, @function
_Z7copySfyPf:
.LFB2038:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	.LC11(%rip), %rdi
	jmp	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.cfi_endproc
.LFE2038:
	.size	_Z7copySfyPf, .-_Z7copySfyPf
	.section	.rodata.str1.1
.LC12:
	.string	"sfz"
	.text
	.globl	_Z7copySfzPf
	.type	_Z7copySfzPf, @function
_Z7copySfzPf:
.LFB2039:
	.cfi_startproc
	endbr64
	movq	%rdi, %rsi
	leaq	.LC12(%rip), %rdi
	jmp	_Z18cudaMemcpyToSymbolIA6_cE9cudaErrorRKT_PKvmm14cudaMemcpyKind.constprop.0.isra.0
	.cfi_endproc
.LFE2039:
	.size	_Z7copySfzPf, .-_Z7copySfzPf
	.globl	_Z55__device_stub__Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifffPfS_S_S_S_S_S_S_fffffPiS0_iiiifff
	.type	_Z55__device_stub__Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifffPfS_S_S_S_S_S_S_fffffPiS0_iiiifff, @function
_Z55__device_stub__Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifffPfS_S_S_S_S_S_S_fffffPiS0_iiiifff:
.LFB2064:
	.cfi_startproc
	endbr64
	subq	$376, %rsp
	.cfi_def_cfa_offset 384
	movq	384(%rsp), %rax
	movq	%rdi, 104(%rsp)
	leaq	136(%rsp), %rdi
	movq	%rsi, 96(%rsp)
	leaq	148(%rsp), %rsi
	movq	%rax, 56(%rsp)
	movq	392(%rsp), %rax
	movq	%rdx, 88(%rsp)
	leaq	120(%rsp), %rdx
	movq	%rax, 48(%rsp)
	movq	400(%rsp), %rax
	movq	%rcx, 80(%rsp)
	leaq	128(%rsp), %rcx
	movq	%rax, 16(%rsp)
	movq	408(%rsp), %rax
	movq	%r8, 72(%rsp)
	movq	%r9, 64(%rsp)
	movq	%rax, 8(%rsp)
	movss	%xmm0, 44(%rsp)
	movss	%xmm1, 40(%rsp)
	movss	%xmm2, 36(%rsp)
	movss	%xmm3, 32(%rsp)
	movss	%xmm4, 28(%rsp)
	movss	%xmm5, 24(%rsp)
	movss	%xmm6, 4(%rsp)
	movss	%xmm7, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 360(%rsp)
	xorl	%eax, %eax
	leaq	104(%rsp), %rax
	movq	%rax, 184(%rsp)
	leaq	96(%rsp), %rax
	movq	%rax, 192(%rsp)
	leaq	88(%rsp), %rax
	movq	%rax, 200(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 208(%rsp)
	leaq	72(%rsp), %rax
	movq	%rax, 216(%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 224(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 232(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 240(%rsp)
	leaq	44(%rsp), %rax
	movq	%rax, 248(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 256(%rsp)
	leaq	36(%rsp), %rax
	movq	%rax, 264(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 272(%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 280(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 288(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 296(%rsp)
	leaq	416(%rsp), %rax
	movq	%rax, 304(%rsp)
	leaq	424(%rsp), %rax
	movq	%rax, 312(%rsp)
	leaq	432(%rsp), %rax
	movq	%rax, 320(%rsp)
	leaq	440(%rsp), %rax
	movq	%rax, 328(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 336(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 344(%rsp)
	movq	%rsp, %rax
	movq	%rax, 352(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 136(%rsp)
	movl	$1, 144(%rsp)
	movq	%rax, 148(%rsp)
	movl	$1, 156(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	pushq	128(%rsp)
	.cfi_def_cfa_offset 392
	leaq	_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff(%rip), %rdi
	pushq	128(%rsp)
	.cfi_def_cfa_offset 400
	movq	164(%rsp), %rcx
	movl	172(%rsp), %r8d
	movq	152(%rsp), %rsi
	movl	160(%rsp), %edx
	leaq	200(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 392
	popq	%rdx
	.cfi_def_cfa_offset 384
.L16:
	movq	360(%rsp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	addq	$376, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2064:
	.size	_Z55__device_stub__Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifffPfS_S_S_S_S_S_S_fffffPiS0_iiiifff, .-_Z55__device_stub__Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifffPfS_S_S_S_S_S_S_fffffPiS0_iiiifff
	.globl	_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff
	.type	_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff, @function
_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff:
.LFB2065:
	.cfi_startproc
	endbr64
	jmp	_Z55__device_stub__Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifffPfS_S_S_S_S_S_S_fffffPiS0_iiiifff
	.cfi_endproc
.LFE2065:
	.size	_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff, .-_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff
	.section	.rodata.str1.1
.LC13:
	.string	"_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2067:
	.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	.LC13(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff(%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	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC0(%rip), %rdx
	movl	$4, %r9d
	leaq	_ZL5sigma(%rip), %rsi
	pushq	$1
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC1(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL4rcut(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC2(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL5vrcut(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	popq	%r8
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC3(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL6dvrc12(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%r9
	.cfi_def_cfa_offset 24
	popq	%r10
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC4(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL6dvrcut(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%r11
	.cfi_def_cfa_offset 24
	popq	%rax
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC5(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL2mx(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC6(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL2my(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC7(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL2mz(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	popq	%r8
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC8(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL6natoms(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%r9
	.cfi_def_cfa_offset 24
	popq	%r10
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC9(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL4step(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%r11
	.cfi_def_cfa_offset 24
	popq	%rax
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC10(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL3sfx(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC11(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$4, %r9d
	leaq	_ZL3sfy(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$1
	.cfi_def_cfa_offset 32
	leaq	.LC12(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movl	$4, %r9d
	movq	%rdx, %rcx
	leaq	_ZL3sfz(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%r8
	.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
.LFE2067:
	.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
	.local	_ZL3sfz
	.comm	_ZL3sfz,4,4
	.local	_ZL3sfy
	.comm	_ZL3sfy,4,4
	.local	_ZL3sfx
	.comm	_ZL3sfx,4,4
	.local	_ZL4step
	.comm	_ZL4step,4,4
	.local	_ZL6natoms
	.comm	_ZL6natoms,4,4
	.local	_ZL2mz
	.comm	_ZL2mz,4,4
	.local	_ZL2my
	.comm	_ZL2my,4,4
	.local	_ZL2mx
	.comm	_ZL2mx,4,4
	.local	_ZL6dvrcut
	.comm	_ZL6dvrcut,4,4
	.local	_ZL6dvrc12
	.comm	_ZL6dvrc12,4,4
	.local	_ZL5vrcut
	.comm	_ZL5vrcut,4,4
	.local	_ZL4rcut
	.comm	_ZL4rcut,4,4
	.local	_ZL5sigma
	.comm	_ZL5sigma,4,4
	.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:

#define BLOCK_SIZE 512
#include <stdio.h>
#include <hip/hip_runtime.h>
#include <math.h>

__constant__ float sigma;
__constant__ float rcut;
__constant__ float vrcut;
__constant__ float dvrc12;
__constant__ float dvrcut;
__constant__ int mx;
__constant__ int my;
__constant__ int mz;
__constant__ int natoms;
__constant__ int step;
__constant__ float sfx;
__constant__ float sfy;
__constant__ float sfz;

void copySigma(float *sig)
{
  hipMemcpyToSymbol(HIP_SYMBOL("sigma"), sig, sizeof(float));
}

void copyRcut(float *rcu)
{
  hipMemcpyToSymbol(HIP_SYMBOL("rcut"), rcu, sizeof(float));
}

void copyVrcut(float *vrc)
{
  hipMemcpyToSymbol(HIP_SYMBOL("vrcut"), vrc, sizeof(float));
}

void copyDvrc12(float *dvr)
{
  hipMemcpyToSymbol(HIP_SYMBOL("dvrc12"), dvr, sizeof(float));
}

void copyDvrcut(float *dvrc)
{
  hipMemcpyToSymbol(HIP_SYMBOL("dvrcut"), dvrc, sizeof(float));
}

void copyMx(int * m)
{
  hipMemcpyToSymbol(HIP_SYMBOL("mx"), m, sizeof(int));
}

void copyMy(int *mm)
{
  hipMemcpyToSymbol(HIP_SYMBOL("my"), mm, sizeof(int));
}

void copyMz(int *mmm)
{
  hipMemcpyToSymbol(HIP_SYMBOL("mz"), mmm, sizeof(int));
}

void copyNatoms(int *nat)
{
  hipMemcpyToSymbol(HIP_SYMBOL("natoms"), nat, sizeof(int));
}

void copyStep(int *ste)
{
  hipMemcpyToSymbol(HIP_SYMBOL("step"), ste, sizeof(int));
}

void copySfx(float *sf)
{
  hipMemcpyToSymbol(HIP_SYMBOL("sfx"), sf, sizeof(float));
}

void copySfy(float *sff)
{
  hipMemcpyToSymbol(HIP_SYMBOL("sfy"), sff, sizeof(float));
}

void copySfz(float *sfff)
{
  hipMemcpyToSymbol(HIP_SYMBOL("sfz"), sfff, sizeof(float));
}



__global__ 
void force (float *virialArray, float *potentialArray, float *rx, float *ry, float *rz, float *fx, float *fy, float *fz, float sigma, float rcut, float vrcut, float dvrc12, float dvrcut, int *head, int *list, int mx, int my, int mz, int natoms, float sfx, float sfy, float sfz)
{
   int element = blockIdx.x * blockDim.x + threadIdx.x;
   /**
   if (element == (natoms - 1))
   {
    printf("\n------------------------------------START------------------------------\n");
    printf("SIGMA: %f\n", sigma);
   }
   */
   float sigsq, rcutsq;
   float rxi, ryi, rzi, fxi, fyi, fzi;
   float rxij, ryij, rzij, rijsq;
   float rij, sr2, sr6, vij, wij, fij, fxij, fyij, fzij;
   int j, jcell;
   float potential, virial;
   int xi, yi, zi, ix, jx, kx, xcell, ycell, zcell;
   __shared__ float vArray[BLOCK_SIZE];
   __shared__ float pArray[BLOCK_SIZE];
   sigsq  = __fmul_rn(sigma, sigma);
   rcutsq = __fmul_rn(rcut,rcut);
   potential = (float)0.0;
   virial = (float)0.0;
   vArray[threadIdx.x] = (float)0.0;
   pArray[threadIdx.x] = (float)0.0;
   if (element < natoms)
   {
  	 rxi = rx[element];
  	 ryi = ry[element];
  	 rzi = rz[element];
     /**
     if (element == (natoms - 1))
     {
       printf("%d: rxi=%f\n",element, rxi);
       printf("%d: ryi=%f\n",element, ryi);
       printf("%d: rzi=%f\n",element, rzi);
     }
     */
     
  	 fxi = (float)0.0;
  	 fyi = (float)0.0;
  	 fzi = (float)0.0;
     //(int)((rxi+0.5)/sfx) + 1;
     //
     xi = (int)( (rxi + (float)0.5) / sfx);
     xi += 1;
  	 yi = (int)( (ryi + (float)0.5) / sfy);
     yi += 1;
  	 zi = (int)( (rzi + (float)0.5) / sfz);
     zi += 1;
     
     /**
     if (element == (natoms - 1))
     {
        printf("%d: xi=%d\n", element, xi);
        printf("%d: yi=%d\n", element, yi);
        printf("%d: zi=%d\n", element, zi);
     } 
     */
     
           if(xi > mx) 
           {
              xi = mx;  
           }
           if(yi > my)
           {
             yi = my;
           }
           if(zi > mz)
           {
             zi = mz;
           }
     
     /**
     if (element == (natoms - 1))
     {
        printf("%d: xi=%d\n", element, xi);
        printf("%d: yi=%d\n", element, yi);
        printf("%d: zi=%d\n", element, zi);
     } 
     */
    
     //CHANGED THIS
     //xi + (mx+2)*(yi+zi*(my+2))
     //icell = __float2int_rn(__fadd_rn(xi,  __fmul_rn(__fadd_rn(mx,2), __fadd_rn(yi, __fmul_rn(zi, __fadd_rn(my,2))))));
     //TO THIS
     //icell = xi;
     
     /**
     if (element == (natoms - 1))
     {
        printf("%d: icell=%d\n",element, icell);
     }
     */
      //icell += (mx+2)*(yi+zi*(my+2));
     
     /**
     if (element == (natoms - 1))
     {
        printf("%d: icell=%d\n",element, icell);
     }
     */

     
  //	 if (xi<0 || xi> mx) printf("\nxi = %d\n",xi);
  //	 if (yi<0 || yi> my) printf("\nyi = %d\n",yi);
  //	 if (zi<0 || zi> mz) printf("\nzi = %d\n",zi);
  //	 if(icell<0||icell>(mx+2)*(my+2)*(mz+2)-1) printf("\nicell = %d\n",icell);
  //	if(step==92&&i==4680){ printf("Particle %5d, (xi,yi,zi) = %d,%d,%d, icell = %5d\n",i,xi,yi,zi,icell);
  //		printf("rx = %f, ry = %f, rz = %f\n",rxi,ryi,rzi);
  //		fflush(stdout);
  //	}
           for (ix=-1;ix<=1;ix++)
               for (jx=-1;jx<=1;jx++)
                   for (kx=-1;kx<=1;kx++){
  		     xcell = ix+xi;
  		     ycell = jx+yi;
  		     zcell = kx+zi;
          /**   
          if (element == (natoms - 1))
          {
            printf("%d: xcell=%d\n",element, xcell);
            printf("%d: ycell=%d\n",element, ycell);
            printf("%d: zcell=%d\n",element, zcell);
                        
          }
          */

                       //CHANGED THIS
                      //jcell = xcell + (mx+2)*(ycell+(my+2)*zcell);
                      //jcell = __float2int_rn(__fadd_rn(xcell, __fmul_rn(__fadd_rn(mx,2),__fadd_rn(ycell,__fmul_rn(__fadd_rn(my,2),zcell)))));
                       jcell = xcell + (mx+2)*(ycell+(my+2)*zcell);
                       //TO THIS
                       //jcell = xcell;
                      /**
                      if (element == (natoms - 1))
                      {
                        printf("%d: jcell=%d\n",element, jcell);              
                      }
                            
                      // jcell += (mx+2)*(ycell+(my+2)*zcell);
                      
                      if (element == (natoms - 1))
                      {
                        printf("%d: jcell=%d\n",element, jcell);              
                      }
                      */
                      
  //	printf("%d (%d,%d,%d); ",jcell,xcell,ycell,zcell);
                       j = head[jcell];
                       /**
                       if (element == (natoms - 1))
                       {
                          printf("%d: j=%d\n",element, j);              
                       }
                       */
  //	 if(jcell<0||jcell>(mx+2)*(my+2)*(mz+2)-1) printf("\njcell = %d\n",jcell);
                       while (j>=0) 
                       {
  //			 if(j<0 || j>ntot-1) printf("\nj = %d\n",j);
                           if (j!=element) 
                           {
                               rxij = __fadd_rn(rxi, -rx[j]);
                               ryij = __fadd_rn(ryi, -ry[j]);
                               rzij = __fadd_rn(rzi, -rz[j]);
                               
                               /**     
                               if (element == (natoms - 1))
                               {
                                  printf("%d: rxij=%f\n",element,rxij);
                                  printf("%d: ryij=%f\n",element,ryij);
                                  printf("%d: rzij=%f\n",element,rzij);
                               }
                               */
                               
                               //rijsq = (rxij*rxij) + (ryij*ryij) + (rzij*rzij);
                               rijsq = __fadd_rn(__fadd_rn(__fmul_rn(rxij,rxij), __fmul_rn(ryij,ryij)), __fmul_rn(rzij,rzij));
                               //TO THIS
                               //rijsq = rxij*rxij;
                               //rijsq += ryij*ryij;
                               //rijsq += rzij*rzij;
                               
                               /**
                               if (element == (natoms - 1))
                               {
                                  printf("%d: rijsq=%f\n",element, rijsq);
                                  printf("%d: rijsq=%f\n",element, rijsq);
                                  printf("%d: rijsq=%f\n",element, rijsq);
                               }
                               */
                               
                               if (rijsq < rcutsq) 
                               {
  			                           //START FORCE_IJ
                                    
                                    rij = __fsqrt_rn(rijsq);
                                    sr2 = __fdiv_rn(sigsq,rijsq);
                                    sr6 = __fmul_rn(__fmul_rn(sr2,sr2),sr2);
                                    //CHANGED THIS
                                    //*vij = sr6*(sr6-1.0) - vrcut - dvrc12*(rij-rcut);
                                    vij = __fadd_rn(__fadd_rn(__fmul_rn(sr6,__fadd_rn(sr6,(float)-1.0)), -vrcut), __fmul_rn(-dvrc12, __fadd_rn(rij,-rcut)));
                                    //TO THIS
                                    //vij = sr6*(sr6-1.0);
                                    //vij -= vrcut;
                                    //vij -= dvrc12*(rij - rcut);
                                    //*wij = sr6*(sr6-0.5) + dvrcut*rij;
                                    wij = __fadd_rn(__fmul_rn(sr6,__fadd_rn(sr6,(float)-0.5)), __fmul_rn(dvrcut,rij));
                                    //TO THIS
                                    //wij = sr6*(sr6-0.5);
                                    //wij += dvrcut*rij;
                                    fij = __fdiv_rn(wij, rijsq);
                                    fxij = __fmul_rn(fij, rxij);
                                    fyij = __fmul_rn(fij, ryij);
                                    fzij = __fmul_rn(fij, rzij);
                                   //END FORCE_IJ
                                   wij = __fmul_rn(wij, (float)0.5);
                                   vij = __fmul_rn(vij, (float)0.5);
                                   potential = __fadd_rn(potential, vij);
                                   virial    = __fadd_rn(virial, wij);
                                   fxi       += fxij;
                                   fyi       += fyij;
                                   fzi       += fzij;
                                  
                                  /**
                                  if (element == (natoms - 1))
                                  {
                                    printf("%d: rij=%f\n",element, rij);
                                    printf("%d: sr2=%f\n",element, sr2);
                                    printf("%d: sr6=%f\n",element, sr6);
                                    printf("%d: vij=%f\n",element, vij);
                                    printf("%d: wij=%f\n",element, wij);
                                    printf("%d: fij=%f\n",element, fij);
                                    printf("%d: fxij=%f\n",element, fxij);
                                    printf("%d: fyij=%f\n",element, fyij);
                                    printf("%d: fzij=%f\n",element, fzij);
                                    printf("%d: potential=%f\n",element, potential);
                                    printf("%d: virial=%f\n",element, virial);
                                    printf("%d: fxi=%f\n",element, fxi);
                                    printf("%d: fyi=%f\n",element, fyi);
                                    printf("%d: fzi=%f\n",element, fzi);
                                  }
                                  */
                               }
  			                    }
                           j = list[j];
                           /**
                           if (element == (natoms - 1))
                           {
                              printf("%d j=%d\n",element, j);
                           }
                           */
                        }
  	         }
           *(fx+element) = __fmul_rn((float)48.0, fxi);
           *(fy+element) = __fmul_rn((float)48.0, fyi);
           *(fz+element) = __fmul_rn((float)48.0, fzi);
            
            /**
            if (element == (natoms - 1))
            {
              printf("%d: fx+element= %f\n",element, *(fx+element));
              printf("%d: fy+element= %f\n",element, *(fy+element));
              printf("%d: fz+element= %f\n",element, *(fz+element));
            }
            */

            vArray[threadIdx.x] = virial;
            //pArray[threadIdx.x] = potential;
            pArray[threadIdx.x] = potential;
            unsigned int t = threadIdx.x;
            unsigned int stride;
            for(stride = blockDim.x / 2; stride >0; stride >>= 1)
            {
               __syncthreads();
               if (t<stride)
               {
                  vArray[t]+= vArray[t+stride];
                  pArray[t]+= pArray[t+stride];
                  //vArray[t]+= vArray[t+stride];
               }
            }
            
            /**
            __syncthreads();
            if (t < 32)
            {
              vArray[t] += vArray[t + 32];
              vArray[t] += vArray[t + 16];
              vArray[t] += vArray[t + 8];
              vArray[t] += vArray[t + 4];
              vArray[t] += vArray[t + 2];
              vArray[t] += vArray[t + 1];
              pArray[t] += pArray[t + 32];
              pArray[t] += pArray[t + 16];
              pArray[t] += pArray[t + 8];
              pArray[t] += pArray[t + 4];
              pArray[t] += pArray[t + 2];
              pArray[t] += pArray[t + 1];
            }
            */
            __syncthreads();
            if (threadIdx.x == 0)
            {
               virialArray[blockIdx.x] = vArray[0];
               potentialArray[blockIdx.x] = pArray[0];
            }            
            /**
            if ((element == 0) || (element == 512))
            {
              printf("%d: vArray[0]= %f\n", element, vArray[0]);
              printf("%d: pArray[0]= %f\n", element, pArray[0]);
            }
            */
            
            /**if (element == (natoms - 1))
            {
              printf("------------------------------------END------------------------------\n");
            }
            */
     }
     //return;

}
	.text
	.file	"force.hip"
	.globl	_Z9copySigmaPf                  # -- Begin function _Z9copySigmaPf
	.type	_Z9copySigmaPf,@function
_Z9copySigmaPf:                         # @_Z9copySigmaPf
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$.L.str, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end0:
	.size	_Z9copySigmaPf, .Lfunc_end0-_Z9copySigmaPf
	.cfi_endproc
                                        # -- End function
	.globl	_Z8copyRcutPf                   # -- Begin function _Z8copyRcutPf
	.type	_Z8copyRcutPf,@function
_Z8copyRcutPf:                          # @_Z8copyRcutPf
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$.L.str.1, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end1:
	.size	_Z8copyRcutPf, .Lfunc_end1-_Z8copyRcutPf
	.cfi_endproc
                                        # -- End function
	.globl	_Z9copyVrcutPf                  # -- Begin function _Z9copyVrcutPf
	.type	_Z9copyVrcutPf,@function
_Z9copyVrcutPf:                         # @_Z9copyVrcutPf
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$.L.str.2, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end2:
	.size	_Z9copyVrcutPf, .Lfunc_end2-_Z9copyVrcutPf
	.cfi_endproc
                                        # -- End function
	.globl	_Z10copyDvrc12Pf                # -- Begin function _Z10copyDvrc12Pf
	.type	_Z10copyDvrc12Pf,@function
_Z10copyDvrc12Pf:                       # @_Z10copyDvrc12Pf
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$.L.str.3, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end3:
	.size	_Z10copyDvrc12Pf, .Lfunc_end3-_Z10copyDvrc12Pf
	.cfi_endproc
                                        # -- End function
	.globl	_Z10copyDvrcutPf                # -- Begin function _Z10copyDvrcutPf
	.type	_Z10copyDvrcutPf,@function
_Z10copyDvrcutPf:                       # @_Z10copyDvrcutPf
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$.L.str.4, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end4:
	.size	_Z10copyDvrcutPf, .Lfunc_end4-_Z10copyDvrcutPf
	.cfi_endproc
                                        # -- End function
	.globl	_Z6copyMxPi                     # -- Begin function _Z6copyMxPi
	.type	_Z6copyMxPi,@function
_Z6copyMxPi:                            # @_Z6copyMxPi
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$.L.str.5, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end5:
	.size	_Z6copyMxPi, .Lfunc_end5-_Z6copyMxPi
	.cfi_endproc
                                        # -- End function
	.globl	_Z6copyMyPi                     # -- Begin function _Z6copyMyPi
	.type	_Z6copyMyPi,@function
_Z6copyMyPi:                            # @_Z6copyMyPi
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$.L.str.6, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end6:
	.size	_Z6copyMyPi, .Lfunc_end6-_Z6copyMyPi
	.cfi_endproc
                                        # -- End function
	.globl	_Z6copyMzPi                     # -- Begin function _Z6copyMzPi
	.type	_Z6copyMzPi,@function
_Z6copyMzPi:                            # @_Z6copyMzPi
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$.L.str.7, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end7:
	.size	_Z6copyMzPi, .Lfunc_end7-_Z6copyMzPi
	.cfi_endproc
                                        # -- End function
	.globl	_Z10copyNatomsPi                # -- Begin function _Z10copyNatomsPi
	.type	_Z10copyNatomsPi,@function
_Z10copyNatomsPi:                       # @_Z10copyNatomsPi
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$.L.str.8, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end8:
	.size	_Z10copyNatomsPi, .Lfunc_end8-_Z10copyNatomsPi
	.cfi_endproc
                                        # -- End function
	.globl	_Z8copyStepPi                   # -- Begin function _Z8copyStepPi
	.type	_Z8copyStepPi,@function
_Z8copyStepPi:                          # @_Z8copyStepPi
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$.L.str.9, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end9:
	.size	_Z8copyStepPi, .Lfunc_end9-_Z8copyStepPi
	.cfi_endproc
                                        # -- End function
	.globl	_Z7copySfxPf                    # -- Begin function _Z7copySfxPf
	.type	_Z7copySfxPf,@function
_Z7copySfxPf:                           # @_Z7copySfxPf
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$.L.str.10, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end10:
	.size	_Z7copySfxPf, .Lfunc_end10-_Z7copySfxPf
	.cfi_endproc
                                        # -- End function
	.globl	_Z7copySfyPf                    # -- Begin function _Z7copySfyPf
	.type	_Z7copySfyPf,@function
_Z7copySfyPf:                           # @_Z7copySfyPf
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$.L.str.11, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end11:
	.size	_Z7copySfyPf, .Lfunc_end11-_Z7copySfyPf
	.cfi_endproc
                                        # -- End function
	.globl	_Z7copySfzPf                    # -- Begin function _Z7copySfzPf
	.type	_Z7copySfzPf,@function
_Z7copySfzPf:                           # @_Z7copySfzPf
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rsi
	movl	$.L.str.12, %edi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movl	$1, %r8d
	jmp	hipMemcpyToSymbol               # TAILCALL
.Lfunc_end12:
	.size	_Z7copySfzPf, .Lfunc_end12-_Z7copySfzPf
	.cfi_endproc
                                        # -- End function
	.globl	_Z20__device_stub__forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff # -- Begin function _Z20__device_stub__forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff
	.type	_Z20__device_stub__forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff,@function
_Z20__device_stub__forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff: # @_Z20__device_stub__forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff
	.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	$312, %rsp                      # imm = 0x138
	.cfi_def_cfa_offset 368
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	leaq	88(%rsp), %r10
	movq	%rdi, (%r10)
	leaq	80(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	72(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	64(%rsp), %r11
	movq	%rcx, (%r11)
	leaq	56(%rsp), %r14
	movq	%r8, (%r14)
	leaq	48(%rsp), %r8
	movq	%r9, (%r8)
	leaq	28(%rsp), %r9
	movss	%xmm0, (%r9)
	leaq	24(%rsp), %r15
	movss	%xmm1, (%r15)
	leaq	20(%rsp), %r12
	movss	%xmm2, (%r12)
	leaq	16(%rsp), %r13
	movss	%xmm3, (%r13)
	leaq	12(%rsp), %rbp
	movss	%xmm4, (%rbp)
	leaq	8(%rsp), %rax
	movss	%xmm5, (%rax)
	leaq	4(%rsp), %rcx
	movss	%xmm6, (%rcx)
	movq	%rsp, %rdx
	movss	%xmm7, (%rdx)
	leaq	128(%rsp), %rbx
	movq	%r10, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%r11, 24(%rbx)
	movq	%r14, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	368(%rsp), %rsi
	movq	%rsi, 48(%rbx)
	leaq	376(%rsp), %rsi
	movq	%rsi, 56(%rbx)
	movq	%r9, 64(%rbx)
	movq	%r15, 72(%rbx)
	movq	%r12, 80(%rbx)
	movq	%r13, 88(%rbx)
	movq	%rbp, 96(%rbx)
	leaq	384(%rsp), %rsi
	movq	%rsi, 104(%rbx)
	leaq	392(%rsp), %rsi
	movq	%rsi, 112(%rbx)
	leaq	400(%rsp), %rsi
	movq	%rsi, 120(%rbx)
	leaq	408(%rsp), %rsi
	movq	%rsi, 128(%rbx)
	leaq	416(%rsp), %rsi
	movq	%rsi, 136(%rbx)
	leaq	424(%rsp), %rsi
	movq	%rsi, 144(%rbx)
	movq	%rax, 152(%rbx)
	movq	%rcx, 160(%rbx)
	movq	%rdx, 168(%rbx)
	leaq	112(%rsp), %r14
	leaq	96(%rsp), %r15
	leaq	40(%rsp), %r12
	leaq	32(%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	$_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$328, %rsp                      # imm = 0x148
	.cfi_adjust_cfa_offset -328
	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_end13:
	.size	_Z20__device_stub__forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff, .Lfunc_end13-_Z20__device_stub__forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff
	.cfi_endproc
                                        # -- End function
	.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
	.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:
	subq	$32, %rsp
	.cfi_adjust_cfa_offset 32
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movl	$sigma, %esi
	movl	$.L.str, %edx
	movl	$.L.str, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$rcut, %esi
	movl	$.L.str.1, %edx
	movl	$.L.str.1, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$vrcut, %esi
	movl	$.L.str.2, %edx
	movl	$.L.str.2, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$dvrc12, %esi
	movl	$.L.str.3, %edx
	movl	$.L.str.3, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$dvrcut, %esi
	movl	$.L.str.4, %edx
	movl	$.L.str.4, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$mx, %esi
	movl	$.L.str.5, %edx
	movl	$.L.str.5, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$my, %esi
	movl	$.L.str.6, %edx
	movl	$.L.str.6, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$mz, %esi
	movl	$.L.str.7, %edx
	movl	$.L.str.7, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$natoms, %esi
	movl	$.L.str.8, %edx
	movl	$.L.str.8, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$step, %esi
	movl	$.L.str.9, %edx
	movl	$.L.str.9, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$sfx, %esi
	movl	$.L.str.10, %edx
	movl	$.L.str.10, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$sfy, %esi
	movl	$.L.str.11, %edx
	movl	$.L.str.11, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$sfz, %esi
	movl	$.L.str.12, %edx
	movl	$.L.str.12, %ecx
	movl	$4, %r9d
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$1
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$__hip_module_dtor, %edi
	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	sigma,@object                   # @sigma
	.local	sigma
	.comm	sigma,4,4
	.type	rcut,@object                    # @rcut
	.local	rcut
	.comm	rcut,4,4
	.type	vrcut,@object                   # @vrcut
	.local	vrcut
	.comm	vrcut,4,4
	.type	dvrc12,@object                  # @dvrc12
	.local	dvrc12
	.comm	dvrc12,4,4
	.type	dvrcut,@object                  # @dvrcut
	.local	dvrcut
	.comm	dvrcut,4,4
	.type	mx,@object                      # @mx
	.local	mx
	.comm	mx,4,4
	.type	my,@object                      # @my
	.local	my
	.comm	my,4,4
	.type	mz,@object                      # @mz
	.local	mz
	.comm	mz,4,4
	.type	natoms,@object                  # @natoms
	.local	natoms
	.comm	natoms,4,4
	.type	step,@object                    # @step
	.local	step
	.comm	step,4,4
	.type	sfx,@object                     # @sfx
	.local	sfx
	.comm	sfx,4,4
	.type	sfy,@object                     # @sfy
	.local	sfy
	.comm	sfy,4,4
	.type	sfz,@object                     # @sfz
	.local	sfz
	.comm	sfz,4,4
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"sigma"
	.size	.L.str, 6

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"rcut"
	.size	.L.str.1, 5

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"vrcut"
	.size	.L.str.2, 6

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"dvrcut"
	.size	.L.str.4, 7

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

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

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

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

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"step"
	.size	.L.str.9, 5

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"sfx"
	.size	.L.str.10, 4

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"sfy"
	.size	.L.str.11, 4

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"sfz"
	.size	.L.str.12, 4

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

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

	.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 _Z20__device_stub__forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym sigma
	.addrsig_sym rcut
	.addrsig_sym vrcut
	.addrsig_sym dvrc12
	.addrsig_sym dvrcut
	.addrsig_sym mx
	.addrsig_sym my
	.addrsig_sym mz
	.addrsig_sym natoms
	.addrsig_sym step
	.addrsig_sym sfx
	.addrsig_sym sfy
	.addrsig_sym sfz
	.addrsig_sym _Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff ; -- Begin function _Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff
	.globl	_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff
	.p2align	8
	.type	_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff,@function
_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff: ; @_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x94
	s_load_b128 s[28:31], s[0:1], 0x68
	s_mov_b32 s34, s15
	v_dual_mov_b32 v3, 0 :: v_dual_lshlrev_b32 v10, 2, v0
	ds_store_2addr_stride64_b32 v10, v3, v3 offset1:8
	s_waitcnt lgkmcnt(0)
	s_and_b32 s33, s2, 0xffff
	s_mov_b32 s2, exec_lo
	v_mad_u64_u32 v[1:2], null, s34, s33, v[0:1]
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s31, v1
	s_cbranch_execz .LBB0_21
; %bb.1:
	s_load_b512 s[4:19], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_clause 0x1
	s_load_b128 s[36:39], s[0:1], 0x78
	s_load_b128 s[20:23], s[0:1], 0x58
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[4:5], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v6, vcc_lo, s8, v4
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v7, vcc_lo, s9, v5, vcc_lo
	v_add_co_u32 v8, vcc_lo, s10, v4
	v_add_co_ci_u32_e32 v9, vcc_lo, s11, v5, vcc_lo
	v_add_co_u32 v14, vcc_lo, s12, v4
	v_add_co_ci_u32_e32 v15, vcc_lo, s13, v5, vcc_lo
	global_load_b32 v12, v[6:7], off
	global_load_b32 v13, v[8:9], off
	global_load_b32 v14, v[14:15], off
	s_clause 0x1
	s_load_b128 s[24:27], s[0:1], 0x40
	s_load_b32 s1, s[0:1], 0x50
	s_waitcnt vmcnt(0)
	v_dual_add_f32 v2, 0.5, v12 :: v_dual_add_f32 v7, 0.5, v14
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_div_scale_f32 v8, null, s36, s36, v2
	v_div_scale_f32 v19, vcc_lo, v2, s36, v2
	v_div_scale_f32 v15, null, s38, s38, v7
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_rcp_f32_e32 v16, v8
	v_div_scale_f32 v23, s3, v7, s38, v7
	v_rcp_f32_e32 v18, v15
	s_waitcnt_depctr 0xfff
	v_fma_f32 v11, -v8, v16, 1.0
	v_fma_f32 v22, -v15, v18, 1.0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v16, v11, v16
	v_dual_add_f32 v6, 0.5, v13 :: v_dual_add_nc_u32 v11, 0x800, v10
	v_div_scale_f32 v9, null, s37, s37, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v17, v9
	s_waitcnt_depctr 0xfff
	v_fma_f32 v21, -v9, v17, 1.0
	v_fmac_f32_e32 v17, v21, v17
	v_mul_f32_e32 v21, v19, v16
	v_div_scale_f32 v20, s2, v6, s37, v6
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fma_f32 v25, -v8, v21, v19
	v_fmac_f32_e32 v18, v22, v18
	v_dual_mul_f32 v22, v20, v17 :: v_dual_fmac_f32 v21, v25, v16
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v24, v23, v18
	v_fma_f32 v26, -v9, v22, v20
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v8, -v8, v21, v19
	v_dual_mov_b32 v19, 0 :: v_dual_fmac_f32 v22, v26, v17
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f32 v27, -v15, v24, v23
	v_div_fmas_f32 v8, v8, v16, v21
	s_mov_b32 vcc_lo, s2
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f32 v9, -v9, v22, v20
	v_fmac_f32_e32 v24, v27, v18
	s_waitcnt lgkmcnt(0)
	v_mul_f32_e64 v20, s24, s24
	v_div_fixup_f32 v2, v8, s36, v2
	v_mul_f32_e64 v21, s25, s25
	v_div_fmas_f32 v9, v9, v17, v22
	v_fma_f32 v15, -v15, v24, v23
	s_mov_b32 vcc_lo, s3
	v_cvt_i32_f32_e32 v2, v2
	v_mov_b32_e32 v17, 0
	v_div_fixup_f32 v6, v9, s37, v6
	v_div_fmas_f32 v15, v15, v18, v24
	s_add_i32 s2, s28, 2
	v_cmp_gt_i32_e32 vcc_lo, s28, v2
	s_add_i32 s3, s29, 2
	v_cvt_i32_f32_e32 v6, v6
	v_div_fixup_f32 v7, v15, s38, v7
	v_dual_mov_b32 v15, 0 :: v_dual_mov_b32 v16, 0
	s_mov_b32 s24, -1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v9, 1, v6
	v_add_nc_u32_e32 v8, 1, v2
	v_cvt_i32_f32_e32 v7, v7
	v_cndmask_b32_e32 v22, s28, v8, vcc_lo
	v_cmp_gt_i32_e32 vcc_lo, s29, v6
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_cndmask_b32 v23, s29, v9 :: v_dual_add_nc_u32 v18, 1, v7
	v_cmp_gt_i32_e32 vcc_lo, s30, v7
	v_cndmask_b32_e32 v24, s30, v18, vcc_lo
	v_mov_b32_e32 v18, 0
.LBB0_2:                                ; %.preheader180
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
                                        ;       Child Loop BB0_4 Depth 3
                                        ;         Child Loop BB0_6 Depth 4
	v_add_nc_u32_e32 v6, s24, v22
	s_mov_b32 s28, -1
.LBB0_3:                                ; %.preheader
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_4 Depth 3
                                        ;         Child Loop BB0_6 Depth 4
	s_delay_alu instid0(SALU_CYCLE_1)
	v_add_nc_u32_e32 v7, s28, v23
	s_mov_b32 s29, -1
.LBB0_4:                                ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_3 Depth=2
                                        ; =>    This Loop Header: Depth=3
                                        ;         Child Loop BB0_6 Depth 4
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v2, s29, v24
	s_mov_b32 s30, exec_lo
	v_mad_u64_u32 v[8:9], null, v2, s3, v[7:8]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[25:26], null, v8, s2, v[6:7]
	v_ashrrev_i32_e32 v26, 31, v25
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[8:9], 2, v[25:26]
	v_add_co_u32 v8, vcc_lo, s20, v8
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v9, vcc_lo, s21, v9, vcc_lo
	global_load_b32 v2, v[8:9], off
	s_waitcnt vmcnt(0)
	v_cmpx_lt_i32_e32 -1, v2
	s_cbranch_execz .LBB0_12
; %bb.5:                                ; %.lr.ph.preheader
                                        ;   in Loop: Header=BB0_4 Depth=3
	s_mov_b32 s31, 0
.LBB0_6:                                ; %.lr.ph
                                        ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_3 Depth=2
                                        ;       Parent Loop BB0_4 Depth=3
                                        ; =>      This Inner Loop Header: Depth=4
	v_lshlrev_b64 v[8:9], 2, v[2:3]
	s_mov_b32 s35, exec_lo
	v_cmpx_ne_u32_e64 v2, v1
	s_cbranch_execz .LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=4
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_u32 v25, vcc_lo, s8, v8
	v_add_co_ci_u32_e32 v26, vcc_lo, s9, v9, vcc_lo
	v_add_co_u32 v27, vcc_lo, s10, v8
	v_add_co_ci_u32_e32 v28, vcc_lo, s11, v9, vcc_lo
	s_mov_b32 s36, exec_lo
	global_load_b32 v29, v[25:26], off
	global_load_b32 v2, v[27:28], off
	v_add_co_u32 v25, vcc_lo, s12, v8
	v_add_co_ci_u32_e32 v26, vcc_lo, s13, v9, vcc_lo
	global_load_b32 v25, v[25:26], off
	s_waitcnt vmcnt(0)
	v_dual_sub_f32 v2, v13, v2 :: v_dual_sub_f32 v25, v14, v25
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_dual_sub_f32 v26, v12, v29 :: v_dual_mul_f32 v27, v2, v2
	v_fmac_f32_e32 v27, v26, v26
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v27, v25, v25
	v_cmpx_lt_f32_e32 v27, v21
	s_cbranch_execz .LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=4
	v_div_scale_f32 v28, null, v27, v27, v20
	v_div_scale_f32 v31, vcc_lo, v20, v27, v20
	v_cmp_gt_f32_e64 s0, 0x800000, v27
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v29, v28
	s_waitcnt_depctr 0xfff
	v_fma_f32 v30, -v28, v29, 1.0
	v_fmac_f32_e32 v29, v30, v29
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v30, v31, v29
	v_fma_f32 v32, -v28, v30, v31
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v30, v32, v29
	v_cndmask_b32_e64 v32, 0, 1, s0
	v_fma_f32 v28, -v28, v30, v31
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b32_e32 v31, 5, v32
	v_div_fmas_f32 v28, v28, v29, v30
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_ldexp_f32 v29, v27, v31
	v_cndmask_b32_e64 v31, 0, -16, s0
	v_div_fixup_f32 v28, v28, v27, v20
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_sqrt_f32_e32 v29, v29
	v_mul_f32_e32 v30, v28, v28
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_2)
	v_fma_f32 v33, v28, v30, -0.5
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v29, v29, v31
	v_mul_f32_e32 v32, v28, v30
	v_fma_f32 v28, v28, v30, -1.0
	v_mul_f32_e32 v31, v32, v33
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_fmac_f32_e32 v31, s1, v29
	v_subrev_f32_e32 v29, s25, v29
	v_fma_f32 v28, v32, v28, -s26
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_div_scale_f32 v33, null, v27, v27, v31
	v_div_scale_f32 v36, vcc_lo, v31, v27, v31
	v_fma_f32 v28, -v29, s27, v28
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_rcp_f32_e32 v34, v33
	v_dual_fmac_f32 v15, 0.5, v31 :: v_dual_fmac_f32 v18, 0.5, v28
	s_waitcnt_depctr 0xfff
	v_fma_f32 v35, -v33, v34, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v34, v35, v34
	v_mul_f32_e32 v35, v36, v34
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v37, -v33, v35, v36
	v_fmac_f32_e32 v35, v37, v34
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v30, -v33, v35, v36
	v_div_fmas_f32 v30, v30, v34, v35
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_fixup_f32 v27, v30, v27, v31
	v_fmac_f32_e32 v19, v26, v27
	v_fmac_f32_e32 v17, v2, v27
	v_fmac_f32_e32 v16, v25, v27
.LBB0_9:                                ; %Flow285
                                        ;   in Loop: Header=BB0_6 Depth=4
	s_or_b32 exec_lo, exec_lo, s36
.LBB0_10:                               ; %.lr.ph._crit_edge
                                        ;   in Loop: Header=BB0_6 Depth=4
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	s_or_b32 exec_lo, exec_lo, s35
	v_add_co_u32 v8, vcc_lo, s22, v8
	v_add_co_ci_u32_e32 v9, vcc_lo, s23, v9, vcc_lo
	global_load_b32 v2, v[8:9], off
	s_waitcnt vmcnt(0)
	v_cmp_gt_i32_e32 vcc_lo, 0, v2
	s_or_b32 s31, vcc_lo, s31
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s31
	s_cbranch_execnz .LBB0_6
; %bb.11:                               ; %Flow286
                                        ;   in Loop: Header=BB0_4 Depth=3
	s_or_b32 exec_lo, exec_lo, s31
.LBB0_12:                               ; %Flow287
                                        ;   in Loop: Header=BB0_4 Depth=3
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s30
	s_add_i32 s29, s29, 1
	s_cmp_lg_u32 s29, 2
	s_cbranch_scc1 .LBB0_4
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=2
	s_add_i32 s28, s28, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u32 s28, 2
	s_cbranch_scc1 .LBB0_3
; %bb.14:                               ;   in Loop: Header=BB0_2 Depth=1
	s_add_i32 s24, s24, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u32 s24, 2
	s_cbranch_scc1 .LBB0_2
; %bb.15:
	v_add_co_u32 v1, vcc_lo, s14, v4
	v_add_co_ci_u32_e32 v2, vcc_lo, s15, v5, vcc_lo
	v_add_co_u32 v6, vcc_lo, s16, v4
	v_add_co_ci_u32_e32 v7, vcc_lo, s17, v5, vcc_lo
	v_dual_mul_f32 v8, 0x42400000, v19 :: v_dual_mul_f32 v9, 0x42400000, v17
	v_add_co_u32 v3, vcc_lo, s18, v4
	v_mul_f32_e32 v12, 0x42400000, v16
	v_add_co_ci_u32_e32 v4, vcc_lo, s19, v5, vcc_lo
	s_cmp_lt_u32 s33, 2
	global_store_b32 v[1:2], v8, off
	global_store_b32 v[6:7], v9, off
	global_store_b32 v[3:4], v12, off
	ds_store_b32 v11, v15
	ds_store_b32 v10, v18
	s_cbranch_scc1 .LBB0_19
.LBB0_16:                               ; %.lr.ph214
                                        ; =>This Inner Loop Header: Depth=1
	s_lshr_b32 s0, s33, 1
	s_mov_b32 s1, exec_lo
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	v_cmpx_gt_u32_e64 s0, v0
	s_cbranch_execz .LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	s_lshl_b32 s2, s0, 2
	s_delay_alu instid0(SALU_CYCLE_1)
	v_add_nc_u32_e32 v1, s2, v10
	v_add_nc_u32_e32 v2, s2, v11
	ds_load_b32 v3, v11
	ds_load_b32 v1, v1
	ds_load_b32 v2, v2
	ds_load_b32 v4, v10
	s_waitcnt lgkmcnt(0)
	v_dual_add_f32 v2, v2, v3 :: v_dual_add_f32 v1, v1, v4
	ds_store_b32 v11, v2
	ds_store_b32 v10, v1
.LBB0_18:                               ;   in Loop: Header=BB0_16 Depth=1
	s_or_b32 exec_lo, exec_lo, s1
	s_cmp_gt_u32 s33, 3
	s_mov_b32 s33, s0
	s_cbranch_scc1 .LBB0_16
.LBB0_19:                               ; %._crit_edge215
	v_cmp_eq_u32_e32 vcc_lo, 0, v0
	s_mov_b32 s35, 0
	s_waitcnt lgkmcnt(0)
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB0_21
; %bb.20:
	v_mov_b32_e32 v2, 0
	s_lshl_b64 s[0:1], s[34:35], 2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s2, s6, s0
	s_addc_u32 s3, s7, s1
	ds_load_2addr_stride64_b32 v[0:1], v2 offset1:8
	s_add_u32 s0, s4, s0
	s_addc_u32 s1, s5, s1
	s_waitcnt lgkmcnt(0)
	s_clause 0x1
	global_store_b32 v2, v1, s[0:1]
	global_store_b32 v2, v0, s[2:3]
.LBB0_21:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff
		.amdhsa_group_segment_fixed_size 4096
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 392
		.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 38
		.amdhsa_next_free_sgpr 40
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff, .Lfunc_end0-_Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1648
; NumSgprs: 42
; NumVgprs: 38
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 4096 bytes/workgroup (compile time only)
; SGPRBlocks: 5
; VGPRBlocks: 4
; NumSGPRsForWavesPerEU: 42
; NumVGPRsForWavesPerEU: 38
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.protected	sigma                   ; @sigma
	.type	sigma,@object
	.section	.bss,"aw",@nobits
	.globl	sigma
	.p2align	2, 0x0
sigma:
	.long	0x00000000                      ; float 0
	.size	sigma, 4

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

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

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

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

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

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

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

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

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

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

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

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

	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __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
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         48
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         56
        .size:           8
        .value_kind:     global_buffer
      - .offset:         64
        .size:           4
        .value_kind:     by_value
      - .offset:         68
        .size:           4
        .value_kind:     by_value
      - .offset:         72
        .size:           4
        .value_kind:     by_value
      - .offset:         76
        .size:           4
        .value_kind:     by_value
      - .offset:         80
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         88
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         96
        .size:           8
        .value_kind:     global_buffer
      - .offset:         104
        .size:           4
        .value_kind:     by_value
      - .offset:         108
        .size:           4
        .value_kind:     by_value
      - .offset:         112
        .size:           4
        .value_kind:     by_value
      - .offset:         116
        .size:           4
        .value_kind:     by_value
      - .offset:         120
        .size:           4
        .value_kind:     by_value
      - .offset:         124
        .size:           4
        .value_kind:     by_value
      - .offset:         128
        .size:           4
        .value_kind:     by_value
      - .offset:         136
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         140
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         144
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         148
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         150
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         152
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         154
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         156
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         158
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         176
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         184
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         192
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         200
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 4096
    .kernarg_segment_align: 8
    .kernarg_segment_size: 392
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff
    .private_segment_fixed_size: 0
    .sgpr_count:     42
    .sgpr_spill_count: 0
    .symbol:         _Z5forcePfS_S_S_S_S_S_S_fffffPiS0_iiiifff.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     38
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
