	.file	"38984.c"
	.intel_syntax noprefix
	.text
	.globl	init_buffer
	.type	init_buffer, @function
init_buffer:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 4[rax], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 208[rax], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 212[rax], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 216[rax], 0
	mov	DWORD PTR -4[rbp], 0
	jmp	.L2
.L3:
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR -4[rbp]
	movsx	rdx, edx
	mov	DWORD PTR 8[rax+rdx*4], 0
	add	DWORD PTR -4[rbp], 1
.L2:
	cmp	DWORD PTR -4[rbp], 49
	jle	.L3
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init_buffer, .-init_buffer
	.section	.rodata
.LC0:
	.string	"Enter no of producers: "
.LC1:
	.string	"%d"
.LC2:
	.string	"Enter no of consumers: "
	.align 8
.LC3:
	.string	"No of consumers or producers cannot be zero"
.LC4:
	.string	"/mutex"
.LC5:
	.string	"In sem_open()"
.LC6:
	.string	"In mmap()"
	.align 8
.LC7:
	.string	"Shared memory segment allocated correctly (%d bytes) at %p.\n"
.LC8:
	.string	"In producer manager process"
.LC9:
	.string	"In producer process"
	.align 8
.LC10:
	.string	"Producer %d produced %d at %d\n"
.LC11:
	.string	"In consumer manager process"
.LC12:
	.string	"In consumer process"
	.align 8
.LC13:
	.string	"Consumer %d consumed %d at %d\n"
.LC14:
	.string	"TOTAL -> %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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, 88
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -96[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	ebx, DWORD PTR -96[rbp]
	mov	eax, 50
	cdq
	idiv	ebx
	mov	DWORD PTR -72[rbp], eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -92[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	ebx, DWORD PTR -92[rbp]
	mov	eax, 50
	cdq
	idiv	ebx
	mov	DWORD PTR -68[rbp], eax
	mov	eax, DWORD PTR -92[rbp]
	test	eax, eax
	sete	al
	movzx	edx, al
	mov	eax, DWORD PTR -96[rbp]
	and	eax, edx
	test	eax, eax
	je	.L5
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	ecx, 1
	mov	edx, 504
	mov	esi, 192
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L6
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	lea	rdi, .LC4[rip]
	call	sem_unlink@PLT
	mov	r9d, 0
	mov	r8d, -1
	mov	ecx, 33
	mov	edx, 3
	mov	esi, 220
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -32[rbp], -1
	jne	.L7
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -32[rbp]
	mov	rcx, rdx
	mov	edx, 220
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	init_buffer
	call	fork@PLT
	mov	DWORD PTR -64[rbp], eax
	cmp	DWORD PTR -64[rbp], 0
	jns	.L8
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	cmp	DWORD PTR -64[rbp], 0
	jne	.L9
	mov	DWORD PTR -88[rbp], 0
	jmp	.L10
.L15:
	call	fork@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	jns	.L11
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	cmp	DWORD PTR -48[rbp], 0
	jne	.L12
	mov	DWORD PTR -84[rbp], 0
	jmp	.L13
.L14:
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	sem_wait@PLT
	call	random@PLT
	mov	rcx, rax
	movabs	rdx, -6640827866535438581
	mov	rax, rcx
	imul	rdx
	lea	rax, [rdx+rcx]
	sar	rax, 6
	mov	rsi, rcx
	sar	rsi, 63
	sub	rax, rsi
	mov	rdx, rax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	add	rax, rdx
	sal	rax, 2
	sub	rcx, rax
	mov	rdx, rcx
	mov	eax, edx
	add	eax, 1
	mov	DWORD PTR -44[rbp], eax
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -32[rbp]
	movsx	rdx, edx
	mov	ecx, DWORD PTR -44[rbp]
	mov	DWORD PTR 8[rax+rdx*4], ecx
	mov	rax, QWORD PTR -32[rbp]
	mov	ebx, DWORD PTR [rax]
	call	getpid@PLT
	mov	esi, eax
	mov	eax, DWORD PTR -44[rbp]
	mov	ecx, ebx
	mov	edx, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	movsx	rax, edx
	imul	rax, rax, 1374389535
	shr	rax, 32
	sar	eax, 4
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	imul	ecx, eax, 50
	mov	eax, edx
	sub	eax, ecx
	mov	rdx, QWORD PTR -32[rbp]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	add	DWORD PTR -84[rbp], 1
.L13:
	mov	eax, DWORD PTR -84[rbp]
	cmp	eax, DWORD PTR -72[rbp]
	jl	.L14
	mov	edi, 0
	call	exit@PLT
.L12:
	add	DWORD PTR -88[rbp], 1
.L10:
	mov	eax, DWORD PTR -96[rbp]
	cmp	DWORD PTR -88[rbp], eax
	jl	.L15
	mov	edi, 0
	call	wait@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	DWORD PTR 212[rax], 1
	mov	edi, 0
	call	exit@PLT
.L9:
	call	fork@PLT
	mov	DWORD PTR -60[rbp], eax
	cmp	DWORD PTR -60[rbp], 0
	jns	.L16
	lea	rdi, .LC11[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L16:
	cmp	DWORD PTR -60[rbp], 0
	jne	.L17
	mov	DWORD PTR -80[rbp], 0
	jmp	.L18
.L24:
	call	fork@PLT
	mov	DWORD PTR -56[rbp], eax
	cmp	DWORD PTR -56[rbp], 0
	jns	.L19
	lea	rdi, .LC12[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L19:
	cmp	DWORD PTR -56[rbp], 0
	jne	.L20
	mov	DWORD PTR -76[rbp], 0
	jmp	.L21
.L23:
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	edx, eax
	jne	.L22
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	jmp	.L21
.L22:
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, DWORD PTR 4[rax]
	mov	rax, QWORD PTR -32[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR 8[rax+rdx*4]
	mov	DWORD PTR -52[rbp], eax
	mov	rax, QWORD PTR -32[rbp]
	mov	ebx, DWORD PTR 4[rax]
	call	getpid@PLT
	mov	esi, eax
	mov	eax, DWORD PTR -52[rbp]
	mov	ecx, ebx
	mov	edx, eax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR 4[rax]
	lea	edx, 1[rax]
	movsx	rax, edx
	imul	rax, rax, 1374389535
	shr	rax, 32
	sar	eax, 4
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	imul	ecx, eax, 50
	mov	eax, edx
	sub	eax, ecx
	mov	rdx, QWORD PTR -32[rbp]
	mov	DWORD PTR 4[rdx], eax
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, DWORD PTR 208[rax]
	mov	eax, DWORD PTR -52[rbp]
	add	edx, eax
	mov	rax, QWORD PTR -32[rbp]
	mov	DWORD PTR 208[rax], edx
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	add	DWORD PTR -76[rbp], 1
.L21:
	mov	eax, DWORD PTR -76[rbp]
	cmp	eax, DWORD PTR -68[rbp]
	jl	.L23
	mov	edi, 0
	call	exit@PLT
.L20:
	add	DWORD PTR -80[rbp], 1
.L18:
	mov	eax, DWORD PTR -92[rbp]
	cmp	DWORD PTR -80[rbp], eax
	jl	.L24
	mov	edi, 0
	call	wait@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	DWORD PTR 216[rax], 1
	mov	edi, 0
	call	exit@PLT
.L17:
	mov	edi, 0
	call	wait@PLT
	jmp	.L25
.L26:
	mov	edi, 1
	call	sleep@PLT
.L25:
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR 212[rax]
	test	eax, eax
	je	.L26
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR 216[rax]
	test	eax, eax
	je	.L26
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	sem_close@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR 208[rax]
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, 220
	mov	rdi, rax
	call	munmap@PLT
	mov	eax, 0
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"38984.c"
	.text
	.align	2
	.global	init_buffer
	.syntax unified
	.arm
	.fpu softvfp
	.type	init_buffer, %function
init_buffer:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	mov	r2, #0
	str	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	mov	r2, #0
	str	r2, [r3, #208]
	ldr	r3, [fp, #-16]
	mov	r2, #0
	str	r2, [r3, #212]
	ldr	r3, [fp, #-16]
	mov	r2, #0
	str	r2, [r3, #216]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L3:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	add	r2, r2, #2
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, [fp, #-8]
	cmp	r3, #49
	ble	.L3
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	init_buffer, .-init_buffer
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Enter no of producers: \000"
	.align	2
.LC1:
	.ascii	"%d\000"
	.global	__aeabi_idiv
	.align	2
.LC2:
	.ascii	"Enter no of consumers: \000"
	.align	2
.LC3:
	.ascii	"No of consumers or producers cannot be zero\000"
	.align	2
.LC4:
	.ascii	"/mutex\000"
	.align	2
.LC5:
	.ascii	"In sem_open()\000"
	.align	2
.LC6:
	.ascii	"In mmap()\000"
	.align	2
.LC7:
	.ascii	"Shared memory segment allocated correctly (%d bytes"
	.ascii	") at %p.\012\000"
	.align	2
.LC8:
	.ascii	"In producer manager process\000"
	.align	2
.LC9:
	.ascii	"In producer process\000"
	.align	2
.LC10:
	.ascii	"Producer %d produced %d at %d\012\000"
	.align	2
.LC11:
	.ascii	"In consumer manager process\000"
	.align	2
.LC12:
	.ascii	"In consumer process\000"
	.align	2
.LC13:
	.ascii	"Consumer %d consumed %d at %d\012\000"
	.align	2
.LC14:
	.ascii	"TOTAL -> %d\000"
	.align	2
.LC15:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #80
	ldr	r3, .L29
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L29+4
	bl	printf
	sub	r3, fp, #72
	mov	r1, r3
	ldr	r0, .L29+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-72]
	mov	r1, r3
	mov	r0, #50
	bl	__aeabi_idiv
	mov	r3, r0
	str	r3, [fp, #-48]
	ldr	r0, .L29+12
	bl	printf
	sub	r3, fp, #68
	mov	r1, r3
	ldr	r0, .L29+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-68]
	mov	r1, r3
	mov	r0, #50
	bl	__aeabi_idiv
	mov	r3, r0
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-68]
	cmp	r3, #0
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	mov	r2, r3
	ldr	r3, [fp, #-72]
	and	r3, r3, r2
	cmp	r3, #0
	beq	.L5
	ldr	r0, .L29+16
	bl	perror
	mov	r0, #1
	bl	exit
.L5:
	mov	r3, #1
	mov	r2, #504
	mov	r1, #192
	ldr	r0, .L29+20
	bl	sem_open
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bne	.L6
	ldr	r0, .L29+24
	bl	perror
	mov	r0, #1
	bl	exit
.L6:
	ldr	r0, .L29+20
	bl	sem_unlink
	mov	r3, #0
	str	r3, [sp, #4]
	mvn	r3, #0
	str	r3, [sp]
	mov	r3, #33
	mov	r2, #3
	mov	r1, #220
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L29+28
	bl	perror
	mov	r0, #1
	bl	exit
.L7:
	ldr	r3, .L29+32
	ldr	r0, [r3]
	ldr	r3, [fp, #-36]
	mov	r2, #220
	ldr	r1, .L29+36
	bl	fprintf
	ldr	r0, [fp, #-36]
	bl	init_buffer
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bge	.L8
	ldr	r0, .L29+40
	bl	perror
	mov	r0, #1
	bl	exit
.L8:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L9
	mov	r3, #0
	str	r3, [fp, #-64]
	b	.L10
.L15:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bge	.L11
	ldr	r0, .L29+44
	bl	perror
	mov	r0, #1
	bl	exit
.L11:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L12
	mov	r3, #0
	str	r3, [fp, #-60]
	b	.L13
.L14:
	ldr	r0, [fp, #-40]
	bl	sem_wait
	bl	random
	mov	r1, r0
	ldr	r3, .L29+48
	smull	r2, r3, r1, r3
	asr	r2, r3, #5
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #2
	sub	r2, r1, r3
	add	r3, r2, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-36]
	ldr	r2, [r3]
	ldr	r3, [fp, #-36]
	add	r2, r2, #2
	ldr	r1, [fp, #-12]
	str	r1, [r3, r2, lsl #2]
	bl	getpid
	mov	r1, r0
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	ldr	r0, .L29+52
	bl	printf
	ldr	r3, [fp, #-36]
	ldr	r3, [r3]
	add	r1, r3, #1
	ldr	r3, .L29+48
	smull	r2, r3, r1, r3
	asr	r2, r3, #4
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	ldr	r3, [fp, #-36]
	str	r2, [r3]
	ldr	r0, [fp, #-40]
	bl	sem_post
	ldr	r3, [fp, #-60]
	add	r3, r3, #1
	str	r3, [fp, #-60]
.L13:
	ldr	r2, [fp, #-60]
	ldr	r3, [fp, #-48]
	cmp	r2, r3
	blt	.L14
	mov	r0, #0
	bl	exit
.L12:
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
.L10:
	ldr	r3, [fp, #-72]
	ldr	r2, [fp, #-64]
	cmp	r2, r3
	blt	.L15
	mov	r0, #0
	bl	wait
	ldr	r3, [fp, #-36]
	mov	r2, #1
	str	r2, [r3, #212]
	mov	r0, #0
	bl	exit
.L9:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L16
	ldr	r0, .L29+56
	bl	perror
	mov	r0, #1
	bl	exit
.L16:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L17
	mov	r3, #0
	str	r3, [fp, #-56]
	b	.L18
.L24:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bge	.L19
	ldr	r0, .L29+60
	bl	perror
	mov	r0, #1
	bl	exit
.L19:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L20
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L21
.L23:
	ldr	r0, [fp, #-40]
	bl	sem_wait
	ldr	r3, [fp, #-36]
	ldr	r2, [r3]
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #4]
	cmp	r2, r3
	bne	.L22
	ldr	r0, [fp, #-40]
	bl	sem_post
	b	.L21
.L22:
	ldr	r3, [fp, #-36]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-36]
	add	r2, r2, #2
	ldr	r3, [r3, r2, lsl #2]
	str	r3, [fp, #-20]
	bl	getpid
	mov	r1, r0
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-20]
	ldr	r0, .L29+64
	bl	printf
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #4]
	add	r1, r3, #1
	ldr	r3, .L29+48
	smull	r2, r3, r1, r3
	asr	r2, r3, #4
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	ldr	r3, [fp, #-36]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-36]
	ldr	r2, [r3, #208]
	ldr	r3, [fp, #-20]
	add	r2, r2, r3
	ldr	r3, [fp, #-36]
	str	r2, [r3, #208]
	ldr	r0, [fp, #-40]
	bl	sem_post
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L21:
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-44]
	cmp	r2, r3
	blt	.L23
	mov	r0, #0
	bl	exit
.L20:
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
.L18:
	ldr	r3, [fp, #-68]
	ldr	r2, [fp, #-56]
	cmp	r2, r3
	blt	.L24
	mov	r0, #0
	bl	wait
	ldr	r3, [fp, #-36]
	mov	r2, #1
	str	r2, [r3, #216]
	mov	r0, #0
	bl	exit
.L17:
	mov	r0, #0
	bl	wait
	b	.L25
.L26:
	mov	r0, #1
	bl	sleep
.L25:
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #212]
	cmp	r3, #0
	beq	.L26
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #216]
	cmp	r3, #0
	beq	.L26
	ldr	r0, [fp, #-40]
	bl	sem_close
	ldr	r3, [fp, #-36]
	ldr	r3, [r3, #208]
	mov	r1, r3
	ldr	r0, .L29+68
	bl	printf
	mov	r1, #220
	ldr	r0, [fp, #-36]
	bl	munmap
	mov	r3, #0
	ldr	r2, .L29
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L28
	bl	__stack_chk_fail
.L28:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	.LC15
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	stderr
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	1374389535
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
