	.file	"184444.c"
	.intel_syntax noprefix
	.text
	.local	lino
	.comm	lino,4,4
	.local	N
	.comm	N,4,4
	.local	array
	.comm	array,8,8
	.local	block_size
	.comm	block_size,4,4
	.local	block_shift
	.comm	block_shift,4,4
	.local	memory_blocks
	.comm	memory_blocks,4,4
	.local	cache_blocks
	.comm	cache_blocks,4,4
	.local	lru_head
	.comm	lru_head,24,16
	.local	cache_nodes
	.comm	cache_nodes,8,8
	.local	block_to_cache
	.comm	block_to_cache,8,8
	.local	cache_accesses
	.comm	cache_accesses,8,8
	.local	cache_misses
	.comm	cache_misses,8,8
	.section	.rodata
.LC0:
	.string	"Error on line %d: %s\n"
	.text
	.type	error, @function
error:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	edx, DWORD PTR lino[rip]
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	error, .-error
	.section	.rodata
.LC1:
	.string	"Out of memory"
	.text
	.type	xmalloc, @function
xmalloc:
.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	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L3
	lea	rdi, .LC1[rip]
	call	error
.L3:
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	xmalloc, .-xmalloc
	.type	pos, @function
pos:
.LFB8:
	.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 -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	mov	eax, DWORD PTR N[rip]
	imul	eax, DWORD PTR -4[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -8[rbp]
	add	eax, edx
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	pos, .-pos
	.section	.rodata
	.align 8
.LC2:
	.string	"Matrices smaller than 4x4 are not supported"
.LC3:
	.string	"Elements: %d\n"
	.text
	.type	matrix_init, @function
matrix_init:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 16
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	eax, DWORD PTR N[rip]
	cmp	eax, 3
	jg	.L8
	lea	rdi, .LC2[rip]
	call	error
.L8:
	mov	edx, DWORD PTR N[rip]
	mov	eax, DWORD PTR N[rip]
	imul	eax, edx
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, DWORD PTR N[rip]
	mov	eax, DWORD PTR N[rip]
	imul	eax, edx
	cdqe
	sal	eax, 2
	mov	edi, eax
	call	xmalloc
	mov	QWORD PTR array[rip], rax
	mov	DWORD PTR -24[rbp], 0
	jmp	.L9
.L12:
	mov	DWORD PTR -20[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR N[rip]
	imul	eax, DWORD PTR -24[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -20[rbp]
	lea	ebx, [rdx+rax]
	mov	r12, QWORD PTR array[rip]
	mov	edx, DWORD PTR -20[rbp]
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, edx
	mov	edi, eax
	call	pos
	cdqe
	sal	rax, 2
	add	rax, r12
	lea	edx, 42[rbx]
	mov	DWORD PTR [rax], edx
	add	DWORD PTR -20[rbp], 1
.L10:
	mov	eax, DWORD PTR N[rip]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L11
	add	DWORD PTR -24[rbp], 1
.L9:
	mov	eax, DWORD PTR N[rip]
	cmp	DWORD PTR -24[rbp], eax
	jl	.L12
	nop
	nop
	add	rsp, 16
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	matrix_init, .-matrix_init
	.section	.rodata
.LC4:
	.string	"Wrong answer"
	.text
	.type	matrix_cleanup, @function
matrix_cleanup:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 24
	.cfi_offset 3, -24
	mov	DWORD PTR -24[rbp], 0
	jmp	.L14
.L18:
	mov	DWORD PTR -20[rbp], 0
	jmp	.L15
.L17:
	mov	rbx, QWORD PTR array[rip]
	mov	edx, DWORD PTR -20[rbp]
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, edx
	mov	edi, eax
	call	pos
	cdqe
	sal	rax, 2
	add	rax, rbx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR N[rip]
	imul	eax, DWORD PTR -20[rbp]
	mov	ecx, eax
	mov	eax, DWORD PTR -24[rbp]
	add	eax, ecx
	add	eax, 42
	cmp	edx, eax
	je	.L16
	lea	rdi, .LC4[rip]
	call	error
.L16:
	add	DWORD PTR -20[rbp], 1
.L15:
	mov	eax, DWORD PTR N[rip]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L17
	add	DWORD PTR -24[rbp], 1
.L14:
	mov	eax, DWORD PTR N[rip]
	cmp	DWORD PTR -24[rbp], eax
	jl	.L18
	mov	rax, QWORD PTR array[rip]
	mov	rdi, rax
	call	free@PLT
	nop
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	matrix_cleanup, .-matrix_cleanup
	.section	.rodata
	.align 8
.LC5:
	.string	"Block size must be at least 4 and a power of 2"
	.align 8
.LC6:
	.string	"Cache must contain at least 2 blocks"
	.text
	.type	cache_init, @function
cache_init:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	eax, DWORD PTR block_size[rip]
	cmp	eax, 3
	jle	.L20
	mov	eax, DWORD PTR block_size[rip]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR block_size[rip]
	and	eax, edx
	test	eax, eax
	je	.L21
.L20:
	lea	rdi, .LC5[rip]
	call	error
.L21:
	mov	eax, DWORD PTR cache_blocks[rip]
	cmp	eax, 1
	jg	.L22
	lea	rdi, .LC6[rip]
	call	error
.L22:
	mov	DWORD PTR block_shift[rip], 1
	jmp	.L23
.L24:
	mov	eax, DWORD PTR block_shift[rip]
	add	eax, 1
	mov	DWORD PTR block_shift[rip], eax
.L23:
	mov	eax, DWORD PTR block_shift[rip]
	mov	edx, 1
	mov	ecx, eax
	sal	edx, cl
	mov	eax, DWORD PTR block_size[rip]
	cmp	edx, eax
	jb	.L24
	mov	edx, DWORD PTR N[rip]
	mov	eax, DWORD PTR N[rip]
	imul	eax, edx
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	eax, DWORD PTR block_size[rip]
	cdqe
	add	rax, rdx
	sub	rax, 1
	mov	edx, DWORD PTR block_size[rip]
	movsx	rsi, edx
	mov	edx, 0
	div	rsi
	mov	DWORD PTR memory_blocks[rip], eax
	mov	eax, DWORD PTR memory_blocks[rip]
	cdqe
	sal	eax, 3
	mov	edi, eax
	call	xmalloc
	mov	QWORD PTR block_to_cache[rip], rax
	mov	DWORD PTR -16[rbp], 0
	jmp	.L25
.L26:
	mov	rdx, QWORD PTR block_to_cache[rip]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	QWORD PTR [rax], 0
	add	DWORD PTR -16[rbp], 1
.L25:
	mov	eax, DWORD PTR memory_blocks[rip]
	cmp	DWORD PTR -16[rbp], eax
	jl	.L26
	lea	rax, lru_head[rip]
	mov	QWORD PTR lru_head[rip+8], rax
	mov	rax, QWORD PTR lru_head[rip+8]
	mov	QWORD PTR lru_head[rip], rax
	mov	eax, DWORD PTR cache_blocks[rip]
	cdqe
	mov	edx, eax
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	sal	eax, 3
	mov	edi, eax
	call	xmalloc
	mov	QWORD PTR cache_nodes[rip], rax
	mov	DWORD PTR -12[rbp], 0
	jmp	.L27
.L28:
	mov	rcx, QWORD PTR cache_nodes[rip]
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 3
	add	rax, rcx
	mov	QWORD PTR -8[rbp], rax
	mov	rdx, QWORD PTR lru_head[rip]
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, lru_head[rip]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 16[rax], -1
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], rdx
	add	DWORD PTR -12[rbp], 1
.L27:
	mov	eax, DWORD PTR cache_blocks[rip]
	cmp	DWORD PTR -12[rbp], eax
	jl	.L28
	mov	QWORD PTR cache_accesses[rip], 0
	mov	QWORD PTR cache_misses[rip], 0
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	cache_init, .-cache_init
	.section	.rodata
	.align 8
.LC7:
	.string	"Internal error: cache_access out of cache"
	.text
	.type	cache_access, @function
cache_access:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	DWORD PTR -36[rbp], edi
	mov	eax, DWORD PTR -36[rbp]
	lea	edx, 0[0+rax*4]
	mov	eax, DWORD PTR block_shift[rip]
	mov	ecx, eax
	sar	edx, cl
	mov	eax, edx
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	js	.L30
	mov	eax, DWORD PTR memory_blocks[rip]
	cmp	DWORD PTR -28[rbp], eax
	jl	.L31
.L30:
	lea	rdi, .LC7[rip]
	call	error
.L31:
	mov	rax, QWORD PTR cache_accesses[rip]
	add	rax, 1
	mov	QWORD PTR cache_accesses[rip], rax
	mov	rdx, QWORD PTR block_to_cache[rip]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L32
	mov	rax, QWORD PTR lru_head[rip+8]
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 16[rax]
	test	eax, eax
	js	.L33
	mov	rdx, QWORD PTR block_to_cache[rip]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 16[rax]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	QWORD PTR [rax], 0
.L33:
	mov	rdx, QWORD PTR block_to_cache[rip]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 3
	add	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR -28[rbp]
	mov	DWORD PTR 16[rax], edx
	mov	rax, QWORD PTR cache_misses[rip]
	add	rax, 1
	mov	QWORD PTR cache_misses[rip], rax
.L32:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rdx, QWORD PTR lru_head[rip]
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, lru_head[rip]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR [rax], rdx
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	cache_access, .-cache_access
	.section	.rodata
.LC8:
	.string	"Accesses: %lld\n"
.LC9:
	.string	"Misses: %lld\n"
.LC10:
	.string	"Missed-bytes: %lld\n"
	.text
	.type	cache_cleanup, @function
cache_cleanup:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	rax, QWORD PTR block_to_cache[rip]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR cache_nodes[rip]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR cache_accesses[rip]
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR cache_misses[rip]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR block_size[rip]
	movsx	rdx, eax
	mov	rax, QWORD PTR cache_misses[rip]
	imul	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	cache_cleanup, .-cache_cleanup
	.section	.rodata
.LC11:
	.string	"Position out of matrix"
	.text
	.type	rd, @function
rd:
.LFB14:
	.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	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	cmp	DWORD PTR -20[rbp], 0
	js	.L36
	mov	eax, DWORD PTR N[rip]
	cmp	DWORD PTR -20[rbp], eax
	jge	.L36
	cmp	DWORD PTR -24[rbp], 0
	js	.L36
	mov	eax, DWORD PTR N[rip]
	cmp	DWORD PTR -24[rbp], eax
	jl	.L37
.L36:
	lea	rdi, .LC11[rip]
	call	error
.L37:
	mov	edx, DWORD PTR -24[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, edx
	mov	edi, eax
	call	pos
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	cache_access
	mov	rdx, QWORD PTR array[rip]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	rd, .-rd
	.type	wr, @function
wr:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 24
	.cfi_offset 3, -24
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	DWORD PTR -28[rbp], edx
	cmp	DWORD PTR -20[rbp], 0
	js	.L40
	mov	eax, DWORD PTR N[rip]
	cmp	DWORD PTR -20[rbp], eax
	jge	.L40
	cmp	DWORD PTR -24[rbp], 0
	js	.L40
	mov	eax, DWORD PTR N[rip]
	cmp	DWORD PTR -24[rbp], eax
	jl	.L41
.L40:
	lea	rdi, .LC11[rip]
	call	error
.L41:
	mov	rbx, QWORD PTR array[rip]
	mov	edx, DWORD PTR -24[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, edx
	mov	edi, eax
	call	pos
	cdqe
	sal	rax, 2
	lea	rdx, [rbx+rax]
	mov	eax, DWORD PTR -28[rbp]
	mov	DWORD PTR [rdx], eax
	nop
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	wr, .-wr
	.section	.rodata
	.align 8
.LC12:
	.string	"Usage: %s <block-size-in-B> <cache-size-in-blocks>\n"
	.align 8
.LC13:
	.string	"Line not terminated or too long"
.LC14:
	.string	"Missing E command"
.LC15:
	.string	"%d"
.LC16:
	.string	"Matrix size expected"
.LC17:
	.string	"%d%d%d%d"
.LC18:
	.string	"4 arguments expected"
.LC19:
	.string	"Missing N command"
.LC20:
	.string	"Misplaced E command"
.LC21:
	.string	"Unrecognized operation"
	.text
	.globl	main
	.type	main, @function
main:
.LFB16:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 320
	mov	DWORD PTR -308[rbp], edi
	mov	QWORD PTR -320[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -308[rbp], 3
	je	.L43
	mov	rax, QWORD PTR -320[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L61
.L43:
	mov	rax, QWORD PTR -320[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR block_size[rip], eax
	mov	rax, QWORD PTR -320[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR cache_blocks[rip], eax
	jmp	.L45
.L59:
	mov	eax, DWORD PTR lino[rip]
	add	eax, 1
	mov	DWORD PTR lino[rip], eax
	lea	rax, -272[rbp]
	mov	esi, 10
	mov	rdi, rax
	call	strchr@PLT
	mov	QWORD PTR -280[rbp], rax
	cmp	QWORD PTR -280[rbp], 0
	jne	.L46
	lea	rdi, .LC13[rip]
	call	error
.L46:
	mov	rax, QWORD PTR -280[rbp]
	mov	BYTE PTR [rax], 0
	movzx	eax, BYTE PTR -272[rbp]
	movsx	eax, al
	cmp	eax, 88
	je	.L47
	cmp	eax, 88
	jg	.L48
	cmp	eax, 78
	je	.L49
	cmp	eax, 78
	jg	.L48
	test	eax, eax
	je	.L50
	cmp	eax, 69
	je	.L51
	jmp	.L48
.L49:
	mov	eax, DWORD PTR N[rip]
	test	eax, eax
	je	.L52
	lea	rdi, .LC14[rip]
	call	error
.L52:
	movzx	eax, BYTE PTR -271[rbp]
	cmp	al, 32
	jne	.L53
	lea	rax, -272[rbp]
	add	rax, 2
	lea	rdx, N[rip]
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	cmp	eax, 1
	je	.L54
.L53:
	lea	rdi, .LC16[rip]
	call	error
.L54:
	call	matrix_init
	call	cache_init
	jmp	.L45
.L47:
	movzx	eax, BYTE PTR -271[rbp]
	cmp	al, 32
	jne	.L55
	lea	rax, -272[rbp]
	add	rax, 2
	lea	rdi, -288[rbp]
	lea	rsi, -292[rbp]
	lea	rcx, -296[rbp]
	lea	rdx, -300[rbp]
	mov	r9, rdi
	mov	r8, rsi
	lea	rsi, .LC17[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	cmp	eax, 4
	je	.L56
.L55:
	lea	rdi, .LC18[rip]
	call	error
.L56:
	mov	eax, DWORD PTR N[rip]
	test	eax, eax
	jne	.L57
	lea	rdi, .LC19[rip]
	call	error
.L57:
	mov	edx, DWORD PTR -296[rbp]
	mov	eax, DWORD PTR -300[rbp]
	mov	esi, edx
	mov	edi, eax
	call	rd
	mov	DWORD PTR -284[rbp], eax
	mov	edx, DWORD PTR -288[rbp]
	mov	eax, DWORD PTR -292[rbp]
	mov	esi, edx
	mov	edi, eax
	call	rd
	mov	edx, eax
	mov	ecx, DWORD PTR -296[rbp]
	mov	eax, DWORD PTR -300[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	wr
	mov	ecx, DWORD PTR -288[rbp]
	mov	eax, DWORD PTR -292[rbp]
	mov	edx, DWORD PTR -284[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	wr
	nop
	jmp	.L45
.L51:
	mov	eax, DWORD PTR N[rip]
	test	eax, eax
	jne	.L58
	lea	rdi, .LC20[rip]
	call	error
.L58:
	call	matrix_cleanup
	call	cache_cleanup
	mov	edi, 10
	call	putchar@PLT
	mov	DWORD PTR N[rip], 0
	jmp	.L45
.L50:
	mov	eax, 0
	jmp	.L61
.L48:
	lea	rdi, .LC21[rip]
	call	error
.L45:
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -272[rbp]
	mov	esi, 256
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	jne	.L59
	mov	eax, DWORD PTR N[rip]
	test	eax, eax
	je	.L60
	lea	rdi, .LC14[rip]
	call	error
.L60:
	mov	eax, 0
.L61:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L62
	call	__stack_chk_fail@PLT
.L62:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	main, .-main
	.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	"184444.c"
	.text
	.local	lino
	.comm	lino,4,4
	.local	N
	.comm	N,4,4
	.local	array
	.comm	array,4,4
	.local	block_size
	.comm	block_size,4,4
	.local	block_shift
	.comm	block_shift,4,4
	.local	memory_blocks
	.comm	memory_blocks,4,4
	.local	cache_blocks
	.comm	cache_blocks,4,4
	.local	lru_head
	.comm	lru_head,12,4
	.local	cache_nodes
	.comm	cache_nodes,4,4
	.local	block_to_cache
	.comm	block_to_cache,4,4
	.local	cache_accesses
	.comm	cache_accesses,8,8
	.local	cache_misses
	.comm	cache_misses,8,8
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Error on line %d: %s\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	error, %function
error:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, .L2
	ldr	r0, [r3]
	ldr	r3, .L2+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r1, .L2+8
	bl	fprintf
	mov	r0, #1
	bl	exit
.L3:
	.align	2
.L2:
	.word	stderr
	.word	lino
	.word	.LC0
	.size	error, .-error
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Out of memory\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	xmalloc, %function
xmalloc:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L5
	ldr	r0, .L7
	bl	error
.L5:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC1
	.size	xmalloc, .-xmalloc
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	pos, %function
pos:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r3, .L11
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	mul	r2, r3, r2
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L12:
	.align	2
.L11:
	.word	N
	.size	pos, .-pos
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Matrices smaller than 4x4 are not supported\000"
	.align	2
.LC3:
	.ascii	"Elements: %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	matrix_init, %function
matrix_init:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #8
	ldr	r3, .L19
	ldr	r3, [r3]
	cmp	r3, #3
	bgt	.L14
	ldr	r0, .L19+4
	bl	error
.L14:
	ldr	r3, .L19
	ldr	r3, [r3]
	ldr	r2, .L19
	ldr	r2, [r2]
	mul	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L19+8
	bl	printf
	ldr	r3, .L19
	ldr	r3, [r3]
	ldr	r2, .L19
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	xmalloc
	mov	r3, r0
	ldr	r2, .L19+12
	str	r3, [r2]
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L15
.L18:
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L16
.L17:
	ldr	r3, .L19
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	mul	r2, r3, r2
	ldr	r3, [fp, #-16]
	add	r4, r2, r3
	ldr	r3, .L19+12
	ldr	r5, [r3]
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-20]
	bl	pos
	mov	r3, r0
	lsl	r3, r3, #2
	add	r3, r5, r3
	add	r2, r4, #42
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L16:
	ldr	r3, .L19
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L17
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L15:
	ldr	r3, .L19
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L18
	nop
	nop
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L20:
	.align	2
.L19:
	.word	N
	.word	.LC2
	.word	.LC3
	.word	array
	.size	matrix_init, .-matrix_init
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Wrong answer\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	matrix_cleanup, %function
matrix_cleanup:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #12
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L22
.L26:
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L23
.L25:
	ldr	r3, .L27
	ldr	r4, [r3]
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-20]
	bl	pos
	mov	r3, r0
	lsl	r3, r3, #2
	add	r3, r4, r3
	ldr	r2, [r3]
	ldr	r3, .L27+4
	ldr	r3, [r3]
	ldr	r1, [fp, #-16]
	mul	r1, r3, r1
	ldr	r3, [fp, #-20]
	add	r3, r1, r3
	add	r3, r3, #42
	cmp	r2, r3
	beq	.L24
	ldr	r0, .L27+8
	bl	error
.L24:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L23:
	ldr	r3, .L27+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L25
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L22:
	ldr	r3, .L27+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L26
	ldr	r3, .L27
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L28:
	.align	2
.L27:
	.word	array
	.word	N
	.word	.LC4
	.size	matrix_cleanup, .-matrix_cleanup
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Block size must be at least 4 and a power of 2\000"
	.align	2
.LC6:
	.ascii	"Cache must contain at least 2 blocks\000"
	.global	__aeabi_uidiv
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cache_init, %function
cache_init:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L39
	ldr	r3, [r3]
	cmp	r3, #3
	ble	.L30
	ldr	r3, .L39
	ldr	r3, [r3]
	sub	r2, r3, #1
	ldr	r3, .L39
	ldr	r3, [r3]
	and	r3, r3, r2
	cmp	r3, #0
	beq	.L31
.L30:
	ldr	r0, .L39+4
	bl	error
.L31:
	ldr	r3, .L39+8
	ldr	r3, [r3]
	cmp	r3, #1
	bgt	.L32
	ldr	r0, .L39+12
	bl	error
.L32:
	ldr	r3, .L39+16
	mov	r2, #1
	str	r2, [r3]
	b	.L33
.L34:
	ldr	r3, .L39+16
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L39+16
	str	r3, [r2]
.L33:
	ldr	r3, .L39+16
	ldr	r3, [r3]
	mov	r2, #1
	lsl	r3, r2, r3
	ldr	r2, .L39
	ldr	r2, [r2]
	cmp	r3, r2
	bcc	.L34
	ldr	r3, .L39+20
	ldr	r3, [r3]
	ldr	r2, .L39+20
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, .L39
	ldr	r2, [r2]
	add	r3, r3, r2
	sub	r3, r3, #1
	ldr	r2, .L39
	ldr	r2, [r2]
	mov	r1, r2
	mov	r0, r3
	bl	__aeabi_uidiv
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L39+24
	str	r2, [r3]
	ldr	r3, .L39+24
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	xmalloc
	mov	r3, r0
	ldr	r2, .L39+28
	str	r3, [r2]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L35
.L36:
	ldr	r3, .L39+28
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L35:
	ldr	r3, .L39+24
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L36
	ldr	r3, .L39+32
	ldr	r2, .L39+32
	str	r2, [r3, #4]
	ldr	r3, .L39+32
	ldr	r3, [r3, #4]
	ldr	r2, .L39+32
	str	r3, [r2]
	ldr	r3, .L39+8
	ldr	r3, [r3]
	mov	r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r0, r3
	bl	xmalloc
	mov	r3, r0
	ldr	r2, .L39+36
	str	r3, [r2]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L37
.L38:
	ldr	r3, .L39+36
	ldr	r1, [r3]
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	str	r3, [fp, #-8]
	ldr	r3, .L39+32
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r2, .L39+32
	str	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	mvn	r2, #0
	str	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L37:
	ldr	r3, .L39+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L38
	ldr	r1, .L39+40
	mov	r2, #0
	mov	r3, #0
	stm	r1, {r2-r3}
	ldr	r1, .L39+44
	mov	r2, #0
	mov	r3, #0
	stm	r1, {r2-r3}
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L40:
	.align	2
.L39:
	.word	block_size
	.word	.LC5
	.word	cache_blocks
	.word	.LC6
	.word	block_shift
	.word	N
	.word	memory_blocks
	.word	block_to_cache
	.word	lru_head
	.word	cache_nodes
	.word	cache_accesses
	.word	cache_misses
	.size	cache_init, .-cache_init
	.section	.rodata
	.align	2
.LC7:
	.ascii	"Internal error: cache_access out of cache\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cache_access, %function
cache_access:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, fp, lr}
	add	fp, sp, #20
	sub	sp, sp, #24
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	lsl	r2, r3, #2
	ldr	r3, .L46
	ldr	r3, [r3]
	asr	r3, r2, r3
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	blt	.L42
	ldr	r3, .L46+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	blt	.L43
.L42:
	ldr	r0, .L46+8
	bl	error
.L43:
	ldr	r3, .L46+12
	ldmia	r3, {r2-r3}
	adds	r6, r2, #1
	adc	r7, r3, #0
	ldr	r3, .L46+12
	stm	r3, {r6-r7}
	ldr	r3, .L46+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bne	.L44
	ldr	r3, .L46+20
	ldr	r3, [r3, #4]
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	blt	.L45
	ldr	r3, .L46+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
.L45:
	ldr	r3, .L46+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [fp, #-36]
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-32]
	str	r2, [r3, #8]
	ldr	r3, .L46+24
	ldmia	r3, {r2-r3}
	adds	r4, r2, #1
	adc	r5, r3, #0
	ldr	r3, .L46+24
	stm	r3, {r4-r5}
.L44:
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-24]
	str	r2, [r3]
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-28]
	str	r2, [r3, #4]
	ldr	r3, .L46+20
	ldr	r2, [r3]
	ldr	r3, [fp, #-36]
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	ldr	r2, .L46+20
	str	r2, [r3, #4]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	ldr	r2, [fp, #-36]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-36]
	str	r2, [r3]
	nop
	sub	sp, fp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, fp, pc}
.L47:
	.align	2
.L46:
	.word	block_shift
	.word	memory_blocks
	.word	.LC7
	.word	cache_accesses
	.word	block_to_cache
	.word	lru_head
	.word	cache_misses
	.size	cache_access, .-cache_access
	.section	.rodata
	.align	2
.LC8:
	.ascii	"Accesses: %lld\012\000"
	.align	2
.LC9:
	.ascii	"Misses: %lld\012\000"
	.align	2
.LC10:
	.ascii	"Missed-bytes: %lld\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cache_cleanup, %function
cache_cleanup:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L49+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L49+8
	ldmia	r3, {r2-r3}
	ldr	r0, .L49+12
	bl	printf
	ldr	r3, .L49+16
	ldmia	r3, {r2-r3}
	ldr	r0, .L49+20
	bl	printf
	ldr	r3, .L49+24
	ldr	r3, [r3]
	mov	r0, r3
	asr	r1, r0, #31
	ldr	r3, .L49+16
	ldmia	r3, {r2-r3}
	mul	lr, r2, r1
	mul	ip, r0, r3
	add	ip, lr, ip
	umull	r4, r5, r0, r2
	add	r3, ip, r5
	mov	r5, r3
	mov	r2, r4
	mov	r3, r5
	ldr	r0, .L49+28
	bl	printf
	nop
	pop	{r4, r5, fp, pc}
.L50:
	.align	2
.L49:
	.word	block_to_cache
	.word	cache_nodes
	.word	cache_accesses
	.word	.LC8
	.word	cache_misses
	.word	.LC9
	.word	block_size
	.word	.LC10
	.size	cache_cleanup, .-cache_cleanup
	.section	.rodata
	.align	2
.LC11:
	.ascii	"Position out of matrix\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rd, %function
rd:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	blt	.L52
	ldr	r3, .L55
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bge	.L52
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	blt	.L52
	ldr	r3, .L55
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L53
.L52:
	ldr	r0, .L55+4
	bl	error
.L53:
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	pos
	str	r0, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	cache_access
	ldr	r3, .L55+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L56:
	.align	2
.L55:
	.word	N
	.word	.LC11
	.word	array
	.size	rd, .-rd
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	wr, %function
wr:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	blt	.L58
	ldr	r3, .L60
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bge	.L58
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	blt	.L58
	ldr	r3, .L60
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L59
.L58:
	ldr	r0, .L60+4
	bl	error
.L59:
	ldr	r3, .L60+8
	ldr	r4, [r3]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	pos
	mov	r3, r0
	lsl	r3, r3, #2
	add	r3, r4, r3
	ldr	r2, [fp, #-24]
	str	r2, [r3]
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L61:
	.align	2
.L60:
	.word	N
	.word	.LC11
	.word	array
	.size	wr, .-wr
	.section	.rodata
	.align	2
.LC12:
	.ascii	"Usage: %s <block-size-in-B> <cache-size-in-blocks>\012"
	.ascii	"\000"
	.align	2
.LC13:
	.ascii	"Line not terminated or too long\000"
	.align	2
.LC14:
	.ascii	"Missing E command\000"
	.align	2
.LC15:
	.ascii	"%d\000"
	.align	2
.LC16:
	.ascii	"Matrix size expected\000"
	.align	2
.LC17:
	.ascii	"%d%d%d%d\000"
	.align	2
.LC18:
	.ascii	"4 arguments expected\000"
	.align	2
.LC19:
	.ascii	"Missing N command\000"
	.align	2
.LC20:
	.ascii	"Misplaced E command\000"
	.align	2
.LC21:
	.ascii	"Unrecognized operation\000"
	.align	2
.LC22:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 296
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #304
	str	r0, [fp, #-304]
	str	r1, [fp, #-308]
	ldr	r3, .L83
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-304]
	cmp	r3, #3
	beq	.L63
	ldr	r3, .L83+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-308]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L83+8
	bl	fprintf
	mov	r3, #1
	b	.L81
.L63:
	ldr	r3, [fp, #-308]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L83+12
	str	r3, [r2]
	ldr	r3, [fp, #-308]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L83+16
	str	r3, [r2]
	b	.L65
.L79:
	ldr	r3, .L83+20
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L83+20
	str	r3, [r2]
	sub	r3, fp, #272
	mov	r1, #10
	mov	r0, r3
	bl	strchr
	str	r0, [fp, #-280]
	ldr	r3, [fp, #-280]
	cmp	r3, #0
	bne	.L66
	ldr	r0, .L83+24
	bl	error
.L66:
	ldr	r3, [fp, #-280]
	mov	r2, #0
	strb	r2, [r3]
	ldrb	r3, [fp, #-272]	@ zero_extendqisi2
	cmp	r3, #88
	beq	.L67
	cmp	r3, #88
	bgt	.L68
	cmp	r3, #78
	beq	.L69
	cmp	r3, #78
	bgt	.L68
	cmp	r3, #0
	beq	.L70
	cmp	r3, #69
	beq	.L71
	b	.L68
.L69:
	ldr	r3, .L83+28
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L72
	ldr	r0, .L83+32
	bl	error
.L72:
	ldrb	r3, [fp, #-271]	@ zero_extendqisi2
	cmp	r3, #32
	bne	.L73
	sub	r3, fp, #272
	add	r3, r3, #2
	ldr	r2, .L83+28
	ldr	r1, .L83+36
	mov	r0, r3
	bl	__isoc99_sscanf
	mov	r3, r0
	cmp	r3, #1
	beq	.L74
.L73:
	ldr	r0, .L83+40
	bl	error
.L74:
	bl	matrix_init
	bl	cache_init
	b	.L65
.L67:
	ldrb	r3, [fp, #-271]	@ zero_extendqisi2
	cmp	r3, #32
	bne	.L75
	sub	r0, fp, #272
	add	r0, r0, #2
	sub	r1, fp, #292
	sub	r2, fp, #296
	sub	r3, fp, #284
	str	r3, [sp, #4]
	sub	r3, fp, #288
	str	r3, [sp]
	mov	r3, r1
	ldr	r1, .L83+44
	bl	__isoc99_sscanf
	mov	r3, r0
	cmp	r3, #4
	beq	.L76
.L75:
	ldr	r0, .L83+48
	bl	error
.L76:
	ldr	r3, .L83+28
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L77
	ldr	r0, .L83+52
	bl	error
.L77:
	ldr	r3, [fp, #-296]
	ldr	r2, [fp, #-292]
	mov	r1, r2
	mov	r0, r3
	bl	rd
	str	r0, [fp, #-276]
	ldr	r4, [fp, #-296]
	ldr	r5, [fp, #-292]
	ldr	r3, [fp, #-288]
	ldr	r2, [fp, #-284]
	mov	r1, r2
	mov	r0, r3
	bl	rd
	mov	r3, r0
	mov	r2, r3
	mov	r1, r5
	mov	r0, r4
	bl	wr
	ldr	r3, [fp, #-288]
	ldr	r1, [fp, #-284]
	ldr	r2, [fp, #-276]
	mov	r0, r3
	bl	wr
	nop
	b	.L65
.L71:
	ldr	r3, .L83+28
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L78
	ldr	r0, .L83+56
	bl	error
.L78:
	bl	matrix_cleanup
	bl	cache_cleanup
	mov	r0, #10
	bl	putchar
	ldr	r3, .L83+28
	mov	r2, #0
	str	r2, [r3]
	b	.L65
.L70:
	mov	r3, #0
	b	.L81
.L68:
	ldr	r0, .L83+60
	bl	error
.L65:
	ldr	r3, .L83+64
	ldr	r2, [r3]
	sub	r3, fp, #272
	mov	r1, #256
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L79
	ldr	r3, .L83+28
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L80
	ldr	r0, .L83+32
	bl	error
.L80:
	mov	r3, #0
.L81:
	ldr	r2, .L83
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L82
	bl	__stack_chk_fail
.L82:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L84:
	.align	2
.L83:
	.word	.LC22
	.word	stderr
	.word	.LC12
	.word	block_size
	.word	cache_blocks
	.word	lino
	.word	.LC13
	.word	N
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.word	stdin
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
