	.file	"45451180.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"\nEnter Total Number of Pages:\t"
.LC1:
	.string	"%d"
	.align 8
.LC2:
	.string	"\nEnter values of Reference String:"
.LC3:
	.string	"Value No. [%d]:\t"
	.align 8
.LC4:
	.string	"\nEnter Total Number of Frames:\t"
.LC5:
	.string	"%d\t"
.LC6:
	.string	"\nTotal Page Faults:\t%d\n"
	.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
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 104
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -124[rbp], 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -136[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	DWORD PTR -128[rbp], 0
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -128[rbp]
	add	eax, 1
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdx, -96[rbp]
	mov	eax, DWORD PTR -128[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 -128[rbp], 1
.L2:
	mov	eax, DWORD PTR -136[rbp]
	cmp	DWORD PTR -128[rbp], eax
	jl	.L3
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -132[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -132[rbp]
	mov	rdx, rsp
	mov	rbx, rdx
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -112[rbp], rdx
	movsx	rdx, eax
	mov	r14, rdx
	mov	r15d, 0
	movsx	rdx, eax
	mov	r12, rdx
	mov	r13d, 0
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L4:
	cmp	rsp, rdx
	je	.L5
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L4
.L5:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L6
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L6:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -104[rbp], rax
	mov	DWORD PTR -128[rbp], 0
	jmp	.L7
.L8:
	mov	rax, QWORD PTR -104[rbp]
	mov	edx, DWORD PTR -128[rbp]
	movsx	rdx, edx
	mov	DWORD PTR [rax+rdx*4], -1
	add	DWORD PTR -128[rbp], 1
.L7:
	mov	eax, DWORD PTR -132[rbp]
	cmp	DWORD PTR -128[rbp], eax
	jl	.L8
	mov	DWORD PTR -128[rbp], 0
	jmp	.L9
.L17:
	mov	DWORD PTR -116[rbp], 0
	mov	DWORD PTR -120[rbp], 0
	jmp	.L10
.L12:
	mov	eax, DWORD PTR -128[rbp]
	cdqe
	mov	ecx, DWORD PTR -96[rbp+rax*4]
	mov	rax, QWORD PTR -104[rbp]
	mov	edx, DWORD PTR -120[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	cmp	ecx, eax
	jne	.L11
	add	DWORD PTR -116[rbp], 1
	sub	DWORD PTR -124[rbp], 1
.L11:
	add	DWORD PTR -120[rbp], 1
.L10:
	mov	eax, DWORD PTR -132[rbp]
	cmp	DWORD PTR -120[rbp], eax
	jl	.L12
	add	DWORD PTR -124[rbp], 1
	mov	eax, DWORD PTR -132[rbp]
	cmp	DWORD PTR -124[rbp], eax
	jg	.L13
	cmp	DWORD PTR -116[rbp], 0
	jne	.L13
	mov	eax, DWORD PTR -128[rbp]
	cdqe
	mov	ecx, DWORD PTR -96[rbp+rax*4]
	mov	rax, QWORD PTR -104[rbp]
	mov	edx, DWORD PTR -128[rbp]
	movsx	rdx, edx
	mov	DWORD PTR [rax+rdx*4], ecx
	jmp	.L14
.L13:
	cmp	DWORD PTR -116[rbp], 0
	jne	.L14
	mov	eax, DWORD PTR -124[rbp]
	sub	eax, 1
	mov	ecx, DWORD PTR -132[rbp]
	cdq
	idiv	ecx
	mov	eax, DWORD PTR -128[rbp]
	cdqe
	mov	ecx, DWORD PTR -96[rbp+rax*4]
	mov	rax, QWORD PTR -104[rbp]
	movsx	rdx, edx
	mov	DWORD PTR [rax+rdx*4], ecx
.L14:
	mov	edi, 10
	call	putchar@PLT
	mov	DWORD PTR -120[rbp], 0
	jmp	.L15
.L16:
	mov	rax, QWORD PTR -104[rbp]
	mov	edx, DWORD PTR -120[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -120[rbp], 1
.L15:
	mov	eax, DWORD PTR -132[rbp]
	cmp	DWORD PTR -120[rbp], eax
	jl	.L16
	add	DWORD PTR -128[rbp], 1
.L9:
	mov	eax, DWORD PTR -136[rbp]
	cmp	DWORD PTR -128[rbp], eax
	jl	.L17
	mov	eax, DWORD PTR -124[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rsp, rbx
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	"45451180.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012Enter Total Number of Pages:\011\000"
	.align	2
.LC1:
	.ascii	"%d\000"
	.align	2
.LC2:
	.ascii	"\012Enter values of Reference String:\000"
	.align	2
.LC3:
	.ascii	"Value No. [%d]:\011\000"
	.align	2
.LC4:
	.ascii	"\012Enter Total Number of Frames:\011\000"
	.global	__aeabi_idivmod
	.align	2
.LC5:
	.ascii	"%d\011\000"
	.align	2
.LC6:
	.ascii	"\012Total Page Faults:\011%d\012\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	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #84
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-76]
	ldr	r0, .L17+4
	bl	printf
	sub	r3, fp, #88
	mov	r1, r3
	ldr	r0, .L17+8
	bl	__isoc99_scanf
	ldr	r0, .L17+12
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-80]
	b	.L2
.L3:
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L17+16
	bl	printf
	sub	r2, fp, #56
	ldr	r3, [fp, #-80]
	lsl	r3, r3, #2
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L17+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L2:
	ldr	r3, [fp, #-88]
	ldr	r2, [fp, #-80]
	cmp	r2, r3
	blt	.L3
	ldr	r0, .L17+20
	bl	printf
	sub	r3, fp, #84
	mov	r1, r3
	ldr	r0, .L17+8
	bl	__isoc99_scanf
	ldr	ip, [fp, #-84]
	mov	r3, sp
	mov	r4, r3
	sub	r3, ip, #1
	str	r3, [fp, #-64]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-60]
	mov	r3, #0
	str	r3, [fp, #-80]
	b	.L4
.L5:
	ldr	r3, [fp, #-60]
	ldr	r2, [fp, #-80]
	mvn	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L4:
	ldr	r3, [fp, #-84]
	ldr	r2, [fp, #-80]
	cmp	r2, r3
	blt	.L5
	mov	r3, #0
	str	r3, [fp, #-80]
	b	.L6
.L14:
	mov	r3, #0
	str	r3, [fp, #-68]
	mov	r3, #0
	str	r3, [fp, #-72]
	b	.L7
.L9:
	ldr	r3, [fp, #-80]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r2, [r3, #-44]
	ldr	r3, [fp, #-60]
	ldr	r1, [fp, #-72]
	ldr	r3, [r3, r1, lsl #2]
	cmp	r2, r3
	bne	.L8
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
	ldr	r3, [fp, #-76]
	sub	r3, r3, #1
	str	r3, [fp, #-76]
.L8:
	ldr	r3, [fp, #-72]
	add	r3, r3, #1
	str	r3, [fp, #-72]
.L7:
	ldr	r3, [fp, #-84]
	ldr	r2, [fp, #-72]
	cmp	r2, r3
	blt	.L9
	ldr	r3, [fp, #-76]
	add	r3, r3, #1
	str	r3, [fp, #-76]
	ldr	r3, [fp, #-84]
	ldr	r2, [fp, #-76]
	cmp	r2, r3
	bgt	.L10
	ldr	r3, [fp, #-68]
	cmp	r3, #0
	bne	.L10
	ldr	r3, [fp, #-80]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r1, [r3, #-44]
	ldr	r3, [fp, #-60]
	ldr	r2, [fp, #-80]
	str	r1, [r3, r2, lsl #2]
	b	.L11
.L10:
	ldr	r3, [fp, #-68]
	cmp	r3, #0
	bne	.L11
	ldr	r3, [fp, #-76]
	sub	r3, r3, #1
	ldr	r2, [fp, #-84]
	mov	r1, r2
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	mov	r1, r3
	ldr	r3, [fp, #-80]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r2, [r3, #-44]
	ldr	r3, [fp, #-60]
	str	r2, [r3, r1, lsl #2]
.L11:
	mov	r0, #10
	bl	putchar
	mov	r3, #0
	str	r3, [fp, #-72]
	b	.L12
.L13:
	ldr	r3, [fp, #-60]
	ldr	r2, [fp, #-72]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, r3
	ldr	r0, .L17+24
	bl	printf
	ldr	r3, [fp, #-72]
	add	r3, r3, #1
	str	r3, [fp, #-72]
.L12:
	ldr	r3, [fp, #-84]
	ldr	r2, [fp, #-72]
	cmp	r2, r3
	blt	.L13
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L6:
	ldr	r3, [fp, #-88]
	ldr	r2, [fp, #-80]
	cmp	r2, r3
	blt	.L14
	ldr	r1, [fp, #-76]
	ldr	r0, .L17+28
	bl	printf
	mov	r3, #0
	mov	sp, r4
	ldr	r2, .L17
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L16
	bl	__stack_chk_fail
.L16:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC7
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
