#define __rose_lt(x,y) ((x)<(y)?(x):(y))
#define __rose_gt(x,y) ((x)>(y)?(x):(y))
//this is only  used for cuda-chill
//heavy simplification
#define NsolventMolecules_ 1024
#define NsolventAtoms_ 1024

struct MolDist 
{
///< Original solvent molecule number (starts from 1).
  int mol;
///< Closest distance of solvent molecule to atoms in distanceMask.
  double D;
//AtomMask mask;  ///< Original topology solvent molecule atom mask.
///< Actual solvent atom #s to loop over.
  double solventAtoms[1024][3];
}
;
//using dist for no image 
// and kernel for when we use solute molecule center
//extracting pulling out arrays out from struct 

void Action_NoImage_Center(struct MolDist SolventMols_[1024],double maskCenter[3],double maxD)
{
  double Dist;
  int solventMol;
  int solventAtom;
//Vec3 maskCenter = frmIn.VGeometricCenter( distanceMask_ );
//standard loop 
  for (solventMol = 0; solventMol < 1024; solventMol++) {
    SolventMols_[solventMol].D = maxD;
    for (solventAtom = 0; solventAtom < 1024; solventAtom++) {
//main dist2_noImage code
//double *a1 = maskCenter.Dptr(); //center of solute molecule
//double *a2 = frmIn.XYZ(*solvent_atom);
//double *a1 = maskCenter; //center of solute molecule
//double *a2 = SolventMols_[solventMol][solventAtom];  
//double x = a1[0] - a2[0];
//double y = a1[1] - a2[1];
//double z = a1[2] - a2[2];
//Dist = (x*x + y*y + z*z);
      Dist = maskCenter[0] * SolventMols_[solventMol].solventAtoms[solventAtom][0] + maskCenter[1] * SolventMols_[solventMol].solventAtoms[solventAtom][1] + maskCenter[2] * SolventMols_[solventMol].solventAtoms[solventAtom][2];
//D_[solventMol] = Dist < D_[solventMol] ?  Dist : D_[solventMol];
      if (Dist < SolventMols_[solventMol].D) 
        SolventMols_[solventMol].D = Dist;
    }
  }
}

	.file	"tmpxft_002106c7_00000000-6_rose_simple_action_noImage.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2011:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2011:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z21Action_NoImage_CenterP7MolDistPdd
	.type	_Z21Action_NoImage_CenterP7MolDistPdd, @function
_Z21Action_NoImage_CenterP7MolDistPdd:
.LFB2008:
	.cfi_startproc
	endbr64
	leaq	25182208(%rdi), %rdx
.L6:
	movsd	%xmm0, 8(%rdi)
	xorl	%eax, %eax
.L5:
	movsd	(%rsi), %xmm1
	movsd	8(%rsi), %xmm2
	mulsd	16(%rdi,%rax), %xmm1
	mulsd	24(%rdi,%rax), %xmm2
	addsd	%xmm2, %xmm1
	movsd	16(%rsi), %xmm2
	mulsd	32(%rdi,%rax), %xmm2
	addsd	%xmm2, %xmm1
	movsd	8(%rdi), %xmm2
	comisd	%xmm1, %xmm2
	jbe	.L3
	movsd	%xmm1, 8(%rdi)
.L3:
	addq	$24, %rax
	cmpq	$24576, %rax
	jne	.L5
	addq	$24592, %rdi
	cmpq	%rdi, %rdx
	jne	.L6
	ret
	.cfi_endproc
.LFE2008:
	.size	_Z21Action_NoImage_CenterP7MolDistPdd, .-_Z21Action_NoImage_CenterP7MolDistPdd
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2034:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2034:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#define __rose_lt(x,y) ((x)<(y)?(x):(y))
#define __rose_gt(x,y) ((x)>(y)?(x):(y))
//this is only  used for cuda-chill
//heavy simplification
#define NsolventMolecules_ 1024
#define NsolventAtoms_ 1024

struct MolDist 
{
///< Original solvent molecule number (starts from 1).
  int mol;
///< Closest distance of solvent molecule to atoms in distanceMask.
  double D;
//AtomMask mask;  ///< Original topology solvent molecule atom mask.
///< Actual solvent atom #s to loop over.
  double solventAtoms[1024][3];
}
;
//using dist for no image 
// and kernel for when we use solute molecule center
//extracting pulling out arrays out from struct 

void Action_NoImage_Center(struct MolDist SolventMols_[1024],double maskCenter[3],double maxD)
{
  double Dist;
  int solventMol;
  int solventAtom;
//Vec3 maskCenter = frmIn.VGeometricCenter( distanceMask_ );
//standard loop 
  for (solventMol = 0; solventMol < 1024; solventMol++) {
    SolventMols_[solventMol].D = maxD;
    for (solventAtom = 0; solventAtom < 1024; solventAtom++) {
//main dist2_noImage code
//double *a1 = maskCenter.Dptr(); //center of solute molecule
//double *a2 = frmIn.XYZ(*solvent_atom);
//double *a1 = maskCenter; //center of solute molecule
//double *a2 = SolventMols_[solventMol][solventAtom];  
//double x = a1[0] - a2[0];
//double y = a1[1] - a2[1];
//double z = a1[2] - a2[2];
//Dist = (x*x + y*y + z*z);
      Dist = maskCenter[0] * SolventMols_[solventMol].solventAtoms[solventAtom][0] + maskCenter[1] * SolventMols_[solventMol].solventAtoms[solventAtom][1] + maskCenter[2] * SolventMols_[solventMol].solventAtoms[solventAtom][2];
//D_[solventMol] = Dist < D_[solventMol] ?  Dist : D_[solventMol];
      if (Dist < SolventMols_[solventMol].D) 
        SolventMols_[solventMol].D = Dist;
    }
  }
}

	.text
	.file	"rose_simple_action_noImage.hip"
	.globl	_Z21Action_NoImage_CenterP7MolDistPdd # -- Begin function _Z21Action_NoImage_CenterP7MolDistPdd
	.type	_Z21Action_NoImage_CenterP7MolDistPdd,@function
_Z21Action_NoImage_CenterP7MolDistPdd:  # @_Z21Action_NoImage_CenterP7MolDistPdd
	.cfi_startproc
# %bb.0:
	xorl	%eax, %eax
	movq	%rdi, %rcx
.LBB0_1:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_2 Depth 2
	imulq	$24592, %rax, %rdx              # imm = 0x6010
	addq	%rdi, %rdx
	addq	$8, %rdx
	movsd	%xmm0, (%rdx)
	movl	$32, %r8d
	movapd	%xmm0, %xmm1
.LBB0_2:                                #   Parent Loop BB0_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	(%rsi), %xmm3                   # xmm3 = mem[0],zero
	movsd	8(%rsi), %xmm4                  # xmm4 = mem[0],zero
	mulsd	-16(%rcx,%r8), %xmm3
	mulsd	-8(%rcx,%r8), %xmm4
	movsd	16(%rsi), %xmm2                 # xmm2 = mem[0],zero
	mulsd	(%rcx,%r8), %xmm2
	addsd	%xmm3, %xmm4
	addsd	%xmm4, %xmm2
	ucomisd	%xmm2, %xmm1
	jbe	.LBB0_4
# %bb.3:                                #   in Loop: Header=BB0_2 Depth=2
	movsd	%xmm2, (%rdx)
	movapd	%xmm2, %xmm1
.LBB0_4:                                #   in Loop: Header=BB0_2 Depth=2
	addq	$24, %r8
	cmpq	$24608, %r8                     # imm = 0x6020
	jne	.LBB0_2
# %bb.5:                                #   in Loop: Header=BB0_1 Depth=1
	incq	%rax
	addq	$24592, %rcx                    # imm = 0x6010
	cmpq	$1024, %rax                     # imm = 0x400
	jne	.LBB0_1
# %bb.6:
	retq
.Lfunc_end0:
	.size	_Z21Action_NoImage_CenterP7MolDistPdd, .Lfunc_end0-_Z21Action_NoImage_CenterP7MolDistPdd
	.cfi_endproc
                                        # -- End function
	.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
