	.file	"151705270.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,4,4
	.local	cache_misses
	.comm	cache_misses,4,4
	.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	DWORD PTR cache_accesses[rip], 0
	mov	DWORD 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	eax, DWORD PTR cache_accesses[rip]
	add	eax, 1
	mov	DWORD PTR cache_accesses[rip], eax
	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	eax, DWORD PTR cache_misses[rip]
	add	eax, 1
	mov	DWORD PTR cache_misses[rip], eax
.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: %d\n"
.LC9:
	.string	"Misses: %d\n"
.LC10:
	.string	"Missed-bytes: %d\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	eax, DWORD PTR cache_accesses[rip]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR cache_misses[rip]
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, DWORD PTR cache_misses[rip]
	mov	eax, DWORD PTR block_size[rip]
	imul	eax, edx
	mov	esi, eax
	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"
.LC13:
	.string	"Misplaced E command"
	.align 8
.LC14:
	.string	"Line not terminated or too long"
.LC15:
	.string	"Missing E command"
.LC16:
	.string	"%d"
.LC17:
	.string	"Matrix size expected"
.LC18:
	.string	"%d%d%d%d"
.LC19:
	.string	"4 arguments expected"
.LC20:
	.string	"Missing N 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	.L62
.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
.L60:
	movzx	eax, BYTE PTR -272[rbp]
	cmp	al, 10
	je	.L46
	movzx	eax, BYTE PTR -272[rbp]
	test	al, al
	jne	.L47
.L46:
	mov	eax, DWORD PTR N[rip]
	test	eax, eax
	je	.L48
	lea	rdi, .LC13[rip]
	call	error
.L48:
	mov	edi, 0
	call	exit@PLT
.L47:
	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	.L49
	lea	rdi, .LC14[rip]
	call	error
.L49:
	mov	rax, QWORD PTR -280[rbp]
	mov	BYTE PTR [rax], 0
	movzx	eax, BYTE PTR -272[rbp]
	movsx	eax, al
	cmp	eax, 88
	je	.L50
	cmp	eax, 88
	jg	.L51
	cmp	eax, 69
	je	.L52
	cmp	eax, 78
	jne	.L51
	mov	eax, DWORD PTR N[rip]
	test	eax, eax
	je	.L53
	lea	rdi, .LC15[rip]
	call	error
.L53:
	movzx	eax, BYTE PTR -271[rbp]
	cmp	al, 32
	jne	.L54
	lea	rax, -272[rbp]
	add	rax, 2
	lea	rdx, N[rip]
	lea	rsi, .LC16[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sscanf_s@PLT
	cmp	eax, 1
	je	.L55
.L54:
	lea	rdi, .LC17[rip]
	call	error
.L55:
	call	matrix_init
	call	cache_init
	jmp	.L45
.L50:
	movzx	eax, BYTE PTR -271[rbp]
	cmp	al, 32
	jne	.L56
	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, .LC18[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sscanf_s@PLT
	cmp	eax, 4
	je	.L57
.L56:
	lea	rdi, .LC19[rip]
	call	error
.L57:
	mov	eax, DWORD PTR N[rip]
	test	eax, eax
	jne	.L58
	lea	rdi, .LC20[rip]
	call	error
.L58:
	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
.L52:
	mov	eax, DWORD PTR N[rip]
	test	eax, eax
	jne	.L59
	lea	rdi, .LC13[rip]
	call	error
.L59:
	call	matrix_cleanup
	call	cache_cleanup
	mov	DWORD PTR N[rip], 0
	jmp	.L45
.L51:
	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	.L60
	mov	eax, DWORD PTR N[rip]
	test	eax, eax
	je	.L61
	lea	rdi, .LC15[rip]
	call	error
.L61:
	mov	eax, 0
.L62:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L63
	call	__stack_chk_fail@PLT
.L63:
	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	"151705270.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,4,4
	.local	cache_misses
	.comm	cache_misses,4,4
	.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	r3, .L39+40
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L39+44
	mov	r2, #0
	str	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	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	lsl	r2, r3, #2
	ldr	r3, .L46
	ldr	r3, [r3]
	asr	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	blt	.L42
	ldr	r3, .L46+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L43
.L42:
	ldr	r0, .L46+8
	bl	error
.L43:
	ldr	r3, .L46+12
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L46+12
	str	r3, [r2]
	ldr	r3, .L46+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L44
	ldr	r3, .L46+20
	ldr	r3, [r3, #4]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	blt	.L45
	ldr	r3, .L46+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-20]
	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, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [fp, #-20]
	str	r2, [r3]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-16]
	str	r2, [r3, #8]
	ldr	r3, .L46+24
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L46+24
	str	r3, [r2]
.L44:
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	str	r2, [r3, #4]
	ldr	r3, .L46+20
	ldr	r2, [r3]
	ldr	r3, [fp, #-20]
	str	r2, [r3]
	ldr	r3, [fp, #-20]
	ldr	r2, .L46+20
	str	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-20]
	str	r2, [r3]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{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: %d\012\000"
	.align	2
.LC9:
	.ascii	"Misses: %d\012\000"
	.align	2
.LC10:
	.ascii	"Missed-bytes: %d\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	{fp, lr}
	add	fp, sp, #4
	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
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L49+12
	bl	printf
	ldr	r3, .L49+16
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L49+20
	bl	printf
	ldr	r3, .L49+16
	ldr	r3, [r3]
	ldr	r2, .L49+24
	ldr	r2, [r2]
	mul	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L49+28
	bl	printf
	nop
	pop	{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	"Misplaced E command\000"
	.align	2
.LC14:
	.ascii	"Line not terminated or too long\000"
	.align	2
.LC15:
	.ascii	"Missing E command\000"
	.align	2
.LC16:
	.ascii	"%d\000"
	.align	2
.LC17:
	.ascii	"Matrix size expected\000"
	.align	2
.LC18:
	.ascii	"%d%d%d%d\000"
	.align	2
.LC19:
	.ascii	"4 arguments expected\000"
	.align	2
.LC20:
	.ascii	"Missing N 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, .L84
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-304]
	cmp	r3, #3
	beq	.L63
	ldr	r3, .L84+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-308]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L84+8
	bl	fprintf
	mov	r3, #1
	b	.L82
.L63:
	ldr	r3, [fp, #-308]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L84+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, .L84+16
	str	r3, [r2]
	b	.L65
.L80:
	ldrb	r3, [fp, #-272]	@ zero_extendqisi2
	cmp	r3, #10
	beq	.L66
	ldrb	r3, [fp, #-272]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L67
.L66:
	ldr	r3, .L84+20
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L68
	ldr	r0, .L84+24
	bl	error
.L68:
	mov	r0, #0
	bl	exit
.L67:
	ldr	r3, .L84+28
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L84+28
	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	.L69
	ldr	r0, .L84+32
	bl	error
.L69:
	ldr	r3, [fp, #-280]
	mov	r2, #0
	strb	r2, [r3]
	ldrb	r3, [fp, #-272]	@ zero_extendqisi2
	cmp	r3, #88
	beq	.L70
	cmp	r3, #88
	bgt	.L71
	cmp	r3, #69
	beq	.L72
	cmp	r3, #78
	bne	.L71
	ldr	r3, .L84+20
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L73
	ldr	r0, .L84+36
	bl	error
.L73:
	ldrb	r3, [fp, #-271]	@ zero_extendqisi2
	cmp	r3, #32
	bne	.L74
	sub	r3, fp, #272
	add	r3, r3, #2
	ldr	r2, .L84+20
	ldr	r1, .L84+40
	mov	r0, r3
	bl	sscanf_s
	mov	r3, r0
	cmp	r3, #1
	beq	.L75
.L74:
	ldr	r0, .L84+44
	bl	error
.L75:
	bl	matrix_init
	bl	cache_init
	b	.L65
.L70:
	ldrb	r3, [fp, #-271]	@ zero_extendqisi2
	cmp	r3, #32
	bne	.L76
	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, .L84+48
	bl	sscanf_s
	mov	r3, r0
	cmp	r3, #4
	beq	.L77
.L76:
	ldr	r0, .L84+52
	bl	error
.L77:
	ldr	r3, .L84+20
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L78
	ldr	r0, .L84+56
	bl	error
.L78:
	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
.L72:
	ldr	r3, .L84+20
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L79
	ldr	r0, .L84+24
	bl	error
.L79:
	bl	matrix_cleanup
	bl	cache_cleanup
	ldr	r3, .L84+20
	mov	r2, #0
	str	r2, [r3]
	b	.L65
.L71:
	ldr	r0, .L84+60
	bl	error
.L65:
	ldr	r3, .L84+64
	ldr	r2, [r3]
	sub	r3, fp, #272
	mov	r1, #256
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L80
	ldr	r3, .L84+20
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L81
	ldr	r0, .L84+36
	bl	error
.L81:
	mov	r3, #0
.L82:
	ldr	r2, .L84
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L83
	bl	__stack_chk_fail
.L83:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L85:
	.align	2
.L84:
	.word	.LC22
	.word	stderr
	.word	.LC12
	.word	block_size
	.word	cache_blocks
	.word	N
	.word	.LC13
	.word	lino
	.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
