	.file	"790171.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Number of Frames : "
.LC1:
	.string	"%d"
.LC2:
	.string	"Number of Pages : "
.LC3:
	.string	"Enter the reference string"
	.text
	.globl	main
	.type	main, @function
main:
.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, 304
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -296[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	DWORD PTR -292[rbp], 0
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -292[rbp]
	cdqe
	mov	DWORD PTR -288[rbp+rax*4], -1
	add	DWORD PTR -292[rbp], 1
.L2:
	mov	eax, DWORD PTR -296[rbp]
	cmp	DWORD PTR -292[rbp], eax
	jl	.L3
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -300[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	DWORD PTR -292[rbp], 0
	jmp	.L4
.L5:
	lea	rdx, -128[rbp]
	mov	eax, DWORD PTR -292[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	add	DWORD PTR -292[rbp], 1
.L4:
	mov	eax, DWORD PTR -300[rbp]
	cmp	DWORD PTR -292[rbp], eax
	jl	.L5
	mov	edi, DWORD PTR -300[rbp]
	mov	ecx, DWORD PTR -296[rbp]
	lea	rdx, -208[rbp]
	lea	rsi, -288[rbp]
	lea	rax, -128[rbp]
	mov	r8d, edi
	mov	rdi, rax
	call	LRU
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC4:
	.string	"\nRef.String   |\tFrames"
	.align 8
.LC5:
	.string	"-------------------------------"
.LC6:
	.string	"  %d\t|\t"
.LC7:
	.string	"   Hit\n"
.LC8:
	.string	"%d  "
.LC9:
	.string	"\n"
.LC10:
	.string	"Total Page Faults = %d\n\n"
	.text
	.globl	LRU
	.type	LRU, @function
LRU:
.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, 64
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -56[rbp], rdx
	mov	DWORD PTR -60[rbp], ecx
	mov	DWORD PTR -64[rbp], r8d
	lea	rdi, .LC4[rip]
	call	puts@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	DWORD PTR -12[rbp], 0
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -16[rbp], 0
	mov	DWORD PTR -32[rbp], 0
	jmp	.L9
.L19:
	mov	DWORD PTR -20[rbp], 0
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -28[rbp], 0
	jmp	.L10
.L13:
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jne	.L11
	mov	DWORD PTR -20[rbp], 1
	add	DWORD PTR -12[rbp], 1
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -56[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR [rdx], eax
	lea	rdi, .LC7[rip]
	call	puts@PLT
	jmp	.L12
.L11:
	add	DWORD PTR -28[rbp], 1
.L10:
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -60[rbp]
	jl	.L13
.L12:
	cmp	DWORD PTR -20[rbp], 0
	jne	.L14
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -60[rbp]
	jge	.L14
	add	DWORD PTR -16[rbp], 1
	add	DWORD PTR -12[rbp], 1
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -8[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	mov	rdx, QWORD PTR -48[rbp]
	add	rdx, rcx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -56[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR [rdx], eax
	add	DWORD PTR -8[rbp], 1
	jmp	.L15
.L14:
	cmp	DWORD PTR -20[rbp], 0
	jne	.L15
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -60[rbp]
	jne	.L15
	add	DWORD PTR -16[rbp], 1
	add	DWORD PTR -12[rbp], 1
	mov	edx, DWORD PTR -60[rbp]
	mov	rax, QWORD PTR -56[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	findLRU
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -4[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	mov	rdx, QWORD PTR -48[rbp]
	add	rdx, rcx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -56[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR [rdx], eax
.L15:
	cmp	DWORD PTR -20[rbp], 0
	jne	.L16
	mov	DWORD PTR -24[rbp], 0
	jmp	.L17
.L18:
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -24[rbp], 1
.L17:
	mov	eax, DWORD PTR -24[rbp]
	cmp	eax, DWORD PTR -60[rbp]
	jl	.L18
	lea	rdi, .LC9[rip]
	call	puts@PLT
.L16:
	add	DWORD PTR -32[rbp], 1
.L9:
	mov	eax, DWORD PTR -32[rbp]
	cmp	eax, DWORD PTR -64[rbp]
	jl	.L19
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	LRU, .-LRU
	.globl	findLRU
	.type	findLRU, @function
findLRU:
.LFB2:
	.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 -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -4[rbp], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -8[rbp], eax
	mov	DWORD PTR -12[rbp], 1
	jmp	.L21
.L23:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -8[rbp], eax
	jle	.L22
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR -4[rbp], eax
.L22:
	add	DWORD PTR -12[rbp], 1
.L21:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jl	.L23
	mov	eax, DWORD PTR -4[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	findLRU, .-findLRU
	.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	"790171.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Number of Frames : \000"
	.align	2
.LC1:
	.ascii	"%d\000"
	.align	2
.LC2:
	.ascii	"Number of Pages : \000"
	.align	2
.LC3:
	.ascii	"Enter the reference string\000"
	.align	2
.LC4:
	.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	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #304
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L8+4
	bl	printf
	sub	r3, fp, #296
	mov	r1, r3
	ldr	r0, .L8+8
	bl	__isoc99_scanf
	mov	r3, #0
	str	r3, [fp, #-292]
	b	.L2
.L3:
	ldr	r3, [fp, #-292]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	mvn	r2, #0
	str	r2, [r3, #-284]
	ldr	r3, [fp, #-292]
	add	r3, r3, #1
	str	r3, [fp, #-292]
.L2:
	ldr	r3, [fp, #-296]
	ldr	r2, [fp, #-292]
	cmp	r2, r3
	blt	.L3
	ldr	r0, .L8+12
	bl	printf
	sub	r3, fp, #300
	mov	r1, r3
	ldr	r0, .L8+8
	bl	__isoc99_scanf
	ldr	r0, .L8+16
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-292]
	b	.L4
.L5:
	sub	r2, fp, #128
	ldr	r3, [fp, #-292]
	lsl	r3, r3, #2
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L8+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-292]
	add	r3, r3, #1
	str	r3, [fp, #-292]
.L4:
	ldr	r3, [fp, #-300]
	ldr	r2, [fp, #-292]
	cmp	r2, r3
	blt	.L5
	ldr	ip, [fp, #-296]
	ldr	r3, [fp, #-300]
	sub	r2, fp, #208
	sub	r1, fp, #288
	sub	r0, fp, #128
	str	r3, [sp]
	mov	r3, ip
	bl	LRU
	mov	r3, #0
	ldr	r2, .L8
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L7
	bl	__stack_chk_fail
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC4
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.section	.rodata
	.align	2
.LC5:
	.ascii	"\012Ref.String   |\011Frames\000"
	.align	2
.LC6:
	.ascii	"-------------------------------\000"
	.align	2
.LC7:
	.ascii	"  %d\011|\011\000"
	.align	2
.LC8:
	.ascii	"   Hit\012\000"
	.align	2
.LC9:
	.ascii	"%d  \000"
	.align	2
.LC10:
	.ascii	"\012\000"
	.align	2
.LC11:
	.ascii	"Total Page Faults = %d\012\012\000"
	.text
	.align	2
	.global	LRU
	.syntax unified
	.arm
	.fpu softvfp
	.type	LRU, %function
LRU:
	@ args = 4, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	str	r2, [fp, #-48]
	str	r3, [fp, #-52]
	ldr	r0, .L22
	bl	puts
	ldr	r0, .L22+4
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L11
.L21:
	mov	r3, #0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L22+8
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L12
.L15:
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-40]
	add	r3, r1, r3
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L13
	mov	r3, #1
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r0, .L22+12
	bl	puts
	b	.L14
.L13:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L12:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-52]
	cmp	r2, r3
	blt	.L15
.L14:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L16
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-52]
	cmp	r2, r3
	bge	.L16
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-40]
	add	r2, r2, r3
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-44]
	add	r3, r1, r3
	ldr	r2, [r2]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	b	.L17
.L16:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L17
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-52]
	cmp	r2, r3
	bne	.L17
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r1, [fp, #-52]
	ldr	r0, [fp, #-48]
	bl	findLRU
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-40]
	add	r2, r2, r3
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-44]
	add	r3, r1, r3
	ldr	r2, [r2]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	ldr	r2, [fp, #-16]
	str	r2, [r3]
.L17:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L18
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L19
.L20:
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L22+16
	bl	printf
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L19:
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-52]
	cmp	r2, r3
	blt	.L20
	ldr	r0, .L22+20
	bl	puts
.L18:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L11:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #4]
	cmp	r2, r3
	blt	.L21
	ldr	r1, [fp, #-20]
	ldr	r0, .L22+24
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	LRU, .-LRU
	.align	2
	.global	findLRU
	.syntax unified
	.arm
	.fpu softvfp
	.type	findLRU, %function
findLRU:
	@ 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]
	str	r1, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	mov	r3, #1
	str	r3, [fp, #-16]
	b	.L25
.L27:
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	ble	.L26
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-8]
.L26:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L25:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	blt	.L27
	ldr	r3, [fp, #-8]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	findLRU, .-findLRU
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
