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

// Define the number of boundary elements
#define NUM_ELEMENTS 32

// Kernel to simulate fluid-structure interaction using atomics
__global__ void fluidStructureInteraction(float* forces, float* displacements) {
    int idx = blockIdx.x * blockDim.x + threadIdx.x;

    if (idx < NUM_ELEMENTS) {
        // Simulate force calculation (e.g., fluid pressure)
        float force = 1.0f + sinf(idx * 0.1f); // Example force calculation

        // Use atomicAdd to accumulate forces safely
        atomicAdd(&forces[idx], force);

        // Simulate displacement update based on force
        float displacement = forces[idx] * 0.01f; // Example displacement calculation

        // Use atomicExch to safely update displacements
        atomicExch(&displacements[idx], displacement);
    }
}

int main() {
    // Allocate memory for forces and displacements on the host
    std::vector<float> h_forces(NUM_ELEMENTS, 0.0f);
    std::vector<float> h_displacements(NUM_ELEMENTS, 0.0f);

    // Allocate memory for forces and displacements on the device
    float* d_forces;
    float* d_displacements;
    cudaError_t err;

    err = cudaMalloc((void**)&d_forces, NUM_ELEMENTS * sizeof(float));
    if (err != cudaSuccess) {
        std::cerr << "Failed to allocate device forces: " << cudaGetErrorString(err) << std::endl;
        return -1;
    }

    err = cudaMalloc((void**)&d_displacements, NUM_ELEMENTS * sizeof(float));
    if (err != cudaSuccess) {
        std::cerr << "Failed to allocate device displacements: " << cudaGetErrorString(err) << std::endl;
        cudaFree(d_forces);
        return -1;
    }

    // Initialize device memory with zero
    err = cudaMemset(d_forces, 0, NUM_ELEMENTS * sizeof(float));
    if (err != cudaSuccess) {
        std::cerr << "Failed to initialize device forces: " << cudaGetErrorString(err) << std::endl;
        cudaFree(d_forces);
        cudaFree(d_displacements);
        return -1;
    }

    err = cudaMemset(d_displacements, 0, NUM_ELEMENTS * sizeof(float));
    if (err != cudaSuccess) {
        std::cerr << "Failed to initialize device displacements: " << cudaGetErrorString(err) << std::endl;
        cudaFree(d_forces);
        cudaFree(d_displacements);
        return -1;
    }

    // Define block and grid sizes
    dim3 blockSize(32);
    dim3 gridSize((NUM_ELEMENTS + blockSize.x - 1) / blockSize.x);

    // Launch the kernel
    fluidStructureInteraction<<<gridSize, blockSize>>>(d_forces, d_displacements);

    // Check for errors in kernel launch
    err = cudaGetLastError();
    if (err != cudaSuccess) {
        std::cerr << "Kernel launch failed: " << cudaGetErrorString(err) << std::endl;
        cudaFree(d_forces);
        cudaFree(d_displacements);
        return -1;
    }

    // Copy results back to host
    err = cudaMemcpy(h_forces.data(), d_forces, NUM_ELEMENTS * sizeof(float), cudaMemcpyDeviceToHost);
    if (err != cudaSuccess) {
        std::cerr << "Failed to copy forces from device to host: " << cudaGetErrorString(err) << std::endl;
        cudaFree(d_forces);
        cudaFree(d_displacements);
        return -1;
    }

    err = cudaMemcpy(h_displacements.data(), d_displacements, NUM_ELEMENTS * sizeof(float), cudaMemcpyDeviceToHost);
    if (err != cudaSuccess) {
        std::cerr << "Failed to copy displacements from device to host: " << cudaGetErrorString(err) << std::endl;
        cudaFree(d_forces);
        cudaFree(d_displacements);
        return -1;
    }

    // Free device memory
    cudaFree(d_forces);
    cudaFree(d_displacements);

    // Print results
    std::cout << "Forces and Displacements after simulation:" << std::endl;
    for (int i = 0; i < NUM_ELEMENTS; ++i) {
        std::cout << "Element " << i << ": Force = " << h_forces[i] << ", Displacement = " << h_displacements[i] << std::endl;
    }

    return 0;
}
	.file	"tmpxft_000d7f95_00000000-6_cuda_code_041655.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
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB4729:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4729:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_
	.type	_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_, @function
_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_:
.LFB4023:
	.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	.L3
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z25fluidStructureInteractionPfS_(%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
.L3:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4023:
	.size	_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_, .-_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_
	.globl	_Z25fluidStructureInteractionPfS_
	.type	_Z25fluidStructureInteractionPfS_, @function
_Z25fluidStructureInteractionPfS_:
.LFB4024:
	.cfi_startproc
	endbr64
	jmp	_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_
	.cfi_endproc
.LFE4024:
	.size	_Z25fluidStructureInteractionPfS_, .-_Z25fluidStructureInteractionPfS_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z25fluidStructureInteractionPfS_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4026:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 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
	leaq	_Z25fluidStructureInteractionPfS_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	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	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4026:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIfSaIfEED2Ev,"axG",@progbits,_ZNSt6vectorIfSaIfEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIfSaIfEED2Ev
	.type	_ZNSt6vectorIfSaIfEED2Ev, @function
_ZNSt6vectorIfSaIfEED2Ev:
.LFB4336:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L11
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L11:
	ret
	.cfi_endproc
.LFE4336:
	.size	_ZNSt6vectorIfSaIfEED2Ev, .-_ZNSt6vectorIfSaIfEED2Ev
	.weak	_ZNSt6vectorIfSaIfEED1Ev
	.set	_ZNSt6vectorIfSaIfEED1Ev,_ZNSt6vectorIfSaIfEED2Ev
	.section	.rodata.str1.1
.LC2:
	.string	"Failed to allocate device forces: "
.LC3:
	.string	"Failed to allocate device displacements: "
.LC4:
	.string	"Failed to initialize device forces: "
.LC5:
	.string	"Failed to initialize device displacements: "
.LC6:
	.string	"Kernel launch failed: "
.LC7:
	.string	"Failed to copy forces from device to host: "
.LC8:
	.string	"Failed to copy displacements from device to host: "
.LC9:
	.string	"Forces and Displacements after simulation:"
.LC10:
	.string	"Element "
.LC11:
	.string	": Force = "
.LC12:
	.string	", Displacement = "
	.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	$128, %edi
	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	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
.LEHB0:
	call	_Znwm@PLT
.LEHE0:
	leaq	128(%rax), %rdx
	movq	%rax, 40(%rsp)
	movq	%rax, %rbx
	xorl	%eax, %eax
	movq	%rdx, 56(%rsp)
.L14:
	movl	$0x00000000, (%rbx,%rax)
	addq	$4, %rax
	cmpq	$128, %rax
	jne	.L14
	xorl	%eax, %eax
	movl	$128, %edi
	movq	%rdx, 48(%rsp)
	movq	%rax, 72(%rsp)
	movq	%rax, 80(%rsp)
.LEHB1:
	call	_Znwm@PLT
.LEHE1:
	leaq	128(%rax), %rdx
	movq	%rax, 64(%rsp)
	movq	%rax, %rbp
	xorl	%eax, %eax
	movq	%rdx, 80(%rsp)
.L15:
	movl	$0x00000000, 0(%rbp,%rax)
	addq	$4, %rax
	cmpq	$128, %rax
	jne	.L15
	movq	%rsp, %rdi
	movl	$128, %esi
	movq	%rdx, 72(%rsp)
.LEHB2:
	call	cudaMalloc@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L16
	leaq	.LC2(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %rbx
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	jmp	.L17
.L16:
	leaq	8(%rsp), %rdi
	movl	$128, %esi
	call	cudaMalloc@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L18
	leaq	.LC3(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %rbx
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	(%rsp), %rdi
	jmp	.L44
.L18:
	movq	(%rsp), %rdi
	movl	$128, %edx
	xorl	%esi, %esi
	call	cudaMemset@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L19
	leaq	.LC4(%rip), %rsi
.L68:
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %rbx
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	(%rsp), %rdi
	call	cudaFree@PLT
	movq	8(%rsp), %rdi
.L44:
	call	cudaFree@PLT
	jmp	.L17
.L19:
	movq	8(%rsp), %rdi
	movl	$128, %edx
	xorl	%esi, %esi
	call	cudaMemset@PLT
	movl	%eax, %r12d
	leaq	.LC5(%rip), %rsi
	testl	%eax, %eax
	jne	.L68
	movl	$134217729, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$5, %rdx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L21
.L23:
	call	cudaGetLastError@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L24
	leaq	.LC6(%rip), %rsi
	jmp	.L68
.L21:
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	call	_Z47__device_stub__Z25fluidStructureInteractionPfS_PfS_
	jmp	.L23
.L24:
	movq	(%rsp), %rsi
	movl	$2, %ecx
	movl	$128, %edx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %r12d
	leaq	.LC7(%rip), %rsi
	testl	%eax, %eax
	jne	.L68
	movq	8(%rsp), %rsi
	movl	$2, %ecx
	movl	$128, %edx
	movq	%rbp, %rdi
	call	cudaMemcpy@PLT
	movl	%eax, %r12d
	leaq	.LC8(%rip), %rsi
	testl	%eax, %eax
	jne	.L68
	movq	(%rsp), %rdi
	call	cudaFree@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	leaq	_ZSt4cout(%rip), %r13
	leaq	.LC9(%rip), %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	xorl	%r12d, %r12d
	leaq	.LC10(%rip), %r14
.L27:
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%r12d, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	cvtss2sd	(%rbx,%r12,4), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	cvtss2sd	0(%rbp,%r12,4), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.LEHE2:
	incq	%r12
	cmpq	$32, %r12
	jne	.L27
	xorl	%ebx, %ebx
	jmp	.L28
.L17:
	orl	$-1, %ebx
.L28:
	leaq	64(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	leaq	40(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L32
	jmp	.L39
.L34:
	endbr64
	movq	%rax, %rbx
.L29:
	leaq	64(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	jmp	.L30
.L33:
	endbr64
	movq	%rax, %rbx
.L30:
	leaq	40(%rsp), %rdi
	call	_ZNSt6vectorIfSaIfEED1Ev
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	movq	%rbx, %rdi
.LEHB3:
	call	_Unwind_Resume@PLT
.LEHE3:
.L39:
	call	__stack_chk_fail@PLT
.L32:
	addq	$104, %rsp
	.cfi_def_cfa_offset 56
	movl	%ebx, %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 .L33-.LFB3998
	.uleb128 0
	.uleb128 .LEHB2-.LFB3998
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L34-.LFB3998
	.uleb128 0
	.uleb128 .LEHB3-.LFB3998
	.uleb128 .LEHE3-.LEHB3
	.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
	.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>

// Define the number of boundary elements
#define NUM_ELEMENTS 32

// Kernel to simulate fluid-structure interaction using atomics
__global__ void fluidStructureInteraction(float* forces, float* displacements) {
    int idx = blockIdx.x * blockDim.x + threadIdx.x;

    if (idx < NUM_ELEMENTS) {
        // Simulate force calculation (e.g., fluid pressure)
        float force = 1.0f + sinf(idx * 0.1f); // Example force calculation

        // Use atomicAdd to accumulate forces safely
        atomicAdd(&forces[idx], force);

        // Simulate displacement update based on force
        float displacement = forces[idx] * 0.01f; // Example displacement calculation

        // Use atomicExch to safely update displacements
        atomicExch(&displacements[idx], displacement);
    }
}

int main() {
    // Allocate memory for forces and displacements on the host
    std::vector<float> h_forces(NUM_ELEMENTS, 0.0f);
    std::vector<float> h_displacements(NUM_ELEMENTS, 0.0f);

    // Allocate memory for forces and displacements on the device
    float* d_forces;
    float* d_displacements;
    hipError_t err;

    err = hipMalloc((void**)&d_forces, NUM_ELEMENTS * sizeof(float));
    if (err != hipSuccess) {
        std::cerr << "Failed to allocate device forces: " << hipGetErrorString(err) << std::endl;
        return -1;
    }

    err = hipMalloc((void**)&d_displacements, NUM_ELEMENTS * sizeof(float));
    if (err != hipSuccess) {
        std::cerr << "Failed to allocate device displacements: " << hipGetErrorString(err) << std::endl;
        hipFree(d_forces);
        return -1;
    }

    // Initialize device memory with zero
    err = hipMemset(d_forces, 0, NUM_ELEMENTS * sizeof(float));
    if (err != hipSuccess) {
        std::cerr << "Failed to initialize device forces: " << hipGetErrorString(err) << std::endl;
        hipFree(d_forces);
        hipFree(d_displacements);
        return -1;
    }

    err = hipMemset(d_displacements, 0, NUM_ELEMENTS * sizeof(float));
    if (err != hipSuccess) {
        std::cerr << "Failed to initialize device displacements: " << hipGetErrorString(err) << std::endl;
        hipFree(d_forces);
        hipFree(d_displacements);
        return -1;
    }

    // Define block and grid sizes
    dim3 blockSize(32);
    dim3 gridSize((NUM_ELEMENTS + blockSize.x - 1) / blockSize.x);

    // Launch the kernel
    fluidStructureInteraction<<<gridSize, blockSize>>>(d_forces, d_displacements);

    // Check for errors in kernel launch
    err = hipGetLastError();
    if (err != hipSuccess) {
        std::cerr << "Kernel launch failed: " << hipGetErrorString(err) << std::endl;
        hipFree(d_forces);
        hipFree(d_displacements);
        return -1;
    }

    // Copy results back to host
    err = hipMemcpy(h_forces.data(), d_forces, NUM_ELEMENTS * sizeof(float), hipMemcpyDeviceToHost);
    if (err != hipSuccess) {
        std::cerr << "Failed to copy forces from device to host: " << hipGetErrorString(err) << std::endl;
        hipFree(d_forces);
        hipFree(d_displacements);
        return -1;
    }

    err = hipMemcpy(h_displacements.data(), d_displacements, NUM_ELEMENTS * sizeof(float), hipMemcpyDeviceToHost);
    if (err != hipSuccess) {
        std::cerr << "Failed to copy displacements from device to host: " << hipGetErrorString(err) << std::endl;
        hipFree(d_forces);
        hipFree(d_displacements);
        return -1;
    }

    // Free device memory
    hipFree(d_forces);
    hipFree(d_displacements);

    // Print results
    std::cout << "Forces and Displacements after simulation:" << std::endl;
    for (int i = 0; i < NUM_ELEMENTS; ++i) {
        std::cout << "Element " << i << ": Force = " << h_forces[i] << ", Displacement = " << h_displacements[i] << std::endl;
    }

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

                                        # End of file scope inline assembly
	.globl	_Z40__device_stub__fluidStructureInteractionPfS_ # -- Begin function _Z40__device_stub__fluidStructureInteractionPfS_
	.type	_Z40__device_stub__fluidStructureInteractionPfS_,@function
_Z40__device_stub__fluidStructureInteractionPfS_: # @_Z40__device_stub__fluidStructureInteractionPfS_
	.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	$_Z25fluidStructureInteractionPfS_, %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_end0:
	.size	_Z40__device_stub__fluidStructureInteractionPfS_, .Lfunc_end0-_Z40__device_stub__fluidStructureInteractionPfS_
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:                                # %.noexc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$128, %edi
	callq	_Znwm
	movq	%rax, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	movups	%xmm0, 16(%rax)
	movups	%xmm0, 32(%rax)
	movups	%xmm0, 48(%rax)
	movups	%xmm0, 64(%rax)
	movups	%xmm0, 80(%rax)
	movups	%xmm0, 96(%rax)
	movups	%xmm0, 112(%rax)
.Ltmp0:
	movl	$128, %edi
	callq	_Znwm
.Ltmp1:
# %bb.1:                                # %.lr.ph.i.i.i.i.i.i.i.i.i53.preheader
	movq	%rax, %r14
	xorps	%xmm0, %xmm0
	movups	%xmm0, 112(%rax)
	movups	%xmm0, 96(%rax)
	movups	%xmm0, 80(%rax)
	movups	%xmm0, 64(%rax)
	movups	%xmm0, 48(%rax)
	movups	%xmm0, 32(%rax)
	movups	%xmm0, 16(%rax)
	movups	%xmm0, (%rax)
.Ltmp3:
	movq	%rsp, %r12
	movl	$128, %esi
	movq	%r12, %rdi
	callq	hipMalloc
.Ltmp4:
# %bb.2:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB1_12
# %bb.3:
.Ltmp5:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	movl	$34, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp6:
# %bb.4:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp7:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp8:
# %bb.5:
	movq	%rax, %r15
	testq	%rax, %rax
	je	.LBB1_6
# %bb.7:
	movq	%r15, %rdi
	callq	strlen
.Ltmp9:
	movl	$_ZSt4cerr, %edi
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp10:
	jmp	.LBB1_8
.LBB1_12:
.Ltmp19:
	leaq	8(%rsp), %r15
	movl	$128, %esi
	movq	%r15, %rdi
	callq	hipMalloc
.Ltmp20:
# %bb.13:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB1_22
# %bb.14:
.Ltmp21:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.1, %esi
	movl	$41, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp22:
# %bb.15:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit64
.Ltmp23:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp24:
# %bb.16:
	movq	%rax, %r15
	testq	%rax, %rax
	je	.LBB1_17
# %bb.18:
	movq	%r15, %rdi
	callq	strlen
.Ltmp25:
	movl	$_ZSt4cerr, %edi
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp26:
	jmp	.LBB1_19
.LBB1_6:
	movq	_ZSt4cerr(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cerr(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp11:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp12:
.LBB1_8:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit61
	movq	_ZSt4cerr(%rip), %rax
	movl	$_ZSt4cerr, %edi
	addq	-24(%rax), %rdi
.Ltmp13:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp14:
# %bb.9:                                # %.noexc123
.Ltmp15:
	movsbl	%al, %esi
	movl	$_ZSt4cerr, %edi
	callq	_ZNSo3putEc
.Ltmp16:
# %bb.10:                               # %.noexc124
	movl	$-1, %ebp
.Ltmp17:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp18:
	jmp	.LBB1_82
.LBB1_22:
	movq	(%rsp), %rdi
.Ltmp35:
	movl	$128, %edx
	xorl	%esi, %esi
	callq	hipMemset
.Ltmp36:
# %bb.23:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB1_32
# %bb.24:
.Ltmp37:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.2, %esi
	movl	$36, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp38:
# %bb.25:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit72
.Ltmp39:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp40:
# %bb.26:
	movq	%rax, %r12
	testq	%rax, %rax
	je	.LBB1_27
# %bb.28:
	movq	%r12, %rdi
	callq	strlen
.Ltmp41:
	movl	$_ZSt4cerr, %edi
	movq	%r12, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp42:
	jmp	.LBB1_29
.LBB1_17:
	movq	_ZSt4cerr(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cerr(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp27:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp28:
.LBB1_19:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit68
	movq	_ZSt4cerr(%rip), %rax
	movl	$_ZSt4cerr, %edi
	addq	-24(%rax), %rdi
.Ltmp29:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp30:
# %bb.20:                               # %.noexc126
.Ltmp31:
	movsbl	%al, %esi
	movl	$_ZSt4cerr, %edi
	callq	_ZNSo3putEc
.Ltmp32:
# %bb.21:                               # %.noexc127
.Ltmp33:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp34:
	movq	%r12, %r15
	jmp	.LBB1_43
.LBB1_32:
	movq	8(%rsp), %rdi
.Ltmp51:
	movl	$128, %edx
	xorl	%esi, %esi
	callq	hipMemset
.Ltmp52:
# %bb.33:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB1_44
# %bb.34:
.Ltmp53:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.3, %esi
	movl	$43, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp54:
# %bb.35:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit80
.Ltmp55:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp56:
# %bb.36:
	movq	%rax, %r12
	testq	%rax, %rax
	je	.LBB1_37
# %bb.38:
	movq	%r12, %rdi
	callq	strlen
.Ltmp57:
	movl	$_ZSt4cerr, %edi
	movq	%r12, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp58:
	jmp	.LBB1_39
.LBB1_27:
	movq	_ZSt4cerr(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cerr(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp43:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp44:
.LBB1_29:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit76
	movq	_ZSt4cerr(%rip), %rax
	movl	$_ZSt4cerr, %edi
	addq	-24(%rax), %rdi
.Ltmp45:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp46:
# %bb.30:                               # %.noexc130
.Ltmp47:
	movsbl	%al, %esi
	movl	$_ZSt4cerr, %edi
	callq	_ZNSo3putEc
.Ltmp48:
# %bb.31:                               # %.noexc131
.Ltmp49:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp50:
	jmp	.LBB1_42
.LBB1_44:
.Ltmp72:
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movabsq	$4294967328, %rdx               # imm = 0x100000020
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp73:
# %bb.45:
	testl	%eax, %eax
	jne	.LBB1_47
# %bb.46:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
.Ltmp74:
	callq	_Z40__device_stub__fluidStructureInteractionPfS_
.Ltmp75:
.LBB1_47:
.Ltmp76:
	callq	hipGetLastError
.Ltmp77:
# %bb.48:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB1_53
# %bb.49:
.Ltmp78:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.4, %esi
	movl	$22, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp79:
# %bb.50:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit88
.Ltmp80:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp81:
# %bb.51:
.Ltmp82:
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp83:
# %bb.52:
.Ltmp84:
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp85:
	jmp	.LBB1_65
.LBB1_37:
	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:
.LBB1_39:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit84
	movq	_ZSt4cerr(%rip), %rax
	movl	$_ZSt4cerr, %edi
	addq	-24(%rax), %rdi
.Ltmp61:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp62:
# %bb.40:                               # %.noexc134
.Ltmp63:
	movsbl	%al, %esi
	movl	$_ZSt4cerr, %edi
	callq	_ZNSo3putEc
.Ltmp64:
# %bb.41:                               # %.noexc135
.Ltmp65:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp66:
.LBB1_42:                               # %_ZNSolsEPFRSoS_E.exit86.invoke
	movq	(%rsp), %rdi
.Ltmp67:
	callq	hipFree
.Ltmp68:
.LBB1_43:                               # %.invoke
	movq	(%r15), %rdi
	movl	$-1, %ebp
.Ltmp69:
	callq	hipFree
.Ltmp70:
.LBB1_82:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit115
	movq	%r14, %rdi
	callq	_ZdlPv
	movq	%rbx, %rdi
	callq	_ZdlPv
	movl	%ebp, %eax
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.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
.LBB1_53:
	.cfi_def_cfa_offset 64
	movq	(%rsp), %rsi
.Ltmp86:
	movl	$128, %edx
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp87:
# %bb.54:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB1_59
# %bb.55:
.Ltmp88:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.5, %esi
	movl	$43, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp89:
# %bb.56:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit92
.Ltmp90:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp91:
# %bb.57:
.Ltmp92:
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp93:
# %bb.58:
.Ltmp94:
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp95:
	jmp	.LBB1_65
.LBB1_59:
	movq	8(%rsp), %rsi
.Ltmp96:
	movl	$128, %edx
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp97:
# %bb.60:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB1_67
# %bb.61:
.Ltmp98:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.6, %esi
	movl	$50, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp99:
# %bb.62:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit96
.Ltmp100:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp101:
# %bb.63:
.Ltmp102:
	movl	$_ZSt4cerr, %edi
	movq	%rax, %rsi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.Ltmp103:
# %bb.64:
.Ltmp104:
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp105:
.LBB1_65:                               # %_ZNSolsEPFRSoS_E.exit98.invoke
	movq	(%rsp), %rdi
.Ltmp106:
	callq	hipFree
.Ltmp107:
# %bb.66:                               # %.invoke159
	movl	$-1, %ebp
	movq	8(%rsp), %rdi
.Ltmp108:
	callq	hipFree
.Ltmp109:
	jmp	.LBB1_82
.LBB1_67:
	movq	(%rsp), %rdi
.Ltmp110:
	callq	hipFree
.Ltmp111:
# %bb.68:
	movq	8(%rsp), %rdi
.Ltmp112:
	callq	hipFree
.Ltmp113:
# %bb.69:
.Ltmp114:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$42, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp115:
# %bb.70:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit100
.Ltmp116:
	movl	$_ZSt4cout, %edi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.Ltmp117:
# %bb.71:                               # %_ZNSolsEPFRSoS_E.exit102.preheader.preheader
	xorl	%r15d, %r15d
	xorl	%ebp, %ebp
.LBB1_72:                               # %_ZNSolsEPFRSoS_E.exit102.preheader
                                        # =>This Inner Loop Header: Depth=1
.Ltmp119:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.8, %esi
	movl	$8, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp120:
# %bb.73:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit104
                                        #   in Loop: Header=BB1_72 Depth=1
.Ltmp121:
	movl	$_ZSt4cout, %edi
	movl	%r15d, %esi
	callq	_ZNSolsEi
.Ltmp122:
# %bb.74:                               #   in Loop: Header=BB1_72 Depth=1
.Ltmp123:
	movq	%rax, %r12
	movl	$.L.str.9, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp124:
# %bb.75:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit106
                                        #   in Loop: Header=BB1_72 Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbx,%r15,4), %xmm0
.Ltmp125:
	movq	%r12, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp126:
# %bb.76:                               # %_ZNSolsEf.exit
                                        #   in Loop: Header=BB1_72 Depth=1
.Ltmp127:
	movq	%rax, %r12
	movl	$.L.str.10, %esi
	movl	$17, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp128:
# %bb.77:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit109
                                        #   in Loop: Header=BB1_72 Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14,%r15,4), %xmm0
.Ltmp129:
	movq	%r12, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp130:
# %bb.78:                               # %_ZNSolsEf.exit111
                                        #   in Loop: Header=BB1_72 Depth=1
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
.Ltmp131:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp132:
# %bb.79:                               # %.noexc138
                                        #   in Loop: Header=BB1_72 Depth=1
.Ltmp133:
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
.Ltmp134:
# %bb.80:                               # %.noexc139
                                        #   in Loop: Header=BB1_72 Depth=1
.Ltmp135:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp136:
# %bb.81:                               # %_ZNSolsEPFRSoS_E.exit113
                                        #   in Loop: Header=BB1_72 Depth=1
	incq	%r15
	cmpq	$32, %r15
	jne	.LBB1_72
	jmp	.LBB1_82
.LBB1_86:
.Ltmp118:
	jmp	.LBB1_84
.LBB1_87:
.Ltmp137:
	jmp	.LBB1_84
.LBB1_11:
.Ltmp2:
	movq	%rax, %r15
	jmp	.LBB1_85
.LBB1_83:
.Ltmp71:
.LBB1_84:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit117
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_ZdlPv
.LBB1_85:                               # %_ZNSt6vectorIfSaIfEED2Ev.exit119
	movq	%rbx, %rdi
	callq	_ZdlPv
	movq	%r15, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table1:
.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 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp50-.Ltmp3                 #   Call between .Ltmp3 and .Ltmp50
	.uleb128 .Ltmp71-.Lfunc_begin0          #     jumps to .Ltmp71
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp72-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp85-.Ltmp72                #   Call between .Ltmp72 and .Ltmp85
	.uleb128 .Ltmp118-.Lfunc_begin0         #     jumps to .Ltmp118
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp59-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp70-.Ltmp59                #   Call between .Ltmp59 and .Ltmp70
	.uleb128 .Ltmp71-.Lfunc_begin0          #     jumps to .Ltmp71
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp86-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp117-.Ltmp86               #   Call between .Ltmp86 and .Ltmp117
	.uleb128 .Ltmp118-.Lfunc_begin0         #     jumps to .Ltmp118
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp119-.Lfunc_begin0         # >> Call Site 7 <<
	.uleb128 .Ltmp136-.Ltmp119              #   Call between .Ltmp119 and .Ltmp136
	.uleb128 .Ltmp137-.Lfunc_begin0         #     jumps to .Ltmp137
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp136-.Lfunc_begin0         # >> Call Site 8 <<
	.uleb128 .Lfunc_end1-.Ltmp136           #   Call between .Ltmp136 and .Lfunc_end1
	.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:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB2_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB2_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z25fluidStructureInteractionPfS_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end2:
	.size	__hip_module_ctor, .Lfunc_end2-__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	.LBB3_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
.LBB3_2:
	retq
.Lfunc_end3:
	.size	__hip_module_dtor, .Lfunc_end3-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z25fluidStructureInteractionPfS_,@object # @_Z25fluidStructureInteractionPfS_
	.section	.rodata,"a",@progbits
	.globl	_Z25fluidStructureInteractionPfS_
	.p2align	3, 0x0
_Z25fluidStructureInteractionPfS_:
	.quad	_Z40__device_stub__fluidStructureInteractionPfS_
	.size	_Z25fluidStructureInteractionPfS_, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Failed to allocate device forces: "
	.size	.L.str, 35

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Failed to allocate device displacements: "
	.size	.L.str.1, 42

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Failed to initialize device forces: "
	.size	.L.str.2, 37

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Failed to initialize device displacements: "
	.size	.L.str.3, 44

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Kernel launch failed: "
	.size	.L.str.4, 23

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Failed to copy forces from device to host: "
	.size	.L.str.5, 44

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"Failed to copy displacements from device to host: "
	.size	.L.str.6, 51

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Forces and Displacements after simulation:"
	.size	.L.str.7, 43

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Element "
	.size	.L.str.8, 9

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	": Force = "
	.size	.L.str.9, 11

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	", Displacement = "
	.size	.L.str.10, 18

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z25fluidStructureInteractionPfS_"
	.size	.L__unnamed_1, 34

	.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 _Z40__device_stub__fluidStructureInteractionPfS_
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z25fluidStructureInteractionPfS_
	.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	_Z25fluidStructureInteractionPfS_ ; -- Begin function _Z25fluidStructureInteractionPfS_
	.globl	_Z25fluidStructureInteractionPfS_
	.p2align	8
	.type	_Z25fluidStructureInteractionPfS_,@function
_Z25fluidStructureInteractionPfS_:      ; @_Z25fluidStructureInteractionPfS_
; %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 32, v1
	s_cbranch_execz .LBB0_8
; %bb.1:
	v_cvt_f32_i32_e32 v0, v1
                                        ; implicit-def: $vgpr8
                                        ; implicit-def: $vgpr7
	s_mov_b32 s3, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v4, 0x3dcccccd, v0
	v_and_b32_e32 v6, 0x7fffffff, v4
	v_cmpx_ngt_f32_e64 0x48000000, |v4|
	s_xor_b32 s4, exec_lo, s3
	s_cbranch_execz .LBB0_3
; %bb.2:
	s_mov_b32 s2, 0x7fffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_or_b32 v0, v6, s2, 0x800000
	v_mad_u64_u32 v[2:3], null, 0xfe5163ab, v0, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_mov_b32 v8, 0 :: v_dual_mov_b32 v7, v3
	v_lshrrev_b32_e32 v3, 23, v6
	v_mad_u64_u32 v[9:10], null, 0x3c439041, v0, v[7:8]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v3, 0xffffff88, v3
	v_cmp_lt_u32_e32 vcc_lo, 63, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v7, v10
	v_cndmask_b32_e64 v5, 0, 0xffffffc0, vcc_lo
	v_mad_u64_u32 v[10:11], null, 0xdb629599, v0, v[7:8]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v3, v5, v3
	v_mov_b32_e32 v7, v11
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cmp_lt_u32_e64 s2, 31, v3
	v_cndmask_b32_e32 v2, v10, v2, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_mad_u64_u32 v[11:12], null, 0xf534ddc0, v0, v[7:8]
	v_cndmask_b32_e64 v5, 0, 0xffffffe0, s2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_nc_u32_e32 v3, v5, v3
	v_mov_b32_e32 v7, v12
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_lt_u32_e64 s3, 31, v3
	v_mad_u64_u32 v[12:13], null, 0xfc2757d1, v0, v[7:8]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mov_b32_e32 v7, v13
	v_mad_u64_u32 v[13:14], null, 0x4e441529, v0, v[7:8]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v7, v14
	v_cndmask_b32_e32 v5, v13, v11, vcc_lo
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[14:15], null, 0xa2f9836e, v0, v[7:8]
	v_cndmask_b32_e64 v0, 0, 0xffffffe0, s3
	v_dual_cndmask_b32 v7, v14, v12 :: v_dual_add_nc_u32 v0, v0, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_cndmask_b32_e32 v8, v15, v13, vcc_lo
	v_dual_cndmask_b32 v12, v12, v10 :: v_dual_cndmask_b32 v3, v11, v9
	v_cmp_eq_u32_e32 vcc_lo, 0, v0
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_cndmask_b32_e64 v9, v7, v5, s2
	v_cndmask_b32_e64 v7, v8, v7, s2
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_4)
	v_cndmask_b32_e64 v5, v5, v12, s2
	v_sub_nc_u32_e32 v8, 32, v0
	v_cndmask_b32_e64 v11, v12, v3, s2
	v_cndmask_b32_e64 v7, v7, v9, s3
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cndmask_b32_e64 v9, v9, v5, s3
	v_cndmask_b32_e64 v5, v5, v11, s3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_alignbit_b32 v12, v7, v9, v8
	v_alignbit_b32 v10, v9, v5, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_cndmask_b32_e32 v0, v12, v7, vcc_lo
	v_cndmask_b32_e64 v2, v3, v2, s2
	v_cndmask_b32_e32 v3, v10, v9, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_bfe_u32 v9, v0, 29, 1
	v_cndmask_b32_e64 v2, v11, v2, s3
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_alignbit_b32 v7, v0, v3, 30
	v_sub_nc_u32_e32 v10, 0, v9
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_alignbit_b32 v8, v5, v2, v8
	v_xor_b32_e32 v7, v7, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v5, v8, v5, vcc_lo
	v_clz_i32_u32_e32 v8, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_alignbit_b32 v3, v3, v5, 30
	v_alignbit_b32 v2, v5, v2, 30
	v_min_u32_e32 v8, 32, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_xor_b32_e32 v3, v3, v10
	v_xor_b32_e32 v2, v2, v10
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_sub_nc_u32_e32 v5, 31, v8
	v_lshlrev_b32_e32 v12, 23, v8
	v_alignbit_b32 v7, v7, v3, v5
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_alignbit_b32 v2, v3, v2, v5
	v_lshrrev_b32_e32 v5, 29, v0
	v_lshrrev_b32_e32 v0, 30, v0
	v_alignbit_b32 v3, v7, v2, 9
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_lshlrev_b32_e32 v5, 31, v5
	v_lshrrev_b32_e32 v7, 9, v7
	v_clz_i32_u32_e32 v10, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_or_b32_e32 v11, 0.5, v5
	v_min_u32_e32 v10, 32, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_nc_u32_e32 v11, v11, v12
	v_sub_nc_u32_e32 v13, 31, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_alignbit_b32 v2, v3, v2, v13
	v_or_b32_e32 v3, v7, v11
	v_add_lshl_u32 v7, v10, v8, 23
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshrrev_b32_e32 v2, 9, v2
	v_mul_f32_e32 v8, 0x3fc90fda, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_sub_nc_u32_e32 v2, v2, v7
	v_fma_f32 v7, 0x3fc90fda, v3, -v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_nc_u32_e32 v2, 0x33000000, v2
	v_fmamk_f32 v3, v3, 0x33a22168, v7
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_or_b32_e32 v2, v2, v5
	v_fmac_f32_e32 v3, 0x3fc90fda, v2
	s_delay_alu instid0(VALU_DEP_1)
	v_dual_add_f32 v7, v8, v3 :: v_dual_add_nc_u32 v8, v9, v0
.LBB0_3:                                ; %Flow
	s_and_not1_saveexec_b32 s2, s4
; %bb.4:
	v_mul_f32_e64 v0, 0x3f22f983, |v4|
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_rndne_f32_e32 v0, v0
	v_fma_f32 v2, 0xbfc90fda, v0, |v4|
	v_cvt_i32_f32_e32 v8, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmamk_f32 v2, v0, 0xb3a22168, v2
	v_fmamk_f32 v7, v0, 0xa7c234c4, v2
; %bb.5:                                ; %_ZL4sinff.exit
	s_or_b32 exec_lo, exec_lo, s2
	s_load_b128 s[0:3], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_mul_f32_e32 v9, v7, v7
	v_xor_b32_e32 v6, v6, v4
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v1, vcc_lo
	s_mov_b32 s0, 0xb94c1982
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_fmaak_f32 v10, s0, v9, 0x3c0881c4
	global_load_b32 v5, v[2:3], off
	s_mov_b32 s0, 0x37d75334
	v_fmaak_f32 v10, v9, v10, 0xbe2aaa9d
	v_mul_f32_e32 v10, v9, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_dual_fmac_f32 v7, v7, v10 :: v_dual_and_b32 v10, 1, v8
	v_dual_fmaak_f32 v11, s0, v9, 0xbab64f3b :: v_dual_lshlrev_b32 v8, 30, v8
	s_mov_b32 s0, 0
	v_cmp_eq_u32_e32 vcc_lo, 0, v10
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fmaak_f32 v11, v9, v11, 0x3d2aabf7
	v_and_b32_e32 v8, 0x80000000, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmaak_f32 v11, v9, v11, 0xbf000004
	v_fma_f32 v9, v9, v11, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cndmask_b32_e32 v7, v9, v7, vcc_lo
	v_cmp_class_f32_e64 vcc_lo, v4, 0x1f8
	v_xor3_b32 v6, v6, v8, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_f32_e32 v6, 1.0, v6
	v_cndmask_b32_e32 v6, 0x7fc00000, v6, vcc_lo
.LBB0_6:                                ; %atomicrmw.start
                                        ; =>This Inner Loop Header: Depth=1
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f32_e32 v4, v5, v6
	global_atomic_cmpswap_b32 v4, v[2:3], v[4:5], off glc
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e32 vcc_lo, v4, v5
	v_mov_b32_e32 v5, v4
	s_or_b32 s0, vcc_lo, s0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s0
	s_cbranch_execnz .LBB0_6
; %bb.7:                                ; %atomicrmw.end
	s_or_b32 exec_lo, exec_lo, s0
	global_load_b32 v2, v[2:3], off
	v_add_co_u32 v0, vcc_lo, s2, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v1, vcc_lo
	s_waitcnt vmcnt(0)
	v_mul_f32_e32 v2, 0x3c23d70a, v2
	global_atomic_swap_b32 v[0:1], v2, off
.LBB0_8:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z25fluidStructureInteractionPfS_
		.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 16
		.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	_Z25fluidStructureInteractionPfS_, .Lfunc_end0-_Z25fluidStructureInteractionPfS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1176
; NumSgprs: 18
; NumVgprs: 16
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 16
; 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
      - .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:           _Z25fluidStructureInteractionPfS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z25fluidStructureInteractionPfS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     16
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
