	.file	"559635.c"
	.intel_syntax noprefix
	.text
	.globl	MAX_PROCS
	.data
	.align 4
	.type	MAX_PROCS, @object
	.size	MAX_PROCS, 4
MAX_PROCS:
	.long	-1
	.globl	MAX_RESOURCES
	.align 4
	.type	MAX_RESOURCES, @object
	.size	MAX_RESOURCES, 4
MAX_RESOURCES:
	.long	1
	.globl	vector
	.bss
	.align 8
	.type	vector, @object
	.size	vector, 8
vector:
	.zero	8
	.globl	resourceVector
	.align 8
	.type	resourceVector, @object
	.size	resourceVector, 8
resourceVector:
	.zero	8
	.globl	availableVector
	.align 8
	.type	availableVector, @object
	.size	availableVector, 8
availableVector:
	.zero	8
	.globl	array
	.align 8
	.type	array, @object
	.size	array, 8
array:
	.zero	8
	.globl	max_claim
	.align 8
	.type	max_claim, @object
	.size	max_claim, 8
max_claim:
	.zero	8
	.globl	allocation
	.align 8
	.type	allocation, @object
	.size	allocation, 8
allocation:
	.zero	8
	.globl	need
	.align 8
	.type	need, @object
	.size	need, 8
need:
	.zero	8
	.section	.rodata
.LC0:
	.string	"\n\tUnits\tAvailable"
.LC1:
	.string	"-----------------------------"
.LC2:
	.string	"r%d"
.LC3:
	.string	"\t%d\t%d"
	.text
	.globl	PrintResource
	.type	PrintResource, @function
PrintResource:
.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
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR availableVector[rip]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	edx, DWORD PTR 4[rax]
	mov	rcx, QWORD PTR resourceVector[rip]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 3
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 10
	call	putchar@PLT
	add	DWORD PTR -4[rbp], 1
.L2:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -4[rbp], eax
	jle	.L3
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	PrintResource, .-PrintResource
	.section	.rodata
.LC4:
	.string	"\n\tMax Claim"
.LC5:
	.string	"Current"
.LC6:
	.string	"\tPotential"
.LC7:
	.string	"\tr%d"
.LC8:
	.string	"\n--------"
	.align 8
.LC9:
	.string	"------------------------------"
.LC10:
	.string	"p%d"
.LC11:
	.string	"\t%d "
.LC12:
	.string	"\n"
	.text
	.globl	PrintMatrix
	.type	PrintMatrix, @function
PrintMatrix:
.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, 48
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	lea	edx, 1[rax]
	mov	DWORD PTR MAX_RESOURCES[rip], edx
	mov	DWORD PTR -4[rbp], eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -40[rbp], 0
	jmp	.L6
.L7:
	mov	edi, 9
	call	putchar@PLT
	add	DWORD PTR -40[rbp], 1
.L6:
	mov	eax, DWORD PTR -40[rbp]
	cmp	eax, DWORD PTR -4[rbp]
	jle	.L7
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -36[rbp], 0
	jmp	.L8
.L9:
	mov	edi, 9
	call	putchar@PLT
	add	DWORD PTR -36[rbp], 1
.L8:
	mov	eax, DWORD PTR -36[rbp]
	cmp	eax, DWORD PTR -4[rbp]
	jle	.L9
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	DWORD PTR -32[rbp], 0
	jmp	.L10
.L13:
	mov	DWORD PTR -28[rbp], 0
	jmp	.L11
.L12:
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -28[rbp], 1
.L11:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -28[rbp], eax
	jl	.L12
	mov	edi, 9
	call	putchar@PLT
	add	DWORD PTR -32[rbp], 1
.L10:
	cmp	DWORD PTR -32[rbp], 2
	jle	.L13
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -24[rbp], 0
	jmp	.L14
.L15:
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -24[rbp], 1
.L14:
	mov	eax, DWORD PTR -24[rbp]
	cmp	eax, DWORD PTR -4[rbp]
	jle	.L15
	mov	edi, 10
	call	putchar@PLT
	mov	DWORD PTR -20[rbp], 0
	jmp	.L16
.L23:
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -16[rbp], 0
	jmp	.L17
.L18:
	mov	rdx, QWORD PTR max_claim[rip]
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -16[rbp], 1
.L17:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -16[rbp], eax
	jl	.L18
	mov	edi, 9
	call	putchar@PLT
	mov	DWORD PTR -12[rbp], 0
	jmp	.L19
.L20:
	mov	rdx, QWORD PTR allocation[rip]
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -12[rbp], 1
.L19:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -12[rbp], eax
	jl	.L20
	mov	edi, 9
	call	putchar@PLT
	mov	DWORD PTR -8[rbp], 0
	jmp	.L21
.L22:
	mov	rdx, QWORD PTR need[rip]
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -8[rbp], 1
.L21:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L22
	mov	edi, 10
	call	putchar@PLT
	add	DWORD PTR -20[rbp], 1
.L16:
	mov	eax, DWORD PTR MAX_PROCS[rip]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L23
	lea	rdi, .LC12[rip]
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	PrintMatrix, .-PrintMatrix
	.section	.rodata
	.align 8
.LC13:
	.string	"Enter total number of processes: "
.LC14:
	.string	"%d"
	.align 8
.LC15:
	.string	"\nResources must be greater than 0"
	.align 8
.LC16:
	.string	"Enter total number of resources: "
	.align 8
.LC17:
	.string	"\nNo memory is allocated for array.\n"
	.align 8
.LC18:
	.string	"\nNo memory is allocated for vector.\n"
	.align 8
.LC19:
	.string	"Enter number of units for resources (r0 to r%d): "
	.align 8
.LC20:
	.string	"Enter maximum number of units process p%d will request from each resource (r0 to r%d): "
	.align 8
.LC21:
	.string	"Enter number of units of each resource (r0 to r%d) allocated to process p%d: "
	.text
	.globl	EnterParameters
	.type	EnterParameters, @function
EnterParameters:
.LFB8:
	.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, 56
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -60[rbp], 0
	mov	DWORD PTR -56[rbp], 0
	mov	DWORD PTR -52[rbp], 0
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, MAX_PROCS[rip]
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
.L27:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	test	eax, eax
	jg	.L26
	lea	rdi, .LC15[rip]
	call	puts@PLT
.L26:
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, MAX_RESOURCES[rip]
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	test	eax, eax
	jle	.L27
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	sub	eax, 1
	mov	DWORD PTR MAX_RESOURCES[rip], eax
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -32[rbp], 0
	jne	.L28
	lea	rdi, .LC17[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L28:
	mov	DWORD PTR -48[rbp], 0
	jmp	.L29
.L30:
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	DWORD PTR [rax], 0
	add	DWORD PTR -48[rbp], 1
.L29:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -48[rbp], eax
	jle	.L30
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR vector[rip], rax
	mov	edx, DWORD PTR MAX_PROCS[rip]
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	imul	eax, edx
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR array[rip], rax
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR resourceVector[rip], rax
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR availableVector[rip], rax
	mov	edx, DWORD PTR MAX_PROCS[rip]
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	imul	eax, edx
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR max_claim[rip], rax
	mov	edx, DWORD PTR MAX_PROCS[rip]
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	imul	eax, edx
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR allocation[rip], rax
	mov	edx, DWORD PTR MAX_PROCS[rip]
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	imul	eax, edx
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR need[rip], rax
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR resourceVector[rip], rax
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR availableVector[rip], rax
	mov	rax, QWORD PTR vector[rip]
	test	rax, rax
	je	.L31
	mov	rax, QWORD PTR resourceVector[rip]
	test	rax, rax
	je	.L31
	mov	rax, QWORD PTR availableVector[rip]
	test	rax, rax
	jne	.L32
.L31:
	lea	rdi, .LC18[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L32:
	mov	edx, DWORD PTR MAX_PROCS[rip]
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	imul	eax, edx
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR max_claim[rip], rax
	mov	edx, DWORD PTR MAX_PROCS[rip]
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	imul	eax, edx
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR allocation[rip], rax
	mov	edx, DWORD PTR MAX_PROCS[rip]
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	imul	eax, edx
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR need[rip], rax
	mov	DWORD PTR -44[rbp], 0
	jmp	.L33
.L34:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cdqe
	sal	rax, 3
	mov	rcx, QWORD PTR max_claim[rip]
	mov	edx, DWORD PTR -44[rbp]
	movsx	rdx, edx
	sal	rdx, 3
	lea	rbx, [rcx+rdx]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR [rbx], rax
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cdqe
	sal	rax, 3
	mov	rcx, QWORD PTR allocation[rip]
	mov	edx, DWORD PTR -44[rbp]
	movsx	rdx, edx
	sal	rdx, 3
	lea	rbx, [rcx+rdx]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR [rbx], rax
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cdqe
	sal	rax, 3
	mov	rcx, QWORD PTR need[rip]
	mov	edx, DWORD PTR -44[rbp]
	movsx	rdx, edx
	sal	rdx, 3
	lea	rbx, [rcx+rdx]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR [rbx], rax
	add	DWORD PTR -44[rbp], 1
.L33:
	mov	eax, DWORD PTR MAX_PROCS[rip]
	cmp	DWORD PTR -44[rbp], eax
	jl	.L34
	mov	rax, QWORD PTR max_claim[rip]
	test	rax, rax
	je	.L35
	mov	rax, QWORD PTR allocation[rip]
	test	rax, rax
	je	.L35
	mov	rax, QWORD PTR need[rip]
	test	rax, rax
	jne	.L36
.L35:
	lea	rdi, .LC17[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L36:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	mov	esi, eax
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -40[rbp], 0
	jmp	.L37
.L38:
	lea	rax, -60[rbp]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	rdx, QWORD PTR resourceVector[rip]
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	sal	rax, 3
	add	rdx, rax
	mov	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR [rdx], eax
	add	DWORD PTR -40[rbp], 1
.L37:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -40[rbp], eax
	jle	.L38
	mov	DWORD PTR -56[rbp], 0
	jmp	.L39
.L42:
	mov	edx, DWORD PTR MAX_RESOURCES[rip]
	mov	eax, DWORD PTR -56[rbp]
	mov	esi, eax
	lea	rdi, .LC20[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -52[rbp], 0
	jmp	.L40
.L41:
	lea	rax, -60[rbp]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	rdx, QWORD PTR max_claim[rip]
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 2
	add	rdx, rax
	mov	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR [rdx], eax
	add	DWORD PTR -52[rbp], 1
.L40:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -52[rbp], eax
	jle	.L41
	add	DWORD PTR -56[rbp], 1
.L39:
	mov	eax, DWORD PTR MAX_PROCS[rip]
	cmp	DWORD PTR -56[rbp], eax
	jl	.L42
	mov	DWORD PTR -56[rbp], 0
	jmp	.L43
.L46:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	mov	edx, DWORD PTR -56[rbp]
	mov	esi, eax
	lea	rdi, .LC21[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -52[rbp], 0
	jmp	.L44
.L45:
	lea	rax, -60[rbp]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	rdx, QWORD PTR allocation[rip]
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 2
	add	rdx, rax
	mov	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR [rdx], eax
	add	DWORD PTR -52[rbp], 1
.L44:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -52[rbp], eax
	jle	.L45
	add	DWORD PTR -56[rbp], 1
.L43:
	mov	eax, DWORD PTR MAX_PROCS[rip]
	cmp	DWORD PTR -56[rbp], eax
	jl	.L46
	mov	DWORD PTR -52[rbp], 0
	jmp	.L47
.L52:
	mov	DWORD PTR -36[rbp], 0
	jmp	.L48
.L49:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	ecx, DWORD PTR [rax]
	mov	rdx, QWORD PTR allocation[rip]
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rsi, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rsi
	add	edx, ecx
	mov	DWORD PTR [rax], edx
	add	DWORD PTR -36[rbp], 1
.L48:
	mov	eax, DWORD PTR MAX_PROCS[rip]
	cmp	DWORD PTR -36[rbp], eax
	jl	.L49
	mov	rdx, QWORD PTR resourceVector[rip]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edx, DWORD PTR -52[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	mov	rdx, QWORD PTR -32[rbp]
	add	rdx, rcx
	mov	edx, DWORD PTR [rdx]
	sub	eax, edx
	test	eax, eax
	js	.L50
	mov	rdx, QWORD PTR resourceVector[rip]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	mov	ecx, DWORD PTR [rax]
	mov	rsi, QWORD PTR availableVector[rip]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 3
	add	rax, rsi
	sub	edx, ecx
	mov	DWORD PTR 4[rax], edx
	jmp	.L51
.L50:
	mov	rdx, QWORD PTR availableVector[rip]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	DWORD PTR 4[rax], 0
.L51:
	add	DWORD PTR -52[rbp], 1
.L47:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -52[rbp], eax
	jle	.L52
	mov	DWORD PTR -56[rbp], 0
	jmp	.L53
.L56:
	mov	DWORD PTR -52[rbp], 0
	jmp	.L54
.L55:
	mov	rdx, QWORD PTR max_claim[rip]
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	rcx, QWORD PTR allocation[rip]
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	sal	rax, 3
	add	rax, rcx
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 2
	add	rax, rcx
	mov	ecx, DWORD PTR [rax]
	mov	rsi, QWORD PTR need[rip]
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	sal	rax, 3
	add	rax, rsi
	mov	rsi, QWORD PTR [rax]
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 2
	add	rax, rsi
	sub	edx, ecx
	mov	DWORD PTR [rax], edx
	add	DWORD PTR -52[rbp], 1
.L54:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -52[rbp], eax
	jle	.L55
	add	DWORD PTR -56[rbp], 1
.L53:
	mov	eax, DWORD PTR MAX_PROCS[rip]
	cmp	DWORD PTR -56[rbp], eax
	jl	.L56
	mov	eax, 0
	call	PrintResource
	mov	eax, 0
	call	PrintMatrix
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L58
	call	__stack_chk_fail@PLT
.L58:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	EnterParameters, .-EnterParameters
	.section	.rodata
	.align 8
.LC22:
	.string	"\nParameters must first be entered before determining safe sequence.\nPlease enter option #1 first.\n"
.LC23:
	.string	"Checking:"
.LC24:
	.string	" <"
.LC25:
	.string	" %d"
.LC26:
	.string	" > <= <"
.LC27:
	.string	" > :"
.LC28:
	.string	"p%d could not be sequenced\n"
.LC29:
	.string	"p%d safely sequenced\n"
	.align 8
.LC30:
	.string	"\nSystem has an unsafe state. Deadlock reached."
.LC31:
	.string	"\nSafe Sequence = "
.LC32:
	.string	"P%d\n\n"
.LC33:
	.string	"P%d, "
	.text
	.globl	BankerAlgo
	.type	BankerAlgo, @function
BankerAlgo:
.LFB9:
	.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	eax, DWORD PTR MAX_PROCS[rip]
	cmp	eax, -1
	jne	.L60
	lea	rdi, .LC22[rip]
	call	puts@PLT
	jmp	.L59
.L60:
	mov	DWORD PTR -36[rbp], 0
	mov	DWORD PTR -32[rbp], 0
	mov	DWORD PTR -28[rbp], 0
	mov	eax, DWORD PTR MAX_PROCS[rip]
	mov	DWORD PTR -24[rbp], eax
	mov	BYTE PTR -37[rbp], 0
	mov	eax, DWORD PTR MAX_PROCS[rip]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	eax, DWORD PTR MAX_PROCS[rip]
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	je	.L62
	cmp	QWORD PTR -8[rbp], 0
	jne	.L63
.L62:
	lea	rdi, .LC18[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L63:
	mov	DWORD PTR -20[rbp], 0
	jmp	.L64
.L65:
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	DWORD PTR [rax], -1
	add	DWORD PTR -20[rbp], 1
.L64:
	mov	eax, DWORD PTR MAX_PROCS[rip]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L65
	jmp	.L66
.L79:
	mov	DWORD PTR -32[rbp], 0
	jmp	.L67
.L78:
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	xor	eax, 1
	test	al, al
	je	.L68
	lea	rdi, .LC23[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC24[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -28[rbp], 0
	jmp	.L69
.L71:
	mov	rdx, QWORD PTR need[rip]
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC25[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR need[rip]
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	rcx, QWORD PTR availableVector[rip]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 3
	add	rax, rcx
	mov	eax, DWORD PTR 4[rax]
	cmp	edx, eax
	jle	.L70
	mov	BYTE PTR -37[rbp], 1
.L70:
	add	DWORD PTR -28[rbp], 1
.L69:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -28[rbp], eax
	jl	.L71
	lea	rdi, .LC26[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -28[rbp], 0
	jmp	.L72
.L73:
	mov	rdx, QWORD PTR availableVector[rip]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	eax, DWORD PTR 4[rax]
	mov	esi, eax
	lea	rdi, .LC25[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -28[rbp], 1
.L72:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -28[rbp], eax
	jl	.L73
	lea	rdi, .LC27[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	BYTE PTR -37[rbp], 0
	je	.L74
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC28[rip]
	mov	eax, 0
	call	printf@PLT
	sub	DWORD PTR -24[rbp], 1
	jmp	.L68
.L74:
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC29[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 1
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -32[rbp]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR MAX_PROCS[rip]
	sub	eax, 1
	mov	DWORD PTR -24[rbp], eax
	mov	DWORD PTR -28[rbp], 0
	jmp	.L75
.L76:
	mov	rdx, QWORD PTR availableVector[rip]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	ecx, DWORD PTR 4[rax]
	mov	rdx, QWORD PTR allocation[rip]
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	rsi, QWORD PTR availableVector[rip]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 3
	add	rax, rsi
	add	edx, ecx
	mov	DWORD PTR 4[rax], edx
	add	DWORD PTR -28[rbp], 1
.L75:
	mov	eax, DWORD PTR MAX_RESOURCES[rip]
	cmp	DWORD PTR -28[rbp], eax
	jl	.L76
	add	DWORD PTR -36[rbp], 1
.L68:
	mov	BYTE PTR -37[rbp], 0
	cmp	DWORD PTR -24[rbp], 0
	jne	.L77
	lea	rdi, .LC30[rip]
	call	puts@PLT
	jmp	.L59
.L77:
	add	DWORD PTR -32[rbp], 1
.L67:
	mov	eax, DWORD PTR MAX_PROCS[rip]
	cmp	DWORD PTR -32[rbp], eax
	jl	.L78
.L66:
	mov	eax, DWORD PTR MAX_PROCS[rip]
	cmp	DWORD PTR -36[rbp], eax
	jl	.L79
	lea	rdi, .LC31[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -32[rbp], 0
	jmp	.L80
.L83:
	mov	eax, DWORD PTR -32[rbp]
	lea	edx, 1[rax]
	mov	eax, DWORD PTR MAX_PROCS[rip]
	cmp	edx, eax
	jne	.L81
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC32[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L82
.L81:
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC33[rip]
	mov	eax, 0
	call	printf@PLT
.L82:
	add	DWORD PTR -32[rbp], 1
.L80:
	mov	eax, DWORD PTR MAX_PROCS[rip]
	cmp	DWORD PTR -32[rbp], eax
	jl	.L83
	nop
.L59:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	BankerAlgo, .-BankerAlgo
	.section	.rodata
.LC34:
	.string	"\nMemory has been freed"
	.text
	.globl	FreeMemoryQuitProgram
	.type	FreeMemoryQuitProgram, @function
FreeMemoryQuitProgram:
.LFB10:
	.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 vector[rip]
	test	rax, rax
	je	.L85
	mov	rax, QWORD PTR vector[rip]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR vector[rip], 0
.L85:
	mov	rax, QWORD PTR array[rip]
	test	rax, rax
	je	.L86
	mov	rax, QWORD PTR array[rip]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR array[rip], 0
.L86:
	mov	rax, QWORD PTR resourceVector[rip]
	test	rax, rax
	je	.L87
	mov	rax, QWORD PTR resourceVector[rip]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR resourceVector[rip], 0
.L87:
	mov	rax, QWORD PTR availableVector[rip]
	test	rax, rax
	je	.L88
	mov	rax, QWORD PTR availableVector[rip]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR availableVector[rip], 0
.L88:
	mov	rax, QWORD PTR max_claim[rip]
	test	rax, rax
	je	.L89
	mov	rax, QWORD PTR max_claim[rip]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR max_claim[rip], 0
.L89:
	mov	rax, QWORD PTR allocation[rip]
	test	rax, rax
	je	.L90
	mov	rax, QWORD PTR allocation[rip]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR allocation[rip], 0
.L90:
	mov	rax, QWORD PTR need[rip]
	test	rax, rax
	je	.L91
	mov	rax, QWORD PTR need[rip]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR need[rip], 0
.L91:
	lea	rdi, .LC34[rip]
	call	puts@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	FreeMemoryQuitProgram, .-FreeMemoryQuitProgram
	.section	.rodata
	.align 8
.LC35:
	.string	"Batch Scheduling\n------------------------------"
.LC36:
	.string	"1) Enter parameters"
.LC37:
	.string	"2) Determine safe sequence"
	.align 8
.LC38:
	.string	"3) Quit program and free memory"
.LC39:
	.string	"\nEnter selection: "
	.align 8
.LC40:
	.string	"Invalid selection made, try again.\n"
	.align 8
.LC41:
	.string	"\nThank you for using the Banker's Algorithm program, have a good day!"
	.text
	.globl	main
	.type	main, @function
main:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -16[rbp], 0
	jmp	.L94
.L103:
	lea	rdi, .LC35[rip]
	call	puts@PLT
	lea	rdi, .LC36[rip]
	call	puts@PLT
	lea	rdi, .LC37[rip]
	call	puts@PLT
	lea	rdi, .LC38[rip]
	call	puts@PLT
	lea	rdi, .LC39[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, 1
	jne	.L95
	mov	DWORD PTR -12[rbp], 0
	jmp	.L96
.L95:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, 2
	jne	.L97
	mov	DWORD PTR -12[rbp], 1
	jmp	.L96
.L97:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, 3
	jne	.L98
	mov	DWORD PTR -12[rbp], 2
	jmp	.L96
.L98:
	mov	DWORD PTR -12[rbp], 3
.L96:
	cmp	DWORD PTR -12[rbp], 3
	je	.L99
	cmp	DWORD PTR -12[rbp], 3
	ja	.L94
	cmp	DWORD PTR -12[rbp], 2
	je	.L100
	cmp	DWORD PTR -12[rbp], 2
	ja	.L94
	cmp	DWORD PTR -12[rbp], 0
	je	.L101
	cmp	DWORD PTR -12[rbp], 1
	je	.L102
	jmp	.L94
.L101:
	mov	eax, 0
	call	EnterParameters
	jmp	.L94
.L102:
	mov	eax, 0
	call	BankerAlgo
	jmp	.L94
.L100:
	mov	eax, 0
	call	FreeMemoryQuitProgram
	jmp	.L94
.L99:
	lea	rdi, .LC40[rip]
	call	puts@PLT
.L94:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, 3
	jne	.L103
	lea	rdi, .LC41[rip]
	call	puts@PLT
	mov	eax, 1
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L105
	call	__stack_chk_fail@PLT
.L105:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	"559635.c"
	.text
	.global	MAX_PROCS
	.data
	.align	2
	.type	MAX_PROCS, %object
	.size	MAX_PROCS, 4
MAX_PROCS:
	.word	-1
	.global	MAX_RESOURCES
	.align	2
	.type	MAX_RESOURCES, %object
	.size	MAX_RESOURCES, 4
MAX_RESOURCES:
	.word	1
	.global	vector
	.bss
	.align	2
	.type	vector, %object
	.size	vector, 4
vector:
	.space	4
	.global	resourceVector
	.align	2
	.type	resourceVector, %object
	.size	resourceVector, 4
resourceVector:
	.space	4
	.global	availableVector
	.align	2
	.type	availableVector, %object
	.size	availableVector, 4
availableVector:
	.space	4
	.global	array
	.align	2
	.type	array, %object
	.size	array, 4
array:
	.space	4
	.global	max_claim
	.align	2
	.type	max_claim, %object
	.size	max_claim, 4
max_claim:
	.space	4
	.global	allocation
	.align	2
	.type	allocation, %object
	.size	allocation, 4
allocation:
	.space	4
	.global	need
	.align	2
	.type	need, %object
	.size	need, 4
need:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012\011Units\011Available\000"
	.align	2
.LC1:
	.ascii	"-----------------------------\000"
	.align	2
.LC2:
	.ascii	"r%d\000"
	.align	2
.LC3:
	.ascii	"\011%d\011%d\000"
	.text
	.align	2
	.global	PrintResource
	.syntax unified
	.arm
	.fpu softvfp
	.type	PrintResource, %function
PrintResource:
	@ 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	r0, .L5
	bl	puts
	ldr	r0, .L5+4
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L3:
	ldr	r1, [fp, #-8]
	ldr	r0, .L5+8
	bl	printf
	ldr	r3, .L5+12
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, .L5+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r0, .L5+20
	bl	printf
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, .L5+24
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	ble	.L3
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	resourceVector
	.word	availableVector
	.word	.LC3
	.word	MAX_RESOURCES
	.size	PrintResource, .-PrintResource
	.section	.rodata
	.align	2
.LC4:
	.ascii	"\012\011Max Claim\000"
	.align	2
.LC5:
	.ascii	"Current\000"
	.align	2
.LC6:
	.ascii	"\011Potential\000"
	.align	2
.LC7:
	.ascii	"\011r%d\000"
	.align	2
.LC8:
	.ascii	"\012--------\000"
	.align	2
.LC9:
	.ascii	"------------------------------\000"
	.align	2
.LC10:
	.ascii	"p%d\000"
	.align	2
.LC11:
	.ascii	"\011%d \000"
	.align	2
.LC12:
	.ascii	"\012\000"
	.text
	.align	2
	.global	PrintMatrix
	.syntax unified
	.arm
	.fpu softvfp
	.type	PrintMatrix, %function
PrintMatrix:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	ldr	r3, .L27
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r1, .L27
	str	r2, [r1]
	str	r3, [fp, #-8]
	ldr	r0, .L27+4
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L8
.L9:
	mov	r0, #9
	bl	putchar
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L8:
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	ble	.L9
	ldr	r0, .L27+8
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L10
.L11:
	mov	r0, #9
	bl	putchar
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L10:
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	ble	.L11
	ldr	r0, .L27+12
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L12
.L15:
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L13
.L14:
	ldr	r1, [fp, #-32]
	ldr	r0, .L27+16
	bl	printf
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L13:
	ldr	r3, .L27
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	blt	.L14
	mov	r0, #9
	bl	putchar
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L12:
	ldr	r3, [fp, #-36]
	cmp	r3, #2
	ble	.L15
	ldr	r0, .L27+20
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L16
.L17:
	ldr	r0, .L27+24
	bl	printf
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L16:
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	ble	.L17
	mov	r0, #10
	bl	putchar
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L18
.L25:
	ldr	r1, [fp, #-24]
	ldr	r0, .L27+28
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L19
.L20:
	ldr	r3, .L27+32
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L27+36
	bl	printf
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L19:
	ldr	r3, .L27
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L20
	mov	r0, #9
	bl	putchar
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L21
.L22:
	ldr	r3, .L27+40
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L27+36
	bl	printf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L21:
	ldr	r3, .L27
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L22
	mov	r0, #9
	bl	putchar
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L23
.L24:
	ldr	r3, .L27+44
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L27+36
	bl	printf
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L23:
	ldr	r3, .L27
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L24
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L18:
	ldr	r3, .L27+48
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L25
	ldr	r0, .L27+52
	bl	puts
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L28:
	.align	2
.L27:
	.word	MAX_RESOURCES
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	max_claim
	.word	.LC11
	.word	allocation
	.word	need
	.word	MAX_PROCS
	.word	.LC12
	.size	PrintMatrix, .-PrintMatrix
	.section	.rodata
	.align	2
.LC13:
	.ascii	"Enter total number of processes: \000"
	.align	2
.LC14:
	.ascii	"%d\000"
	.align	2
.LC15:
	.ascii	"\012Resources must be greater than 0\000"
	.align	2
.LC16:
	.ascii	"Enter total number of resources: \000"
	.align	2
.LC17:
	.ascii	"\012No memory is allocated for array.\012\000"
	.align	2
.LC18:
	.ascii	"\012No memory is allocated for vector.\012\000"
	.align	2
.LC19:
	.ascii	"Enter number of units for resources (r0 to r%d): \000"
	.align	2
.LC20:
	.ascii	"Enter maximum number of units process p%d will requ"
	.ascii	"est from each resource (r0 to r%d): \000"
	.align	2
.LC21:
	.ascii	"Enter number of units of each resource (r0 to r%d) "
	.ascii	"allocated to process p%d: \000"
	.align	2
.LC22:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	EnterParameters
	.syntax unified
	.arm
	.fpu softvfp
	.type	EnterParameters, %function
EnterParameters:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #44
	ldr	r3, .L63
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r3, #0
	str	r3, [fp, #-44]
	mov	r3, #0
	str	r3, [fp, #-40]
	ldr	r0, .L63+4
	bl	printf
	ldr	r1, .L63+8
	ldr	r0, .L63+12
	bl	__isoc99_scanf
.L31:
	ldr	r3, .L63+16
	ldr	r3, [r3]
	cmp	r3, #0
	bgt	.L30
	ldr	r0, .L63+20
	bl	puts
.L30:
	ldr	r0, .L63+24
	bl	printf
	ldr	r1, .L63+16
	ldr	r0, .L63+12
	bl	__isoc99_scanf
	ldr	r3, .L63+16
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L31
	ldr	r3, .L63+16
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L63+16
	str	r3, [r2]
	ldr	r3, .L63+16
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L32
	ldr	r0, .L63+28
	bl	puts
	mov	r0, #0
	bl	exit
.L32:
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L33
.L34:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L33:
	ldr	r3, .L63+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	ble	.L34
	ldr	r3, .L63+16
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+32
	str	r2, [r3]
	ldr	r3, .L63+8
	ldr	r3, [r3]
	ldr	r2, .L63+16
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+36
	str	r2, [r3]
	ldr	r3, .L63+16
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+40
	str	r2, [r3]
	ldr	r3, .L63+16
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+44
	str	r2, [r3]
	ldr	r3, .L63+8
	ldr	r3, [r3]
	ldr	r2, .L63+16
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+48
	str	r2, [r3]
	ldr	r3, .L63+8
	ldr	r3, [r3]
	ldr	r2, .L63+16
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+52
	str	r2, [r3]
	ldr	r3, .L63+8
	ldr	r3, [r3]
	ldr	r2, .L63+16
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+56
	str	r2, [r3]
	ldr	r3, .L63+16
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+40
	str	r2, [r3]
	ldr	r3, .L63+16
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+44
	str	r2, [r3]
	ldr	r3, .L63+32
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L35
	ldr	r3, .L63+40
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L35
	ldr	r3, .L63+44
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L36
.L35:
	ldr	r0, .L63+60
	bl	puts
	mov	r0, #0
	bl	exit
.L36:
	ldr	r3, .L63+8
	ldr	r3, [r3]
	ldr	r2, .L63+16
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+48
	str	r2, [r3]
	ldr	r3, .L63+8
	ldr	r3, [r3]
	ldr	r2, .L63+16
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+52
	str	r2, [r3]
	ldr	r3, .L63+8
	ldr	r3, [r3]
	ldr	r2, .L63+16
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+56
	str	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L37
.L38:
	ldr	r3, .L63+16
	ldr	r3, [r3]
	lsl	r1, r3, #2
	ldr	r3, .L63+48
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	add	r4, r2, r3
	mov	r0, r1
	bl	malloc
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, .L63+16
	ldr	r3, [r3]
	lsl	r1, r3, #2
	ldr	r3, .L63+52
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	add	r4, r2, r3
	mov	r0, r1
	bl	malloc
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, .L63+16
	ldr	r3, [r3]
	lsl	r1, r3, #2
	ldr	r3, .L63+56
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	add	r4, r2, r3
	mov	r0, r1
	bl	malloc
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L37:
	ldr	r3, .L63+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	blt	.L38
	ldr	r3, .L63+48
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L39
	ldr	r3, .L63+52
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L39
	ldr	r3, .L63+56
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L40
.L39:
	ldr	r0, .L63+28
	bl	puts
	mov	r0, #0
	bl	exit
.L40:
	ldr	r3, .L63+16
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L63+64
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L41
.L42:
	sub	r3, fp, #48
	mov	r1, r3
	ldr	r0, .L63+12
	bl	__isoc99_scanf
	ldr	r3, .L63+40
	ldr	r2, [r3]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r2, [fp, #-48]
	str	r2, [r3]
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L41:
	ldr	r3, .L63+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	ble	.L42
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L43
.L46:
	ldr	r3, .L63+16
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, [fp, #-44]
	ldr	r0, .L63+68
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L44
.L45:
	sub	r3, fp, #48
	mov	r1, r3
	ldr	r0, .L63+12
	bl	__isoc99_scanf
	ldr	r3, .L63+48
	ldr	r2, [r3]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [fp, #-48]
	str	r2, [r3]
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L44:
	ldr	r3, .L63+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-40]
	cmp	r2, r3
	ble	.L45
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L43:
	ldr	r3, .L63+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-44]
	cmp	r2, r3
	blt	.L46
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L47
.L50:
	ldr	r3, .L63+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-44]
	mov	r1, r3
	ldr	r0, .L63+72
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L48
.L49:
	sub	r3, fp, #48
	mov	r1, r3
	ldr	r0, .L63+12
	bl	__isoc99_scanf
	ldr	r3, .L63+52
	ldr	r2, [r3]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [fp, #-48]
	str	r2, [r3]
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L48:
	ldr	r3, .L63+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-40]
	cmp	r2, r3
	ble	.L49
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L47:
	ldr	r3, .L63+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-44]
	cmp	r2, r3
	blt	.L50
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L51
.L56:
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L52
.L53:
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, .L63+52
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	ldr	r0, [fp, #-20]
	add	r3, r0, r3
	add	r2, r1, r2
	str	r2, [r3]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L52:
	ldr	r3, .L63+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L53
	ldr	r3, .L63+40
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-20]
	add	r3, r1, r3
	ldr	r3, [r3]
	sub	r3, r2, r3
	cmp	r3, #0
	blt	.L54
	ldr	r3, .L63+40
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, .L63+44
	ldr	r0, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #3
	add	r3, r0, r3
	sub	r2, r1, r2
	str	r2, [r3, #4]
	b	.L55
.L54:
	ldr	r3, .L63+44
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #3
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3, #4]
.L55:
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L51:
	ldr	r3, .L63+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-40]
	cmp	r2, r3
	ble	.L56
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L57
.L60:
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L58
.L59:
	ldr	r3, .L63+48
	ldr	r2, [r3]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, .L63+52
	ldr	r2, [r3]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, .L63+56
	ldr	r0, [r3]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	add	r3, r0, r3
	ldr	r0, [r3]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	add	r3, r0, r3
	sub	r2, r1, r2
	str	r2, [r3]
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L58:
	ldr	r3, .L63+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-40]
	cmp	r2, r3
	ble	.L59
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L57:
	ldr	r3, .L63+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-44]
	cmp	r2, r3
	blt	.L60
	bl	PrintResource
	bl	PrintMatrix
	nop
	ldr	r3, .L63
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L62
	bl	__stack_chk_fail
.L62:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L64:
	.align	2
.L63:
	.word	.LC22
	.word	.LC13
	.word	MAX_PROCS
	.word	.LC14
	.word	MAX_RESOURCES
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	vector
	.word	array
	.word	resourceVector
	.word	availableVector
	.word	max_claim
	.word	allocation
	.word	need
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.size	EnterParameters, .-EnterParameters
	.section	.rodata
	.align	2
.LC23:
	.ascii	"\012Parameters must first be entered before determi"
	.ascii	"ning safe sequence.\012Please enter option #1 first"
	.ascii	".\012\000"
	.align	2
.LC24:
	.ascii	"Checking:\000"
	.align	2
.LC25:
	.ascii	" <\000"
	.align	2
.LC26:
	.ascii	" %d\000"
	.align	2
.LC27:
	.ascii	" > <= <\000"
	.align	2
.LC28:
	.ascii	" > :\000"
	.align	2
.LC29:
	.ascii	"p%d could not be sequenced\012\000"
	.align	2
.LC30:
	.ascii	"p%d safely sequenced\012\000"
	.align	2
.LC31:
	.ascii	"\012System has an unsafe state. Deadlock reached.\000"
	.align	2
.LC32:
	.ascii	"\012Safe Sequence = \000"
	.align	2
.LC33:
	.ascii	"P%d\012\012\000"
	.align	2
.LC34:
	.ascii	"P%d, \000"
	.text
	.align	2
	.global	BankerAlgo
	.syntax unified
	.arm
	.fpu softvfp
	.type	BankerAlgo, %function
BankerAlgo:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	ldr	r3, .L90
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L66
	ldr	r0, .L90+4
	bl	puts
	b	.L65
.L66:
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-24]
	ldr	r3, .L90
	ldr	r3, [r3]
	str	r3, [fp, #-20]
	mov	r3, #0
	strb	r3, [fp, #-33]
	ldr	r3, .L90
	ldr	r3, [r3]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, .L90
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L68
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L69
.L68:
	ldr	r0, .L90+8
	bl	puts
	mov	r0, #0
	bl	exit
.L69:
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L70
.L71:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	mvn	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L70:
	ldr	r3, .L90
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L71
	b	.L72
.L85:
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L73
.L84:
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	beq	.L74
	ldr	r0, .L90+12
	bl	printf
	ldr	r0, .L90+16
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L75
.L77:
	ldr	r3, .L90+20
	ldr	r2, [r3]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L90+24
	bl	printf
	ldr	r3, .L90+20
	ldr	r2, [r3]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, .L90+28
	ldr	r1, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #3
	add	r3, r1, r3
	ldr	r3, [r3, #4]
	cmp	r2, r3
	ble	.L76
	mov	r3, #1
	strb	r3, [fp, #-33]
.L76:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L75:
	ldr	r3, .L90+32
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L77
	ldr	r0, .L90+36
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L78
.L79:
	ldr	r3, .L90+28
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	mov	r1, r3
	ldr	r0, .L90+24
	bl	printf
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L78:
	ldr	r3, .L90+32
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L79
	ldr	r0, .L90+40
	bl	printf
	ldrb	r3, [fp, #-33]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L80
	ldr	r1, [fp, #-28]
	ldr	r0, .L90+44
	bl	printf
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	str	r3, [fp, #-20]
	b	.L74
.L80:
	ldr	r1, [fp, #-28]
	ldr	r0, .L90+48
	bl	printf
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	mov	r2, #1
	strb	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, [fp, #-28]
	str	r2, [r3]
	ldr	r3, .L90
	ldr	r3, [r3]
	sub	r3, r3, #1
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L81
.L82:
	ldr	r3, .L90+28
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r1, [r3, #4]
	ldr	r3, .L90+52
	ldr	r2, [r3]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, .L90+28
	ldr	r0, [r3]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #3
	add	r3, r0, r3
	add	r2, r1, r2
	str	r2, [r3, #4]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L81:
	ldr	r3, .L90+32
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L82
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L74:
	mov	r3, #0
	strb	r3, [fp, #-33]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L83
	ldr	r0, .L90+56
	bl	puts
	b	.L65
.L83:
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L73:
	ldr	r3, .L90
	ldr	r3, [r3]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	blt	.L84
.L72:
	ldr	r3, .L90
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	blt	.L85
	ldr	r0, .L90+60
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L86
.L89:
	ldr	r3, [fp, #-28]
	add	r2, r3, #1
	ldr	r3, .L90
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L87
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L90+64
	bl	printf
	b	.L88
.L87:
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L90+68
	bl	printf
.L88:
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L86:
	ldr	r3, .L90
	ldr	r3, [r3]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	blt	.L89
	nop
.L65:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L91:
	.align	2
.L90:
	.word	MAX_PROCS
	.word	.LC23
	.word	.LC18
	.word	.LC24
	.word	.LC25
	.word	need
	.word	.LC26
	.word	availableVector
	.word	MAX_RESOURCES
	.word	.LC27
	.word	.LC28
	.word	.LC29
	.word	.LC30
	.word	allocation
	.word	.LC31
	.word	.LC32
	.word	.LC33
	.word	.LC34
	.size	BankerAlgo, .-BankerAlgo
	.section	.rodata
	.align	2
.LC35:
	.ascii	"\012Memory has been freed\000"
	.text
	.align	2
	.global	FreeMemoryQuitProgram
	.syntax unified
	.arm
	.fpu softvfp
	.type	FreeMemoryQuitProgram, %function
FreeMemoryQuitProgram:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L101
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L93
	ldr	r3, .L101
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L101
	mov	r2, #0
	str	r2, [r3]
.L93:
	ldr	r3, .L101+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L94
	ldr	r3, .L101+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L101+4
	mov	r2, #0
	str	r2, [r3]
.L94:
	ldr	r3, .L101+8
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L95
	ldr	r3, .L101+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L101+8
	mov	r2, #0
	str	r2, [r3]
.L95:
	ldr	r3, .L101+12
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L96
	ldr	r3, .L101+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L101+12
	mov	r2, #0
	str	r2, [r3]
.L96:
	ldr	r3, .L101+16
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L97
	ldr	r3, .L101+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L101+16
	mov	r2, #0
	str	r2, [r3]
.L97:
	ldr	r3, .L101+20
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L98
	ldr	r3, .L101+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L101+20
	mov	r2, #0
	str	r2, [r3]
.L98:
	ldr	r3, .L101+24
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L99
	ldr	r3, .L101+24
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L101+24
	mov	r2, #0
	str	r2, [r3]
.L99:
	ldr	r0, .L101+28
	bl	puts
	nop
	pop	{fp, pc}
.L102:
	.align	2
.L101:
	.word	vector
	.word	array
	.word	resourceVector
	.word	availableVector
	.word	max_claim
	.word	allocation
	.word	need
	.word	.LC35
	.size	FreeMemoryQuitProgram, .-FreeMemoryQuitProgram
	.section	.rodata
	.align	2
.LC36:
	.ascii	"Batch Scheduling\012------------------------------\000"
	.align	2
.LC37:
	.ascii	"1) Enter parameters\000"
	.align	2
.LC38:
	.ascii	"2) Determine safe sequence\000"
	.align	2
.LC39:
	.ascii	"3) Quit program and free memory\000"
	.align	2
.LC40:
	.ascii	"\012Enter selection: \000"
	.align	2
.LC41:
	.ascii	"Invalid selection made, try again.\012\000"
	.align	2
.LC42:
	.ascii	"\012Thank you for using the Banker's Algorithm prog"
	.ascii	"ram, have a good day!\000"
	.align	2
.LC43:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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, .L118
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-16]
	nop
	b	.L109
.L115:
	ldr	r0, .L118+4
	bl	puts
	ldr	r0, .L118+8
	bl	puts
	ldr	r0, .L118+12
	bl	puts
	ldr	r0, .L118+16
	bl	puts
	ldr	r0, .L118+20
	bl	printf
	sub	r3, fp, #16
	mov	r1, r3
	ldr	r0, .L118+24
	bl	__isoc99_scanf
	ldr	r3, [fp, #-16]
	cmp	r3, #1
	bne	.L105
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L106
.L105:
	ldr	r3, [fp, #-16]
	cmp	r3, #2
	bne	.L107
	mov	r3, #1
	str	r3, [fp, #-12]
	b	.L106
.L107:
	ldr	r3, [fp, #-16]
	cmp	r3, #3
	bne	.L108
	mov	r3, #2
	str	r3, [fp, #-12]
	b	.L106
.L108:
	mov	r3, #3
	str	r3, [fp, #-12]
.L106:
	ldr	r3, [fp, #-12]
	cmp	r3, #3
	ldrls	pc, [pc, r3, asl #2]
	b	.L109
.L111:
	.word	.L114
	.word	.L113
	.word	.L112
	.word	.L110
.L114:
	bl	EnterParameters
	b	.L109
.L113:
	bl	BankerAlgo
	b	.L109
.L112:
	bl	FreeMemoryQuitProgram
	b	.L109
.L110:
	ldr	r0, .L118+28
	bl	puts
.L109:
	ldr	r3, [fp, #-16]
	cmp	r3, #3
	bne	.L115
	ldr	r0, .L118+32
	bl	puts
	mov	r3, #1
	ldr	r2, .L118
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L117
	bl	__stack_chk_fail
.L117:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L119:
	.align	2
.L118:
	.word	.LC43
	.word	.LC36
	.word	.LC37
	.word	.LC38
	.word	.LC39
	.word	.LC40
	.word	.LC14
	.word	.LC41
	.word	.LC42
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
