#include <stdio.h>
#include <cuda_runtime.h>

/**
 * @brief 
 * 
 * @param m 
 * @param n 
 * @param A 
 * @param lda 
 * @param name 
 */
void printMatrix(int m, int n, const float *A, int lda, const char *name) {
  for (int row = 0; row < m; row++) {
    for (int col = 0; col < n; col++) {
      float Areg = A[row + col * lda];
      printf("%s(%d,%d) = %.3f\n", name, row + 1, col + 1, Areg);
    }
  }
}



/**
 * @brief Prints m x n matrix A on host memory. 
 */
void print_cpu_matrix(int m, int n, const float *A) {
  for (int row = 0; row < m; row++) {
    for (int col = 0; col < n; col++) {
      float Areg = A[col + row * n];
      printf("(%d,%d)%.3f,", row, col, Areg);
    }
    printf("\n");
  }
}

/**
 * @brief Prints m x n matrix A on device memory. 
 */
void print_device_matrix(int m, int n, const float *A) {
  float *tempmatrix;
  tempmatrix = (float *)malloc(sizeof(float) * m * n);
  cudaMemcpy(tempmatrix, A, sizeof(float) * m * n, cudaMemcpyDeviceToHost);
  for (int row = 0; row < m; row++) {
    for (int col = 0; col < n; col++) {
      float Areg = tempmatrix[col + row * n];
      printf("(%d,%d)%.3f,", row, col, Areg);
    }
    printf("\n");
  }
}

/**
 * @brief Prints m vector A on device memory. 
 */
void print_device_vector(int m, const float *A) {
  float *tempmatrix;
  tempmatrix = (float *)malloc(sizeof(float) * m);
  cudaMemcpy(tempmatrix, A, sizeof(float) * m, cudaMemcpyDeviceToHost);
  for (int row = 0; row < m; row++) {
    float Areg = tempmatrix[row];
    printf("(%d)%.3f,", row, Areg);
  }
  printf("\n");
}

void printVector(int m, const float *A, const char *name) {
  for (int i = 0; i < m; i++) {
    float Areg = A[i];
    printf("%.6f\n", Areg);
    printf("%s(%d) = %.3f\n", name, i, Areg);
  }
}
	.file	"tmpxft_00236b31_00000000-6_debugFunctions.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2034:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2034:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s(%d,%d) = %.3f\n"
	.text
	.globl	_Z11printMatrixiiPKfiPKc
	.type	_Z11printMatrixiiPKfiPKc, @function
_Z11printMatrixiiPKfiPKc:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%ecx, %rcx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	0(,%rcx,4), %rax
	movq	%rdx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edi, %r13d
	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
	xorl	%ebx, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%r8, 16(%rsp)
	movq	%rax, 8(%rsp)
.L3:
	movl	%ebx, %r15d
	cmpl	%ebx, %r13d
	jle	.L2
	leaq	(%r14,%rbx,4), %r12
	xorl	%r8d, %r8d
.L6:
	leal	1(%r15), %ecx
	cmpl	%ebp, %r8d
	jge	.L9
	movq	16(%rsp), %rdx
	incl	%r8d
	movl	$2, %edi
	movb	$1, %al
	leaq	.LC0(%rip), %rsi
	movl	%r8d, 28(%rsp)
	cvtss2sd	(%r12), %xmm0
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	movl	28(%rsp), %r8d
	addq	%rax, %r12
	jmp	.L6
.L9:
	incq	%rbx
	jmp	.L3
.L2:
	addq	$40, %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
.LFE2027:
	.size	_Z11printMatrixiiPKfiPKc, .-_Z11printMatrixiiPKfiPKc
	.section	.rodata.str1.1
.LC1:
	.string	"(%d,%d)%.3f,"
.LC2:
	.string	"\n"
	.text
	.globl	_Z16print_cpu_matrixiiPKf
	.type	_Z16print_cpu_matrixiiPKf, @function
_Z16print_cpu_matrixiiPKf:
.LFB2028:
	.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
	movl	%edi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdx, %r12
	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
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L11:
	cmpl	%r14d, %ebx
	jge	.L10
	movslq	%r13d, %rax
	xorl	%r15d, %r15d
	leaq	(%r12,%rax,4), %r9
.L14:
	movl	%r15d, %ecx
	cmpl	%r15d, %ebp
	jle	.L16
	movl	%ebx, %edx
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	(%r9,%r15,4), %xmm0
	movq	%r9, 8(%rsp)
	incq	%r15
	call	__printf_chk@PLT
	movq	8(%rsp), %r9
	jmp	.L14
.L16:
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incl	%ebx
	call	__printf_chk@PLT
	addl	%ebp, %r13d
	jmp	.L11
.L10:
	addq	$24, %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
.LFE2028:
	.size	_Z16print_cpu_matrixiiPKf, .-_Z16print_cpu_matrixiiPKf
	.globl	_Z19print_device_matrixiiPKf
	.type	_Z19print_device_matrixiiPKf, @function
_Z19print_device_matrixiiPKf:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	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
	movq	%rax, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movslq	%edi, %rbx
	movq	%rbx, %r13
	imulq	%rax, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	salq	$2, %rbx
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rbx, %rdx
	movq	%r14, %rsi
	movl	$2, %ecx
	movq	%rax, %rdi
	movq	%rax, %r12
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	call	cudaMemcpy@PLT
.L18:
	cmpl	%r13d, %ebx
	jge	.L17
	movslq	%r14d, %rax
	xorl	%r15d, %r15d
	leaq	(%r12,%rax,4), %r9
.L21:
	movl	%r15d, %ecx
	cmpl	%r15d, %ebp
	jle	.L23
	movl	%ebx, %edx
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	(%r9,%r15,4), %xmm0
	movq	%r9, 8(%rsp)
	incq	%r15
	call	__printf_chk@PLT
	movq	8(%rsp), %r9
	jmp	.L21
.L23:
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incl	%ebx
	call	__printf_chk@PLT
	addl	%ebp, %r14d
	jmp	.L18
.L17:
	addq	$24, %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	_Z19print_device_matrixiiPKf, .-_Z19print_device_matrixiiPKf
	.section	.rodata.str1.1
.LC3:
	.string	"(%d)%.3f,"
	.text
	.globl	_Z19print_device_vectoriPKf
	.type	_Z19print_device_vectoriPKf, @function
_Z19print_device_vectoriPKf:
.LFB2030:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC3(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movslq	%edi, %rbx
	movq	%rbx, %rbp
	salq	$2, %rbx
	movq	%rbx, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%rsi, 8(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rsi
	movq	%rbx, %rdx
	movl	$2, %ecx
	movq	%rax, %rdi
	movq	%rax, %r12
	xorl	%ebx, %ebx
	call	cudaMemcpy@PLT
.L25:
	movl	%ebx, %edx
	cmpl	%ebx, %ebp
	jle	.L28
	movq	%r13, %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	(%r12,%rbx,4), %xmm0
	call	__printf_chk@PLT
	incq	%rbx
	jmp	.L25
.L28:
	addq	$24, %rsp
	.cfi_def_cfa_offset 40
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE2030:
	.size	_Z19print_device_vectoriPKf, .-_Z19print_device_vectoriPKf
	.section	.rodata.str1.1
.LC4:
	.string	"%.6f\n"
.LC5:
	.string	"%s(%d) = %.3f\n"
	.text
	.globl	_Z11printVectoriPKfPKc
	.type	_Z11printVectoriPKfPKc, @function
_Z11printVectoriPKfPKc:
.LFB2031:
	.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
	leaq	.LC4(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rdx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L30:
	movl	%ebx, %r15d
	cmpl	%ebx, %ebp
	jle	.L33
	movq	%r14, %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	(%r12,%rbx,4), %xmm0
	movsd	%xmm0, 8(%rsp)
	incq	%rbx
	call	__printf_chk@PLT
	movsd	8(%rsp), %xmm0
	movl	%r15d, %ecx
	movb	$1, %al
	movq	%r13, %rdx
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L30
.L33:
	addq	$24, %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	_Z11printVectoriPKfPKc, .-_Z11printVectoriPKfPKc
	.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
	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
.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
	.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 <stdio.h>
#include <hip/hip_runtime.h>

/**
 * @brief 
 * 
 * @param m 
 * @param n 
 * @param A 
 * @param lda 
 * @param name 
 */
void printMatrix(int m, int n, const float *A, int lda, const char *name) {
  for (int row = 0; row < m; row++) {
    for (int col = 0; col < n; col++) {
      float Areg = A[row + col * lda];
      printf("%s(%d,%d) = %.3f\n", name, row + 1, col + 1, Areg);
    }
  }
}



/**
 * @brief Prints m x n matrix A on host memory. 
 */
void print_cpu_matrix(int m, int n, const float *A) {
  for (int row = 0; row < m; row++) {
    for (int col = 0; col < n; col++) {
      float Areg = A[col + row * n];
      printf("(%d,%d)%.3f,", row, col, Areg);
    }
    printf("\n");
  }
}

/**
 * @brief Prints m x n matrix A on device memory. 
 */
void print_device_matrix(int m, int n, const float *A) {
  float *tempmatrix;
  tempmatrix = (float *)malloc(sizeof(float) * m * n);
  hipMemcpy(tempmatrix, A, sizeof(float) * m * n, hipMemcpyDeviceToHost);
  for (int row = 0; row < m; row++) {
    for (int col = 0; col < n; col++) {
      float Areg = tempmatrix[col + row * n];
      printf("(%d,%d)%.3f,", row, col, Areg);
    }
    printf("\n");
  }
}

/**
 * @brief Prints m vector A on device memory. 
 */
void print_device_vector(int m, const float *A) {
  float *tempmatrix;
  tempmatrix = (float *)malloc(sizeof(float) * m);
  hipMemcpy(tempmatrix, A, sizeof(float) * m, hipMemcpyDeviceToHost);
  for (int row = 0; row < m; row++) {
    float Areg = tempmatrix[row];
    printf("(%d)%.3f,", row, Areg);
  }
  printf("\n");
}

void printVector(int m, const float *A, const char *name) {
  for (int i = 0; i < m; i++) {
    float Areg = A[i];
    printf("%.6f\n", Areg);
    printf("%s(%d) = %.3f\n", name, i, Areg);
  }
}
	.text
	.file	"debugFunctions.hip"
	.globl	_Z11printMatrixiiPKfiPKc        # -- Begin function _Z11printMatrixiiPKfiPKc
	.type	_Z11printMatrixiiPKfiPKc,@function
_Z11printMatrixiiPKfiPKc:               # @_Z11printMatrixiiPKfiPKc
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	.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	%rdx, 8(%rsp)                   # 8-byte Spill
	movl	%esi, 4(%rsp)                   # 4-byte Spill
	testl	%edi, %edi
	jle	.LBB0_6
# %bb.1:                                # %.preheader.lr.ph
	movq	%r8, %rbx
	movslq	%ecx, %r13
	movl	%edi, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	4(%rsp), %ebp                   # 4-byte Reload
	shlq	$2, %r13
	xorl	%r15d, %r15d
.LBB0_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_4 Depth 2
	incq	%r15
	cmpl	$0, 4(%rsp)                     # 4-byte Folded Reload
	jle	.LBB0_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB0_2 Depth=1
	movq	8(%rsp), %r14                   # 8-byte Reload
	xorl	%r12d, %r12d
.LBB0_4:                                #   Parent Loop BB0_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	incq	%r12
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14), %xmm0
	movl	$.L.str, %edi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	movb	$1, %al
	callq	printf
	addq	%r13, %r14
	cmpq	%r12, %rbp
	jne	.LBB0_4
.LBB0_5:                                # %._crit_edge
                                        #   in Loop: Header=BB0_2 Depth=1
	addq	$4, 8(%rsp)                     # 8-byte Folded Spill
	cmpq	16(%rsp), %r15                  # 8-byte Folded Reload
	jne	.LBB0_2
.LBB0_6:                                # %._crit_edge16
	addq	$24, %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_end0:
	.size	_Z11printMatrixiiPKfiPKc, .Lfunc_end0-_Z11printMatrixiiPKfiPKc
	.cfi_endproc
                                        # -- End function
	.globl	_Z16print_cpu_matrixiiPKf       # -- Begin function _Z16print_cpu_matrixiiPKf
	.type	_Z16print_cpu_matrixiiPKf,@function
_Z16print_cpu_matrixiiPKf:              # @_Z16print_cpu_matrixiiPKf
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	.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	%rdx, 8(%rsp)                   # 8-byte Spill
	testl	%edi, %edi
	jle	.LBB1_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%esi, %ebp
	movl	%edi, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	%esi, %r13d
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
.LBB1_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_4 Depth 2
	testl	%ebp, %ebp
	jle	.LBB1_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB1_2 Depth=1
	movl	%ebx, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %r12
	xorl	%r15d, %r15d
.LBB1_4:                                #   Parent Loop BB1_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r12,%r15,4), %xmm0
	movl	$.L.str.1, %edi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movb	$1, %al
	callq	printf
	incq	%r15
	cmpq	%r15, %r13
	jne	.LBB1_4
.LBB1_5:                                # %._crit_edge
                                        #   in Loop: Header=BB1_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%r14
	addl	%ebp, %ebx
	cmpq	16(%rsp), %r14                  # 8-byte Folded Reload
	jne	.LBB1_2
.LBB1_6:                                # %._crit_edge16
	addq	$24, %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_end1:
	.size	_Z16print_cpu_matrixiiPKf, .Lfunc_end1-_Z16print_cpu_matrixiiPKf
	.cfi_endproc
                                        # -- End function
	.globl	_Z19print_device_matrixiiPKf    # -- Begin function _Z19print_device_matrixiiPKf
	.type	_Z19print_device_matrixiiPKf,@function
_Z19print_device_matrixiiPKf:           # @_Z19print_device_matrixiiPKf
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	.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	%rdx, %r15
	movl	%esi, %ebx
	movl	%edi, %ebp
	movslq	%edi, %r14
	movslq	%esi, %r12
	imulq	%r14, %r12
	shlq	$2, %r12
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%r14d, %r14d
	jle	.LBB2_6
# %bb.1:                                # %.preheader.lr.ph
	movl	%ebp, %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movl	%ebx, %ebp
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
.LBB2_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_4 Depth 2
	testl	%ebx, %ebx
	jle	.LBB2_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB2_2 Depth=1
	movl	%r14d, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %r13
	xorl	%r12d, %r12d
.LBB2_4:                                #   Parent Loop BB2_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r13,%r12,4), %xmm0
	movl	$.L.str.1, %edi
	movl	%r15d, %esi
	movl	%r12d, %edx
	movb	$1, %al
	callq	printf
	incq	%r12
	cmpq	%r12, %rbp
	jne	.LBB2_4
.LBB2_5:                                # %._crit_edge
                                        #   in Loop: Header=BB2_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%r15
	addl	%ebx, %r14d
	cmpq	16(%rsp), %r15                  # 8-byte Folded Reload
	jne	.LBB2_2
.LBB2_6:                                # %._crit_edge22
	addq	$24, %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	_Z19print_device_matrixiiPKf, .Lfunc_end2-_Z19print_device_matrixiiPKf
	.cfi_endproc
                                        # -- End function
	.globl	_Z19print_device_vectoriPKf     # -- Begin function _Z19print_device_vectoriPKf
	.type	_Z19print_device_vectoriPKf,@function
_Z19print_device_vectoriPKf:            # @_Z19print_device_vectoriPKf
	.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	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %r14
	movl	%edi, %ebp
	movslq	%edi, %r12
	leaq	(,%r12,4), %r15
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, %rbx
	movq	%rax, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	testl	%r12d, %r12d
	jle	.LBB3_3
# %bb.1:                                # %.lr.ph.preheader
	movl	%ebp, %r15d
	xorl	%r14d, %r14d
.LBB3_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbx,%r14,4), %xmm0
	movl	$.L.str.3, %edi
	movl	%r14d, %esi
	movb	$1, %al
	callq	printf
	incq	%r14
	cmpq	%r14, %r15
	jne	.LBB3_2
.LBB3_3:                                # %._crit_edge
	movl	$10, %edi
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT                     # TAILCALL
.Lfunc_end3:
	.size	_Z19print_device_vectoriPKf, .Lfunc_end3-_Z19print_device_vectoriPKf
	.cfi_endproc
                                        # -- End function
	.globl	_Z11printVectoriPKfPKc          # -- Begin function _Z11printVectoriPKfPKc
	.type	_Z11printVectoriPKfPKc,@function
_Z11printVectoriPKfPKc:                 # @_Z11printVectoriPKfPKc
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jle	.LBB4_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movl	%edi, %r12d
	xorl	%r15d, %r15d
.LBB4_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14,%r15,4), %xmm0
	movsd	%xmm0, (%rsp)                   # 8-byte Spill
	movl	$.L.str.4, %edi
	movb	$1, %al
	callq	printf
	movl	$.L.str.5, %edi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	movsd	(%rsp), %xmm0                   # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB4_2
# %bb.3:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r14
	.cfi_restore %r15
.LBB4_4:                                # %._crit_edge
	retq
.Lfunc_end4:
	.size	_Z11printVectoriPKfPKc, .Lfunc_end4-_Z11printVectoriPKfPKc
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"%s(%d,%d) = %.3f\n"
	.size	.L.str, 18

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"(%d,%d)%.3f,"
	.size	.L.str.1, 13

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"(%d)%.3f,"
	.size	.L.str.3, 10

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"%.6f\n"
	.size	.L.str.4, 6

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"%s(%d) = %.3f\n"
	.size	.L.str.5, 15

	.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
