#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>

#define TILE_WIDTH 10
#define TILE_HEIGHT 10

__host__
__device__ int calc_mandel(float c_re, float c_im, int count)
{
    float z_re = c_re, z_im = c_im;
    int i;
    for (i = 0; i < count; ++i) {

        if (z_re * z_re + z_im * z_im > 4.f)
            break;

        float new_re = z_re*z_re - z_im*z_im;
        float new_im = 2.f * z_re * z_im;
        z_re = c_re + new_re;
        z_im = c_im + new_im;
    }

    return i;
}

__host__
__device__ int mandelbrot_calc(
    float x0, float y0, float x1, float y1,
    int width, int height,
    int row, int col,
    int maxIterations)
{
    float dx = (x1 - x0) / width;
    float dy = (y1 - y0) / height;
	float x = x0 + col * dx;
	float y = y0 + row * dy;
	int val = calc_mandel(x, y, maxIterations);

	return val;
}

__global__ void mandelbrot_kernel(float x0, float y0, float x1, float y1, int width, int height, int maxIterations, int* output) {
	int col = blockIdx.x*blockDim.x + threadIdx.x;	
	int row = blockIdx.y*blockDim.y + threadIdx.y;
	if (row < height && col < width) {
		output[row*width + col] = mandelbrot_calc(x0, y0, x1, y1, width, height, row, col, maxIterations);
	}
}

void mandelbrotGpu(
    float x0, float y0, float x1, float y1,
    int width, int height,
    int maxIterations,
    int output[]) {

	int* d_output;
	float millisec = 0.0;
	cudaEvent_t start, stop;
	cudaEventCreate(&start);
	cudaEventCreate(&stop);
	
	cudaEventRecord(start);
	

	int nTilesX = (width / TILE_WIDTH) + ((width % TILE_WIDTH == 0) ? 0 : 1);
	int nTilesY = (height / TILE_HEIGHT) + ((height % TILE_HEIGHT == 0) ? 0 : 1);
	
	cudaMalloc(&d_output, width*height*sizeof(int));
	
	//printf("\ndim=%d,%d   %d,%d", nTilesX, nTilesY, TILE_WIDTH, TILE_HEIGHT);	
	
	dim3 threadsPerBlock(TILE_WIDTH, TILE_HEIGHT);
	dim3 blocksPerGrid(nTilesX, nTilesY);
	
	mandelbrot_kernel<<<blocksPerGrid, threadsPerBlock>>>(x0, y0, x1, y1, width, height, maxIterations, d_output);

	cudaMemcpy(output, d_output, width*height*sizeof(int), cudaMemcpyDeviceToHost);		
	
	cudaFree(d_output);		

	cudaEventRecord(stop);
	cudaEventSynchronize(stop);
	cudaEventElapsedTime(&millisec, start, stop);
	//printf("\ncuda time = %f\n", millisec);
	//printf("\nVal=%d\n", mandelbrot_calc(x0, y0, x1, y1, width, height, 5, 517, maxIterations));
}

	.file	"tmpxft_002cc976_00000000-6_mandelbrotGpu.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2032:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2032:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z11calc_mandelffi
	.type	_Z11calc_mandelffi, @function
_Z11calc_mandelffi:
.LFB2027:
	.cfi_startproc
	endbr64
	movaps	%xmm1, %xmm3
	movaps	%xmm0, %xmm2
	xorl	%eax, %eax
.L3:
	cmpl	%edi, %eax
	jge	.L2
	movaps	%xmm2, %xmm4
	movaps	%xmm3, %xmm5
	mulss	%xmm2, %xmm4
	mulss	%xmm3, %xmm5
	movaps	%xmm4, %xmm6
	addss	%xmm5, %xmm6
	comiss	.LC0(%rip), %xmm6
	ja	.L2
	addss	%xmm2, %xmm2
	subss	%xmm5, %xmm4
	incl	%eax
	mulss	%xmm2, %xmm3
	movaps	%xmm4, %xmm2
	addss	%xmm0, %xmm2
	addss	%xmm1, %xmm3
	jmp	.L3
.L2:
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z11calc_mandelffi, .-_Z11calc_mandelffi
	.globl	_Z15mandelbrot_calcffffiiiii
	.type	_Z15mandelbrot_calcffffiiiii, @function
_Z15mandelbrot_calcffffiiiii:
.LFB2028:
	.cfi_startproc
	endbr64
	movaps	%xmm0, %xmm4
	cvtsi2ssl	%esi, %xmm0
	subss	%xmm1, %xmm3
	movl	%edi, %eax
	subss	%xmm4, %xmm2
	movl	%r8d, %edi
	divss	%xmm0, %xmm3
	cvtsi2ssl	%edx, %xmm0
	mulss	%xmm0, %xmm3
	movaps	%xmm2, %xmm0
	cvtsi2ssl	%eax, %xmm2
	divss	%xmm2, %xmm0
	cvtsi2ssl	%ecx, %xmm2
	addss	%xmm3, %xmm1
	mulss	%xmm2, %xmm0
	addss	%xmm4, %xmm0
	jmp	_Z11calc_mandelffi
	.cfi_endproc
.LFE2028:
	.size	_Z15mandelbrot_calcffffiiiii, .-_Z15mandelbrot_calcffffiiiii
	.globl	_Z44__device_stub__Z17mandelbrot_kernelffffiiiPiffffiiiPi
	.type	_Z44__device_stub__Z17mandelbrot_kernelffffiiiPiffffiiiPi, @function
_Z44__device_stub__Z17mandelbrot_kernelffffiiiPiffffiiiPi:
.LFB2054:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movl	%edi, 28(%rsp)
	leaq	72(%rsp), %rdi
	movl	%esi, 24(%rsp)
	leaq	84(%rsp), %rsi
	movl	%edx, 20(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 8(%rsp)
	leaq	64(%rsp), %rcx
	movss	%xmm0, 44(%rsp)
	movss	%xmm1, 40(%rsp)
	movss	%xmm2, 36(%rsp)
	movss	%xmm3, 32(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	36(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L10
	pushq	64(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z17mandelbrot_kernelffffiiiPi(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 224
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L10:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2054:
	.size	_Z44__device_stub__Z17mandelbrot_kernelffffiiiPiffffiiiPi, .-_Z44__device_stub__Z17mandelbrot_kernelffffiiiPiffffiiiPi
	.globl	_Z17mandelbrot_kernelffffiiiPi
	.type	_Z17mandelbrot_kernelffffiiiPi, @function
_Z17mandelbrot_kernelffffiiiPi:
.LFB2055:
	.cfi_startproc
	endbr64
	jmp	_Z44__device_stub__Z17mandelbrot_kernelffffiiiPiffffiiiPi
	.cfi_endproc
.LFE2055:
	.size	_Z17mandelbrot_kernelffffiiiPi, .-_Z17mandelbrot_kernelffffiiiPi
	.globl	_Z13mandelbrotGpuffffiiiPi
	.type	_Z13mandelbrotGpuffffiiiPi, @function
_Z13mandelbrotGpuffffiiiPi:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rcx, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%edx, %r14d
	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
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movss	%xmm0, 28(%rsp)
	leaq	48(%rsp), %rdi
	movss	%xmm1, 24(%rsp)
	movss	%xmm2, 20(%rsp)
	movss	%xmm3, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	movl	$0x00000000, 36(%rsp)
	call	cudaEventCreate@PLT
	leaq	56(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	48(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movl	%ebx, %eax
	movl	$10, %ecx
	leaq	40(%rsp), %rdi
	cltd
	idivl	%ecx
	cmpl	$1, %edx
	sbbl	$-1, %eax
	movl	%eax, %r13d
	movl	%ebp, %eax
	cltd
	idivl	%ecx
	cmpl	$1, %edx
	sbbl	$-1, %eax
	movl	%eax, %r12d
	movl	%ebx, %eax
	imull	%ebp, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rsi
	movq	%rax, 8(%rsp)
	call	cudaMalloc@PLT
	movl	%r13d, 76(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	%r12d, 80(%rsp)
	movq	76(%rsp), %rdi
	movl	$1, %ecx
	movabsq	$42949672970, %rdx
	movl	$1, %esi
	call	__cudaPushCallConfiguration@PLT
	movss	16(%rsp), %xmm3
	movss	20(%rsp), %xmm2
	testl	%eax, %eax
	movss	24(%rsp), %xmm1
	movss	28(%rsp), %xmm0
	jne	.L16
	movq	40(%rsp), %rcx
	movl	%r14d, %edx
	movl	%ebp, %esi
	movl	%ebx, %edi
	call	_Z44__device_stub__Z17mandelbrot_kernelffffiiiPiffffiiiPi
.L16:
	movq	8(%rsp), %rdx
	movq	40(%rsp), %rsi
	movl	$2, %ecx
	movq	%r15, %rdi
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	56(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movq	56(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	56(%rsp), %rdx
	movq	48(%rsp), %rsi
	leaq	36(%rsp), %rdi
	call	cudaEventElapsedTime@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	addq	$104, %rsp
	.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
.LFE2029:
	.size	_Z13mandelbrotGpuffffiiiPi, .-_Z13mandelbrotGpuffffiiiPi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"_Z17mandelbrot_kernelffffiiiPi"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2057:
	.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	.LC2(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z17mandelbrot_kernelffffiiiPi(%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
.LFE2057:
	.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
.LC0:
	.long	1082130432
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


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

#define TILE_WIDTH 10
#define TILE_HEIGHT 10

__host__
__device__ int calc_mandel(float c_re, float c_im, int count)
{
    float z_re = c_re, z_im = c_im;
    int i;
    for (i = 0; i < count; ++i) {

        if (z_re * z_re + z_im * z_im > 4.f)
            break;

        float new_re = z_re*z_re - z_im*z_im;
        float new_im = 2.f * z_re * z_im;
        z_re = c_re + new_re;
        z_im = c_im + new_im;
    }

    return i;
}

__host__
__device__ int mandelbrot_calc(
    float x0, float y0, float x1, float y1,
    int width, int height,
    int row, int col,
    int maxIterations)
{
    float dx = (x1 - x0) / width;
    float dy = (y1 - y0) / height;
	float x = x0 + col * dx;
	float y = y0 + row * dy;
	int val = calc_mandel(x, y, maxIterations);

	return val;
}

__global__ void mandelbrot_kernel(float x0, float y0, float x1, float y1, int width, int height, int maxIterations, int* output) {
	int col = blockIdx.x*blockDim.x + threadIdx.x;	
	int row = blockIdx.y*blockDim.y + threadIdx.y;
	if (row < height && col < width) {
		output[row*width + col] = mandelbrot_calc(x0, y0, x1, y1, width, height, row, col, maxIterations);
	}
}

void mandelbrotGpu(
    float x0, float y0, float x1, float y1,
    int width, int height,
    int maxIterations,
    int output[]) {

	int* d_output;
	float millisec = 0.0;
	hipEvent_t start, stop;
	hipEventCreate(&start);
	hipEventCreate(&stop);
	
	hipEventRecord(start);
	

	int nTilesX = (width / TILE_WIDTH) + ((width % TILE_WIDTH == 0) ? 0 : 1);
	int nTilesY = (height / TILE_HEIGHT) + ((height % TILE_HEIGHT == 0) ? 0 : 1);
	
	hipMalloc(&d_output, width*height*sizeof(int));
	
	//printf("\ndim=%d,%d   %d,%d", nTilesX, nTilesY, TILE_WIDTH, TILE_HEIGHT);	
	
	dim3 threadsPerBlock(TILE_WIDTH, TILE_HEIGHT);
	dim3 blocksPerGrid(nTilesX, nTilesY);
	
	mandelbrot_kernel<<<blocksPerGrid, threadsPerBlock>>>(x0, y0, x1, y1, width, height, maxIterations, d_output);

	hipMemcpy(output, d_output, width*height*sizeof(int), hipMemcpyDeviceToHost);		
	
	hipFree(d_output);		

	hipEventRecord(stop);
	hipEventSynchronize(stop);
	hipEventElapsedTime(&millisec, start, stop);
	//printf("\ncuda time = %f\n", millisec);
	//printf("\nVal=%d\n", mandelbrot_calc(x0, y0, x1, y1, width, height, 5, 517, maxIterations));
}

	.text
	.file	"mandelbrotGpu.hip"
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z11calc_mandelffi
.LCPI0_0:
	.long	0x40800000                      # float 4
	.text
	.globl	_Z11calc_mandelffi
	.type	_Z11calc_mandelffi,@function
_Z11calc_mandelffi:                     # @_Z11calc_mandelffi
	.cfi_startproc
# %bb.0:
	xorl	%eax, %eax
	testl	%edi, %edi
	jle	.LBB0_5
# %bb.1:                                # %.lr.ph.preheader
	movss	.LCPI0_0(%rip), %xmm2           # xmm2 = mem[0],zero,zero,zero
	movaps	%xmm0, %xmm5
	movaps	%xmm1, %xmm3
	movaps	%xmm0, %xmm4
.LBB0_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	mulss	%xmm4, %xmm4
	movaps	%xmm3, %xmm6
	mulss	%xmm3, %xmm6
	movaps	%xmm6, %xmm7
	addss	%xmm4, %xmm7
	ucomiss	%xmm2, %xmm7
	ja	.LBB0_5
# %bb.3:                                #   in Loop: Header=BB0_2 Depth=1
	subss	%xmm6, %xmm4
	addss	%xmm5, %xmm5
	mulss	%xmm5, %xmm3
	addss	%xmm0, %xmm4
	addss	%xmm1, %xmm3
	incl	%eax
	movaps	%xmm4, %xmm5
	cmpl	%eax, %edi
	jne	.LBB0_2
# %bb.4:
	movl	%edi, %eax
.LBB0_5:                                # %._crit_edge
	retq
.Lfunc_end0:
	.size	_Z11calc_mandelffi, .Lfunc_end0-_Z11calc_mandelffi
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z15mandelbrot_calcffffiiiii
.LCPI1_0:
	.long	0x40800000                      # float 4
	.text
	.globl	_Z15mandelbrot_calcffffiiiii
	.type	_Z15mandelbrot_calcffffiiiii,@function
_Z15mandelbrot_calcffffiiiii:           # @_Z15mandelbrot_calcffffiiiii
	.cfi_startproc
# %bb.0:
	testl	%r8d, %r8d
	jle	.LBB1_1
# %bb.3:                                # %.lr.ph.i.preheader
	subss	%xmm0, %xmm2
	cvtsi2ss	%edi, %xmm4
	divss	%xmm4, %xmm2
	subss	%xmm1, %xmm3
	xorps	%xmm4, %xmm4
	cvtsi2ss	%esi, %xmm4
	divss	%xmm4, %xmm3
	xorps	%xmm4, %xmm4
	cvtsi2ss	%ecx, %xmm4
	mulss	%xmm2, %xmm4
	xorps	%xmm2, %xmm2
	cvtsi2ss	%edx, %xmm2
	addss	%xmm0, %xmm4
	mulss	%xmm3, %xmm2
	addss	%xmm1, %xmm2
	xorl	%eax, %eax
	movss	.LCPI1_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movaps	%xmm4, %xmm5
	movaps	%xmm2, %xmm1
	movaps	%xmm4, %xmm3
.LBB1_4:                                # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	mulss	%xmm3, %xmm3
	movaps	%xmm1, %xmm6
	mulss	%xmm1, %xmm6
	movaps	%xmm3, %xmm7
	addss	%xmm6, %xmm7
	ucomiss	%xmm0, %xmm7
	ja	.LBB1_2
# %bb.5:                                #   in Loop: Header=BB1_4 Depth=1
	subss	%xmm6, %xmm3
	addss	%xmm5, %xmm5
	mulss	%xmm5, %xmm1
	addss	%xmm4, %xmm3
	addss	%xmm2, %xmm1
	incl	%eax
	movaps	%xmm3, %xmm5
	cmpl	%eax, %r8d
	jne	.LBB1_4
# %bb.6:
	movl	%r8d, %eax
	retq
.LBB1_1:
	xorl	%eax, %eax
.LBB1_2:                                # %_Z11calc_mandelffi.exit
	retq
.Lfunc_end1:
	.size	_Z15mandelbrot_calcffffiiiii, .Lfunc_end1-_Z15mandelbrot_calcffffiiiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z32__device_stub__mandelbrot_kernelffffiiiPi # -- Begin function _Z32__device_stub__mandelbrot_kernelffffiiiPi
	.type	_Z32__device_stub__mandelbrot_kernelffffiiiPi,@function
_Z32__device_stub__mandelbrot_kernelffffiiiPi: # @_Z32__device_stub__mandelbrot_kernelffffiiiPi
	.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	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	36(%rsp), %rax
	movss	%xmm0, (%rax)
	leaq	32(%rsp), %r8
	movss	%xmm1, (%r8)
	leaq	28(%rsp), %r9
	movss	%xmm2, (%r9)
	leaq	24(%rsp), %r10
	movss	%xmm3, (%r10)
	leaq	20(%rsp), %r11
	movl	%edi, (%r11)
	leaq	16(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	56(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%r8, 8(%rbx)
	movq	%r9, 16(%rbx)
	movq	%r10, 24(%rbx)
	movq	%r11, 32(%rbx)
	movq	%rdi, 40(%rbx)
	movq	%rsi, 48(%rbx)
	movq	%rdx, 56(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	48(%rsp), %r12
	leaq	40(%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	$_Z17mandelbrot_kernelffffiiiPi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	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_end2:
	.size	_Z32__device_stub__mandelbrot_kernelffffiiiPi, .Lfunc_end2-_Z32__device_stub__mandelbrot_kernelffffiiiPi
	.cfi_endproc
                                        # -- End function
	.globl	_Z13mandelbrotGpuffffiiiPi      # -- Begin function _Z13mandelbrotGpuffffiiiPi
	.type	_Z13mandelbrotGpuffffiiiPi,@function
_Z13mandelbrotGpuffffiiiPi:             # @_Z13mandelbrotGpuffffiiiPi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rcx, %rbx
	movl	%edx, 40(%rsp)                  # 4-byte Spill
	movl	%esi, %r14d
	movl	%edi, %r15d
	movss	%xmm3, 36(%rsp)                 # 4-byte Spill
	movss	%xmm2, 32(%rsp)                 # 4-byte Spill
	movss	%xmm1, 28(%rsp)                 # 4-byte Spill
	movss	%xmm0, 24(%rsp)                 # 4-byte Spill
	movl	$0, 44(%rsp)
	leaq	48(%rsp), %r12
	movq	%r12, %rdi
	callq	hipEventCreate
	leaq	8(%rsp), %rdi
	callq	hipEventCreate
	movq	(%r12), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movslq	%r15d, %rax
	imulq	$1717986919, %rax, %rbp         # imm = 0x66666667
	movq	%rbp, %rcx
	shrq	$63, %rcx
	sarq	$34, %rbp
	addl	%ecx, %ebp
	imull	$-858993459, %eax, %eax         # imm = 0xCCCCCCCD
	movl	$429496728, %ecx                # imm = 0x19999998
	addl	%ecx, %eax
	rorl	%eax
	movl	$429496729, %edx                # imm = 0x19999999
	cmpl	%edx, %eax
	sbbl	$-1, %ebp
	movslq	%r14d, %rax
	imulq	$1717986919, %rax, %r13         # imm = 0x66666667
	movq	%r13, %rsi
	shrq	$63, %rsi
	sarq	$34, %r13
	imull	$-858993459, %eax, %eax         # imm = 0xCCCCCCCD
	addl	%ecx, %eax
	rorl	%eax
	addl	%esi, %r13d
	cmpl	%edx, %eax
	sbbl	$-1, %r13d
	movl	%r14d, %eax
	imull	%r15d, %eax
	movslq	%eax, %r12
	shlq	$2, %r12
	leaq	16(%rsp), %rdi
	movq	%r12, %rsi
	callq	hipMalloc
	shlq	$32, %r13
	orq	%rbp, %r13
	movabsq	$42949672970, %rdx              # imm = 0xA0000000A
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_2
# %bb.1:
	movq	16(%rsp), %rcx
	movss	24(%rsp), %xmm0                 # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	movss	28(%rsp), %xmm1                 # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	movss	32(%rsp), %xmm2                 # 4-byte Reload
                                        # xmm2 = mem[0],zero,zero,zero
	movss	36(%rsp), %xmm3                 # 4-byte Reload
                                        # xmm3 = mem[0],zero,zero,zero
	movl	%r15d, %edi
	movl	%r14d, %esi
	movl	40(%rsp), %edx                  # 4-byte Reload
	callq	_Z32__device_stub__mandelbrot_kernelffffiiiPi
.LBB3_2:
	movq	16(%rsp), %rsi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	8(%rsp), %rdi
	callq	hipEventSynchronize
	movq	48(%rsp), %rsi
	movq	8(%rsp), %rdx
	leaq	44(%rsp), %rdi
	callq	hipEventElapsedTime
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z13mandelbrotGpuffffiiiPi, .Lfunc_end3-_Z13mandelbrotGpuffffiiiPi
	.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	.LBB4_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB4_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z17mandelbrot_kernelffffiiiPi, %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_end4:
	.size	__hip_module_ctor, .Lfunc_end4-__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	.LBB5_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
.LBB5_2:
	retq
.Lfunc_end5:
	.size	__hip_module_dtor, .Lfunc_end5-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z17mandelbrot_kernelffffiiiPi,@object # @_Z17mandelbrot_kernelffffiiiPi
	.section	.rodata,"a",@progbits
	.globl	_Z17mandelbrot_kernelffffiiiPi
	.p2align	3, 0x0
_Z17mandelbrot_kernelffffiiiPi:
	.quad	_Z32__device_stub__mandelbrot_kernelffffiiiPi
	.size	_Z17mandelbrot_kernelffffiiiPi, 8

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

	.type	__hip_fatbin_wrapper,@object    # @__hip_fatbin_wrapper
	.section	.hipFatBinSegment,"a",@progbits
	.p2align	3, 0x0
__hip_fatbin_wrapper:
	.long	1212764230                      # 0x48495046
	.long	1                               # 0x1
	.quad	__hip_fatbin
	.quad	0
	.size	__hip_fatbin_wrapper, 24

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z32__device_stub__mandelbrot_kernelffffiiiPi
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z17mandelbrot_kernelffffiiiPi
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z17mandelbrot_kernelffffiiiPi ; -- Begin function _Z17mandelbrot_kernelffffiiiPi
	.globl	_Z17mandelbrot_kernelffffiiiPi
	.p2align	8
	.type	_Z17mandelbrot_kernelffffiiiPi,@function
_Z17mandelbrot_kernelffffiiiPi:         ; @_Z17mandelbrot_kernelffffiiiPi
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b128 s[4:7], s[0:1], 0x10
	v_bfe_u32 v2, v0, 10, 10
	v_and_b32_e32 v3, 0x3ff, v0
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[0:1], null, s15, s3, v[2:3]
	v_mad_u64_u32 v[1:2], null, s14, s2, v[3:4]
	v_cmp_gt_i32_e32 vcc_lo, s5, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_gt_i32_e64 s2, s4, v1
	s_and_b32 s2, s2, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_9
; %bb.1:
	s_load_b128 s[8:11], s[0:1], 0x0
	s_cmp_lt_i32 s6, 1
	s_cbranch_scc1 .LBB0_7
; %bb.2:                                ; %.lr.ph.i.i.preheader
	s_waitcnt lgkmcnt(0)
	v_sub_f32_e64 v2, s10, s8
	v_cvt_f32_i32_e32 v3, s4
	v_sub_f32_e64 v4, s11, s9
	v_cvt_f32_i32_e32 v5, s5
	s_mov_b32 s3, 0
                                        ; implicit-def: $sgpr5
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_div_scale_f32 v6, null, v3, v3, v2
	v_div_scale_f32 v7, null, v5, v5, v4
	v_div_scale_f32 v12, vcc_lo, v2, v3, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_rcp_f32_e32 v8, v6
	v_rcp_f32_e32 v9, v7
	s_waitcnt_depctr 0xfff
	v_fma_f32 v10, -v6, v8, 1.0
	v_fma_f32 v11, -v7, v9, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_dual_fmac_f32 v8, v10, v8 :: v_dual_fmac_f32 v9, v11, v9
	v_div_scale_f32 v10, s2, v4, v5, v4
	v_mul_f32_e32 v11, v12, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v13, v10, v9
	v_fma_f32 v14, -v6, v11, v12
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v15, -v7, v13, v10
	v_fmac_f32_e32 v11, v14, v8
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fmac_f32_e32 v13, v15, v9
	v_fma_f32 v6, -v6, v11, v12
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v7, -v7, v13, v10
	v_div_fmas_f32 v6, v6, v8, v11
	s_mov_b32 vcc_lo, s2
	v_cvt_f32_i32_e32 v8, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_div_fmas_f32 v7, v7, v9, v13
	s_mov_b32 s2, 0
	v_div_fixup_f32 v2, v6, v3, v2
	v_div_fixup_f32 v3, v7, v5, v4
	v_cvt_f32_i32_e32 v4, v0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_fma_f32 v2, v2, v8, s8
	v_fma_f32 v3, v3, v4, s9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mov_b32_e32 v6, v2
	v_mov_b32_e32 v4, v3
.LBB0_3:                                ; %.lr.ph.i.i
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v7, v4, v4
	s_or_b32 s5, s5, exec_lo
	v_fma_f32 v5, v6, v6, v7
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_nlt_f32_e32 vcc_lo, 4.0, v5
	v_mov_b32_e32 v5, s3
	s_and_saveexec_b32 s7, vcc_lo
	s_cbranch_execz .LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	v_mul_f32_e32 v5, v6, v6
	v_add_f32_e32 v6, v6, v6
	s_add_i32 s3, s3, 1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	s_cmp_eq_u32 s6, s3
	v_sub_f32_e32 v7, v5, v7
	s_cselect_b32 s8, -1, 0
	v_mov_b32_e32 v5, s6
	v_fma_f32 v4, v4, v6, v3
	s_and_not1_b32 s5, s5, exec_lo
	v_add_f32_e32 v6, v2, v7
	s_and_b32 s8, s8, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s5, s5, s8
.LBB0_5:                                ; %Flow
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_or_b32 exec_lo, exec_lo, s7
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s7, exec_lo, s5
	s_or_b32 s2, s7, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s2
	s_cbranch_execnz .LBB0_3
; %bb.6:                                ; %Flow46
	s_or_b32 exec_lo, exec_lo, s2
	s_branch .LBB0_8
.LBB0_7:
	v_mov_b32_e32 v5, 0
.LBB0_8:                                ; %_Z15mandelbrot_calcffffiiiii.exit
	s_load_b64 s[0:1], s[0:1], 0x20
	v_mad_u64_u32 v[2:3], null, v0, s4, v[1:2]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[0:1], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[0:1], v5, off
.LBB0_9:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17mandelbrot_kernelffffiiiPi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 14
		.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 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.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	_Z17mandelbrot_kernelffffiiiPi, .Lfunc_end0-_Z17mandelbrot_kernelffffiiiPi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 592
; 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: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.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:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .offset:         4
        .size:           4
        .value_kind:     by_value
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         44
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         52
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         54
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         56
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         58
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         60
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         62
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         104
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 296
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z17mandelbrot_kernelffffiiiPi
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z17mandelbrot_kernelffffiiiPi.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
