	.file	"477315.c"
	.intel_syntax noprefix
	.text
	.globl	available
	.bss
	.align 16
	.type	available, @object
	.size	available, 16
available:
	.zero	16
	.globl	maximum
	.align 32
	.type	maximum, @object
	.size	maximum, 80
maximum:
	.zero	80
	.globl	allocation
	.align 32
	.type	allocation, @object
	.size	allocation, 80
allocation:
	.zero	80
	.globl	need
	.align 32
	.type	need, @object
	.size	need, 80
need:
	.zero	80
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	toBeReleased
	.align 4
	.type	toBeReleased, @object
	.size	toBeReleased, 4
toBeReleased:
	.zero	4
	.globl	sequence
	.align 16
	.type	sequence, @object
	.size	sequence, 20
sequence:
	.zero	20
	.section	.rodata
.LC0:
	.string	"sample4_in.txt"
	.align 8
.LC1:
	.string	"Error: available array info is missing\n"
.LC2:
	.string	"Number of Customers: %d\n"
	.align 8
.LC3:
	.string	"Currently Available resources: "
.LC4:
	.string	"%d "
.LC5:
	.string	"Maximum resources from file:"
.LC6:
	.string	"Enter Command: "
.LC7:
	.string	"%d"
.LC8:
	.string	"Request is satisfied."
.LC9:
	.string	"Unsafe request! denied.\n"
.LC10:
	.string	"Available Array State"
.LC11:
	.string	"\n\nMaximum Array State"
.LC12:
	.string	"\nAllocation Array State"
.LC13:
	.string	"\nNeed Array State"
	.align 8
.LC14:
	.string	"\nThe current state is NOT SAFE"
.LC15:
	.string	"\nThe current state is SAFE"
.LC16:
	.string	"The safe sequence is: <"
.LC17:
	.string	">"
.LC18:
	.string	"\n\n-->Customer/Thread %d"
	.align 8
.LC19:
	.string	"\n      Allocated resources:   "
.LC20:
	.string	" %d"
.LC21:
	.string	"\n      Needed:   "
.LC22:
	.string	"\n      Available:  "
.LC23:
	.string	"      New Available:  "
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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, 168
	.cfi_offset 3, -24
	mov	DWORD PTR -164[rbp], edi
	mov	QWORD PTR -176[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	lea	rax, .LC0[rip]
	mov	QWORD PTR -80[rbp], rax
	cmp	DWORD PTR -164[rbp], 1
	jg	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 39
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	eax, -1
	jmp	.L3
.L2:
	mov	esi, 5
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -152[rbp], 1
	jmp	.L4
.L5:
	mov	eax, DWORD PTR -152[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -176[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, DWORD PTR -152[rbp]
	lea	ebx, -1[rdx]
	mov	rdi, rax
	call	atoi@PLT
	movsx	rdx, ebx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, available[rip]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR -152[rbp]
	sub	eax, 1
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, available[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -152[rbp], 1
.L4:
	cmp	DWORD PTR -152[rbp], 4
	jle	.L5
	mov	edi, 10
	call	putchar@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -80[rbp]
	mov	rdi, rax
	call	get_max
.L49:
	mov	DWORD PTR -148[rbp], 0
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L6
.L7:
	mov	eax, DWORD PTR -148[rbp]
	cdqe
	movzx	edx, BYTE PTR -153[rbp]
	mov	BYTE PTR -34[rbp+rax], dl
	add	DWORD PTR -148[rbp], 1
.L6:
	call	getchar@PLT
	mov	BYTE PTR -153[rbp], al
	cmp	BYTE PTR -153[rbp], 10
	jne	.L7
	movzx	eax, BYTE PTR -34[rbp]
	cmp	al, 82
	jne	.L8
	movzx	eax, BYTE PTR -33[rbp]
	cmp	al, 81
	jne	.L8
	lea	rax, -34[rbp]
	add	rax, 3
	mov	QWORD PTR -96[rbp], rax
	lea	rdx, -104[rbp]
	mov	rax, QWORD PTR -96[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	add	QWORD PTR -96[rbp], 2
	mov	DWORD PTR -144[rbp], 0
	jmp	.L9
.L10:
	lea	rdx, -64[rbp]
	mov	eax, DWORD PTR -144[rbp]
	cdqe
	sal	rax, 2
	add	rdx, rax
	mov	rax, QWORD PTR -96[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	add	QWORD PTR -96[rbp], 2
	add	DWORD PTR -144[rbp], 1
.L9:
	cmp	DWORD PTR -144[rbp], 3
	jle	.L10
	mov	eax, DWORD PTR -104[rbp]
	lea	rdx, -64[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	request_resources
	test	eax, eax
	jne	.L11
	lea	rdi, .LC8[rip]
	call	puts@PLT
	jmp	.L13
.L11:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC9[rip]
	call	fwrite@PLT
	jmp	.L13
.L8:
	movzx	eax, BYTE PTR -34[rbp]
	cmp	al, 82
	jne	.L14
	movzx	eax, BYTE PTR -33[rbp]
	cmp	al, 76
	jne	.L14
	lea	rax, -34[rbp]
	add	rax, 3
	mov	QWORD PTR -88[rbp], rax
	lea	rdx, -104[rbp]
	mov	rax, QWORD PTR -88[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	add	QWORD PTR -88[rbp], 2
	mov	DWORD PTR -140[rbp], 0
	jmp	.L15
.L16:
	lea	rdx, -64[rbp]
	mov	eax, DWORD PTR -140[rbp]
	cdqe
	sal	rax, 2
	add	rdx, rax
	mov	rax, QWORD PTR -88[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	add	QWORD PTR -88[rbp], 2
	add	DWORD PTR -140[rbp], 1
.L15:
	cmp	DWORD PTR -140[rbp], 3
	jle	.L16
	mov	eax, DWORD PTR -104[rbp]
	lea	rdx, -64[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	release_resources
	jmp	.L13
.L14:
	movzx	eax, BYTE PTR -34[rbp]
	cmp	al, 42
	jne	.L17
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	DWORD PTR -132[rbp], 0
	jmp	.L18
.L19:
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, available[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -132[rbp], 1
.L18:
	cmp	DWORD PTR -132[rbp], 3
	jle	.L19
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	DWORD PTR -136[rbp], 0
	jmp	.L20
.L23:
	mov	DWORD PTR -132[rbp], 0
	jmp	.L21
.L22:
	mov	eax, DWORD PTR -132[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -136[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, maximum[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -132[rbp], 1
.L21:
	cmp	DWORD PTR -132[rbp], 3
	jle	.L22
	mov	edi, 10
	call	putchar@PLT
	add	DWORD PTR -136[rbp], 1
.L20:
	cmp	DWORD PTR -136[rbp], 4
	jle	.L23
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	DWORD PTR -136[rbp], 0
	jmp	.L24
.L27:
	mov	DWORD PTR -132[rbp], 0
	jmp	.L25
.L26:
	mov	eax, DWORD PTR -132[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -136[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	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 -132[rbp], 1
.L25:
	cmp	DWORD PTR -132[rbp], 3
	jle	.L26
	mov	edi, 10
	call	putchar@PLT
	add	DWORD PTR -136[rbp], 1
.L24:
	cmp	DWORD PTR -136[rbp], 4
	jle	.L27
	lea	rdi, .LC13[rip]
	call	puts@PLT
	mov	DWORD PTR -136[rbp], 0
	jmp	.L28
.L31:
	mov	DWORD PTR -132[rbp], 0
	jmp	.L29
.L30:
	mov	eax, DWORD PTR -132[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -136[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	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 -132[rbp], 1
.L29:
	cmp	DWORD PTR -132[rbp], 3
	jle	.L30
	mov	edi, 10
	call	putchar@PLT
	add	DWORD PTR -136[rbp], 1
.L28:
	cmp	DWORD PTR -136[rbp], 4
	jle	.L31
	jmp	.L49
.L17:
	movzx	eax, BYTE PTR -34[rbp]
	cmp	al, 82
	jne	.L32
	movzx	eax, BYTE PTR -33[rbp]
	cmp	al, 117
	jne	.L32
	movzx	eax, BYTE PTR -32[rbp]
	cmp	al, 110
	jne	.L32
	lea	rdi, available[rip]
	call	safe_state
	mov	DWORD PTR -108[rbp], eax
	cmp	DWORD PTR -108[rbp], -1
	jne	.L33
	lea	rdi, .LC14[rip]
	call	puts@PLT
	jmp	.L13
.L33:
	lea	rdi, .LC15[rip]
	call	puts@PLT
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -128[rbp], 0
	jmp	.L35
.L38:
	cmp	DWORD PTR -128[rbp], 3
	jg	.L36
	mov	eax, DWORD PTR -128[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, sequence[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L37
.L36:
	mov	eax, DWORD PTR -128[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, sequence[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
.L37:
	add	DWORD PTR -128[rbp], 1
.L35:
	cmp	DWORD PTR -128[rbp], 4
	jle	.L38
	lea	rdi, .LC17[rip]
	call	puts@PLT
	mov	DWORD PTR r[rip], 0
	jmp	.L39
.L48:
	mov	eax, DWORD PTR r[rip]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, sequence[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC18[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -124[rbp], 0
	jmp	.L40
.L41:
	mov	eax, DWORD PTR r[rip]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, sequence[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -124[rbp]
	movsx	rdx, edx
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, allocation[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC20[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -124[rbp], 1
.L40:
	cmp	DWORD PTR -124[rbp], 3
	jle	.L41
	lea	rdi, .LC21[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -120[rbp], 0
	jmp	.L42
.L43:
	mov	eax, DWORD PTR r[rip]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, sequence[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -120[rbp]
	movsx	rdx, edx
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC20[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -120[rbp], 1
.L42:
	cmp	DWORD PTR -120[rbp], 3
	jle	.L43
	lea	rdi, .LC22[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -116[rbp], 0
	jmp	.L44
.L45:
	mov	eax, DWORD PTR -116[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 -116[rbp], 1
.L44:
	cmp	DWORD PTR -116[rbp], 3
	jle	.L45
	mov	edi, 10
	call	putchar@PLT
	mov	eax, DWORD PTR r[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -72[rbp]
	add	rdx, rax
	lea	rax, -104[rbp]
	mov	rcx, rdx
	lea	rdx, threadRunner[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	rax, QWORD PTR -104[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	lea	rdi, .LC23[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -112[rbp], 0
	jmp	.L46
.L47:
	mov	eax, DWORD PTR -112[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 -112[rbp], 1
.L46:
	cmp	DWORD PTR -112[rbp], 3
	jle	.L47
	mov	edi, 10
	call	putchar@PLT
	mov	eax, DWORD PTR r[rip]
	add	eax, 1
	mov	DWORD PTR r[rip], eax
.L39:
	mov	eax, DWORD PTR r[rip]
	cmp	eax, 4
	jle	.L48
	jmp	.L13
.L32:
	mov	eax, 0
	jmp	.L3
.L13:
	jmp	.L49
.L3:
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC24:
	.string	"r"
	.align 8
.LC25:
	.string	"Error in opening input file...exiting with error code -1"
.LC26:
	.string	"\r\n"
.LC27:
	.string	"%s \n"
.LC28:
	.string	","
	.text
	.globl	get_max
	.type	get_max, @function
get_max:
.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, 384
	mov	QWORD PTR -376[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -376[rbp]
	lea	rsi, .LC24[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -328[rbp], rax
	cmp	QWORD PTR -328[rbp], 0
	jne	.L52
	lea	rdi, .LC25[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L65
.L52:
	mov	rax, QWORD PTR -328[rbp]
	mov	rdi, rax
	call	fileno@PLT
	mov	edx, eax
	lea	rax, -256[rbp]
	mov	rsi, rax
	mov	edi, edx
	call	fstat@PLT
	mov	rax, QWORD PTR -208[rbp]
	add	eax, 1
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -320[rbp], rax
	mov	rax, QWORD PTR -320[rbp]
	mov	BYTE PTR [rax], 0
	jmp	.L54
.L56:
	mov	rdx, QWORD PTR -328[rbp]
	lea	rax, -112[rbp]
	mov	esi, 100
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	je	.L54
	lea	rax, -112[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rcx, -112[rbp]
	mov	rax, QWORD PTR -320[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncat@PLT
.L54:
	mov	rax, QWORD PTR -328[rbp]
	mov	rdi, rax
	call	feof@PLT
	test	eax, eax
	je	.L56
	mov	rax, QWORD PTR -328[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	QWORD PTR -344[rbp], 0
	mov	DWORD PTR -360[rbp], 0
	mov	rax, QWORD PTR -320[rbp]
	mov	rdi, rax
	call	strlen@PLT
	add	rax, 1
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -312[rbp], rax
	mov	rdx, QWORD PTR -320[rbp]
	mov	rax, QWORD PTR -312[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	rax, QWORD PTR -312[rbp]
	lea	rsi, .LC26[rip]
	mov	rdi, rax
	call	strtok@PLT
	mov	QWORD PTR -344[rbp], rax
	jmp	.L57
.L58:
	add	DWORD PTR -360[rbp], 1
	lea	rsi, .LC26[rip]
	mov	edi, 0
	call	strtok@PLT
	mov	QWORD PTR -344[rbp], rax
.L57:
	cmp	QWORD PTR -344[rbp], 0
	jne	.L58
	mov	DWORD PTR -356[rbp], 0
	mov	rax, QWORD PTR -320[rbp]
	lea	rsi, .LC26[rip]
	mov	rdi, rax
	call	strtok@PLT
	mov	QWORD PTR -344[rbp], rax
	jmp	.L59
.L60:
	mov	edi, 8
	call	malloc@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR -356[rbp]
	cdqe
	mov	QWORD PTR -304[rbp+rax*8], rdx
	mov	eax, DWORD PTR -356[rbp]
	cdqe
	mov	rax, QWORD PTR -304[rbp+rax*8]
	mov	rdx, QWORD PTR -344[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	eax, DWORD PTR -356[rbp]
	cdqe
	mov	rax, QWORD PTR -304[rbp+rax*8]
	mov	rsi, rax
	lea	rdi, .LC27[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -356[rbp], 1
	lea	rsi, .LC26[rip]
	mov	edi, 0
	call	strtok@PLT
	mov	QWORD PTR -344[rbp], rax
.L59:
	cmp	QWORD PTR -344[rbp], 0
	jne	.L60
	mov	DWORD PTR -352[rbp], 0
	jmp	.L61
.L64:
	mov	QWORD PTR -336[rbp], 0
	mov	eax, DWORD PTR -352[rbp]
	cdqe
	mov	rax, QWORD PTR -304[rbp+rax*8]
	lea	rsi, .LC28[rip]
	mov	rdi, rax
	call	strtok@PLT
	mov	QWORD PTR -336[rbp], rax
	mov	DWORD PTR -348[rbp], 0
	jmp	.L62
.L63:
	mov	rax, QWORD PTR -336[rbp]
	mov	rdi, rax
	call	atoi@PLT
	mov	edx, DWORD PTR -348[rbp]
	movsx	rcx, edx
	mov	edx, DWORD PTR -352[rbp]
	movsx	rdx, edx
	sal	rdx, 2
	add	rdx, rcx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, maximum[rip]
	mov	DWORD PTR [rcx+rdx], eax
	mov	rax, QWORD PTR -336[rbp]
	mov	rdi, rax
	call	atoi@PLT
	mov	edx, DWORD PTR -348[rbp]
	movsx	rcx, edx
	mov	edx, DWORD PTR -352[rbp]
	movsx	rdx, edx
	sal	rdx, 2
	add	rdx, rcx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, need[rip]
	mov	DWORD PTR [rcx+rdx], eax
	add	DWORD PTR -348[rbp], 1
	lea	rsi, .LC28[rip]
	mov	edi, 0
	call	strtok@PLT
	mov	QWORD PTR -336[rbp], rax
.L62:
	cmp	QWORD PTR -336[rbp], 0
	jne	.L63
	add	DWORD PTR -352[rbp], 1
.L61:
	cmp	DWORD PTR -352[rbp], 4
	jle	.L64
	mov	eax, 1
.L65:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L66
	call	__stack_chk_fail@PLT
.L66:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_max, .-get_max
	.globl	request_resources
	.type	request_resources, @function
request_resources:
.LFB8:
	.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 -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	rdx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -20[rbp]
	lea	rsi, available[rip]
	mov	edi, eax
	call	initial_safe_check
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], -1
	jne	.L68
	mov	eax, -1
	jmp	.L69
.L68:
	mov	DWORD PTR -16[rbp], 0
	jmp	.L70
.L71:
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, available[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -16[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
	mov	ecx, eax
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, available[rip]
	mov	DWORD PTR [rdx+rax], ecx
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, allocation[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	lea	ecx, [rdx+rax]
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, allocation[rip]
	mov	DWORD PTR [rdx+rax], ecx
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -16[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
	mov	ecx, eax
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	DWORD PTR [rdx+rax], ecx
	add	DWORD PTR -16[rbp], 1
.L70:
	cmp	DWORD PTR -16[rbp], 3
	jle	.L71
	lea	rdi, available[rip]
	call	safe_state
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L72
	mov	DWORD PTR -12[rbp], 0
	jmp	.L73
.L74:
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, available[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	lea	ecx, [rdx+rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, available[rip]
	mov	DWORD PTR [rdx+rax], ecx
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, allocation[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -12[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
	mov	ecx, eax
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, allocation[rip]
	mov	DWORD PTR [rdx+rax], ecx
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	lea	ecx, [rdx+rax]
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	DWORD PTR [rdx+rax], ecx
	add	DWORD PTR -12[rbp], 1
.L73:
	cmp	DWORD PTR -12[rbp], 3
	jle	.L74
	mov	eax, -1
	jmp	.L69
.L72:
	mov	eax, 0
.L69:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	request_resources, .-request_resources
	.section	.rodata
.LC29:
	.string	"Invalid release! denied.\n"
.LC30:
	.string	"Release is satisfied."
	.text
	.globl	release_resources
	.type	release_resources, @function
release_resources:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -12[rbp], 1
	mov	DWORD PTR -8[rbp], 0
	jmp	.L76
.L78:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, available[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	lea	ecx, [rdx+rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, available[rip]
	mov	DWORD PTR [rdx+rax], ecx
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, allocation[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -8[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
	mov	ecx, eax
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, allocation[rip]
	mov	DWORD PTR [rdx+rax], ecx
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	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]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	lea	ecx, [rdx+rax]
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	DWORD PTR [rdx+rax], ecx
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, allocation[rip]
	mov	eax, DWORD PTR [rdx+rax]
	test	eax, eax
	jns	.L77
	mov	DWORD PTR -12[rbp], 0
.L77:
	add	DWORD PTR -8[rbp], 1
.L76:
	cmp	DWORD PTR -8[rbp], 3
	jle	.L78
	cmp	DWORD PTR -12[rbp], 0
	jne	.L79
	mov	DWORD PTR -4[rbp], 0
	jmp	.L80
.L81:
	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]
	mov	rdx, QWORD PTR -32[rbp]
	add	rdx, rcx
	mov	edx, DWORD PTR [rdx]
	sub	eax, edx
	mov	ecx, eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, available[rip]
	mov	DWORD PTR [rdx+rax], ecx
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, allocation[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	lea	ecx, [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, allocation[rip]
	mov	DWORD PTR [rdx+rax], ecx
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -4[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
	mov	ecx, eax
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	DWORD PTR [rdx+rax], ecx
	add	DWORD PTR -4[rbp], 1
.L80:
	cmp	DWORD PTR -4[rbp], 3
	jle	.L81
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 25
	mov	esi, 1
	lea	rdi, .LC29[rip]
	call	fwrite@PLT
	jmp	.L75
.L79:
	lea	rdi, .LC30[rip]
	call	puts@PLT
	nop
.L75:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	release_resources, .-release_resources
	.globl	initial_safe_check
	.type	initial_safe_check, @function
initial_safe_check:
.LFB10:
	.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 -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	mov	DWORD PTR -4[rbp], 0
	jmp	.L84
.L88:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -4[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 2
	add	rax, rcx
	lea	rcx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	eax, DWORD PTR [rcx+rax]
	cmp	edx, eax
	jg	.L85
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jle	.L86
.L85:
	mov	eax, -1
	jmp	.L87
.L86:
	add	DWORD PTR -4[rbp], 1
.L84:
	cmp	DWORD PTR -4[rbp], 3
	jle	.L88
	mov	eax, 1
.L87:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	initial_safe_check, .-initial_safe_check
	.globl	safe_state
	.type	safe_state, @function
safe_state:
.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, 96
	mov	QWORD PTR -88[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -76[rbp], -1
	mov	DWORD PTR -72[rbp], 0
	jmp	.L90
.L91:
	mov	eax, DWORD PTR -72[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rdx, sequence[rip]
	mov	eax, DWORD PTR -76[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	add	DWORD PTR -72[rbp], 1
.L90:
	cmp	DWORD PTR -72[rbp], 3
	jle	.L91
	mov	DWORD PTR -68[rbp], 0
	jmp	.L92
.L93:
	mov	eax, DWORD PTR -68[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -88[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -68[rbp]
	cdqe
	mov	DWORD PTR -48[rbp+rax*4], edx
	add	DWORD PTR -68[rbp], 1
.L92:
	cmp	DWORD PTR -68[rbp], 3
	jle	.L93
	mov	DWORD PTR -64[rbp], 0
	jmp	.L94
.L95:
	mov	eax, DWORD PTR -64[rbp]
	cdqe
	mov	DWORD PTR -32[rbp+rax*4], 0
	add	DWORD PTR -64[rbp], 1
.L94:
	cmp	DWORD PTR -64[rbp], 4
	jle	.L95
	mov	DWORD PTR -60[rbp], 0
	jmp	.L96
.L104:
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	mov	eax, DWORD PTR -32[rbp+rax*4]
	test	eax, eax
	jne	.L97
	mov	DWORD PTR -56[rbp], 0
	jmp	.L98
.L103:
	mov	eax, DWORD PTR -56[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, need[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	mov	eax, DWORD PTR -48[rbp+rax*4]
	cmp	edx, eax
	jg	.L111
	cmp	DWORD PTR -56[rbp], 3
	jne	.L100
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	mov	DWORD PTR -32[rbp+rax*4], 1
	add	DWORD PTR -76[rbp], 1
	mov	eax, DWORD PTR -76[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rdx, sequence[rip]
	mov	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	mov	DWORD PTR -56[rbp], 0
	jmp	.L101
.L102:
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	mov	ecx, DWORD PTR -48[rbp+rax*4]
	mov	eax, DWORD PTR -56[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, allocation[rip]
	mov	eax, DWORD PTR [rdx+rax]
	lea	edx, [rcx+rax]
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	mov	DWORD PTR -48[rbp+rax*4], edx
	mov	DWORD PTR -60[rbp], -1
	add	DWORD PTR -56[rbp], 1
.L101:
	cmp	DWORD PTR -56[rbp], 3
	jle	.L102
.L100:
	add	DWORD PTR -56[rbp], 1
.L98:
	cmp	DWORD PTR -56[rbp], 3
	jle	.L103
	jmp	.L97
.L111:
	nop
.L97:
	add	DWORD PTR -60[rbp], 1
.L96:
	cmp	DWORD PTR -60[rbp], 4
	jle	.L104
	mov	DWORD PTR -52[rbp], 0
	jmp	.L105
.L108:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	mov	eax, DWORD PTR -32[rbp+rax*4]
	test	eax, eax
	jne	.L106
	mov	eax, -1
	jmp	.L109
.L106:
	add	DWORD PTR -52[rbp], 1
.L105:
	cmp	DWORD PTR -52[rbp], 4
	jle	.L108
	mov	eax, 1
.L109:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L110
	call	__stack_chk_fail@PLT
.L110:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	safe_state, .-safe_state
	.section	.rodata
.LC31:
	.string	"      Thread has started"
.LC32:
	.string	"      Thread has finished"
	.align 8
.LC33:
	.string	"      Thread is releasing resources"
	.text
	.globl	threadRunner
	.type	threadRunner, @function
threadRunner:
.LFB12:
	.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	QWORD PTR -8[rbp], rdi
	lea	rdi, .LC31[rip]
	call	puts@PLT
	mov	edi, 1
	call	sleep@PLT
	lea	rdi, .LC32[rip]
	call	puts@PLT
	mov	edi, 1
	call	sleep@PLT
	lea	rdi, .LC33[rip]
	call	puts@PLT
	mov	eax, DWORD PTR r[rip]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, sequence[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, allocation[rip]
	add	rdx, rax
	mov	eax, DWORD PTR r[rip]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, sequence[rip]
	mov	eax, DWORD PTR [rcx+rax]
	mov	rsi, rdx
	mov	edi, eax
	call	release_resources
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE12:
	.size	threadRunner, .-threadRunner
	.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	"477315.c"
	.text
	.comm	available,16,4
	.comm	maximum,80,4
	.comm	allocation,80,4
	.comm	need,80,4
	.comm	r,4,4
	.comm	toBeReleased,4,4
	.comm	sequence,20,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"sample4_in.txt\000"
	.align	2
.LC1:
	.ascii	"Error: available array info is missing\012\000"
	.align	2
.LC2:
	.ascii	"Number of Customers: %d\012\000"
	.align	2
.LC3:
	.ascii	"Currently Available resources: \000"
	.align	2
.LC4:
	.ascii	"%d \000"
	.align	2
.LC5:
	.ascii	"Maximum resources from file:\000"
	.align	2
.LC6:
	.ascii	"Enter Command: \000"
	.align	2
.LC7:
	.ascii	"%d\000"
	.align	2
.LC8:
	.ascii	"Request is satisfied.\000"
	.align	2
.LC9:
	.ascii	"Unsafe request! denied.\012\000"
	.align	2
.LC10:
	.ascii	"Available Array State\000"
	.align	2
.LC11:
	.ascii	"\012\012Maximum Array State\000"
	.align	2
.LC12:
	.ascii	"\012Allocation Array State\000"
	.align	2
.LC13:
	.ascii	"\012Need Array State\000"
	.align	2
.LC14:
	.ascii	"\012The current state is NOT SAFE\000"
	.align	2
.LC15:
	.ascii	"\012The current state is SAFE\000"
	.align	2
.LC16:
	.ascii	"The safe sequence is: <\000"
	.align	2
.LC17:
	.ascii	">\000"
	.align	2
.LC18:
	.ascii	"\012\012-->Customer/Thread %d\000"
	.align	2
.LC19:
	.ascii	"\012      Allocated resources:   \000"
	.align	2
.LC20:
	.ascii	" %d\000"
	.align	2
.LC21:
	.ascii	"\012      Needed:   \000"
	.align	2
.LC22:
	.ascii	"\012      Available:  \000"
	.align	2
.LC23:
	.ascii	"      New Available:  \000"
	.align	2
.LC24:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 112
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #116
	str	r0, [fp, #-120]
	str	r1, [fp, #-124]
	ldr	r3, .L51
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, .L51+4
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-120]
	cmp	r3, #1
	bgt	.L2
	ldr	r3, .L51+8
	ldr	r3, [r3]
	mov	r2, #39
	mov	r1, #1
	ldr	r0, .L51+12
	bl	fwrite
	mvn	r3, #0
	b	.L3
.L2:
	mov	r1, #5
	ldr	r0, .L51+16
	bl	printf
	ldr	r0, .L51+20
	bl	printf
	mov	r3, #1
	str	r3, [fp, #-108]
	b	.L4
.L5:
	ldr	r3, [fp, #-108]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-124]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-108]
	sub	r4, r3, #1
	mov	r0, r2
	bl	atoi
	mov	r3, r0
	ldr	r2, .L51+24
	str	r3, [r2, r4, lsl #2]
	ldr	r3, [fp, #-108]
	sub	r3, r3, #1
	ldr	r2, .L51+24
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L51+28
	bl	printf
	ldr	r3, [fp, #-108]
	add	r3, r3, #1
	str	r3, [fp, #-108]
.L4:
	ldr	r3, [fp, #-108]
	cmp	r3, #4
	ble	.L5
	mov	r0, #10
	bl	putchar
	ldr	r0, .L51+32
	bl	puts
	ldr	r0, [fp, #-56]
	bl	get_max
.L49:
	mov	r3, #0
	str	r3, [fp, #-104]
	ldr	r0, .L51+36
	bl	printf
	b	.L6
.L7:
	sub	r2, fp, #28
	ldr	r3, [fp, #-104]
	add	r3, r2, r3
	ldrb	r2, [fp, #-113]
	strb	r2, [r3]
	ldr	r3, [fp, #-104]
	add	r3, r3, #1
	str	r3, [fp, #-104]
.L6:
	bl	getchar
	mov	r3, r0
	strb	r3, [fp, #-113]
	ldrb	r3, [fp, #-113]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L7
	ldrb	r3, [fp, #-28]	@ zero_extendqisi2
	cmp	r3, #82
	bne	.L8
	ldrb	r3, [fp, #-27]	@ zero_extendqisi2
	cmp	r3, #81
	bne	.L8
	sub	r3, fp, #28
	add	r3, r3, #3
	str	r3, [fp, #-100]
	sub	r3, fp, #112
	mov	r2, r3
	ldr	r1, .L51+40
	ldr	r0, [fp, #-100]
	bl	__isoc99_sscanf
	ldr	r3, [fp, #-100]
	add	r3, r3, #2
	str	r3, [fp, #-100]
	mov	r3, #0
	str	r3, [fp, #-96]
	b	.L9
.L10:
	sub	r2, fp, #44
	ldr	r3, [fp, #-96]
	lsl	r3, r3, #2
	add	r3, r2, r3
	mov	r2, r3
	ldr	r1, .L51+40
	ldr	r0, [fp, #-100]
	bl	__isoc99_sscanf
	ldr	r3, [fp, #-100]
	add	r3, r3, #2
	str	r3, [fp, #-100]
	ldr	r3, [fp, #-96]
	add	r3, r3, #1
	str	r3, [fp, #-96]
.L9:
	ldr	r3, [fp, #-96]
	cmp	r3, #3
	ble	.L10
	ldr	r3, [fp, #-112]
	sub	r2, fp, #44
	mov	r1, r2
	mov	r0, r3
	bl	request_resources
	mov	r3, r0
	cmp	r3, #0
	bne	.L11
	ldr	r0, .L51+44
	bl	puts
	b	.L13
.L11:
	ldr	r3, .L51+8
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L51+48
	bl	fwrite
	b	.L13
.L8:
	ldrb	r3, [fp, #-28]	@ zero_extendqisi2
	cmp	r3, #82
	bne	.L14
	ldrb	r3, [fp, #-27]	@ zero_extendqisi2
	cmp	r3, #76
	bne	.L14
	sub	r3, fp, #28
	add	r3, r3, #3
	str	r3, [fp, #-92]
	sub	r3, fp, #112
	mov	r2, r3
	ldr	r1, .L51+40
	ldr	r0, [fp, #-92]
	bl	__isoc99_sscanf
	ldr	r3, [fp, #-92]
	add	r3, r3, #2
	str	r3, [fp, #-92]
	mov	r3, #0
	str	r3, [fp, #-88]
	b	.L15
.L16:
	sub	r2, fp, #44
	ldr	r3, [fp, #-88]
	lsl	r3, r3, #2
	add	r3, r2, r3
	mov	r2, r3
	ldr	r1, .L51+40
	ldr	r0, [fp, #-92]
	bl	__isoc99_sscanf
	ldr	r3, [fp, #-92]
	add	r3, r3, #2
	str	r3, [fp, #-92]
	ldr	r3, [fp, #-88]
	add	r3, r3, #1
	str	r3, [fp, #-88]
.L15:
	ldr	r3, [fp, #-88]
	cmp	r3, #3
	ble	.L16
	ldr	r3, [fp, #-112]
	sub	r2, fp, #44
	mov	r1, r2
	mov	r0, r3
	bl	release_resources
	b	.L13
.L14:
	ldrb	r3, [fp, #-28]	@ zero_extendqisi2
	cmp	r3, #42
	bne	.L17
	ldr	r0, .L51+52
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-80]
	b	.L18
.L19:
	ldr	r2, .L51+24
	ldr	r3, [fp, #-80]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L51+28
	bl	printf
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L18:
	ldr	r3, [fp, #-80]
	cmp	r3, #3
	ble	.L19
	ldr	r0, .L51+56
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-84]
	b	.L20
.L23:
	mov	r3, #0
	str	r3, [fp, #-80]
	b	.L21
.L22:
	ldr	r1, .L51+60
	ldr	r3, [fp, #-84]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-80]
	add	r3, r2, r3
	ldr	r3, [r1, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L51+28
	bl	printf
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L21:
	ldr	r3, [fp, #-80]
	cmp	r3, #3
	ble	.L22
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-84]
	add	r3, r3, #1
	str	r3, [fp, #-84]
.L20:
	ldr	r3, [fp, #-84]
	cmp	r3, #4
	ble	.L23
	ldr	r0, .L51+64
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-84]
	b	.L24
.L27:
	mov	r3, #0
	str	r3, [fp, #-80]
	b	.L25
.L26:
	ldr	r1, .L51+68
	ldr	r3, [fp, #-84]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-80]
	add	r3, r2, r3
	ldr	r3, [r1, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L51+28
	bl	printf
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L25:
	ldr	r3, [fp, #-80]
	cmp	r3, #3
	ble	.L26
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-84]
	add	r3, r3, #1
	str	r3, [fp, #-84]
.L24:
	ldr	r3, [fp, #-84]
	cmp	r3, #4
	ble	.L27
	ldr	r0, .L51+72
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-84]
	b	.L28
.L31:
	mov	r3, #0
	str	r3, [fp, #-80]
	b	.L29
.L30:
	ldr	r1, .L51+76
	ldr	r3, [fp, #-84]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-80]
	add	r3, r2, r3
	ldr	r3, [r1, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L51+28
	bl	printf
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L29:
	ldr	r3, [fp, #-80]
	cmp	r3, #3
	ble	.L30
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-84]
	add	r3, r3, #1
	str	r3, [fp, #-84]
.L28:
	ldr	r3, [fp, #-84]
	cmp	r3, #4
	ble	.L31
	b	.L49
.L17:
	ldrb	r3, [fp, #-28]	@ zero_extendqisi2
	cmp	r3, #82
	bne	.L32
	ldrb	r3, [fp, #-27]	@ zero_extendqisi2
	cmp	r3, #117
	bne	.L32
	ldrb	r3, [fp, #-26]	@ zero_extendqisi2
	cmp	r3, #110
	bne	.L32
	ldr	r0, .L51+24
	bl	safe_state
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmn	r3, #1
	bne	.L33
	ldr	r0, .L51+80
	bl	puts
	b	.L13
.L33:
	ldr	r0, .L51+84
	bl	puts
	ldr	r0, .L51+88
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-76]
	b	.L35
.L38:
	ldr	r3, [fp, #-76]
	cmp	r3, #3
	bgt	.L36
	ldr	r2, .L51+92
	ldr	r3, [fp, #-76]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L51+28
	bl	printf
	b	.L37
.L36:
	ldr	r2, .L51+92
	ldr	r3, [fp, #-76]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L51+40
	bl	printf
.L37:
	ldr	r3, [fp, #-76]
	add	r3, r3, #1
	str	r3, [fp, #-76]
.L35:
	ldr	r3, [fp, #-76]
	cmp	r3, #4
	ble	.L38
	ldr	r0, .L51+96
	bl	puts
	ldr	r3, .L51+100
	mov	r2, #0
	str	r2, [r3]
	b	.L39
.L48:
	ldr	r3, .L51+100
	ldr	r3, [r3]
	ldr	r2, .L51+92
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L51+104
	bl	printf
	ldr	r0, .L51+108
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-72]
	b	.L40
.L41:
	ldr	r3, .L51+100
	ldr	r3, [r3]
	ldr	r2, .L51+92
	ldr	r3, [r2, r3, lsl #2]
	ldr	r1, .L51+68
	lsl	r2, r3, #2
	ldr	r3, [fp, #-72]
	add	r3, r2, r3
	ldr	r3, [r1, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L51+112
	bl	printf
	ldr	r3, [fp, #-72]
	add	r3, r3, #1
	str	r3, [fp, #-72]
.L40:
	ldr	r3, [fp, #-72]
	cmp	r3, #3
	ble	.L41
	ldr	r0, .L51+116
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-68]
	b	.L42
.L43:
	ldr	r3, .L51+100
	ldr	r3, [r3]
	ldr	r2, .L51+92
	ldr	r3, [r2, r3, lsl #2]
	ldr	r1, .L51+76
	lsl	r2, r3, #2
	ldr	r3, [fp, #-68]
	add	r3, r2, r3
	ldr	r3, [r1, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L51+112
	bl	printf
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
.L42:
	ldr	r3, [fp, #-68]
	cmp	r3, #3
	ble	.L43
	ldr	r0, .L51+120
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-64]
	b	.L44
.L45:
	ldr	r2, .L51+24
	ldr	r3, [fp, #-64]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L51+112
	bl	printf
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
.L44:
	ldr	r3, [fp, #-64]
	cmp	r3, #3
	ble	.L45
	mov	r0, #10
	bl	putchar
	ldr	r3, .L51+100
	ldr	r3, [r3]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	sub	r0, fp, #112
	ldr	r2, .L51+124
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-112]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r0, .L51+128
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-60]
	b	.L46
.L47:
	ldr	r2, .L51+24
	ldr	r3, [fp, #-60]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L51+112
	bl	printf
	ldr	r3, [fp, #-60]
	add	r3, r3, #1
	str	r3, [fp, #-60]
.L46:
	ldr	r3, [fp, #-60]
	cmp	r3, #3
	ble	.L47
	mov	r0, #10
	bl	putchar
	ldr	r3, .L51+100
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L51+100
	str	r3, [r2]
.L39:
	ldr	r3, .L51+100
	ldr	r3, [r3]
	cmp	r3, #4
	ble	.L48
	b	.L13
.L32:
	mov	r3, #0
	b	.L3
.L13:
	b	.L49
.L3:
	ldr	r2, .L51
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L50
	bl	__stack_chk_fail
.L50:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L52:
	.align	2
.L51:
	.word	.LC24
	.word	.LC0
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	available
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	maximum
	.word	.LC12
	.word	allocation
	.word	.LC13
	.word	need
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	sequence
	.word	.LC17
	.word	r
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.word	threadRunner
	.word	.LC23
	.size	main, .-main
	.section	.rodata
	.align	2
.LC25:
	.ascii	"r\000"
	.align	2
.LC26:
	.ascii	"Error in opening input file...exiting with error co"
	.ascii	"de -1\000"
	.align	2
.LC27:
	.ascii	"\015\012\000"
	.align	2
.LC28:
	.ascii	"%s \012\000"
	.align	2
.LC29:
	.ascii	",\000"
	.align	2
.LC30:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	get_max
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_max, %function
get_max:
	@ args = 0, pretend = 0, frame = 264
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #264
	str	r0, [fp, #-264]
	ldr	r3, .L69
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L69+4
	ldr	r0, [fp, #-264]
	bl	fopen
	str	r0, [fp, #-232]
	ldr	r3, [fp, #-232]
	cmp	r3, #0
	bne	.L54
	ldr	r0, .L69+8
	bl	puts
	mvn	r3, #0
	b	.L67
.L54:
	ldr	r0, [fp, #-232]
	bl	fileno
	mov	r2, r0
	sub	r3, fp, #220
	mov	r1, r3
	mov	r0, r2
	bl	fstat
	ldr	r3, [fp, #-176]
	add	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-228]
	ldr	r3, [fp, #-228]
	mov	r2, #0
	strb	r2, [r3]
	b	.L56
.L58:
	sub	r3, fp, #108
	ldr	r2, [fp, #-232]
	mov	r1, #100
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	beq	.L56
	sub	r3, fp, #108
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r3, fp, #108
	mov	r1, r3
	ldr	r0, [fp, #-228]
	bl	strncat
.L56:
	ldr	r0, [fp, #-232]
	bl	feof
	mov	r3, r0
	cmp	r3, #0
	beq	.L58
	ldr	r0, [fp, #-232]
	bl	fclose
	mov	r3, #0
	str	r3, [fp, #-256]
	mov	r3, #0
	str	r3, [fp, #-252]
	ldr	r0, [fp, #-228]
	bl	strlen
	mov	r3, r0
	add	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-224]
	ldr	r1, [fp, #-228]
	ldr	r0, [fp, #-224]
	bl	strcpy
	ldr	r1, .L69+12
	ldr	r0, [fp, #-224]
	bl	strtok
	str	r0, [fp, #-256]
	b	.L59
.L60:
	ldr	r3, [fp, #-252]
	add	r3, r3, #1
	str	r3, [fp, #-252]
	ldr	r1, .L69+12
	mov	r0, #0
	bl	strtok
	str	r0, [fp, #-256]
.L59:
	ldr	r3, [fp, #-256]
	cmp	r3, #0
	bne	.L60
	mov	r3, #0
	str	r3, [fp, #-248]
	ldr	r1, .L69+12
	ldr	r0, [fp, #-228]
	bl	strtok
	str	r0, [fp, #-256]
	b	.L61
.L62:
	mov	r0, #4
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-248]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-124]
	ldr	r3, [fp, #-248]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-124]
	ldr	r1, [fp, #-256]
	mov	r0, r3
	bl	strcpy
	ldr	r3, [fp, #-248]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-124]
	mov	r1, r3
	ldr	r0, .L69+16
	bl	printf
	ldr	r3, [fp, #-248]
	add	r3, r3, #1
	str	r3, [fp, #-248]
	ldr	r1, .L69+12
	mov	r0, #0
	bl	strtok
	str	r0, [fp, #-256]
.L61:
	ldr	r3, [fp, #-256]
	cmp	r3, #0
	bne	.L62
	mov	r3, #0
	str	r3, [fp, #-244]
	b	.L63
.L66:
	mov	r3, #0
	str	r3, [fp, #-240]
	ldr	r3, [fp, #-244]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-124]
	ldr	r1, .L69+20
	mov	r0, r3
	bl	strtok
	str	r0, [fp, #-240]
	mov	r3, #0
	str	r3, [fp, #-236]
	b	.L64
.L65:
	ldr	r0, [fp, #-240]
	bl	atoi
	mov	r1, r0
	ldr	r0, .L69+24
	ldr	r3, [fp, #-244]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-236]
	add	r3, r2, r3
	str	r1, [r0, r3, lsl #2]
	ldr	r0, [fp, #-240]
	bl	atoi
	mov	r1, r0
	ldr	r0, .L69+28
	ldr	r3, [fp, #-244]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-236]
	add	r3, r2, r3
	str	r1, [r0, r3, lsl #2]
	ldr	r3, [fp, #-236]
	add	r3, r3, #1
	str	r3, [fp, #-236]
	ldr	r1, .L69+20
	mov	r0, #0
	bl	strtok
	str	r0, [fp, #-240]
.L64:
	ldr	r3, [fp, #-240]
	cmp	r3, #0
	bne	.L65
	ldr	r3, [fp, #-244]
	add	r3, r3, #1
	str	r3, [fp, #-244]
.L63:
	ldr	r3, [fp, #-244]
	cmp	r3, #4
	ble	.L66
	mov	r3, #1
.L67:
	ldr	r2, .L69
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L68
	bl	__stack_chk_fail
.L68:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L70:
	.align	2
.L69:
	.word	.LC30
	.word	.LC25
	.word	.LC26
	.word	.LC27
	.word	.LC28
	.word	.LC29
	.word	maximum
	.word	need
	.size	get_max, .-get_max
	.align	2
	.global	request_resources
	.syntax unified
	.arm
	.fpu softvfp
	.type	request_resources, %function
request_resources:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r2, [fp, #-28]
	ldr	r1, .L79
	ldr	r0, [fp, #-24]
	bl	initial_safe_check
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L72
	mvn	r3, #0
	b	.L73
.L72:
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L74
.L75:
	ldr	r2, .L79
	ldr	r3, [fp, #-20]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r3, [r3]
	sub	r2, r2, r3
	ldr	r1, .L79
	ldr	r3, [fp, #-20]
	str	r2, [r1, r3, lsl #2]
	ldr	r1, .L79+4
	ldr	r3, [fp, #-24]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r3, [r3]
	add	r2, r2, r3
	ldr	r0, .L79+4
	ldr	r3, [fp, #-24]
	lsl	r1, r3, #2
	ldr	r3, [fp, #-20]
	add	r3, r1, r3
	str	r2, [r0, r3, lsl #2]
	ldr	r1, .L79+8
	ldr	r3, [fp, #-24]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r3, [r3]
	sub	r2, r2, r3
	ldr	r0, .L79+8
	ldr	r3, [fp, #-24]
	lsl	r1, r3, #2
	ldr	r3, [fp, #-20]
	add	r3, r1, r3
	str	r2, [r0, r3, lsl #2]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L74:
	ldr	r3, [fp, #-20]
	cmp	r3, #3
	ble	.L75
	ldr	r0, .L79
	bl	safe_state
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L76
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L77
.L78:
	ldr	r2, .L79
	ldr	r3, [fp, #-16]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r3, [r3]
	add	r2, r2, r3
	ldr	r1, .L79
	ldr	r3, [fp, #-16]
	str	r2, [r1, r3, lsl #2]
	ldr	r1, .L79+4
	ldr	r3, [fp, #-24]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r3, [r3]
	sub	r2, r2, r3
	ldr	r0, .L79+4
	ldr	r3, [fp, #-24]
	lsl	r1, r3, #2
	ldr	r3, [fp, #-16]
	add	r3, r1, r3
	str	r2, [r0, r3, lsl #2]
	ldr	r1, .L79+8
	ldr	r3, [fp, #-24]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r3, [r3]
	add	r2, r2, r3
	ldr	r0, .L79+8
	ldr	r3, [fp, #-24]
	lsl	r1, r3, #2
	ldr	r3, [fp, #-16]
	add	r3, r1, r3
	str	r2, [r0, r3, lsl #2]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L77:
	ldr	r3, [fp, #-16]
	cmp	r3, #3
	ble	.L78
	mvn	r3, #0
	b	.L73
.L76:
	mov	r3, #0
.L73:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L80:
	.align	2
.L79:
	.word	available
	.word	allocation
	.word	need
	.size	request_resources, .-request_resources
	.section	.rodata
	.align	2
.LC31:
	.ascii	"Invalid release! denied.\012\000"
	.align	2
.LC32:
	.ascii	"Release is satisfied.\000"
	.text
	.align	2
	.global	release_resources
	.syntax unified
	.arm
	.fpu softvfp
	.type	release_resources, %function
release_resources:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	mov	r3, #1
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L82
.L84:
	ldr	r2, .L89
	ldr	r3, [fp, #-12]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r3, [r3]
	add	r2, r2, r3
	ldr	r1, .L89
	ldr	r3, [fp, #-12]
	str	r2, [r1, r3, lsl #2]
	ldr	r1, .L89+4
	ldr	r3, [fp, #-24]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	ldr	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r3, [r3]
	sub	r2, r2, r3
	ldr	r0, .L89+4
	ldr	r3, [fp, #-24]
	lsl	r1, r3, #2
	ldr	r3, [fp, #-12]
	add	r3, r1, r3
	str	r2, [r0, r3, lsl #2]
	ldr	r1, .L89+8
	ldr	r3, [fp, #-24]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	ldr	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r3, [r3]
	add	r2, r2, r3
	ldr	r0, .L89+8
	ldr	r3, [fp, #-24]
	lsl	r1, r3, #2
	ldr	r3, [fp, #-12]
	add	r3, r1, r3
	str	r2, [r0, r3, lsl #2]
	ldr	r1, .L89+4
	ldr	r3, [fp, #-24]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	ldr	r3, [r1, r3, lsl #2]
	cmp	r3, #0
	bge	.L83
	mov	r3, #0
	str	r3, [fp, #-16]
.L83:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L82:
	ldr	r3, [fp, #-12]
	cmp	r3, #3
	ble	.L84
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L85
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L86
.L87:
	ldr	r2, .L89
	ldr	r3, [fp, #-8]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r3, [r3]
	sub	r2, r2, r3
	ldr	r1, .L89
	ldr	r3, [fp, #-8]
	str	r2, [r1, r3, lsl #2]
	ldr	r1, .L89+4
	ldr	r3, [fp, #-24]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r3, [r3]
	add	r2, r2, r3
	ldr	r0, .L89+4
	ldr	r3, [fp, #-24]
	lsl	r1, r3, #2
	ldr	r3, [fp, #-8]
	add	r3, r1, r3
	str	r2, [r0, r3, lsl #2]
	ldr	r1, .L89+8
	ldr	r3, [fp, #-24]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-28]
	add	r3, r1, r3
	ldr	r3, [r3]
	sub	r2, r2, r3
	ldr	r0, .L89+8
	ldr	r3, [fp, #-24]
	lsl	r1, r3, #2
	ldr	r3, [fp, #-8]
	add	r3, r1, r3
	str	r2, [r0, r3, lsl #2]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L86:
	ldr	r3, [fp, #-8]
	cmp	r3, #3
	ble	.L87
	ldr	r3, .L89+12
	ldr	r3, [r3]
	mov	r2, #25
	mov	r1, #1
	ldr	r0, .L89+16
	bl	fwrite
	b	.L81
.L85:
	ldr	r0, .L89+20
	bl	puts
	nop
.L81:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L90:
	.align	2
.L89:
	.word	available
	.word	allocation
	.word	need
	.word	stderr
	.word	.LC31
	.word	.LC32
	.size	release_resources, .-release_resources
	.align	2
	.global	initial_safe_check
	.syntax unified
	.arm
	.fpu softvfp
	.type	initial_safe_check, %function
initial_safe_check:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L92
.L96:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r0, .L97
	ldr	r3, [fp, #-16]
	lsl	r1, r3, #2
	ldr	r3, [fp, #-8]
	add	r3, r1, r3
	ldr	r3, [r0, r3, lsl #2]
	cmp	r2, r3
	bgt	.L93
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r1, [fp, #-20]
	add	r3, r1, r3
	ldr	r3, [r3]
	cmp	r2, r3
	ble	.L94
.L93:
	mvn	r3, #0
	b	.L95
.L94:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L92:
	ldr	r3, [fp, #-8]
	cmp	r3, #3
	ble	.L96
	mov	r3, #1
.L95:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L98:
	.align	2
.L97:
	.word	need
	.size	initial_safe_check, .-initial_safe_check
	.section	.rodata
	.align	2
.LC33:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	safe_state
	.syntax unified
	.arm
	.fpu softvfp
	.type	safe_state, %function
safe_state:
	@ args = 0, pretend = 0, frame = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #80
	str	r0, [fp, #-80]
	ldr	r3, .L122
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mvn	r3, #0
	str	r3, [fp, #-72]
	mov	r3, #0
	str	r3, [fp, #-68]
	b	.L100
.L101:
	ldr	r1, .L122+4
	ldr	r3, [fp, #-68]
	ldr	r2, [fp, #-72]
	str	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
.L100:
	ldr	r3, [fp, #-68]
	cmp	r3, #3
	ble	.L101
	mov	r3, #0
	str	r3, [fp, #-64]
	b	.L102
.L103:
	ldr	r3, [fp, #-64]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-80]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-64]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-40]
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
.L102:
	ldr	r3, [fp, #-64]
	cmp	r3, #3
	ble	.L103
	mov	r3, #0
	str	r3, [fp, #-60]
	b	.L104
.L105:
	ldr	r3, [fp, #-60]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3, #-24]
	ldr	r3, [fp, #-60]
	add	r3, r3, #1
	str	r3, [fp, #-60]
.L104:
	ldr	r3, [fp, #-60]
	cmp	r3, #4
	ble	.L105
	mov	r3, #0
	str	r3, [fp, #-56]
	b	.L106
.L114:
	ldr	r3, [fp, #-56]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-24]
	cmp	r3, #0
	bne	.L107
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L108
.L113:
	ldr	r1, .L122+8
	ldr	r3, [fp, #-56]
	lsl	r2, r3, #2
	ldr	r3, [fp, #-52]
	add	r3, r2, r3
	ldr	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r3, [r3, #-40]
	cmp	r2, r3
	bgt	.L121
	ldr	r3, [fp, #-52]
	cmp	r3, #3
	bne	.L110
	ldr	r3, [fp, #-56]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	mov	r2, #1
	str	r2, [r3, #-24]
	ldr	r3, [fp, #-72]
	add	r3, r3, #1
	str	r3, [fp, #-72]
	ldr	r1, .L122+4
	ldr	r3, [fp, #-72]
	ldr	r2, [fp, #-56]
	str	r2, [r1, r3, lsl #2]
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L111
.L112:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [r3, #-40]
	ldr	r0, .L122+12
	ldr	r3, [fp, #-56]
	lsl	r1, r3, #2
	ldr	r3, [fp, #-52]
	add	r3, r1, r3
	ldr	r3, [r0, r3, lsl #2]
	add	r2, r2, r3
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-40]
	mvn	r3, #0
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L111:
	ldr	r3, [fp, #-52]
	cmp	r3, #3
	ble	.L112
.L110:
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L108:
	ldr	r3, [fp, #-52]
	cmp	r3, #3
	ble	.L113
	b	.L107
.L121:
	nop
.L107:
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
.L106:
	ldr	r3, [fp, #-56]
	cmp	r3, #4
	ble	.L114
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L115
.L118:
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-24]
	cmp	r3, #0
	bne	.L116
	mvn	r3, #0
	b	.L119
.L116:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L115:
	ldr	r3, [fp, #-48]
	cmp	r3, #4
	ble	.L118
	mov	r3, #1
.L119:
	ldr	r2, .L122
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L120
	bl	__stack_chk_fail
.L120:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L123:
	.align	2
.L122:
	.word	.LC33
	.word	sequence
	.word	need
	.word	allocation
	.size	safe_state, .-safe_state
	.section	.rodata
	.align	2
.LC34:
	.ascii	"      Thread has started\000"
	.align	2
.LC35:
	.ascii	"      Thread has finished\000"
	.align	2
.LC36:
	.ascii	"      Thread is releasing resources\000"
	.text
	.align	2
	.global	threadRunner
	.syntax unified
	.arm
	.fpu softvfp
	.type	threadRunner, %function
threadRunner:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r0, .L125
	bl	puts
	mov	r0, #1
	bl	sleep
	ldr	r0, .L125+4
	bl	puts
	mov	r0, #1
	bl	sleep
	ldr	r0, .L125+8
	bl	puts
	ldr	r3, .L125+12
	ldr	r3, [r3]
	ldr	r2, .L125+16
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, .L125+12
	ldr	r3, [r3]
	ldr	r1, .L125+16
	ldr	r3, [r1, r3, lsl #2]
	lsl	r3, r3, #4
	ldr	r1, .L125+20
	add	r3, r3, r1
	mov	r1, r3
	mov	r0, r2
	bl	release_resources
	mov	r0, #0
	bl	pthread_exit
.L126:
	.align	2
.L125:
	.word	.LC34
	.word	.LC35
	.word	.LC36
	.word	r
	.word	sequence
	.word	allocation
	.size	threadRunner, .-threadRunner
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
