/*
 * Solve-1 by SnipGhost 22.03.2017
 */
#include <stdio.h>
#include <stdlib.h>

#define INCREMENT 5
#define BLOCK_SIZE 8

#define CUDA_CHECK_RETURN(value) {											\
	cudaError_t _m_cudaStat = value;										\
	if (_m_cudaStat != cudaSuccess) {										\
		fprintf(stderr, "Error %s at line %d in file %s\n",					\
				cudaGetErrorString(_m_cudaStat), __LINE__, __FILE__);		\
		exit(1);															\
	} }


__global__ void kernel_simulate(float *data, float *buff, const int size, const float Hx, const float Ht)
{
	unsigned tid = blockIdx.x * blockDim.x + threadIdx.x;
	if (tid == 0) {
		buff[tid] = 0;
		return;
	} else if (tid == size-1) {
		buff[tid] += INCREMENT;
		return;
	}
	buff[tid] += ((data[tid+1] - 2*data[tid] + data[tid-1]) * Ht) / (Hx * Hx);
}

void initialize(float *d, int size, float init = 0)
{
	for (int i = 0; i < size; ++i)
		d[i] = init;
}

void save_data(FILE *f, float *d, int size, int z)
{
	 if (!f)
		 printf("File output error\n");
	 else
		 for (int i = 0; i < size; ++i)
			 fprintf(f, "%4d %4d %20.4f\n", i, z, d[i]);
}

void print_data(float *d, int size, int z)
{
	for (int i = 0; i < size; ++i)
		printf("%4d %4d %10.4f\n", i, z, d[i]);
}

int main(void)
{
	const int S_LENGTH = 32;
	const int T_LENGTH = 16;

	const float Hx = 0.5;
	const float Ht = 0.05;

	const int NODES = S_LENGTH / Hx;
	const int TICKS = T_LENGTH / Ht;
	const int numBytes = sizeof(float) * NODES;

	FILE *f = fopen("out","w");

	dim3 threads(BLOCK_SIZE);
	dim3 blocks(NODES/BLOCK_SIZE);

	float *data_dev, *buff_dev, *data_host;

	data_host = (float*)malloc(numBytes);

	initialize(data_host, NODES);

	CUDA_CHECK_RETURN(cudaMalloc((void**)&data_dev, numBytes));
	CUDA_CHECK_RETURN(cudaMalloc((void**)&buff_dev, numBytes));
	CUDA_CHECK_RETURN(cudaMemcpy(data_dev, data_host, numBytes, cudaMemcpyHostToDevice));

	for (int t = 0; t < TICKS; ++t)
	{
		kernel_simulate <<< blocks, threads >>> (data_dev, buff_dev, NODES, Hx, Ht);
		CUDA_CHECK_RETURN(cudaGetLastError());
		CUDA_CHECK_RETURN(cudaMemcpy(data_dev, buff_dev, numBytes, cudaMemcpyDeviceToDevice));
		CUDA_CHECK_RETURN(cudaMemcpy(data_host, buff_dev, numBytes, cudaMemcpyDeviceToHost));
		save_data(f, data_host, NODES, t);
	}

	CUDA_CHECK_RETURN(cudaFree((void*)data_dev));
	CUDA_CHECK_RETURN(cudaFree((void*)buff_dev));
	CUDA_CHECK_RETURN(cudaDeviceReset());

	free(data_host);

	fclose(f);

	return 0;
}

	.file	"tmpxft_002b59e1_00000000-6_z1.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2033:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2033:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z10initializePfif
	.type	_Z10initializePfif, @function
_Z10initializePfif:
.LFB2027:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
.L3:
	cmpl	%eax, %esi
	jle	.L6
	movss	%xmm0, (%rdi,%rax,4)
	incq	%rax
	jmp	.L3
.L6:
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z10initializePfif, .-_Z10initializePfif
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"File output error\n"
.LC1:
	.string	"%4d %4d %20.4f\n"
	.text
	.globl	_Z9save_dataP8_IO_FILEPfii
	.type	_Z9save_dataP8_IO_FILEPfii, @function
_Z9save_dataP8_IO_FILEPfii:
.LFB2028:
	.cfi_startproc
	endbr64
	testq	%rdi, %rdi
	jne	.L12
	leaq	.LC0(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
.L12:
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%ecx, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	pushq	%r8
	.cfi_def_cfa_offset 64
.L8:
	movl	%ebx, %ecx
	cmpl	%ebx, %r12d
	jle	.L15
	movl	%r14d, %r8d
	movq	%r15, %rdx
	movl	$2, %esi
	movq	%rbp, %rdi
	movb	$1, %al
	cvtss2sd	0(%r13,%rbx,4), %xmm0
	incq	%rbx
	call	__fprintf_chk@PLT
	jmp	.L8
.L15:
	popq	%rax
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z9save_dataP8_IO_FILEPfii, .-_Z9save_dataP8_IO_FILEPfii
	.section	.rodata.str1.1
.LC2:
	.string	"%4d %4d %10.4f\n"
	.text
	.globl	_Z10print_dataPfii
	.type	_Z10print_dataPfii, @function
_Z10print_dataPfii:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC2(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movl	%edx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
.L17:
	movl	%ebx, %edx
	cmpl	%ebx, %ebp
	jle	.L20
	movl	%r13d, %ecx
	movq	%r14, %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	(%r12,%rbx,4), %xmm0
	call	__printf_chk@PLT
	incq	%rbx
	jmp	.L17
.L20:
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z10print_dataPfii, .-_Z10print_dataPfii
	.globl	_Z40__device_stub__Z15kernel_simulatePfS_iffPfS_iff
	.type	_Z40__device_stub__Z15kernel_simulatePfS_iffPfS_iff, @function
_Z40__device_stub__Z15kernel_simulatePfS_iffPfS_iff:
.LFB2055:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movss	%xmm0, 8(%rsp)
	movss	%xmm1, 4(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L21
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z15kernel_simulatePfS_iff(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L21:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2055:
	.size	_Z40__device_stub__Z15kernel_simulatePfS_iffPfS_iff, .-_Z40__device_stub__Z15kernel_simulatePfS_iffPfS_iff
	.globl	_Z15kernel_simulatePfS_iff
	.type	_Z15kernel_simulatePfS_iff, @function
_Z15kernel_simulatePfS_iff:
.LFB2056:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z15kernel_simulatePfS_iffPfS_iff
	.cfi_endproc
.LFE2056:
	.size	_Z15kernel_simulatePfS_iff, .-_Z15kernel_simulatePfS_iff
	.section	.rodata.str1.1
.LC3:
	.string	"w"
.LC4:
	.string	"out"
.LC6:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/SnipGhost/cuda-tech-park/master/SZ1/z1.cu"
.LC7:
	.string	"Error %s at line %d in file %s\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC3(%rip), %rsi
	leaq	.LC4(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$48, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	fopen@PLT
	movl	$256, %edi
	movl	$1, 24(%rsp)
	movq	%rax, %rbp
	movl	$536870913, %eax
	movl	$1, 36(%rsp)
	salq	$3, %rax
	movq	%rax, 16(%rsp)
	movq	%rax, 28(%rsp)
	call	malloc@PLT
	movl	$64, %esi
	xorps	%xmm0, %xmm0
	movq	%rax, %rdi
	movq	%rax, %rbx
	call	_Z10initializePfif
	movq	%rsp, %rdi
	movl	$256, %esi
	call	cudaMalloc@PLT
	testl	%eax, %eax
	je	.L27
	movl	%eax, %edi
	call	cudaGetErrorString@PLT
	leaq	.LC6(%rip), %r9
	movl	$76, %r8d
	movq	%rax, %rcx
	jmp	.L42
.L27:
	leaq	8(%rsp), %rdi
	movl	$256, %esi
	call	cudaMalloc@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L28
	call	cudaGetErrorString@PLT
	leaq	.LC6(%rip), %r9
	movl	$77, %r8d
	movq	%rax, %rcx
.L42:
	movq	stderr(%rip), %rdi
	leaq	.LC7(%rip), %rdx
	movl	$2, %esi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L28:
	movq	(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rsi
	xorl	%r12d, %r12d
	movl	$256, %edx
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L29
	call	cudaGetErrorString@PLT
	leaq	.LC6(%rip), %r9
	movl	$78, %r8d
	movq	%rax, %rcx
	jmp	.L42
.L33:
	movl	%r12d, %ecx
	movl	$64, %edx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	_Z9save_dataP8_IO_FILEPfii
	incl	%r12d
	cmpl	$320, %r12d
	je	.L43
.L29:
	movl	24(%rsp), %ecx
	movq	16(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	28(%rsp), %rdi
	movl	36(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L30
	movq	8(%rsp), %rsi
	movq	(%rsp), %rdi
	movl	$64, %edx
	movss	.LC8(%rip), %xmm1
	movss	.LC9(%rip), %xmm0
	call	_Z40__device_stub__Z15kernel_simulatePfS_iffPfS_iff
.L30:
	call	cudaGetLastError@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L31
	call	cudaGetErrorString@PLT
	leaq	.LC6(%rip), %r9
	movl	$83, %r8d
	movq	%rax, %rcx
	jmp	.L42
.L31:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$3, %ecx
	movl	$256, %edx
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L32
	call	cudaGetErrorString@PLT
	leaq	.LC6(%rip), %r9
	movl	$84, %r8d
	movq	%rax, %rcx
	jmp	.L42
.L32:
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	movl	$2, %ecx
	movl	$256, %edx
	call	cudaMemcpy@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L33
	call	cudaGetErrorString@PLT
	leaq	.LC6(%rip), %r9
	movl	$85, %r8d
	movq	%rax, %rcx
	jmp	.L42
.L43:
	movq	(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L34
	call	cudaGetErrorString@PLT
	leaq	.LC6(%rip), %r9
	movl	$89, %r8d
	movq	%rax, %rcx
	jmp	.L42
.L34:
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L35
	call	cudaGetErrorString@PLT
	leaq	.LC6(%rip), %r9
	movl	$90, %r8d
	movq	%rax, %rcx
	jmp	.L42
.L35:
	call	cudaDeviceReset@PLT
	movl	%eax, %edi
	testl	%eax, %eax
	je	.L36
	call	cudaGetErrorString@PLT
	leaq	.LC6(%rip), %r9
	movl	$91, %r8d
	movq	%rax, %rcx
	jmp	.L42
.L36:
	movq	%rbx, %rdi
	call	free@PLT
	movq	%rbp, %rdi
	call	fclose@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L37
	call	__stack_chk_fail@PLT
.L37:
	addq	$48, %rsp
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2030:
	.size	main, .-main
	.section	.rodata.str1.1
.LC10:
	.string	"_Z15kernel_simulatePfS_iff"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2058:
	.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	.LC10(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z15kernel_simulatePfS_iff(%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
.LFE2058:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC8:
	.long	1028443341
	.align 4
.LC9:
	.long	1056964608
	.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:

/*
 * Solve-1 by SnipGhost 22.03.2017
 */

#include <hip/hip_runtime.h>
#include <stdio.h>
#include <stdlib.h>

#define INCREMENT 5
#define BLOCK_SIZE 8

#define CUDA_CHECK_RETURN(value) {											\
	hipError_t _m_cudaStat = value;										\
	if (_m_cudaStat != hipSuccess) {										\
		fprintf(stderr, "Error %s at line %d in file %s\n",					\
				hipGetErrorString(_m_cudaStat), __LINE__, __FILE__);		\
		exit(1);															\
	} }


__global__ void kernel_simulate(float *data, float *buff, const int size, const float Hx, const float Ht)
{
	unsigned tid = blockIdx.x * blockDim.x + threadIdx.x;
	if (tid == 0) {
		buff[tid] = 0;
		return;
	} else if (tid == size-1) {
		buff[tid] += INCREMENT;
		return;
	}
	buff[tid] += ((data[tid+1] - 2*data[tid] + data[tid-1]) * Ht) / (Hx * Hx);
}

void initialize(float *d, int size, float init = 0)
{
	for (int i = 0; i < size; ++i)
		d[i] = init;
}

void save_data(FILE *f, float *d, int size, int z)
{
	 if (!f)
		 printf("File output error\n");
	 else
		 for (int i = 0; i < size; ++i)
			 fprintf(f, "%4d %4d %20.4f\n", i, z, d[i]);
}

void print_data(float *d, int size, int z)
{
	for (int i = 0; i < size; ++i)
		printf("%4d %4d %10.4f\n", i, z, d[i]);
}

int main(void)
{
	const int S_LENGTH = 32;
	const int T_LENGTH = 16;

	const float Hx = 0.5;
	const float Ht = 0.05;

	const int NODES = S_LENGTH / Hx;
	const int TICKS = T_LENGTH / Ht;
	const int numBytes = sizeof(float) * NODES;

	FILE *f = fopen("out","w");

	dim3 threads(BLOCK_SIZE);
	dim3 blocks(NODES/BLOCK_SIZE);

	float *data_dev, *buff_dev, *data_host;

	data_host = (float*)malloc(numBytes);

	initialize(data_host, NODES);

	CUDA_CHECK_RETURN(hipMalloc((void**)&data_dev, numBytes));
	CUDA_CHECK_RETURN(hipMalloc((void**)&buff_dev, numBytes));
	CUDA_CHECK_RETURN(hipMemcpy(data_dev, data_host, numBytes, hipMemcpyHostToDevice));

	for (int t = 0; t < TICKS; ++t)
	{
		kernel_simulate <<< blocks, threads >>> (data_dev, buff_dev, NODES, Hx, Ht);
		CUDA_CHECK_RETURN(hipGetLastError());
		CUDA_CHECK_RETURN(hipMemcpy(data_dev, buff_dev, numBytes, hipMemcpyDeviceToDevice));
		CUDA_CHECK_RETURN(hipMemcpy(data_host, buff_dev, numBytes, hipMemcpyDeviceToHost));
		save_data(f, data_host, NODES, t);
	}

	CUDA_CHECK_RETURN(hipFree((void*)data_dev));
	CUDA_CHECK_RETURN(hipFree((void*)buff_dev));
	CUDA_CHECK_RETURN(hipDeviceReset());

	free(data_host);

	fclose(f);

	return 0;
}

	.text
	.file	"z1.hip"
	.globl	_Z30__device_stub__kernel_simulatePfS_iff # -- Begin function _Z30__device_stub__kernel_simulatePfS_iff
	.type	_Z30__device_stub__kernel_simulatePfS_iff,@function
_Z30__device_stub__kernel_simulatePfS_iff: # @_Z30__device_stub__kernel_simulatePfS_iff
	.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	$128, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movss	%xmm0, (%rdx)
	leaq	4(%rsp), %rdi
	movss	%xmm1, (%rdi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rdi, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%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	$_Z15kernel_simulatePfS_iff, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	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	_Z30__device_stub__kernel_simulatePfS_iff, .Lfunc_end0-_Z30__device_stub__kernel_simulatePfS_iff
	.cfi_endproc
                                        # -- End function
	.globl	_Z10initializePfif              # -- Begin function _Z10initializePfif
	.type	_Z10initializePfif,@function
_Z10initializePfif:                     # @_Z10initializePfif
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB1_3
# %bb.1:                                # %.lr.ph.preheader
	movl	%esi, %eax
	xorl	%ecx, %ecx
.LBB1_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movss	%xmm0, (%rdi,%rcx,4)
	incq	%rcx
	cmpq	%rcx, %rax
	jne	.LBB1_2
.LBB1_3:                                # %._crit_edge
	retq
.Lfunc_end1:
	.size	_Z10initializePfif, .Lfunc_end1-_Z10initializePfif
	.cfi_endproc
                                        # -- End function
	.globl	_Z9save_dataP8_IO_FILEPfii      # -- Begin function _Z9save_dataP8_IO_FILEPfii
	.type	_Z9save_dataP8_IO_FILEPfii,@function
_Z9save_dataP8_IO_FILEPfii:             # @_Z9save_dataP8_IO_FILEPfii
	.cfi_startproc
# %bb.0:
	testq	%rdi, %rdi
	je	.LBB2_6
# %bb.1:                                # %.preheader
	testl	%edx, %edx
	jle	.LBB2_5
# %bb.2:                                # %.lr.ph.preheader
	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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	%ecx, %ebx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	%edx, %r13d
	xorl	%r12d, %r12d
.LBB2_3:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14,%r12,4), %xmm0
	movl	$.L.str.1, %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	movl	%ebx, %ecx
	movb	$1, %al
	callq	fprintf
	incq	%r12
	cmpq	%r12, %r13
	jne	.LBB2_3
# %bb.4:
	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
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
.LBB2_5:                                # %.loopexit
	retq
.LBB2_6:
	movl	$.Lstr, %edi
	jmp	puts@PLT                        # TAILCALL
.Lfunc_end2:
	.size	_Z9save_dataP8_IO_FILEPfii, .Lfunc_end2-_Z9save_dataP8_IO_FILEPfii
	.cfi_endproc
                                        # -- End function
	.globl	_Z10print_dataPfii              # -- Begin function _Z10print_dataPfii
	.type	_Z10print_dataPfii,@function
_Z10print_dataPfii:                     # @_Z10print_dataPfii
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB3_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	%edx, %ebx
	movq	%rdi, %r14
	movl	%esi, %r12d
	xorl	%r15d, %r15d
.LBB3_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14,%r15,4), %xmm0
	movl	$.L.str.2, %edi
	movl	%r15d, %esi
	movl	%ebx, %edx
	movb	$1, %al
	callq	printf
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB3_2
# %bb.3:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r14
	.cfi_restore %r15
.LBB3_4:                                # %._crit_edge
	retq
.Lfunc_end3:
	.size	_Z10print_dataPfii, .Lfunc_end3-_Z10print_dataPfii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI4_0:
	.long	0x3f000000                      # float 0.5
.LCPI4_1:
	.long	0x3d4ccccd                      # float 0.0500000007
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:                                # %_Z10initializePfif.exit
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$.L.str.3, %edi
	movl	$.L.str.4, %esi
	callq	fopen
	movq	%rax, %rbx
	movl	$1, %edi
	movl	$256, %esi                      # imm = 0x100
	callq	calloc@PLT
	movq	%rax, %r14
	leaq	16(%rsp), %rdi
	movl	$256, %esi                      # imm = 0x100
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB4_1
# %bb.3:
	leaq	8(%rsp), %rdi
	movl	$256, %esi                      # imm = 0x100
	callq	hipMalloc
	testl	%eax, %eax
	jne	.LBB4_4
# %bb.5:
	movq	16(%rsp), %rdi
	movl	$256, %edx                      # imm = 0x100
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB4_11
# %bb.6:                                # %.preheader.preheader
	xorl	%r15d, %r15d
	movabsq	$4294967304, %r12               # imm = 0x100000008
.LBB4_7:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_9
# %bb.8:                                #   in Loop: Header=BB4_7 Depth=1
	movq	16(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$64, %edx
	movss	.LCPI4_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	.LCPI4_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	callq	_Z30__device_stub__kernel_simulatePfS_iff
.LBB4_9:                                #   in Loop: Header=BB4_7 Depth=1
	callq	hipGetLastError
	testl	%eax, %eax
	jne	.LBB4_10
# %bb.12:                               #   in Loop: Header=BB4_7 Depth=1
	movq	16(%rsp), %rdi
	movq	8(%rsp), %rsi
	movl	$256, %edx                      # imm = 0x100
	movl	$3, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB4_13
# %bb.14:                               #   in Loop: Header=BB4_7 Depth=1
	movq	8(%rsp), %rsi
	movl	$256, %edx                      # imm = 0x100
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%eax, %eax
	jne	.LBB4_15
# %bb.16:                               #   in Loop: Header=BB4_7 Depth=1
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$64, %edx
	movl	%r15d, %ecx
	callq	_Z9save_dataP8_IO_FILEPfii
	incl	%r15d
	cmpl	$320, %r15d                     # imm = 0x140
	jne	.LBB4_7
# %bb.17:
	movq	16(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB4_18
# %bb.19:
	movq	8(%rsp), %rdi
	callq	hipFree
	testl	%eax, %eax
	jne	.LBB4_20
# %bb.21:
	callq	hipDeviceReset
	testl	%eax, %eax
	jne	.LBB4_22
# %bb.23:
	movq	%r14, %rdi
	callq	free
	movq	%rbx, %rdi
	callq	fclose
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB4_15:
	.cfi_def_cfa_offset 64
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.5, %esi
	movl	$.L.str.6, %r8d
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$87, %ecx
	jmp	.LBB4_2
.LBB4_13:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.5, %esi
	movl	$.L.str.6, %r8d
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$86, %ecx
	jmp	.LBB4_2
.LBB4_10:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.5, %esi
	movl	$.L.str.6, %r8d
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$85, %ecx
.LBB4_2:
	xorl	%eax, %eax
	callq	fprintf
	movl	$1, %edi
	callq	exit
.LBB4_1:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.5, %esi
	movl	$.L.str.6, %r8d
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$78, %ecx
	jmp	.LBB4_2
.LBB4_4:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.5, %esi
	movl	$.L.str.6, %r8d
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$79, %ecx
	jmp	.LBB4_2
.LBB4_11:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.5, %esi
	movl	$.L.str.6, %r8d
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$80, %ecx
	jmp	.LBB4_2
.LBB4_18:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.5, %esi
	movl	$.L.str.6, %r8d
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$91, %ecx
	jmp	.LBB4_2
.LBB4_20:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.5, %esi
	movl	$.L.str.6, %r8d
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$92, %ecx
	jmp	.LBB4_2
.LBB4_22:
	movq	stderr(%rip), %rbx
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.5, %esi
	movl	$.L.str.6, %r8d
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movl	$93, %ecx
	jmp	.LBB4_2
.Lfunc_end4:
	.size	main, .Lfunc_end4-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB5_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB5_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z15kernel_simulatePfS_iff, %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_end5:
	.size	__hip_module_ctor, .Lfunc_end5-__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	.LBB6_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
.LBB6_2:
	retq
.Lfunc_end6:
	.size	__hip_module_dtor, .Lfunc_end6-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z15kernel_simulatePfS_iff,@object # @_Z15kernel_simulatePfS_iff
	.section	.rodata,"a",@progbits
	.globl	_Z15kernel_simulatePfS_iff
	.p2align	3, 0x0
_Z15kernel_simulatePfS_iff:
	.quad	_Z30__device_stub__kernel_simulatePfS_iff
	.size	_Z15kernel_simulatePfS_iff, 8

	.type	.L.str.1,@object                # @.str.1
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.1:
	.asciz	"%4d %4d %20.4f\n"
	.size	.L.str.1, 16

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"%4d %4d %10.4f\n"
	.size	.L.str.2, 16

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"out"
	.size	.L.str.3, 4

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"w"
	.size	.L.str.4, 2

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Error %s at line %d in file %s\n"
	.size	.L.str.5, 32

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/SnipGhost/cuda-tech-park/master/SZ1/z1.hip"
	.size	.L.str.6, 105

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z15kernel_simulatePfS_iff"
	.size	.L__unnamed_1, 27

	.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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"File output error"
	.size	.Lstr, 18

	.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 _Z30__device_stub__kernel_simulatePfS_iff
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z15kernel_simulatePfS_iff
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z15kernel_simulatePfS_iff ; -- Begin function _Z15kernel_simulatePfS_iff
	.globl	_Z15kernel_simulatePfS_iff
	.p2align	8
	.type	_Z15kernel_simulatePfS_iff,@function
_Z15kernel_simulatePfS_iff:             ; @_Z15kernel_simulatePfS_iff
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x2c
	s_load_b128 s[4:7], s[0:1], 0x0
	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_ne_u32_e32 0, v1
	s_xor_b32 s8, exec_lo, s2
	s_cbranch_execz .LBB0_6
; %bb.1:
	s_load_b128 s[0:3], s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_add_i32 s0, s0, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_ne_u32_e32 vcc_lo, s0, v1
	s_and_saveexec_b32 s0, vcc_lo
	s_xor_b32 s0, exec_lo, s0
	s_cbranch_execz .LBB0_3
; %bb.2:
	v_dual_mov_b32 v4, 0 :: v_dual_add_nc_u32 v3, 1, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v2, v4
	v_lshlrev_b64 v[5:6], 2, v[3:4]
	v_add_nc_u32_e32 v3, -1, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	v_lshlrev_b64 v[2:3], 2, v[3:4]
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_4)
	v_add_co_u32 v4, vcc_lo, s4, v5
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v6, vcc_lo
	v_add_co_u32 v6, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v7, vcc_lo, s5, v1, vcc_lo
	v_add_co_u32 v2, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v3, vcc_lo
	s_clause 0x2
	global_load_b32 v4, v[4:5], off
	global_load_b32 v5, v[6:7], off
	global_load_b32 v2, v[2:3], off
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	global_load_b32 v3, v[0:1], off
	s_waitcnt vmcnt(2)
	v_fmac_f32_e32 v4, -2.0, v5
	s_waitcnt vmcnt(1)
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_add_f32_e32 v2, v2, v4
	v_mul_f32_e64 v4, s1, s1
	v_mul_f32_e32 v2, s2, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_scale_f32 v5, null, v4, v4, v2
	v_rcp_f32_e32 v6, v5
	s_waitcnt_depctr 0xfff
	v_fma_f32 v7, -v5, v6, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v6, v7, v6
	v_div_scale_f32 v7, vcc_lo, v2, v4, v2
	v_mul_f32_e32 v8, v7, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v9, -v5, v8, v7
	v_fmac_f32_e32 v8, v9, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v5, -v5, v8, v7
	v_div_fmas_f32 v5, v5, v6, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_div_fixup_f32 v2, v5, v4, v2
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v2, v3, v2
	global_store_b32 v[0:1], v2, off
                                        ; implicit-def: $vgpr1_vgpr2
.LBB0_3:                                ; %Flow
	s_and_not1_saveexec_b32 s0, s0
	s_cbranch_execz .LBB0_5
; %bb.4:
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	v_add_co_u32 v0, vcc_lo, s6, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	global_load_b32 v2, v[0:1], off
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v2, 0x40a00000, v2
	global_store_b32 v[0:1], v2, off
.LBB0_5:                                ; %Flow33
	s_or_b32 exec_lo, exec_lo, s0
.LBB0_6:                                ; %Flow34
	s_and_not1_saveexec_b32 s0, s8
	s_cbranch_execz .LBB0_8
; %bb.7:
	v_mov_b32_e32 v0, 0
	global_store_b32 v0, v0, s[6:7]
.LBB0_8:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z15kernel_simulatePfS_iff
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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 10
		.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	_Z15kernel_simulatePfS_iff, .Lfunc_end0-_Z15kernel_simulatePfS_iff
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 480
; NumSgprs: 18
; NumVgprs: 10
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 10
; 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:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z15kernel_simulatePfS_iff
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z15kernel_simulatePfS_iff.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     10
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
