	.file	"92381.c"
	.intel_syntax noprefix
	.text
	.globl	empty
	.bss
	.align 8
	.type	empty, @object
	.size	empty, 8
empty:
	.zero	8
	.globl	full
	.align 8
	.type	full, @object
	.size	full, 8
full:
	.zero	8
	.globl	mutex
	.align 8
	.type	mutex, @object
	.size	mutex, 8
mutex:
	.zero	8
	.section	.rodata
.LC0:
	.string	"empty"
.LC1:
	.string	"full"
.LC2:
	.string	"mutex"
.LC3:
	.string	"wb++"
.LC4:
	.string	"FileBuffer.txt"
.LC5:
	.string	"in producer %d\n"
.LC6:
	.string	"p%d in lock\n"
.LC7:
	.string	"%d was writed \n"
.LC8:
	.string	"p%d out lock\n"
.LC9:
	.string	"set full = %d\n"
.LC10:
	.string	"in consumer %d \n"
.LC11:
	.string	"full = %d\n"
.LC12:
	.string	"c%d in lock\n"
.LC13:
	.string	"%d:\t%d\n"
.LC14:
	.string	"c%d out lock\n"
.LC15:
	.string	"c%d exit\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	rbx
	sub	rsp, 56
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -52[rbp], 0
	mov	DWORD PTR -36[rbp], 0
	mov	QWORD PTR -32[rbp], 0
	mov	ecx, 10
	mov	edx, 52
	mov	esi, 192
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR empty[rip], rax
	mov	ecx, 0
	mov	edx, 52
	mov	esi, 192
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR full[rip], rax
	mov	ecx, 1
	mov	edx, 52
	mov	esi, 192
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR mutex[rip], rax
	lea	rsi, .LC3[rip]
	lea	rdi, .LC4[rip]
	call	fopen@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 0
	mov	esi, 40
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -32[rbp]
	lea	rax, -52[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fflush@PLT
	call	fork@PLT
	test	eax, eax
	jne	.L2
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -56[rbp], 0
	jmp	.L3
.L4:
	mov	rax, QWORD PTR empty[rip]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR mutex[rip]
	mov	rdi, rax
	call	sem_wait@PLT
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	sal	rax, 2
	mov	rcx, rax
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -32[rbp]
	lea	rax, -56[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fflush@PLT
	mov	eax, DWORD PTR -56[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	eax, DWORD PTR -36[rbp]
	lea	edx, 1[rax]
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	DWORD PTR -36[rbp], eax
	mov	ecx, DWORD PTR -36[rbp]
	mov	eax, ecx
	sal	eax, 2
	add	eax, ecx
	add	eax, eax
	sub	edx, eax
	mov	DWORD PTR -36[rbp], edx
	mov	rax, QWORD PTR mutex[rip]
	mov	rdi, rax
	call	sem_post@PLT
	mov	rax, QWORD PTR full[rip]
	mov	rdi, rax
	call	sem_post@PLT
	mov	rax, QWORD PTR full[rip]
	lea	rdx, -48[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	sem_getvalue@PLT
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -48[rbp]
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -56[rbp]
	add	eax, 1
	mov	DWORD PTR -56[rbp], eax
.L3:
	mov	eax, DWORD PTR -56[rbp]
	cmp	eax, 499
	jle	.L4
	mov	edi, 0
	call	exit@PLT
.L2:
	mov	edi, 1
	call	sleep@PLT
	mov	DWORD PTR -40[rbp], 0
	jmp	.L5
.L9:
	call	fork@PLT
	test	eax, eax
	jne	.L6
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -44[rbp], 0
	jmp	.L7
.L8:
	mov	rax, QWORD PTR full[rip]
	lea	rdx, -48[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	sem_getvalue@PLT
	mov	eax, DWORD PTR -48[rbp]
	mov	esi, eax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR full[rip]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR mutex[rip]
	mov	rdi, rax
	call	sem_wait@PLT
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 0
	mov	esi, 40
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -32[rbp]
	lea	rax, -52[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fread@PLT
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	sal	rax, 2
	mov	rcx, rax
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -32[rbp]
	lea	rax, -56[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fread@PLT
	mov	ebx, DWORD PTR -56[rbp]
	call	getpid@PLT
	mov	edx, ebx
	mov	esi, eax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	eax, DWORD PTR -52[rbp]
	lea	ecx, 1[rax]
	movsx	rax, ecx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	esi, ecx
	sar	esi, 31
	sub	eax, esi
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	sub	ecx, eax
	mov	edx, ecx
	mov	DWORD PTR -52[rbp], edx
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 0
	mov	esi, 40
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -32[rbp]
	lea	rax, -52[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fflush@PLT
	mov	rax, QWORD PTR mutex[rip]
	mov	rdi, rax
	call	sem_post@PLT
	mov	rax, QWORD PTR empty[rip]
	mov	rdi, rax
	call	sem_post@PLT
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -44[rbp], 1
.L7:
	cmp	DWORD PTR -44[rbp], 99
	jle	.L8
	call	getpid@PLT
	mov	esi, eax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	exit@PLT
.L6:
	add	DWORD PTR -40[rbp], 1
.L5:
	cmp	DWORD PTR -40[rbp], 4
	jle	.L9
	mov	edi, 0
	mov	eax, 0
	call	wait@PLT
	mov	edi, 0
	mov	eax, 0
	call	wait@PLT
	mov	edi, 0
	mov	eax, 0
	call	wait@PLT
	mov	edi, 0
	mov	eax, 0
	call	wait@PLT
	mov	edi, 0
	mov	eax, 0
	call	wait@PLT
	lea	rdi, .LC0[rip]
	call	sem_unlink@PLT
	lea	rdi, .LC1[rip]
	call	sem_unlink@PLT
	lea	rdi, .LC2[rip]
	call	sem_unlink@PLT
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"92381.c"
	.text
	.comm	empty,4,4
	.comm	full,4,4
	.comm	mutex,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"empty\000"
	.align	2
.LC1:
	.ascii	"full\000"
	.align	2
.LC2:
	.ascii	"mutex\000"
	.align	2
.LC3:
	.ascii	"wb++\000"
	.align	2
.LC4:
	.ascii	"FileBuffer.txt\000"
	.align	2
.LC5:
	.ascii	"in producer %d\012\000"
	.align	2
.LC6:
	.ascii	"p%d in lock\012\000"
	.align	2
.LC7:
	.ascii	"%d was writed \012\000"
	.align	2
.LC8:
	.ascii	"p%d out lock\012\000"
	.align	2
.LC9:
	.ascii	"set full = %d\012\000"
	.align	2
.LC10:
	.ascii	"in consumer %d \012\000"
	.align	2
.LC11:
	.ascii	"full = %d\012\000"
	.align	2
.LC12:
	.ascii	"c%d in lock\012\000"
	.align	2
.LC13:
	.ascii	"%d:\011%d\012\000"
	.align	2
.LC14:
	.ascii	"c%d out lock\012\000"
	.align	2
.LC15:
	.ascii	"c%d exit\012\000"
	.align	2
.LC16:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #10
	mov	r2, #52
	mov	r1, #192
	ldr	r0, .L12+4
	bl	sem_open
	mov	r3, r0
	ldr	r2, .L12+8
	str	r3, [r2]
	mov	r3, #0
	mov	r2, #52
	mov	r1, #192
	ldr	r0, .L12+12
	bl	sem_open
	mov	r3, r0
	ldr	r2, .L12+16
	str	r3, [r2]
	mov	r3, #1
	mov	r2, #52
	mov	r1, #192
	ldr	r0, .L12+20
	bl	sem_open
	mov	r3, r0
	ldr	r2, .L12+24
	str	r3, [r2]
	ldr	r1, .L12+28
	ldr	r0, .L12+32
	bl	fopen
	str	r0, [fp, #-12]
	mov	r2, #0
	mov	r1, #40
	ldr	r0, [fp, #-12]
	bl	fseek
	sub	r0, fp, #32
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #4
	bl	fwrite
	ldr	r0, [fp, #-12]
	bl	fflush
	bl	fork
	mov	r3, r0
	cmp	r3, #0
	bne	.L2
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L12+36
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L3
.L4:
	ldr	r3, .L12+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	sem_wait
	ldr	r3, .L12+24
	ldr	r3, [r3]
	mov	r0, r3
	bl	sem_wait
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L12+40
	bl	printf
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	fseek
	sub	r0, fp, #36
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #4
	bl	fwrite
	ldr	r0, [fp, #-12]
	bl	fflush
	ldr	r3, [fp, #-36]
	mov	r1, r3
	ldr	r0, .L12+44
	bl	printf
	ldr	r3, .L12+48
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	ldr	r3, .L12+52
	smull	r1, r3, r2, r3
	asr	r1, r3, #2
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #1
	sub	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r3, .L12+24
	ldr	r3, [r3]
	mov	r0, r3
	bl	sem_post
	ldr	r3, .L12+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	sem_post
	ldr	r3, .L12+16
	ldr	r3, [r3]
	sub	r2, fp, #28
	mov	r1, r2
	mov	r0, r3
	bl	sem_getvalue
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L12+56
	bl	printf
	ldr	r3, [fp, #-28]
	mov	r1, r3
	ldr	r0, .L12+60
	bl	printf
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L3:
	ldr	r3, [fp, #-36]
	cmp	r3, #500
	blt	.L4
	mov	r0, #0
	bl	exit
.L2:
	mov	r0, #1
	bl	sleep
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L5
.L9:
	bl	fork
	mov	r3, r0
	cmp	r3, #0
	bne	.L6
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L12+64
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L7
.L8:
	ldr	r3, .L12+16
	ldr	r3, [r3]
	sub	r2, fp, #28
	mov	r1, r2
	mov	r0, r3
	bl	sem_getvalue
	ldr	r3, [fp, #-28]
	mov	r1, r3
	ldr	r0, .L12+68
	bl	printf
	ldr	r3, .L12+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	sem_wait
	ldr	r3, .L12+24
	ldr	r3, [r3]
	mov	r0, r3
	bl	sem_wait
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L12+72
	bl	printf
	ldr	r3, .L12+48
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	mov	r2, #0
	mov	r1, #40
	ldr	r0, [fp, #-12]
	bl	fseek
	sub	r0, fp, #32
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #4
	bl	fread
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	fseek
	sub	r0, fp, #36
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #4
	bl	fread
	bl	getpid
	mov	r1, r0
	ldr	r3, [fp, #-36]
	mov	r2, r3
	ldr	r0, .L12+76
	bl	printf
	ldr	r3, .L12+48
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	ldr	r3, [fp, #-32]
	add	r1, r3, #1
	ldr	r3, .L12+52
	smull	r2, r3, r1, r3
	asr	r2, r3, #2
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	str	r2, [fp, #-32]
	mov	r2, #0
	mov	r1, #40
	ldr	r0, [fp, #-12]
	bl	fseek
	sub	r0, fp, #32
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #4
	bl	fwrite
	ldr	r0, [fp, #-12]
	bl	fflush
	ldr	r3, .L12+24
	ldr	r3, [r3]
	mov	r0, r3
	bl	sem_post
	ldr	r3, .L12+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	sem_post
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L12+80
	bl	printf
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L7:
	ldr	r3, [fp, #-24]
	cmp	r3, #99
	ble	.L8
	bl	getpid
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L12+84
	bl	printf
	mov	r0, #0
	bl	exit
.L6:
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L5:
	ldr	r3, [fp, #-20]
	cmp	r3, #4
	ble	.L9
	mov	r0, #0
	bl	wait
	mov	r0, #0
	bl	wait
	mov	r0, #0
	bl	wait
	mov	r0, #0
	bl	wait
	mov	r0, #0
	bl	wait
	ldr	r0, .L12+4
	bl	sem_unlink
	ldr	r0, .L12+12
	bl	sem_unlink
	ldr	r0, .L12+20
	bl	sem_unlink
	ldr	r0, [fp, #-12]
	bl	fclose
	mov	r3, #0
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC16
	.word	.LC0
	.word	empty
	.word	.LC1
	.word	full
	.word	.LC2
	.word	mutex
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	stdout
	.word	1717986919
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
