	.file	"809286.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"key.k"
	.text
	.globl	cleanSegements
	.type	cleanSegements, @function
cleanSegements:
.LFB6:
	.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
	mov	esi, 300
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 420
	mov	esi, 16
	mov	edi, eax
	call	shmget@PLT
	cmp	eax, -1
	je	.L2
	mov	esi, 300
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 420
	mov	esi, 16
	mov	edi, eax
	call	shmget@PLT
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmctl@PLT
.L2:
	cmp	DWORD PTR -4[rbp], -1
	je	.L3
	mov	eax, DWORD PTR -4[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmctl@PLT
.L3:
	mov	esi, 302
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	esi, 438
	mov	edi, eax
	call	msgget@PLT
	cmp	eax, -1
	je	.L4
	mov	esi, 302
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	esi, 438
	mov	edi, eax
	call	msgget@PLT
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	msgctl@PLT
.L4:
	mov	esi, 303
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	cmp	eax, -1
	je	.L5
	mov	esi, 303
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
.L5:
	mov	esi, 102
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	cmp	eax, -1
	je	.L6
	mov	esi, 102
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
.L6:
	mov	esi, 101
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	cmp	eax, -1
	je	.L7
	mov	esi, 101
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
.L7:
	mov	esi, 702
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	cmp	eax, -1
	je	.L8
	mov	esi, 702
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
.L8:
	mov	esi, 701
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	cmp	eax, -1
	je	.L10
	mov	esi, 701
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
.L10:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cleanSegements, .-cleanSegements
	.section	.rodata
.LC1:
	.string	"Error in down()"
	.text
	.globl	down
	.type	down, @function
down:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	WORD PTR -14[rbp], 0
	mov	WORD PTR -12[rbp], -1
	mov	WORD PTR -10[rbp], 0
	lea	rcx, -14[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	semop@PLT
	cmp	eax, -1
	jne	.L14
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
.L14:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	down, .-down
	.section	.rodata
.LC2:
	.string	"Error in up()"
	.text
	.globl	up
	.type	up, @function
up:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	WORD PTR -14[rbp], 0
	mov	WORD PTR -12[rbp], 1
	mov	WORD PTR -10[rbp], 0
	lea	rcx, -14[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	semop@PLT
	cmp	eax, -1
	jne	.L18
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
.L18:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	up, .-up
	.globl	bdataid
	.data
	.align 4
	.type	bdataid, @object
	.size	bdataid, 4
bdataid:
	.long	-1
	.globl	bufferid
	.align 4
	.type	bufferid, @object
	.size	bufferid, 4
bufferid:
	.long	-1
	.globl	mutex
	.align 4
	.type	mutex, @object
	.size	mutex, 4
mutex:
	.long	-1
	.globl	consumer
	.align 4
	.type	consumer, @object
	.size	consumer, 4
consumer:
	.long	-1
	.globl	producer
	.align 4
	.type	producer, @object
	.size	producer, 4
producer:
	.long	-1
	.globl	full
	.bss
	.align 4
	.type	full, @object
	.size	full, 4
full:
	.zero	4
	.globl	empty
	.align 4
	.type	empty, @object
	.size	empty, 4
empty:
	.zero	4
	.text
	.globl	handler
	.type	handler, @function
handler:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	eax, DWORD PTR bufferid[rip]
	mov	edi, eax
	call	cleanSegements
	call	getpgrp@PLT
	mov	esi, 9
	mov	edi, eax
	call	killpg@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	handler, .-handler
	.section	.rodata
.LC3:
	.string	"Error in semctl"
.LC4:
	.string	"Enter buffer size : "
.LC5:
	.string	"%d"
	.align 8
.LC6:
	.string	"Producer : Error in attach in writer"
.LC7:
	.string	"Error in create"
.LC8:
	.string	"Error in attach in writer"
.LC9:
	.string	"producer: inserted %d\n"
.LC10:
	.string	"producer quiting"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.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	r12
	push	rbx
	sub	rsp, 192
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	r12, rax
	lea	rsi, handler[rip]
	mov	edi, 2
	call	signal@PLT
	mov	DWORD PTR -204[rbp], 0
	mov	eax, DWORD PTR -204[rbp]
	mov	DWORD PTR -128[rbp], eax
	mov	DWORD PTR -124[rbp], 0
	mov	DWORD PTR -120[rbp], 0
	mov	DWORD PTR -116[rbp], 0
	mov	eax, DWORD PTR -204[rbp]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -184[rbp], rdx
	movsx	rdx, eax
	mov	QWORD PTR -224[rbp], rdx
	mov	QWORD PTR -216[rbp], 0
	movsx	rdx, eax
	mov	r14, rdx
	mov	r15d, 0
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 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
.L21:
	cmp	rsp, rdx
	je	.L22
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L21
.L22:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L23
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L23:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -176[rbp], rax
	mov	esi, 101
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	DWORD PTR producer[rip], eax
	mov	esi, 701
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 950
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	DWORD PTR full[rip], eax
	mov	esi, 702
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 950
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	DWORD PTR empty[rip], eax
	mov	eax, DWORD PTR producer[rip]
	cmp	eax, -1
	jne	.L24
	mov	esi, 101
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 950
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	DWORD PTR producer[rip], eax
	mov	DWORD PTR -192[rbp], 1
	mov	eax, DWORD PTR producer[rip]
	mov	rdx, QWORD PTR -192[rbp]
	mov	rcx, rdx
	mov	edx, 16
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	cmp	eax, -1
	jne	.L24
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	eax, DWORD PTR bufferid[rip]
	mov	edi, eax
	call	cleanSegements
	mov	edi, -1
	call	exit@PLT
.L24:
	mov	esi, 102
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 438
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	DWORD PTR consumer[rip], eax
	mov	eax, DWORD PTR producer[rip]
	mov	edi, eax
	call	down
	mov	eax, DWORD PTR consumer[rip]
	cmp	eax, -1
	je	.L25
	mov	eax, DWORD PTR consumer[rip]
	mov	edi, eax
	call	down
.L25:
	mov	esi, 300
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 420
	mov	esi, 16
	mov	edi, eax
	call	shmget@PLT
	mov	DWORD PTR bdataid[rip], eax
	mov	esi, 303
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 950
	mov	esi, 1
	mov	edi, eax
	call	semget@PLT
	mov	DWORD PTR mutex[rip], eax
	mov	eax, DWORD PTR bdataid[rip]
	cmp	eax, -1
	jne	.L26
	lea	rdi, .LC4[rip]
	call	puts@PLT
	lea	rax, -204[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -204[rbp]
	mov	DWORD PTR -128[rbp], eax
	mov	esi, 300
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 932
	mov	esi, 16
	mov	edi, eax
	call	shmget@PLT
	mov	DWORD PTR bdataid[rip], eax
	mov	eax, DWORD PTR -204[rbp]
	mov	DWORD PTR -192[rbp], eax
	mov	eax, DWORD PTR empty[rip]
	mov	rdx, QWORD PTR -192[rbp]
	mov	rcx, rdx
	mov	edx, 16
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	cmp	eax, -1
	jne	.L27
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	eax, DWORD PTR bufferid[rip]
	mov	edi, eax
	call	cleanSegements
	mov	edi, -1
	call	exit@PLT
.L27:
	mov	DWORD PTR -192[rbp], 0
	mov	eax, DWORD PTR full[rip]
	mov	rdx, QWORD PTR -192[rbp]
	mov	rcx, rdx
	mov	edx, 16
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	cmp	eax, -1
	jne	.L28
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	eax, DWORD PTR bufferid[rip]
	mov	edi, eax
	call	cleanSegements
	mov	edi, -1
	call	exit@PLT
.L28:
	mov	eax, DWORD PTR bdataid[rip]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmat@PLT
	mov	QWORD PTR -168[rbp], rax
	mov	rax, QWORD PTR -168[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	eax, -1
	jne	.L29
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	eax, DWORD PTR bufferid[rip]
	mov	edi, eax
	call	cleanSegements
	mov	edi, -1
	call	exit@PLT
.L29:
	mov	rax, QWORD PTR -168[rbp]
	mov	QWORD PTR -160[rbp], rax
	mov	DWORD PTR -196[rbp], 0
	jmp	.L30
.L31:
	mov	eax, DWORD PTR -196[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -160[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -196[rbp]
	cdqe
	mov	eax, DWORD PTR -128[rbp+rax*4]
	mov	DWORD PTR [rdx], eax
	add	DWORD PTR -196[rbp], 1
.L30:
	cmp	DWORD PTR -196[rbp], 3
	jle	.L31
.L26:
	mov	eax, DWORD PTR consumer[rip]
	cmp	eax, -1
	je	.L32
	mov	eax, DWORD PTR consumer[rip]
	mov	edi, eax
	call	up
.L32:
	mov	eax, DWORD PTR producer[rip]
	mov	edi, eax
	call	up
	mov	eax, DWORD PTR bdataid[rip]
	cmp	eax, -1
	je	.L33
	mov	eax, DWORD PTR mutex[rip]
	cmp	eax, -1
	jne	.L34
.L33:
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	eax, DWORD PTR bufferid[rip]
	mov	edi, eax
	call	cleanSegements
	mov	edi, -1
	call	exit@PLT
.L34:
	mov	DWORD PTR -192[rbp], 1
	mov	eax, DWORD PTR mutex[rip]
	mov	rdx, QWORD PTR -192[rbp]
	mov	rcx, rdx
	mov	edx, 16
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	cmp	eax, -1
	jne	.L35
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	eax, DWORD PTR bufferid[rip]
	mov	edi, eax
	call	cleanSegements
	mov	edi, -1
	call	exit@PLT
.L35:
	mov	eax, DWORD PTR bdataid[rip]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmat@PLT
	mov	QWORD PTR -152[rbp], rax
	mov	rax, QWORD PTR -152[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	eax, -1
	jne	.L36
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	eax, DWORD PTR bufferid[rip]
	mov	edi, eax
	call	cleanSegements
	mov	edi, -1
	call	exit@PLT
.L36:
	mov	rax, QWORD PTR -152[rbp]
	mov	QWORD PTR -160[rbp], rax
	mov	rax, QWORD PTR -160[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	lea	rbx, 0[0+rax*4]
	mov	esi, 301
	lea	rdi, .LC0[rip]
	call	ftok@PLT
	mov	edx, 932
	mov	rsi, rbx
	mov	edi, eax
	call	shmget@PLT
	mov	DWORD PTR bufferid[rip], eax
	mov	eax, DWORD PTR bufferid[rip]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmat@PLT
	mov	QWORD PTR -144[rbp], rax
	mov	rax, QWORD PTR -144[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	eax, -1
	jne	.L37
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	eax, DWORD PTR bufferid[rip]
	mov	edi, eax
	call	cleanSegements
	mov	edi, -1
	call	exit@PLT
.L37:
	mov	rax, QWORD PTR -144[rbp]
	mov	QWORD PTR -136[rbp], rax
	mov	DWORD PTR -200[rbp], 1
	jmp	.L38
.L39:
	mov	eax, DWORD PTR empty[rip]
	mov	edi, eax
	call	down
	mov	eax, DWORD PTR mutex[rip]
	mov	edi, eax
	call	down
	mov	rax, QWORD PTR -160[rbp]
	add	rax, 8
	mov	eax, DWORD PTR [rax]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -136[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -200[rbp]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -160[rbp]
	add	rax, 8
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -160[rbp]
	mov	esi, DWORD PTR [rax]
	mov	rax, QWORD PTR -160[rbp]
	lea	rcx, 8[rax]
	mov	eax, edx
	cdq
	idiv	esi
	mov	eax, edx
	mov	DWORD PTR [rcx], eax
	mov	rax, QWORD PTR -160[rbp]
	add	rax, 4
	mov	edx, DWORD PTR [rax]
	add	edx, 1
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR mutex[rip]
	mov	edi, eax
	call	up
	mov	eax, DWORD PTR full[rip]
	mov	edi, eax
	call	up
	mov	eax, DWORD PTR -200[rbp]
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -200[rbp], 1
.L38:
	cmp	DWORD PTR -200[rbp], 20
	jle	.L39
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	eax, 0
	mov	rsp, r12
	mov	rbx, QWORD PTR -40[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	lea	rsp, -32[rbp]
	pop	rbx
	pop	r12
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	"809286.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"key.k\000"
	.text
	.align	2
	.global	cleanSegements
	.syntax unified
	.arm
	.fpu softvfp
	.type	cleanSegements, %function
cleanSegements:
	@ 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]
	mov	r1, #300
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	mov	r2, #420
	mov	r1, #16
	mov	r0, r3
	bl	shmget
	mov	r3, r0
	cmn	r3, #1
	beq	.L2
	mov	r1, #300
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	mov	r2, #420
	mov	r1, #16
	mov	r0, r3
	bl	shmget
	mov	r3, r0
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	shmctl
.L2:
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	beq	.L3
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	shmctl
.L3:
	ldr	r1, .L11+4
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	ldr	r1, .L11+8
	mov	r0, r3
	bl	msgget
	mov	r3, r0
	cmn	r3, #1
	beq	.L4
	ldr	r1, .L11+4
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	ldr	r1, .L11+8
	mov	r0, r3
	bl	msgget
	mov	r3, r0
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	msgctl
.L4:
	ldr	r1, .L11+12
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	ldr	r2, .L11+8
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	cmn	r3, #1
	beq	.L5
	ldr	r1, .L11+12
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	ldr	r2, .L11+8
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	semctl
.L5:
	mov	r1, #102
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	ldr	r2, .L11+8
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	cmn	r3, #1
	beq	.L6
	mov	r1, #102
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	ldr	r2, .L11+8
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	semctl
.L6:
	mov	r1, #101
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	ldr	r2, .L11+8
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	cmn	r3, #1
	beq	.L7
	mov	r1, #101
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	ldr	r2, .L11+8
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	semctl
.L7:
	ldr	r1, .L11+16
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	ldr	r2, .L11+8
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	cmn	r3, #1
	beq	.L8
	ldr	r1, .L11+16
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	ldr	r2, .L11+8
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	semctl
.L8:
	ldr	r1, .L11+20
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	ldr	r2, .L11+8
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	cmn	r3, #1
	beq	.L10
	ldr	r1, .L11+20
	ldr	r0, .L11
	bl	ftok
	mov	r3, r0
	ldr	r2, .L11+8
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	semctl
.L10:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC0
	.word	302
	.word	438
	.word	303
	.word	702
	.word	701
	.size	cleanSegements, .-cleanSegements
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Error in down()\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	down
	.syntax unified
	.arm
	.fpu softvfp
	.type	down, %function
down:
	@ 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]
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strh	r3, [fp, #-16]	@ movhi
	mvn	r3, #0
	strh	r3, [fp, #-14]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-12]	@ movhi
	sub	r3, fp, #16
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	semop
	mov	r3, r0
	cmn	r3, #1
	bne	.L16
	ldr	r0, .L17+4
	bl	perror
	mvn	r0, #0
	bl	exit
.L16:
	nop
	ldr	r3, .L17
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC2
	.word	.LC1
	.size	down, .-down
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Error in up()\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	up
	.syntax unified
	.arm
	.fpu softvfp
	.type	up, %function
up:
	@ 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]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strh	r3, [fp, #-16]	@ movhi
	mov	r3, #1
	strh	r3, [fp, #-14]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-12]	@ movhi
	sub	r3, fp, #16
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	semop
	mov	r3, r0
	cmn	r3, #1
	bne	.L22
	ldr	r0, .L23+4
	bl	perror
	mvn	r0, #0
	bl	exit
.L22:
	nop
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L21
	bl	__stack_chk_fail
.L21:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC4
	.word	.LC3
	.size	up, .-up
	.global	bdataid
	.data
	.align	2
	.type	bdataid, %object
	.size	bdataid, 4
bdataid:
	.word	-1
	.global	bufferid
	.align	2
	.type	bufferid, %object
	.size	bufferid, 4
bufferid:
	.word	-1
	.global	mutex
	.align	2
	.type	mutex, %object
	.size	mutex, 4
mutex:
	.word	-1
	.global	consumer
	.align	2
	.type	consumer, %object
	.size	consumer, 4
consumer:
	.word	-1
	.global	producer
	.align	2
	.type	producer, %object
	.size	producer, 4
producer:
	.word	-1
	.comm	full,4,4
	.comm	empty,4,4
	.text
	.align	2
	.global	handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	handler, %function
handler:
	@ 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, .L26
	ldr	r3, [r3]
	mov	r0, r3
	bl	cleanSegements
	bl	getpgrp
	mov	r3, r0
	mov	r1, #9
	mov	r0, r3
	bl	killpg
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	bufferid
	.size	handler, .-handler
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Error in semctl\000"
	.align	2
.LC6:
	.ascii	"Enter buffer size : \000"
	.align	2
.LC7:
	.ascii	"%d\000"
	.align	2
.LC8:
	.ascii	"Producer : Error in attach in writer\000"
	.align	2
.LC9:
	.ascii	"Error in create\000"
	.align	2
.LC10:
	.ascii	"Error in attach in writer\000"
	.global	__aeabi_idivmod
	.align	2
.LC11:
	.ascii	"producer: inserted %d\012\000"
	.align	2
.LC12:
	.ascii	"producer quiting\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 128
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #128
	ldr	r3, .L47
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r5, r3
	ldr	r1, .L47+4
	mov	r0, #2
	bl	signal
	mov	r3, #0
	str	r3, [fp, #-132]
	ldr	r3, [fp, #-132]
	str	r3, [fp, #-92]
	mov	r3, #0
	str	r3, [fp, #-88]
	mov	r3, #0
	str	r3, [fp, #-84]
	mov	r3, #0
	str	r3, [fp, #-80]
	ldr	ip, [fp, #-132]
	sub	r3, ip, #1
	str	r3, [fp, #-120]
	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, #-116]
	mov	r1, #101
	ldr	r0, .L47+8
	bl	ftok
	mov	r3, r0
	ldr	r2, .L47+12
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	ldr	r2, .L47+16
	str	r3, [r2]
	ldr	r1, .L47+20
	ldr	r0, .L47+8
	bl	ftok
	mov	r3, r0
	ldr	r2, .L47+24
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	ldr	r2, .L47+28
	str	r3, [r2]
	ldr	r1, .L47+32
	ldr	r0, .L47+8
	bl	ftok
	mov	r3, r0
	ldr	r2, .L47+24
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	ldr	r2, .L47+36
	str	r3, [r2]
	ldr	r3, .L47+16
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L29
	mov	r1, #101
	ldr	r0, .L47+8
	bl	ftok
	mov	r3, r0
	ldr	r2, .L47+24
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	ldr	r2, .L47+16
	str	r3, [r2]
	mov	r3, #1
	str	r3, [fp, #-136]
	ldr	r3, .L47+16
	ldr	r0, [r3]
	ldr	r3, [fp, #-136]
	mov	r2, #16
	mov	r1, #0
	bl	semctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L29
	ldr	r0, .L47+40
	bl	perror
	ldr	r3, .L47+44
	ldr	r3, [r3]
	mov	r0, r3
	bl	cleanSegements
	mvn	r0, #0
	bl	exit
.L29:
	mov	r1, #102
	ldr	r0, .L47+8
	bl	ftok
	mov	r3, r0
	ldr	r2, .L47+12
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	ldr	r2, .L47+48
	str	r3, [r2]
	ldr	r3, .L47+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	down
	ldr	r3, .L47+48
	ldr	r3, [r3]
	cmn	r3, #1
	beq	.L30
	ldr	r3, .L47+48
	ldr	r3, [r3]
	mov	r0, r3
	bl	down
.L30:
	mov	r1, #300
	ldr	r0, .L47+8
	bl	ftok
	mov	r3, r0
	mov	r2, #420
	mov	r1, #16
	mov	r0, r3
	bl	shmget
	mov	r3, r0
	ldr	r2, .L47+52
	str	r3, [r2]
	ldr	r1, .L47+56
	ldr	r0, .L47+8
	bl	ftok
	mov	r3, r0
	ldr	r2, .L47+24
	mov	r1, #1
	mov	r0, r3
	bl	semget
	mov	r3, r0
	ldr	r2, .L47+60
	str	r3, [r2]
	ldr	r3, .L47+52
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L31
	ldr	r0, .L47+64
	bl	puts
	sub	r3, fp, #132
	mov	r1, r3
	ldr	r0, .L47+68
	bl	__isoc99_scanf
	ldr	r3, [fp, #-132]
	str	r3, [fp, #-92]
	mov	r1, #300
	ldr	r0, .L47+8
	bl	ftok
	mov	r3, r0
	mov	r2, #932
	mov	r1, #16
	mov	r0, r3
	bl	shmget
	mov	r3, r0
	ldr	r2, .L47+52
	str	r3, [r2]
	ldr	r3, [fp, #-132]
	str	r3, [fp, #-136]
	ldr	r3, .L47+36
	ldr	r0, [r3]
	ldr	r3, [fp, #-136]
	mov	r2, #16
	mov	r1, #0
	bl	semctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L32
	ldr	r0, .L47+40
	bl	perror
	ldr	r3, .L47+44
	ldr	r3, [r3]
	mov	r0, r3
	bl	cleanSegements
	mvn	r0, #0
	bl	exit
.L32:
	mov	r3, #0
	str	r3, [fp, #-136]
	ldr	r3, .L47+28
	ldr	r0, [r3]
	ldr	r3, [fp, #-136]
	mov	r2, #16
	mov	r1, #0
	bl	semctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L33
	ldr	r0, .L47+40
	bl	perror
	ldr	r3, .L47+44
	ldr	r3, [r3]
	mov	r0, r3
	bl	cleanSegements
	mvn	r0, #0
	bl	exit
.L33:
	ldr	r3, .L47+52
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	shmat
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-112]
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L34
	ldr	r0, .L47+72
	bl	perror
	ldr	r3, .L47+44
	ldr	r3, [r3]
	mov	r0, r3
	bl	cleanSegements
	mvn	r0, #0
	bl	exit
.L34:
	ldr	r3, [fp, #-112]
	str	r3, [fp, #-108]
	mov	r3, #0
	str	r3, [fp, #-124]
	b	.L35
.L36:
	ldr	r3, [fp, #-124]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-108]
	add	r2, r2, r3
	ldr	r3, [fp, #-124]
	lsl	r3, r3, #2
	sub	r1, fp, #12
	add	r3, r1, r3
	ldr	r3, [r3, #-80]
	str	r3, [r2]
	ldr	r3, [fp, #-124]
	add	r3, r3, #1
	str	r3, [fp, #-124]
.L35:
	ldr	r3, [fp, #-124]
	cmp	r3, #3
	ble	.L36
.L31:
	ldr	r3, .L47+48
	ldr	r3, [r3]
	cmn	r3, #1
	beq	.L37
	ldr	r3, .L47+48
	ldr	r3, [r3]
	mov	r0, r3
	bl	up
.L37:
	ldr	r3, .L47+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	up
	ldr	r3, .L47+52
	ldr	r3, [r3]
	cmn	r3, #1
	beq	.L38
	ldr	r3, .L47+60
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L39
.L38:
	ldr	r0, .L47+76
	bl	perror
	ldr	r3, .L47+44
	ldr	r3, [r3]
	mov	r0, r3
	bl	cleanSegements
	mvn	r0, #0
	bl	exit
.L39:
	mov	r3, #1
	str	r3, [fp, #-136]
	ldr	r3, .L47+60
	ldr	r0, [r3]
	ldr	r3, [fp, #-136]
	mov	r2, #16
	mov	r1, #0
	bl	semctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L40
	ldr	r0, .L47+40
	bl	perror
	ldr	r3, .L47+44
	ldr	r3, [r3]
	mov	r0, r3
	bl	cleanSegements
	mvn	r0, #0
	bl	exit
.L40:
	ldr	r3, .L47+52
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	shmat
	str	r0, [fp, #-104]
	ldr	r3, [fp, #-104]
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L41
	ldr	r0, .L47+72
	bl	perror
	ldr	r3, .L47+44
	ldr	r3, [r3]
	mov	r0, r3
	bl	cleanSegements
	mvn	r0, #0
	bl	exit
.L41:
	ldr	r3, [fp, #-104]
	str	r3, [fp, #-108]
	ldr	r1, .L47+80
	ldr	r0, .L47+8
	bl	ftok
	ldr	r3, [fp, #-108]
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r2, #932
	mov	r1, r3
	bl	shmget
	mov	r3, r0
	ldr	r2, .L47+44
	str	r3, [r2]
	ldr	r3, .L47+44
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	shmat
	str	r0, [fp, #-100]
	ldr	r3, [fp, #-100]
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L42
	ldr	r0, .L47+84
	bl	perror
	ldr	r3, .L47+44
	ldr	r3, [r3]
	mov	r0, r3
	bl	cleanSegements
	mvn	r0, #0
	bl	exit
.L42:
	ldr	r3, [fp, #-100]
	str	r3, [fp, #-96]
	mov	r3, #1
	str	r3, [fp, #-128]
	b	.L43
.L44:
	ldr	r3, .L47+36
	ldr	r3, [r3]
	mov	r0, r3
	bl	down
	ldr	r3, .L47+60
	ldr	r3, [r3]
	mov	r0, r3
	bl	down
	ldr	r3, [fp, #-108]
	add	r3, r3, #8
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-96]
	add	r3, r2, r3
	ldr	r2, [fp, #-128]
	str	r2, [r3]
	ldr	r3, [fp, #-108]
	add	r3, r3, #8
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #-108]
	ldr	r1, [r3]
	ldr	r3, [fp, #-108]
	add	r4, r3, #8
	mov	r0, r2
	bl	__aeabi_idivmod
	mov	r3, r1
	str	r3, [r4]
	ldr	r3, [fp, #-108]
	add	r3, r3, #4
	ldr	r2, [r3]
	add	r2, r2, #1
	str	r2, [r3]
	ldr	r3, .L47+60
	ldr	r3, [r3]
	mov	r0, r3
	bl	up
	ldr	r3, .L47+28
	ldr	r3, [r3]
	mov	r0, r3
	bl	up
	ldr	r1, [fp, #-128]
	ldr	r0, .L47+88
	bl	printf
	ldr	r3, [fp, #-128]
	add	r3, r3, #1
	str	r3, [fp, #-128]
.L43:
	ldr	r3, [fp, #-128]
	cmp	r3, #20
	ble	.L44
	ldr	r0, .L47+92
	bl	puts
	mov	r3, #0
	mov	sp, r5
	ldr	r2, .L47
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L46
	bl	__stack_chk_fail
.L46:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L48:
	.align	2
.L47:
	.word	.LC13
	.word	handler
	.word	.LC0
	.word	438
	.word	producer
	.word	701
	.word	950
	.word	full
	.word	702
	.word	empty
	.word	.LC5
	.word	bufferid
	.word	consumer
	.word	bdataid
	.word	303
	.word	mutex
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	301
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
