	.file	"24458.c"
	.intel_syntax noprefix
	.text
	.globl	semA
	.bss
	.align 32
	.type	semA, @object
	.size	semA, 32
semA:
	.zero	32
	.globl	mas
	.align 32
	.type	mas, @object
	.size	mas, 400
mas:
	.zero	400
	.section	.rodata
	.align 8
.LC0:
	.string	"\320\277\321\200\320\276\320\270\320\267\320\262\320\265\320\273 %d \320\277\320\276\320\264 \320\275\320\276\320\274\320\265\321\200\320\276\320\274 %d\n"
	.text
	.globl	producer
	.type	producer, @function
producer:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -12[rbp], 0
	jmp	.L2
.L4:
	lea	rax, -16[rbp]
	mov	rsi, rax
	lea	rdi, semA[rip]
	call	sem_getvalue@PLT
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, 100
	jg	.L3
	call	rand@PLT
	mov	edx, eax
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	esi, edx
	sar	esi, 31
	sub	eax, esi
	mov	ecx, eax
	mov	eax, ecx
	sal	eax, 2
	add	eax, ecx
	add	eax, eax
	mov	ecx, edx
	sub	ecx, eax
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	imul	rdx, rdx, 1374389535
	shr	rdx, 32
	sar	edx, 5
	mov	esi, eax
	sar	esi, 31
	sub	edx, esi
	imul	esi, edx, 100
	sub	eax, esi
	mov	edx, eax
	add	ecx, 1
	movsx	rax, edx
	lea	rdx, 0[0+rax*4]
	lea	rax, mas[rip]
	mov	DWORD PTR [rdx+rax], ecx
	mov	edx, DWORD PTR -12[rbp]
	movsx	rax, edx
	imul	rax, rax, 1374389535
	shr	rax, 32
	sar	eax, 5
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	imul	ecx, eax, 100
	mov	eax, edx
	sub	eax, ecx
	mov	edx, DWORD PTR -12[rbp]
	movsx	rcx, edx
	imul	rcx, rcx, 1374389535
	shr	rcx, 32
	sar	ecx, 5
	mov	esi, edx
	sar	esi, 31
	sub	ecx, esi
	imul	esi, ecx, 100
	mov	ecx, edx
	sub	ecx, esi
	movsx	rdx, ecx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, mas[rip]
	mov	ecx, DWORD PTR [rcx+rdx]
	mov	edx, eax
	mov	esi, ecx
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -12[rbp], 1
	lea	rdi, semA[rip]
	call	sem_post@PLT
.L3:
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1374389535
	shr	rdx, 32
	sar	edx, 5
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 100
	sub	eax, ecx
	mov	edx, eax
	lea	eax, 1[rdx]
	imul	eax, eax, 1000
	mov	edi, eax
	call	usleep@PLT
.L2:
	cmp	DWORD PTR -12[rbp], 1000
	jne	.L4
	mov	eax, 0
	mov	rdi, QWORD PTR -8[rbp]
	sub	rdi, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	producer, .-producer
	.section	.rodata
	.align 8
.LC1:
	.string	"\321\201\320\276\320\261\321\200\320\260\320\273 %d \320\277\320\276\320\264 \320\275\320\276\320\274\320\265\321\200\320\276\320\274 %d \320\270 \320\277\320\276\320\273\321\203\321\207\320\270\320\273 %d\n"
	.text
	.globl	consumer
	.type	consumer, @function
consumer:
.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	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -4[rbp], 0
.L8:
	lea	rdi, semA[rip]
	call	sem_wait@PLT
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	imul	rdx, rdx, 1374389535
	shr	rdx, 32
	sar	edx, 5
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 100
	sub	eax, ecx
	mov	edx, eax
	movsx	rax, edx
	lea	rdx, 0[0+rax*4]
	lea	rax, mas[rip]
	mov	eax, DWORD PTR [rdx+rax]
	add	DWORD PTR -4[rbp], eax
	mov	edx, DWORD PTR -8[rbp]
	movsx	rax, edx
	imul	rax, rax, 1374389535
	shr	rax, 32
	sar	eax, 5
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	imul	ecx, eax, 100
	mov	eax, edx
	sub	eax, ecx
	mov	edx, DWORD PTR -8[rbp]
	movsx	rcx, edx
	imul	rcx, rcx, 1374389535
	shr	rcx, 32
	sar	ecx, 5
	mov	esi, edx
	sar	esi, 31
	sub	ecx, esi
	imul	esi, ecx, 100
	mov	ecx, edx
	sub	ecx, esi
	movsx	rdx, ecx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, mas[rip]
	mov	esi, DWORD PTR [rcx+rdx]
	mov	edx, DWORD PTR -4[rbp]
	mov	ecx, edx
	mov	edx, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -8[rbp], 1
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 1374389535
	shr	rdx, 32
	sar	edx, 5
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 100
	sub	eax, ecx
	mov	edx, eax
	lea	eax, 1[rdx]
	imul	eax, eax, 1000
	mov	edi, eax
	call	usleep@PLT
	jmp	.L8
	.cfi_endproc
.LFE7:
	.size	consumer, .-consumer
	.section	.rodata
.LC2:
	.string	"Error creating thread\n"
.LC3:
	.string	"Error joining thread\n"
	.align 8
.LC4:
	.string	"\320\221\320\253\320\233\320\236 \320\224\320\236\320\221\320\220\320\222\320\233\320\225\320\235\320\236 1000 \320\255\320\225\320\233\320\225\320\234\320\225\320\235\320\242\320\236\320\222"
	.text
	.globl	main
	.type	main, @function
main:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 0
	call	time@PLT
	mov	edi, eax
	call	srand@PLT
	mov	edx, 0
	mov	esi, 0
	lea	rdi, semA[rip]
	call	sem_init@PLT
	lea	rax, -24[rbp]
	mov	ecx, 0
	lea	rdx, producer[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	je	.L10
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 22
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L14
.L10:
	lea	rax, -16[rbp]
	mov	ecx, 0
	lea	rdx, consumer[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	je	.L12
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 22
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L14
.L12:
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	test	eax, eax
	je	.L13
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 21
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	eax, 2
	jmp	.L14
.L13:
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, 0
.L14:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"24458.c"
	.text
	.comm	semA,16,4
	.comm	mas,400,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\320\277\321\200\320\276\320\270\320\267\320\262\320"
	.ascii	"\265\320\273 %d \320\277\320\276\320\264 \320\275\320"
	.ascii	"\276\320\274\320\265\321\200\320\276\320\274 %d\012"
	.ascii	"\000"
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	producer
	.syntax unified
	.arm
	.fpu softvfp
	.type	producer, %function
producer:
	@ 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, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L2
.L4:
	sub	r3, fp, #16
	mov	r1, r3
	ldr	r0, .L7+4
	bl	sem_getvalue
	ldr	r3, [fp, #-16]
	cmp	r3, #100
	bgt	.L3
	bl	rand
	mov	r2, r0
	ldr	r3, .L7+8
	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	r1, r2, r3
	ldr	r0, [fp, #-12]
	ldr	r3, .L7+12
	smull	r2, r3, r0, r3
	asr	r2, r3, #5
	asr	r3, r0, #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, r0, r3
	add	r3, r1, #1
	ldr	r1, .L7+16
	str	r3, [r1, r2, lsl #2]
	ldr	r1, [fp, #-12]
	ldr	r3, .L7+12
	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
	ldr	r3, .L7+16
	ldr	r0, [r3, r2, lsl #2]
	ldr	r2, [fp, #-12]
	ldr	r3, .L7+12
	smull	r1, r3, r2, r3
	asr	r1, r3, #5
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r1, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #2
	sub	r1, r2, r3
	mov	r2, r1
	mov	r1, r0
	ldr	r0, .L7+20
	bl	printf
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r0, .L7+4
	bl	sem_post
.L3:
	bl	rand
	mov	r1, r0
	ldr	r3, .L7+12
	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	r2, r2, #1
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r0, r3
	bl	usleep
.L2:
	ldr	r3, [fp, #-12]
	cmp	r3, #1000
	bne	.L4
	mov	r3, #0
	ldr	r2, .L7
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L6
	bl	__stack_chk_fail
.L6:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC1
	.word	semA
	.word	1717986919
	.word	1374389535
	.word	mas
	.word	.LC0
	.size	producer, .-producer
	.section	.rodata
	.align	2
.LC2:
	.ascii	"\321\201\320\276\320\261\321\200\320\260\320\273 %d"
	.ascii	" \320\277\320\276\320\264 \320\275\320\276\320\274\320"
	.ascii	"\265\321\200\320\276\320\274 %d \320\270 \320\277\320"
	.ascii	"\276\320\273\321\203\321\207\320\270\320\273 %d\012"
	.ascii	"\000"
	.text
	.align	2
	.global	consumer
	.syntax unified
	.arm
	.fpu softvfp
	.type	consumer, %function
consumer:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
.L10:
	ldr	r0, .L11
	bl	sem_wait
	ldr	r1, [fp, #-12]
	ldr	r3, .L11+4
	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
	ldr	r3, .L11+8
	ldr	r3, [r3, r2, lsl #2]
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r1, [fp, #-12]
	ldr	r3, .L11+4
	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
	ldr	r3, .L11+8
	ldr	r0, [r3, r2, lsl #2]
	ldr	r2, [fp, #-12]
	ldr	r3, .L11+4
	smull	r1, r3, r2, r3
	asr	r1, r3, #5
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r1, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #2
	sub	r1, r2, r3
	ldr	r3, [fp, #-8]
	mov	r2, r1
	mov	r1, r0
	ldr	r0, .L11+12
	bl	printf
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	bl	rand
	mov	r1, r0
	ldr	r3, .L11+4
	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	r2, r2, #1
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	mov	r0, r3
	bl	usleep
	b	.L10
.L12:
	.align	2
.L11:
	.word	semA
	.word	1374389535
	.word	mas
	.word	.LC2
	.size	consumer, .-consumer
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Error creating thread\012\000"
	.align	2
.LC4:
	.ascii	"Error joining thread\012\000"
	.align	2
.LC5:
	.ascii	"\320\221\320\253\320\233\320\236 \320\224\320\236\320"
	.ascii	"\221\320\220\320\222\320\233\320\225\320\235\320\236"
	.ascii	" 1000 \320\255\320\225\320\233\320\225\320\234\320\225"
	.ascii	"\320\235\320\242\320\236\320\222\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r0, #0
	bl	time
	mov	r3, r0
	mov	r0, r3
	bl	srand
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L20+4
	bl	sem_init
	sub	r0, fp, #16
	mov	r3, #0
	ldr	r2, .L20+8
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L14
	ldr	r3, .L20+12
	ldr	r3, [r3]
	mov	r2, #22
	mov	r1, #1
	ldr	r0, .L20+16
	bl	fwrite
	mov	r3, #1
	b	.L18
.L14:
	sub	r0, fp, #12
	mov	r3, #0
	ldr	r2, .L20+20
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	beq	.L16
	ldr	r3, .L20+12
	ldr	r3, [r3]
	mov	r2, #22
	mov	r1, #1
	ldr	r0, .L20+16
	bl	fwrite
	mov	r3, #1
	b	.L18
.L16:
	ldr	r3, [fp, #-16]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, r0
	cmp	r3, #0
	beq	.L17
	ldr	r3, .L20+12
	ldr	r3, [r3]
	mov	r2, #21
	mov	r1, #1
	ldr	r0, .L20+24
	bl	fwrite
	mov	r3, #2
	b	.L18
.L17:
	ldr	r0, .L20+28
	bl	puts
	mov	r3, #0
.L18:
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC6
	.word	semA
	.word	producer
	.word	stderr
	.word	.LC3
	.word	consumer
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
