#include <iostream>
#include <cuda_runtime.h>
#include <vector>

// Constants
const int NUM_PARTICLES = 2048;
const int BLOCK_SIZE = 256;
const float DT = 0.005f;
const float EPSILON = 1e-5f;
const float GRAVITY = 9.81f;

// Kernel to compute forces using Verlet integration
__global__ void verletIntegration(float4* positions, float4* velocities, float4* forces, float4* newForces, float dt) {
    int idx = blockIdx.x * blockDim.x + threadIdx.x;
    if (idx >= NUM_PARTICLES) return;

    // Load current position and velocity
    float4 pos = positions[idx];
    float4 vel = velocities[idx];
    float4 force = forces[idx];

    // Verlet integration to update position
    pos.x += vel.x * dt + 0.5f * force.x * dt * dt;
    pos.y += vel.y * dt + 0.5f * force.y * dt * dt;
    pos.z += vel.z * dt + 0.5f * force.z * dt * dt;

    // Update velocity using average of old and new forces
    vel.x += 0.5f * (force.x + newForces[idx].x) * dt;
    vel.y += 0.5f * (force.y + newForces[idx].y) * dt;
    vel.z += 0.5f * (force.z + newForces[idx].z) * dt;

    // Store updated position and velocity
    positions[idx] = pos;
    velocities[idx] = vel;
}

// Simple force calculation (gravity only for demonstration)
__global__ void computeForces(float4* positions, float4* forces) {
    int idx = blockIdx.x * blockDim.x + threadIdx.x;
    if (idx >= NUM_PARTICLES) return;

    // Apply gravity force
    forces[idx].x = 0.0f;
    forces[idx].y = -GRAVITY;
    forces[idx].z = 0.0f;
}

int main() {
    // Allocate host memory
    std::vector<float4> h_positions(NUM_PARTICLES);
    std::vector<float4> h_velocities(NUM_PARTICLES);
    std::vector<float4> h_forces(NUM_PARTICLES);
    std::vector<float4> h_newForces(NUM_PARTICLES);

    // Initialize particles (simple initialization)
    for (int i = 0; i < NUM_PARTICLES; ++i) {
        h_positions[i] = make_float4(static_cast<float>(i), 0.0f, 0.0f, 0.0f);
        h_velocities[i] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
        h_forces[i] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
        h_newForces[i] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
    }

    // Allocate device memory
    float4* d_positions, *d_velocities, *d_forces, *d_newForces;
    cudaMalloc(&d_positions, NUM_PARTICLES * sizeof(float4));
    cudaMalloc(&d_velocities, NUM_PARTICLES * sizeof(float4));
    cudaMalloc(&d_forces, NUM_PARTICLES * sizeof(float4));
    cudaMalloc(&d_newForces, NUM_PARTICLES * sizeof(float4));

    // Copy data from host to device
    cudaMemcpy(d_positions, h_positions.data(), NUM_PARTICLES * sizeof(float4), cudaMemcpyHostToDevice);
    cudaMemcpy(d_velocities, h_velocities.data(), NUM_PARTICLES * sizeof(float4), cudaMemcpyHostToDevice);
    cudaMemcpy(d_forces, h_forces.data(), NUM_PARTICLES * sizeof(float4), cudaMemcpyHostToDevice);
    cudaMemcpy(d_newForces, h_newForces.data(), NUM_PARTICLES * sizeof(float4), cudaMemcpyHostToDevice);

    // Kernel launch configuration
    int numBlocks = (NUM_PARTICLES + BLOCK_SIZE - 1) / BLOCK_SIZE;

    // Compute initial forces
    computeForces<<<numBlocks, BLOCK_SIZE>>>(d_positions, d_forces);
    cudaDeviceSynchronize();

    // Verlet integration step
    verletIntegration<<<numBlocks, BLOCK_SIZE>>>(d_positions, d_velocities, d_forces, d_newForces, DT);
    cudaDeviceSynchronize();

    // Copy results back to host
    cudaMemcpy(h_positions.data(), d_positions, NUM_PARTICLES * sizeof(float4), cudaMemcpyDeviceToHost);
    cudaMemcpy(h_velocities.data(), d_velocities, NUM_PARTICLES * sizeof(float4), cudaMemcpyDeviceToHost);

    // Free device memory
    cudaFree(d_positions);
    cudaFree(d_velocities);
    cudaFree(d_forces);
    cudaFree(d_newForces);

    // Check for any errors launching the kernel
    cudaError_t err = cudaGetLastError();
    if (err != cudaSuccess) {
        std::cerr << "CUDA error: " << cudaGetErrorString(err) << std::endl;
        return -1;
    }

    std::cout << "Simulation completed successfully." << std::endl;

    return 0;
}
	.file	"tmpxft_000b12e3_00000000-6_cuda_code_008666.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4001:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4001:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z53__device_stub__Z17verletIntegrationP6float4S0_S0_S0_fP6float4S0_S0_S0_f
	.type	_Z53__device_stub__Z17verletIntegrationP6float4S0_S0_S0_fP6float4S0_S0_S0_f, @function
_Z53__device_stub__Z17verletIntegrationP6float4S0_S0_S0_fP6float4S0_S0_S0_f:
.LFB4023:
	.cfi_startproc
	endbr64
	subq	$168, %rsp
	.cfi_def_cfa_offset 176
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	56(%rsp), %rcx
	movss	%xmm0, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 144(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	56(%rsp)
	.cfi_def_cfa_offset 184
	leaq	_Z17verletIntegrationP6float4S0_S0_S0_f(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 192
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 184
	popq	%rdx
	.cfi_def_cfa_offset 176
.L2:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$168, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4023:
	.size	_Z53__device_stub__Z17verletIntegrationP6float4S0_S0_S0_fP6float4S0_S0_S0_f, .-_Z53__device_stub__Z17verletIntegrationP6float4S0_S0_S0_fP6float4S0_S0_S0_f
	.globl	_Z17verletIntegrationP6float4S0_S0_S0_f
	.type	_Z17verletIntegrationP6float4S0_S0_S0_f, @function
_Z17verletIntegrationP6float4S0_S0_S0_f:
.LFB4024:
	.cfi_startproc
	endbr64
	jmp	_Z53__device_stub__Z17verletIntegrationP6float4S0_S0_S0_fP6float4S0_S0_S0_f
	.cfi_endproc
.LFE4024:
	.size	_Z17verletIntegrationP6float4S0_S0_S0_f, .-_Z17verletIntegrationP6float4S0_S0_S0_f
	.globl	_Z42__device_stub__Z13computeForcesP6float4S0_P6float4S0_
	.type	_Z42__device_stub__Z13computeForcesP6float4S0_P6float4S0_, @function
_Z42__device_stub__Z13computeForcesP6float4S0_P6float4S0_:
.LFB4025:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movq	%rsi, (%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L8
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z13computeForcesP6float4S0_(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L8:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4025:
	.size	_Z42__device_stub__Z13computeForcesP6float4S0_P6float4S0_, .-_Z42__device_stub__Z13computeForcesP6float4S0_P6float4S0_
	.globl	_Z13computeForcesP6float4S0_
	.type	_Z13computeForcesP6float4S0_, @function
_Z13computeForcesP6float4S0_:
.LFB4026:
	.cfi_startproc
	endbr64
	jmp	_Z42__device_stub__Z13computeForcesP6float4S0_P6float4S0_
	.cfi_endproc
.LFE4026:
	.size	_Z13computeForcesP6float4S0_, .-_Z13computeForcesP6float4S0_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z13computeForcesP6float4S0_"
.LC1:
	.string	"_Z17verletIntegrationP6float4S0_S0_S0_f"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4028:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z13computeForcesP6float4S0_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC1(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z17verletIntegrationP6float4S0_S0_S0_f(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4028:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata._ZNSt6vectorI6float4SaIS0_EEC2EmRKS1_.str1.1,"aMS",@progbits,1
.LC2:
	.string	"cannot create std::vector larger than max_size()"
	.section	.text._ZNSt6vectorI6float4SaIS0_EEC2EmRKS1_,"axG",@progbits,_ZNSt6vectorI6float4SaIS0_EEC5EmRKS1_,comdat
	.align 2
	.weak	_ZNSt6vectorI6float4SaIS0_EEC2EmRKS1_
	.type	_ZNSt6vectorI6float4SaIS0_EEC2EmRKS1_, @function
_ZNSt6vectorI6float4SaIS0_EEC2EmRKS1_:
.LFB4335:
	.cfi_startproc
	endbr64
	movabsq	$576460752303423487, %rax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	cmpq	%rsi, %rax
	jnb	.L16
	leaq	.LC2(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L16:
	xorl	%eax, %eax
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	%rsi, %rbp
	movq	%rax, (%rdi)
	salq	$4, %r12
	movq	%rax, 8(%rdi)
	movq	%rax, 16(%rdi)
	xorl	%eax, %eax
	testq	%rsi, %rsi
	je	.L17
	movq	%r12, %rdi
	call	_Znwm@PLT
.L17:
	addq	%rax, %r12
	movq	%rax, (%rbx)
	movq	%rax, %rdx
	movq	%rax, 8(%rbx)
	movq	%r12, 16(%rbx)
	testq	%rbp, %rbp
	je	.L18
	xorps	%xmm0, %xmm0
	decq	%rbp
	leaq	16(%rax), %rdx
	movaps	%xmm0, (%rax)
	je	.L18
.L19:
	cmpq	%rdx, %r12
	je	.L18
	movaps	(%rax), %xmm1
	addq	$16, %rdx
	movaps	%xmm1, -16(%rdx)
	jmp	.L19
.L18:
	movq	%rdx, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4335:
	.size	_ZNSt6vectorI6float4SaIS0_EEC2EmRKS1_, .-_ZNSt6vectorI6float4SaIS0_EEC2EmRKS1_
	.weak	_ZNSt6vectorI6float4SaIS0_EEC1EmRKS1_
	.set	_ZNSt6vectorI6float4SaIS0_EEC1EmRKS1_,_ZNSt6vectorI6float4SaIS0_EEC2EmRKS1_
	.section	.text._ZNSt6vectorI6float4SaIS0_EED2Ev,"axG",@progbits,_ZNSt6vectorI6float4SaIS0_EED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorI6float4SaIS0_EED2Ev
	.type	_ZNSt6vectorI6float4SaIS0_EED2Ev, @function
_ZNSt6vectorI6float4SaIS0_EED2Ev:
.LFB4338:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L29
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L29:
	ret
	.cfi_endproc
.LFE4338:
	.size	_ZNSt6vectorI6float4SaIS0_EED2Ev, .-_ZNSt6vectorI6float4SaIS0_EED2Ev
	.weak	_ZNSt6vectorI6float4SaIS0_EED1Ev
	.set	_ZNSt6vectorI6float4SaIS0_EED1Ev,_ZNSt6vectorI6float4SaIS0_EED2Ev
	.section	.rodata.str1.1
.LC5:
	.string	"CUDA error: "
.LC6:
	.string	"Simulation completed successfully."
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3998:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3998
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$2048, %esi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$184, %rsp
	.cfi_def_cfa_offset 240
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	144(%rsp), %rbx
	leaq	72(%rsp), %rax
	movq	%rax, %rdi
	movq	%rbx, %rdx
	movq	%rax, (%rsp)
.LEHB0:
	call	_ZNSt6vectorI6float4SaIS0_EEC1EmRKS1_
.LEHE0:
	leaq	96(%rsp), %rax
	movq	%rbx, %rdx
	movl	$2048, %esi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
.LEHB1:
	call	_ZNSt6vectorI6float4SaIS0_EEC1EmRKS1_
.LEHE1:
	leaq	120(%rsp), %r15
	movq	%rbx, %rdx
	movl	$2048, %esi
	movq	%r15, %rdi
.LEHB2:
	call	_ZNSt6vectorI6float4SaIS0_EEC1EmRKS1_
.LEHE2:
	leaq	60(%rsp), %rdx
	movl	$2048, %esi
	movq	%rbx, %rdi
.LEHB3:
	call	_ZNSt6vectorI6float4SaIS0_EEC1EmRKS1_
.LEHE3:
	movq	72(%rsp), %r12
	movq	96(%rsp), %rbp
	xorl	%eax, %eax
	xorl	%edx, %edx
	movq	120(%rsp), %r14
	movq	144(%rsp), %r13
.L32:
	movl	$0x00000000, 4(%r12,%rax)
	cvtsi2ssl	%edx, %xmm0
	incl	%edx
	movl	$0x00000000, 8(%r12,%rax)
	movl	$0x00000000, 12(%r12,%rax)
	movss	%xmm0, (%r12,%rax)
	movl	$0x00000000, 0(%rbp,%rax)
	movl	$0x00000000, 4(%rbp,%rax)
	movl	$0x00000000, 8(%rbp,%rax)
	movl	$0x00000000, 12(%rbp,%rax)
	movl	$0x00000000, (%r14,%rax)
	movl	$0x00000000, 4(%r14,%rax)
	movl	$0x00000000, 8(%r14,%rax)
	movl	$0x00000000, 12(%r14,%rax)
	movl	$0x00000000, 0(%r13,%rax)
	movl	$0x00000000, 4(%r13,%rax)
	movl	$0x00000000, 8(%r13,%rax)
	movl	$0x00000000, 12(%r13,%rax)
	addq	$16, %rax
	cmpl	$2048, %edx
	jne	.L32
	leaq	16(%rsp), %rdi
	movl	$32768, %esi
.LEHB4:
	call	cudaMalloc@PLT
	leaq	24(%rsp), %rdi
	movl	$32768, %esi
	call	cudaMalloc@PLT
	leaq	32(%rsp), %rdi
	movl	$32768, %esi
	call	cudaMalloc@PLT
	leaq	40(%rsp), %rdi
	movl	$32768, %esi
	call	cudaMalloc@PLT
	movq	16(%rsp), %rdi
	movl	$1, %ecx
	movl	$32768, %edx
	movq	%r12, %rsi
	call	cudaMemcpy@PLT
	movq	24(%rsp), %rdi
	movl	$1, %ecx
	movl	$32768, %edx
	movq	%rbp, %rsi
	call	cudaMemcpy@PLT
	movq	32(%rsp), %rdi
	movl	$1, %ecx
	movl	$32768, %edx
	movq	%r14, %rsi
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rdi
	movl	$1, %ecx
	movl	$32768, %edx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movl	$16777217, %edx
	movl	$536870913, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$8, %rdx
	salq	$3, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, 60(%rsp)
	movl	$1, 68(%rsp)
	movq	%rdi, 48(%rsp)
	movl	$1, 56(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L33
.L35:
	call	cudaDeviceSynchronize@PLT
	jmp	.L58
.L33:
	movq	32(%rsp), %rsi
	movq	16(%rsp), %rdi
	call	_Z42__device_stub__Z13computeForcesP6float4S0_P6float4S0_
	jmp	.L35
.L58:
	movl	$16777217, %edx
	movl	$536870913, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$8, %rdx
	salq	$3, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, 60(%rsp)
	movl	$1, 68(%rsp)
	movq	%rdi, 48(%rsp)
	movl	$1, 56(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L36
.L38:
	call	cudaDeviceSynchronize@PLT
	jmp	.L59
.L36:
	movss	.LC4(%rip), %xmm0
	movq	40(%rsp), %rcx
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdi
	call	_Z53__device_stub__Z17verletIntegrationP6float4S0_S0_S0_fP6float4S0_S0_S0_f
	jmp	.L38
.L59:
	movq	16(%rsp), %rsi
	movl	$2, %ecx
	movl	$32768, %edx
	movq	%r12, %rdi
	call	cudaMemcpy@PLT
	movq	24(%rsp), %rsi
	movl	$2, %ecx
	movl	$32768, %edx
	movq	%rbp, %rdi
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	call	cudaGetLastError@PLT
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L39
	leaq	.LC5(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %edi
	movq	%rax, %r12
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	orl	$-1, %ebp
	jmp	.L40
.L39:
	leaq	.LC6(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
.LEHE4:
	xorl	%ebp, %ebp
.L40:
	movq	%rbx, %rdi
	call	_ZNSt6vectorI6float4SaIS0_EED1Ev
	movq	%r15, %rdi
	call	_ZNSt6vectorI6float4SaIS0_EED1Ev
	movq	8(%rsp), %rdi
	call	_ZNSt6vectorI6float4SaIS0_EED1Ev
	movq	(%rsp), %rdi
	call	_ZNSt6vectorI6float4SaIS0_EED1Ev
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L46
	jmp	.L56
.L51:
	endbr64
	movq	%rax, %rbp
.L41:
	movq	%rbx, %rdi
	movq	%rbp, %rbx
	call	_ZNSt6vectorI6float4SaIS0_EED1Ev
	jmp	.L42
.L50:
	endbr64
	movq	%rax, %rbx
.L42:
	movq	%r15, %rdi
	call	_ZNSt6vectorI6float4SaIS0_EED1Ev
	jmp	.L43
.L49:
	endbr64
	movq	%rax, %rbx
.L43:
	movq	8(%rsp), %rdi
	call	_ZNSt6vectorI6float4SaIS0_EED1Ev
	jmp	.L44
.L48:
	endbr64
	movq	%rax, %rbx
.L44:
	movq	(%rsp), %rdi
	call	_ZNSt6vectorI6float4SaIS0_EED1Ev
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	movq	%rbx, %rdi
.LEHB5:
	call	_Unwind_Resume@PLT
.LEHE5:
.L56:
	call	__stack_chk_fail@PLT
.L46:
	addq	$184, %rsp
	.cfi_def_cfa_offset 56
	movl	%ebp, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3998:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3998:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3998-.LLSDACSB3998
.LLSDACSB3998:
	.uleb128 .LEHB0-.LFB3998
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3998
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L48-.LFB3998
	.uleb128 0
	.uleb128 .LEHB2-.LFB3998
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L49-.LFB3998
	.uleb128 0
	.uleb128 .LEHB3-.LFB3998
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L50-.LFB3998
	.uleb128 0
	.uleb128 .LEHB4-.LFB3998
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L51-.LFB3998
	.uleb128 0
	.uleb128 .LEHB5-.LFB3998
	.uleb128 .LEHE5-.LEHB5
	.uleb128 0
	.uleb128 0
.LLSDACSE3998:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC4:
	.long	1000593162
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <iostream>
#include <hip/hip_runtime.h>
#include <vector>

// Constants
const int NUM_PARTICLES = 2048;
const int BLOCK_SIZE = 256;
const float DT = 0.005f;
const float EPSILON = 1e-5f;
const float GRAVITY = 9.81f;

// Kernel to compute forces using Verlet integration
__global__ void verletIntegration(float4* positions, float4* velocities, float4* forces, float4* newForces, float dt) {
    int idx = blockIdx.x * blockDim.x + threadIdx.x;
    if (idx >= NUM_PARTICLES) return;

    // Load current position and velocity
    float4 pos = positions[idx];
    float4 vel = velocities[idx];
    float4 force = forces[idx];

    // Verlet integration to update position
    pos.x += vel.x * dt + 0.5f * force.x * dt * dt;
    pos.y += vel.y * dt + 0.5f * force.y * dt * dt;
    pos.z += vel.z * dt + 0.5f * force.z * dt * dt;

    // Update velocity using average of old and new forces
    vel.x += 0.5f * (force.x + newForces[idx].x) * dt;
    vel.y += 0.5f * (force.y + newForces[idx].y) * dt;
    vel.z += 0.5f * (force.z + newForces[idx].z) * dt;

    // Store updated position and velocity
    positions[idx] = pos;
    velocities[idx] = vel;
}

// Simple force calculation (gravity only for demonstration)
__global__ void computeForces(float4* positions, float4* forces) {
    int idx = blockIdx.x * blockDim.x + threadIdx.x;
    if (idx >= NUM_PARTICLES) return;

    // Apply gravity force
    forces[idx].x = 0.0f;
    forces[idx].y = -GRAVITY;
    forces[idx].z = 0.0f;
}

int main() {
    // Allocate host memory
    std::vector<float4> h_positions(NUM_PARTICLES);
    std::vector<float4> h_velocities(NUM_PARTICLES);
    std::vector<float4> h_forces(NUM_PARTICLES);
    std::vector<float4> h_newForces(NUM_PARTICLES);

    // Initialize particles (simple initialization)
    for (int i = 0; i < NUM_PARTICLES; ++i) {
        h_positions[i] = make_float4(static_cast<float>(i), 0.0f, 0.0f, 0.0f);
        h_velocities[i] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
        h_forces[i] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
        h_newForces[i] = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
    }

    // Allocate device memory
    float4* d_positions, *d_velocities, *d_forces, *d_newForces;
    hipMalloc(&d_positions, NUM_PARTICLES * sizeof(float4));
    hipMalloc(&d_velocities, NUM_PARTICLES * sizeof(float4));
    hipMalloc(&d_forces, NUM_PARTICLES * sizeof(float4));
    hipMalloc(&d_newForces, NUM_PARTICLES * sizeof(float4));

    // Copy data from host to device
    hipMemcpy(d_positions, h_positions.data(), NUM_PARTICLES * sizeof(float4), hipMemcpyHostToDevice);
    hipMemcpy(d_velocities, h_velocities.data(), NUM_PARTICLES * sizeof(float4), hipMemcpyHostToDevice);
    hipMemcpy(d_forces, h_forces.data(), NUM_PARTICLES * sizeof(float4), hipMemcpyHostToDevice);
    hipMemcpy(d_newForces, h_newForces.data(), NUM_PARTICLES * sizeof(float4), hipMemcpyHostToDevice);

    // Kernel launch configuration
    int numBlocks = (NUM_PARTICLES + BLOCK_SIZE - 1) / BLOCK_SIZE;

    // Compute initial forces
    computeForces<<<numBlocks, BLOCK_SIZE>>>(d_positions, d_forces);
    hipDeviceSynchronize();

    // Verlet integration step
    verletIntegration<<<numBlocks, BLOCK_SIZE>>>(d_positions, d_velocities, d_forces, d_newForces, DT);
    hipDeviceSynchronize();

    // Copy results back to host
    hipMemcpy(h_positions.data(), d_positions, NUM_PARTICLES * sizeof(float4), hipMemcpyDeviceToHost);
    hipMemcpy(h_velocities.data(), d_velocities, NUM_PARTICLES * sizeof(float4), hipMemcpyDeviceToHost);

    // Free device memory
    hipFree(d_positions);
    hipFree(d_velocities);
    hipFree(d_forces);
    hipFree(d_newForces);

    // Check for any errors launching the kernel
    hipError_t err = hipGetLastError();
    if (err != hipSuccess) {
        std::cerr << "CUDA error: " << hipGetErrorString(err) << std::endl;
        return -1;
    }

    std::cout << "Simulation completed successfully." << std::endl;

    return 0;
}
	.text
	.file	"cuda_code_008666.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z32__device_stub__verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f # -- Begin function _Z32__device_stub__verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
	.type	_Z32__device_stub__verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f,@function
_Z32__device_stub__verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f: # @_Z32__device_stub__verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	12(%rsp), %rcx
	movss	%xmm0, (%rcx)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z32__device_stub__verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f, .Lfunc_end0-_Z32__device_stub__verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
	.cfi_endproc
                                        # -- End function
	.globl	_Z28__device_stub__computeForcesP15HIP_vector_typeIfLj4EES1_ # -- Begin function _Z28__device_stub__computeForcesP15HIP_vector_typeIfLj4EES1_
	.type	_Z28__device_stub__computeForcesP15HIP_vector_typeIfLj4EES1_,@function
_Z28__device_stub__computeForcesP15HIP_vector_typeIfLj4EES1_: # @_Z28__device_stub__computeForcesP15HIP_vector_typeIfLj4EES1_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	16(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z13computeForcesP15HIP_vector_typeIfLj4EES1_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z28__device_stub__computeForcesP15HIP_vector_typeIfLj4EES1_, .Lfunc_end1-_Z28__device_stub__computeForcesP15HIP_vector_typeIfLj4EES1_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI2_0:
	.long	0x3ba3d70a                      # float 0.00499999989
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$32768, %edi                    # imm = 0x8000
	callq	_Znwm
	movq	%rax, %rbx
	movl	$32768, %edx                    # imm = 0x8000
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.Ltmp0:
	movl	$32768, %edi                    # imm = 0x8000
	callq	_Znwm
.Ltmp1:
# %bb.1:
	movq	%rax, %r14
	movl	$32768, %edx                    # imm = 0x8000
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.Ltmp3:
	movl	$32768, %edi                    # imm = 0x8000
	callq	_Znwm
.Ltmp4:
# %bb.2:
	movq	%rax, %r15
	movl	$32768, %edx                    # imm = 0x8000
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.Ltmp6:
	movl	$32768, %edi                    # imm = 0x8000
	callq	_Znwm
.Ltmp7:
# %bb.3:
	movq	%rax, %r12
	xorl	%r13d, %r13d
	movl	$32768, %edx                    # imm = 0x8000
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	movl	$32768, %edx                    # imm = 0x8000
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	movl	$32768, %edx                    # imm = 0x8000
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	movq	%rbx, %rax
	addq	$8, %rax
.LBB2_4:                                # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtsi2ss	%r13d, %xmm0
	xorps	%xmm1, %xmm1
	movss	%xmm0, %xmm1                    # xmm1 = xmm0[0],xmm1[1,2,3]
	movlps	%xmm1, -8(%rax)
	movq	$0, (%rax)
	incq	%r13
	addq	$16, %rax
	cmpq	$2048, %r13                     # imm = 0x800
	jne	.LBB2_4
# %bb.5:
.Ltmp9:
	leaq	8(%rsp), %rdi
	movl	$32768, %esi                    # imm = 0x8000
	callq	hipMalloc
.Ltmp10:
# %bb.6:                                # %_ZL9hipMallocI15HIP_vector_typeIfLj4EEE10hipError_tPPT_m.exit
.Ltmp11:
	leaq	24(%rsp), %rdi
	movl	$32768, %esi                    # imm = 0x8000
	callq	hipMalloc
.Ltmp12:
# %bb.7:                                # %_ZL9hipMallocI15HIP_vector_typeIfLj4EEE10hipError_tPPT_m.exit49
.Ltmp13:
	leaq	16(%rsp), %rdi
	movl	$32768, %esi                    # imm = 0x8000
	callq	hipMalloc
.Ltmp14:
# %bb.8:                                # %_ZL9hipMallocI15HIP_vector_typeIfLj4EEE10hipError_tPPT_m.exit50
.Ltmp15:
	leaq	32(%rsp), %rdi
	movl	$32768, %esi                    # imm = 0x8000
	callq	hipMalloc
.Ltmp16:
# %bb.9:                                # %_ZL9hipMallocI15HIP_vector_typeIfLj4EEE10hipError_tPPT_m.exit51
	movq	8(%rsp), %rdi
.Ltmp17:
	movl	$32768, %edx                    # imm = 0x8000
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp18:
# %bb.10:
	movq	24(%rsp), %rdi
.Ltmp19:
	movl	$32768, %edx                    # imm = 0x8000
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp20:
# %bb.11:
	movq	16(%rsp), %rdi
.Ltmp21:
	movl	$32768, %edx                    # imm = 0x8000
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp22:
# %bb.12:
	movq	32(%rsp), %rdi
.Ltmp23:
	movl	$32768, %edx                    # imm = 0x8000
	movq	%r12, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp24:
# %bb.13:
.Ltmp26:
	movabsq	$4294967304, %rdi               # imm = 0x100000008
	movabsq	$4294967552, %rdx               # imm = 0x100000100
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp27:
# %bb.14:
	testl	%eax, %eax
	jne	.LBB2_16
# %bb.15:
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
.Ltmp28:
	callq	_Z28__device_stub__computeForcesP15HIP_vector_typeIfLj4EES1_
.Ltmp29:
.LBB2_16:
.Ltmp30:
	callq	hipDeviceSynchronize
.Ltmp31:
# %bb.17:
.Ltmp32:
	movabsq	$4294967304, %rdi               # imm = 0x100000008
	movabsq	$4294967552, %rdx               # imm = 0x100000100
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp33:
# %bb.18:
	testl	%eax, %eax
	jne	.LBB2_20
# %bb.19:
	movq	8(%rsp), %rdi
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
	movq	32(%rsp), %rcx
.Ltmp34:
	movss	.LCPI2_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	callq	_Z32__device_stub__verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
.Ltmp35:
.LBB2_20:
.Ltmp36:
	callq	hipDeviceSynchronize
.Ltmp37:
# %bb.21:
	movq	8(%rsp), %rsi
.Ltmp38:
	movl	$32768, %edx                    # imm = 0x8000
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp39:
# %bb.22:
	movq	24(%rsp), %rsi
.Ltmp40:
	movl	$32768, %edx                    # imm = 0x8000
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp41:
# %bb.23:
	movq	8(%rsp), %rdi
.Ltmp42:
	callq	hipFree
.Ltmp43:
# %bb.24:
	movq	24(%rsp), %rdi
.Ltmp44:
	callq	hipFree
.Ltmp45:
# %bb.25:
	movq	16(%rsp), %rdi
.Ltmp46:
	callq	hipFree
.Ltmp47:
# %bb.26:
	movq	32(%rsp), %rdi
.Ltmp48:
	callq	hipFree
.Ltmp49:
# %bb.27:
.Ltmp51:
	callq	hipGetLastError
.Ltmp52:
# %bb.28:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB2_41
# %bb.29:
.Ltmp53:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp54:
# %bb.30:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp55:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp56:
# %bb.31:
	movq	%rax, %r13
	testq	%rax, %rax
	je	.LBB2_32
# %bb.36:
	movq	%r13, %rdi
	callq	strlen
.Ltmp57:
	movl	$_ZSt4cerr, %edi
	movq	%r13, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp58:
	jmp	.LBB2_37
.LBB2_41:
.Ltmp67:
	movl	$_ZSt4cout, %r13d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$34, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp68:
# %bb.42:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit56
	movq	_ZSt4cout(%rip), %rax
	addq	-24(%rax), %r13
.Ltmp69:
	movq	%r13, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp70:
# %bb.43:                               # %.noexc83
.Ltmp71:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp72:
# %bb.44:                               # %.noexc84
	xorl	%ebp, %ebp
.Ltmp73:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp74:
	jmp	.LBB2_45
.LBB2_32:
	movq	_ZSt4cerr(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cerr(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp59:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp60:
.LBB2_37:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit53
	movq	_ZSt4cerr(%rip), %rax
	movl	$_ZSt4cerr, %edi
	addq	-24(%rax), %rdi
.Ltmp61:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp62:
# %bb.38:                               # %.noexc80
.Ltmp63:
	movsbl	%al, %esi
	movl	$_ZSt4cerr, %edi
	callq	_ZNSo3putEc
.Ltmp64:
# %bb.39:                               # %.noexc81
	movl	$-1, %ebp
.Ltmp65:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp66:
.LBB2_45:                               # %_ZNSt6vectorI15HIP_vector_typeIfLj4EESaIS1_EED2Ev.exit64
	movq	%r12, %rdi
	callq	_ZdlPv
	movq	%r15, %rdi
	callq	_ZdlPv
	movq	%r14, %rdi
	callq	_ZdlPv
	movq	%rbx, %rdi
	callq	_ZdlPv
	movl	%ebp, %eax
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB2_35:
	.cfi_def_cfa_offset 96
.Ltmp8:
	movq	%rax, %r13
	jmp	.LBB2_48
.LBB2_34:
.Ltmp5:
	movq	%rax, %r13
	jmp	.LBB2_49
.LBB2_33:
.Ltmp2:
	movq	%rax, %r13
	jmp	.LBB2_50
.LBB2_40:
.Ltmp75:
	jmp	.LBB2_47
.LBB2_46:
.Ltmp25:
	jmp	.LBB2_47
.LBB2_51:
.Ltmp50:
.LBB2_47:                               # %_ZNSt6vectorI15HIP_vector_typeIfLj4EESaIS1_EED2Ev.exit66
	movq	%rax, %r13
	movq	%r12, %rdi
	callq	_ZdlPv
.LBB2_48:                               # %_ZNSt6vectorI15HIP_vector_typeIfLj4EESaIS1_EED2Ev.exit68
	movq	%r15, %rdi
	callq	_ZdlPv
.LBB2_49:                               # %_ZNSt6vectorI15HIP_vector_typeIfLj4EESaIS1_EED2Ev.exit70
	movq	%r14, %rdi
	callq	_ZdlPv
.LBB2_50:                               # %_ZNSt6vectorI15HIP_vector_typeIfLj4EESaIS1_EED2Ev.exit72
	movq	%rbx, %rdi
	callq	_ZdlPv
	movq	%r13, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp1-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp3-.Ltmp1                  #   Call between .Ltmp1 and .Ltmp3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp4-.Lfunc_begin0           # >> Call Site 5 <<
	.uleb128 .Ltmp6-.Ltmp4                  #   Call between .Ltmp4 and .Ltmp6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 6 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin0           #     jumps to .Ltmp8
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp7-.Lfunc_begin0           # >> Call Site 7 <<
	.uleb128 .Ltmp9-.Ltmp7                  #   Call between .Ltmp7 and .Ltmp9
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 8 <<
	.uleb128 .Ltmp24-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp24
	.uleb128 .Ltmp25-.Lfunc_begin0          #     jumps to .Ltmp25
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp26-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp49-.Ltmp26                #   Call between .Ltmp26 and .Ltmp49
	.uleb128 .Ltmp50-.Lfunc_begin0          #     jumps to .Ltmp50
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp51-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp66-.Ltmp51                #   Call between .Ltmp51 and .Ltmp66
	.uleb128 .Ltmp75-.Lfunc_begin0          #     jumps to .Ltmp75
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp66-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Lfunc_end2-.Ltmp66            #   Call between .Ltmp66 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z13computeForcesP15HIP_vector_typeIfLj4EES1_, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end3:
	.size	__hip_module_ctor, .Lfunc_end3-__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	.LBB4_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
.LBB4_2:
	retq
.Lfunc_end4:
	.size	__hip_module_dtor, .Lfunc_end4-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f,@object # @_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
	.section	.rodata,"a",@progbits
	.globl	_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
	.p2align	3, 0x0
_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f:
	.quad	_Z32__device_stub__verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
	.size	_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f, 8

	.type	_Z13computeForcesP15HIP_vector_typeIfLj4EES1_,@object # @_Z13computeForcesP15HIP_vector_typeIfLj4EES1_
	.globl	_Z13computeForcesP15HIP_vector_typeIfLj4EES1_
	.p2align	3, 0x0
_Z13computeForcesP15HIP_vector_typeIfLj4EES1_:
	.quad	_Z28__device_stub__computeForcesP15HIP_vector_typeIfLj4EES1_
	.size	_Z13computeForcesP15HIP_vector_typeIfLj4EES1_, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"CUDA error: "
	.size	.L.str, 13

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Simulation completed successfully."
	.size	.L.str.1, 35

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f"
	.size	.L__unnamed_1, 57

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z13computeForcesP15HIP_vector_typeIfLj4EES1_"
	.size	.L__unnamed_2, 46

	.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 _Z32__device_stub__verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
	.addrsig_sym _Z28__device_stub__computeForcesP15HIP_vector_typeIfLj4EES1_
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
	.addrsig_sym _Z13computeForcesP15HIP_vector_typeIfLj4EES1_
	.addrsig_sym _ZSt4cerr
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f ; -- Begin function _Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
	.globl	_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
	.p2align	8
	.type	_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f,@function
_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f: ; @_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
; %bb.0:
	s_load_b32 s2, s[0:1], 0x34
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e32 0x800, v1
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b256 s[4:11], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_load_b32 s0, s[0:1], 0x20
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 4, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s8, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s9, v1, vcc_lo
	v_add_co_u32 v7, vcc_lo, s10, v0
	v_add_co_ci_u32_e32 v8, vcc_lo, s11, v1, vcc_lo
	v_add_co_u32 v13, vcc_lo, s6, v0
	global_load_b96 v[4:6], v[2:3], off
	global_load_b96 v[7:9], v[7:8], off
	v_add_co_ci_u32_e32 v14, vcc_lo, s7, v1, vcc_lo
	v_add_co_u32 v15, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v16, vcc_lo, s5, v1, vcc_lo
	global_load_b128 v[0:3], v[13:14], off
	global_load_b96 v[10:12], v[15:16], off
	s_waitcnt vmcnt(3)
	v_dual_mul_f32 v17, 0.5, v4 :: v_dual_mul_f32 v18, 0.5, v5
	s_waitcnt vmcnt(2)
	v_dual_mul_f32 v19, 0.5, v6 :: v_dual_add_f32 v4, v4, v7
	v_add_f32_e32 v5, v5, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_dual_mul_f32 v7, s0, v17 :: v_dual_mul_f32 v8, s0, v18
	v_dual_mul_f32 v17, s0, v19 :: v_dual_add_f32 v6, v6, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_dual_mul_f32 v4, 0.5, v4 :: v_dual_mul_f32 v7, s0, v7
	v_dual_mul_f32 v8, s0, v8 :: v_dual_mul_f32 v5, 0.5, v5
	s_waitcnt vmcnt(1)
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_fmac_f32_e32 v7, s0, v0
	v_mul_f32_e32 v9, s0, v17
	v_dual_mul_f32 v17, 0.5, v6 :: v_dual_fmac_f32 v8, s0, v1
	v_fma_f32 v0, s0, v4, v0
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_3) | instid1(VALU_DEP_4)
	v_dual_add_f32 v4, v10, v7 :: v_dual_fmac_f32 v9, s0, v2
	v_fma_f32 v1, s0, v5, v1
	v_add_f32_e32 v5, v11, v8
	v_fma_f32 v2, s0, v17, v2
	v_add_f32_e32 v6, v12, v9
	global_store_b96 v[15:16], v[4:6], off
	global_store_b128 v[13:14], v[0:3], off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 20
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f, .Lfunc_end0-_Z17verletIntegrationP15HIP_vector_typeIfLj4EES1_S1_S1_f
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 336
; NumSgprs: 18
; NumVgprs: 20
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 2
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 20
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z13computeForcesP15HIP_vector_typeIfLj4EES1_ ; -- Begin function _Z13computeForcesP15HIP_vector_typeIfLj4EES1_
	.globl	_Z13computeForcesP15HIP_vector_typeIfLj4EES1_
	.p2align	8
	.type	_Z13computeForcesP15HIP_vector_typeIfLj4EES1_,@function
_Z13computeForcesP15HIP_vector_typeIfLj4EES1_: ; @_Z13computeForcesP15HIP_vector_typeIfLj4EES1_
; %bb.0:
	s_load_b32 s2, s[0:1], 0x1c
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e32 0x800, v1
	s_cbranch_execz .LBB1_2
; %bb.1:
	s_load_b64 s[0:1], s[0:1], 0x8
	v_ashrrev_i32_e32 v2, 31, v1
	v_mov_b32_e32 v0, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[2:3], 4, v[1:2]
	v_mov_b32_e32 v1, 0xc11cf5c3
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v4, vcc_lo, s0, v2
	s_delay_alu instid0(VALU_DEP_3)
	v_add_co_ci_u32_e32 v5, vcc_lo, s1, v3, vcc_lo
	v_mov_b32_e32 v2, v0
	global_store_b96 v[4:5], v[0:2], off
.LBB1_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z13computeForcesP15HIP_vector_typeIfLj4EES1_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.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 6
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z13computeForcesP15HIP_vector_typeIfLj4EES1_, .Lfunc_end1-_Z13computeForcesP15HIP_vector_typeIfLj4EES1_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 128
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
