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

#define x_max (1.25)
#define x_min (-2.25)
#define y_max (1.75)
#define y_min (-1.75)
#define count_max 400
#define n 64
#define task 32768

double my_timer()
{
struct timeval time;
double _ret_val_0;
gettimeofday(( & time), 0);
_ret_val_0=(time.tv_sec+(time.tv_usec/1000000.0));
return _ret_val_0;
}

void explode ( float x, float y, int *value){
  int k;
  float x1;
  float x2;
  float y1;
  float y2;
  //int value;
  *value = 0;

  x1 = x;
  y1 = y;

  for ( k = 1; k <= count_max; k++ )
  {
    x2 = x1 * x1 - y1 * y1 + x;
    y2 = 2.0 * x1 * y1 + y;

    if ( x2 < -2.0 || 2.0 < x2 || y2 < -2.0 || 2.0 < y2 )
    {
      *value = k;
      //if(k > 1000)
         //printf("k:%d\n", k);
      break;
    }
    x1 = x2;
    y1 = y2;
  }
}

 /*
  Carry out the iteration for each pixel, determining COUNT.
*/

void get_pixel(int *count, float index, int size){

  int i, j;
  float x, y;
  for ( i = 0; i < size; i++ )
  {
    for ( j = 0; j < size; j++ )
    {
      x = ( ( float ) (     j     ) * (x_max + index)
          + ( float ) ( size - j - 1 ) * (x_min + index) )
          / ( float ) ( size     - 1 );

      y = ( ( float ) (     i     ) * (y_max + index)
          + ( float ) ( size - i - 1 ) * (y_min + index) )
          / ( float ) ( size     - 1 );

      explode ( x, y, &count[i + j * size] );
    }
  }

}

/*
  Determine the coloring of each pixel.
*/

int det_pixel(int *c_max, int *count, int size){

  int i, j;

  *c_max = 0;
  for ( j = 0; j < size; j++ )
  {
    for ( i = 0; i < size; i++ )
    {
      if ( *c_max < count[i+j*size] )
      {
        *c_max = count[i+j*size];
      }
    }
  }
}

/*
  Set the image data.
*/

void set_img(int *r, int *g, int *b, int *count, int c_max, int size){
  int i, j;
  int c;

  for ( i = 0; i < size; i++ )
  {
    for ( j = 0; j < size; j++ )
    {
      if ( count[i+j*size] % 2 == 1 )
      {
        r[i+j*size] = 255;
        g[i+j*size] = 255;
        b[i+j*size] = 255;
      }
      else
      {
        c = ( int ) ( 255.0 * sqrt ( sqrt ( sqrt (
          ( ( double ) ( count[i+j*size] ) / ( double ) ( c_max ) ) ) ) ) );
        r[i+j*size] = 3 * c / 5;
        g[i+j*size] = 3 * c / 5;
        b[i+j*size] = c;
      }
    }
  }  
}

int main(){
  int i, j, k;
  int **r, **g, **b;
  int *c_max;
  int **count;

  int num_thread[task];
  int num_size[task];
  FILE *f;

  f = fopen("rand.txt", "r");
  for(i = 0; i < task; i++)
    fscanf(f, "%1d", &num_thread[i]);

  fclose(f);

  for(i = 0; i < task; i++)
    num_size[i] = num_thread[i]*32;


  double start_timer, end_timer;
  count =  (int**)malloc(task * sizeof(int *));
  r =  (int**)malloc(task * sizeof(int *));
  g =  (int** )malloc(task * sizeof(int *));
  b =  (int**)malloc(task * sizeof(int *));
  c_max = (int*)malloc(task * sizeof(int));

  for(i = 0; i < task; i++){
    count[i] = ( int * ) malloc ( num_size[i] * num_size[i] * sizeof ( int ) );
    r[i] = ( int * ) malloc ( num_size[i] * num_size[i] * sizeof ( int ) );
    g[i] = ( int * ) malloc ( num_size[i] * num_size[i] * sizeof ( int ) );
    b[i] = ( int * ) malloc ( num_size[i] * num_size[i] * sizeof ( int ) );
  }
  start_timer = my_timer(); 
  //Carry out the iteration for each pixel, determining COUNT.
  for(i = 0 ; i < task ; i++)
    get_pixel(count[i], (float)(i/(task/2.0)), num_size[i]);

  end_timer = my_timer();
  printf("Elapsed Time:%lf Sec.\n", end_timer - start_timer);

  //Determine the coloring of each pixel.
  for(i = 0; i < task; i++)
    det_pixel(&c_max[i], count[i], num_size[i]);

  //Set the image data.
  for(i = 0; i < task ; i++)
    set_img(r[i], g[i], b[i], count[i], c_max[i], num_size[i]);


#if 0
  // output results
  FILE *fp;
  fp = fopen("output1.txt", "w+");
  for(i = 0; i < task; i++)
    for(j = 0; j < n * n; j++)
        fprintf(fp, "%d, %d, %d\n", r[i][j], g[i][j], b[i][j]);
  fclose(fp);
#endif
  /*clean up*/
  for(i = 0; i < task; i++){
    free(count[i]);
    free(r[i]);
    free(g[i]);
    free(b[i]);
  }
  free(c_max);
  free(r);
  free(g);
  free(b);

  return 0;
}

	.file	"tmpxft_002871a3_00000000-6_mandelbrot.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2035:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2035:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z8my_timerv
	.type	_Z8my_timerv, @function
_Z8my_timerv:
.LFB2027:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdi
	call	gettimeofday@PLT
	cvtsi2sdq	8(%rsp), %xmm1
	cvtsi2sdq	16(%rsp), %xmm0
	divsd	.LC0(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z8my_timerv, .-_Z8my_timerv
	.globl	_Z7explodeffPi
	.type	_Z7explodeffPi, @function
_Z7explodeffPi:
.LFB2028:
	.cfi_startproc
	endbr64
	movss	.LC1(%rip), %xmm4
	movaps	%xmm0, %xmm3
	movl	$1, %eax
	cvtss2sd	%xmm1, %xmm5
.L8:
	movaps	%xmm1, %xmm6
	movaps	%xmm3, %xmm2
	mulss	%xmm1, %xmm6
	cvtss2sd	%xmm2, %xmm2
	addsd	%xmm2, %xmm2
	cvtss2sd	%xmm1, %xmm1
	mulss	%xmm3, %xmm3
	mulsd	%xmm1, %xmm2
	subss	%xmm6, %xmm3
	addsd	%xmm5, %xmm2
	addss	%xmm0, %xmm3
	cvtsd2ss	%xmm2, %xmm1
	comiss	%xmm3, %xmm4
	ja	.L7
	comiss	.LC2(%rip), %xmm3
	ja	.L7
	comiss	%xmm1, %xmm4
	ja	.L7
	comiss	.LC2(%rip), %xmm1
	ja	.L7
	incl	%eax
	cmpl	$401, %eax
	jne	.L8
	xorl	%eax, %eax
.L7:
	movl	%eax, (%rdi)
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z7explodeffPi, .-_Z7explodeffPi
	.globl	_Z9get_pixelPifi
	.type	_Z9get_pixelPifi, @function
_Z9get_pixelPifi:
.LFB2029:
	.cfi_startproc
	endbr64
	movslq	%esi, %r8
	xorl	%ecx, %ecx
	movaps	%xmm0, %xmm11
	movq	%rdi, %rsi
	movq	%r8, %rdx
	movsd	.LC3(%rip), %xmm7
	salq	$2, %r8
	cmpl	%edx, %ecx
	jl	.L17
	ret
.L17:
	pushq	%rax
	.cfi_def_cfa_offset 16
.L13:
	leal	-1(%rdx), %r9d
	cvtss2sd	%xmm11, %xmm8
	movaps	%xmm8, %xmm1
	movaps	%xmm8, %xmm2
	movl	%r9d, %eax
	subsd	%xmm7, %xmm1
	addsd	%xmm7, %xmm2
	movq	%rsi, %rdi
	subl	%ecx, %eax
	cvtsi2ssl	%r9d, %xmm10
	movl	%r9d, %r10d
	movsd	.LC4(%rip), %xmm9
	cvtsi2ssl	%eax, %xmm0
	addsd	%xmm8, %xmm9
	subsd	.LC5(%rip), %xmm8
	cvtss2sd	%xmm10, %xmm10
	cvtss2sd	%xmm0, %xmm0
	mulsd	%xmm1, %xmm0
	cvtsi2ssl	%ecx, %xmm1
	cvtss2sd	%xmm1, %xmm1
	mulsd	%xmm2, %xmm1
	addsd	%xmm1, %xmm0
	divsd	%xmm10, %xmm0
	cvtsd2ss	%xmm0, %xmm1
.L12:
	movl	%r9d, %eax
	cvtsi2ssl	%r10d, %xmm2
	movss	%xmm1, 4(%rsp)
	subl	%r10d, %eax
	decl	%r10d
	cvtsi2ssl	%eax, %xmm0
	cvtss2sd	%xmm2, %xmm2
	mulsd	%xmm8, %xmm2
	cvtss2sd	%xmm0, %xmm0
	mulsd	%xmm9, %xmm0
	addsd	%xmm2, %xmm0
	divsd	%xmm10, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	call	_Z7explodeffPi
	addq	%r8, %rdi
	cmpl	$-1, %r10d
	movss	4(%rsp), %xmm1
	jne	.L12
	incl	%ecx
	addq	$4, %rsi
	cmpl	%edx, %ecx
	jl	.L13
	popq	%rdx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z9get_pixelPifi, .-_Z9get_pixelPifi
	.globl	_Z9det_pixelPiS_i
	.type	_Z9det_pixelPiS_i, @function
_Z9det_pixelPiS_i:
.LFB2030:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	movslq	%edx, %rcx
	movl	%eax, (%rdi)
	salq	$2, %rcx
.L21:
	xorl	%eax, %eax
.L20:
	movl	(%rsi,%rax,4), %r8d
	cmpl	%r8d, (%rdi)
	jge	.L19
	movl	%r8d, (%rdi)
.L19:
	incq	%rax
	cmpl	%eax, %edx
	jg	.L20
	addq	%rcx, %rsi
	jmp	.L21
	.cfi_endproc
.LFE2030:
	.size	_Z9det_pixelPiS_i, .-_Z9det_pixelPiS_i
	.globl	_Z7set_imgPiS_S_S_ii
	.type	_Z7set_imgPiS_S_S_ii, @function
_Z7set_imgPiS_S_S_ii:
.LFB2031:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%r9d, %r9
	movq	%rdx, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	0(,%r9,4), %r10
	movq	%rsi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r9, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
.L24:
	cmpl	%ebp, %r12d
	jle	.L31
	leaq	0(,%rbp,4), %rbx
	xorl	%esi, %esi
.L26:
	movl	(%rcx,%rbx), %edi
	movl	$2, %r11d
	movl	%edi, %eax
	cltd
	idivl	%r11d
	decl	%edx
	je	.L28
	cvtsi2sdl	%edi, %xmm0
	movq	%rcx, 40(%rsp)
	cvtsi2sdl	%r8d, %xmm1
	movq	%r9, 32(%rsp)
	movq	%r10, 24(%rsp)
	movq	%rsi, 16(%rsp)
	movl	%r8d, 12(%rsp)
	divsd	%xmm1, %xmm0
	call	sqrt@PLT
	call	sqrt@PLT
	call	sqrt@PLT
	movl	$5, %r11d
	movl	12(%rsp), %r8d
	movq	16(%rsp), %rsi
	mulsd	.LC6(%rip), %xmm0
	movq	24(%rsp), %r10
	movq	32(%rsp), %r9
	movq	40(%rsp), %rcx
	cvttsd2sil	%xmm0, %edi
	leal	(%rdi,%rdi,2), %eax
	cltd
	idivl	%r11d
	jmp	.L25
.L28:
	movl	$255, %eax
	movl	$255, %edi
.L25:
	incq	%rsi
	movl	%eax, 0(%r13,%rbx)
	movl	%eax, (%r14,%rbx)
	movl	%edi, (%r15,%rbx)
	addq	%r10, %rbx
	cmpq	%r9, %rsi
	jne	.L26
	incq	%rbp
	jmp	.L24
.L31:
	addq	$56, %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
.LFE2031:
	.size	_Z7set_imgPiS_S_S_ii, .-_Z7set_imgPiS_S_S_ii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC7:
	.string	"r"
.LC8:
	.string	"rand.txt"
.LC9:
	.string	"%1d"
.LC11:
	.string	"Elapsed Time:%lf Sec.\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2032:
	.cfi_startproc
	endbr64
	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
	leaq	-262144(%rsp), %r11
	.cfi_def_cfa 11, 262200
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$40, %rsp
	.cfi_def_cfa_offset 262240
	leaq	.LC7(%rip), %rsi
	leaq	.LC8(%rip), %rdi
	leaq	.LC9(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 262168(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rbx
	leaq	131096(%rsp), %r13
	call	fopen@PLT
	movq	%rbx, %r12
	movq	%rax, %rbp
.L33:
	movq	%rbx, %rdx
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc23_fscanf@PLT
	addq	$4, %rbx
	cmpq	%r13, %rbx
	jne	.L33
	movq	%rbp, %rdi
	call	fclose@PLT
	xorl	%eax, %eax
.L34:
	movl	(%r12,%rax), %edx
	sall	$5, %edx
	movl	%edx, 0(%r13,%rax)
	addq	$4, %rax
	cmpq	$131072, %rax
	jne	.L34
	movl	$262144, %edi
	xorl	%ebp, %ebp
	call	malloc@PLT
	movl	$262144, %edi
	movq	%rax, %r12
	call	malloc@PLT
	movl	$262144, %edi
	movq	%rax, %r15
	call	malloc@PLT
	movl	$262144, %edi
	movq	%rax, %r14
	call	malloc@PLT
	movq	%rax, %rdx
.L35:
	movl	0(%r13,%rbp,4), %ebx
	movq	%rdx, 8(%rsp)
	imull	%ebx, %ebx
	movslq	%ebx, %rbx
	salq	$2, %rbx
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, (%r12,%rbp,8)
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, (%r15,%rbp,8)
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, (%r14,%rbp,8)
	call	malloc@PLT
	movq	8(%rsp), %rdx
	movq	%rax, (%rdx,%rbp,8)
	incq	%rbp
	cmpq	$32768, %rbp
	jne	.L35
	call	_Z8my_timerv
	xorl	%r11d, %r11d
	movsd	.LC10(%rip), %xmm12
	movsd	%xmm0, 8(%rsp)
.L36:
	cvtsi2sdl	%r11d, %xmm0
	movl	0(%r13,%r11,4), %esi
	movq	(%r12,%r11,8), %rdi
	incq	%r11
	mulsd	%xmm12, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	call	_Z9get_pixelPifi
	cmpq	$32768, %r11
	jne	.L36
	call	_Z8my_timerv
	subsd	8(%rsp), %xmm0
	leaq	.LC11(%rip), %rsi
	movb	$1, %al
	movl	$2, %edi
	call	__printf_chk@PLT
	.cfi_endproc
.LFE2032:
	.size	main, .-main
	.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
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	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.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1093567616
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC1:
	.long	-1073741824
	.align 4
.LC2:
	.long	1073741824
	.section	.rodata.cst8
	.align 8
.LC3:
	.long	0
	.long	1073479680
	.align 8
.LC4:
	.long	0
	.long	1072955392
	.align 8
.LC5:
	.long	0
	.long	1073872896
	.align 8
.LC6:
	.long	0
	.long	1081073664
	.align 8
.LC10:
	.long	0
	.long	1058013184
	.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 <stdlib.h>
# include <stdio.h>
# include <math.h>
# include <sys/time.h>

#define x_max (1.25)
#define x_min (-2.25)
#define y_max (1.75)
#define y_min (-1.75)
#define count_max 400
#define n 64
#define task 32768

double my_timer()
{
struct timeval time;
double _ret_val_0;
gettimeofday(( & time), 0);
_ret_val_0=(time.tv_sec+(time.tv_usec/1000000.0));
return _ret_val_0;
}

void explode ( float x, float y, int *value){
  int k;
  float x1;
  float x2;
  float y1;
  float y2;
  //int value;
  *value = 0;

  x1 = x;
  y1 = y;

  for ( k = 1; k <= count_max; k++ )
  {
    x2 = x1 * x1 - y1 * y1 + x;
    y2 = 2.0 * x1 * y1 + y;

    if ( x2 < -2.0 || 2.0 < x2 || y2 < -2.0 || 2.0 < y2 )
    {
      *value = k;
      //if(k > 1000)
         //printf("k:%d\n", k);
      break;
    }
    x1 = x2;
    y1 = y2;
  }
}

 /*
  Carry out the iteration for each pixel, determining COUNT.
*/

void get_pixel(int *count, float index, int size){

  int i, j;
  float x, y;
  for ( i = 0; i < size; i++ )
  {
    for ( j = 0; j < size; j++ )
    {
      x = ( ( float ) (     j     ) * (x_max + index)
          + ( float ) ( size - j - 1 ) * (x_min + index) )
          / ( float ) ( size     - 1 );

      y = ( ( float ) (     i     ) * (y_max + index)
          + ( float ) ( size - i - 1 ) * (y_min + index) )
          / ( float ) ( size     - 1 );

      explode ( x, y, &count[i + j * size] );
    }
  }

}

/*
  Determine the coloring of each pixel.
*/

int det_pixel(int *c_max, int *count, int size){

  int i, j;

  *c_max = 0;
  for ( j = 0; j < size; j++ )
  {
    for ( i = 0; i < size; i++ )
    {
      if ( *c_max < count[i+j*size] )
      {
        *c_max = count[i+j*size];
      }
    }
  }
}

/*
  Set the image data.
*/

void set_img(int *r, int *g, int *b, int *count, int c_max, int size){
  int i, j;
  int c;

  for ( i = 0; i < size; i++ )
  {
    for ( j = 0; j < size; j++ )
    {
      if ( count[i+j*size] % 2 == 1 )
      {
        r[i+j*size] = 255;
        g[i+j*size] = 255;
        b[i+j*size] = 255;
      }
      else
      {
        c = ( int ) ( 255.0 * sqrt ( sqrt ( sqrt (
          ( ( double ) ( count[i+j*size] ) / ( double ) ( c_max ) ) ) ) ) );
        r[i+j*size] = 3 * c / 5;
        g[i+j*size] = 3 * c / 5;
        b[i+j*size] = c;
      }
    }
  }  
}

int main(){
  int i, j, k;
  int **r, **g, **b;
  int *c_max;
  int **count;

  int num_thread[task];
  int num_size[task];
  FILE *f;

  f = fopen("rand.txt", "r");
  for(i = 0; i < task; i++)
    fscanf(f, "%1d", &num_thread[i]);

  fclose(f);

  for(i = 0; i < task; i++)
    num_size[i] = num_thread[i]*32;


  double start_timer, end_timer;
  count =  (int**)malloc(task * sizeof(int *));
  r =  (int**)malloc(task * sizeof(int *));
  g =  (int** )malloc(task * sizeof(int *));
  b =  (int**)malloc(task * sizeof(int *));
  c_max = (int*)malloc(task * sizeof(int));

  for(i = 0; i < task; i++){
    count[i] = ( int * ) malloc ( num_size[i] * num_size[i] * sizeof ( int ) );
    r[i] = ( int * ) malloc ( num_size[i] * num_size[i] * sizeof ( int ) );
    g[i] = ( int * ) malloc ( num_size[i] * num_size[i] * sizeof ( int ) );
    b[i] = ( int * ) malloc ( num_size[i] * num_size[i] * sizeof ( int ) );
  }
  start_timer = my_timer(); 
  //Carry out the iteration for each pixel, determining COUNT.
  for(i = 0 ; i < task ; i++)
    get_pixel(count[i], (float)(i/(task/2.0)), num_size[i]);

  end_timer = my_timer();
  printf("Elapsed Time:%lf Sec.\n", end_timer - start_timer);

  //Determine the coloring of each pixel.
  for(i = 0; i < task; i++)
    det_pixel(&c_max[i], count[i], num_size[i]);

  //Set the image data.
  for(i = 0; i < task ; i++)
    set_img(r[i], g[i], b[i], count[i], c_max[i], num_size[i]);


#if 0
  // output results
  FILE *fp;
  fp = fopen("output1.txt", "w+");
  for(i = 0; i < task; i++)
    for(j = 0; j < n * n; j++)
        fprintf(fp, "%d, %d, %d\n", r[i][j], g[i][j], b[i][j]);
  fclose(fp);
#endif
  /*clean up*/
  for(i = 0; i < task; i++){
    free(count[i]);
    free(r[i]);
    free(g[i]);
    free(b[i]);
  }
  free(c_max);
  free(r);
  free(g);
  free(b);

  return 0;
}

	.text
	.file	"mandelbrot.hip"
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z8my_timerv
.LCPI0_0:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	_Z8my_timerv
	.type	_Z8my_timerv,@function
_Z8my_timerv:                           # @_Z8my_timerv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -16
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	cvtsi2sdq	(%rbx), %xmm1
	cvtsi2sdq	8(%rbx), %xmm0
	divsd	.LCPI0_0(%rip), %xmm0
	addsd	%xmm1, %xmm0
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z8my_timerv, .Lfunc_end0-_Z8my_timerv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z7explodeffPi
.LCPI1_0:
	.long	0xc0000000                      # float -2
.LCPI1_1:
	.long	0x40000000                      # float 2
	.text
	.globl	_Z7explodeffPi
	.type	_Z7explodeffPi,@function
_Z7explodeffPi:                         # @_Z7explodeffPi
	.cfi_startproc
# %bb.0:
	movl	$0, (%rdi)
	cvtss2sd	%xmm1, %xmm2
	movl	$1, %eax
	movss	.LCPI1_0(%rip), %xmm3           # xmm3 = mem[0],zero,zero,zero
	movss	.LCPI1_1(%rip), %xmm4           # xmm4 = mem[0],zero,zero,zero
	movaps	%xmm0, %xmm6
	movaps	%xmm0, %xmm5
.LBB1_1:                                # =>This Inner Loop Header: Depth=1
	mulss	%xmm5, %xmm5
	movaps	%xmm1, %xmm7
	mulss	%xmm1, %xmm7
	subss	%xmm7, %xmm5
	addss	%xmm0, %xmm5
	ucomiss	%xmm5, %xmm3
	ja	.LBB1_5
# %bb.2:                                #   in Loop: Header=BB1_1 Depth=1
	ucomiss	%xmm4, %xmm5
	ja	.LBB1_5
# %bb.3:                                #   in Loop: Header=BB1_1 Depth=1
	cvtss2sd	%xmm6, %xmm6
	addsd	%xmm6, %xmm6
	cvtss2sd	%xmm1, %xmm1
	mulsd	%xmm6, %xmm1
	addsd	%xmm2, %xmm1
	cvtsd2ss	%xmm1, %xmm1
	ucomiss	%xmm1, %xmm3
	ja	.LBB1_5
# %bb.4:                                #   in Loop: Header=BB1_1 Depth=1
	ucomiss	%xmm4, %xmm1
	ja	.LBB1_5
# %bb.6:                                #   in Loop: Header=BB1_1 Depth=1
	incl	%eax
	movaps	%xmm5, %xmm6
	cmpl	$401, %eax                      # imm = 0x191
	jne	.LBB1_1
# %bb.7:                                # %.loopexit
	retq
.LBB1_5:
	movl	%eax, (%rdi)
	retq
.Lfunc_end1:
	.size	_Z7explodeffPi, .Lfunc_end1-_Z7explodeffPi
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z9get_pixelPifi
.LCPI2_0:
	.quad	0x3ff4000000000000              # double 1.25
.LCPI2_1:
	.quad	0xc002000000000000              # double -2.25
.LCPI2_2:
	.quad	0x3ffc000000000000              # double 1.75
.LCPI2_3:
	.quad	0xbffc000000000000              # double -1.75
	.text
	.globl	_Z9get_pixelPifi
	.type	_Z9get_pixelPifi,@function
_Z9get_pixelPifi:                       # @_Z9get_pixelPifi
	.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	$72, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
                                        # kill: def $esi killed $esi def $rsi
	movq	%rsi, 16(%rsp)                  # 8-byte Spill
	testl	%esi, %esi
	jle	.LBB2_5
# %bb.1:                                # %.preheader.lr.ph
	movq	%rdi, %r15
	cvtss2sd	%xmm0, %xmm1
	movsd	.LCPI2_0(%rip), %xmm2           # xmm2 = mem[0],zero
	addsd	%xmm1, %xmm2
	movsd	.LCPI2_1(%rip), %xmm3           # xmm3 = mem[0],zero
	addsd	%xmm1, %xmm3
	movq	16(%rsp), %rax                  # 8-byte Reload
	leal	-1(%rax), %ecx
	movl	%ecx, 8(%rsp)                   # 4-byte Spill
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ecx, %xmm0
	movsd	.LCPI2_2(%rip), %xmm4           # xmm4 = mem[0],zero
	addsd	%xmm1, %xmm4
	movsd	%xmm4, 24(%rsp)                 # 8-byte Spill
	addsd	.LCPI2_3(%rip), %xmm1
	movsd	%xmm1, 32(%rsp)                 # 8-byte Spill
	xorps	%xmm4, %xmm4
	cvtss2sd	%xmm0, %xmm4
	movl	%eax, %r12d
	leaq	(,%r12,4), %r13
	xorl	%ebx, %ebx
	movsd	%xmm2, 64(%rsp)                 # 8-byte Spill
	movsd	%xmm3, 56(%rsp)                 # 8-byte Spill
	movsd	%xmm4, 48(%rsp)                 # 8-byte Spill
.LBB2_2:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_3 Depth 2
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ebx, %xmm0
	movl	%ebx, %eax
	notl	%eax
	addl	16(%rsp), %eax                  # 4-byte Folded Reload
	xorps	%xmm1, %xmm1
	cvtsi2ss	%eax, %xmm1
	cvtss2sd	%xmm0, %xmm0
	mulsd	24(%rsp), %xmm0                 # 8-byte Folded Reload
	cvtss2sd	%xmm1, %xmm1
	mulsd	32(%rsp), %xmm1                 # 8-byte Folded Reload
	addsd	%xmm0, %xmm1
	divsd	%xmm4, %xmm1
	xorps	%xmm0, %xmm0
	cvtsd2ss	%xmm1, %xmm0
	movss	%xmm0, 12(%rsp)                 # 4-byte Spill
	movl	8(%rsp), %ebp                   # 4-byte Reload
	movq	%r15, 40(%rsp)                  # 8-byte Spill
	xorl	%r14d, %r14d
.LBB2_3:                                #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtsi2ss	%r14d, %xmm0
	xorps	%xmm1, %xmm1
	cvtsi2ss	%ebp, %xmm1
	cvtss2sd	%xmm0, %xmm0
	mulsd	%xmm2, %xmm0
	cvtss2sd	%xmm1, %xmm1
	mulsd	%xmm3, %xmm1
	addsd	%xmm0, %xmm1
	divsd	%xmm4, %xmm1
	xorps	%xmm0, %xmm0
	cvtsd2ss	%xmm1, %xmm0
	movss	12(%rsp), %xmm1                 # 4-byte Reload
                                        # xmm1 = mem[0],zero,zero,zero
	movq	%r15, %rdi
	callq	_Z7explodeffPi
	movsd	48(%rsp), %xmm4                 # 8-byte Reload
                                        # xmm4 = mem[0],zero
	movsd	56(%rsp), %xmm3                 # 8-byte Reload
                                        # xmm3 = mem[0],zero
	movsd	64(%rsp), %xmm2                 # 8-byte Reload
                                        # xmm2 = mem[0],zero
	incq	%r14
	addq	%r13, %r15
	decl	%ebp
	cmpq	%r14, %r12
	jne	.LBB2_3
# %bb.4:                                # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	incq	%rbx
	movq	40(%rsp), %r15                  # 8-byte Reload
	addq	$4, %r15
	cmpq	%r12, %rbx
	jne	.LBB2_2
.LBB2_5:                                # %._crit_edge27
	addq	$72, %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_end2:
	.size	_Z9get_pixelPifi, .Lfunc_end2-_Z9get_pixelPifi
	.cfi_endproc
                                        # -- End function
	.globl	_Z9det_pixelPiS_i               # -- Begin function _Z9det_pixelPiS_i
	.type	_Z9det_pixelPiS_i,@function
_Z9det_pixelPiS_i:                      # @_Z9det_pixelPiS_i
	.cfi_startproc
# %bb.0:
	movl	$0, (%rdi)
	movl	%edx, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
.LBB3_1:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_3 Depth 2
	testl	%edx, %edx
	jle	.LBB3_6
# %bb.2:                                # %.lr.ph
                                        #   in Loop: Header=BB3_1 Depth=1
	movl	%ecx, %r9d
	leaq	(%rsi,%r9,4), %r9
	xorl	%r10d, %r10d
.LBB3_3:                                #   Parent Loop BB3_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r9,%r10,4), %r11d
	cmpl	%r11d, %r8d
	jge	.LBB3_5
# %bb.4:                                #   in Loop: Header=BB3_3 Depth=2
	movl	%r11d, (%rdi)
	movl	%r11d, %r8d
.LBB3_5:                                #   in Loop: Header=BB3_3 Depth=2
	incq	%r10
	cmpq	%r10, %rax
	jne	.LBB3_3
.LBB3_6:                                # %._crit_edge
                                        #   in Loop: Header=BB3_1 Depth=1
	addl	%edx, %ecx
	jmp	.LBB3_1
.Lfunc_end3:
	.size	_Z9det_pixelPiS_i, .Lfunc_end3-_Z9det_pixelPiS_i
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z7set_imgPiS_S_S_ii
.LCPI4_0:
	.quad	0x406fe00000000000              # double 255
	.text
	.globl	_Z7set_imgPiS_S_S_ii
	.type	_Z7set_imgPiS_S_S_ii,@function
_Z7set_imgPiS_S_S_ii:                   # @_Z7set_imgPiS_S_S_ii
	.cfi_startproc
# %bb.0:
	testl	%r9d, %r9d
	jle	.LBB4_17
# %bb.1:                                # %.preheader.lr.ph
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	cvtsi2sd	%r8d, %xmm0
	movsd	%xmm0, 32(%rsp)                 # 8-byte Spill
	movl	%r9d, %r13d
	leaq	(,%r13,4), %rdi
	xorl	%eax, %eax
	xorpd	%xmm1, %xmm1
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	movq	%r13, 16(%rsp)                  # 8-byte Spill
.LBB4_2:                                # %.lr.ph.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_3 Depth 2
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	xorl	%ebp, %ebp
.LBB4_3:                                # %.lr.ph
                                        #   Parent Loop BB4_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%rbx,%rbp), %edx
	movl	%edx, %esi
	andl	$-2147483647, %esi              # imm = 0x80000001
	movl	$255, %ecx
	movl	$255, %eax
	cmpl	$1, %esi
	je	.LBB4_14
# %bb.4:                                #   in Loop: Header=BB4_3 Depth=2
	xorps	%xmm0, %xmm0
	cvtsi2sd	%edx, %xmm0
	divsd	32(%rsp), %xmm0                 # 8-byte Folded Reload
	ucomisd	%xmm1, %xmm0
	jb	.LBB4_6
# %bb.5:                                #   in Loop: Header=BB4_3 Depth=2
	sqrtsd	%xmm0, %xmm0
	jmp	.LBB4_7
.LBB4_6:                                # %call.sqrt
                                        #   in Loop: Header=BB4_3 Depth=2
	callq	sqrt
	xorpd	%xmm1, %xmm1
.LBB4_7:                                # %.split
                                        #   in Loop: Header=BB4_3 Depth=2
	ucomisd	%xmm1, %xmm0
	jb	.LBB4_9
# %bb.8:                                #   in Loop: Header=BB4_3 Depth=2
	sqrtsd	%xmm0, %xmm0
	jmp	.LBB4_10
.LBB4_9:                                # %call.sqrt67
                                        #   in Loop: Header=BB4_3 Depth=2
	callq	sqrt
	xorpd	%xmm1, %xmm1
.LBB4_10:                               # %.split.split
                                        #   in Loop: Header=BB4_3 Depth=2
	ucomisd	%xmm1, %xmm0
	jb	.LBB4_12
# %bb.11:                               #   in Loop: Header=BB4_3 Depth=2
	sqrtsd	%xmm0, %xmm0
	jmp	.LBB4_13
.LBB4_12:                               # %call.sqrt68
                                        #   in Loop: Header=BB4_3 Depth=2
	callq	sqrt
	xorpd	%xmm1, %xmm1
.LBB4_13:                               # %.split.split.split
                                        #   in Loop: Header=BB4_3 Depth=2
	movq	8(%rsp), %rdi                   # 8-byte Reload
	mulsd	.LCPI4_0(%rip), %xmm0
	cvttsd2si	%xmm0, %eax
	leal	(%rax,%rax,2), %ecx
	movslq	%ecx, %rcx
	imulq	$1717986919, %rcx, %rcx         # imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$33, %rcx
	addl	%edx, %ecx
.LBB4_14:                               #   in Loop: Header=BB4_3 Depth=2
	movl	%ecx, (%r12,%rbp)
	movl	%ecx, (%r15,%rbp)
	movl	%eax, (%r14,%rbp)
	addq	%rdi, %rbp
	decq	%r13
	jne	.LBB4_3
# %bb.15:                               # %._crit_edge
                                        #   in Loop: Header=BB4_2 Depth=1
	movq	24(%rsp), %rax                  # 8-byte Reload
	incq	%rax
	addq	$4, %r12
	addq	$4, %r15
	addq	$4, %r14
	addq	$4, %rbx
	movq	16(%rsp), %r13                  # 8-byte Reload
	cmpq	%r13, %rax
	jne	.LBB4_2
# %bb.16:
	addq	$40, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB4_17:                               # %._crit_edge45
	retq
.Lfunc_end4:
	.size	_Z7set_imgPiS_S_S_ii, .Lfunc_end4-_Z7set_imgPiS_S_S_ii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI5_0:
	.quad	0x3f10000000000000              # double 6.103515625E-5
.LCPI5_1:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	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	$262184, %rsp                   # imm = 0x40028
	.cfi_def_cfa_offset 262224
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	callq	fopen
	movq	%rax, %rbx
	xorl	%r14d, %r14d
.LBB5_1:                                # =>This Inner Loop Header: Depth=1
	leaq	(%rsp,%r14), %rdx
	addq	$131104, %rdx                   # imm = 0x20020
	movl	$.L.str.2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	addq	$4, %r14
	cmpq	$131072, %r14                   # imm = 0x20000
	jne	.LBB5_1
# %bb.2:
	movq	%rbx, %rdi
	callq	fclose
	xorl	%eax, %eax
.LBB5_3:                                # =>This Inner Loop Header: Depth=1
	movl	131104(%rsp,%rax,4), %ecx
	shll	$5, %ecx
	movl	%ecx, 32(%rsp,%rax,4)
	incq	%rax
	cmpq	$32768, %rax                    # imm = 0x8000
	jne	.LBB5_3
# %bb.4:
	movl	$262144, %edi                   # imm = 0x40000
	callq	malloc
	movq	%rax, %rbx
	xorl	%r14d, %r14d
.LBB5_5:                                # =>This Inner Loop Header: Depth=1
	movl	32(%rsp,%r14,4), %edi
	imull	%edi, %edi
	shlq	$2, %rdi
	callq	malloc
	movq	%rax, (%rbx,%r14,8)
	incq	%r14
	cmpq	$32768, %r14                    # imm = 0x8000
	jne	.LBB5_5
# %bb.6:
	xorl	%r15d, %r15d
	leaq	16(%rsp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	movq	(%r14), %r12
	movq	8(%r14), %r14
.LBB5_7:                                # =>This Inner Loop Header: Depth=1
	movq	(%rbx,%r15,8), %rdi
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r15d, %xmm0
	mulsd	.LCPI5_0(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movl	32(%rsp,%r15,4), %esi
	callq	_Z9get_pixelPifi
	incq	%r15
	cmpq	$32768, %r15                    # imm = 0x8000
	jne	.LBB5_7
# %bb.8:
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r14, %xmm0
	divsd	.LCPI5_1(%rip), %xmm0
	cvtsi2sd	%r12, %xmm1
	addsd	%xmm0, %xmm1
	movsd	%xmm1, 8(%rsp)                  # 8-byte Spill
	leaq	16(%rsp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	gettimeofday
	xorps	%xmm1, %xmm1
	cvtsi2sdq	(%rbx), %xmm1
	xorps	%xmm0, %xmm0
	cvtsi2sdq	8(%rbx), %xmm0
	divsd	.LCPI5_1(%rip), %xmm0
	addsd	%xmm1, %xmm0
	subsd	8(%rsp), %xmm0                  # 8-byte Folded Reload
	movl	$.L.str.3, %edi
	movb	$1, %al
	callq	printf
.Lfunc_end5:
	.size	main, .Lfunc_end5-main
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"rand.txt"
	.size	.L.str, 9

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"r"
	.size	.L.str.1, 2

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"%1d"
	.size	.L.str.2, 4

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Elapsed Time:%lf Sec.\n"
	.size	.L.str.3, 23

	.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 __hip_cuid_

	.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_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
