	.file	"34660.c"
	.intel_syntax noprefix
	.text
	.globl	read_timer
	.type	read_timer, @function
read_timer:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -32[rbp]
	mov	rdi, rax
	call	ftime@PLT
	mov	rax, QWORD PTR -32[rbp]
	pxor	xmm1, xmm1
	cvtsi2sd	xmm1, rax
	movzx	eax, WORD PTR -24[rbp]
	movzx	eax, ax
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, eax
	movsd	xmm2, QWORD PTR .LC0[rip]
	divsd	xmm0, xmm2
	addsd	xmm0, xmm1
	movq	rax, xmm0
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	movq	xmm0, rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	read_timer, .-read_timer
	.globl	read_timer_ms
	.type	read_timer_ms, @function
read_timer_ms:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -32[rbp]
	mov	rdi, rax
	call	ftime@PLT
	mov	rax, QWORD PTR -32[rbp]
	pxor	xmm1, xmm1
	cvtsi2sd	xmm1, rax
	movsd	xmm0, QWORD PTR .LC0[rip]
	mulsd	xmm1, xmm0
	movzx	eax, WORD PTR -24[rbp]
	movzx	eax, ax
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, eax
	addsd	xmm0, xmm1
	movq	rax, xmm0
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	movq	xmm0, rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	read_timer_ms, .-read_timer_ms
	.globl	init
	.type	init, @function
init:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -4[rbp], 0
	jmp	.L8
.L9:
	call	drand48@PLT
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	cvtsd2ss	xmm0, xmm0
	movss	DWORD PTR [rax], xmm0
	add	DWORD PTR -4[rbp], 1
.L8:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jl	.L9
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	init, .-init
	.section	.rodata
	.align 8
.LC1:
	.string	"Usage: assignment1 <n> <m> (default %d)\n"
	.align 8
.LC2:
	.string	"======================================================================================================"
.LC3:
	.string	"\tN: %d, M: %d, K: %d\n"
	.align 8
.LC4:
	.string	"------------------------------------------------------------------------------------------------------"
	.align 8
.LC5:
	.string	"Performance:\t\t\t\tRuntime (ms)\t MFLOPS "
	.align 8
.LC7:
	.string	"matrix addition row row:\t\t%4f\t%4f\n"
	.align 8
.LC8:
	.string	"matrix addition row col:\t\t%4f\t%4f\n"
	.align 8
.LC9:
	.string	"matrix addition col row:\t\t%4f\t%4f\n"
	.align 8
.LC10:
	.string	"matrix addition col col:\t\t%4f\t%4f\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	DWORD PTR -64[rbp], 512
	cmp	DWORD PTR -68[rbp], 2
	jg	.L11
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -64[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -64[rbp], eax
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -60[rbp], eax
	mov	eax, DWORD PTR -64[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	imul	rax, rdx
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -56[rbp], rax
	mov	eax, DWORD PTR -64[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	imul	rax, rdx
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -48[rbp], rax
	mov	eax, DWORD PTR -64[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	imul	rax, rdx
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	edi, 4096
	call	srand48@PLT
	mov	eax, DWORD PTR -64[rbp]
	imul	eax, DWORD PTR -60[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -56[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	init
	mov	eax, DWORD PTR -64[rbp]
	imul	eax, DWORD PTR -60[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -48[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	init
	mov	eax, 0
	call	read_timer
	movq	rax, xmm0
	mov	QWORD PTR -32[rbp], rax
	mov	rdi, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -56[rbp]
	mov	esi, DWORD PTR -60[rbp]
	mov	eax, DWORD PTR -64[rbp]
	sub	rsp, 8
	push	1
	mov	r9d, 1
	mov	r8, rdi
	mov	edi, eax
	call	matrix_addition
	add	rsp, 16
	mov	eax, 0
	call	read_timer
	movq	rax, xmm0
	movq	xmm0, rax
	subsd	xmm0, QWORD PTR -32[rbp]
	movsd	QWORD PTR -32[rbp], xmm0
	mov	eax, 0
	call	read_timer
	movq	rax, xmm0
	mov	QWORD PTR -24[rbp], rax
	mov	rdi, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -56[rbp]
	mov	esi, DWORD PTR -60[rbp]
	mov	eax, DWORD PTR -64[rbp]
	sub	rsp, 8
	push	0
	mov	r9d, 1
	mov	r8, rdi
	mov	edi, eax
	call	matrix_addition
	add	rsp, 16
	mov	eax, 0
	call	read_timer
	movq	rax, xmm0
	movq	xmm0, rax
	subsd	xmm0, QWORD PTR -24[rbp]
	movsd	QWORD PTR -24[rbp], xmm0
	mov	eax, 0
	call	read_timer
	movq	rax, xmm0
	mov	QWORD PTR -16[rbp], rax
	mov	rdi, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -56[rbp]
	mov	esi, DWORD PTR -60[rbp]
	mov	eax, DWORD PTR -64[rbp]
	sub	rsp, 8
	push	1
	mov	r9d, 0
	mov	r8, rdi
	mov	edi, eax
	call	matrix_addition
	add	rsp, 16
	mov	eax, 0
	call	read_timer
	movq	rax, xmm0
	movq	xmm0, rax
	subsd	xmm0, QWORD PTR -16[rbp]
	movsd	QWORD PTR -16[rbp], xmm0
	mov	eax, 0
	call	read_timer
	movq	rax, xmm0
	mov	QWORD PTR -8[rbp], rax
	mov	rdi, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -56[rbp]
	mov	esi, DWORD PTR -60[rbp]
	mov	eax, DWORD PTR -64[rbp]
	sub	rsp, 8
	push	0
	mov	r9d, 0
	mov	r8, rdi
	mov	edi, eax
	call	matrix_addition
	add	rsp, 16
	mov	eax, 0
	call	read_timer
	movq	rax, xmm0
	movq	xmm0, rax
	subsd	xmm0, QWORD PTR -8[rbp]
	movsd	QWORD PTR -8[rbp], xmm0
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	ecx, DWORD PTR -64[rbp]
	mov	edx, DWORD PTR -60[rbp]
	mov	eax, DWORD PTR -64[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -60[rbp]
	imul	eax, DWORD PTR -64[rbp]
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, eax
	movsd	xmm2, QWORD PTR -32[rbp]
	movsd	xmm1, QWORD PTR .LC6[rip]
	mulsd	xmm1, xmm2
	movapd	xmm2, xmm0
	divsd	xmm2, xmm1
	movsd	xmm1, QWORD PTR -32[rbp]
	movsd	xmm0, QWORD PTR .LC0[rip]
	mulsd	xmm1, xmm0
	movq	rax, xmm1
	movapd	xmm1, xmm2
	movq	xmm0, rax
	lea	rdi, .LC7[rip]
	mov	eax, 2
	call	printf@PLT
	mov	eax, DWORD PTR -60[rbp]
	imul	eax, DWORD PTR -64[rbp]
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, eax
	movsd	xmm2, QWORD PTR -24[rbp]
	movsd	xmm1, QWORD PTR .LC6[rip]
	mulsd	xmm1, xmm2
	movapd	xmm2, xmm0
	divsd	xmm2, xmm1
	movsd	xmm1, QWORD PTR -24[rbp]
	movsd	xmm0, QWORD PTR .LC0[rip]
	mulsd	xmm1, xmm0
	movq	rax, xmm1
	movapd	xmm1, xmm2
	movq	xmm0, rax
	lea	rdi, .LC8[rip]
	mov	eax, 2
	call	printf@PLT
	mov	eax, DWORD PTR -60[rbp]
	imul	eax, DWORD PTR -64[rbp]
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, eax
	movsd	xmm2, QWORD PTR -16[rbp]
	movsd	xmm1, QWORD PTR .LC6[rip]
	mulsd	xmm1, xmm2
	movapd	xmm2, xmm0
	divsd	xmm2, xmm1
	movsd	xmm1, QWORD PTR -16[rbp]
	movsd	xmm0, QWORD PTR .LC0[rip]
	mulsd	xmm1, xmm0
	movq	rax, xmm1
	movapd	xmm1, xmm2
	movq	xmm0, rax
	lea	rdi, .LC9[rip]
	mov	eax, 2
	call	printf@PLT
	mov	eax, DWORD PTR -60[rbp]
	imul	eax, DWORD PTR -64[rbp]
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, eax
	movsd	xmm2, QWORD PTR -8[rbp]
	movsd	xmm1, QWORD PTR .LC6[rip]
	mulsd	xmm1, xmm2
	movapd	xmm2, xmm0
	divsd	xmm2, xmm1
	movsd	xmm1, QWORD PTR -8[rbp]
	movsd	xmm0, QWORD PTR .LC0[rip]
	mulsd	xmm1, xmm0
	movq	rax, xmm1
	movapd	xmm1, xmm2
	movq	xmm0, rax
	lea	rdi, .LC10[rip]
	mov	eax, 2
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.globl	matrix_addition
	.type	matrix_addition, @function
matrix_addition:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -36[rbp], edi
	mov	DWORD PTR -40[rbp], esi
	mov	QWORD PTR -48[rbp], rdx
	mov	QWORD PTR -56[rbp], rcx
	mov	QWORD PTR -64[rbp], r8
	mov	DWORD PTR -68[rbp], r9d
	cmp	DWORD PTR -68[rbp], 0
	je	.L14
	cmp	DWORD PTR 16[rbp], 0
	je	.L14
	mov	DWORD PTR -28[rbp], 0
	jmp	.L15
.L18:
	mov	DWORD PTR -24[rbp], 0
	jmp	.L16
.L17:
	mov	eax, DWORD PTR -28[rbp]
	imul	eax, DWORD PTR -40[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -24[rbp]
	add	eax, edx
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	movss	xmm1, DWORD PTR [rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	movss	xmm0, DWORD PTR [rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	addss	xmm0, xmm1
	movss	DWORD PTR [rax], xmm0
	add	DWORD PTR -24[rbp], 1
.L16:
	mov	eax, DWORD PTR -24[rbp]
	cmp	eax, DWORD PTR -40[rbp]
	jl	.L17
	add	DWORD PTR -28[rbp], 1
.L15:
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jl	.L18
	jmp	.L13
.L14:
	cmp	DWORD PTR -68[rbp], 0
	je	.L13
	cmp	DWORD PTR 16[rbp], 0
	jne	.L13
	mov	DWORD PTR -20[rbp], 0
	jmp	.L20
.L23:
	mov	DWORD PTR -16[rbp], 0
	jmp	.L21
.L22:
	mov	eax, DWORD PTR -20[rbp]
	imul	eax, DWORD PTR -40[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -16[rbp]
	add	eax, edx
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	imul	eax, DWORD PTR -36[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -20[rbp]
	add	eax, edx
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	movss	xmm1, DWORD PTR [rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	movss	xmm0, DWORD PTR [rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	addss	xmm0, xmm1
	movss	DWORD PTR [rax], xmm0
	add	DWORD PTR -16[rbp], 1
.L21:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -40[rbp]
	jl	.L22
	add	DWORD PTR -20[rbp], 1
.L20:
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jl	.L23
	nop
.L13:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	matrix_addition, .-matrix_addition
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1083129856
	.align 8
.LC6:
	.long	0
	.long	1093567616
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"34660.c"
	.text
	.global	__aeabi_i2d
	.global	__aeabi_ui2d
	.global	__aeabi_ddiv
	.global	__aeabi_dadd
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read_timer
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_timer, %function
read_timer:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #16
	ldr	r3, .L4
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #28
	mov	r0, r3
	bl	ftime
	ldr	r3, [fp, #-28]
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r4, r0
	mov	r5, r1
	ldrh	r3, [fp, #-24]
	mov	r0, r3
	bl	__aeabi_ui2d
	mov	r2, #0
	ldr	r3, .L4+4
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_dadd
	mov	r2, r0
	mov	r3, r1
	ldr	r1, .L4
	ldr	r0, [r1]
	ldr	r1, [fp, #-16]
	eors	r0, r1, r0
	mov	r1, #0
	beq	.L3
	bl	__stack_chk_fail
.L3:
	mov	r0, r2
	mov	r1, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L5:
	.align	2
.L4:
	.word	.LC0
	.word	1083129856
	.size	read_timer, .-read_timer
	.global	__aeabi_dmul
	.section	.rodata
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read_timer_ms
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_timer_ms, %function
read_timer_ms:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #16
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #28
	mov	r0, r3
	bl	ftime
	ldr	r3, [fp, #-28]
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, #0
	ldr	r3, .L9+4
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r4, r2
	mov	r5, r3
	ldrh	r3, [fp, #-24]
	mov	r0, r3
	bl	__aeabi_ui2d
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_dadd
	mov	r2, r0
	mov	r3, r1
	ldr	r1, .L9
	ldr	r0, [r1]
	ldr	r1, [fp, #-16]
	eors	r0, r1, r0
	mov	r1, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	mov	r0, r2
	mov	r1, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC1
	.word	1083129856
	.size	read_timer_ms, .-read_timer_ms
	.global	__aeabi_d2f
	.align	2
	.global	init
	.syntax unified
	.arm
	.fpu softvfp
	.type	init, %function
init:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #20
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L12
.L13:
	bl	drand48
	mov	r2, r0
	mov	r3, r1
	ldr	r1, [fp, #-16]
	lsl	r1, r1, #2
	ldr	r0, [fp, #-24]
	add	r4, r0, r1
	mov	r0, r2
	mov	r1, r3
	bl	__aeabi_d2f
	mov	r3, r0
	str	r3, [r4]	@ float
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L12:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	blt	.L13
	nop
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
	.size	init, .-init
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Usage: assignment1 <n> <m> (default %d)\012\000"
	.global	__aeabi_dsub
	.align	2
.LC3:
	.ascii	"==================================================="
	.ascii	"==================================================="
	.ascii	"\000"
	.align	2
.LC4:
	.ascii	"\011N: %d, M: %d, K: %d\012\000"
	.align	2
.LC5:
	.ascii	"---------------------------------------------------"
	.ascii	"---------------------------------------------------"
	.ascii	"\000"
	.align	2
.LC6:
	.ascii	"Performance:\011\011\011\011Runtime (ms)\011 MFLOPS"
	.ascii	" \000"
	.align	2
.LC7:
	.ascii	"matrix addition row row:\011\011%4f\011%4f\012\000"
	.align	2
.LC8:
	.ascii	"matrix addition row col:\011\011%4f\011%4f\012\000"
	.align	2
.LC9:
	.ascii	"matrix addition col row:\011\011%4f\011%4f\012\000"
	.align	2
.LC10:
	.ascii	"matrix addition col col:\011\011%4f\011%4f\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, fp, lr}
	add	fp, sp, #20
	sub	sp, sp, #80
	str	r0, [fp, #-80]
	str	r1, [fp, #-84]
	mov	r3, #512
	str	r3, [fp, #-72]
	ldr	r3, [fp, #-80]
	cmp	r3, #2
	bgt	.L15
	ldr	r3, .L17
	ldr	r3, [r3]
	ldr	r2, [fp, #-72]
	ldr	r1, .L17+4
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L15:
	ldr	r3, [fp, #-84]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-72]
	ldr	r3, [fp, #-84]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-68]
	ldr	r3, [fp, #-72]
	ldr	r2, [fp, #-68]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-72]
	ldr	r2, [fp, #-68]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-60]
	ldr	r3, [fp, #-72]
	ldr	r2, [fp, #-68]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-56]
	mov	r0, #4096
	bl	srand48
	ldr	r3, [fp, #-72]
	ldr	r2, [fp, #-68]
	mul	r3, r2, r3
	mov	r1, r3
	ldr	r0, [fp, #-64]
	bl	init
	ldr	r3, [fp, #-72]
	ldr	r2, [fp, #-68]
	mul	r3, r2, r3
	mov	r1, r3
	ldr	r0, [fp, #-60]
	bl	init
	bl	read_timer
	str	r0, [fp, #-52]
	str	r1, [fp, #-48]
	mov	r3, #1
	str	r3, [sp, #8]
	mov	r3, #1
	str	r3, [sp, #4]
	ldr	r3, [fp, #-56]
	str	r3, [sp]
	ldr	r3, [fp, #-60]
	ldr	r2, [fp, #-64]
	ldr	r1, [fp, #-68]
	ldr	r0, [fp, #-72]
	bl	matrix_addition
	bl	read_timer
	sub	r3, fp, #52
	ldmia	r3, {r2-r3}
	bl	__aeabi_dsub
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-52]
	str	r3, [fp, #-48]
	bl	read_timer
	str	r0, [fp, #-44]
	str	r1, [fp, #-40]
	mov	r3, #0
	str	r3, [sp, #8]
	mov	r3, #1
	str	r3, [sp, #4]
	ldr	r3, [fp, #-56]
	str	r3, [sp]
	ldr	r3, [fp, #-60]
	ldr	r2, [fp, #-64]
	ldr	r1, [fp, #-68]
	ldr	r0, [fp, #-72]
	bl	matrix_addition
	bl	read_timer
	sub	r3, fp, #44
	ldmia	r3, {r2-r3}
	bl	__aeabi_dsub
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
	bl	read_timer
	str	r0, [fp, #-36]
	str	r1, [fp, #-32]
	mov	r3, #1
	str	r3, [sp, #8]
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-56]
	str	r3, [sp]
	ldr	r3, [fp, #-60]
	ldr	r2, [fp, #-64]
	ldr	r1, [fp, #-68]
	ldr	r0, [fp, #-72]
	bl	matrix_addition
	bl	read_timer
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	bl	__aeabi_dsub
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-36]
	str	r3, [fp, #-32]
	bl	read_timer
	str	r0, [fp, #-28]
	str	r1, [fp, #-24]
	mov	r3, #0
	str	r3, [sp, #8]
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-56]
	str	r3, [sp]
	ldr	r3, [fp, #-60]
	ldr	r2, [fp, #-64]
	ldr	r1, [fp, #-68]
	ldr	r0, [fp, #-72]
	bl	matrix_addition
	bl	read_timer
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
	bl	__aeabi_dsub
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-28]
	str	r3, [fp, #-24]
	ldr	r0, [fp, #-64]
	bl	free
	ldr	r0, [fp, #-60]
	bl	free
	ldr	r0, [fp, #-56]
	bl	free
	ldr	r0, .L17+8
	bl	puts
	ldr	r3, [fp, #-72]
	ldr	r2, [fp, #-68]
	ldr	r1, [fp, #-72]
	ldr	r0, .L17+12
	bl	printf
	ldr	r0, .L17+16
	bl	puts
	ldr	r0, .L17+20
	bl	puts
	ldr	r0, .L17+16
	bl	puts
	mov	r2, #0
	ldr	r3, .L17+24
	sub	r1, fp, #52
	ldmia	r1, {r0-r1}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r6, r2
	mov	r7, r3
	ldr	r3, [fp, #-68]
	ldr	r2, [fp, #-72]
	mul	r3, r2, r3
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r4, r0
	mov	r5, r1
	mov	r2, #0
	ldr	r3, .L17+28
	sub	r1, fp, #52
	ldmia	r1, {r0-r1}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	stm	sp, {r2-r3}
	mov	r2, r6
	mov	r3, r7
	ldr	r0, .L17+32
	bl	printf
	mov	r2, #0
	ldr	r3, .L17+24
	sub	r1, fp, #44
	ldmia	r1, {r0-r1}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r6, r2
	mov	r7, r3
	ldr	r3, [fp, #-68]
	ldr	r2, [fp, #-72]
	mul	r3, r2, r3
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r4, r0
	mov	r5, r1
	mov	r2, #0
	ldr	r3, .L17+28
	sub	r1, fp, #44
	ldmia	r1, {r0-r1}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	stm	sp, {r2-r3}
	mov	r2, r6
	mov	r3, r7
	ldr	r0, .L17+36
	bl	printf
	mov	r2, #0
	ldr	r3, .L17+24
	sub	r1, fp, #36
	ldmia	r1, {r0-r1}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r6, r2
	mov	r7, r3
	ldr	r3, [fp, #-68]
	ldr	r2, [fp, #-72]
	mul	r3, r2, r3
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r4, r0
	mov	r5, r1
	mov	r2, #0
	ldr	r3, .L17+28
	sub	r1, fp, #36
	ldmia	r1, {r0-r1}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	stm	sp, {r2-r3}
	mov	r2, r6
	mov	r3, r7
	ldr	r0, .L17+40
	bl	printf
	mov	r2, #0
	ldr	r3, .L17+24
	sub	r1, fp, #28
	ldmia	r1, {r0-r1}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r6, r2
	mov	r7, r3
	ldr	r3, [fp, #-68]
	ldr	r2, [fp, #-72]
	mul	r3, r2, r3
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r4, r0
	mov	r5, r1
	mov	r2, #0
	ldr	r3, .L17+28
	sub	r1, fp, #28
	ldmia	r1, {r0-r1}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	stm	sp, {r2-r3}
	mov	r2, r6
	mov	r3, r7
	ldr	r0, .L17+44
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, fp, pc}
.L18:
	.align	2
.L17:
	.word	stderr
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	1083129856
	.word	1093567616
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.global	__aeabi_fadd
	.align	2
	.global	matrix_addition
	.syntax unified
	.arm
	.fpu softvfp
	.type	matrix_addition, %function
matrix_addition:
	@ args = 12, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #52
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	str	r2, [fp, #-56]
	str	r3, [fp, #-60]
	ldr	r3, [fp, #8]
	cmp	r3, #0
	beq	.L20
	ldr	r3, [fp, #12]
	cmp	r3, #0
	beq	.L20
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L21
.L24:
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L22
.L23:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-52]
	mul	r3, r2, r3
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r0, [r3]	@ float
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-60]
	add	r3, r2, r3
	ldr	r1, [r3]	@ float
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #4]
	add	r4, r2, r3
	bl	__aeabi_fadd
	mov	r3, r0
	str	r3, [r4]	@ float
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L22:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-52]
	cmp	r2, r3
	blt	.L23
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L21:
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-48]
	cmp	r2, r3
	blt	.L24
	b	.L19
.L20:
	ldr	r3, [fp, #8]
	cmp	r3, #0
	beq	.L19
	ldr	r3, [fp, #12]
	cmp	r3, #0
	bne	.L19
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L26
.L29:
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L27
.L28:
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-52]
	mul	r3, r2, r3
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-48]
	mul	r3, r2, r3
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r0, [r3]	@ float
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-60]
	add	r3, r2, r3
	ldr	r1, [r3]	@ float
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #4]
	add	r4, r2, r3
	bl	__aeabi_fadd
	mov	r3, r0
	str	r3, [r4]	@ float
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L27:
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-52]
	cmp	r2, r3
	blt	.L28
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L26:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-48]
	cmp	r2, r3
	blt	.L29
	nop
.L19:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
	.size	matrix_addition, .-matrix_addition
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
