	.file	"534282.c"
	.intel_syntax noprefix
	.text
	.globl	max_timeout
	.bss
	.align 16
	.type	max_timeout, @object
	.size	max_timeout, 16
max_timeout:
	.zero	16
	.globl	num_con
	.align 4
	.type	num_con, @object
	.size	num_con, 4
num_con:
	.zero	4
	.globl	num_pro
	.align 4
	.type	num_pro, @object
	.size	num_pro, 4
num_pro:
	.zero	4
	.globl	num_place
	.align 4
	.type	num_place, @object
	.size	num_place, 4
num_place:
	.zero	4
	.globl	num_to_take
	.align 4
	.type	num_to_take, @object
	.size	num_to_take, 4
num_to_take:
	.zero	4
	.globl	round
	.align 4
	.type	round, @object
	.size	round, 4
round:
	.zero	4
	.section	.rodata
	.align 8
.LC0:
	.string	"Producer puts %d at %d, round %d \n"
	.text
	.globl	put
	.type	put, @function
put:
.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	DWORD PTR -28[rbp], esi
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	jmp	.L2
.L3:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	add	rdx, 88
	mov	rsi, rax
	mov	rdi, rdx
	call	pthread_cond_wait@PLT
.L2:
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR 136[rax]
	mov	eax, DWORD PTR num_place[rip]
	cmp	edx, eax
	je	.L3
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -4[rbp], 0
	jmp	.L4
.L7:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 160[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	je	.L5
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 160[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	add	edx, 1
	mov	DWORD PTR [rax], edx
.L5:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 160[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L6
	cmp	DWORD PTR -8[rbp], 0
	jne	.L6
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 160[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	DWORD PTR [rax], 1
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 144[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rdx, rax
	mov	eax, DWORD PTR -28[rbp]
	mov	DWORD PTR [rdx], eax
	mov	DWORD PTR -8[rbp], 1
	mov	ecx, DWORD PTR round[rip]
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 144[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edx, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
.L6:
	mov	eax, DWORD PTR round[rip]
	add	eax, 1
	mov	DWORD PTR round[rip], eax
	add	DWORD PTR -4[rbp], 1
.L4:
	mov	eax, DWORD PTR num_place[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L7
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 136[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 136[rax], edx
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 40
	mov	rdi, rax
	call	pthread_cond_broadcast@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	put, .-put
	.globl	search_biggest_position
	.type	search_biggest_position, @function
search_biggest_position:
.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 -24[rbp], rdi
	mov	DWORD PTR -12[rbp], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 160[rax]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -8[rbp], eax
	mov	DWORD PTR -4[rbp], 0
	jmp	.L9
.L11:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 160[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -8[rbp], eax
	jge	.L10
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 160[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -8[rbp], eax
.L10:
	add	DWORD PTR -4[rbp], 1
.L9:
	mov	eax, DWORD PTR num_place[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L11
	mov	eax, DWORD PTR -12[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	search_biggest_position, .-search_biggest_position
	.section	.rodata
.LC1:
	.string	"Consumer Timedout, round %d\n"
	.align 8
.LC2:
	.string	"Consumer takes %d from %d, round %d\n"
	.text
	.globl	take
	.type	take, @function
take:
.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	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -4[rbp], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	jmp	.L14
.L16:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	lea	rcx, 40[rdx]
	lea	rdx, max_timeout[rip]
	mov	rsi, rax
	mov	rdi, rcx
	call	pthread_cond_timedwait@PLT
	test	eax, eax
	je	.L14
	mov	eax, DWORD PTR round[rip]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR round[rip]
	add	eax, 1
	mov	DWORD PTR round[rip], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	eax, -1
	jmp	.L15
.L14:
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, DWORD PTR 136[rax]
	mov	eax, DWORD PTR num_to_take[rip]
	cmp	edx, eax
	jl	.L16
	mov	DWORD PTR -8[rbp], 0
	jmp	.L17
.L18:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	search_biggest_position
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 160[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	DWORD PTR [rax], 0
	mov	ecx, DWORD PTR round[rip]
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 144[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edx, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 136[rax]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 136[rax], edx
	mov	eax, DWORD PTR round[rip]
	add	eax, 1
	mov	DWORD PTR round[rip], eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 88
	mov	rdi, rax
	call	pthread_cond_broadcast@PLT
	add	DWORD PTR -8[rbp], 1
.L17:
	mov	eax, DWORD PTR num_to_take[rip]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L18
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	eax, 0
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	take, .-take
	.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 -4[rbp], 0
	jmp	.L20
.L21:
	mov	edx, DWORD PTR -4[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	put
	add	DWORD PTR -4[rbp], 1
.L20:
	cmp	DWORD PTR -4[rbp], 999
	jle	.L21
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE9:
	.size	producer, .-producer
	.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, 16
	mov	QWORD PTR -8[rbp], rdi
.L25:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	take
	test	eax, eax
	jne	.L27
	jmp	.L25
.L27:
	nop
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE10:
	.size	consumer, .-consumer
	.section	.rodata
.LC3:
	.string	"How many consumers?"
.LC4:
	.string	"%d"
.LC5:
	.string	"How many producers?"
.LC6:
	.string	"How many places?"
	.align 8
.LC7:
	.string	"How many products to take each time?"
.LC8:
	.string	"Input can't be negative!"
.LC9:
	.string	"Can't take so much products!"
	.align 8
.LC10:
	.string	"ERROR: return code from pthread_create () is %d\n"
	.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
	push	r15
	push	r14
	push	r13
	push	r12
	sub	rsp, 96
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	lea	rsi, max_timeout[rip]
	mov	edi, 0
	call	clock_gettime@PLT
	mov	rax, QWORD PTR max_timeout[rip]
	add	rax, 5
	mov	QWORD PTR max_timeout[rip], rax
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rsi, num_con[rip]
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	lea	rsi, num_pro[rip]
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rdi, .LC6[rip]
	call	puts@PLT
	lea	rsi, num_place[rip]
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rdi, .LC7[rip]
	call	puts@PLT
	lea	rsi, num_to_take[rip]
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR num_con[rip]
	test	eax, eax
	js	.L29
	mov	eax, DWORD PTR num_pro[rip]
	test	eax, eax
	js	.L29
	mov	eax, DWORD PTR num_to_take[rip]
	test	eax, eax
	jns	.L30
.L29:
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
.L30:
	mov	edx, DWORD PTR num_to_take[rip]
	mov	eax, DWORD PTR num_place[rip]
	cmp	edx, eax
	jle	.L31
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
.L31:
	mov	eax, DWORD PTR num_con[rip]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -80[rbp], rdx
	movsx	rdx, eax
	mov	QWORD PTR -112[rbp], rdx
	mov	QWORD PTR -104[rbp], 0
	movsx	rdx, eax
	mov	QWORD PTR -128[rbp], rdx
	mov	QWORD PTR -120[rbp], 0
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	ecx, 16
	mov	edx, 0
	div	rcx
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L32:
	cmp	rsp, rdx
	je	.L33
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L32
.L33:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L34
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L34:
	mov	rax, rsp
	add	rax, 7
	shr	rax, 3
	sal	rax, 3
	mov	QWORD PTR -72[rbp], rax
	mov	eax, DWORD PTR num_pro[rip]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -64[rbp], rdx
	movsx	rdx, eax
	mov	r14, rdx
	mov	r15d, 0
	movsx	rdx, eax
	mov	r12, rdx
	mov	r13d, 0
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	ecx, 16
	mov	edx, 0
	div	rcx
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L35:
	cmp	rsp, rdx
	je	.L36
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L35
.L36:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L37
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L37:
	mov	rax, rsp
	add	rax, 7
	shr	rax, 3
	sal	rax, 3
	mov	QWORD PTR -56[rbp], rax
	mov	edi, 168
	call	malloc@PLT
	mov	QWORD PTR -48[rbp], rax
	mov	eax, DWORD PTR num_place[rip]
	cdqe
	mov	esi, 4
	mov	rdi, rax
	call	calloc@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	mov	QWORD PTR 144[rax], rdx
	mov	eax, DWORD PTR num_place[rip]
	cdqe
	mov	esi, 4
	mov	rdi, rax
	call	calloc@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	mov	QWORD PTR 160[rax], rdx
	mov	rax, QWORD PTR -48[rbp]
	mov	DWORD PTR 136[rax], 0
	mov	rax, QWORD PTR -48[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 88
	mov	esi, 0
	mov	rdi, rax
	call	pthread_cond_init@PLT
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 40
	mov	esi, 0
	mov	rdi, rax
	call	pthread_cond_init@PLT
	mov	QWORD PTR -88[rbp], 0
	jmp	.L38
.L40:
	mov	rax, QWORD PTR -88[rbp]
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -72[rbp]
	lea	rdi, [rdx+rax]
	mov	rax, QWORD PTR -48[rbp]
	mov	rcx, rax
	lea	rdx, consumer[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	DWORD PTR -92[rbp], eax
	cmp	DWORD PTR -92[rbp], 0
	je	.L39
	mov	eax, DWORD PTR -92[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, -1
	call	exit@PLT
.L39:
	add	QWORD PTR -88[rbp], 1
.L38:
	mov	eax, DWORD PTR num_con[rip]
	cdqe
	cmp	QWORD PTR -88[rbp], rax
	jl	.L40
	mov	QWORD PTR -88[rbp], 0
	jmp	.L41
.L43:
	mov	rax, QWORD PTR -88[rbp]
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	lea	rdi, [rdx+rax]
	mov	rax, QWORD PTR -48[rbp]
	mov	rcx, rax
	lea	rdx, producer[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	DWORD PTR -92[rbp], eax
	cmp	DWORD PTR -92[rbp], 0
	je	.L42
	mov	eax, DWORD PTR -92[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, -1
	call	exit@PLT
.L42:
	add	QWORD PTR -88[rbp], 1
.L41:
	mov	eax, DWORD PTR num_pro[rip]
	cdqe
	cmp	QWORD PTR -88[rbp], rax
	jl	.L43
	mov	QWORD PTR -88[rbp], 0
	jmp	.L44
.L45:
	mov	rax, QWORD PTR -72[rbp]
	mov	rdx, QWORD PTR -88[rbp]
	mov	rax, QWORD PTR [rax+rdx*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	QWORD PTR -88[rbp], 1
.L44:
	mov	eax, DWORD PTR num_con[rip]
	cdqe
	cmp	QWORD PTR -88[rbp], rax
	jl	.L45
	mov	QWORD PTR -88[rbp], 0
	jmp	.L46
.L47:
	mov	rax, QWORD PTR -56[rbp]
	mov	rdx, QWORD PTR -88[rbp]
	mov	rax, QWORD PTR [rax+rdx*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	QWORD PTR -88[rbp], 1
.L46:
	mov	eax, DWORD PTR num_pro[rip]
	cdqe
	cmp	QWORD PTR -88[rbp], rax
	jl	.L47
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 40
	mov	rdi, rax
	call	pthread_cond_destroy@PLT
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 88
	mov	rdi, rax
	call	pthread_cond_destroy@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	pthread_mutex_destroy@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR 144[rax]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR 160[rax]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	edi, 0
	call	pthread_exit@PLT
	.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	"534282.c"
	.text
	.comm	max_timeout,8,4
	.comm	num_con,4,4
	.comm	num_pro,4,4
	.comm	num_place,4,4
	.comm	num_to_take,4,4
	.global	round
	.bss
	.align	2
	.type	round, %object
	.size	round, 4
round:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Producer puts %d at %d, round %d \012\000"
	.text
	.align	2
	.global	put
	.syntax unified
	.arm
	.fpu softvfp
	.type	put, %function
put:
	@ 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]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	pthread_mutex_lock
	b	.L2
.L3:
	ldr	r3, [fp, #-16]
	add	r3, r3, #72
	ldr	r2, [fp, #-16]
	mov	r1, r2
	mov	r0, r3
	bl	pthread_cond_wait
.L2:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #120]
	ldr	r3, .L8
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L3
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L4
.L7:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #132]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L5
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #132]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	add	r2, r2, #1
	str	r2, [r3]
.L5:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #132]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L6
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L6
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #132]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #124]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [fp, #-20]
	str	r2, [r3]
	mov	r3, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #124]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, .L8+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r0, .L8+8
	bl	printf
.L6:
	ldr	r3, .L8+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L8+4
	str	r3, [r2]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L4:
	ldr	r3, .L8
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L7
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #120]
	add	r2, r3, #1
	ldr	r3, [fp, #-16]
	str	r2, [r3, #120]
	ldr	r3, [fp, #-16]
	add	r3, r3, #24
	mov	r0, r3
	bl	pthread_cond_broadcast
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	pthread_mutex_unlock
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	num_place
	.word	round
	.word	.LC0
	.size	put, .-put
	.align	2
	.global	search_biggest_position
	.syntax unified
	.arm
	.fpu softvfp
	.type	search_biggest_position, %function
search_biggest_position:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #132]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L11
.L13:
	ldr	r3, [fp, #-24]
	ldr	r2, [r3, #132]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bge	.L12
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-24]
	ldr	r2, [r3, #132]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-12]
.L12:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L11:
	ldr	r3, .L15
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L13
	ldr	r3, [fp, #-16]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L16:
	.align	2
.L15:
	.word	num_place
	.size	search_biggest_position, .-search_biggest_position
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Consumer Timedout, round %d\012\000"
	.align	2
.LC2:
	.ascii	"Consumer takes %d from %d, round %d\012\000"
	.text
	.align	2
	.global	take
	.syntax unified
	.arm
	.fpu softvfp
	.type	take, %function
take:
	@ 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, #-8]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	pthread_mutex_lock
	b	.L18
.L20:
	ldr	r3, [fp, #-16]
	add	r3, r3, #24
	ldr	r1, [fp, #-16]
	ldr	r2, .L23
	mov	r0, r3
	bl	pthread_cond_timedwait
	mov	r3, r0
	cmp	r3, #0
	beq	.L18
	ldr	r3, .L23+4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L23+8
	bl	printf
	ldr	r3, .L23+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L23+4
	str	r3, [r2]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	pthread_mutex_unlock
	mvn	r3, #0
	b	.L19
.L18:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #120]
	ldr	r3, .L23+12
	ldr	r3, [r3]
	cmp	r2, r3
	blt	.L20
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L21
.L22:
	ldr	r0, [fp, #-16]
	bl	search_biggest_position
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #132]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #124]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, .L23+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r0, .L23+16
	bl	printf
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #120]
	sub	r2, r3, #1
	ldr	r3, [fp, #-16]
	str	r2, [r3, #120]
	ldr	r3, .L23+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L23+4
	str	r3, [r2]
	ldr	r3, [fp, #-16]
	add	r3, r3, #72
	mov	r0, r3
	bl	pthread_cond_broadcast
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L21:
	ldr	r3, .L23+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L22
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	pthread_mutex_unlock
	mov	r3, #0
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	max_timeout
	.word	round
	.word	.LC1
	.word	num_to_take
	.word	.LC2
	.size	take, .-take
	.align	2
	.global	producer
	.syntax unified
	.arm
	.fpu softvfp
	.type	producer, %function
producer:
	@ 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, #-8]
	b	.L26
.L27:
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-16]
	bl	put
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L26:
	ldr	r3, [fp, #-8]
	cmp	r3, #1000
	blt	.L27
	mov	r0, #0
	bl	pthread_exit
	.size	producer, .-producer
	.align	2
	.global	consumer
	.syntax unified
	.arm
	.fpu softvfp
	.type	consumer, %function
consumer:
	@ 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]
.L31:
	ldr	r0, [fp, #-8]
	bl	take
	mov	r3, r0
	cmp	r3, #0
	bne	.L33
	b	.L31
.L33:
	nop
	mov	r0, #0
	bl	pthread_exit
	.size	consumer, .-consumer
	.section	.rodata
	.align	2
.LC3:
	.ascii	"How many consumers?\000"
	.align	2
.LC4:
	.ascii	"%d\000"
	.align	2
.LC5:
	.ascii	"How many producers?\000"
	.align	2
.LC6:
	.ascii	"How many places?\000"
	.align	2
.LC7:
	.ascii	"How many products to take each time?\000"
	.align	2
.LC8:
	.ascii	"Input can't be negative!\000"
	.align	2
.LC9:
	.ascii	"Can't take so much products!\000"
	.align	2
.LC10:
	.ascii	"ERROR: return code from pthread_create () is %d\012"
	.ascii	"\000"
	.align	2
.LC11:
	.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, .L49
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L49+4
	mov	r0, #0
	bl	clock_gettime
	ldr	r3, .L49+4
	ldr	r3, [r3]
	add	r3, r3, #5
	ldr	r2, .L49+4
	str	r3, [r2]
	ldr	r0, .L49+8
	bl	puts
	ldr	r1, .L49+12
	ldr	r0, .L49+16
	bl	__isoc99_scanf
	ldr	r0, .L49+20
	bl	puts
	ldr	r1, .L49+24
	ldr	r0, .L49+16
	bl	__isoc99_scanf
	ldr	r0, .L49+28
	bl	puts
	ldr	r1, .L49+32
	ldr	r0, .L49+16
	bl	__isoc99_scanf
	ldr	r0, .L49+36
	bl	puts
	ldr	r1, .L49+40
	ldr	r0, .L49+16
	bl	__isoc99_scanf
	ldr	r3, .L49+12
	ldr	r3, [r3]
	cmp	r3, #0
	blt	.L35
	ldr	r3, .L49+24
	ldr	r3, [r3]
	cmp	r3, #0
	blt	.L35
	ldr	r3, .L49+40
	ldr	r3, [r3]
	cmp	r3, #0
	bge	.L36
.L35:
	ldr	r0, .L49+44
	bl	puts
	mvn	r0, #0
	bl	exit
.L36:
	ldr	r3, .L49+40
	ldr	r2, [r3]
	ldr	r3, .L49+32
	ldr	r3, [r3]
	cmp	r2, r3
	ble	.L37
	ldr	r0, .L49+48
	bl	puts
	mvn	r0, #0
	bl	exit
.L37:
	ldr	r3, .L49+12
	ldr	ip, [r3]
	sub	r3, ip, #1
	str	r3, [fp, #-32]
	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, #-28]
	ldr	r3, .L49+24
	ldr	ip, [r3]
	sub	r3, ip, #1
	str	r3, [fp, #-24]
	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, #-20]
	mov	r0, #136
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, .L49+32
	ldr	r3, [r3]
	mov	r1, #4
	mov	r0, r3
	bl	calloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-16]
	str	r2, [r3, #124]
	ldr	r3, .L49+32
	ldr	r3, [r3]
	mov	r1, #4
	mov	r0, r3
	bl	calloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-16]
	str	r2, [r3, #132]
	ldr	r3, [fp, #-16]
	mov	r2, #0
	str	r2, [r3, #120]
	ldr	r3, [fp, #-16]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	ldr	r3, [fp, #-16]
	add	r3, r3, #72
	mov	r1, #0
	mov	r0, r3
	bl	pthread_cond_init
	ldr	r3, [fp, #-16]
	add	r3, r3, #24
	mov	r1, #0
	mov	r0, r3
	bl	pthread_cond_init
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L38
.L40:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r0, r2, r3
	ldr	r3, [fp, #-16]
	ldr	r2, .L49+52
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L39
	ldr	r1, [fp, #-12]
	ldr	r0, .L49+56
	bl	printf
	mvn	r0, #0
	bl	exit
.L39:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L38:
	ldr	r3, .L49+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	blt	.L40
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L41
.L43:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r0, r2, r3
	ldr	r3, [fp, #-16]
	ldr	r2, .L49+60
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L42
	ldr	r1, [fp, #-12]
	ldr	r0, .L49+56
	bl	printf
	mvn	r0, #0
	bl	exit
.L42:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L41:
	ldr	r3, .L49+24
	ldr	r3, [r3]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	blt	.L43
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L44
.L45:
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-36]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L44:
	ldr	r3, .L49+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	blt	.L45
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L46
.L47:
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-36]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L46:
	ldr	r3, .L49+24
	ldr	r3, [r3]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	blt	.L47
	ldr	r3, [fp, #-16]
	add	r3, r3, #24
	mov	r0, r3
	bl	pthread_cond_destroy
	ldr	r3, [fp, #-16]
	add	r3, r3, #72
	mov	r0, r3
	bl	pthread_cond_destroy
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	pthread_mutex_destroy
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #124]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #132]
	mov	r0, r3
	bl	free
	ldr	r0, [fp, #-16]
	bl	free
	mov	r0, #0
	bl	pthread_exit
.L50:
	.align	2
.L49:
	.word	.LC11
	.word	max_timeout
	.word	.LC3
	.word	num_con
	.word	.LC4
	.word	.LC5
	.word	num_pro
	.word	.LC6
	.word	num_place
	.word	.LC7
	.word	num_to_take
	.word	.LC8
	.word	.LC9
	.word	consumer
	.word	.LC10
	.word	producer
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
