	.file	"384309.c"
	.intel_syntax noprefix
	.text
	.globl	ERROR_MESSAGES
	.section	.rodata
.LC0:
	.string	"Invalid parametres"
.LC1:
	.string	"Invalid conversion"
.LC2:
	.string	"Cannot set output"
.LC3:
	.string	"Cannot fork"
.LC4:
	.string	"Aborting.."
.LC5:
	.string	"Failed function ftok"
.LC6:
	.string	"Failed function shmget"
.LC7:
	.string	"Failed function shmat"
.LC8:
	.string	"Failed function shmdt"
.LC9:
	.string	"Failed function shmctl"
	.section	.data.rel.local,"aw"
	.align 32
	.type	ERROR_MESSAGES, @object
	.size	ERROR_MESSAGES, 88
ERROR_MESSAGES:
	.zero	8
	.quad	.LC0
	.quad	.LC1
	.quad	.LC2
	.quad	.LC3
	.quad	.LC4
	.quad	.LC5
	.quad	.LC6
	.quad	.LC7
	.quad	.LC8
	.quad	.LC9
	.globl	RESOURCE
	.data
	.align 32
	.type	RESOURCE, @object
	.size	RESOURCE, 112
RESOURCE:
	.long	0
	.long	0
	.quad	0
	.long	-1
	.zero	4
	.quad	0
	.quad	0
	.quad	0
	.quad	0
	.long	-1
	.zero	4
	.quad	0
	.quad	0
	.quad	0
	.quad	0
	.quad	0
	.zero	8
	.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	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 280
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	DWORD PTR -164[rbp], edi
	mov	QWORD PTR -176[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	rbx, rax
	lea	rsi, programAbort[rip]
	mov	edi, 15
	call	signal@PLT
	lea	rsi, programAbort[rip]
	mov	edi, 2
	call	signal@PLT
	lea	rax, -96[rbp]
	mov	rdx, QWORD PTR -176[rbp]
	mov	ecx, DWORD PTR -164[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	loadParams
	mov	eax, DWORD PTR -96[rbp]
	test	eax, eax
	je	.L2
	mov	eax, DWORD PTR -96[rbp]
	mov	edi, eax
	call	printError
	mov	eax, DWORD PTR -96[rbp]
	jmp	.L3
.L2:
	lea	rax, -288[rbp]
	push	QWORD PTR -72[rbp]
	push	QWORD PTR -80[rbp]
	push	QWORD PTR -88[rbp]
	push	QWORD PTR -96[rbp]
	mov	rdi, rax
	call	loadResources
	add	rsp, 32
	mov	rax, QWORD PTR -288[rbp]
	mov	rdx, QWORD PTR -280[rbp]
	mov	QWORD PTR RESOURCE[rip], rax
	mov	QWORD PTR RESOURCE[rip+8], rdx
	mov	rax, QWORD PTR -272[rbp]
	mov	rdx, QWORD PTR -264[rbp]
	mov	QWORD PTR RESOURCE[rip+16], rax
	mov	QWORD PTR RESOURCE[rip+24], rdx
	mov	rax, QWORD PTR -256[rbp]
	mov	rdx, QWORD PTR -248[rbp]
	mov	QWORD PTR RESOURCE[rip+32], rax
	mov	QWORD PTR RESOURCE[rip+40], rdx
	mov	rax, QWORD PTR -240[rbp]
	mov	rdx, QWORD PTR -232[rbp]
	mov	QWORD PTR RESOURCE[rip+48], rax
	mov	QWORD PTR RESOURCE[rip+56], rdx
	mov	rax, QWORD PTR -224[rbp]
	mov	rdx, QWORD PTR -216[rbp]
	mov	QWORD PTR RESOURCE[rip+64], rax
	mov	QWORD PTR RESOURCE[rip+72], rdx
	mov	rax, QWORD PTR -208[rbp]
	mov	rdx, QWORD PTR -200[rbp]
	mov	QWORD PTR RESOURCE[rip+80], rax
	mov	QWORD PTR RESOURCE[rip+88], rdx
	mov	rax, QWORD PTR -192[rbp]
	mov	rdx, QWORD PTR -184[rbp]
	mov	QWORD PTR RESOURCE[rip+96], rax
	mov	QWORD PTR RESOURCE[rip+104], rdx
	mov	eax, DWORD PTR RESOURCE[rip]
	test	eax, eax
	je	.L4
	mov	eax, DWORD PTR RESOURCE[rip]
	mov	edi, eax
	call	printError
	push	QWORD PTR RESOURCE[rip+104]
	push	QWORD PTR RESOURCE[rip+96]
	push	QWORD PTR RESOURCE[rip+88]
	push	QWORD PTR RESOURCE[rip+80]
	push	QWORD PTR RESOURCE[rip+72]
	push	QWORD PTR RESOURCE[rip+64]
	push	QWORD PTR RESOURCE[rip+56]
	push	QWORD PTR RESOURCE[rip+48]
	push	QWORD PTR RESOURCE[rip+40]
	push	QWORD PTR RESOURCE[rip+32]
	push	QWORD PTR RESOURCE[rip+24]
	push	QWORD PTR RESOURCE[rip+16]
	push	QWORD PTR RESOURCE[rip+8]
	push	QWORD PTR RESOURCE[rip]
	call	freeResources
	add	rsp, 112
	mov	eax, DWORD PTR RESOURCE[rip]
	jmp	.L3
.L4:
	mov	edi, 0
	call	time@PLT
	mov	edi, eax
	call	srand@PLT
	mov	DWORD PTR -132[rbp], -1
	mov	eax, DWORD PTR -88[rbp]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -128[rbp], rdx
	movsx	rdx, eax
	mov	QWORD PTR -304[rbp], rdx
	mov	QWORD PTR -296[rbp], 0
	movsx	rdx, eax
	mov	QWORD PTR -320[rbp], rdx
	mov	QWORD PTR -312[rbp], 0
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L5:
	cmp	rsp, rdx
	je	.L6
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L5
.L6:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L7
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L7:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -120[rbp], rax
	mov	eax, DWORD PTR -92[rbp]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -112[rbp], rdx
	movsx	rdx, eax
	mov	r14, rdx
	mov	r15d, 0
	movsx	rdx, eax
	mov	r12, rdx
	mov	r13d, 0
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L8:
	cmp	rsp, rdx
	je	.L9
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L8
.L9:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L10
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L10:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -104[rbp], rax
	mov	DWORD PTR -136[rbp], 0
	jmp	.L11
.L19:
	call	fork@PLT
	mov	DWORD PTR -132[rbp], eax
	cmp	DWORD PTR -132[rbp], -1
	jne	.L12
	mov	edi, 4
	call	printError
	mov	DWORD PTR -140[rbp], 0
	jmp	.L13
.L14:
	mov	rax, QWORD PTR -104[rbp]
	mov	edx, DWORD PTR -140[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	esi, 15
	mov	edi, eax
	call	kill@PLT
	add	DWORD PTR -140[rbp], 1
.L13:
	mov	eax, DWORD PTR -140[rbp]
	cmp	eax, DWORD PTR -136[rbp]
	jl	.L14
	mov	DWORD PTR -144[rbp], 0
	jmp	.L15
.L16:
	mov	rax, QWORD PTR -104[rbp]
	mov	edx, DWORD PTR -144[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	waitpid@PLT
	add	DWORD PTR -144[rbp], 1
.L15:
	mov	eax, DWORD PTR -144[rbp]
	cmp	eax, DWORD PTR -136[rbp]
	jl	.L16
	push	QWORD PTR RESOURCE[rip+104]
	push	QWORD PTR RESOURCE[rip+96]
	push	QWORD PTR RESOURCE[rip+88]
	push	QWORD PTR RESOURCE[rip+80]
	push	QWORD PTR RESOURCE[rip+72]
	push	QWORD PTR RESOURCE[rip+64]
	push	QWORD PTR RESOURCE[rip+56]
	push	QWORD PTR RESOURCE[rip+48]
	push	QWORD PTR RESOURCE[rip+40]
	push	QWORD PTR RESOURCE[rip+32]
	push	QWORD PTR RESOURCE[rip+24]
	push	QWORD PTR RESOURCE[rip+16]
	push	QWORD PTR RESOURCE[rip+8]
	push	QWORD PTR RESOURCE[rip]
	call	freeResources
	add	rsp, 112
	mov	eax, 4
	jmp	.L3
.L12:
	cmp	DWORD PTR -132[rbp], 0
	jne	.L17
	mov	eax, DWORD PTR -136[rbp]
	add	eax, 1
	push	QWORD PTR -72[rbp]
	push	QWORD PTR -80[rbp]
	push	QWORD PTR -88[rbp]
	push	QWORD PTR -96[rbp]
	mov	edi, eax
	call	processWriter
	add	rsp, 32
	jmp	.L18
.L17:
	mov	rax, QWORD PTR -104[rbp]
	mov	edx, DWORD PTR -136[rbp]
	movsx	rdx, edx
	mov	ecx, DWORD PTR -132[rbp]
	mov	DWORD PTR [rax+rdx*4], ecx
.L18:
	add	DWORD PTR -136[rbp], 1
.L11:
	mov	eax, DWORD PTR -92[rbp]
	cmp	DWORD PTR -136[rbp], eax
	jl	.L19
	mov	DWORD PTR -136[rbp], 0
	jmp	.L20
.L32:
	call	fork@PLT
	mov	DWORD PTR -132[rbp], eax
	cmp	DWORD PTR -132[rbp], -1
	jne	.L21
	mov	edi, 4
	call	printError
	mov	DWORD PTR -148[rbp], 0
	jmp	.L22
.L23:
	mov	rax, QWORD PTR -104[rbp]
	mov	edx, DWORD PTR -148[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	esi, 15
	mov	edi, eax
	call	kill@PLT
	add	DWORD PTR -148[rbp], 1
.L22:
	mov	eax, DWORD PTR -92[rbp]
	cmp	DWORD PTR -148[rbp], eax
	jl	.L23
	mov	DWORD PTR -152[rbp], 0
	jmp	.L24
.L25:
	mov	rax, QWORD PTR -120[rbp]
	mov	edx, DWORD PTR -152[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	esi, 15
	mov	edi, eax
	call	kill@PLT
	add	DWORD PTR -152[rbp], 1
.L24:
	mov	eax, DWORD PTR -152[rbp]
	cmp	eax, DWORD PTR -136[rbp]
	jl	.L25
	mov	DWORD PTR -156[rbp], 0
	jmp	.L26
.L27:
	mov	rax, QWORD PTR -104[rbp]
	mov	edx, DWORD PTR -156[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	waitpid@PLT
	add	DWORD PTR -156[rbp], 1
.L26:
	mov	eax, DWORD PTR -92[rbp]
	cmp	DWORD PTR -156[rbp], eax
	jl	.L27
	mov	DWORD PTR -160[rbp], 0
	jmp	.L28
.L29:
	mov	rax, QWORD PTR -120[rbp]
	mov	edx, DWORD PTR -160[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	waitpid@PLT
	add	DWORD PTR -160[rbp], 1
.L28:
	mov	eax, DWORD PTR -160[rbp]
	cmp	eax, DWORD PTR -136[rbp]
	jl	.L29
	push	QWORD PTR RESOURCE[rip+104]
	push	QWORD PTR RESOURCE[rip+96]
	push	QWORD PTR RESOURCE[rip+88]
	push	QWORD PTR RESOURCE[rip+80]
	push	QWORD PTR RESOURCE[rip+72]
	push	QWORD PTR RESOURCE[rip+64]
	push	QWORD PTR RESOURCE[rip+56]
	push	QWORD PTR RESOURCE[rip+48]
	push	QWORD PTR RESOURCE[rip+40]
	push	QWORD PTR RESOURCE[rip+32]
	push	QWORD PTR RESOURCE[rip+24]
	push	QWORD PTR RESOURCE[rip+16]
	push	QWORD PTR RESOURCE[rip+8]
	push	QWORD PTR RESOURCE[rip]
	call	freeResources
	add	rsp, 112
	mov	eax, 4
	jmp	.L3
.L21:
	cmp	DWORD PTR -132[rbp], 0
	jne	.L30
	mov	eax, DWORD PTR -136[rbp]
	add	eax, 1
	push	QWORD PTR -72[rbp]
	push	QWORD PTR -80[rbp]
	push	QWORD PTR -88[rbp]
	push	QWORD PTR -96[rbp]
	mov	edi, eax
	call	processReader
	add	rsp, 32
	jmp	.L31
.L30:
	mov	rax, QWORD PTR -120[rbp]
	mov	edx, DWORD PTR -136[rbp]
	movsx	rdx, edx
	mov	ecx, DWORD PTR -132[rbp]
	mov	DWORD PTR [rax+rdx*4], ecx
.L31:
	add	DWORD PTR -136[rbp], 1
.L20:
	mov	eax, DWORD PTR -88[rbp]
	cmp	DWORD PTR -136[rbp], eax
	jl	.L32
	mov	DWORD PTR -136[rbp], 0
	jmp	.L33
.L34:
	mov	rax, QWORD PTR -104[rbp]
	mov	edx, DWORD PTR -136[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	waitpid@PLT
	add	DWORD PTR -136[rbp], 1
.L33:
	mov	eax, DWORD PTR -92[rbp]
	cmp	DWORD PTR -136[rbp], eax
	jl	.L34
	mov	rax, QWORD PTR RESOURCE[rip+72]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR RESOURCE[rip+32]
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR RESOURCE[rip+72]
	mov	rdi, rax
	call	sem_post@PLT
	mov	DWORD PTR -136[rbp], 0
	jmp	.L35
.L36:
	mov	rax, QWORD PTR -120[rbp]
	mov	edx, DWORD PTR -136[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	waitpid@PLT
	add	DWORD PTR -136[rbp], 1
.L35:
	mov	eax, DWORD PTR -88[rbp]
	cmp	DWORD PTR -136[rbp], eax
	jl	.L36
	push	QWORD PTR RESOURCE[rip+104]
	push	QWORD PTR RESOURCE[rip+96]
	push	QWORD PTR RESOURCE[rip+88]
	push	QWORD PTR RESOURCE[rip+80]
	push	QWORD PTR RESOURCE[rip+72]
	push	QWORD PTR RESOURCE[rip+64]
	push	QWORD PTR RESOURCE[rip+56]
	push	QWORD PTR RESOURCE[rip+48]
	push	QWORD PTR RESOURCE[rip+40]
	push	QWORD PTR RESOURCE[rip+32]
	push	QWORD PTR RESOURCE[rip+24]
	push	QWORD PTR RESOURCE[rip+16]
	push	QWORD PTR RESOURCE[rip+8]
	push	QWORD PTR RESOURCE[rip]
	call	freeResources
	add	rsp, 112
	mov	eax, DWORD PTR RESOURCE[rip]
.L3:
	mov	rsp, rbx
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	loadParams
	.type	loadParams, @function
loadParams:
.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, 96
	mov	QWORD PTR -72[rbp], rdi
	mov	DWORD PTR -76[rbp], esi
	mov	QWORD PTR -88[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -48[rbp], 0
	mov	QWORD PTR -40[rbp], 0
	mov	QWORD PTR -32[rbp], 0
	mov	QWORD PTR -24[rbp], 0
	cmp	DWORD PTR -76[rbp], 7
	jne	.L40
	mov	DWORD PTR -52[rbp], 0
	mov	rax, QWORD PTR -88[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rdx, -52[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	parseInt
	mov	DWORD PTR -44[rbp], eax
	mov	eax, DWORD PTR -52[rbp]
	test	eax, eax
	je	.L41
	mov	DWORD PTR -48[rbp], 2
	mov	rcx, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	QWORD PTR [rcx], rax
	mov	QWORD PTR 8[rcx], rdx
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 16[rcx], rax
	mov	QWORD PTR 24[rcx], rdx
	jmp	.L39
.L41:
	mov	rax, QWORD PTR -88[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rdx, -52[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	parseInt
	mov	DWORD PTR -40[rbp], eax
	mov	eax, DWORD PTR -52[rbp]
	test	eax, eax
	je	.L43
	mov	DWORD PTR -48[rbp], 2
	mov	rcx, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	QWORD PTR [rcx], rax
	mov	QWORD PTR 8[rcx], rdx
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 16[rcx], rax
	mov	QWORD PTR 24[rcx], rdx
	jmp	.L42
.L43:
	mov	rax, QWORD PTR -88[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	lea	rdx, -52[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	parseInt
	mov	DWORD PTR -36[rbp], eax
	mov	eax, DWORD PTR -52[rbp]
	test	eax, eax
	je	.L44
	mov	DWORD PTR -48[rbp], 2
	mov	rcx, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	QWORD PTR [rcx], rax
	mov	QWORD PTR 8[rcx], rdx
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 16[rcx], rax
	mov	QWORD PTR 24[rcx], rdx
	jmp	.L42
.L44:
	mov	rax, QWORD PTR -88[rbp]
	add	rax, 32
	mov	rax, QWORD PTR [rax]
	lea	rdx, -52[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	parseInt
	mov	DWORD PTR -32[rbp], eax
	mov	eax, DWORD PTR -52[rbp]
	test	eax, eax
	je	.L45
	mov	DWORD PTR -48[rbp], 2
	mov	rcx, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	QWORD PTR [rcx], rax
	mov	QWORD PTR 8[rcx], rdx
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 16[rcx], rax
	mov	QWORD PTR 24[rcx], rdx
	jmp	.L42
.L45:
	mov	rax, QWORD PTR -88[rbp]
	add	rax, 40
	mov	rax, QWORD PTR [rax]
	lea	rdx, -52[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	parseInt
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -52[rbp]
	test	eax, eax
	je	.L46
	mov	DWORD PTR -48[rbp], 2
	mov	rcx, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	QWORD PTR [rcx], rax
	mov	QWORD PTR 8[rcx], rdx
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 16[rcx], rax
	mov	QWORD PTR 24[rcx], rdx
	jmp	.L42
.L46:
	mov	rax, QWORD PTR -88[rbp]
	mov	rax, QWORD PTR 48[rax]
	mov	QWORD PTR -24[rbp], rax
	jmp	.L47
.L42:
	jmp	.L39
.L40:
	mov	DWORD PTR -48[rbp], 1
.L47:
	mov	eax, DWORD PTR -40[rbp]
	test	eax, eax
	js	.L49
	mov	eax, DWORD PTR -44[rbp]
	test	eax, eax
	js	.L49
	mov	eax, DWORD PTR -36[rbp]
	test	eax, eax
	js	.L49
	mov	eax, DWORD PTR -32[rbp]
	test	eax, eax
	js	.L49
	mov	eax, DWORD PTR -28[rbp]
	test	eax, eax
	jns	.L50
.L49:
	mov	DWORD PTR -48[rbp], 1
.L50:
	mov	rcx, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	QWORD PTR [rcx], rax
	mov	QWORD PTR 8[rcx], rdx
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 16[rcx], rax
	mov	QWORD PTR 24[rcx], rdx
.L39:
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L52
	call	__stack_chk_fail@PLT
.L52:
	mov	rax, QWORD PTR -72[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	loadParams, .-loadParams
	.section	.rodata
.LC10:
	.string	"-"
.LC11:
	.string	"w"
.LC12:
	.string	"HOME"
	.text
	.globl	loadResources
	.type	loadResources, @function
loadResources:
.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, 152
	.cfi_offset 3, -24
	mov	QWORD PTR -152[rbp], rdi
	lea	rdx, -128[rbp]
	mov	eax, 0
	mov	ecx, 14
	mov	rdi, rdx
	rep stosq
	mov	DWORD PTR -112[rbp], -1
	mov	DWORD PTR -72[rbp], -1
	call	getpid@PLT
	mov	DWORD PTR -124[rbp], eax
	mov	rax, QWORD PTR 40[rbp]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L54
	mov	rax, QWORD PTR stdout[rip]
	mov	QWORD PTR -120[rbp], rax
	jmp	.L55
.L54:
	mov	rax, QWORD PTR 40[rbp]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -120[rbp], rax
	mov	rax, QWORD PTR -120[rbp]
	test	rax, rax
	jne	.L56
	mov	DWORD PTR -128[rbp], 3
	mov	rax, QWORD PTR -152[rbp]
	mov	rcx, QWORD PTR -128[rbp]
	mov	rbx, QWORD PTR -120[rbp]
	mov	QWORD PTR [rax], rcx
	mov	QWORD PTR 8[rax], rbx
	mov	rcx, QWORD PTR -112[rbp]
	mov	rbx, QWORD PTR -104[rbp]
	mov	QWORD PTR 16[rax], rcx
	mov	QWORD PTR 24[rax], rbx
	mov	rcx, QWORD PTR -96[rbp]
	mov	rbx, QWORD PTR -88[rbp]
	mov	QWORD PTR 32[rax], rcx
	mov	QWORD PTR 40[rax], rbx
	mov	rcx, QWORD PTR -80[rbp]
	mov	rbx, QWORD PTR -72[rbp]
	mov	QWORD PTR 48[rax], rcx
	mov	QWORD PTR 56[rax], rbx
	mov	rcx, QWORD PTR -64[rbp]
	mov	rbx, QWORD PTR -56[rbp]
	mov	QWORD PTR 64[rax], rcx
	mov	QWORD PTR 72[rax], rbx
	mov	rcx, QWORD PTR -48[rbp]
	mov	rbx, QWORD PTR -40[rbp]
	mov	QWORD PTR 80[rax], rcx
	mov	QWORD PTR 88[rax], rbx
	mov	rcx, QWORD PTR -32[rbp]
	mov	rbx, QWORD PTR -24[rbp]
	mov	QWORD PTR 96[rax], rcx
	mov	QWORD PTR 104[rax], rbx
	jmp	.L66
.L56:
	mov	rax, QWORD PTR -120[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	setbuf@PLT
.L55:
	lea	rdi, .LC12[rip]
	call	getenv@PLT
	mov	esi, 42
	mov	rdi, rax
	call	ftok@PLT
	mov	DWORD PTR -136[rbp], eax
	lea	rdi, .LC12[rip]
	call	getenv@PLT
	mov	esi, 24
	mov	rdi, rax
	call	ftok@PLT
	mov	DWORD PTR -132[rbp], eax
	cmp	DWORD PTR -136[rbp], -1
	je	.L58
	cmp	DWORD PTR -132[rbp], -1
	jne	.L59
.L58:
	mov	DWORD PTR -128[rbp], 6
	mov	rax, QWORD PTR -152[rbp]
	mov	rcx, QWORD PTR -128[rbp]
	mov	rbx, QWORD PTR -120[rbp]
	mov	QWORD PTR [rax], rcx
	mov	QWORD PTR 8[rax], rbx
	mov	rcx, QWORD PTR -112[rbp]
	mov	rbx, QWORD PTR -104[rbp]
	mov	QWORD PTR 16[rax], rcx
	mov	QWORD PTR 24[rax], rbx
	mov	rcx, QWORD PTR -96[rbp]
	mov	rbx, QWORD PTR -88[rbp]
	mov	QWORD PTR 32[rax], rcx
	mov	QWORD PTR 40[rax], rbx
	mov	rcx, QWORD PTR -80[rbp]
	mov	rbx, QWORD PTR -72[rbp]
	mov	QWORD PTR 48[rax], rcx
	mov	QWORD PTR 56[rax], rbx
	mov	rcx, QWORD PTR -64[rbp]
	mov	rbx, QWORD PTR -56[rbp]
	mov	QWORD PTR 64[rax], rcx
	mov	QWORD PTR 72[rax], rbx
	mov	rcx, QWORD PTR -48[rbp]
	mov	rbx, QWORD PTR -40[rbp]
	mov	QWORD PTR 80[rax], rcx
	mov	QWORD PTR 88[rax], rbx
	mov	rcx, QWORD PTR -32[rbp]
	mov	rbx, QWORD PTR -24[rbp]
	mov	QWORD PTR 96[rax], rcx
	mov	QWORD PTR 104[rax], rbx
	jmp	.L66
.L59:
	mov	eax, DWORD PTR -136[rbp]
	mov	edx, 944
	mov	esi, 32
	mov	edi, eax
	call	shmget@PLT
	mov	DWORD PTR -112[rbp], eax
	mov	eax, DWORD PTR -132[rbp]
	mov	edx, 944
	mov	esi, 48
	mov	edi, eax
	call	shmget@PLT
	mov	DWORD PTR -72[rbp], eax
	mov	eax, DWORD PTR -112[rbp]
	test	eax, eax
	js	.L60
	mov	eax, DWORD PTR -72[rbp]
	test	eax, eax
	jns	.L61
.L60:
	mov	DWORD PTR -128[rbp], 7
	mov	rax, QWORD PTR -152[rbp]
	mov	rcx, QWORD PTR -128[rbp]
	mov	rbx, QWORD PTR -120[rbp]
	mov	QWORD PTR [rax], rcx
	mov	QWORD PTR 8[rax], rbx
	mov	rcx, QWORD PTR -112[rbp]
	mov	rbx, QWORD PTR -104[rbp]
	mov	QWORD PTR 16[rax], rcx
	mov	QWORD PTR 24[rax], rbx
	mov	rcx, QWORD PTR -96[rbp]
	mov	rbx, QWORD PTR -88[rbp]
	mov	QWORD PTR 32[rax], rcx
	mov	QWORD PTR 40[rax], rbx
	mov	rcx, QWORD PTR -80[rbp]
	mov	rbx, QWORD PTR -72[rbp]
	mov	QWORD PTR 48[rax], rcx
	mov	QWORD PTR 56[rax], rbx
	mov	rcx, QWORD PTR -64[rbp]
	mov	rbx, QWORD PTR -56[rbp]
	mov	QWORD PTR 64[rax], rcx
	mov	QWORD PTR 72[rax], rbx
	mov	rcx, QWORD PTR -48[rbp]
	mov	rbx, QWORD PTR -40[rbp]
	mov	QWORD PTR 80[rax], rcx
	mov	QWORD PTR 88[rax], rbx
	mov	rcx, QWORD PTR -32[rbp]
	mov	rbx, QWORD PTR -24[rbp]
	mov	QWORD PTR 96[rax], rcx
	mov	QWORD PTR 104[rax], rbx
	jmp	.L66
.L61:
	mov	eax, DWORD PTR -112[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmat@PLT
	mov	QWORD PTR -96[rbp], rax
	mov	eax, DWORD PTR -72[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmat@PLT
	mov	QWORD PTR -64[rbp], rax
	mov	rax, QWORD PTR -96[rbp]
	cmp	rax, -1
	je	.L62
	mov	rax, QWORD PTR -64[rbp]
	cmp	rax, -1
	jne	.L63
.L62:
	mov	QWORD PTR -96[rbp], 0
	mov	QWORD PTR -64[rbp], 0
	mov	eax, DWORD PTR -112[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmctl@PLT
	test	eax, eax
	jne	.L64
	mov	eax, DWORD PTR -72[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmctl@PLT
	test	eax, eax
	je	.L65
.L64:
	mov	DWORD PTR -128[rbp], 10
	mov	rax, QWORD PTR -152[rbp]
	mov	rcx, QWORD PTR -128[rbp]
	mov	rbx, QWORD PTR -120[rbp]
	mov	QWORD PTR [rax], rcx
	mov	QWORD PTR 8[rax], rbx
	mov	rcx, QWORD PTR -112[rbp]
	mov	rbx, QWORD PTR -104[rbp]
	mov	QWORD PTR 16[rax], rcx
	mov	QWORD PTR 24[rax], rbx
	mov	rcx, QWORD PTR -96[rbp]
	mov	rbx, QWORD PTR -88[rbp]
	mov	QWORD PTR 32[rax], rcx
	mov	QWORD PTR 40[rax], rbx
	mov	rcx, QWORD PTR -80[rbp]
	mov	rbx, QWORD PTR -72[rbp]
	mov	QWORD PTR 48[rax], rcx
	mov	QWORD PTR 56[rax], rbx
	mov	rcx, QWORD PTR -64[rbp]
	mov	rbx, QWORD PTR -56[rbp]
	mov	QWORD PTR 64[rax], rcx
	mov	QWORD PTR 72[rax], rbx
	mov	rcx, QWORD PTR -48[rbp]
	mov	rbx, QWORD PTR -40[rbp]
	mov	QWORD PTR 80[rax], rcx
	mov	QWORD PTR 88[rax], rbx
	mov	rcx, QWORD PTR -32[rbp]
	mov	rbx, QWORD PTR -24[rbp]
	mov	QWORD PTR 96[rax], rcx
	mov	QWORD PTR 104[rax], rbx
	jmp	.L66
.L65:
	mov	DWORD PTR -112[rbp], -1
	mov	DWORD PTR -72[rbp], -1
	mov	DWORD PTR -128[rbp], 8
	mov	rax, QWORD PTR -152[rbp]
	mov	rcx, QWORD PTR -128[rbp]
	mov	rbx, QWORD PTR -120[rbp]
	mov	QWORD PTR [rax], rcx
	mov	QWORD PTR 8[rax], rbx
	mov	rcx, QWORD PTR -112[rbp]
	mov	rbx, QWORD PTR -104[rbp]
	mov	QWORD PTR 16[rax], rcx
	mov	QWORD PTR 24[rax], rbx
	mov	rcx, QWORD PTR -96[rbp]
	mov	rbx, QWORD PTR -88[rbp]
	mov	QWORD PTR 32[rax], rcx
	mov	QWORD PTR 40[rax], rbx
	mov	rcx, QWORD PTR -80[rbp]
	mov	rbx, QWORD PTR -72[rbp]
	mov	QWORD PTR 48[rax], rcx
	mov	QWORD PTR 56[rax], rbx
	mov	rcx, QWORD PTR -64[rbp]
	mov	rbx, QWORD PTR -56[rbp]
	mov	QWORD PTR 64[rax], rcx
	mov	QWORD PTR 72[rax], rbx
	mov	rcx, QWORD PTR -48[rbp]
	mov	rbx, QWORD PTR -40[rbp]
	mov	QWORD PTR 80[rax], rcx
	mov	QWORD PTR 88[rax], rbx
	mov	rcx, QWORD PTR -32[rbp]
	mov	rbx, QWORD PTR -24[rbp]
	mov	QWORD PTR 96[rax], rcx
	mov	QWORD PTR 104[rax], rbx
	jmp	.L66
.L63:
	mov	rax, QWORD PTR -96[rbp]
	add	rax, 32
	mov	QWORD PTR -104[rbp], rax
	mov	rax, QWORD PTR -96[rbp]
	add	rax, 64
	mov	QWORD PTR -88[rbp], rax
	mov	rax, QWORD PTR -96[rbp]
	add	rax, 96
	mov	QWORD PTR -80[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 256
	mov	QWORD PTR -56[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 512
	mov	QWORD PTR -48[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 768
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 1024
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 1280
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -96[rbp]
	mov	DWORD PTR [rax], -1
	mov	rax, QWORD PTR -104[rbp]
	mov	DWORD PTR [rax], 1
	mov	rax, QWORD PTR -88[rbp]
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -80[rbp]
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rax
	call	sem_init@PLT
	mov	rax, QWORD PTR -56[rbp]
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rax
	call	sem_init@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rax
	call	sem_init@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rax
	call	sem_init@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rax
	call	sem_init@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rax
	call	sem_init@PLT
	mov	rax, QWORD PTR -152[rbp]
	mov	rcx, QWORD PTR -128[rbp]
	mov	rbx, QWORD PTR -120[rbp]
	mov	QWORD PTR [rax], rcx
	mov	QWORD PTR 8[rax], rbx
	mov	rcx, QWORD PTR -112[rbp]
	mov	rbx, QWORD PTR -104[rbp]
	mov	QWORD PTR 16[rax], rcx
	mov	QWORD PTR 24[rax], rbx
	mov	rcx, QWORD PTR -96[rbp]
	mov	rbx, QWORD PTR -88[rbp]
	mov	QWORD PTR 32[rax], rcx
	mov	QWORD PTR 40[rax], rbx
	mov	rcx, QWORD PTR -80[rbp]
	mov	rbx, QWORD PTR -72[rbp]
	mov	QWORD PTR 48[rax], rcx
	mov	QWORD PTR 56[rax], rbx
	mov	rcx, QWORD PTR -64[rbp]
	mov	rbx, QWORD PTR -56[rbp]
	mov	QWORD PTR 64[rax], rcx
	mov	QWORD PTR 72[rax], rbx
	mov	rcx, QWORD PTR -48[rbp]
	mov	rbx, QWORD PTR -40[rbp]
	mov	QWORD PTR 80[rax], rcx
	mov	QWORD PTR 88[rax], rbx
	mov	rcx, QWORD PTR -32[rbp]
	mov	rbx, QWORD PTR -24[rbp]
	mov	QWORD PTR 96[rax], rcx
	mov	QWORD PTR 104[rax], rbx
.L66:
	mov	rax, QWORD PTR -152[rbp]
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	loadResources, .-loadResources
	.globl	freeResources
	.type	freeResources, @function
freeResources:
.LFB9:
	.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 24[rbp]
	test	rax, rax
	je	.L68
	mov	rdx, QWORD PTR 24[rbp]
	mov	rax, QWORD PTR stdout[rip]
	cmp	rdx, rax
	je	.L68
	mov	rax, QWORD PTR 24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	QWORD PTR 24[rbp], 0
.L68:
	mov	rax, QWORD PTR 48[rbp]
	test	rax, rax
	je	.L69
	mov	rax, QWORD PTR 48[rbp]
	mov	rdi, rax
	call	shmdt@PLT
	test	eax, eax
	je	.L70
	mov	DWORD PTR 16[rbp], 9
.L70:
	mov	eax, DWORD PTR 32[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmctl@PLT
	test	eax, eax
	je	.L71
	mov	DWORD PTR 16[rbp], 10
.L71:
	mov	DWORD PTR 32[rbp], -1
	mov	QWORD PTR 48[rbp], 0
	mov	QWORD PTR 40[rbp], 0
	mov	QWORD PTR 56[rbp], 0
	mov	QWORD PTR 64[rbp], 0
.L69:
	mov	rax, QWORD PTR 80[rbp]
	test	rax, rax
	je	.L76
	call	getpid@PLT
	mov	edx, DWORD PTR 20[rbp]
	cmp	eax, edx
	jne	.L73
	mov	rax, QWORD PTR RESOURCE[rip+64]
	mov	rdi, rax
	call	sem_destroy@PLT
	mov	rax, QWORD PTR RESOURCE[rip+72]
	mov	rdi, rax
	call	sem_destroy@PLT
	mov	rax, QWORD PTR RESOURCE[rip+80]
	mov	rdi, rax
	call	sem_destroy@PLT
	mov	rax, QWORD PTR RESOURCE[rip+88]
	mov	rdi, rax
	call	sem_destroy@PLT
	mov	rax, QWORD PTR RESOURCE[rip+96]
	mov	rdi, rax
	call	sem_destroy@PLT
	mov	rax, QWORD PTR RESOURCE[rip+104]
	mov	rdi, rax
	call	sem_destroy@PLT
.L73:
	mov	rax, QWORD PTR 80[rbp]
	mov	rdi, rax
	call	shmdt@PLT
	test	eax, eax
	je	.L74
	mov	DWORD PTR 16[rbp], 9
.L74:
	mov	eax, DWORD PTR 72[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmctl@PLT
	test	eax, eax
	je	.L75
	mov	DWORD PTR 16[rbp], 10
.L75:
	mov	DWORD PTR 72[rbp], -1
	mov	QWORD PTR 80[rbp], 0
	mov	QWORD PTR 88[rbp], 0
	mov	QWORD PTR 96[rbp], 0
	mov	QWORD PTR 104[rbp], 0
	mov	QWORD PTR 112[rbp], 0
	mov	QWORD PTR 120[rbp], 0
.L76:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	freeResources, .-freeResources
	.section	.rodata
.LC13:
	.string	"writer: %d: new value\n"
.LC14:
	.string	"writer: %d: ready\n"
.LC15:
	.string	"writer: %d: writes a value\n"
.LC16:
	.string	"writer: %d: written\n"
	.text
	.globl	processWriter
	.type	processWriter, @function
processWriter:
.LFB10:
	.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	DWORD PTR -8[rbp], 0
	jmp	.L78
.L83:
	mov	eax, DWORD PTR 32[rbp]
	test	eax, eax
	je	.L79
	call	rand@PLT
	mov	edx, DWORD PTR 32[rbp]
	lea	ecx, 1[rdx]
	cdq
	idiv	ecx
	mov	eax, edx
	jmp	.L80
.L79:
	mov	eax, 0
.L80:
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR RESOURCE[rip+80]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR RESOURCE[rip+40]
	mov	edx, DWORD PTR [rax]
	add	edx, 1
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printStatus
	mov	eax, DWORD PTR -4[rbp]
	imul	eax, eax, 1000
	mov	edi, eax
	call	usleep@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printStatus
	mov	rax, QWORD PTR RESOURCE[rip+40]
	mov	eax, DWORD PTR [rax]
	cmp	eax, 1
	jne	.L81
	mov	rax, QWORD PTR RESOURCE[rip+72]
	mov	rdi, rax
	call	sem_wait@PLT
.L81:
	mov	rax, QWORD PTR RESOURCE[rip+80]
	mov	rdi, rax
	call	sem_post@PLT
	mov	rax, QWORD PTR RESOURCE[rip+64]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printStatus
	mov	rax, QWORD PTR RESOURCE[rip+32]
	mov	edx, DWORD PTR -20[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printStatus
	mov	rax, QWORD PTR RESOURCE[rip+64]
	mov	rdi, rax
	call	sem_post@PLT
	mov	rax, QWORD PTR RESOURCE[rip+80]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR RESOURCE[rip+40]
	mov	edx, DWORD PTR [rax]
	sub	edx, 1
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR RESOURCE[rip+40]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L82
	mov	rax, QWORD PTR RESOURCE[rip+72]
	mov	rdi, rax
	call	sem_post@PLT
.L82:
	mov	rax, QWORD PTR RESOURCE[rip+80]
	mov	rdi, rax
	call	sem_post@PLT
	add	DWORD PTR -8[rbp], 1
.L78:
	mov	eax, DWORD PTR 28[rbp]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L83
	push	QWORD PTR RESOURCE[rip+104]
	push	QWORD PTR RESOURCE[rip+96]
	push	QWORD PTR RESOURCE[rip+88]
	push	QWORD PTR RESOURCE[rip+80]
	push	QWORD PTR RESOURCE[rip+72]
	push	QWORD PTR RESOURCE[rip+64]
	push	QWORD PTR RESOURCE[rip+56]
	push	QWORD PTR RESOURCE[rip+48]
	push	QWORD PTR RESOURCE[rip+40]
	push	QWORD PTR RESOURCE[rip+32]
	push	QWORD PTR RESOURCE[rip+24]
	push	QWORD PTR RESOURCE[rip+16]
	push	QWORD PTR RESOURCE[rip+8]
	push	QWORD PTR RESOURCE[rip]
	call	freeResources
	add	rsp, 112
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE10:
	.size	processWriter, .-processWriter
	.section	.rodata
.LC17:
	.string	"reader: %d: ready\n"
.LC18:
	.string	"reader: %d: reads a value\n"
.LC19:
	.string	"reader: %d: read: %d\n"
	.text
	.globl	processReader
	.type	processReader, @function
processReader:
.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, 32
	mov	DWORD PTR -20[rbp], edi
.L91:
	mov	rax, QWORD PTR RESOURCE[rip+96]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR RESOURCE[rip+72]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR RESOURCE[rip+88]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR RESOURCE[rip+48]
	mov	edx, DWORD PTR [rax]
	add	edx, 1
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	printStatus
	mov	rax, QWORD PTR RESOURCE[rip+48]
	mov	eax, DWORD PTR [rax]
	cmp	eax, 1
	jne	.L85
	mov	rax, QWORD PTR RESOURCE[rip+64]
	mov	rdi, rax
	call	sem_wait@PLT
.L85:
	mov	rax, QWORD PTR RESOURCE[rip+88]
	mov	rdi, rax
	call	sem_post@PLT
	mov	rax, QWORD PTR RESOURCE[rip+72]
	mov	rdi, rax
	call	sem_post@PLT
	mov	rax, QWORD PTR RESOURCE[rip+96]
	mov	rdi, rax
	call	sem_post@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC18[rip]
	mov	eax, 0
	call	printStatus
	mov	rax, QWORD PTR RESOURCE[rip+32]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -8[rbp], eax
	mov	edx, DWORD PTR -8[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC19[rip]
	mov	eax, 0
	call	printStatus
	mov	eax, DWORD PTR 36[rbp]
	test	eax, eax
	je	.L86
	call	rand@PLT
	mov	edx, DWORD PTR 36[rbp]
	lea	ecx, 1[rdx]
	cdq
	idiv	ecx
	mov	eax, edx
	jmp	.L87
.L86:
	mov	eax, 0
.L87:
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	imul	eax, eax, 1000
	mov	edi, eax
	call	usleep@PLT
	mov	rax, QWORD PTR RESOURCE[rip+88]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR RESOURCE[rip+48]
	mov	edx, DWORD PTR [rax]
	sub	edx, 1
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR RESOURCE[rip+48]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L88
	mov	rax, QWORD PTR RESOURCE[rip+64]
	mov	rdi, rax
	call	sem_post@PLT
.L88:
	mov	rax, QWORD PTR RESOURCE[rip+88]
	mov	rdi, rax
	call	sem_post@PLT
	cmp	DWORD PTR -8[rbp], 0
	je	.L93
	jmp	.L91
.L93:
	nop
	push	QWORD PTR RESOURCE[rip+104]
	push	QWORD PTR RESOURCE[rip+96]
	push	QWORD PTR RESOURCE[rip+88]
	push	QWORD PTR RESOURCE[rip+80]
	push	QWORD PTR RESOURCE[rip+72]
	push	QWORD PTR RESOURCE[rip+64]
	push	QWORD PTR RESOURCE[rip+56]
	push	QWORD PTR RESOURCE[rip+48]
	push	QWORD PTR RESOURCE[rip+40]
	push	QWORD PTR RESOURCE[rip+32]
	push	QWORD PTR RESOURCE[rip+24]
	push	QWORD PTR RESOURCE[rip+16]
	push	QWORD PTR RESOURCE[rip+8]
	push	QWORD PTR RESOURCE[rip]
	call	freeResources
	add	rsp, 112
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE11:
	.size	processReader, .-processReader
	.globl	programAbort
	.type	programAbort, @function
programAbort:
.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	DWORD PTR -4[rbp], edi
	push	QWORD PTR RESOURCE[rip+104]
	push	QWORD PTR RESOURCE[rip+96]
	push	QWORD PTR RESOURCE[rip+88]
	push	QWORD PTR RESOURCE[rip+80]
	push	QWORD PTR RESOURCE[rip+72]
	push	QWORD PTR RESOURCE[rip+64]
	push	QWORD PTR RESOURCE[rip+56]
	push	QWORD PTR RESOURCE[rip+48]
	push	QWORD PTR RESOURCE[rip+40]
	push	QWORD PTR RESOURCE[rip+32]
	push	QWORD PTR RESOURCE[rip+24]
	push	QWORD PTR RESOURCE[rip+16]
	push	QWORD PTR RESOURCE[rip+8]
	push	QWORD PTR RESOURCE[rip]
	call	freeResources
	add	rsp, 112
	mov	edi, 5
	call	printError
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE12:
	.size	programAbort, .-programAbort
	.globl	parseInt
	.type	parseInt, @function
parseInt:
.LFB13:
	.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	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -16[rbp], 0
	lea	rcx, -16[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 10
	mov	rsi, rcx
	mov	rdi, rax
	call	strtoul@PLT
	mov	DWORD PTR -20[rbp], eax
	mov	rax, QWORD PTR -16[rbp]
	cmp	QWORD PTR -40[rbp], rax
	je	.L96
	mov	rax, QWORD PTR -16[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L97
.L96:
	cmp	QWORD PTR -48[rbp], 0
	je	.L97
	mov	rax, QWORD PTR -48[rbp]
	mov	DWORD PTR [rax], 2
.L97:
	mov	eax, DWORD PTR -20[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L99
	call	__stack_chk_fail@PLT
.L99:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	parseInt, .-parseInt
	.section	.rodata
.LC20:
	.string	"%s\n"
	.text
	.globl	printError
	.type	printError, @function
printError:
.LFB14:
	.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	DWORD PTR -4[rbp], edi
	cmp	DWORD PTR -4[rbp], 0
	jle	.L102
	cmp	DWORD PTR -4[rbp], 10
	jg	.L102
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, ERROR_MESSAGES[rip]
	mov	rdx, QWORD PTR [rdx+rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC20[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L102:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	printError, .-printError
	.section	.rodata
.LC21:
	.string	"%d: "
	.text
	.globl	printStatus
	.type	printStatus, @function
printStatus:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 224
	mov	QWORD PTR -216[rbp], rdi
	mov	QWORD PTR -168[rbp], rsi
	mov	QWORD PTR -160[rbp], rdx
	mov	QWORD PTR -152[rbp], rcx
	mov	QWORD PTR -144[rbp], r8
	mov	QWORD PTR -136[rbp], r9
	test	al, al
	je	.L104
	movaps	XMMWORD PTR -128[rbp], xmm0
	movaps	XMMWORD PTR -112[rbp], xmm1
	movaps	XMMWORD PTR -96[rbp], xmm2
	movaps	XMMWORD PTR -80[rbp], xmm3
	movaps	XMMWORD PTR -64[rbp], xmm4
	movaps	XMMWORD PTR -48[rbp], xmm5
	movaps	XMMWORD PTR -32[rbp], xmm6
	movaps	XMMWORD PTR -16[rbp], xmm7
.L104:
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -184[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR RESOURCE[rip+104]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR RESOURCE[rip+8]
	test	rax, rax
	je	.L105
	mov	DWORD PTR -208[rbp], 8
	mov	DWORD PTR -204[rbp], 48
	lea	rax, 16[rbp]
	mov	QWORD PTR -200[rbp], rax
	lea	rax, -176[rbp]
	mov	QWORD PTR -192[rbp], rax
	mov	rax, QWORD PTR RESOURCE[rip+24]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR RESOURCE[rip+8]
	lea	rsi, .LC21[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR RESOURCE[rip+24]
	mov	edx, DWORD PTR [rax]
	add	edx, 1
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR RESOURCE[rip+8]
	lea	rdx, -208[rbp]
	mov	rcx, QWORD PTR -216[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	vfprintf@PLT
	mov	rax, QWORD PTR RESOURCE[rip+8]
	mov	rdi, rax
	call	fflush@PLT
.L105:
	mov	rax, QWORD PTR RESOURCE[rip+104]
	mov	rdi, rax
	call	sem_post@PLT
	nop
	mov	rax, QWORD PTR -184[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L106
	call	__stack_chk_fail@PLT
.L106:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	printStatus, .-printStatus
	.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	"384309.c"
	.text
	.global	ERROR_MESSAGES
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Invalid parametres\000"
	.align	2
.LC1:
	.ascii	"Invalid conversion\000"
	.align	2
.LC2:
	.ascii	"Cannot set output\000"
	.align	2
.LC3:
	.ascii	"Cannot fork\000"
	.align	2
.LC4:
	.ascii	"Aborting..\000"
	.align	2
.LC5:
	.ascii	"Failed function ftok\000"
	.align	2
.LC6:
	.ascii	"Failed function shmget\000"
	.align	2
.LC7:
	.ascii	"Failed function shmat\000"
	.align	2
.LC8:
	.ascii	"Failed function shmdt\000"
	.align	2
.LC9:
	.ascii	"Failed function shmctl\000"
	.data
	.align	2
	.type	ERROR_MESSAGES, %object
	.size	ERROR_MESSAGES, 44
ERROR_MESSAGES:
	.space	4
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.global	RESOURCE
	.align	2
	.type	RESOURCE, %object
	.size	RESOURCE, 60
RESOURCE:
	.word	0
	.word	0
	.word	0
	.word	-1
	.word	0
	.word	0
	.word	0
	.word	0
	.word	-1
	.word	0
	.word	0
	.word	0
	.word	0
	.word	0
	.space	4
	.section	.rodata
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 152
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #200
	str	r0, [fp, #-96]
	str	r1, [fp, #-100]
	ldr	r3, .L33
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r5, r3
	ldr	r1, .L33+4
	mov	r0, #15
	bl	signal
	ldr	r1, .L33+4
	mov	r0, #2
	bl	signal
	sub	r3, fp, #44
	ldr	r2, [fp, #-100]
	ldr	r1, [fp, #-96]
	mov	r0, r3
	bl	loadParams
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	beq	.L2
	ldr	r3, [fp, #-44]
	mov	r0, r3
	bl	printError
	ldr	r3, [fp, #-44]
	b	.L3
.L2:
	ldr	r4, .L33+8
	sub	lr, fp, #164
	mov	ip, sp
	sub	r3, fp, #32
	ldm	r3, {r0, r1, r2, r3}
	stm	ip, {r0, r1, r2, r3}
	sub	r3, fp, #44
	ldm	r3, {r1, r2, r3}
	mov	r0, lr
	bl	loadResources
	mov	lr, r4
	sub	ip, fp, #164
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	ldr	r3, .L33+8
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L4
	ldr	r3, .L33+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	printError
	ldr	r4, .L33+8
	mov	lr, sp
	add	ip, r4, #16
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	ldm	r4, {r0, r1, r2, r3}
	bl	freeResources
	ldr	r3, .L33+8
	ldr	r3, [r3]
	b	.L3
.L4:
	mov	r0, #0
	bl	time
	mov	r3, r0
	mov	r0, r3
	bl	srand
	mvn	r3, #0
	str	r3, [fp, #-64]
	ldr	ip, [fp, #-36]
	sub	r3, ip, #1
	str	r3, [fp, #-60]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	add	r3, sp, #48
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-56]
	ldr	ip, [fp, #-40]
	sub	r3, ip, #1
	str	r3, [fp, #-52]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	add	r3, sp, #48
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-48]
	mov	r3, #0
	str	r3, [fp, #-68]
	b	.L5
.L13:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmn	r3, #1
	bne	.L6
	mov	r0, #4
	bl	printError
	mov	r3, #0
	str	r3, [fp, #-72]
	b	.L7
.L8:
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-72]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, #15
	mov	r0, r3
	bl	kill
	ldr	r3, [fp, #-72]
	add	r3, r3, #1
	str	r3, [fp, #-72]
.L7:
	ldr	r2, [fp, #-72]
	ldr	r3, [fp, #-68]
	cmp	r2, r3
	blt	.L8
	mov	r3, #0
	str	r3, [fp, #-76]
	b	.L9
.L10:
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-76]
	ldr	r3, [r3, r2, lsl #2]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	waitpid
	ldr	r3, [fp, #-76]
	add	r3, r3, #1
	str	r3, [fp, #-76]
.L9:
	ldr	r2, [fp, #-76]
	ldr	r3, [fp, #-68]
	cmp	r2, r3
	blt	.L10
	ldr	r4, .L33+8
	mov	lr, sp
	add	ip, r4, #16
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	ldm	r4, {r0, r1, r2, r3}
	bl	freeResources
	mov	r3, #4
	b	.L3
.L6:
	ldr	r3, [fp, #-64]
	cmp	r3, #0
	bne	.L11
	ldr	r3, [fp, #-68]
	add	lr, r3, #1
	mov	ip, sp
	sub	r3, fp, #32
	ldm	r3, {r0, r1, r2, r3}
	stm	ip, {r0, r1, r2, r3}
	sub	r3, fp, #44
	ldm	r3, {r1, r2, r3}
	mov	r0, lr
	bl	processWriter
	b	.L12
.L11:
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-68]
	ldr	r1, [fp, #-64]
	str	r1, [r3, r2, lsl #2]
.L12:
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
.L5:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-68]
	cmp	r2, r3
	blt	.L13
	mov	r3, #0
	str	r3, [fp, #-68]
	b	.L14
.L26:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmn	r3, #1
	bne	.L15
	mov	r0, #4
	bl	printError
	mov	r3, #0
	str	r3, [fp, #-80]
	b	.L16
.L17:
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-80]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, #15
	mov	r0, r3
	bl	kill
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L16:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-80]
	cmp	r2, r3
	blt	.L17
	mov	r3, #0
	str	r3, [fp, #-84]
	b	.L18
.L19:
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #-84]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, #15
	mov	r0, r3
	bl	kill
	ldr	r3, [fp, #-84]
	add	r3, r3, #1
	str	r3, [fp, #-84]
.L18:
	ldr	r2, [fp, #-84]
	ldr	r3, [fp, #-68]
	cmp	r2, r3
	blt	.L19
	mov	r3, #0
	str	r3, [fp, #-88]
	b	.L20
.L21:
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-88]
	ldr	r3, [r3, r2, lsl #2]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	waitpid
	ldr	r3, [fp, #-88]
	add	r3, r3, #1
	str	r3, [fp, #-88]
.L20:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-88]
	cmp	r2, r3
	blt	.L21
	mov	r3, #0
	str	r3, [fp, #-92]
	b	.L22
.L23:
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #-92]
	ldr	r3, [r3, r2, lsl #2]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	waitpid
	ldr	r3, [fp, #-92]
	add	r3, r3, #1
	str	r3, [fp, #-92]
.L22:
	ldr	r2, [fp, #-92]
	ldr	r3, [fp, #-68]
	cmp	r2, r3
	blt	.L23
	ldr	r4, .L33+8
	mov	lr, sp
	add	ip, r4, #16
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	ldm	r4, {r0, r1, r2, r3}
	bl	freeResources
	mov	r3, #4
	b	.L3
.L15:
	ldr	r3, [fp, #-64]
	cmp	r3, #0
	bne	.L24
	ldr	r3, [fp, #-68]
	add	lr, r3, #1
	mov	ip, sp
	sub	r3, fp, #32
	ldm	r3, {r0, r1, r2, r3}
	stm	ip, {r0, r1, r2, r3}
	sub	r3, fp, #44
	ldm	r3, {r1, r2, r3}
	mov	r0, lr
	bl	processReader
	b	.L25
.L24:
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #-68]
	ldr	r1, [fp, #-64]
	str	r1, [r3, r2, lsl #2]
.L25:
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
.L14:
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-68]
	cmp	r2, r3
	blt	.L26
	mov	r3, #0
	str	r3, [fp, #-68]
	b	.L27
.L28:
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-68]
	ldr	r3, [r3, r2, lsl #2]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	waitpid
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
.L27:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-68]
	cmp	r2, r3
	blt	.L28
	ldr	r3, .L33+8
	ldr	r3, [r3, #40]
	mov	r0, r3
	bl	sem_wait
	ldr	r3, .L33+8
	ldr	r3, [r3, #20]
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L33+8
	ldr	r3, [r3, #40]
	mov	r0, r3
	bl	sem_post
	mov	r3, #0
	str	r3, [fp, #-68]
	b	.L29
.L30:
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #-68]
	ldr	r3, [r3, r2, lsl #2]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	waitpid
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
.L29:
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-68]
	cmp	r2, r3
	blt	.L30
	ldr	r4, .L33+8
	mov	lr, sp
	add	ip, r4, #16
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	ldm	r4, {r0, r1, r2, r3}
	bl	freeResources
	ldr	r3, .L33+8
	ldr	r3, [r3]
.L3:
	mov	sp, r5
	ldr	r2, .L33
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L32
	bl	__stack_chk_fail
.L32:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L34:
	.align	2
.L33:
	.word	.LC10
	.word	programAbort
	.word	RESOURCE
	.size	main, .-main
	.section	.rodata
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	loadParams
	.syntax unified
	.arm
	.fpu softvfp
	.type	loadParams, %function
loadParams:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	str	r2, [fp, #-56]
	ldr	r3, .L49
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #36
	mov	r2, #0
	str	r2, [r3]
	str	r2, [r3, #4]
	str	r2, [r3, #8]
	str	r2, [r3, #12]
	str	r2, [r3, #16]
	str	r2, [r3, #20]
	str	r2, [r3, #24]
	ldr	r3, [fp, #-52]
	cmp	r3, #7
	bne	.L36
	mov	r3, #0
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-56]
	add	r3, r3, #4
	ldr	r3, [r3]
	sub	r2, fp, #40
	mov	r1, r2
	mov	r0, r3
	bl	parseInt
	mov	r3, r0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	beq	.L37
	mov	r3, #2
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-48]
	mov	lr, r3
	sub	ip, fp, #36
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	b	.L35
.L37:
	ldr	r3, [fp, #-56]
	add	r3, r3, #8
	ldr	r3, [r3]
	sub	r2, fp, #40
	mov	r1, r2
	mov	r0, r3
	bl	parseInt
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	beq	.L39
	mov	r3, #2
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-48]
	mov	lr, r3
	sub	ip, fp, #36
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	b	.L35
.L39:
	ldr	r3, [fp, #-56]
	add	r3, r3, #12
	ldr	r3, [r3]
	sub	r2, fp, #40
	mov	r1, r2
	mov	r0, r3
	bl	parseInt
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	beq	.L40
	mov	r3, #2
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-48]
	mov	lr, r3
	sub	ip, fp, #36
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	b	.L35
.L40:
	ldr	r3, [fp, #-56]
	add	r3, r3, #16
	ldr	r3, [r3]
	sub	r2, fp, #40
	mov	r1, r2
	mov	r0, r3
	bl	parseInt
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	beq	.L41
	mov	r3, #2
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-48]
	mov	lr, r3
	sub	ip, fp, #36
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	b	.L35
.L41:
	ldr	r3, [fp, #-56]
	add	r3, r3, #20
	ldr	r3, [r3]
	sub	r2, fp, #40
	mov	r1, r2
	mov	r0, r3
	bl	parseInt
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	beq	.L42
	mov	r3, #2
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-48]
	mov	lr, r3
	sub	ip, fp, #36
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	b	.L35
.L42:
	ldr	r3, [fp, #-56]
	ldr	r3, [r3, #24]
	str	r3, [fp, #-12]
	b	.L43
.L36:
	mov	r3, #1
	str	r3, [fp, #-36]
.L43:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	blt	.L45
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	blt	.L45
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	blt	.L45
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	blt	.L45
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bge	.L46
.L45:
	mov	r3, #1
	str	r3, [fp, #-36]
.L46:
	ldr	r3, [fp, #-48]
	mov	lr, r3
	sub	ip, fp, #36
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
.L35:
	ldr	r3, .L49
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L48
	bl	__stack_chk_fail
.L48:
	ldr	r0, [fp, #-48]
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L50:
	.align	2
.L49:
	.word	.LC11
	.size	loadParams, .-loadParams
	.section	.rodata
	.align	2
.LC12:
	.ascii	"-\000"
	.align	2
.LC13:
	.ascii	"w\000"
	.align	2
.LC14:
	.ascii	"HOME\000"
	.text
	.align	2
	.global	loadResources
	.syntax unified
	.arm
	.fpu softvfp
	.type	loadResources, %function
loadResources:
	@ args = 32, pretend = 16, frame = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	sub	sp, sp, #16
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #80
	str	r0, [fp, #-80]
	add	r0, fp, #8
	stm	r0, {r1, r2, r3}
	sub	r3, fp, #64
	mov	r2, #60
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mvn	r3, #0
	str	r3, [fp, #-52]
	mvn	r3, #0
	str	r3, [fp, #-32]
	bl	getpid
	mov	r3, r0
	str	r3, [fp, #-60]
	ldr	r3, [fp, #32]
	ldr	r1, .L65
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L52
	ldr	r3, .L65+4
	ldr	r3, [r3]
	str	r3, [fp, #-56]
	b	.L53
.L52:
	ldr	r3, [fp, #32]
	ldr	r1, .L65+8
	mov	r0, r3
	bl	fopen
	mov	r3, r0
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L54
	mov	r3, #3
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-80]
	mov	lr, r3
	sub	ip, fp, #64
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	b	.L51
.L54:
	ldr	r3, [fp, #-56]
	mov	r1, #0
	mov	r0, r3
	bl	setbuf
.L53:
	ldr	r0, .L65+12
	bl	getenv
	mov	r3, r0
	mov	r1, #42
	mov	r0, r3
	bl	ftok
	str	r0, [fp, #-72]
	ldr	r0, .L65+12
	bl	getenv
	mov	r3, r0
	mov	r1, #24
	mov	r0, r3
	bl	ftok
	str	r0, [fp, #-68]
	ldr	r3, [fp, #-72]
	cmn	r3, #1
	beq	.L56
	ldr	r3, [fp, #-68]
	cmn	r3, #1
	bne	.L57
.L56:
	mov	r3, #6
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-80]
	mov	lr, r3
	sub	ip, fp, #64
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	b	.L51
.L57:
	mov	r2, #944
	mov	r1, #16
	ldr	r0, [fp, #-72]
	bl	shmget
	mov	r3, r0
	str	r3, [fp, #-52]
	mov	r2, #944
	mov	r1, #24
	ldr	r0, [fp, #-68]
	bl	shmget
	mov	r3, r0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-52]
	cmp	r3, #0
	blt	.L58
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bge	.L59
.L58:
	mov	r3, #7
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-80]
	mov	lr, r3
	sub	ip, fp, #64
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	b	.L51
.L59:
	ldr	r3, [fp, #-52]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	shmat
	mov	r3, r0
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-32]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	shmat
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-44]
	cmn	r3, #1
	beq	.L60
	ldr	r3, [fp, #-28]
	cmn	r3, #1
	bne	.L61
.L60:
	mov	r3, #0
	str	r3, [fp, #-44]
	mov	r3, #0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-52]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	shmctl
	mov	r3, r0
	cmp	r3, #0
	bne	.L62
	ldr	r3, [fp, #-32]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	shmctl
	mov	r3, r0
	cmp	r3, #0
	beq	.L63
.L62:
	mov	r3, #10
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-80]
	mov	lr, r3
	sub	ip, fp, #64
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	b	.L51
.L63:
	mvn	r3, #0
	str	r3, [fp, #-52]
	mvn	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #8
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-80]
	mov	lr, r3
	sub	ip, fp, #64
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	b	.L51
.L61:
	ldr	r3, [fp, #-44]
	add	r3, r3, #16
	str	r3, [fp, #-48]
	ldr	r3, [fp, #-44]
	add	r3, r3, #32
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-44]
	add	r3, r3, #48
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-28]
	add	r3, r3, #64
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-28]
	add	r3, r3, #128
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-28]
	add	r3, r3, #192
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-28]
	add	r3, r3, #256
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-28]
	add	r3, r3, #320
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-44]
	mvn	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-48]
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, [fp, #-40]
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-28]
	mov	r2, #1
	mov	r1, #1
	mov	r0, r3
	bl	sem_init
	ldr	r3, [fp, #-24]
	mov	r2, #1
	mov	r1, #1
	mov	r0, r3
	bl	sem_init
	ldr	r3, [fp, #-20]
	mov	r2, #1
	mov	r1, #1
	mov	r0, r3
	bl	sem_init
	ldr	r3, [fp, #-16]
	mov	r2, #1
	mov	r1, #1
	mov	r0, r3
	bl	sem_init
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #1
	mov	r0, r3
	bl	sem_init
	ldr	r3, [fp, #-8]
	mov	r2, #1
	mov	r1, #1
	mov	r0, r3
	bl	sem_init
	ldr	r3, [fp, #-80]
	mov	lr, r3
	sub	ip, fp, #64
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
.L51:
	ldr	r0, [fp, #-80]
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, lr}
	add	sp, sp, #16
	bx	lr
.L66:
	.align	2
.L65:
	.word	.LC12
	.word	stdout
	.word	.LC13
	.word	.LC14
	.size	loadResources, .-loadResources
	.align	2
	.global	freeResources
	.syntax unified
	.arm
	.fpu softvfp
	.type	freeResources, %function
freeResources:
	@ args = 60, pretend = 16, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	sub	sp, sp, #16
	push	{fp, lr}
	add	fp, sp, #4
	add	ip, fp, #4
	stm	ip, {r0, r1, r2, r3}
	ldr	r3, [fp, #12]
	cmp	r3, #0
	beq	.L68
	ldr	r2, [fp, #12]
	ldr	r3, .L77
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L68
	ldr	r3, [fp, #12]
	mov	r0, r3
	bl	fclose
	mov	r3, #0
	str	r3, [fp, #12]
.L68:
	ldr	r3, [fp, #24]
	cmp	r3, #0
	beq	.L69
	ldr	r3, [fp, #24]
	mov	r0, r3
	bl	shmdt
	mov	r3, r0
	cmp	r3, #0
	beq	.L70
	mov	r3, #9
	str	r3, [fp, #4]
.L70:
	ldr	r3, [fp, #16]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	shmctl
	mov	r3, r0
	cmp	r3, #0
	beq	.L71
	mov	r3, #10
	str	r3, [fp, #4]
.L71:
	mvn	r3, #0
	str	r3, [fp, #16]
	mov	r3, #0
	str	r3, [fp, #24]
	mov	r3, #0
	str	r3, [fp, #20]
	mov	r3, #0
	str	r3, [fp, #28]
	mov	r3, #0
	str	r3, [fp, #32]
.L69:
	ldr	r3, [fp, #40]
	cmp	r3, #0
	beq	.L76
	bl	getpid
	mov	r2, r0
	ldr	r3, [fp, #8]
	cmp	r2, r3
	bne	.L73
	ldr	r3, .L77+4
	ldr	r3, [r3, #36]
	mov	r0, r3
	bl	sem_destroy
	ldr	r3, .L77+4
	ldr	r3, [r3, #40]
	mov	r0, r3
	bl	sem_destroy
	ldr	r3, .L77+4
	ldr	r3, [r3, #44]
	mov	r0, r3
	bl	sem_destroy
	ldr	r3, .L77+4
	ldr	r3, [r3, #48]
	mov	r0, r3
	bl	sem_destroy
	ldr	r3, .L77+4
	ldr	r3, [r3, #52]
	mov	r0, r3
	bl	sem_destroy
	ldr	r3, .L77+4
	ldr	r3, [r3, #56]
	mov	r0, r3
	bl	sem_destroy
.L73:
	ldr	r3, [fp, #40]
	mov	r0, r3
	bl	shmdt
	mov	r3, r0
	cmp	r3, #0
	beq	.L74
	mov	r3, #9
	str	r3, [fp, #4]
.L74:
	ldr	r3, [fp, #36]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	shmctl
	mov	r3, r0
	cmp	r3, #0
	beq	.L75
	mov	r3, #10
	str	r3, [fp, #4]
.L75:
	mvn	r3, #0
	str	r3, [fp, #36]
	mov	r3, #0
	str	r3, [fp, #40]
	mov	r3, #0
	str	r3, [fp, #44]
	mov	r3, #0
	str	r3, [fp, #48]
	mov	r3, #0
	str	r3, [fp, #52]
	mov	r3, #0
	str	r3, [fp, #56]
	mov	r3, #0
	str	r3, [fp, #60]
.L76:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, lr}
	add	sp, sp, #16
	bx	lr
.L78:
	.align	2
.L77:
	.word	stdout
	.word	RESOURCE
	.size	freeResources, .-freeResources
	.global	__aeabi_idivmod
	.section	.rodata
	.align	2
.LC15:
	.ascii	"writer: %d: new value\012\000"
	.align	2
.LC16:
	.ascii	"writer: %d: ready\012\000"
	.align	2
.LC17:
	.ascii	"writer: %d: writes a value\012\000"
	.align	2
.LC18:
	.ascii	"writer: %d: written\012\000"
	.text
	.align	2
	.global	processWriter
	.syntax unified
	.arm
	.fpu softvfp
	.type	processWriter, %function
processWriter:
	@ args = 32, pretend = 16, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	sub	sp, sp, #16
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #68
	str	r0, [fp, #-24]
	add	r0, fp, #8
	stm	r0, {r1, r2, r3}
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L80
.L85:
	ldr	r3, [fp, #24]
	cmp	r3, #0
	beq	.L81
	bl	rand
	mov	r2, r0
	ldr	r3, [fp, #24]
	add	r3, r3, #1
	mov	r1, r3
	mov	r0, r2
	bl	__aeabi_idivmod
	mov	r3, r1
	b	.L82
.L81:
	mov	r3, #0
.L82:
	str	r3, [fp, #-16]
	ldr	r3, .L86
	ldr	r3, [r3, #44]
	mov	r0, r3
	bl	sem_wait
	ldr	r3, .L86
	ldr	r3, [r3, #24]
	ldr	r2, [r3]
	add	r2, r2, #1
	str	r2, [r3]
	ldr	r1, [fp, #-24]
	ldr	r0, .L86+4
	bl	printStatus
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r0, r3
	bl	usleep
	ldr	r1, [fp, #-24]
	ldr	r0, .L86+8
	bl	printStatus
	ldr	r3, .L86
	ldr	r3, [r3, #24]
	ldr	r3, [r3]
	cmp	r3, #1
	bne	.L83
	ldr	r3, .L86
	ldr	r3, [r3, #40]
	mov	r0, r3
	bl	sem_wait
.L83:
	ldr	r3, .L86
	ldr	r3, [r3, #44]
	mov	r0, r3
	bl	sem_post
	ldr	r3, .L86
	ldr	r3, [r3, #36]
	mov	r0, r3
	bl	sem_wait
	ldr	r1, [fp, #-24]
	ldr	r0, .L86+12
	bl	printStatus
	ldr	r3, .L86
	ldr	r3, [r3, #20]
	ldr	r2, [fp, #-24]
	str	r2, [r3]
	ldr	r1, [fp, #-24]
	ldr	r0, .L86+16
	bl	printStatus
	ldr	r3, .L86
	ldr	r3, [r3, #36]
	mov	r0, r3
	bl	sem_post
	ldr	r3, .L86
	ldr	r3, [r3, #44]
	mov	r0, r3
	bl	sem_wait
	ldr	r3, .L86
	ldr	r3, [r3, #24]
	ldr	r2, [r3]
	sub	r2, r2, #1
	str	r2, [r3]
	ldr	r3, .L86
	ldr	r3, [r3, #24]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L84
	ldr	r3, .L86
	ldr	r3, [r3, #40]
	mov	r0, r3
	bl	sem_post
.L84:
	ldr	r3, .L86
	ldr	r3, [r3, #44]
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L80:
	ldr	r3, [fp, #20]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L85
	ldr	r4, .L86
	mov	lr, sp
	add	ip, r4, #16
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	ldm	r4, {r0, r1, r2, r3}
	bl	freeResources
	mov	r0, #0
	bl	exit
.L87:
	.align	2
.L86:
	.word	RESOURCE
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.size	processWriter, .-processWriter
	.section	.rodata
	.align	2
.LC19:
	.ascii	"reader: %d: ready\012\000"
	.align	2
.LC20:
	.ascii	"reader: %d: reads a value\012\000"
	.align	2
.LC21:
	.ascii	"reader: %d: read: %d\012\000"
	.text
	.align	2
	.global	processReader
	.syntax unified
	.arm
	.fpu softvfp
	.type	processReader, %function
processReader:
	@ args = 32, pretend = 16, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	sub	sp, sp, #16
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #68
	str	r0, [fp, #-24]
	add	r0, fp, #8
	stm	r0, {r1, r2, r3}
.L95:
	ldr	r3, .L98
	ldr	r3, [r3, #52]
	mov	r0, r3
	bl	sem_wait
	ldr	r3, .L98
	ldr	r3, [r3, #40]
	mov	r0, r3
	bl	sem_wait
	ldr	r3, .L98
	ldr	r3, [r3, #48]
	mov	r0, r3
	bl	sem_wait
	ldr	r3, .L98
	ldr	r3, [r3, #28]
	ldr	r2, [r3]
	add	r2, r2, #1
	str	r2, [r3]
	ldr	r1, [fp, #-24]
	ldr	r0, .L98+4
	bl	printStatus
	ldr	r3, .L98
	ldr	r3, [r3, #28]
	ldr	r3, [r3]
	cmp	r3, #1
	bne	.L89
	ldr	r3, .L98
	ldr	r3, [r3, #36]
	mov	r0, r3
	bl	sem_wait
.L89:
	ldr	r3, .L98
	ldr	r3, [r3, #48]
	mov	r0, r3
	bl	sem_post
	ldr	r3, .L98
	ldr	r3, [r3, #40]
	mov	r0, r3
	bl	sem_post
	ldr	r3, .L98
	ldr	r3, [r3, #52]
	mov	r0, r3
	bl	sem_post
	ldr	r1, [fp, #-24]
	ldr	r0, .L98+8
	bl	printStatus
	ldr	r3, .L98
	ldr	r3, [r3, #20]
	ldr	r3, [r3]
	str	r3, [fp, #-20]
	ldr	r2, [fp, #-20]
	ldr	r1, [fp, #-24]
	ldr	r0, .L98+12
	bl	printStatus
	ldr	r3, [fp, #28]
	cmp	r3, #0
	beq	.L90
	bl	rand
	mov	r2, r0
	ldr	r3, [fp, #28]
	add	r3, r3, #1
	mov	r1, r3
	mov	r0, r2
	bl	__aeabi_idivmod
	mov	r3, r1
	b	.L91
.L90:
	mov	r3, #0
.L91:
	str	r3, [fp, #-16]
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r0, r3
	bl	usleep
	ldr	r3, .L98
	ldr	r3, [r3, #48]
	mov	r0, r3
	bl	sem_wait
	ldr	r3, .L98
	ldr	r3, [r3, #28]
	ldr	r2, [r3]
	sub	r2, r2, #1
	str	r2, [r3]
	ldr	r3, .L98
	ldr	r3, [r3, #28]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L92
	ldr	r3, .L98
	ldr	r3, [r3, #36]
	mov	r0, r3
	bl	sem_post
.L92:
	ldr	r3, .L98
	ldr	r3, [r3, #48]
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L97
	b	.L95
.L97:
	nop
	ldr	r4, .L98
	mov	lr, sp
	add	ip, r4, #16
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	ldm	r4, {r0, r1, r2, r3}
	bl	freeResources
	mov	r0, #0
	bl	exit
.L99:
	.align	2
.L98:
	.word	RESOURCE
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.size	processReader, .-processReader
	.align	2
	.global	programAbort
	.syntax unified
	.arm
	.fpu softvfp
	.type	programAbort, %function
programAbort:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #60
	str	r0, [fp, #-16]
	ldr	r4, .L101
	mov	lr, sp
	add	ip, r4, #16
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	lr!, {r0, r1, r2, r3}
	ldm	ip, {r0, r1, r2}
	stm	lr, {r0, r1, r2}
	ldm	r4, {r0, r1, r2, r3}
	bl	freeResources
	mov	r0, #5
	bl	printError
	mov	r0, #1
	bl	exit
.L102:
	.align	2
.L101:
	.word	RESOURCE
	.size	programAbort, .-programAbort
	.section	.rodata
	.align	2
.LC22:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	parseInt
	.syntax unified
	.arm
	.fpu softvfp
	.type	parseInt, %function
parseInt:
	@ 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	r3, .L108
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-16]
	sub	r3, fp, #16
	mov	r2, #10
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	strtoul
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	beq	.L104
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L105
.L104:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L105
	ldr	r3, [fp, #-28]
	mov	r2, #2
	str	r2, [r3]
.L105:
	ldr	r3, [fp, #-12]
	ldr	r2, .L108
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L107
	bl	__stack_chk_fail
.L107:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L109:
	.align	2
.L108:
	.word	.LC22
	.size	parseInt, .-parseInt
	.section	.rodata
	.align	2
.LC23:
	.ascii	"%s\012\000"
	.text
	.align	2
	.global	printError
	.syntax unified
	.arm
	.fpu softvfp
	.type	printError, %function
printError:
	@ 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	r3, [fp, #-8]
	cmp	r3, #0
	ble	.L112
	ldr	r3, [fp, #-8]
	cmp	r3, #10
	bgt	.L112
	ldr	r3, .L113
	ldr	r0, [r3]
	ldr	r2, .L113+4
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	mov	r2, r3
	ldr	r1, .L113+8
	bl	fprintf
.L112:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L114:
	.align	2
.L113:
	.word	stderr
	.word	ERROR_MESSAGES
	.word	.LC23
	.size	printError, .-printError
	.section	.rodata
	.align	2
.LC24:
	.ascii	"%d: \000"
	.align	2
.LC25:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	printStatus
	.syntax unified
	.arm
	.fpu softvfp
	.type	printStatus, %function
printStatus:
	@ args = 4, pretend = 16, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 1
	push	{r0, r1, r2, r3}
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, [fp, #4]
	str	r3, [fp, #-16]
	ldr	r3, .L118
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L118+4
	ldr	r3, [r3, #56]
	mov	r0, r3
	bl	sem_wait
	ldr	r3, .L118+4
	ldr	r3, [r3, #8]
	cmp	r3, #0
	beq	.L116
	add	r3, fp, #8
	str	r3, [fp, #-12]
	ldr	r3, .L118+4
	ldr	r0, [r3, #8]
	ldr	r3, .L118+4
	ldr	r3, [r3, #16]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L118+8
	bl	fprintf
	ldr	r3, .L118+4
	ldr	r3, [r3, #16]
	ldr	r2, [r3]
	add	r2, r2, #1
	str	r2, [r3]
	ldr	r3, .L118+4
	ldr	r3, [r3, #8]
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-16]
	mov	r0, r3
	bl	vfprintf
	ldr	r3, .L118+4
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	fflush
.L116:
	ldr	r3, .L118+4
	ldr	r3, [r3, #56]
	mov	r0, r3
	bl	sem_post
	nop
	ldr	r3, .L118
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L117
	bl	__stack_chk_fail
.L117:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, lr}
	add	sp, sp, #16
	bx	lr
.L119:
	.align	2
.L118:
	.word	.LC25
	.word	RESOURCE
	.word	.LC24
	.size	printStatus, .-printStatus
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
