	.file	"438004.c"
	.intel_syntax noprefix
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	Available
	.align 32
	.type	Available, @object
	.size	Available, 40
Available:
	.zero	40
	.globl	Work
	.align 32
	.type	Work, @object
	.size	Work, 40
Work:
	.zero	40
	.globl	Allocation
	.align 32
	.type	Allocation, @object
	.size	Allocation, 800
Allocation:
	.zero	800
	.globl	Max
	.align 32
	.type	Max, @object
	.size	Max, 800
Max:
	.zero	800
	.globl	Need
	.align 32
	.type	Need, @object
	.size	Need, 800
Need:
	.zero	800
	.globl	finish
	.align 32
	.type	finish, @object
	.size	finish, 80
finish:
	.zero	80
	.globl	SEQUENCE
	.align 32
	.type	SEQUENCE, @object
	.size	SEQUENCE, 80
SEQUENCE:
	.zero	80
	.section	.rodata
.LC0:
	.string	"\n\nSafe Sequence : "
.LC1:
	.string	"P%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
	sub	rsp, 16
	mov	eax, 0
	call	input
	mov	eax, 0
	call	print
	mov	eax, 0
	call	main_algo
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, SEQUENCE[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -4[rbp], 1
.L2:
	mov	eax, DWORD PTR n[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L3
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC2:
	.string	"\n\nFor i=%d "
.LC3:
	.string	"\nNEED[%d] = "
.LC4:
	.string	"%d "
.LC5:
	.string	"\nWork = "
	.align 8
.LC6:
	.string	"\nNEED[%d]<=WORK \nP%d must be kept in sequence.....!"
	.align 8
.LC7:
	.string	"\nFinish[%d] is False and NEED[%d]>Work\nP[%d] must wait.....!"
	.text
	.globl	main_algo
	.type	main_algo, @function
main_algo:
.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	DWORD PTR -28[rbp], 0
	jmp	.L6
.L21:
	mov	DWORD PTR -20[rbp], 0
	jmp	.L7
.L20:
	mov	DWORD PTR -24[rbp], 1
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, finish[rip]
	mov	eax, DWORD PTR [rdx+rax]
	test	eax, eax
	jne	.L8
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -16[rbp], 0
	jmp	.L9
.L10:
	mov	eax, DWORD PTR -16[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rcx
	lea	rdx, 0[0+rax*4]
	lea	rax, Need[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -16[rbp], 1
.L9:
	mov	eax, DWORD PTR m[rip]
	cmp	DWORD PTR -16[rbp], eax
	jl	.L10
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -12[rbp], 0
	jmp	.L11
.L12:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, Work[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -12[rbp], 1
.L11:
	mov	eax, DWORD PTR m[rip]
	cmp	DWORD PTR -12[rbp], eax
	jl	.L12
	mov	DWORD PTR -8[rbp], 0
	jmp	.L13
.L16:
	mov	eax, DWORD PTR -8[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rcx
	lea	rdx, 0[0+rax*4]
	lea	rax, Need[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, Work[rip]
	mov	eax, DWORD PTR [rcx+rax]
	cmp	edx, eax
	jle	.L14
	mov	DWORD PTR -24[rbp], 0
	jmp	.L15
.L14:
	add	DWORD PTR -8[rbp], 1
.L13:
	mov	eax, DWORD PTR m[rip]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L16
.L15:
	cmp	DWORD PTR -24[rbp], 1
	jne	.L17
	mov	edx, DWORD PTR -20[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, finish[rip]
	mov	DWORD PTR [rdx+rax], 1
	mov	eax, DWORD PTR k[rip]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rdx, SEQUENCE[rip]
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR k[rip]
	add	eax, 1
	mov	DWORD PTR k[rip], eax
	mov	DWORD PTR -4[rbp], 0
	jmp	.L18
.L19:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, Work[rip]
	mov	ecx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	movsx	rsi, eax
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rsi
	lea	rdx, 0[0+rax*4]
	lea	rax, Allocation[rip]
	mov	eax, DWORD PTR [rdx+rax]
	add	ecx, eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, Work[rip]
	mov	DWORD PTR [rdx+rax], ecx
	add	DWORD PTR -4[rbp], 1
.L18:
	mov	eax, DWORD PTR m[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L19
	jmp	.L8
.L17:
	mov	ecx, DWORD PTR -20[rbp]
	mov	edx, DWORD PTR -20[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
.L8:
	add	DWORD PTR -20[rbp], 1
.L7:
	mov	eax, DWORD PTR n[rip]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L20
	mov	eax, 0
	call	finish_check
	mov	DWORD PTR -28[rbp], eax
.L6:
	cmp	DWORD PTR -28[rbp], 0
	je	.L21
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main_algo, .-main_algo
	.globl	finish_check
	.type	finish_check, @function
finish_check:
.LFB2:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -4[rbp], 0
	jmp	.L23
.L26:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, finish[rip]
	mov	eax, DWORD PTR [rdx+rax]
	test	eax, eax
	jne	.L24
	mov	eax, 0
	jmp	.L25
.L24:
	add	DWORD PTR -4[rbp], 1
.L23:
	mov	eax, DWORD PTR n[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L26
	mov	eax, 1
.L25:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	finish_check, .-finish_check
	.section	.rodata
	.align 8
.LC8:
	.string	"\nEnter the number of processes (n) : "
.LC9:
	.string	"%d"
	.align 8
.LC10:
	.string	"Enter the number of resources types (m) : "
	.align 8
.LC11:
	.string	"\nEnter the Available (vector) : "
	.align 8
.LC12:
	.string	"Enter the Allocation (matrix of n*m) :"
.LC13:
	.string	"Allocation of Process %d : "
.LC14:
	.string	"Enter the Max (matrix n*m): "
.LC15:
	.string	"Max of Process %d : "
	.text
	.globl	input
	.type	input, @function
input:
.LFB3:
	.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
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, n[rip]
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, m[rip]
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -36[rbp], 0
	jmp	.L28
.L29:
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, Available[rip]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	add	DWORD PTR -36[rbp], 1
.L28:
	mov	eax, DWORD PTR m[rip]
	cmp	DWORD PTR -36[rbp], eax
	jl	.L29
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	DWORD PTR -32[rbp], 0
	jmp	.L30
.L33:
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -28[rbp], 0
	jmp	.L31
.L32:
	mov	eax, DWORD PTR -28[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rcx
	lea	rdx, 0[0+rax*4]
	lea	rax, Allocation[rip]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	add	DWORD PTR -28[rbp], 1
.L31:
	mov	eax, DWORD PTR m[rip]
	cmp	DWORD PTR -28[rbp], eax
	jl	.L32
	add	DWORD PTR -32[rbp], 1
.L30:
	mov	eax, DWORD PTR n[rip]
	cmp	DWORD PTR -32[rbp], eax
	jl	.L33
	lea	rdi, .LC14[rip]
	call	puts@PLT
	mov	DWORD PTR -24[rbp], 0
	jmp	.L34
.L37:
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, eax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -20[rbp], 0
	jmp	.L35
.L36:
	mov	eax, DWORD PTR -20[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -24[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rcx
	lea	rdx, 0[0+rax*4]
	lea	rax, Max[rip]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	add	DWORD PTR -20[rbp], 1
.L35:
	mov	eax, DWORD PTR m[rip]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L36
	add	DWORD PTR -24[rbp], 1
.L34:
	mov	eax, DWORD PTR n[rip]
	cmp	DWORD PTR -24[rbp], eax
	jl	.L37
	mov	DWORD PTR -16[rbp], 0
	jmp	.L38
.L41:
	mov	DWORD PTR -12[rbp], 0
	jmp	.L39
.L40:
	mov	eax, DWORD PTR -12[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rcx
	lea	rdx, 0[0+rax*4]
	lea	rax, Max[rip]
	mov	ecx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -12[rbp]
	movsx	rsi, eax
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rsi
	lea	rdx, 0[0+rax*4]
	lea	rax, Allocation[rip]
	mov	eax, DWORD PTR [rdx+rax]
	sub	ecx, eax
	mov	eax, DWORD PTR -12[rbp]
	movsx	rsi, eax
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rsi
	lea	rdx, 0[0+rax*4]
	lea	rax, Need[rip]
	mov	DWORD PTR [rdx+rax], ecx
	add	DWORD PTR -12[rbp], 1
.L39:
	mov	eax, DWORD PTR m[rip]
	cmp	DWORD PTR -12[rbp], eax
	jl	.L40
	add	DWORD PTR -16[rbp], 1
.L38:
	mov	eax, DWORD PTR n[rip]
	cmp	DWORD PTR -16[rbp], eax
	jl	.L41
	mov	DWORD PTR -8[rbp], 0
	jmp	.L42
.L43:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, finish[rip]
	mov	DWORD PTR [rdx+rax], 0
	add	DWORD PTR -8[rbp], 1
.L42:
	mov	eax, DWORD PTR n[rip]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L43
	mov	DWORD PTR -4[rbp], 0
	jmp	.L44
.L45:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, Available[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -4[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, Work[rip]
	mov	DWORD PTR [rcx+rdx], eax
	add	DWORD PTR -4[rbp], 1
.L44:
	mov	eax, DWORD PTR m[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L45
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	input, .-input
	.section	.rodata
	.align 8
.LC16:
	.string	"\nProcess\t\tAllocation\t\t Max\t\tNeed"
.LC17:
	.string	"P%d\t\t  "
.LC18:
	.string	"\t\t"
.LC19:
	.string	"Available = "
.LC20:
	.string	"%d  "
.LC21:
	.string	"\nINTIALLY FINISH : "
.LC22:
	.string	"False  "
.LC23:
	.string	"True  "
	.text
	.globl	print
	.type	print, @function
print:
.LFB4:
	.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
	lea	rdi, .LC16[rip]
	call	puts@PLT
	mov	DWORD PTR -24[rbp], 0
	jmp	.L47
.L54:
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, eax
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -20[rbp], 0
	jmp	.L48
.L49:
	mov	eax, DWORD PTR -20[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -24[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rcx
	lea	rdx, 0[0+rax*4]
	lea	rax, Allocation[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -20[rbp], 1
.L48:
	mov	eax, DWORD PTR m[rip]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L49
	lea	rdi, .LC18[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -16[rbp], 0
	jmp	.L50
.L51:
	mov	eax, DWORD PTR -16[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -24[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rcx
	lea	rdx, 0[0+rax*4]
	lea	rax, Max[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -16[rbp], 1
.L50:
	mov	eax, DWORD PTR m[rip]
	cmp	DWORD PTR -16[rbp], eax
	jl	.L51
	lea	rdi, .LC18[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -12[rbp], 0
	jmp	.L52
.L53:
	mov	eax, DWORD PTR -12[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -24[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rcx
	lea	rdx, 0[0+rax*4]
	lea	rax, Need[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -12[rbp], 1
.L52:
	mov	eax, DWORD PTR m[rip]
	cmp	DWORD PTR -12[rbp], eax
	jl	.L53
	mov	edi, 10
	call	putchar@PLT
	add	DWORD PTR -24[rbp], 1
.L47:
	mov	eax, DWORD PTR n[rip]
	cmp	DWORD PTR -24[rbp], eax
	jl	.L54
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -8[rbp], 0
	jmp	.L55
.L56:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, Available[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC20[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -8[rbp], 1
.L55:
	mov	eax, DWORD PTR m[rip]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L56
	lea	rdi, .LC21[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L57
.L60:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, finish[rip]
	mov	eax, DWORD PTR [rdx+rax]
	test	eax, eax
	jne	.L58
	lea	rdi, .LC22[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L59
.L58:
	lea	rdi, .LC23[rip]
	mov	eax, 0
	call	printf@PLT
.L59:
	add	DWORD PTR -4[rbp], 1
.L57:
	mov	eax, DWORD PTR n[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L60
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	print, .-print
	.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	"438004.c"
	.text
	.comm	n,4,4
	.comm	m,4,4
	.global	k
	.bss
	.align	2
	.type	k, %object
	.size	k, 4
k:
	.space	4
	.comm	Available,40,4
	.comm	Work,40,4
	.comm	Allocation,800,4
	.comm	Max,800,4
	.comm	Need,800,4
	.comm	finish,80,4
	.comm	SEQUENCE,80,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012\012Safe Sequence : \000"
	.align	2
.LC1:
	.ascii	"P%d \000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	bl	input
	bl	print
	bl	main_algo
	ldr	r0, .L5
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L3:
	ldr	r2, .L5+4
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L5+8
	bl	printf
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, .L5+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L3
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC0
	.word	SEQUENCE
	.word	.LC1
	.word	n
	.size	main, .-main
	.section	.rodata
	.align	2
.LC2:
	.ascii	"\012\012For i=%d \000"
	.align	2
.LC3:
	.ascii	"\012NEED[%d] = \000"
	.align	2
.LC4:
	.ascii	"%d \000"
	.align	2
.LC5:
	.ascii	"\012Work = \000"
	.align	2
.LC6:
	.ascii	"\012NEED[%d]<=WORK \012P%d must be kept in sequence"
	.ascii	".....!\000"
	.align	2
.LC7:
	.ascii	"\012Finish[%d] is False and NEED[%d]>Work\012P[%d] "
	.ascii	"must wait.....!\000"
	.text
	.align	2
	.global	main_algo
	.syntax unified
	.arm
	.fpu softvfp
	.type	main_algo, %function
main_algo:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L8
.L23:
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L9
.L22:
	mov	r3, #1
	str	r3, [fp, #-28]
	ldr	r2, .L24
	ldr	r3, [fp, #-24]
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #0
	bne	.L10
	ldr	r1, [fp, #-24]
	ldr	r0, .L24+4
	bl	printf
	ldr	r1, [fp, #-24]
	ldr	r0, .L24+8
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L11
.L12:
	ldr	r1, .L24+12
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-20]
	add	r3, r3, r2
	ldr	r3, [r1, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L24+16
	bl	printf
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L11:
	ldr	r3, .L24+20
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L12
	ldr	r0, .L24+24
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L13
.L14:
	ldr	r2, .L24+28
	ldr	r3, [fp, #-16]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L24+16
	bl	printf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L13:
	ldr	r3, .L24+20
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L14
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L15
.L18:
	ldr	r1, .L24+12
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-12]
	add	r3, r3, r2
	ldr	r2, [r1, r3, lsl #2]
	ldr	r1, .L24+28
	ldr	r3, [fp, #-12]
	ldr	r3, [r1, r3, lsl #2]
	cmp	r2, r3
	ble	.L16
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L17
.L16:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L15:
	ldr	r3, .L24+20
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L18
.L17:
	ldr	r3, [fp, #-28]
	cmp	r3, #1
	bne	.L19
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-24]
	ldr	r0, .L24+32
	bl	printf
	ldr	r2, .L24
	ldr	r3, [fp, #-24]
	mov	r1, #1
	str	r1, [r2, r3, lsl #2]
	ldr	r3, .L24+36
	ldr	r3, [r3]
	ldr	r1, .L24+40
	ldr	r2, [fp, #-24]
	str	r2, [r1, r3, lsl #2]
	ldr	r3, .L24+36
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L24+36
	str	r3, [r2]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L20
.L21:
	ldr	r2, .L24+28
	ldr	r3, [fp, #-8]
	ldr	r1, [r2, r3, lsl #2]
	ldr	r0, .L24+44
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-8]
	add	r3, r3, r2
	ldr	r3, [r0, r3, lsl #2]
	add	r2, r1, r3
	ldr	r1, .L24+28
	ldr	r3, [fp, #-8]
	str	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L20:
	ldr	r3, .L24+20
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L21
	b	.L10
.L19:
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-24]
	ldr	r0, .L24+48
	bl	printf
.L10:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L9:
	ldr	r3, .L24+52
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L22
	bl	finish_check
	str	r0, [fp, #-32]
.L8:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L23
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	finish
	.word	.LC2
	.word	.LC3
	.word	Need
	.word	.LC4
	.word	m
	.word	.LC5
	.word	Work
	.word	.LC6
	.word	k
	.word	SEQUENCE
	.word	Allocation
	.word	.LC7
	.word	n
	.size	main_algo, .-main_algo
	.align	2
	.global	finish_check
	.syntax unified
	.arm
	.fpu softvfp
	.type	finish_check, %function
finish_check:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L27
.L30:
	ldr	r2, .L31
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #0
	bne	.L28
	mov	r3, #0
	b	.L29
.L28:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L27:
	ldr	r3, .L31+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L30
	mov	r3, #1
.L29:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L32:
	.align	2
.L31:
	.word	finish
	.word	n
	.size	finish_check, .-finish_check
	.section	.rodata
	.align	2
.LC8:
	.ascii	"\012Enter the number of processes (n) : \000"
	.align	2
.LC9:
	.ascii	"%d\000"
	.align	2
.LC10:
	.ascii	"Enter the number of resources types (m) : \000"
	.align	2
.LC11:
	.ascii	"\012Enter the Available (vector) : \000"
	.align	2
.LC12:
	.ascii	"Enter the Allocation (matrix of n*m) :\000"
	.align	2
.LC13:
	.ascii	"Allocation of Process %d : \000"
	.align	2
.LC14:
	.ascii	"Enter the Max (matrix n*m): \000"
	.align	2
.LC15:
	.ascii	"Max of Process %d : \000"
	.text
	.align	2
	.global	input
	.syntax unified
	.arm
	.fpu softvfp
	.type	input, %function
input:
	@ 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	r0, .L52
	bl	printf
	ldr	r1, .L52+4
	ldr	r0, .L52+8
	bl	__isoc99_scanf
	ldr	r0, .L52+12
	bl	printf
	ldr	r1, .L52+16
	ldr	r0, .L52+8
	bl	__isoc99_scanf
	ldr	r0, .L52+20
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L34
.L35:
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	ldr	r2, .L52+24
	add	r3, r3, r2
	mov	r1, r3
	ldr	r0, .L52+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L34:
	ldr	r3, .L52+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-40]
	cmp	r2, r3
	blt	.L35
	ldr	r0, .L52+28
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L36
.L39:
	ldr	r1, [fp, #-36]
	ldr	r0, .L52+32
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L37
.L38:
	ldr	r2, [fp, #-36]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-32]
	add	r3, r3, r2
	lsl	r3, r3, #2
	ldr	r2, .L52+36
	add	r3, r3, r2
	mov	r1, r3
	ldr	r0, .L52+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L37:
	ldr	r3, .L52+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	blt	.L38
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L36:
	ldr	r3, .L52+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	blt	.L39
	ldr	r0, .L52+40
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L40
.L43:
	ldr	r1, [fp, #-28]
	ldr	r0, .L52+44
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L41
.L42:
	ldr	r2, [fp, #-28]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-24]
	add	r3, r3, r2
	lsl	r3, r3, #2
	ldr	r2, .L52+48
	add	r3, r3, r2
	mov	r1, r3
	ldr	r0, .L52+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L41:
	ldr	r3, .L52+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L42
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L40:
	ldr	r3, .L52+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	blt	.L43
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L44
.L47:
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L45
.L46:
	ldr	r1, .L52+48
	ldr	r2, [fp, #-20]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-16]
	add	r3, r3, r2
	ldr	r1, [r1, r3, lsl #2]
	ldr	r0, .L52+36
	ldr	r2, [fp, #-20]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-16]
	add	r3, r3, r2
	ldr	r3, [r0, r3, lsl #2]
	sub	r1, r1, r3
	ldr	r0, .L52+52
	ldr	r2, [fp, #-20]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-16]
	add	r3, r3, r2
	str	r1, [r0, r3, lsl #2]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L45:
	ldr	r3, .L52+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L46
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L44:
	ldr	r3, .L52+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L47
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L48
.L49:
	ldr	r2, .L52+56
	ldr	r3, [fp, #-12]
	mov	r1, #0
	str	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L48:
	ldr	r3, .L52+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L49
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L50
.L51:
	ldr	r2, .L52+24
	ldr	r3, [fp, #-8]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r1, .L52+60
	ldr	r3, [fp, #-8]
	str	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L50:
	ldr	r3, .L52+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L51
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L53:
	.align	2
.L52:
	.word	.LC8
	.word	n
	.word	.LC9
	.word	.LC10
	.word	m
	.word	.LC11
	.word	Available
	.word	.LC12
	.word	.LC13
	.word	Allocation
	.word	.LC14
	.word	.LC15
	.word	Max
	.word	Need
	.word	finish
	.word	Work
	.size	input, .-input
	.section	.rodata
	.align	2
.LC16:
	.ascii	"\012Process\011\011Allocation\011\011 Max\011\011Ne"
	.ascii	"ed\000"
	.align	2
.LC17:
	.ascii	"P%d\011\011  \000"
	.align	2
.LC18:
	.ascii	"\011\011\000"
	.align	2
.LC19:
	.ascii	"Available = \000"
	.align	2
.LC20:
	.ascii	"%d  \000"
	.align	2
.LC21:
	.ascii	"\012INTIALLY FINISH : \000"
	.align	2
.LC22:
	.ascii	"False  \000"
	.align	2
.LC23:
	.ascii	"True  \000"
	.text
	.align	2
	.global	print
	.syntax unified
	.arm
	.fpu softvfp
	.type	print, %function
print:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r0, .L69
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L55
.L62:
	ldr	r1, [fp, #-28]
	ldr	r0, .L69+4
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L56
.L57:
	ldr	r1, .L69+8
	ldr	r2, [fp, #-28]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-24]
	add	r3, r3, r2
	ldr	r3, [r1, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L69+12
	bl	printf
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L56:
	ldr	r3, .L69+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L57
	ldr	r0, .L69+20
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L58
.L59:
	ldr	r1, .L69+24
	ldr	r2, [fp, #-28]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-20]
	add	r3, r3, r2
	ldr	r3, [r1, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L69+12
	bl	printf
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L58:
	ldr	r3, .L69+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L59
	ldr	r0, .L69+20
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L60
.L61:
	ldr	r1, .L69+28
	ldr	r2, [fp, #-28]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-16]
	add	r3, r3, r2
	ldr	r3, [r1, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L69+12
	bl	printf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L60:
	ldr	r3, .L69+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L61
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L55:
	ldr	r3, .L69+32
	ldr	r3, [r3]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	blt	.L62
	ldr	r0, .L69+36
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L63
.L64:
	ldr	r2, .L69+40
	ldr	r3, [fp, #-12]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L69+44
	bl	printf
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L63:
	ldr	r3, .L69+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L64
	ldr	r0, .L69+48
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L65
.L68:
	ldr	r2, .L69+52
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	cmp	r3, #0
	bne	.L66
	ldr	r0, .L69+56
	bl	printf
	b	.L67
.L66:
	ldr	r0, .L69+60
	bl	printf
.L67:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L65:
	ldr	r3, .L69+32
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L68
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L70:
	.align	2
.L69:
	.word	.LC16
	.word	.LC17
	.word	Allocation
	.word	.LC4
	.word	m
	.word	.LC18
	.word	Max
	.word	Need
	.word	n
	.word	.LC19
	.word	Available
	.word	.LC20
	.word	.LC21
	.word	finish
	.word	.LC22
	.word	.LC23
	.size	print, .-print
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
