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

/*#define M(row, col)  *(M.elements + (row) (*) M.width + col)*/
typedef struct {
    int width;
    int height;
    float* elements;
} Matrix;




//a h w  B h w    C 
void MatMul(const Matrix A, const Matrix B, Matrix C)
{
    for (int i = 0; i < A.height; i++) {
        for (int j = 0; j < B.width; j++) {
            C.elements[i * C.width + j] = 0;
            for (int k = 0; k < A.width; k++) {
                C.elements[i * C.width + j] +=
                    A.elements[i * A.width + k]
                    * B.elements[k * B.width + j];
            }
        }
    }
}


void fill_Matrix(Matrix A)
{
    for (int i = 0; i < A.height ; i++) {
        for (int j = 0; j < A.width; j++) {
            A.elements[i * A.width + j] = rand() / (float)RAND_MAX * 10;
        }
    }
}

void print_Matrix(Matrix A)
{
    /*for (int i = 0; i < A.height; i++) {*/
        /*for (int j = 0; j < A.width; j++) {*/
            /*printf("%4.1f ", A.elements[i * A.width + j]);*/
        /*}*/
        /*printf("\n");*/
    /*}*/
}

int main(int argc, char **argv)
{
    if (argc != 2) {
        printf("usage: n\n");
        return -1;
    }
    int nnn = atoi(argv[1]);

    int n = 1 << nnn;

    srand(time(0));

    Matrix A, B, C;
    A.width = A.height = n;
    A.elements = (float *)malloc(sizeof(float) * n * n);
    B.width = B.height = n;
    B.elements = (float *)malloc(sizeof(float) * n * n);
    C.width = C.height = n;
    C.elements = (float *)malloc(sizeof(float) * n * n);


    fill_Matrix(A);
    print_Matrix(A);
    printf("\n");

    fill_Matrix(B);
    print_Matrix(B);
    printf("\n");

    MatMul(A, B, C);

    print_Matrix(C);

}

	.file	"tmpxft_00365ce1_00000000-6_mat_c.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2033:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2033:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z6MatMul6MatrixS_S_
	.type	_Z6MatMul6MatrixS_S_, @function
_Z6MatMul6MatrixS_S_:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r10
	movq	%rdx, %rax
	movl	%edx, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	cltq
	movl	%r10d, %edx
	movq	%rsi, %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	salq	$2, %rax
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%r10, %rbx
	shrq	$32, %rbx
	movq	%rcx, -8(%rsp)
	movl	%r10d, -12(%rsp)
	xorl	%r10d, %r10d
	movl	%ebx, -16(%rsp)
	xorl	%ebx, %ebx
.L3:
	cmpl	%r12d, -16(%rsp)
	jle	.L2
	movslq	%ebx, %rcx
	movq	-8(%rsp), %rbp
	xorl	%esi, %esi
	leaq	(%r9,%rcx,4), %r11
	movslq	%r10d, %rcx
	leaq	(%rdi,%rcx,4), %r14
.L7:
	cmpl	%r15d, %esi
	jge	.L11
	movq	%rbp, %r13
	xorl	%ecx, %ecx
	xorps	%xmm0, %xmm0
.L5:
	movss	%xmm0, (%r11)
	cmpl	%ecx, -12(%rsp)
	jle	.L12
	movss	(%r14,%rcx,4), %xmm1
	mulss	0(%r13), %xmm1
	incq	%rcx
	addq	%rax, %r13
	addss	%xmm1, %xmm0
	jmp	.L5
.L12:
	incl	%esi
	addq	$4, %rbp
	addq	$4, %r11
	jmp	.L7
.L11:
	incl	%r12d
	addl	%r8d, %ebx
	addl	%edx, %r10d
	jmp	.L3
.L2:
	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	_Z6MatMul6MatrixS_S_, .-_Z6MatMul6MatrixS_S_
	.globl	_Z11fill_Matrix6Matrix
	.type	_Z11fill_Matrix6Matrix, @function
_Z11fill_Matrix6Matrix:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edi, %ecx
	movq	%rsi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	xorl	%r14d, %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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edi, %ebp
	sarq	$32, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%rdi, (%rsp)
.L14:
	movl	(%rsp), %eax
	cmpl	%eax, %r14d
	jge	.L13
	movslq	%r13d, %rbx
	xorl	%r12d, %r12d
	salq	$2, %rbx
.L17:
	cmpl	%ebp, %r12d
	jge	.L19
	movl	%ecx, 12(%rsp)
	incl	%r12d
	addq	$4, %rbx
	call	rand@PLT
	movl	12(%rsp), %ecx
	cvtsi2ssl	%eax, %xmm0
	mulss	.LC1(%rip), %xmm0
	mulss	.LC2(%rip), %xmm0
	movss	%xmm0, -4(%rbx,%r15)
	jmp	.L17
.L19:
	incl	%r14d
	addl	%ecx, %r13d
	jmp	.L14
.L13:
	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	_Z11fill_Matrix6Matrix, .-_Z11fill_Matrix6Matrix
	.globl	_Z12print_Matrix6Matrix
	.type	_Z12print_Matrix6Matrix, @function
_Z12print_Matrix6Matrix:
.LFB2029:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z12print_Matrix6Matrix, .-_Z12print_Matrix6Matrix
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"usage: n\n"
.LC4:
	.string	"\n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2030:
	.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
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	$2, %edi
	je	.L22
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	orl	$-1, %eax
	jmp	.L21
.L22:
	movq	8(%rsi), %rdi
	movl	$1, %ebx
	leaq	.LC4(%rip), %r15
	call	atoi@PLT
	xorl	%edi, %edi
	movl	%eax, %ecx
	sall	%cl, %ebx
	call	time@PLT
	movslq	%ebx, %rbp
	imulq	%rbp, %rbp
	movl	%eax, %edi
	call	srand@PLT
	salq	$2, %rbp
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rax, %r12
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rbx, %rbp
	movl	%ebx, %ebx
	salq	$32, %rbp
	movq	%rax, %r13
	call	malloc@PLT
	orq	%rbp, %rbx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	movq	%rax, 8(%rsp)
	call	_Z11fill_Matrix6Matrix
	movq	%r15, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	%rbx, (%rsp)
	call	_Z11fill_Matrix6Matrix
	movq	%r15, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %r9
	movq	%rbx, %r8
	movq	%r13, %rcx
	movq	(%rsp), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	call	_Z6MatMul6MatrixS_S_
	xorl	%eax, %eax
.L21:
	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
.LFE2030:
	.size	main, .-main
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2056:
	.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
.LFE2056:
	.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
.LC1:
	.long	805306368
	.align 4
.LC2:
	.long	1092616192
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


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

/*#define M(row, col)  *(M.elements + (row) (*) M.width + col)*/
typedef struct {
    int width;
    int height;
    float* elements;
} Matrix;




//a h w  B h w    C 
void MatMul(const Matrix A, const Matrix B, Matrix C)
{
    for (int i = 0; i < A.height; i++) {
        for (int j = 0; j < B.width; j++) {
            C.elements[i * C.width + j] = 0;
            for (int k = 0; k < A.width; k++) {
                C.elements[i * C.width + j] +=
                    A.elements[i * A.width + k]
                    * B.elements[k * B.width + j];
            }
        }
    }
}


void fill_Matrix(Matrix A)
{
    for (int i = 0; i < A.height ; i++) {
        for (int j = 0; j < A.width; j++) {
            A.elements[i * A.width + j] = rand() / (float)RAND_MAX * 10;
        }
    }
}

void print_Matrix(Matrix A)
{
    /*for (int i = 0; i < A.height; i++) {*/
        /*for (int j = 0; j < A.width; j++) {*/
            /*printf("%4.1f ", A.elements[i * A.width + j]);*/
        /*}*/
        /*printf("\n");*/
    /*}*/
}

int main(int argc, char **argv)
{
    if (argc != 2) {
        printf("usage: n\n");
        return -1;
    }
    int nnn = atoi(argv[1]);

    int n = 1 << nnn;

    srand(time(0));

    Matrix A, B, C;
    A.width = A.height = n;
    A.elements = (float *)malloc(sizeof(float) * n * n);
    B.width = B.height = n;
    B.elements = (float *)malloc(sizeof(float) * n * n);
    C.width = C.height = n;
    C.elements = (float *)malloc(sizeof(float) * n * n);


    fill_Matrix(A);
    print_Matrix(A);
    printf("\n");

    fill_Matrix(B);
    print_Matrix(B);
    printf("\n");

    MatMul(A, B, C);

    print_Matrix(C);

}

	.text
	.file	"mat_c.hip"
	.globl	_Z6MatMul6MatrixS_S_            # -- Begin function _Z6MatMul6MatrixS_S_
	.type	_Z6MatMul6MatrixS_S_,@function
_Z6MatMul6MatrixS_S_:                   # @_Z6MatMul6MatrixS_S_
	.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
	.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	%r9, -8(%rsp)                   # 8-byte Spill
	movq	%rcx, -16(%rsp)                 # 8-byte Spill
	movq	%rsi, -24(%rsp)                 # 8-byte Spill
	movq	%rdi, %rax
	shrq	$32, %rax
	testl	%eax, %eax
	jle	.LBB0_9
# %bb.1:                                # %.preheader.lr.ph
	movslq	%edx, %r10
	movslq	%r8d, %rsi
	movl	%r10d, %r11d
	movl	%edi, %ebx
	shlq	$2, %r10
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
.LBB0_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_4 Depth 2
                                        #       Child Loop BB0_6 Depth 3
	testl	%edx, %edx
	jle	.LBB0_8
# %bb.3:                                # %.lr.ph28
                                        #   in Loop: Header=BB0_2 Depth=1
	movl	%r14d, %ecx
	movq	-24(%rsp), %r8                  # 8-byte Reload
	leaq	(%r8,%rcx,4), %r12
	movq	%r15, %rcx
	imulq	%rsi, %rcx
	movq	-8(%rsp), %r8                   # 8-byte Reload
	leaq	(%r8,%rcx,4), %r13
	movq	-16(%rsp), %rcx                 # 8-byte Reload
	xorl	%r8d, %r8d
.LBB0_4:                                #   Parent Loop BB0_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB0_6 Depth 3
	movl	$0, (%r13,%r8,4)
	testl	%edi, %edi
	jle	.LBB0_7
# %bb.5:                                # %.lr.ph
                                        #   in Loop: Header=BB0_4 Depth=2
	xorps	%xmm0, %xmm0
	movq	%rcx, %rbp
	xorl	%r9d, %r9d
.LBB0_6:                                #   Parent Loop BB0_2 Depth=1
                                        #     Parent Loop BB0_4 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%r12,%r9,4), %xmm1             # xmm1 = mem[0],zero,zero,zero
	mulss	(%rbp), %xmm1
	addss	%xmm1, %xmm0
	movss	%xmm0, (%r13,%r8,4)
	incq	%r9
	addq	%r10, %rbp
	cmpq	%r9, %rbx
	jne	.LBB0_6
.LBB0_7:                                # %._crit_edge
                                        #   in Loop: Header=BB0_4 Depth=2
	incq	%r8
	addq	$4, %rcx
	cmpq	%r11, %r8
	jne	.LBB0_4
.LBB0_8:                                # %._crit_edge29
                                        #   in Loop: Header=BB0_2 Depth=1
	incq	%r15
	addl	%edi, %r14d
	cmpq	%rax, %r15
	jne	.LBB0_2
.LBB0_9:                                # %._crit_edge31
	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	_Z6MatMul6MatrixS_S_, .Lfunc_end0-_Z6MatMul6MatrixS_S_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z11fill_Matrix6Matrix
.LCPI1_0:
	.long	0x30000000                      # float 4.65661287E-10
.LCPI1_1:
	.long	0x41200000                      # float 10
	.text
	.globl	_Z11fill_Matrix6Matrix
	.type	_Z11fill_Matrix6Matrix,@function
_Z11fill_Matrix6Matrix:                 # @_Z11fill_Matrix6Matrix
	.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	%rsi, 8(%rsp)                   # 8-byte Spill
	movq	%rdi, %rax
	shrq	$32, %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	testl	%eax, %eax
	jle	.LBB1_6
# %bb.1:                                # %.preheader.lr.ph
	movq	%rdi, %r14
	movl	%r14d, %r12d
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
.LBB1_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_4 Depth 2
	testl	%r14d, %r14d
	jle	.LBB1_5
# %bb.3:                                # %.lr.ph
                                        #   in Loop: Header=BB1_2 Depth=1
	movl	%r13d, %eax
	movq	8(%rsp), %rcx                   # 8-byte Reload
	leaq	(%rcx,%rax,4), %rbx
	xorl	%r15d, %r15d
.LBB1_4:                                #   Parent Loop BB1_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	movss	.LCPI1_0(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	%xmm1, %xmm0
	movss	.LCPI1_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	movss	%xmm0, (%rbx,%r15,4)
	incq	%r15
	cmpq	%r15, %r12
	jne	.LBB1_4
.LBB1_5:                                # %._crit_edge
                                        #   in Loop: Header=BB1_2 Depth=1
	incq	%rbp
	addl	%r14d, %r13d
	cmpq	16(%rsp), %rbp                  # 8-byte Folded Reload
	jne	.LBB1_2
.LBB1_6:                                # %._crit_edge10
	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	_Z11fill_Matrix6Matrix, .Lfunc_end1-_Z11fill_Matrix6Matrix
	.cfi_endproc
                                        # -- End function
	.globl	_Z12print_Matrix6Matrix         # -- Begin function _Z12print_Matrix6Matrix
	.type	_Z12print_Matrix6Matrix,@function
_Z12print_Matrix6Matrix:                # @_Z12print_Matrix6Matrix
	.cfi_startproc
# %bb.0:
	retq
.Lfunc_end2:
	.size	_Z12print_Matrix6Matrix, .Lfunc_end2-_Z12print_Matrix6Matrix
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.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
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	cmpl	$2, %edi
	jne	.LBB3_1
# %bb.2:
	movq	8(%rsi), %rdi
	callq	atoi
	movl	%eax, %ebp
	movl	$1, %r15d
	movl	%ebp, %ecx
	shll	%cl, %r15d
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	callq	srand
	movabsq	$4294967297, %r14               # imm = 0x100000001
	movl	%ebp, %ecx
	shlq	%cl, %r14
	movslq	%r15d, %r12
	imulq	%r12, %r12
	shlq	$2, %r12
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %r13
	movq	%r12, %rdi
	callq	malloc
	movq	%rax, %r12
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_Z11fill_Matrix6Matrix
	movl	$10, %edi
	callq	putchar@PLT
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_Z11fill_Matrix6Matrix
	movl	$10, %edi
	callq	putchar@PLT
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movq	%r13, %rcx
	movq	%r14, %r8
	movq	%r12, %r9
	callq	_Z6MatMul6MatrixS_S_
	jmp	.LBB3_3
.LBB3_1:
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$-1, %ebx
.LBB3_3:
	movl	%ebx, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	main, .Lfunc_end3-main
	.cfi_endproc
                                        # -- End function
	.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	"usage: n"
	.size	.Lstr, 9

	.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
