	.file	"161786.c"
	.intel_syntax noprefix
	.text
	.globl	test
	.data
	.align 32
	.type	test, @object
	.size	test, 500
test:
	.string	"7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1"
	.zero	456
	.globl	faults
	.bss
	.align 4
	.type	faults, @object
	.size	faults, 4
faults:
	.zero	4
	.globl	misses
	.align 4
	.type	misses, @object
	.size	misses, 4
misses:
	.zero	4
	.globl	hits
	.align 4
	.type	hits, @object
	.size	hits, 4
hits:
	.zero	4
	.globl	total_pages
	.align 4
	.type	total_pages, @object
	.size	total_pages, 4
total_pages:
	.zero	4
	.globl	head
	.align 8
	.type	head, @object
	.size	head, 8
head:
	.zero	8
	.globl	tail
	.align 8
	.type	tail, @object
	.size	tail, 8
tail:
	.zero	8
	.section	.rodata
.LC0:
	.string	"no pages in memory"
.LC1:
	.string	"pages:"
.LC2:
	.string	"%d \n"
.LC3:
	.string	"--------------------"
	.text
	.globl	print_all_pages_in_memory
	.type	print_all_pages_in_memory, @function
print_all_pages_in_memory:
.LFB0:
	.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	rax, QWORD PTR head[rip]
	test	rax, rax
	jne	.L2
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L6
.L2:
	mov	rax, QWORD PTR head[rip]
	mov	QWORD PTR -8[rbp], rax
	lea	rdi, .LC1[rip]
	call	puts@PLT
	jmp	.L4
.L5:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
.L4:
	cmp	QWORD PTR -8[rbp], 0
	jne	.L5
	lea	rdi, .LC3[rip]
	call	puts@PLT
.L6:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	print_all_pages_in_memory, .-print_all_pages_in_memory
	.section	.rodata
	.align 8
.LC4:
	.string	"HIT : page number %d is already in memory\n"
	.text
	.globl	add_page
	.type	add_page, @function
add_page:
.LFB1:
	.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	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	test	rax, rax
	jne	.L8
	mov	rax, QWORD PTR tail[rip]
	cmp	QWORD PTR -24[rbp], rax
	jne	.L9
.L8:
	mov	eax, DWORD PTR hits[rip]
	add	eax, 1
	mov	DWORD PTR hits[rip], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L7
.L9:
	mov	eax, DWORD PTR misses[rip]
	add	eax, 1
	mov	DWORD PTR misses[rip], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR 8[rax], 0
	mov	rax, QWORD PTR head[rip]
	test	rax, rax
	jne	.L11
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR head[rip], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR tail[rip], rax
	mov	eax, DWORD PTR total_pages[rip]
	add	eax, 1
	mov	DWORD PTR total_pages[rip], eax
	jmp	.L7
.L11:
	mov	eax, DWORD PTR total_pages[rip]
	cmp	eax, 3
	jne	.L12
	mov	eax, DWORD PTR faults[rip]
	add	eax, 1
	mov	DWORD PTR faults[rip], eax
	mov	rax, QWORD PTR head[rip]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR head[rip]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR head[rip], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], 0
	mov	rax, QWORD PTR tail[rip]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR tail[rip], rax
	jmp	.L7
.L12:
	mov	rax, QWORD PTR tail[rip]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR tail[rip], rax
	mov	eax, DWORD PTR total_pages[rip]
	add	eax, 1
	mov	DWORD PTR total_pages[rip], eax
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	add_page, .-add_page
	.section	.rodata
	.align 8
.LC5:
	.string	"Test case : \n%s , page size : %d\n"
	.text
	.globl	problem
	.type	problem, @function
problem:
.LFB2:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	edx, 3
	lea	rsi, test[rip]
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	problem, .-problem
	.globl	initialize_pages
	.type	initialize_pages, @function
initialize_pages:
.LFB3:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -20[rbp], 0
	jmp	.L15
.L16:
	mov	QWORD PTR -8[rbp], 0
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	lea	rcx, [rdx+rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR [rcx], rax
	mov	QWORD PTR 8[rcx], rdx
	add	DWORD PTR -20[rbp], 1
.L15:
	cmp	DWORD PTR -20[rbp], 7
	jle	.L16
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	initialize_pages, .-initialize_pages
	.section	.rodata
	.align 8
.LC6:
	.string	"Hits : %d , Misses: %d ,Faults: %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB4:
	.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, 168
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	lea	rax, -160[rbp]
	mov	rdi, rax
	call	initialize_pages
	mov	eax, 0
	call	problem
	mov	DWORD PTR -168[rbp], 0
	jmp	.L18
.L19:
	mov	eax, DWORD PTR -168[rbp]
	cdqe
	lea	rdx, test[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	movsx	eax, al
	sub	eax, 48
	mov	DWORD PTR -164[rbp], eax
	lea	rdx, -160[rbp]
	mov	eax, DWORD PTR -164[rbp]
	cdqe
	sal	rax, 4
	add	rax, rdx
	mov	rdi, rax
	call	add_page
	mov	eax, 0
	call	print_all_pages_in_memory
	add	DWORD PTR -168[rbp], 2
.L18:
	mov	eax, DWORD PTR -168[rbp]
	movsx	rbx, eax
	lea	rdi, test[rip]
	call	strlen@PLT
	cmp	rbx, rax
	jb	.L19
	mov	ecx, DWORD PTR faults[rip]
	mov	edx, DWORD PTR misses[rip]
	mov	eax, DWORD PTR hits[rip]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rsi, QWORD PTR -24[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.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	"161786.c"
	.text
	.global	test
	.data
	.align	2
	.type	test, %object
	.size	test, 500
test:
	.ascii	"7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1\000"
	.space	456
	.global	faults
	.bss
	.align	2
	.type	faults, %object
	.size	faults, 4
faults:
	.space	4
	.global	misses
	.align	2
	.type	misses, %object
	.size	misses, 4
misses:
	.space	4
	.global	hits
	.align	2
	.type	hits, %object
	.size	hits, 4
hits:
	.space	4
	.global	total_pages
	.align	2
	.type	total_pages, %object
	.size	total_pages, 4
total_pages:
	.space	4
	.global	head
	.align	2
	.type	head, %object
	.size	head, 4
head:
	.space	4
	.global	tail
	.align	2
	.type	tail, %object
	.size	tail, 4
tail:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"no pages in memory\000"
	.align	2
.LC1:
	.ascii	"pages:\000"
	.align	2
.LC2:
	.ascii	"%d \012\000"
	.align	2
.LC3:
	.ascii	"--------------------\000"
	.text
	.align	2
	.global	print_all_pages_in_memory
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_all_pages_in_memory, %function
print_all_pages_in_memory:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r3, .L7
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L7+4
	bl	printf
	b	.L6
.L2:
	ldr	r3, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r0, .L7+8
	bl	puts
	b	.L4
.L5:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L7+12
	bl	printf
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
.L4:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L5
	ldr	r0, .L7+16
	bl	puts
.L6:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	head
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	print_all_pages_in_memory, .-print_all_pages_in_memory
	.section	.rodata
	.align	2
.LC4:
	.ascii	"HIT : page number %d is already in memory\012\000"
	.text
	.align	2
	.global	add_page
	.syntax unified
	.arm
	.fpu softvfp
	.type	add_page, %function
add_page:
	@ 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]
	ldr	r3, [r3, #4]
	cmp	r3, #0
	bne	.L10
	ldr	r3, .L15
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bne	.L11
.L10:
	ldr	r3, .L15+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L15+4
	str	r3, [r2]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L15+8
	bl	printf
	b	.L9
.L11:
	ldr	r3, .L15+12
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L15+12
	str	r3, [r2]
	ldr	r3, [fp, #-16]
	mov	r2, #0
	str	r2, [r3, #4]
	ldr	r3, .L15+16
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L13
	ldr	r2, .L15+16
	ldr	r3, [fp, #-16]
	str	r3, [r2]
	ldr	r2, .L15
	ldr	r3, [fp, #-16]
	str	r3, [r2]
	ldr	r3, .L15+20
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L15+20
	str	r3, [r2]
	b	.L9
.L13:
	ldr	r3, .L15+20
	ldr	r3, [r3]
	cmp	r3, #3
	bne	.L14
	ldr	r3, .L15+24
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L15+24
	str	r3, [r2]
	ldr	r3, .L15+16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, .L15+16
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	ldr	r2, .L15+16
	str	r3, [r2]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #4]
	ldr	r3, .L15
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	str	r2, [r3, #4]
	ldr	r2, .L15
	ldr	r3, [fp, #-16]
	str	r3, [r2]
	b	.L9
.L14:
	ldr	r3, .L15
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	str	r2, [r3, #4]
	ldr	r2, .L15
	ldr	r3, [fp, #-16]
	str	r3, [r2]
	ldr	r3, .L15+20
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L15+20
	str	r3, [r2]
.L9:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	tail
	.word	hits
	.word	.LC4
	.word	misses
	.word	head
	.word	total_pages
	.word	faults
	.size	add_page, .-add_page
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Test case : \012%s , page size : %d\012\000"
	.text
	.align	2
	.global	problem
	.syntax unified
	.arm
	.fpu softvfp
	.type	problem, %function
problem:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	mov	r2, #3
	ldr	r1, .L18
	ldr	r0, .L18+4
	bl	printf
	nop
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	test
	.word	.LC5
	.size	problem, .-problem
	.align	2
	.global	initialize_pages
	.syntax unified
	.arm
	.fpu softvfp
	.type	initialize_pages, %function
initialize_pages:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L21
.L22:
	mov	r3, #0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	mov	r2, r3
	sub	r3, fp, #12
	ldm	r3, {r0, r1}
	stm	r2, {r0, r1}
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L21:
	ldr	r3, [fp, #-16]
	cmp	r3, #7
	ble	.L22
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	initialize_pages, .-initialize_pages
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Hits : %d , Misses: %d ,Faults: %d\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #80
	ldr	r3, .L28
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #72
	mov	r0, r3
	bl	initialize_pages
	bl	problem
	mov	r3, #0
	str	r3, [fp, #-80]
	b	.L24
.L25:
	ldr	r2, .L28+4
	ldr	r3, [fp, #-80]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	str	r3, [fp, #-76]
	sub	r2, fp, #72
	ldr	r3, [fp, #-76]
	lsl	r3, r3, #3
	add	r3, r2, r3
	mov	r0, r3
	bl	add_page
	bl	print_all_pages_in_memory
	ldr	r3, [fp, #-80]
	add	r3, r3, #2
	str	r3, [fp, #-80]
.L24:
	ldr	r0, .L28+4
	bl	strlen
	mov	r2, r0
	ldr	r3, [fp, #-80]
	cmp	r2, r3
	bhi	.L25
	ldr	r3, .L28+8
	ldr	r1, [r3]
	ldr	r3, .L28+12
	ldr	r2, [r3]
	ldr	r3, .L28+16
	ldr	r3, [r3]
	ldr	r0, .L28+20
	bl	printf
	mov	r3, #0
	ldr	r2, .L28
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L27
	bl	__stack_chk_fail
.L27:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	.LC7
	.word	test
	.word	hits
	.word	misses
	.word	faults
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
