	.file	"1203.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	" Enter the total memory available(in Bytes)-- "
.LC1:
	.string	" %d"
	.align 8
.LC2:
	.string	" Enter the number of blocks-- "
.LC3:
	.string	" Enter size of partition %d: "
.LC4:
	.string	"%d"
	.align 8
.LC5:
	.string	"\n Enter the number of processes-- "
	.align 8
.LC6:
	.string	" Enter memory required for process %d(in Bytes)-- "
	.align 8
.LC7:
	.string	" \nNo.of Blocks available in memory-- %d"
	.align 8
.LC8:
	.string	" \n\nPROCESS\tMEMORY REQUIRED\t ALLOCATED\tINTERNAL FRAGMENTATION"
.LC9:
	.string	" \n %d\t\t%d"
.LC10:
	.string	" \t\tYES\t%d"
.LC11:
	.string	" \t\tNO\t-- "
	.align 8
.LC12:
	.string	" \nMemory is Full, Remaining Processes cannot be accomodated"
	.align 8
.LC13:
	.string	" \n\nTotal Internal Fragmentation is %d"
	.align 8
.LC14:
	.string	" \nTotal External Fragmentation is %d"
	.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, 136
	.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	rax, rsp
	mov	rbx, rax
	mov	DWORD PTR -104[rbp], 0
	mov	DWORD PTR -100[rbp], 0
	mov	DWORD PTR -96[rbp], 0
	lea	rdi, .LC0[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
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -128[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -128[rbp]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -88[rbp], rdx
	movsx	rdx, eax
	mov	QWORD PTR -160[rbp], rdx
	mov	QWORD PTR -152[rbp], 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
.L2:
	cmp	rsp, rdx
	je	.L3
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L2
.L3:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L4
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L4:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -80[rbp], rax
	mov	DWORD PTR -112[rbp], 0
	mov	DWORD PTR -116[rbp], 0
	jmp	.L5
.L6:
	mov	eax, DWORD PTR -116[rbp]
	add	eax, 1
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -116[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	rax, QWORD PTR -80[rbp]
	mov	edx, DWORD PTR -116[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	add	DWORD PTR -112[rbp], eax
	add	DWORD PTR -116[rbp], 1
.L5:
	mov	eax, DWORD PTR -128[rbp]
	cmp	DWORD PTR -116[rbp], eax
	jl	.L6
	mov	eax, DWORD PTR -132[rbp]
	sub	eax, DWORD PTR -112[rbp]
	mov	DWORD PTR -100[rbp], eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -124[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -124[rbp]
	mov	rdx, rsp
	mov	r12, rdx
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -72[rbp], rdx
	movsx	rdx, eax
	mov	QWORD PTR -176[rbp], rdx
	mov	QWORD PTR -168[rbp], 0
	movsx	rdx, eax
	mov	r14, rdx
	mov	r15d, 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
.L7:
	cmp	rsp, rdx
	je	.L8
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L7
.L8:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L9
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L9:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -64[rbp], rax
	mov	DWORD PTR -108[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -108[rbp]
	add	eax, 1
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -108[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	add	DWORD PTR -108[rbp], 1
.L10:
	mov	eax, DWORD PTR -124[rbp]
	cmp	DWORD PTR -108[rbp], eax
	jl	.L11
	mov	eax, DWORD PTR -128[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -108[rbp], 0
	jmp	.L12
.L18:
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -108[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	edx, DWORD PTR -108[rbp]
	lea	ecx, 1[rdx]
	mov	edx, eax
	mov	esi, ecx
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -120[rbp], 0
	jmp	.L13
.L17:
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -108[rbp]
	movsx	rdx, edx
	mov	ecx, DWORD PTR [rax+rdx*4]
	mov	rax, QWORD PTR -80[rbp]
	mov	edx, DWORD PTR -120[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	cmp	ecx, eax
	jg	.L14
	mov	rax, QWORD PTR -80[rbp]
	mov	edx, DWORD PTR -120[rbp]
	movsx	rdx, edx
	mov	ecx, DWORD PTR [rax+rdx*4]
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -108[rbp]
	movsx	rdx, edx
	mov	edx, DWORD PTR [rax+rdx*4]
	mov	eax, ecx
	sub	eax, edx
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -80[rbp]
	mov	edx, DWORD PTR -120[rbp]
	movsx	rdx, edx
	mov	edx, DWORD PTR [rax+rdx*4]
	mov	eax, DWORD PTR -104[rbp]
	lea	ecx, [rdx+rax]
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -108[rbp]
	movsx	rdx, edx
	mov	edx, DWORD PTR [rax+rdx*4]
	mov	eax, ecx
	sub	eax, edx
	mov	DWORD PTR -104[rbp], eax
	mov	rax, QWORD PTR -80[rbp]
	mov	edx, DWORD PTR -120[rbp]
	movsx	rdx, edx
	mov	ecx, DWORD PTR [rax+rdx*4]
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -108[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	sub	ecx, eax
	mov	rax, QWORD PTR -80[rbp]
	mov	edx, DWORD PTR -120[rbp]
	movsx	rdx, edx
	mov	DWORD PTR [rax+rdx*4], ecx
	jmp	.L15
.L14:
	mov	eax, DWORD PTR -128[rbp]
	sub	eax, 1
	cmp	DWORD PTR -120[rbp], eax
	jne	.L16
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
.L16:
	add	DWORD PTR -120[rbp], 1
.L13:
	mov	eax, DWORD PTR -128[rbp]
	cmp	DWORD PTR -120[rbp], eax
	jl	.L17
.L15:
	add	DWORD PTR -108[rbp], 1
.L12:
	mov	eax, DWORD PTR -124[rbp]
	cmp	DWORD PTR -108[rbp], eax
	jl	.L18
	mov	edx, DWORD PTR -100[rbp]
	mov	eax, DWORD PTR -104[rbp]
	add	eax, edx
	mov	DWORD PTR -92[rbp], eax
	mov	eax, DWORD PTR -124[rbp]
	cmp	DWORD PTR -108[rbp], eax
	jge	.L19
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
.L19:
	mov	eax, DWORD PTR -104[rbp]
	mov	esi, eax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -92[rbp]
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rsp, r12
	mov	rsp, rbx
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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	"1203.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	" Enter the total memory available(in Bytes)-- \000"
	.align	2
.LC1:
	.ascii	" %d\000"
	.align	2
.LC2:
	.ascii	" Enter the number of blocks-- \000"
	.align	2
.LC3:
	.ascii	" Enter size of partition %d: \000"
	.align	2
.LC4:
	.ascii	"%d\000"
	.align	2
.LC5:
	.ascii	"\012 Enter the number of processes-- \000"
	.align	2
.LC6:
	.ascii	" Enter memory required for process %d(in Bytes)-- \000"
	.align	2
.LC7:
	.ascii	" \012No.of Blocks available in memory-- %d\000"
	.align	2
.LC8:
	.ascii	" \012\012PROCESS\011MEMORY REQUIRED\011 ALLOCATED\011"
	.ascii	"INTERNAL FRAGMENTATION\000"
	.align	2
.LC9:
	.ascii	" \012 %d\011\011%d\000"
	.align	2
.LC10:
	.ascii	" \011\011YES\011%d\000"
	.align	2
.LC11:
	.ascii	" \011\011NO\011-- \000"
	.align	2
.LC12:
	.ascii	" \012Memory is Full, Remaining Processes cannot be "
	.ascii	"accomodated\000"
	.align	2
.LC13:
	.ascii	" \012\012Total Internal Fragmentation is %d\000"
	.align	2
.LC14:
	.ascii	" \012Total External Fragmentation is %d\000"
	.align	2
.LC15:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #64
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r4, r3
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r3, #0
	str	r3, [fp, #-44]
	mov	r3, #0
	str	r3, [fp, #-40]
	ldr	r0, .L16+4
	bl	printf
	sub	r3, fp, #76
	mov	r1, r3
	ldr	r0, .L16+8
	bl	__isoc99_scanf
	ldr	r0, .L16+12
	bl	printf
	sub	r3, fp, #72
	mov	r1, r3
	ldr	r0, .L16+8
	bl	__isoc99_scanf
	ldr	ip, [fp, #-72]
	sub	r3, ip, #1
	str	r3, [fp, #-36]
	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, #-32]
	mov	r3, #0
	str	r3, [fp, #-56]
	mov	r3, #0
	str	r3, [fp, #-60]
	b	.L2
.L3:
	ldr	r3, [fp, #-60]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L16+16
	bl	printf
	ldr	r3, [fp, #-60]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L16+20
	bl	__isoc99_scanf
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-60]
	ldr	r3, [r3, r2, lsl #2]
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-60]
	add	r3, r3, #1
	str	r3, [fp, #-60]
.L2:
	ldr	r3, [fp, #-72]
	ldr	r2, [fp, #-60]
	cmp	r2, r3
	blt	.L3
	ldr	r2, [fp, #-76]
	ldr	r3, [fp, #-56]
	sub	r3, r2, r3
	str	r3, [fp, #-44]
	ldr	r0, .L16+24
	bl	printf
	sub	r3, fp, #68
	mov	r1, r3
	ldr	r0, .L16+20
	bl	__isoc99_scanf
	ldr	ip, [fp, #-68]
	mov	r3, sp
	mov	r5, r3
	sub	r3, ip, #1
	str	r3, [fp, #-28]
	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, #-24]
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L4
.L5:
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L16+28
	bl	printf
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L16+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L4:
	ldr	r3, [fp, #-68]
	ldr	r2, [fp, #-52]
	cmp	r2, r3
	blt	.L5
	ldr	r3, [fp, #-72]
	mov	r1, r3
	ldr	r0, .L16+32
	bl	printf
	ldr	r0, .L16+36
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L6
.L12:
	ldr	r3, [fp, #-52]
	add	r1, r3, #1
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-52]
	ldr	r3, [r3, r2, lsl #2]
	mov	r2, r3
	ldr	r0, .L16+40
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-64]
	b	.L7
.L11:
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-52]
	ldr	r2, [r3, r2, lsl #2]
	ldr	r3, [fp, #-32]
	ldr	r1, [fp, #-64]
	ldr	r3, [r3, r1, lsl #2]
	cmp	r2, r3
	bgt	.L8
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-64]
	ldr	r2, [r3, r2, lsl #2]
	ldr	r3, [fp, #-24]
	ldr	r1, [fp, #-52]
	ldr	r3, [r3, r1, lsl #2]
	sub	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L16+44
	bl	printf
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-64]
	ldr	r2, [r3, r2, lsl #2]
	ldr	r3, [fp, #-48]
	add	r2, r2, r3
	ldr	r3, [fp, #-24]
	ldr	r1, [fp, #-52]
	ldr	r3, [r3, r1, lsl #2]
	sub	r3, r2, r3
	str	r3, [fp, #-48]
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-64]
	ldr	r2, [r3, r2, lsl #2]
	ldr	r3, [fp, #-24]
	ldr	r1, [fp, #-52]
	ldr	r3, [r3, r1, lsl #2]
	sub	r1, r2, r3
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-64]
	str	r1, [r3, r2, lsl #2]
	b	.L9
.L8:
	ldr	r3, [fp, #-72]
	sub	r3, r3, #1
	ldr	r2, [fp, #-64]
	cmp	r2, r3
	bne	.L10
	ldr	r0, .L16+48
	bl	printf
.L10:
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
.L7:
	ldr	r3, [fp, #-72]
	ldr	r2, [fp, #-64]
	cmp	r2, r3
	blt	.L11
.L9:
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L6:
	ldr	r3, [fp, #-68]
	ldr	r2, [fp, #-52]
	cmp	r2, r3
	blt	.L12
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-48]
	add	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-68]
	ldr	r2, [fp, #-52]
	cmp	r2, r3
	bge	.L13
	ldr	r0, .L16+52
	bl	printf
.L13:
	ldr	r1, [fp, #-48]
	ldr	r0, .L16+56
	bl	printf
	ldr	r1, [fp, #-20]
	ldr	r0, .L16+60
	bl	printf
	mov	r3, #0
	mov	sp, r5
	mov	sp, r4
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC15
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
