	.file	"162644360.c"
	.intel_syntax noprefix
	.text
	.globl	P_START
	.data
	.align 8
	.type	P_START, @object
	.size	P_START, 12
P_START:
	.value	2
	.value	-1
	.value	0
	.value	0
	.value	-1
	.value	0
	.globl	P_STOP
	.align 8
	.type	P_STOP, @object
	.size	P_STOP, 12
P_STOP:
	.value	0
	.value	1
	.value	0
	.value	1
	.value	1
	.value	0
	.globl	C_START
	.align 8
	.type	C_START, @object
	.size	C_START, 12
C_START:
	.value	1
	.value	-1
	.value	0
	.value	0
	.value	-1
	.value	0
	.globl	C_STOP
	.align 8
	.type	C_STOP, @object
	.size	C_STOP, 12
C_STOP:
	.value	0
	.value	1
	.value	0
	.value	2
	.value	1
	.value	0
	.text
	.globl	init_buf
	.type	init_buf, @function
init_buf:
.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	QWORD PTR -8[rbp], rdi
	cmp	QWORD PTR -8[rbp], 0
	jne	.L2
	mov	eax, -1
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 40
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	eax, 0
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	init_buf, .-init_buf
	.globl	write_buf
	.type	write_buf, @function
write_buf:
.LFB7:
	.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 -8[rbp], rdi
	mov	eax, esi
	mov	BYTE PTR -12[rbp], al
	cmp	QWORD PTR -8[rbp], 0
	jne	.L5
	mov	eax, -1
	jmp	.L6
.L5:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	lea	rcx, 1[rax]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rdx], rcx
	mov	rdx, QWORD PTR -8[rbp]
	movzx	ecx, BYTE PTR -12[rbp]
	mov	BYTE PTR 16[rdx+rax], cl
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, QWORD PTR 8[rax]
	movabs	rdx, -6148914691236517205
	mov	rax, rcx
	mul	rdx
	shr	rdx, 4
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 3
	sub	rcx, rax
	mov	rdx, rcx
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	eax, 0
.L6:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	write_buf, .-write_buf
	.globl	read_buf
	.type	read_buf, @function
read_buf:
.LFB8:
	.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 -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	cmp	QWORD PTR -8[rbp], 0
	jne	.L8
	mov	eax, -1
	jmp	.L9
.L8:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	lea	rcx, 1[rax]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR [rdx], rcx
	mov	rdx, QWORD PTR -8[rbp]
	movzx	edx, BYTE PTR 16[rdx+rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, QWORD PTR [rax]
	movabs	rdx, -6148914691236517205
	mov	rax, rcx
	mul	rdx
	shr	rdx, 4
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 3
	sub	rcx, rax
	mov	rdx, rcx
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], rdx
	mov	eax, 0
.L9:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	read_buf, .-read_buf
	.section	.rodata
.LC0:
	.string	"Producer lock error."
.LC1:
	.string	"Buffer write error."
.LC2:
	.string	"P%d produced: %c \t Time: %ds\n"
.LC3:
	.string	"Producer release error."
	.text
	.globl	producer
	.type	producer, @function
producer:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	cmp	QWORD PTR -24[rbp], 0
	jne	.L11
	mov	eax, -1
	jmp	.L12
.L11:
	mov	edi, 0
	call	time@PLT
	mov	edx, eax
	mov	eax, DWORD PTR -32[rbp]
	add	eax, edx
	mov	edi, eax
	call	srand@PLT
	mov	QWORD PTR -8[rbp], 0
	jmp	.L13
.L17:
	call	rand@PLT
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	add	eax, 1
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	sleep@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	edx, 2
	lea	rsi, P_START[rip]
	mov	edi, eax
	call	semop@PLT
	cmp	eax, -1
	jne	.L14
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L14:
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, QWORD PTR 8[rax]
	movabs	rdx, 5675921253449092805
	mov	rax, rcx
	mul	rdx
	shr	rdx, 3
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	sub	rcx, rax
	mov	rdx, rcx
	mov	eax, edx
	add	eax, 97
	mov	BYTE PTR -13[rbp], al
	movsx	edx, BYTE PTR -13[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	write_buf
	cmp	eax, -1
	jne	.L15
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L12
.L15:
	movsx	edx, BYTE PTR -13[rbp]
	mov	ecx, DWORD PTR -12[rbp]
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	edx, 2
	lea	rsi, P_STOP[rip]
	mov	edi, eax
	call	semop@PLT
	cmp	eax, -1
	jne	.L16
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L16:
	add	QWORD PTR -8[rbp], 1
.L13:
	cmp	QWORD PTR -8[rbp], 7
	jbe	.L17
	mov	eax, 0
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	producer, .-producer
	.section	.rodata
.LC4:
	.string	"Consumer lock error."
.LC5:
	.string	"Buffer read error."
.LC6:
	.string	"C%d consumed: %c \t Time: %ds\n"
.LC7:
	.string	"Consumer release error."
	.text
	.globl	consumer
	.type	consumer, @function
consumer:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	DWORD PTR -48[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L19
	mov	eax, -1
	jmp	.L26
.L19:
	mov	edi, 0
	call	time@PLT
	mov	edx, eax
	mov	eax, DWORD PTR -48[rbp]
	add	eax, edx
	add	eax, 3
	mov	edi, eax
	call	srand@PLT
	mov	QWORD PTR -16[rbp], 0
	jmp	.L21
.L25:
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1717986919
	shr	rdx, 32
	sar	edx
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	ecx, edx
	sal	ecx, 2
	add	ecx, edx
	sub	eax, ecx
	mov	edx, eax
	lea	eax, 1[rdx]
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	sleep@PLT
	mov	eax, DWORD PTR -44[rbp]
	mov	edx, 2
	lea	rsi, C_START[rip]
	mov	edi, eax
	call	semop@PLT
	cmp	eax, -1
	jne	.L22
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L22:
	lea	rdx, -21[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	read_buf
	cmp	eax, -1
	jne	.L23
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L26
.L23:
	movzx	eax, BYTE PTR -21[rbp]
	movsx	edx, al
	mov	ecx, DWORD PTR -20[rbp]
	mov	eax, DWORD PTR -48[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -44[rbp]
	mov	edx, 2
	lea	rsi, C_STOP[rip]
	mov	edi, eax
	call	semop@PLT
	cmp	eax, -1
	jne	.L24
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L24:
	add	QWORD PTR -16[rbp], 1
.L21:
	cmp	QWORD PTR -16[rbp], 7
	jbe	.L25
	mov	eax, 0
.L26:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	consumer, .-consumer
	.section	.rodata
.LC8:
	.string	"shmget failed."
.LC9:
	.string	"shmat failed."
.LC10:
	.string	"Buffer initialization failed."
.LC11:
	.string	"semget failed."
.LC12:
	.string	"Producer fork failed."
.LC13:
	.string	"Consumer fork failed."
.LC14:
	.string	"Child error."
	.align 8
.LC15:
	.string	"Child process terminated abnormally"
.LC16:
	.string	"Exit error."
	.text
	.globl	main
	.type	main, @function
main:
.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, 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR stdout[rip]
	mov	esi, 0
	mov	rdi, rax
	call	setbuf@PLT
	mov	edx, 1023
	mov	esi, 40
	mov	edi, 0
	call	shmget@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], -1
	jne	.L29
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L30
.L29:
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmat@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], -1
	jne	.L31
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L30
.L31:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	init_buf
	cmp	eax, -1
	jne	.L32
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L30
.L32:
	mov	edx, 1023
	mov	esi, 3
	mov	edi, 0
	call	semget@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], -1
	jne	.L33
	lea	rdi, .LC11[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L30
.L33:
	mov	eax, DWORD PTR -48[rbp]
	mov	ecx, 1
	mov	edx, 16
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	mov	eax, DWORD PTR -48[rbp]
	mov	ecx, 24
	mov	edx, 16
	mov	esi, 2
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	mov	eax, DWORD PTR -48[rbp]
	mov	ecx, 0
	mov	edx, 16
	mov	esi, 1
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	mov	QWORD PTR -40[rbp], 0
	jmp	.L34
.L38:
	call	fork@PLT
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], -1
	je	.L35
	cmp	DWORD PTR -44[rbp], 0
	je	.L36
	jmp	.L51
.L35:
	lea	rdi, .LC12[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L36:
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, eax
	mov	ecx, DWORD PTR -48[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	producer
	mov	eax, 0
	jmp	.L30
.L51:
	add	QWORD PTR -40[rbp], 1
.L34:
	cmp	QWORD PTR -40[rbp], 2
	jbe	.L38
	mov	QWORD PTR -32[rbp], 0
	jmp	.L39
.L43:
	call	fork@PLT
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], -1
	je	.L40
	cmp	DWORD PTR -44[rbp], 0
	je	.L41
	jmp	.L52
.L40:
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L41:
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, eax
	mov	ecx, DWORD PTR -48[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	consumer
	mov	eax, 0
	jmp	.L30
.L52:
	add	QWORD PTR -32[rbp], 1
.L39:
	cmp	QWORD PTR -32[rbp], 2
	jbe	.L43
	mov	QWORD PTR -24[rbp], 0
	jmp	.L44
.L47:
	lea	rax, -56[rbp]
	mov	rdi, rax
	call	wait@PLT
	cmp	eax, -1
	jne	.L45
	lea	rdi, .LC14[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L45:
	mov	eax, DWORD PTR -56[rbp]
	and	eax, 127
	test	eax, eax
	je	.L46
	lea	rdi, .LC15[rip]
	call	puts@PLT
.L46:
	add	QWORD PTR -24[rbp], 1
.L44:
	cmp	QWORD PTR -24[rbp], 5
	jbe	.L47
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	shmdt@PLT
	cmp	eax, -1
	je	.L48
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmctl@PLT
	cmp	eax, -1
	je	.L48
	mov	eax, DWORD PTR -48[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	semctl@PLT
	cmp	eax, -1
	jne	.L49
.L48:
	lea	rdi, .LC16[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L30
.L49:
	mov	eax, 0
.L30:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	"162644360.c"
	.text
	.global	P_START
	.data
	.align	2
	.type	P_START, %object
	.size	P_START, 12
P_START:
	.short	2
	.short	-1
	.short	0
	.short	0
	.short	-1
	.short	0
	.global	P_STOP
	.align	2
	.type	P_STOP, %object
	.size	P_STOP, 12
P_STOP:
	.short	0
	.short	1
	.short	0
	.short	1
	.short	1
	.short	0
	.global	C_START
	.align	2
	.type	C_START, %object
	.size	C_START, 12
C_START:
	.short	1
	.short	-1
	.short	0
	.short	0
	.short	-1
	.short	0
	.global	C_STOP
	.align	2
	.type	C_STOP, %object
	.size	C_STOP, 12
C_STOP:
	.short	0
	.short	1
	.short	0
	.short	2
	.short	1
	.short	0
	.text
	.align	2
	.global	init_buf
	.syntax unified
	.arm
	.fpu softvfp
	.type	init_buf, %function
init_buf:
	@ 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
	bne	.L2
	mvn	r3, #0
	b	.L3
.L2:
	mov	r2, #32
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	memset
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	init_buf, .-init_buf
	.align	2
	.global	write_buf
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_buf, %function
write_buf:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	mov	r3, r1
	strb	r3, [fp, #-9]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L5
	mvn	r3, #0
	b	.L6
.L5:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	add	r1, r3, #1
	ldr	r2, [fp, #-8]
	str	r1, [r2, #4]
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldrb	r2, [fp, #-9]
	strb	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	ldr	r1, [r3, #4]
	ldr	r3, .L7
	umull	r2, r3, r1, r3
	lsr	r2, r3, #4
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	sub	r2, r1, r3
	ldr	r3, [fp, #-8]
	str	r2, [r3, #4]
	mov	r3, #0
.L6:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L8:
	.align	2
.L7:
	.word	-1431655765
	.size	write_buf, .-write_buf
	.align	2
	.global	read_buf
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_buf, %function
read_buf:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L10
	mvn	r3, #0
	b	.L11
.L10:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	add	r1, r3, #1
	ldr	r2, [fp, #-8]
	str	r1, [r2]
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	ldrb	r2, [r3, #8]	@ zero_extendqisi2
	ldr	r3, [fp, #-12]
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r1, [r3]
	ldr	r3, .L12
	umull	r2, r3, r1, r3
	lsr	r2, r3, #4
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	sub	r2, r1, r3
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	mov	r3, #0
.L11:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L13:
	.align	2
.L12:
	.word	-1431655765
	.size	read_buf, .-read_buf
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Producer lock error.\000"
	.align	2
.LC1:
	.ascii	"Buffer write error.\000"
	.align	2
.LC2:
	.ascii	"P%d produced: %c \011 Time: %ds\012\000"
	.align	2
.LC3:
	.ascii	"Producer release error.\000"
	.text
	.align	2
	.global	producer
	.syntax unified
	.arm
	.fpu softvfp
	.type	producer, %function
producer:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L15
	mvn	r3, #0
	b	.L16
.L15:
	mov	r0, #0
	bl	time
	mov	r2, r0
	ldr	r3, [fp, #-32]
	add	r3, r2, r3
	mov	r0, r3
	bl	srand
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L17
.L21:
	bl	rand
	mov	r3, r0
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	bl	sleep
	mov	r2, #2
	ldr	r1, .L22
	ldr	r0, [fp, #-28]
	bl	semop
	mov	r3, r0
	cmn	r3, #1
	bne	.L18
	ldr	r0, .L22+4
	bl	perror
	mov	r0, #1
	bl	exit
.L18:
	ldr	r3, [fp, #-24]
	ldr	r1, [r3, #4]
	ldr	r3, .L22+8
	umull	r2, r3, r1, r3
	lsr	r2, r3, #3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	and	r3, r2, #255
	add	r3, r3, #97
	strb	r3, [fp, #-13]
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	write_buf
	mov	r3, r0
	cmn	r3, #1
	bne	.L19
	ldr	r0, .L22+12
	bl	perror
	mov	r3, #1
	b	.L16
.L19:
	ldrb	r2, [fp, #-13]	@ zero_extendqisi2
	ldr	r3, [fp, #-8]
	ldr	r1, [fp, #-32]
	ldr	r0, .L22+16
	bl	printf
	mov	r2, #2
	ldr	r1, .L22+20
	ldr	r0, [fp, #-28]
	bl	semop
	mov	r3, r0
	cmn	r3, #1
	bne	.L20
	ldr	r0, .L22+24
	bl	perror
	mov	r0, #1
	bl	exit
.L20:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L17:
	ldr	r3, [fp, #-12]
	cmp	r3, #7
	bls	.L21
	mov	r3, #0
.L16:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	P_START
	.word	.LC0
	.word	1321528399
	.word	.LC1
	.word	.LC2
	.word	P_STOP
	.word	.LC3
	.size	producer, .-producer
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Consumer lock error.\000"
	.align	2
.LC5:
	.ascii	"Buffer read error.\000"
	.align	2
.LC6:
	.ascii	"C%d consumed: %c \011 Time: %ds\012\000"
	.align	2
.LC7:
	.ascii	"Consumer release error.\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	consumer
	.syntax unified
	.arm
	.fpu softvfp
	.type	consumer, %function
consumer:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	ldr	r3, .L34
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L25
	mvn	r3, #0
	b	.L32
.L25:
	mov	r0, #0
	bl	time
	mov	r2, r0
	ldr	r3, [fp, #-32]
	add	r3, r2, r3
	add	r3, r3, #3
	mov	r0, r3
	bl	srand
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L27
.L31:
	bl	rand
	mov	r1, r0
	ldr	r3, .L34+4
	smull	r2, r3, r1, r3
	asr	r2, r3, #1
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	sub	r2, r1, r3
	add	r3, r2, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	sleep
	mov	r2, #2
	ldr	r1, .L34+8
	ldr	r0, [fp, #-28]
	bl	semop
	mov	r3, r0
	cmn	r3, #1
	bne	.L28
	ldr	r0, .L34+12
	bl	perror
	mov	r0, #1
	bl	exit
.L28:
	sub	r3, fp, #17
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	read_buf
	mov	r3, r0
	cmn	r3, #1
	bne	.L29
	ldr	r0, .L34+16
	bl	perror
	mov	r3, #1
	b	.L32
.L29:
	ldrb	r3, [fp, #-17]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-12]
	ldr	r1, [fp, #-32]
	ldr	r0, .L34+20
	bl	printf
	mov	r2, #2
	ldr	r1, .L34+24
	ldr	r0, [fp, #-28]
	bl	semop
	mov	r3, r0
	cmn	r3, #1
	bne	.L30
	ldr	r0, .L34+28
	bl	perror
	mov	r0, #1
	bl	exit
.L30:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L27:
	ldr	r3, [fp, #-16]
	cmp	r3, #7
	bls	.L31
	mov	r3, #0
.L32:
	ldr	r2, .L34
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L33
	bl	__stack_chk_fail
.L33:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L35:
	.align	2
.L34:
	.word	.LC8
	.word	1717986919
	.word	C_START
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	C_STOP
	.word	.LC7
	.size	consumer, .-consumer
	.section	.rodata
	.align	2
.LC9:
	.ascii	"shmget failed.\000"
	.align	2
.LC10:
	.ascii	"shmat failed.\000"
	.align	2
.LC11:
	.ascii	"Buffer initialization failed.\000"
	.align	2
.LC12:
	.ascii	"semget failed.\000"
	.align	2
.LC13:
	.ascii	"Producer fork failed.\000"
	.align	2
.LC14:
	.ascii	"Consumer fork failed.\000"
	.align	2
.LC15:
	.ascii	"Child error.\000"
	.align	2
.LC16:
	.ascii	"Child process terminated abnormally\000"
	.align	2
.LC17:
	.ascii	"Exit error.\000"
	.align	2
.LC18:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	ldr	r3, .L61
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L61+4
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	setbuf
	ldr	r2, .L61+8
	mov	r1, #32
	mov	r0, #0
	bl	shmget
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmn	r3, #1
	bne	.L37
	ldr	r0, .L61+12
	bl	perror
	mov	r3, #1
	b	.L38
.L37:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-24]
	bl	shmat
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	bne	.L39
	ldr	r0, .L61+16
	bl	perror
	mov	r3, #1
	b	.L38
.L39:
	ldr	r0, [fp, #-20]
	bl	init_buf
	mov	r3, r0
	cmn	r3, #1
	bne	.L40
	ldr	r0, .L61+20
	bl	perror
	mov	r3, #1
	b	.L38
.L40:
	ldr	r2, .L61+8
	mov	r1, #3
	mov	r0, #0
	bl	semget
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L41
	ldr	r0, .L61+24
	bl	perror
	mov	r3, #1
	b	.L38
.L41:
	mov	r3, #1
	mov	r2, #16
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	semctl
	mov	r3, #24
	mov	r2, #16
	mov	r1, #2
	ldr	r0, [fp, #-16]
	bl	semctl
	mov	r3, #0
	mov	r2, #16
	mov	r1, #1
	ldr	r0, [fp, #-16]
	bl	semctl
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L42
.L46:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	beq	.L43
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L44
	b	.L59
.L43:
	ldr	r0, .L61+28
	bl	perror
	mov	r0, #1
	bl	exit
.L44:
	ldr	r3, [fp, #-36]
	mov	r2, r3
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-20]
	bl	producer
	mov	r3, #0
	b	.L38
.L59:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L42:
	ldr	r3, [fp, #-36]
	cmp	r3, #2
	bls	.L46
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L47
.L51:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	beq	.L48
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L49
	b	.L60
.L48:
	ldr	r0, .L61+32
	bl	perror
	mov	r0, #1
	bl	exit
.L49:
	ldr	r3, [fp, #-32]
	mov	r2, r3
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-20]
	bl	consumer
	mov	r3, #0
	b	.L38
.L60:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L47:
	ldr	r3, [fp, #-32]
	cmp	r3, #2
	bls	.L51
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L52
.L55:
	sub	r3, fp, #40
	mov	r0, r3
	bl	wait
	mov	r3, r0
	cmn	r3, #1
	bne	.L53
	ldr	r0, .L61+36
	bl	perror
	mov	r0, #1
	bl	exit
.L53:
	ldr	r3, [fp, #-40]
	and	r3, r3, #127
	cmp	r3, #0
	beq	.L54
	ldr	r0, .L61+40
	bl	puts
.L54:
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L52:
	ldr	r3, [fp, #-28]
	cmp	r3, #5
	bls	.L55
	ldr	r0, [fp, #-20]
	bl	shmdt
	mov	r3, r0
	cmn	r3, #1
	beq	.L56
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-24]
	bl	shmctl
	mov	r3, r0
	cmn	r3, #1
	beq	.L56
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	semctl
	mov	r3, r0
	cmn	r3, #1
	bne	.L57
.L56:
	ldr	r0, .L61+44
	bl	perror
	mov	r3, #1
	b	.L38
.L57:
	mov	r3, #0
.L38:
	ldr	r2, .L61
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L58
	bl	__stack_chk_fail
.L58:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L62:
	.align	2
.L61:
	.word	.LC18
	.word	stdout
	.word	1023
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
