	.file	"479031.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"s"
.LC1:
	.string	"."
	.align 8
.LC2:
	.string	"Error: Could not create semaphore"
	.align 8
.LC3:
	.string	"Error: Could not store the address in union buf using IPC_STAT"
	.align 8
.LC4:
	.string	"ERROR: Could not set the value for semaphore %d"
	.align 8
.LC5:
	.string	"ERROR: Could not retrieve the value for semaphore %d"
.LC6:
	.string	"Unable to fork child #%d\n"
	.align 8
.LC7:
	.string	"ERROR: Could not remove the semaphore"
	.align 8
.LC8:
	.string	"Finished the program, Have a nice day!\n"
	.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
	sub	rsp, 320
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	DWORD PTR -340[rbp], edi
	mov	QWORD PTR -352[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	mov	rdx, QWORD PTR -352[rbp]
	mov	eax, DWORD PTR -340[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	checkInput@PLT
	mov	edi, 10
	call	putchar@PLT
	mov	rax, QWORD PTR -352[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -312[rbp], eax
	mov	BYTE PTR -322[rbp], 0
	mov	rax, QWORD PTR -352[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L2
	mov	BYTE PTR -322[rbp], 1
.L2:
	mov	rax, QWORD PTR -352[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -308[rbp], eax
	mov	DWORD PTR -304[rbp], 1
	mov	eax, DWORD PTR -304[rbp]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -272[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	ecx, 16
	mov	edx, 0
	div	rcx
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L3:
	cmp	rsp, rdx
	je	.L4
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L3
.L4:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L5
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L5:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -264[rbp], rax
	mov	DWORD PTR -316[rbp], 0
	jmp	.L6
.L7:
	mov	rax, QWORD PTR -264[rbp]
	mov	edx, DWORD PTR -316[rbp]
	movsx	rdx, edx
	mov	DWORD PTR [rax+rdx*4], 0
	add	DWORD PTR -316[rbp], 1
.L6:
	mov	eax, DWORD PTR -316[rbp]
	cmp	eax, DWORD PTR -304[rbp]
	jl	.L7
	mov	esi, 83
	lea	rdi, .LC1[rip]
	call	ftok@PLT
	mov	DWORD PTR -300[rbp], eax
	mov	ecx, DWORD PTR -304[rbp]
	mov	eax, DWORD PTR -300[rbp]
	mov	edx, 950
	mov	esi, ecx
	mov	edi, eax
	call	semget@PLT
	mov	DWORD PTR -296[rbp], eax
	cmp	DWORD PTR -296[rbp], -1
	jne	.L8
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	lea	rax, -256[rbp]
	mov	QWORD PTR -280[rbp], rax
	mov	rdx, QWORD PTR -280[rbp]
	mov	eax, DWORD PTR -296[rbp]
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	cmp	eax, -1
	jne	.L9
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 2
	call	exit@PLT
.L9:
	mov	DWORD PTR -316[rbp], 0
	jmp	.L10
.L22:
	call	fork@PLT
	mov	DWORD PTR -292[rbp], eax
	cmp	DWORD PTR -292[rbp], 0
	jne	.L11
	call	getpid@PLT
	mov	edi, eax
	call	srand@PLT
	movzx	eax, BYTE PTR -322[rbp]
	xor	eax, 1
	test	al, al
	je	.L12
	call	rand@PLT
	cdq
	idiv	DWORD PTR -308[rbp]
	mov	eax, edx
	add	eax, 1
	mov	DWORD PTR -284[rbp], eax
	mov	eax, DWORD PTR -284[rbp]
	imul	eax, eax, 100000
	mov	edi, eax
	call	usleep@PLT
	mov	edx, DWORD PTR -308[rbp]
	mov	ecx, DWORD PTR -292[rbp]
	mov	eax, DWORD PTR -316[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	writeBuffer
	jmp	.L13
.L12:
	mov	BYTE PTR -321[rbp], 1
	jmp	.L14
.L20:
	mov	eax, DWORD PTR -296[rbp]
	mov	ecx, 0
	mov	edx, 12
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	mov	DWORD PTR -320[rbp], eax
	jmp	.L15
.L17:
	call	rand@PLT
	cdq
	idiv	DWORD PTR -308[rbp]
	mov	eax, edx
	add	eax, 1
	mov	DWORD PTR -288[rbp], eax
	mov	eax, DWORD PTR -288[rbp]
	imul	eax, eax, 10000
	mov	edi, eax
	call	usleep@PLT
	mov	eax, DWORD PTR -296[rbp]
	mov	ecx, 0
	mov	edx, 12
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	mov	DWORD PTR -320[rbp], eax
.L15:
	cmp	DWORD PTR -320[rbp], -1
	je	.L16
	cmp	DWORD PTR -320[rbp], 0
	jne	.L17
.L16:
	cmp	DWORD PTR -320[rbp], 0
	jne	.L18
	mov	DWORD PTR -280[rbp], 1
	mov	rdx, QWORD PTR -280[rbp]
	mov	eax, DWORD PTR -296[rbp]
	mov	rcx, rdx
	mov	edx, 16
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	cmp	eax, -1
	jne	.L19
	mov	edx, DWORD PTR -316[rbp]
	lea	rax, -144[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 3
	call	exit@PLT
.L19:
	mov	edx, DWORD PTR -308[rbp]
	mov	ecx, DWORD PTR -292[rbp]
	mov	eax, DWORD PTR -316[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	writeBuffer
	movzx	eax, al
	test	eax, eax
	setne	al
	xor	eax, 1
	movzx	eax, al
	mov	BYTE PTR -321[rbp], al
	and	BYTE PTR -321[rbp], 1
	mov	rax, QWORD PTR -264[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -280[rbp], eax
	mov	rdx, QWORD PTR -280[rbp]
	mov	eax, DWORD PTR -296[rbp]
	mov	rcx, rdx
	mov	edx, 16
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	cmp	eax, -1
	jne	.L14
	mov	edx, DWORD PTR -316[rbp]
	lea	rax, -144[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 3
	call	exit@PLT
.L18:
	cmp	DWORD PTR -320[rbp], -1
	jne	.L14
	mov	edx, DWORD PTR -316[rbp]
	lea	rax, -144[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 4
	call	exit@PLT
.L14:
	cmp	BYTE PTR -321[rbp], 0
	jne	.L20
.L13:
	mov	edi, 1
	call	exit@PLT
.L11:
	cmp	DWORD PTR -292[rbp], -1
	jne	.L21
	mov	eax, DWORD PTR -316[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
.L21:
	add	DWORD PTR -316[rbp], 1
.L10:
	mov	eax, DWORD PTR -316[rbp]
	cmp	eax, DWORD PTR -312[rbp]
	jl	.L22
	mov	DWORD PTR -316[rbp], 0
	jmp	.L23
.L24:
	mov	edi, 0
	call	wait@PLT
	add	DWORD PTR -316[rbp], 1
.L23:
	mov	eax, DWORD PTR -316[rbp]
	cmp	eax, DWORD PTR -312[rbp]
	jl	.L24
	mov	eax, DWORD PTR -296[rbp]
	mov	ecx, 0
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	cmp	eax, -1
	jne	.L25
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 5
	call	exit@PLT
.L25:
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC9:
	.string	"i: %d process ID:%ld parent ID:%ld child ID:%ld\n"
	.text
	.globl	writeBuffer
	.type	writeBuffer, @function
writeBuffer:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r13
	push	r12
	push	rbx
	sub	rsp, 72
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	mov	DWORD PTR -84[rbp], edi
	mov	DWORD PTR -88[rbp], esi
	mov	DWORD PTR -92[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	r13, rax
	mov	DWORD PTR -68[rbp], 255
	mov	eax, DWORD PTR -68[rbp]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -56[rbp], rdx
	movsx	rdx, eax
	mov	r8, rdx
	mov	r9d, 0
	movsx	rdx, eax
	mov	rcx, rdx
	mov	ebx, 0
	cdqe
	mov	edx, 16
	sub	rdx, 1
	add	rax, rdx
	mov	ebx, 16
	mov	edx, 0
	div	rbx
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L28:
	cmp	rsp, rdx
	je	.L29
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L28
.L29:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L30
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L30:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -48[rbp], rax
	mov	eax, DWORD PTR -88[rbp]
	movsx	r12, eax
	call	getppid@PLT
	movsx	rbx, eax
	call	getpid@PLT
	movsx	rcx, eax
	mov	edx, DWORD PTR -84[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	r9, r12
	mov	r8, rbx
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	DWORD PTR -64[rbp], eax
	mov	rax, QWORD PTR stdout[rip]
	mov	rsi, QWORD PTR -48[rbp]
	mov	ecx, 0
	mov	edx, 0
	mov	rdi, rax
	call	setvbuf@PLT
	mov	DWORD PTR -72[rbp], 0
	jmp	.L31
.L32:
	mov	rdx, QWORD PTR stdout[rip]
	mov	rcx, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR -72[rbp]
	cdqe
	movzx	eax, BYTE PTR [rcx+rax]
	movsx	eax, al
	mov	rsi, rdx
	mov	edi, eax
	call	fputc@PLT
	call	rand@PLT
	cdq
	idiv	DWORD PTR -92[rbp]
	mov	eax, edx
	add	eax, 1
	mov	DWORD PTR -60[rbp], eax
	mov	eax, DWORD PTR -60[rbp]
	imul	eax, eax, 10000
	mov	edi, eax
	call	usleep@PLT
	add	DWORD PTR -72[rbp], 1
.L31:
	mov	eax, DWORD PTR -72[rbp]
	cmp	eax, DWORD PTR -64[rbp]
	jl	.L32
	mov	eax, 1
	mov	rsp, r13
	mov	rbx, QWORD PTR -40[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	lea	rsp, -24[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	writeBuffer, .-writeBuffer
	.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	"479031.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"s\000"
	.align	2
.LC1:
	.ascii	".\000"
	.align	2
.LC2:
	.ascii	"Error: Could not create semaphore\000"
	.align	2
.LC3:
	.ascii	"Error: Could not store the address in union buf usi"
	.ascii	"ng IPC_STAT\000"
	.global	__aeabi_idivmod
	.align	2
.LC4:
	.ascii	"ERROR: Could not set the value for semaphore %d\000"
	.align	2
.LC5:
	.ascii	"ERROR: Could not retrieve the value for semaphore %"
	.ascii	"d\000"
	.align	2
.LC6:
	.ascii	"Unable to fork child #%d\012\000"
	.align	2
.LC7:
	.ascii	"ERROR: Could not remove the semaphore\000"
	.align	2
.LC8:
	.ascii	"Finished the program, Have a nice day!\012\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 232
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #232
	str	r0, [fp, #-232]
	str	r1, [fp, #-236]
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, [fp, #-236]
	ldr	r0, [fp, #-232]
	bl	checkInput
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-236]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-212]
	mov	r3, #0
	strb	r3, [fp, #-226]
	ldr	r3, [fp, #-236]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L24+4
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L2
	mov	r3, #1
	strb	r3, [fp, #-226]
.L2:
	ldr	r3, [fp, #-236]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-208]
	mov	r3, #1
	str	r3, [fp, #-204]
	ldr	ip, [fp, #-204]
	sub	r3, ip, #1
	str	r3, [fp, #-200]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-196]
	mov	r3, #0
	str	r3, [fp, #-216]
	b	.L3
.L4:
	ldr	r3, [fp, #-196]
	ldr	r2, [fp, #-216]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-216]
	add	r3, r3, #1
	str	r3, [fp, #-216]
.L3:
	ldr	r2, [fp, #-216]
	ldr	r3, [fp, #-204]
	cmp	r2, r3
	blt	.L4
	mov	r1, #83
	ldr	r0, .L24+8
	bl	ftok
	str	r0, [fp, #-192]
	ldr	r2, .L24+12
	ldr	r1, [fp, #-204]
	ldr	r0, [fp, #-192]
	bl	semget
	str	r0, [fp, #-188]
	ldr	r3, [fp, #-188]
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L24+16
	bl	perror
	mov	r0, #1
	bl	exit
.L5:
	sub	r3, fp, #172
	str	r3, [fp, #-224]
	ldr	r3, [fp, #-224]
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-188]
	bl	semctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L24+20
	bl	perror
	mov	r0, #2
	bl	exit
.L6:
	mov	r3, #0
	str	r3, [fp, #-216]
	b	.L7
.L19:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-184]
	ldr	r3, [fp, #-184]
	cmp	r3, #0
	bne	.L8
	bl	getpid
	mov	r3, r0
	mov	r0, r3
	bl	srand
	ldrb	r3, [fp, #-226]
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	beq	.L9
	bl	rand
	mov	r3, r0
	ldr	r1, [fp, #-208]
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	add	r3, r3, #1
	str	r3, [fp, #-176]
	ldr	r3, [fp, #-176]
	ldr	r2, .L24+24
	mul	r3, r2, r3
	mov	r0, r3
	bl	usleep
	ldr	r2, [fp, #-208]
	ldr	r1, [fp, #-184]
	ldr	r0, [fp, #-216]
	bl	writeBuffer
	b	.L10
.L9:
	mov	r3, #1
	strb	r3, [fp, #-225]
	b	.L11
.L17:
	mov	r3, #0
	mov	r2, #12
	mov	r1, #0
	ldr	r0, [fp, #-188]
	bl	semctl
	str	r0, [fp, #-220]
	b	.L12
.L14:
	bl	rand
	mov	r3, r0
	ldr	r1, [fp, #-208]
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	add	r3, r3, #1
	str	r3, [fp, #-180]
	ldr	r2, [fp, #-180]
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #4
	mov	r0, r3
	bl	usleep
	mov	r3, #0
	mov	r2, #12
	mov	r1, #0
	ldr	r0, [fp, #-188]
	bl	semctl
	str	r0, [fp, #-220]
.L12:
	ldr	r3, [fp, #-220]
	cmn	r3, #1
	beq	.L13
	ldr	r3, [fp, #-220]
	cmp	r3, #0
	bne	.L14
.L13:
	ldr	r3, [fp, #-220]
	cmp	r3, #0
	bne	.L15
	mov	r3, #1
	str	r3, [fp, #-224]
	ldr	r3, [fp, #-224]
	mov	r2, #16
	mov	r1, #0
	ldr	r0, [fp, #-188]
	bl	semctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L16
	sub	r3, fp, #108
	ldr	r2, [fp, #-216]
	ldr	r1, .L24+28
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #108
	mov	r0, r3
	bl	perror
	mov	r0, #3
	bl	exit
.L16:
	ldr	r2, [fp, #-208]
	ldr	r1, [fp, #-184]
	ldr	r0, [fp, #-216]
	bl	writeBuffer
	mov	r3, r0
	cmp	r3, #0
	movne	r3, #1
	moveq	r3, #0
	and	r3, r3, #255
	eor	r3, r3, #1
	and	r3, r3, #255
	strb	r3, [fp, #-225]
	ldrb	r3, [fp, #-225]
	and	r3, r3, #1
	strb	r3, [fp, #-225]
	ldr	r3, [fp, #-196]
	ldr	r3, [r3]
	str	r3, [fp, #-224]
	ldr	r3, [fp, #-224]
	mov	r2, #16
	mov	r1, #0
	ldr	r0, [fp, #-188]
	bl	semctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L11
	sub	r3, fp, #108
	ldr	r2, [fp, #-216]
	ldr	r1, .L24+28
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #108
	mov	r0, r3
	bl	perror
	mov	r0, #3
	bl	exit
.L15:
	ldr	r3, [fp, #-220]
	cmn	r3, #1
	bne	.L11
	sub	r3, fp, #108
	ldr	r2, [fp, #-216]
	ldr	r1, .L24+32
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #108
	mov	r0, r3
	bl	perror
	mov	r0, #4
	bl	exit
.L11:
	ldrb	r3, [fp, #-225]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L17
.L10:
	mov	r0, #1
	bl	exit
.L8:
	ldr	r3, [fp, #-184]
	cmn	r3, #1
	bne	.L18
	ldr	r1, [fp, #-216]
	ldr	r0, .L24+36
	bl	printf
.L18:
	ldr	r3, [fp, #-216]
	add	r3, r3, #1
	str	r3, [fp, #-216]
.L7:
	ldr	r2, [fp, #-216]
	ldr	r3, [fp, #-212]
	cmp	r2, r3
	blt	.L19
	mov	r3, #0
	str	r3, [fp, #-216]
	b	.L20
.L21:
	mov	r0, #0
	bl	wait
	ldr	r3, [fp, #-216]
	add	r3, r3, #1
	str	r3, [fp, #-216]
.L20:
	ldr	r2, [fp, #-216]
	ldr	r3, [fp, #-212]
	cmp	r2, r3
	blt	.L21
	mov	r3, #0
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-188]
	bl	semctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L22
	ldr	r0, .L24+40
	bl	perror
	mov	r0, #5
	bl	exit
.L22:
	ldr	r0, .L24+44
	bl	puts
	mov	r0, #0
	bl	exit
.L25:
	.align	2
.L24:
	.word	.LC9
	.word	.LC0
	.word	.LC1
	.word	950
	.word	.LC2
	.word	.LC3
	.word	100000
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	main, .-main
	.section	.rodata
	.align	2
.LC10:
	.ascii	"i: %d process ID:%ld parent ID:%ld child ID:%ld\012"
	.ascii	"\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	writeBuffer
	.syntax unified
	.arm
	.fpu softvfp
	.type	writeBuffer, %function
writeBuffer:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #56
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	str	r2, [fp, #-56]
	ldr	r3, .L31
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r5, r3
	mov	r3, #255
	str	r3, [fp, #-36]
	ldr	ip, [fp, #-36]
	sub	r3, ip, #1
	str	r3, [fp, #-32]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	add	r3, sp, #8
	add	r3, r3, #0
	str	r3, [fp, #-28]
	bl	getpid
	mov	r4, r0
	bl	getppid
	mov	r2, r0
	ldr	r3, [fp, #-52]
	str	r3, [sp, #4]
	str	r2, [sp]
	mov	r3, r4
	ldr	r2, [fp, #-48]
	ldr	r1, .L31+4
	ldr	r0, [fp, #-28]
	bl	sprintf
	str	r0, [fp, #-24]
	ldr	r3, .L31+8
	ldr	r0, [r3]
	mov	r3, #0
	mov	r2, #0
	ldr	r1, [fp, #-28]
	bl	setvbuf
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L27
.L28:
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-40]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, .L31+8
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, r2
	bl	fputc
	bl	rand
	mov	r3, r0
	ldr	r1, [fp, #-56]
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	add	r3, r3, #1
	str	r3, [fp, #-20]
	ldr	r2, [fp, #-20]
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #4
	mov	r0, r3
	bl	usleep
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L27:
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L28
	mov	r3, #1
	mov	sp, r5
	ldr	r2, .L31
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L30
	bl	__stack_chk_fail
.L30:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L32:
	.align	2
.L31:
	.word	.LC11
	.word	.LC10
	.word	stdout
	.size	writeBuffer, .-writeBuffer
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
