#include <stdio.h>

//constant for architecture
int SEED = 12; //seed for rand //old was 15
int DIM_LIM = 300; //max size of a matrix
double INIT_VAL = 0.1; //initial value of matrix
int MAT_COUNT = 10000; //


/* file format


ndicate the size of array A)
n_1 n_2 n_3... n_k (k numbers in a single line indicate the dimensions of matrices)
n_1 by n_2 matrix 1 (n_1 rows, each row contains n_2 doubles)
n_2 by n_3 matrix 2 (n_2 rows, each row contains n_3 doubles)
...
n_{k-1} by n_k matrix k-1

*/



double randMToN(double M, double N)
{
    return M + (rand() / ( RAND_MAX / (N-M) ) ) ;  
}

void gen_matrix(int rows, int cols, FILE *fp){
    for(int i = 0; i < rows; i++){//each row as outer loop
        for(int j = 0; j < cols; j++){ //each element in row, across all columns
            //fprintf(fp, "%f ", floor(randMToN(1,INIT_VAL))); //print space after each value
            //fprintf(fp, "%f ", randMToN(0,INIT_VAL)); //print space after each value
            fprintf(fp, "%f ", INIT_VAL); //print space after each value
            //fprintf(fp, "%f ", INIT_VAL); //print space after each value
        }
        //print newline after each row.
        fprintf(fp, "\n");
    }
}







int main(int argc, char *argv[]){

    if(argc == 3){
        INIT_VAL = atof(argv[1]);
        MAT_COUNT = atoi(argv[2]);
        printf("main: %d matrices of initial value is %f\n", MAT_COUNT, INIT_VAL);
    } else {
        printf("incorrect input values, must be max initial value, and number of matrices");
        return -1;
    }

	
    //initialize random number gen, get array sizes
    srand(SEED); //init random gen
    int dim[MAT_COUNT + 1]; //stores matrix sizes
    for(int z = 0; z <= MAT_COUNT; z++){
        dim[z] = rand()%DIM_LIM + 1;//random between 1 and limit
    }

    const char* filename = "input.txt";
    FILE *fp = fopen(filename, "w");
    fprintf(fp, "%d\n", MAT_COUNT + 1); //count of arrays
    for(int i = 0; i < MAT_COUNT + 1; i++){
        fprintf(fp, "%d ", dim[i]);
    }
    //print newline after each row.
    fprintf(fp, "\n");

    for(int i = 0; i < MAT_COUNT; i++){
        gen_matrix(dim[i], dim[i+1], fp);
    }


}

	.file	"tmpxft_003aad5d_00000000-6_gen_file.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2032:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2032:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z8randMToNdd
	.type	_Z8randMToNdd, @function
_Z8randMToNdd:
.LFB2027:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movsd	%xmm0, 8(%rsp)
	movsd	%xmm1, (%rsp)
	call	rand@PLT
	movsd	8(%rsp), %xmm2
	movsd	(%rsp), %xmm1
	movsd	.LC0(%rip), %xmm3
	cvtsi2sdl	%eax, %xmm0
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	subsd	%xmm2, %xmm1
	divsd	%xmm1, %xmm3
	divsd	%xmm3, %xmm0
	addsd	%xmm2, %xmm0
	ret
	.cfi_endproc
.LFE2027:
	.size	_Z8randMToNdd, .-_Z8randMToNdd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%f "
.LC2:
	.string	"\n"
	.text
	.globl	_Z10gen_matrixiiP8_IO_FILE
	.type	_Z10gen_matrixiiP8_IO_FILE, @function
_Z10gen_matrixiiP8_IO_FILE:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%esi, %r13d
	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
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdx, %rbx
	pushq	%rcx
	.cfi_def_cfa_offset 64
.L5:
	cmpl	%ebp, %r12d
	jge	.L11
	xorl	%r14d, %r14d
.L7:
	cmpl	%r13d, %r14d
	jge	.L12
	movsd	INIT_VAL(%rip), %xmm0
	movq	%r15, %rdx
	movq	%rbx, %rdi
	movb	$1, %al
	movl	$2, %esi
	incl	%r14d
	call	__fprintf_chk@PLT
	jmp	.L7
.L12:
	leaq	.LC2(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	incl	%r12d
	movl	$2, %esi
	call	__fprintf_chk@PLT
	jmp	.L5
.L11:
	popq	%rax
	.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	_Z10gen_matrixiiP8_IO_FILE, .-_Z10gen_matrixiiP8_IO_FILE
	.section	.rodata.str1.1
.LC3:
	.string	"main: %d matrices of initial value is %f\n"
.LC4:
	.string	"incorrect input values, must be max initial value, and number of matrices"
.LC5:
	.string	"w"
.LC6:
	.string	"input.txt"
.LC7:
	.string	"%d\n"
.LC8:
	.string	"%d "
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 14, -24
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	cmpl	$3, %edi
	jne	.L14
	movq	8(%rsi), %rdi
	movq	%rsi, %rbx
	call	atof@PLT
	movq	16(%rbx), %rdi
	movsd	%xmm0, INIT_VAL(%rip)
	movsd	%xmm0, -56(%rbp)
	call	atoi@PLT
	movsd	-56(%rbp), %xmm0
	movl	$2, %edi
	leaq	.LC3(%rip), %rsi
	movl	%eax, %edx
	movl	%eax, MAT_COUNT(%rip)
	movb	$1, %al
	call	__printf_chk@PLT
	movl	SEED(%rip), %edi
	call	srand@PLT
	movl	MAT_COUNT(%rip), %eax
	movq	%rsp, %rcx
	incl	%eax
	cltq
	leaq	15(,%rax,4), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L15:
	cmpq	%rcx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L17
	orq	$0, -8(%rsp,%rax)
.L17:
	movq	%rsp, %r13
	xorl	%ebx, %ebx
	jmp	.L18
.L14:
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	orl	$-1, %eax
	jmp	.L13
.L18:
	cmpl	%ebx, MAT_COUNT(%rip)
	jl	.L30
	call	rand@PLT
	cltd
	idivl	DIM_LIM(%rip)
	incl	%edx
	movl	%edx, 0(%r13,%rbx,4)
	incq	%rbx
	jmp	.L18
.L30:
	leaq	.LC5(%rip), %rsi
	leaq	.LC6(%rip), %rdi
	xorl	%r12d, %r12d
	call	fopen@PLT
	leaq	.LC7(%rip), %rdx
	movl	$2, %esi
	leaq	.LC8(%rip), %r14
	movq	%rax, %rbx
	movl	MAT_COUNT(%rip), %eax
	movq	%rbx, %rdi
	leal	1(%rax), %ecx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
.L21:
	cmpl	%r12d, MAT_COUNT(%rip)
	jl	.L31
	movl	0(%r13,%r12,4), %ecx
	movq	%r14, %rdx
	movl	$2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	incq	%r12
	call	__fprintf_chk@PLT
	jmp	.L21
.L31:
	leaq	.LC2(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	movl	$2, %esi
	call	__fprintf_chk@PLT
.L23:
	cmpl	%r12d, MAT_COUNT(%rip)
	jle	.L32
	movl	4(%r13,%r12,4), %esi
	movl	0(%r13,%r12,4), %edi
	movq	%rbx, %rdx
	incq	%r12
	call	_Z10gen_matrixiiP8_IO_FILE
	jmp	.L23
.L32:
	xorl	%eax, %eax
.L13:
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2029:
	.size	main, .-main
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2055:
	.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
.LFE2055:
	.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
	.globl	MAT_COUNT
	.data
	.align 4
	.type	MAT_COUNT, @object
	.size	MAT_COUNT, 4
MAT_COUNT:
	.long	10000
	.globl	INIT_VAL
	.align 8
	.type	INIT_VAL, @object
	.size	INIT_VAL, 8
INIT_VAL:
	.long	-1717986918
	.long	1069128089
	.globl	DIM_LIM
	.align 4
	.type	DIM_LIM, @object
	.size	DIM_LIM, 4
DIM_LIM:
	.long	300
	.globl	SEED
	.align 4
	.type	SEED, @object
	.size	SEED, 4
SEED:
	.long	12
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	-4194304
	.long	1105199103
	.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>

//constant for architecture
int SEED = 12; //seed for rand //old was 15
int DIM_LIM = 300; //max size of a matrix
double INIT_VAL = 0.1; //initial value of matrix
int MAT_COUNT = 10000; //


/* file format


ndicate the size of array A)
n_1 n_2 n_3... n_k (k numbers in a single line indicate the dimensions of matrices)
n_1 by n_2 matrix 1 (n_1 rows, each row contains n_2 doubles)
n_2 by n_3 matrix 2 (n_2 rows, each row contains n_3 doubles)
...
n_{k-1} by n_k matrix k-1

*/



double randMToN(double M, double N)
{
    return M + (rand() / ( RAND_MAX / (N-M) ) ) ;  
}

void gen_matrix(int rows, int cols, FILE *fp){
    for(int i = 0; i < rows; i++){//each row as outer loop
        for(int j = 0; j < cols; j++){ //each element in row, across all columns
            //fprintf(fp, "%f ", floor(randMToN(1,INIT_VAL))); //print space after each value
            //fprintf(fp, "%f ", randMToN(0,INIT_VAL)); //print space after each value
            fprintf(fp, "%f ", INIT_VAL); //print space after each value
            //fprintf(fp, "%f ", INIT_VAL); //print space after each value
        }
        //print newline after each row.
        fprintf(fp, "\n");
    }
}







int main(int argc, char *argv[]){

    if(argc == 3){
        INIT_VAL = atof(argv[1]);
        MAT_COUNT = atoi(argv[2]);
        printf("main: %d matrices of initial value is %f\n", MAT_COUNT, INIT_VAL);
    } else {
        printf("incorrect input values, must be max initial value, and number of matrices");
        return -1;
    }

	
    //initialize random number gen, get array sizes
    srand(SEED); //init random gen
    int dim[MAT_COUNT + 1]; //stores matrix sizes
    for(int z = 0; z <= MAT_COUNT; z++){
        dim[z] = rand()%DIM_LIM + 1;//random between 1 and limit
    }

    const char* filename = "input.txt";
    FILE *fp = fopen(filename, "w");
    fprintf(fp, "%d\n", MAT_COUNT + 1); //count of arrays
    for(int i = 0; i < MAT_COUNT + 1; i++){
        fprintf(fp, "%d ", dim[i]);
    }
    //print newline after each row.
    fprintf(fp, "\n");

    for(int i = 0; i < MAT_COUNT; i++){
        gen_matrix(dim[i], dim[i+1], fp);
    }


}

	.text
	.file	"gen_file.hip"
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z8randMToNdd
.LCPI0_0:
	.quad	0x41dfffffffc00000              # double 2147483647
	.text
	.globl	_Z8randMToNdd
	.type	_Z8randMToNdd,@function
_Z8randMToNdd:                          # @_Z8randMToNdd
	.cfi_startproc
# %bb.0:
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movsd	%xmm1, 16(%rsp)                 # 8-byte Spill
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	movsd	8(%rsp), %xmm2                  # 8-byte Reload
                                        # xmm2 = mem[0],zero
	movsd	16(%rsp), %xmm3                 # 8-byte Reload
                                        # xmm3 = mem[0],zero
	subsd	%xmm2, %xmm3
	movsd	.LCPI0_0(%rip), %xmm1           # xmm1 = mem[0],zero
	divsd	%xmm3, %xmm1
	divsd	%xmm1, %xmm0
	addsd	%xmm2, %xmm0
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z8randMToNdd, .Lfunc_end0-_Z8randMToNdd
	.cfi_endproc
                                        # -- End function
	.globl	_Z10gen_matrixiiP8_IO_FILE      # -- Begin function _Z10gen_matrixiiP8_IO_FILE
	.type	_Z10gen_matrixiiP8_IO_FILE,@function
_Z10gen_matrixiiP8_IO_FILE:             # @_Z10gen_matrixiiP8_IO_FILE
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jle	.LBB1_5
# %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	%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	%rdx, %rbx
	movl	%esi, %ebp
	movl	%edi, %r14d
	xorl	%r15d, %r15d
.LBB1_2:                                # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_6 Depth 2
	movl	%ebp, %r12d
	testl	%ebp, %ebp
	jle	.LBB1_3
.LBB1_6:                                # %.lr.ph
                                        #   Parent Loop BB1_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	INIT_VAL(%rip), %xmm0           # xmm0 = mem[0],zero
	movl	$.L.str, %esi
	movq	%rbx, %rdi
	movb	$1, %al
	callq	fprintf
	decl	%r12d
	jne	.LBB1_6
.LBB1_3:                                # %._crit_edge
                                        #   in Loop: Header=BB1_2 Depth=1
	movl	$10, %edi
	movq	%rbx, %rsi
	callq	fputc@PLT
	incl	%r15d
	cmpl	%r14d, %r15d
	jne	.LBB1_2
# %bb.4:
	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
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB1_5:                                # %._crit_edge10
	retq
.Lfunc_end1:
	.size	_Z10gen_matrixiiP8_IO_FILE, .Lfunc_end1-_Z10gen_matrixiiP8_IO_FILE
	.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
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$3, %edi
	jne	.LBB2_11
# %bb.1:
	movq	%rsi, %rbx
	movq	8(%rsi), %rdi
	callq	atof
	movsd	%xmm0, -48(%rbp)                # 8-byte Spill
	movsd	%xmm0, INIT_VAL(%rip)
	movq	16(%rbx), %rdi
	callq	atoi
	movl	%eax, MAT_COUNT(%rip)
	movl	$.L.str.2, %edi
	movl	%eax, %esi
	movsd	-48(%rbp), %xmm0                # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	movl	SEED(%rip), %edi
	callq	srand
	movq	%rsp, %r15
	movl	MAT_COUNT(%rip), %eax
	incl	%eax
	movq	%rsp, %r12
	leaq	15(,%rax,4), %rax
	andq	$-16, %rax
	subq	%rax, %r12
	movq	%r12, %rsp
	cmpl	$0, MAT_COUNT(%rip)
	js	.LBB2_4
# %bb.2:                                # %.lr.ph.preheader
	movq	$-1, %rbx
.LBB2_3:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	cltd
	idivl	DIM_LIM(%rip)
	incl	%edx
	movl	%edx, 4(%r12,%rbx,4)
	movslq	MAT_COUNT(%rip), %rax
	incq	%rbx
	cmpq	%rax, %rbx
	jl	.LBB2_3
.LBB2_4:                                # %._crit_edge
	movl	$.L.str.4, %edi
	movl	$.L.str.5, %esi
	callq	fopen
	movq	%rax, %rbx
	movl	MAT_COUNT(%rip), %edx
	incl	%edx
	movl	$.L.str.6, %esi
	movq	%rax, %rdi
	xorl	%eax, %eax
	callq	fprintf
	cmpl	$0, MAT_COUNT(%rip)
	js	.LBB2_7
# %bb.5:                                # %.lr.ph28.preheader
	movq	$-1, %r14
.LBB2_6:                                # %.lr.ph28
                                        # =>This Inner Loop Header: Depth=1
	movl	4(%r12,%r14,4), %edx
	movl	$.L.str.7, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movslq	MAT_COUNT(%rip), %rax
	incq	%r14
	cmpq	%rax, %r14
	jl	.LBB2_6
.LBB2_7:                                # %._crit_edge29
	movl	$10, %edi
	movq	%rbx, %rsi
	callq	fputc@PLT
	cmpl	$0, MAT_COUNT(%rip)
	jle	.LBB2_10
# %bb.8:                                # %.lr.ph32.preheader
	movl	(%r12), %edi
	xorl	%r13d, %r13d
.LBB2_9:                                # %.lr.ph32
                                        # =>This Inner Loop Header: Depth=1
	movl	4(%r12,%r13,4), %r14d
	incq	%r13
	movl	%r14d, %esi
	movq	%rbx, %rdx
	callq	_Z10gen_matrixiiP8_IO_FILE
	movslq	MAT_COUNT(%rip), %rax
	movl	%r14d, %edi
	cmpq	%rax, %r13
	jl	.LBB2_9
.LBB2_10:                               # %._crit_edge33
	movq	%r15, %rsp
	xorl	%eax, %eax
	jmp	.LBB2_12
.LBB2_11:
	movl	$.L.str.3, %edi
	xorl	%eax, %eax
	callq	printf
	movl	$-1, %eax
.LBB2_12:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
                                        # -- End function
	.type	SEED,@object                    # @SEED
	.data
	.globl	SEED
	.p2align	2, 0x0
SEED:
	.long	12                              # 0xc
	.size	SEED, 4

	.type	DIM_LIM,@object                 # @DIM_LIM
	.globl	DIM_LIM
	.p2align	2, 0x0
DIM_LIM:
	.long	300                             # 0x12c
	.size	DIM_LIM, 4

	.type	INIT_VAL,@object                # @INIT_VAL
	.globl	INIT_VAL
	.p2align	3, 0x0
INIT_VAL:
	.quad	0x3fb999999999999a              # double 0.10000000000000001
	.size	INIT_VAL, 8

	.type	MAT_COUNT,@object               # @MAT_COUNT
	.globl	MAT_COUNT
	.p2align	2, 0x0
MAT_COUNT:
	.long	10000                           # 0x2710
	.size	MAT_COUNT, 4

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"%f "
	.size	.L.str, 4

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"main: %d matrices of initial value is %f\n"
	.size	.L.str.2, 42

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"incorrect input values, must be max initial value, and number of matrices"
	.size	.L.str.3, 74

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"input.txt"
	.size	.L.str.4, 10

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"w"
	.size	.L.str.5, 2

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

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

	.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
