#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>

#define HEIGHT 256
#define WIDTH 256
#define IMAGE_SIZE 256*256
#define THREAD_SIZE 64
#define BLOCK_SIZE IMAGE_SIZE/THREAD_SIZE



__device__ int iterate_pixel(float x, float y, float c_re, float c_im)
{
	int c=0;
	float z_re=x;
	float z_im=y;
	while (c < 255) {
		float re2 = z_re*z_re;
		float im2 = z_im*z_im;
		if ((re2+im2) > 4) 
			break; 
		z_im=2*z_re*z_im + c_im;
		z_re=re2-im2 + c_re;
		c++;
	}
	return c;
}

//calc_fractal<<< N, N >>>( 28, 0.008, fractal);
__global__ void calc_fractal(float c_re, float c_im, unsigned char *fractal)
{
	
	int width = 256, height = 256;
	int x = (blockIdx.x * blockDim.x + threadIdx.x)%HEIGHT;   		  
	int y = (blockIdx.x * blockDim.x + threadIdx.x)/WIDTH;		  
	float f_x = (float)(x*0.8)/(float)(width)-0.8;
	float f_y = (float)(y*0.8)/(float)(height)-0.8;
	fractal[threadIdx.x+blockIdx.x*blockDim.x] = iterate_pixel(f_x,f_y,c_re,c_im);

}

// Write a width by height 8-bit color image into File "filename"
void write_ppm(unsigned char* data,unsigned int width,unsigned int height,char* filename)
{
	if (data == NULL) {
		printf("Provide a valid data pointer!\n");
		return;
	}
	if (filename == NULL) {
		printf("Provide a valid filename!\n");
		return;
	}
	if ( (width>4096) || (height>4096)) {
		printf("Only pictures upto 4096x4096 are supported!\n");
		return;
	}
	FILE *f=fopen(filename,"wb");
	if (f == NULL) 
	{
		printf("Opening File %s failed!\n",filename);
		return;
	}
	if (fprintf(f,"P6 %i %i 255\n",width,height) <= 0) {
		printf("Writing to file failed!\n");
		return;
	};
	int i;
	for (i=0;i<height;i++) {
		unsigned char buffer[4096*3];
		int j;
		for (j=0;j<width;j++) {
			int v=data[i*width+j];
			int s;
			s= v << 0;
			s=s > 255? 255 : s;
			buffer[j*3+0]=s;
			s= v << 1;
			s=s > 255? 255 : s;
			buffer[j*3+1]=s;
			s= v << 2;
			s=s > 255? 255 : s;
			buffer[j*3+2]=s;
		}
		if (fwrite(buffer,width*3,1,f) != 1) {
			printf("Writing of line %i to file failed!\n",i);
			return;
		}
	}
	fclose(f);
}

int main(int argc, char** args)
{
	int N = 256*256;
	unsigned char julia[N];
	unsigned char* fractal;


	for(int i = 0; i < N; i++)
	{

		julia[i] = i;
	}
	
	// memory allocation
	cudaMalloc ( (void**)&fractal, (N)*sizeof(char) );

	//copying from host to Device
	cudaMemcpy(fractal, &julia, (N)*sizeof(char), cudaMemcpyHostToDevice);
	

	//Kernel invocation
	calc_fractal<<< BLOCK_SIZE, THREAD_SIZE>>>( 0.28, 0.008, fractal);
	

	//copying from Device to Host
	cudaMemcpy(&julia, fractal, (N)*sizeof(char), cudaMemcpyDeviceToHost) ;

	write_ppm(julia, 256, 256, "julia.ppm");	
	
	cudaFree(&fractal);

	
	return 0;
}

	.file	"tmpxft_001fd5ff_00000000-6_julia_cuda_1D.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3771:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3771:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"wb"
.LC1:
	.string	"Opening File %s failed!\n"
.LC2:
	.string	"P6 %i %i 255\n"
.LC3:
	.string	"Writing to file failed!\n"
.LC4:
	.string	"Writing of line %i to file failed!\n"
	.text
	.type	_Z9write_ppmPhjjPc.part.0, @function
_Z9write_ppmPhjjPc.part.0:
.LFB4433:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 12344
	orq	$0, (%rsp)
	subq	$40, %rsp
	.cfi_def_cfa_offset 12384
	movq	%rdi, %r12
	movl	%esi, %ebp
	movq	%rcx, %rdi
	movl	%edx, %r15d
	movq	%fs:40, %rax
	movq	%rax, 12312(%rsp)
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	movq	%rcx, %r13
	call	fopen@PLT
	testq	%rax, %rax
	jne	.L3
	movq	12312(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$12328, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r13, %rdx
	movl	$2, %edi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	leaq	.LC1(%rip), %rsi
	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
	jmp	__printf_chk@PLT
.L3:
	.cfi_restore_state
	movq	%rax, %rbx
	movq	%rax, %rdi
	movl	%r15d, %r8d
	xorl	%eax, %eax
	movl	%ebp, %ecx
	leaq	.LC2(%rip), %rdx
	movl	$2, %esi
	call	__fprintf_chk@PLT
	testl	%eax, %eax
	jle	.L5
	imull	$3, %ebp, %eax
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	movq	%rax, 8(%rsp)
	jmp	.L6
.L5:
	movq	12312(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$12328, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %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
	jmp	__printf_chk@PLT
.L20:
	.cfi_restore_state
	movq	8(%rsp), %rsi
	movl	$1, %edx
	movq	%rbx, %rcx
	addl	%ebp, %r13d
	call	fwrite@PLT
	movq	%rax, %rdx
	leaq	1(%r14), %rax
	decq	%rdx
	jne	.L19
	movq	%rax, %r14
.L6:
	cmpq	%r15, %r14
	je	.L11
	leaq	24(%rsp), %rdx
	movl	%r13d, %r9d
	xorl	%ecx, %ecx
	movq	%rdx, %rdi
	addq	%r12, %r9
.L12:
	cmpl	%ebp, %ecx
	jnb	.L20
	movzbl	(%r9,%rcx), %eax
	movl	$255, %r10d
	leal	(%rax,%rax), %esi
	movb	%al, (%rdx)
	cmpl	%r10d, %esi
	cmovg	%r10d, %esi
	sall	$2, %eax
	movb	%sil, 1(%rdx)
	movl	$255, %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	incq	%rcx
	addq	$3, %rdx
	movb	%al, -1(%rdx)
	jmp	.L12
.L19:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movl	$2, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	12312(%rsp), %rax
	subq	%fs:40, %rax
	je	.L14
	jmp	.L15
.L11:
	movq	12312(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$12328, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%rbx, %rdi
	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
	jmp	fclose@PLT
.L15:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
.L14:
	addq	$12328, %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
.LFE4433:
	.size	_Z9write_ppmPhjjPc.part.0, .-_Z9write_ppmPhjjPc.part.0
	.globl	_Z13iterate_pixelffff
	.type	_Z13iterate_pixelffff, @function
_Z13iterate_pixelffff:
.LFB3766:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE3766:
	.size	_Z13iterate_pixelffff, .-_Z13iterate_pixelffff
	.section	.rodata.str1.1
.LC5:
	.string	"Provide a valid data pointer!\n"
.LC6:
	.string	"Provide a valid filename!\n"
.LC7:
	.string	"Only pictures upto 4096x4096 are supported!\n"
	.text
	.globl	_Z9write_ppmPhjjPc
	.type	_Z9write_ppmPhjjPc, @function
_Z9write_ppmPhjjPc:
.LFB3767:
	.cfi_startproc
	endbr64
	testq	%rdi, %rdi
	jne	.L24
	leaq	.LC5(%rip), %rsi
	jmp	.L29
.L24:
	testq	%rcx, %rcx
	jne	.L25
	leaq	.LC6(%rip), %rsi
.L29:
	movl	$2, %edi
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
.L25:
	cmpl	$4096, %esi
	ja	.L28
	cmpl	$4096, %edx
	jbe	.L26
.L28:
	leaq	.LC7(%rip), %rsi
	jmp	.L29
.L26:
	jmp	_Z9write_ppmPhjjPc.part.0
	.cfi_endproc
.LFE3767:
	.size	_Z9write_ppmPhjjPc, .-_Z9write_ppmPhjjPc
	.globl	_Z34__device_stub__Z12calc_fractalffPhffPh
	.type	_Z34__device_stub__Z12calc_fractalffPhffPh, @function
_Z34__device_stub__Z12calc_fractalffPhffPh:
.LFB3793:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, (%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	movss	%xmm0, 12(%rsp)
	leaq	44(%rsp), %rsi
	leaq	32(%rsp), %rdi
	movss	%xmm1, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 88(%rsp)
	movq	%rsp, %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L30
	pushq	24(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z12calc_fractalffPh(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 144
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L30:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3793:
	.size	_Z34__device_stub__Z12calc_fractalffPhffPh, .-_Z34__device_stub__Z12calc_fractalffPhffPh
	.globl	_Z12calc_fractalffPh
	.type	_Z12calc_fractalffPh, @function
_Z12calc_fractalffPh:
.LFB3794:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z12calc_fractalffPhffPh
	.cfi_endproc
.LFE3794:
	.size	_Z12calc_fractalffPh, .-_Z12calc_fractalffPh
	.section	.rodata.str1.1
.LC10:
	.string	"julia.ppm"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3768:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-65536(%rsp), %rax
.L36:
	cmpq	%rax, %rsp
	je	.L37
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L36
.L37:
	xorl	%eax, %eax
	movq	%rsp, %rbx
.L39:
	movb	%al, (%rbx,%rax)
	incq	%rax
	cmpq	$65536, %rax
	jne	.L39
	leaq	-56(%rbp), %r12
	movl	$65536, %esi
	movq	%r12, %rdi
	call	cudaMalloc@PLT
	movq	-56(%rbp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rsi
	movl	$65536, %edx
	call	cudaMemcpy@PLT
	movl	$67108865, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$4194305, %edi
	salq	$6, %rdx
	movl	$1, %ecx
	movl	$1, %esi
	salq	$10, %rdi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L40
	movq	-56(%rbp), %rdi
	movss	.LC8(%rip), %xmm1
	movss	.LC9(%rip), %xmm0
	call	_Z34__device_stub__Z12calc_fractalffPhffPh
.L40:
	movq	-56(%rbp), %rsi
	movl	$2, %ecx
	movl	$65536, %edx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	movq	%rbx, %rdi
	movl	$256, %edx
	leaq	.LC10(%rip), %rcx
	movl	$256, %esi
	call	_Z9write_ppmPhjjPc
	movq	%r12, %rdi
	call	cudaFree@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	leaq	-16(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3768:
	.size	main, .-main
	.section	.rodata.str1.1
.LC11:
	.string	"_Z12calc_fractalffPh"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3796:
	.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	.LC11(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z12calc_fractalffPh(%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
.LFE3796:
	.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	1006834287
	.align 4
.LC9:
	.long	1049582633
	.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 <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>

#define HEIGHT 256
#define WIDTH 256
#define IMAGE_SIZE 256*256
#define THREAD_SIZE 64
#define BLOCK_SIZE IMAGE_SIZE/THREAD_SIZE



__device__ int iterate_pixel(float x, float y, float c_re, float c_im)
{
	int c=0;
	float z_re=x;
	float z_im=y;
	while (c < 255) {
		float re2 = z_re*z_re;
		float im2 = z_im*z_im;
		if ((re2+im2) > 4) 
			break; 
		z_im=2*z_re*z_im + c_im;
		z_re=re2-im2 + c_re;
		c++;
	}
	return c;
}

//calc_fractal<<< N, N >>>( 28, 0.008, fractal);
__global__ void calc_fractal(float c_re, float c_im, unsigned char *fractal)
{
	
	int width = 256, height = 256;
	int x = (blockIdx.x * blockDim.x + threadIdx.x)%HEIGHT;   		  
	int y = (blockIdx.x * blockDim.x + threadIdx.x)/WIDTH;		  
	float f_x = (float)(x*0.8)/(float)(width)-0.8;
	float f_y = (float)(y*0.8)/(float)(height)-0.8;
	fractal[threadIdx.x+blockIdx.x*blockDim.x] = iterate_pixel(f_x,f_y,c_re,c_im);

}

// Write a width by height 8-bit color image into File "filename"
void write_ppm(unsigned char* data,unsigned int width,unsigned int height,char* filename)
{
	if (data == NULL) {
		printf("Provide a valid data pointer!\n");
		return;
	}
	if (filename == NULL) {
		printf("Provide a valid filename!\n");
		return;
	}
	if ( (width>4096) || (height>4096)) {
		printf("Only pictures upto 4096x4096 are supported!\n");
		return;
	}
	FILE *f=fopen(filename,"wb");
	if (f == NULL) 
	{
		printf("Opening File %s failed!\n",filename);
		return;
	}
	if (fprintf(f,"P6 %i %i 255\n",width,height) <= 0) {
		printf("Writing to file failed!\n");
		return;
	};
	int i;
	for (i=0;i<height;i++) {
		unsigned char buffer[4096*3];
		int j;
		for (j=0;j<width;j++) {
			int v=data[i*width+j];
			int s;
			s= v << 0;
			s=s > 255? 255 : s;
			buffer[j*3+0]=s;
			s= v << 1;
			s=s > 255? 255 : s;
			buffer[j*3+1]=s;
			s= v << 2;
			s=s > 255? 255 : s;
			buffer[j*3+2]=s;
		}
		if (fwrite(buffer,width*3,1,f) != 1) {
			printf("Writing of line %i to file failed!\n",i);
			return;
		}
	}
	fclose(f);
}

int main(int argc, char** args)
{
	int N = 256*256;
	unsigned char julia[N];
	unsigned char* fractal;


	for(int i = 0; i < N; i++)
	{

		julia[i] = i;
	}
	
	// memory allocation
	hipMalloc ( (void**)&fractal, (N)*sizeof(char) );

	//copying from host to Device
	hipMemcpy(fractal, &julia, (N)*sizeof(char), hipMemcpyHostToDevice);
	

	//Kernel invocation
	calc_fractal<<< BLOCK_SIZE, THREAD_SIZE>>>( 0.28, 0.008, fractal);
	

	//copying from Device to Host
	hipMemcpy(&julia, fractal, (N)*sizeof(char), hipMemcpyDeviceToHost) ;

	write_ppm(julia, 256, 256, "julia.ppm");	
	
	hipFree(&fractal);

	
	return 0;
}

	.text
	.file	"julia_cuda_1D.hip"
	.globl	_Z27__device_stub__calc_fractalffPh # -- Begin function _Z27__device_stub__calc_fractalffPh
	.type	_Z27__device_stub__calc_fractalffPh,@function
_Z27__device_stub__calc_fractalffPh:    # @_Z27__device_stub__calc_fractalffPh
	.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	$96, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	4(%rsp), %rax
	movss	%xmm0, (%rax)
	movq	%rsp, %rcx
	movss	%xmm1, (%rcx)
	leaq	24(%rsp), %rdx
	movq	%rdi, (%rdx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rdx, 16(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%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	$_Z12calc_fractalffPh, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$112, %rsp
	.cfi_adjust_cfa_offset -112
	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	_Z27__device_stub__calc_fractalffPh, .Lfunc_end0-_Z27__device_stub__calc_fractalffPh
	.cfi_endproc
                                        # -- End function
	.globl	_Z9write_ppmPhjjPc              # -- Begin function _Z9write_ppmPhjjPc
	.type	_Z9write_ppmPhjjPc,@function
_Z9write_ppmPhjjPc:                     # @_Z9write_ppmPhjjPc
	.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	$12312, %rsp                    # imm = 0x3018
	.cfi_def_cfa_offset 12368
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	testq	%rdi, %rdi
	je	.LBB1_1
# %bb.3:
	movq	%rcx, %r12
	testq	%rcx, %rcx
	je	.LBB1_4
# %bb.5:
	movl	%esi, %ebx
	cmpl	$4096, %esi                     # imm = 0x1000
	ja	.LBB1_7
# %bb.6:
	movl	%edx, %ebp
	cmpl	$4097, %edx                     # imm = 0x1001
	jae	.LBB1_7
# %bb.8:
	movq	%rdi, %r14
	movl	$.L.str.3, %esi
	movq	%r12, %rdi
	callq	fopen
	testq	%rax, %rax
	je	.LBB1_18
# %bb.9:
	movq	%rax, %r15
	movl	$.L.str.5, %esi
	movq	%rax, %rdi
	movl	%ebx, %edx
	movl	%ebp, %ecx
	xorl	%eax, %eax
	callq	fprintf
	testl	%eax, %eax
	jle	.LBB1_19
# %bb.10:                               # %.preheader
	testl	%ebp, %ebp
	je	.LBB1_17
# %bb.11:                               # %.lr.ph53
	leal	(%rbx,%rbx,2), %eax
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movl	%ebx, %r12d
	movl	%ebp, %eax
	movq	%rax, (%rsp)                    # 8-byte Spill
	xorl	%r13d, %r13d
	movl	$255, %ebp
.LBB1_12:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_14 Depth 2
	testl	%ebx, %ebx
	je	.LBB1_15
# %bb.13:                               # %.lr.ph
                                        #   in Loop: Header=BB1_12 Depth=1
	leaq	18(%rsp), %rax
	xorl	%ecx, %ecx
.LBB1_14:                               #   Parent Loop BB1_12 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movzbl	(%r14,%rcx), %edx
	movb	%dl, -2(%rax)
	leal	(%rdx,%rdx), %esi
	cmpl	%ebp, %esi
	cmovael	%ebp, %esi
	movb	%sil, -1(%rax)
	shll	$2, %edx
	cmpl	%ebp, %edx
	cmovael	%ebp, %edx
	movb	%dl, (%rax)
	incq	%rcx
	addq	$3, %rax
	cmpq	%rcx, %r12
	jne	.LBB1_14
.LBB1_15:                               # %._crit_edge
                                        #   in Loop: Header=BB1_12 Depth=1
	movl	$1, %edx
	leaq	16(%rsp), %rdi
	movq	8(%rsp), %rsi                   # 8-byte Reload
	movq	%r15, %rcx
	callq	fwrite
	cmpq	$1, %rax
	jne	.LBB1_20
# %bb.16:                               # %.critedge
                                        #   in Loop: Header=BB1_12 Depth=1
	incq	%r13
	addq	%r12, %r14
	cmpq	(%rsp), %r13                    # 8-byte Folded Reload
	jne	.LBB1_12
.LBB1_17:                               # %._crit_edge54
	movq	%r15, %rdi
	addq	$12312, %rsp                    # imm = 0x3018
	.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
	jmp	fclose                          # TAILCALL
.LBB1_1:
	.cfi_def_cfa_offset 12368
	movl	$.Lstr.3, %edi
	jmp	.LBB1_2
.LBB1_4:
	movl	$.Lstr.2, %edi
	jmp	.LBB1_2
.LBB1_7:
	movl	$.Lstr.1, %edi
.LBB1_2:
	addq	$12312, %rsp                    # imm = 0x3018
	.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
	jmp	puts@PLT                        # TAILCALL
.LBB1_18:
	.cfi_def_cfa_offset 12368
	movl	$.L.str.4, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	addq	$12312, %rsp                    # imm = 0x3018
	.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
	jmp	printf                          # TAILCALL
.LBB1_19:
	.cfi_def_cfa_offset 12368
	movl	$.Lstr, %edi
	jmp	.LBB1_2
.LBB1_20:
	movl	$.L.str.7, %edi
	movl	%r13d, %esi
	xorl	%eax, %eax
	addq	$12312, %rsp                    # imm = 0x3018
	.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
	jmp	printf                          # TAILCALL
.Lfunc_end1:
	.size	_Z9write_ppmPhjjPc, .Lfunc_end1-_Z9write_ppmPhjjPc
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI2_0:
	.long	0x3e8f5c29                      # float 0.280000001
.LCPI2_1:
	.long	0x3c03126f                      # float 0.00800000038
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	subq	$65560, %rsp                    # imm = 0x10018
	.cfi_def_cfa_offset 65584
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	xorl	%eax, %eax
.LBB2_1:                                # =>This Inner Loop Header: Depth=1
	movb	%al, 16(%rsp,%rax)
	incq	%rax
	cmpq	$65536, %rax                    # imm = 0x10000
	jne	.LBB2_1
# %bb.2:
	leaq	8(%rsp), %rbx
	movl	$65536, %esi                    # imm = 0x10000
	movq	%rbx, %rdi
	callq	hipMalloc
	movq	(%rbx), %rdi
	leaq	16(%rsp), %rsi
	movl	$65536, %edx                    # imm = 0x10000
	movl	$1, %ecx
	callq	hipMemcpy
	movabsq	$4294967360, %rdx               # imm = 0x100000040
	leaq	960(%rdx), %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_4
# %bb.3:
	movq	8(%rsp), %rdi
	movss	.LCPI2_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	.LCPI2_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	callq	_Z27__device_stub__calc_fractalffPh
.LBB2_4:
	leaq	8(%rsp), %rbx
	movq	(%rbx), %rsi
	leaq	16(%rsp), %r14
	movl	$65536, %edx                    # imm = 0x10000
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$.L.str.8, %ecx
	movq	%r14, %rdi
	movl	$256, %esi                      # imm = 0x100
	movl	$256, %edx                      # imm = 0x100
	callq	_Z9write_ppmPhjjPc
	movq	%rbx, %rdi
	callq	hipFree
	xorl	%eax, %eax
	addq	$65560, %rsp                    # imm = 0x10018
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	main, .Lfunc_end2-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	.LBB3_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB3_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z12calc_fractalffPh, %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_end3:
	.size	__hip_module_ctor, .Lfunc_end3-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB4_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB4_2:
	retq
.Lfunc_end4:
	.size	__hip_module_dtor, .Lfunc_end4-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z12calc_fractalffPh,@object    # @_Z12calc_fractalffPh
	.section	.rodata,"a",@progbits
	.globl	_Z12calc_fractalffPh
	.p2align	3, 0x0
_Z12calc_fractalffPh:
	.quad	_Z27__device_stub__calc_fractalffPh
	.size	_Z12calc_fractalffPh, 8

	.type	.L.str.3,@object                # @.str.3
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.3:
	.asciz	"wb"
	.size	.L.str.3, 3

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Opening File %s failed!\n"
	.size	.L.str.4, 25

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"P6 %i %i 255\n"
	.size	.L.str.5, 14

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Writing of line %i to file failed!\n"
	.size	.L.str.7, 36

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"julia.ppm"
	.size	.L.str.8, 10

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z12calc_fractalffPh"
	.size	.L__unnamed_1, 21

	.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	"Writing to file failed!"
	.size	.Lstr, 24

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"Only pictures upto 4096x4096 are supported!"
	.size	.Lstr.1, 44

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"Provide a valid filename!"
	.size	.Lstr.2, 26

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"Provide a valid data pointer!"
	.size	.Lstr.3, 30

	.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 _Z27__device_stub__calc_fractalffPh
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z12calc_fractalffPh
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z12calc_fractalffPh    ; -- Begin function _Z12calc_fractalffPh
	.globl	_Z12calc_fractalffPh
	.p2align	8
	.type	_Z12calc_fractalffPh,@function
_Z12calc_fractalffPh:                   ; @_Z12calc_fractalffPh
; %bb.0:
	s_load_b32 s2, s[0:1], 0x1c
	s_mov_b32 s4, 0
	s_mov_b32 s6, 0
                                        ; implicit-def: $sgpr5
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, 0x9999999a
	s_mov_b32 s3, 0x3fe99999
	v_and_b32_e32 v0, 0xff, v1
	v_lshrrev_b32_e32 v4, 8, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f64_i32_e32 v[2:3], v0
	v_cvt_f64_i32_e32 v[4:5], v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f64 v[2:3], v[2:3], s[2:3]
	v_mul_f64 v[4:5], v[4:5], s[2:3]
	s_mov_b32 s3, 0xbfe99999
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f32_f64_e32 v0, v[2:3]
	v_cvt_f32_f64_e32 v2, v[4:5]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_mul_f32_e32 v0, 0x3b800000, v0
	v_mul_f32_e32 v4, 0x3b800000, v2
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f64_f32_e32 v[2:3], v0
	v_cvt_f64_f32_e32 v[4:5], v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_f64 v[2:3], v[2:3], s[2:3]
	v_add_f64 v[4:5], v[4:5], s[2:3]
	s_load_b64 s[2:3], s[0:1], 0x0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cvt_f32_f64_e32 v2, v[2:3]
	v_cvt_f32_f64_e32 v0, v[4:5]
.LBB0_1:                                ; =>This Inner Loop Header: Depth=1
	s_or_b32 s5, s5, exec_lo
	s_cmpk_gt_u32 s6, 0xfe
	s_cbranch_scc1 .LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v3, v0, v0
	s_and_not1_b32 s5, s5, exec_lo
	s_add_i32 s7, s6, 1
	v_fma_f32 v4, v2, v2, -v3
	v_fma_f32 v3, v2, v2, v3
	v_add_f32_e32 v2, v2, v2
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_f32_e32 v4, s2, v4
	v_cmp_lt_f32_e32 vcc_lo, 4.0, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_fma_f32 v0, v0, v2, s3
	v_mov_b32_e32 v2, v4
	s_and_b32 s8, vcc_lo, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s5, s5, s8
	s_branch .LBB0_4
.LBB0_3:                                ;   in Loop: Header=BB0_1 Depth=1
	s_movk_i32 s6, 0xff
                                        ; implicit-def: $vgpr2
                                        ; implicit-def: $vgpr0
                                        ; implicit-def: $sgpr7
.LBB0_4:                                ; %Flow
                                        ;   in Loop: Header=BB0_1 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(SALU_CYCLE_1)
	v_mov_b32_e32 v3, s6
	s_and_b32 s8, exec_lo, s5
	s_mov_b32 s6, s7
	s_or_b32 s4, s8, s4
	s_and_not1_b32 exec_lo, exec_lo, s4
	s_cbranch_execnz .LBB0_1
; %bb.5:                                ; %_Z13iterate_pixelffff.exit
	s_or_b32 exec_lo, exec_lo, s4
	s_load_b64 s[0:1], s[0:1], 0x8
	s_waitcnt lgkmcnt(0)
	global_store_b8 v1, v3, s[0:1]
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z12calc_fractalffPh
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 272
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 6
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z12calc_fractalffPh, .Lfunc_end0-_Z12calc_fractalffPh
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 356
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .offset:         4
        .size:           4
        .value_kind:     by_value
      - .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:           _Z12calc_fractalffPh
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z12calc_fractalffPh.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
