	.file	"307924.c"
	.intel_syntax noprefix
	.text
	.globl	capacity
	.bss
	.align 4
	.type	capacity, @object
	.size	capacity, 4
capacity:
	.zero	4
	.globl	prod_threads
	.align 4
	.type	prod_threads, @object
	.size	prod_threads, 4
prod_threads:
	.zero	4
	.globl	cons_threads
	.align 4
	.type	cons_threads, @object
	.size	cons_threads, 4
cons_threads:
	.zero	4
	.globl	producer_loops
	.align 4
	.type	producer_loops, @object
	.size	producer_loops, 4
producer_loops:
	.zero	4
	.globl	consumer_loops
	.align 4
	.type	consumer_loops, @object
	.size	consumer_loops, 4
consumer_loops:
	.zero	4
	.globl	avg1
	.align 4
	.type	avg1, @object
	.size	avg1, 4
avg1:
	.zero	4
	.globl	avg2
	.align 4
	.type	avg2, @object
	.size	avg2, 4
avg2:
	.zero	4
	.globl	buffer
	.align 8
	.type	buffer, @object
	.size	buffer, 8
buffer:
	.zero	8
	.globl	buffer_index
	.align 4
	.type	buffer_index, @object
	.size	buffer_index, 4
buffer_index:
	.zero	4
	.globl	buffer_mutex
	.align 32
	.type	buffer_mutex, @object
	.size	buffer_mutex, 40
buffer_mutex:
	.zero	40
	.globl	full
	.align 32
	.type	full, @object
	.size	full, 32
full:
	.zero	32
	.globl	empty
	.align 32
	.type	empty, @object
	.size	empty, 32
empty:
	.zero	32
	.text
	.globl	ex
	.type	ex, @function
ex:
.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	DWORD PTR -20[rbp], edi
	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, ecx
	not	eax
	cdq
	idiv	DWORD PTR -20[rbp]
	mov	DWORD PTR -8[rbp], eax
	pxor	xmm2, xmm2
	cvtsi2sd	xmm2, DWORD PTR -8[rbp]
	movq	rax, xmm2
	movq	xmm0, rax
	call	exp@PLT
	movsd	xmm1, QWORD PTR .LC0[rip]
	mulsd	xmm0, xmm1
	cvttsd2si	eax, xmm0
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	cdq
	idiv	DWORD PTR -20[rbp]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	ex, .-ex
	.section	.rodata
.LC1:
	.string	"Buffer overflow"
	.text
	.globl	insertItem
	.type	insertItem, @function
insertItem:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	edx, DWORD PTR buffer_index[rip]
	mov	eax, DWORD PTR capacity[rip]
	cmp	edx, eax
	jge	.L4
	mov	rcx, QWORD PTR buffer[rip]
	mov	eax, DWORD PTR buffer_index[rip]
	lea	edx, 1[rax]
	mov	DWORD PTR buffer_index[rip], edx
	cdqe
	sal	rax, 2
	lea	rdx, [rcx+rax]
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR [rdx], eax
	jmp	.L6
.L4:
	lea	rdi, .LC1[rip]
	call	puts@PLT
.L6:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	insertItem, .-insertItem
	.section	.rodata
.LC2:
	.string	"Buffer underflow"
	.text
	.globl	removeItem
	.type	removeItem, @function
removeItem:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR buffer_index[rip]
	test	eax, eax
	jle	.L8
	mov	rdx, QWORD PTR buffer[rip]
	mov	eax, DWORD PTR buffer_index[rip]
	sub	eax, 1
	mov	DWORD PTR buffer_index[rip], eax
	mov	eax, DWORD PTR buffer_index[rip]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	jmp	.L9
.L8:
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	eax, 0
.L9:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	removeItem, .-removeItem
	.globl	total_prod
	.bss
	.align 8
	.type	total_prod, @object
	.size	total_prod, 8
total_prod:
	.zero	8
	.globl	timevar
	.align 16
	.type	timevar, @object
	.size	timevar, 16
timevar:
	.zero	16
	.section	.rodata
	.align 8
.LC3:
	.string	"%dth item produced by thread %d at %s into buffer location %d, item is %d\n"
	.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
	push	rbx
	sub	rsp, 88
	.cfi_offset 3, -24
	mov	QWORD PTR -88[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	esi, 0
	lea	rdi, timevar[rip]
	call	gettimeofday@PLT
	mov	rax, QWORD PTR timevar[rip+8]
	mov	QWORD PTR -48[rbp], rax
	mov	rax, QWORD PTR -88[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -64[rbp], eax
	mov	DWORD PTR -68[rbp], 0
	jmp	.L11
.L13:
	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
	mov	DWORD PTR -60[rbp], edx
	mov	edx, DWORD PTR -60[rbp]
	imul	edx, edx, 100
	sub	eax, edx
	mov	DWORD PTR -60[rbp], eax
	lea	rdi, buffer_mutex[rip]
	call	pthread_mutex_lock@PLT
.L12:
	lea	rdi, buffer_mutex[rip]
	call	pthread_mutex_unlock@PLT
	lea	rdi, full[rip]
	call	sem_wait@PLT
	lea	rdi, buffer_mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	edx, DWORD PTR buffer_index[rip]
	mov	eax, DWORD PTR capacity[rip]
	cmp	edx, eax
	je	.L12
	mov	eax, DWORD PTR -60[rbp]
	mov	edi, eax
	call	insertItem
	lea	rax, -56[rbp]
	mov	rdi, rax
	call	time@PLT
	lea	rax, -56[rbp]
	mov	rdi, rax
	call	localtime@PLT
	mov	QWORD PTR -32[rbp], rax
	lea	rdi, buffer_mutex[rip]
	call	pthread_mutex_unlock@PLT
	lea	rdi, empty[rip]
	call	sem_post@PLT
	mov	ebx, DWORD PTR buffer_index[rip]
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	asctime@PLT
	mov	rcx, rax
	mov	esi, DWORD PTR -60[rbp]
	mov	edx, DWORD PTR -64[rbp]
	mov	eax, DWORD PTR -68[rbp]
	mov	r9d, esi
	mov	r8d, ebx
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR avg1[rip]
	mov	edi, eax
	call	ex
	mov	edi, eax
	call	sleep@PLT
	add	DWORD PTR -68[rbp], 1
.L11:
	mov	eax, DWORD PTR producer_loops[rip]
	cmp	DWORD PTR -68[rbp], eax
	jl	.L13
	mov	esi, 0
	lea	rdi, timevar[rip]
	call	gettimeofday@PLT
	mov	rax, QWORD PTR timevar[rip+8]
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	sub	rax, QWORD PTR -48[rbp]
	mov	edx, DWORD PTR producer_loops[rip]
	movsx	rbx, edx
	cqo
	idiv	rbx
	mov	rdx, rax
	mov	rax, QWORD PTR total_prod[rip]
	add	rax, rdx
	mov	QWORD PTR total_prod[rip], rax
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE9:
	.size	producer, .-producer
	.globl	total_cons
	.bss
	.align 8
	.type	total_cons, @object
	.size	total_cons, 8
total_cons:
	.zero	8
	.section	.rodata
	.align 8
.LC4:
	.string	"%dth item read from buffer by thread %d at %s from buffer location %d, item is %d\n"
	.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
	push	rbx
	sub	rsp, 88
	.cfi_offset 3, -24
	mov	QWORD PTR -88[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	esi, 0
	lea	rdi, timevar[rip]
	call	gettimeofday@PLT
	mov	rax, QWORD PTR timevar[rip+8]
	mov	QWORD PTR -48[rbp], rax
	mov	rax, QWORD PTR -88[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -60[rbp], eax
	mov	DWORD PTR -64[rbp], 0
	jmp	.L16
.L18:
	lea	rdi, buffer_mutex[rip]
	call	pthread_mutex_lock@PLT
.L17:
	lea	rdi, buffer_mutex[rip]
	call	pthread_mutex_unlock@PLT
	lea	rdi, empty[rip]
	call	sem_wait@PLT
	lea	rdi, buffer_mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR buffer_index[rip]
	test	eax, eax
	je	.L17
	mov	eax, DWORD PTR -68[rbp]
	mov	edi, eax
	mov	eax, 0
	call	removeItem
	mov	DWORD PTR -68[rbp], eax
	lea	rax, -56[rbp]
	mov	rdi, rax
	call	time@PLT
	lea	rax, -56[rbp]
	mov	rdi, rax
	call	localtime@PLT
	mov	QWORD PTR -32[rbp], rax
	lea	rdi, buffer_mutex[rip]
	call	pthread_mutex_unlock@PLT
	lea	rdi, full[rip]
	call	sem_post@PLT
	mov	ebx, DWORD PTR buffer_index[rip]
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	asctime@PLT
	mov	rcx, rax
	mov	esi, DWORD PTR -68[rbp]
	mov	edx, DWORD PTR -60[rbp]
	mov	eax, DWORD PTR -64[rbp]
	mov	r9d, esi
	mov	r8d, ebx
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR avg2[rip]
	mov	edi, eax
	call	ex
	mov	edi, eax
	call	sleep@PLT
	add	DWORD PTR -64[rbp], 1
.L16:
	mov	eax, DWORD PTR consumer_loops[rip]
	cmp	DWORD PTR -64[rbp], eax
	jl	.L18
	mov	esi, 0
	lea	rdi, timevar[rip]
	call	gettimeofday@PLT
	mov	rax, QWORD PTR timevar[rip+8]
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	sub	rax, QWORD PTR -48[rbp]
	mov	edx, DWORD PTR consumer_loops[rip]
	movsx	rbx, edx
	cqo
	idiv	rbx
	mov	rdx, rax
	mov	rax, QWORD PTR total_cons[rip]
	add	rax, rdx
	mov	QWORD PTR total_cons[rip], rax
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE10:
	.size	consumer, .-consumer
	.section	.rodata
.LC5:
	.string	"r"
.LC6:
	.string	"input.txt"
.LC7:
	.string	"error in opening the file"
.LC8:
	.string	"%d %d %d %d %d %d %d"
	.align 8
.LC9:
	.string	"avg time taken by producer thread is %lld usec\n"
	.align 8
.LC10:
	.string	"avg time taken by consumer thread is %lld usec\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
	push	rbx
	sub	rsp, 216
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	DWORD PTR -148[rbp], edi
	mov	QWORD PTR -160[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	rbx, rax
	mov	DWORD PTR buffer_index[rip], 0
	lea	rsi, .LC5[rip]
	lea	rdi, .LC6[rip]
	call	fopen@PLT
	mov	QWORD PTR -128[rbp], rax
	cmp	QWORD PTR -128[rbp], 0
	jne	.L21
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
.L21:
	mov	rdi, QWORD PTR -128[rbp]
	sub	rsp, 8
	lea	rax, avg2[rip]
	push	rax
	lea	rax, avg1[rip]
	push	rax
	lea	rax, consumer_loops[rip]
	push	rax
	lea	r9, cons_threads[rip]
	lea	r8, producer_loops[rip]
	lea	rcx, prod_threads[rip]
	lea	rdx, capacity[rip]
	lea	rsi, .LC8[rip]
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	add	rsp, 32
	mov	eax, DWORD PTR capacity[rip]
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR buffer[rip], rax
	mov	esi, 0
	lea	rdi, buffer_mutex[rip]
	call	pthread_mutex_init@PLT
	mov	eax, DWORD PTR capacity[rip]
	mov	edx, eax
	mov	esi, 0
	lea	rdi, full[rip]
	call	sem_init@PLT
	mov	edx, 0
	mov	esi, 0
	lea	rdi, empty[rip]
	call	sem_init@PLT
	mov	edx, DWORD PTR prod_threads[rip]
	movsx	rax, edx
	sub	rax, 1
	mov	QWORD PTR -120[rbp], rax
	movsx	rax, edx
	mov	r12, rax
	mov	r13d, 0
	movsx	rax, edx
	mov	r14, rax
	mov	r15d, 0
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rdx, rax, 16
	mov	rax, rdx
	and	rax, -4096
	mov	rcx, rsp
	sub	rcx, rax
.L22:
	cmp	rsp, rcx
	je	.L23
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L22
.L23:
	mov	rax, rdx
	and	eax, 4095
	sub	rsp, rax
	mov	rax, rdx
	and	eax, 4095
	test	rax, rax
	je	.L24
	mov	rax, rdx
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L24:
	mov	rax, rsp
	add	rax, 7
	shr	rax, 3
	sal	rax, 3
	mov	QWORD PTR -112[rbp], rax
	mov	edx, DWORD PTR cons_threads[rip]
	movsx	rax, edx
	sub	rax, 1
	mov	QWORD PTR -104[rbp], rax
	movsx	rax, edx
	mov	QWORD PTR -176[rbp], rax
	mov	QWORD PTR -168[rbp], 0
	movsx	rax, edx
	mov	QWORD PTR -192[rbp], rax
	mov	QWORD PTR -184[rbp], 0
	movsx	rax, edx
	lea	rdx, 0[0+rax*8]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L25:
	cmp	rsp, rdx
	je	.L26
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L25
.L26:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L27
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L27:
	mov	rax, rsp
	add	rax, 7
	shr	rax, 3
	sal	rax, 3
	mov	QWORD PTR -96[rbp], rax
	mov	eax, DWORD PTR prod_threads[rip]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -88[rbp], rdx
	movsx	rdx, eax
	mov	QWORD PTR -208[rbp], rdx
	mov	QWORD PTR -200[rbp], 0
	movsx	rdx, eax
	mov	QWORD PTR -224[rbp], rdx
	mov	QWORD PTR -216[rbp], 0
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L28:
	cmp	rsp, rdx
	je	.L29
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L28
.L29:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L30
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L30:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -80[rbp], rax
	mov	eax, DWORD PTR cons_threads[rip]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -72[rbp], rdx
	movsx	rdx, eax
	mov	QWORD PTR -240[rbp], rdx
	mov	QWORD PTR -232[rbp], 0
	movsx	rdx, eax
	mov	QWORD PTR -256[rbp], rdx
	mov	QWORD PTR -248[rbp], 0
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	edi, 16
	mov	edx, 0
	div	rdi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L31:
	cmp	rsp, rdx
	je	.L32
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L31
.L32:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L33
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L33:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -64[rbp], rax
	mov	DWORD PTR -132[rbp], 0
	jmp	.L34
.L35:
	mov	rax, QWORD PTR -80[rbp]
	mov	edx, DWORD PTR -132[rbp]
	movsx	rdx, edx
	mov	ecx, DWORD PTR -132[rbp]
	mov	DWORD PTR [rax+rdx*4], ecx
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -80[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -112[rbp]
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, producer[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -132[rbp], 1
.L34:
	mov	eax, DWORD PTR prod_threads[rip]
	cmp	DWORD PTR -132[rbp], eax
	jl	.L35
	mov	DWORD PTR -132[rbp], 0
	jmp	.L36
.L37:
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -132[rbp]
	movsx	rdx, edx
	mov	ecx, DWORD PTR -132[rbp]
	mov	DWORD PTR [rax+rdx*4], ecx
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -64[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -96[rbp]
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, consumer[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -132[rbp], 1
.L36:
	mov	eax, DWORD PTR cons_threads[rip]
	cmp	DWORD PTR -132[rbp], eax
	jl	.L37
	mov	DWORD PTR -132[rbp], 0
	jmp	.L38
.L39:
	mov	rax, QWORD PTR -112[rbp]
	mov	edx, DWORD PTR -132[rbp]
	movsx	rdx, edx
	mov	rax, QWORD PTR [rax+rdx*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -132[rbp], 1
.L38:
	mov	eax, DWORD PTR prod_threads[rip]
	cmp	DWORD PTR -132[rbp], eax
	jl	.L39
	mov	DWORD PTR -132[rbp], 0
	jmp	.L40
.L41:
	mov	rax, QWORD PTR -96[rbp]
	mov	edx, DWORD PTR -132[rbp]
	movsx	rdx, edx
	mov	rax, QWORD PTR [rax+rdx*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -132[rbp], 1
.L40:
	mov	eax, DWORD PTR cons_threads[rip]
	cmp	DWORD PTR -132[rbp], eax
	jl	.L41
	lea	rdi, buffer_mutex[rip]
	call	pthread_mutex_destroy@PLT
	lea	rdi, full[rip]
	call	sem_destroy@PLT
	lea	rdi, empty[rip]
	call	sem_destroy@PLT
	mov	rax, QWORD PTR total_prod[rip]
	mov	edx, DWORD PTR prod_threads[rip]
	movsx	rsi, edx
	cqo
	idiv	rsi
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR total_cons[rip]
	mov	edx, DWORD PTR cons_threads[rip]
	movsx	rsi, edx
	cqo
	idiv	rsi
	mov	rsi, rax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rsp, rbx
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L43
	call	__stack_chk_fail@PLT
.L43:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1079574528
	.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	"307924.c"
	.text
	.comm	capacity,4,4
	.comm	prod_threads,4,4
	.comm	cons_threads,4,4
	.comm	producer_loops,4,4
	.comm	consumer_loops,4,4
	.comm	avg1,4,4
	.comm	avg2,4,4
	.comm	buffer,4,4
	.comm	buffer_index,4,4
	.comm	buffer_mutex,24,4
	.comm	full,16,4
	.comm	empty,16,4
	.global	__aeabi_idiv
	.global	__aeabi_i2d
	.global	__aeabi_dmul
	.global	__aeabi_d2iz
	.align	2
	.global	ex
	.syntax unified
	.arm
	.fpu softvfp
	.type	ex, %function
ex:
	@ 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]
	bl	rand
	mov	r1, r0
	ldr	r3, .L3
	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
	mvn	r3, r2
	ldr	r1, [fp, #-16]
	mov	r0, r3
	bl	__aeabi_idiv
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r0, [fp, #-12]
	bl	__aeabi_i2d
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	exp
	mov	r2, #0
	ldr	r3, .L3+4
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	__aeabi_d2iz
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-8]
	bl	__aeabi_idiv
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	1717986919
	.word	1079574528
	.size	ex, .-ex
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Buffer overflow\000"
	.text
	.align	2
	.global	insertItem
	.syntax unified
	.arm
	.fpu softvfp
	.type	insertItem, %function
insertItem:
	@ 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, .L9
	ldr	r2, [r3]
	ldr	r3, .L9+4
	ldr	r3, [r3]
	cmp	r2, r3
	bge	.L6
	ldr	r3, .L9+8
	ldr	r2, [r3]
	ldr	r3, .L9
	ldr	r3, [r3]
	add	r1, r3, #1
	ldr	r0, .L9
	str	r1, [r0]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	b	.L8
.L6:
	ldr	r0, .L9+12
	bl	puts
.L8:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	buffer_index
	.word	capacity
	.word	buffer
	.word	.LC0
	.size	insertItem, .-insertItem
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Buffer underflow\000"
	.text
	.align	2
	.global	removeItem
	.syntax unified
	.arm
	.fpu softvfp
	.type	removeItem, %function
removeItem:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L14
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L12
	ldr	r3, .L14+4
	ldr	r2, [r3]
	ldr	r3, .L14
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r1, .L14
	str	r3, [r1]
	ldr	r3, .L14
	ldr	r3, [r3]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	b	.L13
.L12:
	ldr	r0, .L14+8
	bl	puts
	mov	r3, #0
.L13:
	mov	r0, r3
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	buffer_index
	.word	buffer
	.word	.LC1
	.size	removeItem, .-removeItem
	.global	total_prod
	.bss
	.align	3
	.type	total_prod, %object
	.size	total_prod, 8
total_prod:
	.space	8
	.comm	timevar,8,4
	.section	.rodata
	.align	2
.LC2:
	.ascii	"%dth item produced by thread %d at %s into buffer l"
	.ascii	"ocation %d, item is %d\012\000"
	.global	__aeabi_ldivmod
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	producer
	.syntax unified
	.arm
	.fpu softvfp
	.type	producer, %function
producer:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, fp, lr}
	add	fp, sp, #20
	sub	sp, sp, #64
	str	r0, [fp, #-72]
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	mov	r3,#0
	mov	r1, #0
	ldr	r0, .L21+4
	bl	gettimeofday
	ldr	r3, .L21+4
	ldr	r3, [r3, #4]
	mov	r2, r3
	asr	r3, r2, #31
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-72]
	ldr	r3, [r3]
	str	r3, [fp, #-56]
	mov	r3, #0
	str	r3, [fp, #-60]
	b	.L17
.L19:
	bl	rand
	mov	r2, r0
	ldr	r3, .L21+8
	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	r3, r2, r3
	str	r3, [fp, #-52]
	ldr	r0, .L21+12
	bl	pthread_mutex_lock
.L18:
	ldr	r0, .L21+12
	bl	pthread_mutex_unlock
	ldr	r0, .L21+16
	bl	sem_wait
	ldr	r0, .L21+12
	bl	pthread_mutex_lock
	ldr	r3, .L21+20
	ldr	r2, [r3]
	ldr	r3, .L21+24
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L18
	ldr	r0, [fp, #-52]
	bl	insertItem
	sub	r3, fp, #64
	mov	r0, r3
	bl	time
	sub	r3, fp, #64
	mov	r0, r3
	bl	localtime
	str	r0, [fp, #-48]
	ldr	r0, .L21+12
	bl	pthread_mutex_unlock
	ldr	r0, .L21+28
	bl	sem_post
	ldr	r0, [fp, #-48]
	bl	asctime
	mov	r1, r0
	ldr	r3, .L21+20
	ldr	r3, [r3]
	ldr	r2, [fp, #-52]
	str	r2, [sp, #4]
	str	r3, [sp]
	mov	r3, r1
	ldr	r2, [fp, #-56]
	ldr	r1, [fp, #-60]
	ldr	r0, .L21+32
	bl	printf
	ldr	r3, .L21+36
	ldr	r3, [r3]
	mov	r0, r3
	bl	ex
	mov	r3, r0
	mov	r0, r3
	bl	sleep
	ldr	r3, [fp, #-60]
	add	r3, r3, #1
	str	r3, [fp, #-60]
.L17:
	ldr	r3, .L21+40
	ldr	r3, [r3]
	ldr	r2, [fp, #-60]
	cmp	r2, r3
	blt	.L19
	mov	r1, #0
	ldr	r0, .L21+4
	bl	gettimeofday
	ldr	r3, .L21+4
	ldr	r3, [r3, #4]
	mov	r2, r3
	asr	r3, r2, #31
	str	r2, [fp, #-36]
	str	r3, [fp, #-32]
	sub	r1, fp, #36
	ldmia	r1, {r0-r1}
	sub	r3, fp, #44
	ldmia	r3, {r2-r3}
	subs	r6, r0, r2
	sbc	r7, r1, r3
	ldr	r3, .L21+40
	ldr	r3, [r3]
	mov	r2, r3
	asr	r3, r2, #31
	mov	r0, r6
	mov	r1, r7
	bl	__aeabi_ldivmod
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	ldr	r3, .L21+44
	ldmia	r3, {r2-r3}
	adds	r4, r0, r2
	adc	r5, r1, r3
	ldr	r3, .L21+44
	stm	r3, {r4-r5}
	mov	r0, #0
	bl	pthread_exit
.L22:
	.align	2
.L21:
	.word	.LC3
	.word	timevar
	.word	1374389535
	.word	buffer_mutex
	.word	full
	.word	buffer_index
	.word	capacity
	.word	empty
	.word	.LC2
	.word	avg1
	.word	producer_loops
	.word	total_prod
	.size	producer, .-producer
	.global	total_cons
	.bss
	.align	3
	.type	total_cons, %object
	.size	total_cons, 8
total_cons:
	.space	8
	.section	.rodata
	.align	2
.LC4:
	.ascii	"%dth item read from buffer by thread %d at %s from "
	.ascii	"buffer location %d, item is %d\012\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	consumer
	.syntax unified
	.arm
	.fpu softvfp
	.type	consumer, %function
consumer:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, fp, lr}
	add	fp, sp, #20
	sub	sp, sp, #64
	str	r0, [fp, #-72]
	ldr	r3, .L28
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	mov	r3,#0
	mov	r1, #0
	ldr	r0, .L28+4
	bl	gettimeofday
	ldr	r3, .L28+4
	ldr	r3, [r3, #4]
	mov	r2, r3
	asr	r3, r2, #31
	str	r2, [fp, #-44]
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-72]
	ldr	r3, [r3]
	str	r3, [fp, #-52]
	mov	r3, #0
	str	r3, [fp, #-56]
	b	.L24
.L26:
	ldr	r0, .L28+8
	bl	pthread_mutex_lock
.L25:
	ldr	r0, .L28+8
	bl	pthread_mutex_unlock
	ldr	r0, .L28+12
	bl	sem_wait
	ldr	r0, .L28+8
	bl	pthread_mutex_lock
	ldr	r3, .L28+16
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L25
	ldr	r0, [fp, #-60]
	bl	removeItem
	str	r0, [fp, #-60]
	sub	r3, fp, #64
	mov	r0, r3
	bl	time
	sub	r3, fp, #64
	mov	r0, r3
	bl	localtime
	str	r0, [fp, #-48]
	ldr	r0, .L28+8
	bl	pthread_mutex_unlock
	ldr	r0, .L28+20
	bl	sem_post
	ldr	r0, [fp, #-48]
	bl	asctime
	mov	r1, r0
	ldr	r3, .L28+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-60]
	str	r2, [sp, #4]
	str	r3, [sp]
	mov	r3, r1
	ldr	r2, [fp, #-52]
	ldr	r1, [fp, #-56]
	ldr	r0, .L28+24
	bl	printf
	ldr	r3, .L28+28
	ldr	r3, [r3]
	mov	r0, r3
	bl	ex
	mov	r3, r0
	mov	r0, r3
	bl	sleep
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
.L24:
	ldr	r3, .L28+32
	ldr	r3, [r3]
	ldr	r2, [fp, #-56]
	cmp	r2, r3
	blt	.L26
	mov	r1, #0
	ldr	r0, .L28+4
	bl	gettimeofday
	ldr	r3, .L28+4
	ldr	r3, [r3, #4]
	mov	r2, r3
	asr	r3, r2, #31
	str	r2, [fp, #-36]
	str	r3, [fp, #-32]
	sub	r1, fp, #36
	ldmia	r1, {r0-r1}
	sub	r3, fp, #44
	ldmia	r3, {r2-r3}
	subs	r6, r0, r2
	sbc	r7, r1, r3
	ldr	r3, .L28+32
	ldr	r3, [r3]
	mov	r2, r3
	asr	r3, r2, #31
	mov	r0, r6
	mov	r1, r7
	bl	__aeabi_ldivmod
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	ldr	r3, .L28+36
	ldmia	r3, {r2-r3}
	adds	r4, r0, r2
	adc	r5, r1, r3
	ldr	r3, .L28+36
	stm	r3, {r4-r5}
	mov	r0, #0
	bl	pthread_exit
.L29:
	.align	2
.L28:
	.word	.LC5
	.word	timevar
	.word	buffer_mutex
	.word	empty
	.word	buffer_index
	.word	full
	.word	.LC4
	.word	avg2
	.word	consumer_loops
	.word	total_cons
	.size	consumer, .-consumer
	.section	.rodata
	.align	2
.LC6:
	.ascii	"r\000"
	.align	2
.LC7:
	.ascii	"input.txt\000"
	.align	2
.LC8:
	.ascii	"error in opening the file\000"
	.align	2
.LC9:
	.ascii	"%d %d %d %d %d %d %d\000"
	.align	2
.LC10:
	.ascii	"avg time taken by producer thread is %lld usec\012\000"
	.align	2
.LC11:
	.ascii	"avg time taken by consumer thread is %lld usec\012\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #84
	str	r0, [fp, #-64]
	str	r1, [fp, #-68]
	ldr	r3, .L42
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r4, r3
	ldr	r3, .L42+4
	mov	r2, #0
	str	r2, [r3]
	ldr	r1, .L42+8
	ldr	r0, .L42+12
	bl	fopen
	str	r0, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L31
	ldr	r0, .L42+16
	bl	puts
	mvn	r0, #0
	bl	exit
.L31:
	ldr	r3, .L42+20
	str	r3, [sp, #16]
	ldr	r3, .L42+24
	str	r3, [sp, #12]
	ldr	r3, .L42+28
	str	r3, [sp, #8]
	ldr	r3, .L42+32
	str	r3, [sp, #4]
	ldr	r3, .L42+36
	str	r3, [sp]
	ldr	r3, .L42+40
	ldr	r2, .L42+44
	ldr	r1, .L42+48
	ldr	r0, [fp, #-56]
	bl	__isoc99_fscanf
	ldr	r3, .L42+44
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L42+52
	str	r2, [r3]
	mov	r1, #0
	ldr	r0, .L42+56
	bl	pthread_mutex_init
	ldr	r3, .L42+44
	ldr	r3, [r3]
	mov	r2, r3
	mov	r1, #0
	ldr	r0, .L42+60
	bl	sem_init
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L42+64
	bl	sem_init
	ldr	r3, .L42+40
	ldr	ip, [r3]
	sub	r3, ip, #1
	str	r3, [fp, #-48]
	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
	add	r3, sp, #24
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-44]
	ldr	r3, .L42+32
	ldr	ip, [r3]
	sub	r3, ip, #1
	str	r3, [fp, #-40]
	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
	add	r3, sp, #24
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-36]
	ldr	r3, .L42+40
	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
	add	r3, sp, #24
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-28]
	ldr	r3, .L42+32
	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
	add	r3, sp, #24
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L32
.L33:
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-52]
	ldr	r1, [fp, #-52]
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-44]
	add	r0, r2, r3
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r2, .L42+68
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L32:
	ldr	r3, .L42+40
	ldr	r3, [r3]
	ldr	r2, [fp, #-52]
	cmp	r2, r3
	blt	.L33
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L34
.L35:
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-52]
	ldr	r1, [fp, #-52]
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r0, r2, r3
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, .L42+72
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L34:
	ldr	r3, .L42+32
	ldr	r3, [r3]
	ldr	r2, [fp, #-52]
	cmp	r2, r3
	blt	.L35
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L36
.L37:
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-52]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L36:
	ldr	r3, .L42+40
	ldr	r3, [r3]
	ldr	r2, [fp, #-52]
	cmp	r2, r3
	blt	.L37
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L38
.L39:
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-52]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L38:
	ldr	r3, .L42+32
	ldr	r3, [r3]
	ldr	r2, [fp, #-52]
	cmp	r2, r3
	blt	.L39
	ldr	r0, .L42+56
	bl	pthread_mutex_destroy
	ldr	r0, .L42+60
	bl	sem_destroy
	ldr	r0, .L42+64
	bl	sem_destroy
	ldr	r3, .L42+76
	ldmia	r3, {r0-r1}
	ldr	r3, .L42+40
	ldr	r3, [r3]
	mov	r2, r3
	asr	r3, r2, #31
	bl	__aeabi_ldivmod
	mov	r2, r0
	mov	r3, r1
	ldr	r0, .L42+80
	bl	printf
	ldr	r3, .L42+84
	ldmia	r3, {r0-r1}
	ldr	r3, .L42+32
	ldr	r3, [r3]
	mov	r2, r3
	asr	r3, r2, #31
	bl	__aeabi_ldivmod
	mov	r2, r0
	mov	r3, r1
	ldr	r0, .L42+88
	bl	printf
	mov	r3, #0
	mov	sp, r4
	ldr	r2, .L42
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L41
	bl	__stack_chk_fail
.L41:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L43:
	.align	2
.L42:
	.word	.LC12
	.word	buffer_index
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	avg2
	.word	avg1
	.word	consumer_loops
	.word	cons_threads
	.word	producer_loops
	.word	prod_threads
	.word	capacity
	.word	.LC9
	.word	buffer
	.word	buffer_mutex
	.word	full
	.word	empty
	.word	producer
	.word	consumer
	.word	total_prod
	.word	.LC10
	.word	total_cons
	.word	.LC11
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
