	.file	"415993.c"
	.intel_syntax noprefix
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	P
	.align 4
	.type	P, @object
	.size	P, 4
P:
	.zero	4
	.globl	C
	.align 4
	.type	C, @object
	.size	C, 4
C:
	.zero	4
	.globl	X
	.align 4
	.type	X, @object
	.size	X, 4
X:
	.zero	4
	.globl	PTime
	.align 4
	.type	PTime, @object
	.size	PTime, 4
PTime:
	.zero	4
	.globl	CTime
	.align 4
	.type	CTime, @object
	.size	CTime, 4
CTime:
	.zero	4
	.globl	CX
	.align 4
	.type	CX, @object
	.size	CX, 4
CX:
	.zero	4
	.globl	extra
	.align 4
	.type	extra, @object
	.size	extra, 4
extra:
	.zero	4
	.globl	distribution
	.align 4
	.type	distribution, @object
	.size	distribution, 4
distribution:
	.zero	4
	.globl	overconsumed
	.align 4
	.type	overconsumed, @object
	.size	overconsumed, 4
overconsumed:
	.zero	4
	.globl	buffer
	.align 8
	.type	buffer, @object
	.size	buffer, 8
buffer:
	.zero	8
	.globl	pArray
	.align 8
	.type	pArray, @object
	.size	pArray, 8
pArray:
	.zero	8
	.globl	cArray
	.align 8
	.type	cArray, @object
	.size	cArray, 8
cArray:
	.zero	8
	.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
	.globl	lock
	.align 32
	.type	lock, @object
	.size	lock, 40
lock:
	.zero	40
	.globl	newLock
	.align 32
	.type	newLock, @object
	.size	newLock, 40
newLock:
	.zero	40
	.globl	in
	.align 4
	.type	in, @object
	.size	in, 4
in:
	.zero	4
	.globl	out
	.align 4
	.type	out, @object
	.size	out, 4
out:
	.zero	4
	.globl	pIndex
	.align 4
	.type	pIndex, @object
	.size	pIndex, 4
pIndex:
	.zero	4
	.globl	cIndex
	.align 4
	.type	cIndex, @object
	.size	cIndex, 4
cIndex:
	.zero	4
	.globl	items
	.align 4
	.type	items, @object
	.size	items, 4
items:
	.zero	4
	.text
	.globl	dequeue_item
	.type	dequeue_item, @function
dequeue_item:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	rdx, QWORD PTR buffer[rip]
	mov	eax, DWORD PTR out[rip]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR out[rip]
	add	eax, 1
	mov	ecx, DWORD PTR N[rip]
	cdq
	idiv	ecx
	mov	eax, edx
	mov	DWORD PTR out[rip], eax
	mov	eax, DWORD PTR -4[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	dequeue_item, .-dequeue_item
	.globl	enqueue_item
	.type	enqueue_item, @function
enqueue_item:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -4[rbp], edi
	mov	rdx, QWORD PTR buffer[rip]
	mov	eax, DWORD PTR in[rip]
	cdqe
	sal	rax, 2
	add	rdx, rax
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR in[rip]
	add	eax, 1
	mov	ecx, DWORD PTR N[rip]
	cdq
	idiv	ecx
	mov	eax, edx
	mov	DWORD PTR in[rip], eax
	mov	eax, DWORD PTR -4[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	enqueue_item, .-enqueue_item
	.section	.rodata
	.align 8
.LC0:
	.string	"%d was produced by producer-> %d\n"
.LC1:
	.string	"Something went wrong..."
	.text
	.globl	producer
	.type	producer, @function
producer:
.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	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	DWORD PTR -12[rbp], 0
	jmp	.L6
.L8:
	lea	rdi, empty[rip]
	call	sem_wait@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR items[rip]
	add	eax, 1
	mov	DWORD PTR items[rip], eax
	mov	rcx, QWORD PTR pArray[rip]
	mov	eax, DWORD PTR pIndex[rip]
	lea	edx, 1[rax]
	mov	DWORD PTR pIndex[rip], edx
	cdqe
	sal	rax, 2
	lea	rdx, [rcx+rax]
	mov	eax, DWORD PTR items[rip]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR 8[rax]
	mov	eax, DWORD PTR items[rip]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR items[rip]
	mov	edi, eax
	call	enqueue_item
	test	eax, eax
	jne	.L7
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L7:
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	lea	rdi, full[rip]
	call	sem_post@PLT
	mov	eax, DWORD PTR PTime[rip]
	mov	edi, eax
	call	sleep@PLT
	add	DWORD PTR -12[rbp], 1
.L6:
	mov	eax, DWORD PTR X[rip]
	cmp	DWORD PTR -12[rbp], eax
	jl	.L8
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	producer, .-producer
	.section	.rodata
	.align 8
.LC2:
	.string	"%d was consumed by consumer-> %d\n"
	.text
	.globl	consumer
	.type	consumer, @function
consumer:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	eax, DWORD PTR distribution[rip]
	test	eax, eax
	je	.L10
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 8[rax]
	cmp	eax, 1
	jne	.L10
	mov	DWORD PTR -24[rbp], 0
	jmp	.L11
.L12:
	lea	rdi, full[rip]
	call	sem_wait@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, 0
	call	dequeue_item
	mov	DWORD PTR -16[rbp], eax
	lea	rdi, newLock[rip]
	call	pthread_mutex_lock@PLT
	mov	rcx, QWORD PTR cArray[rip]
	mov	eax, DWORD PTR cIndex[rip]
	lea	edx, 1[rax]
	mov	DWORD PTR cIndex[rip], edx
	cdqe
	sal	rax, 2
	lea	rdx, [rcx+rax]
	mov	eax, DWORD PTR -16[rbp]
	mov	DWORD PTR [rdx], eax
	lea	rdi, newLock[rip]
	call	pthread_mutex_unlock@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR 8[rax]
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	lea	rdi, empty[rip]
	call	sem_post@PLT
	mov	eax, DWORD PTR CTime[rip]
	mov	edi, eax
	call	sleep@PLT
	add	DWORD PTR -24[rbp], 1
.L11:
	mov	eax, DWORD PTR overconsumed[rip]
	cmp	DWORD PTR -24[rbp], eax
	jl	.L12
	jmp	.L13
.L10:
	mov	DWORD PTR -20[rbp], 0
	jmp	.L14
.L15:
	lea	rdi, full[rip]
	call	sem_wait@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, 0
	call	dequeue_item
	mov	DWORD PTR -12[rbp], eax
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	lea	rdi, empty[rip]
	call	sem_post@PLT
	lea	rdi, newLock[rip]
	call	pthread_mutex_lock@PLT
	mov	rcx, QWORD PTR cArray[rip]
	mov	eax, DWORD PTR cIndex[rip]
	lea	edx, 1[rax]
	mov	DWORD PTR cIndex[rip], edx
	cdqe
	sal	rax, 2
	lea	rdx, [rcx+rax]
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR [rdx], eax
	lea	rdi, newLock[rip]
	call	pthread_mutex_unlock@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR 8[rax]
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR CTime[rip]
	mov	edi, eax
	call	sleep@PLT
	add	DWORD PTR -20[rbp], 1
.L14:
	mov	eax, DWORD PTR CX[rip]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L15
.L13:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	consumer, .-consumer
	.globl	compare
	.type	compare, @function
compare:
.LFB10:
	.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
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	ecx, DWORD PTR [rax]
	mov	eax, edx
	sub	eax, ecx
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	compare, .-compare
	.section	.rodata
.LC3:
	.string	"Consumer Array"
.LC4:
	.string	"|"
.LC5:
	.string	"Producer Array"
.LC6:
	.string	"%-15s%-4s%-4s\n"
.LC7:
	.string	"%-15d%-4s%-4d\n"
	.align 8
.LC8:
	.string	"\nConsumer and Producer Arrays Match!"
	.align 8
.LC9:
	.string	"\nConsumer and Producer Arrays Do Not Match!"
	.text
	.globl	print
	.type	print, @function
print:
.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, 16
	mov	edx, DWORD PTR P[rip]
	mov	eax, DWORD PTR X[rip]
	imul	eax, edx
	mov	DWORD PTR -4[rbp], eax
	mov	DWORD PTR -16[rbp], 1
	lea	rcx, .LC3[rip]
	lea	rdx, .LC4[rip]
	lea	rsi, .LC5[rip]
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -12[rbp], 0
	jmp	.L19
.L20:
	mov	rdx, QWORD PTR cArray[rip]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	rcx, QWORD PTR pArray[rip]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	mov	ecx, edx
	lea	rdx, .LC4[rip]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -12[rbp], 1
.L19:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -4[rbp]
	jl	.L20
	mov	DWORD PTR -8[rbp], 0
	jmp	.L21
.L24:
	mov	rdx, QWORD PTR pArray[rip]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	rcx, QWORD PTR cArray[rip]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	je	.L22
	mov	DWORD PTR -16[rbp], 0
	jmp	.L23
.L22:
	add	DWORD PTR -8[rbp], 1
.L21:
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -4[rbp]
	jl	.L24
.L23:
	cmp	DWORD PTR -16[rbp], 0
	je	.L25
	lea	rdi, .LC8[rip]
	call	puts@PLT
	jmp	.L27
.L25:
	lea	rdi, .LC9[rip]
	call	puts@PLT
.L27:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	print, .-print
	.section	.rodata
.LC10:
	.string	"Current Time: %s"
.LC11:
	.string	"Insufficient arguments"
	.align 8
.LC12:
	.string	"Arguments must be greater than zero"
.LC13:
	.string	"Number of Buffers:"
.LC14:
	.string	"%42s %4d\n"
.LC15:
	.string	"Number of Producers:"
.LC16:
	.string	"Number of Consumers:"
	.align 8
.LC17:
	.string	"Number of items Produced by each producer:"
	.align 8
.LC18:
	.string	"Number of items consumed by each consumer:"
.LC19:
	.string	"Over consume on?:"
.LC20:
	.string	"Over consume amount:"
	.align 8
.LC21:
	.string	"Time each Producer Sleeps (seconds):"
	.align 8
.LC22:
	.string	"Time each Consumer Sleeps (seconds):"
.LC23:
	.string	"Error initializing semaphore"
.LC24:
	.string	"Cannot initialize mutex"
.LC25:
	.string	"Error Creating Thread.."
.LC26:
	.string	"Error joining Threads"
.LC27:
	.string	"Producer Thread joined: %d\n"
.LC28:
	.string	"Consumer Thread joined: %d\n"
.LC29:
	.string	"Total Runtime: %f secs.\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB12:
	.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, 136
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	DWORD PTR -132[rbp], edi
	mov	QWORD PTR -144[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	rbx, rax
	mov	edi, 0
	call	time@PLT
	mov	QWORD PTR -104[rbp], rax
	lea	rax, -104[rbp]
	mov	rdi, rax
	call	ctime@PLT
	mov	rsi, rax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	DWORD PTR -132[rbp], 7
	je	.L29
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L30
.L29:
	mov	rax, QWORD PTR -144[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR N[rip], eax
	mov	rax, QWORD PTR -144[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR P[rip], eax
	mov	rax, QWORD PTR -144[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR C[rip], eax
	mov	rax, QWORD PTR -144[rbp]
	add	rax, 32
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR X[rip], eax
	mov	rax, QWORD PTR -144[rbp]
	add	rax, 40
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR PTime[rip], eax
	mov	rax, QWORD PTR -144[rbp]
	add	rax, 48
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR CTime[rip], eax
	mov	eax, DWORD PTR N[rip]
	test	eax, eax
	jle	.L31
	mov	eax, DWORD PTR P[rip]
	test	eax, eax
	jle	.L31
	mov	eax, DWORD PTR C[rip]
	test	eax, eax
	jle	.L31
	mov	eax, DWORD PTR X[rip]
	test	eax, eax
	jg	.L32
.L31:
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L30
.L32:
	mov	edx, DWORD PTR X[rip]
	mov	eax, DWORD PTR P[rip]
	imul	eax, edx
	mov	ecx, DWORD PTR C[rip]
	cdq
	idiv	ecx
	mov	DWORD PTR CX[rip], eax
	mov	DWORD PTR extra[rip], 0
	mov	edx, DWORD PTR X[rip]
	mov	eax, DWORD PTR P[rip]
	imul	eax, edx
	mov	ecx, DWORD PTR C[rip]
	cdq
	idiv	ecx
	mov	eax, edx
	mov	DWORD PTR distribution[rip], eax
	mov	eax, DWORD PTR distribution[rip]
	test	eax, eax
	je	.L33
	mov	DWORD PTR extra[rip], 1
	mov	edx, DWORD PTR CX[rip]
	mov	eax, DWORD PTR distribution[rip]
	add	eax, edx
	mov	DWORD PTR overconsumed[rip], eax
	jmp	.L34
.L33:
	mov	DWORD PTR overconsumed[rip], 0
.L34:
	mov	edi, 10
	call	putchar@PLT
	mov	eax, DWORD PTR N[rip]
	mov	edx, eax
	lea	rsi, .LC13[rip]
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR P[rip]
	mov	edx, eax
	lea	rsi, .LC15[rip]
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR C[rip]
	mov	edx, eax
	lea	rsi, .LC16[rip]
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR X[rip]
	mov	edx, eax
	lea	rsi, .LC17[rip]
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR CX[rip]
	mov	edx, eax
	lea	rsi, .LC18[rip]
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR extra[rip]
	mov	edx, eax
	lea	rsi, .LC19[rip]
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR overconsumed[rip]
	mov	edx, eax
	lea	rsi, .LC20[rip]
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR PTime[rip]
	mov	edx, eax
	lea	rsi, .LC21[rip]
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR CTime[rip]
	mov	edx, eax
	lea	rsi, .LC22[rip]
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 10
	call	putchar@PLT
	mov	eax, DWORD PTR N[rip]
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR buffer[rip], rax
	mov	eax, DWORD PTR P[rip]
	movsx	rdx, eax
	mov	eax, DWORD PTR X[rip]
	cdqe
	imul	rax, rdx
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR pArray[rip], rax
	mov	eax, DWORD PTR P[rip]
	movsx	rdx, eax
	mov	eax, DWORD PTR X[rip]
	cdqe
	imul	rax, rdx
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR cArray[rip], rax
	mov	edx, 0
	mov	esi, 0
	lea	rdi, full[rip]
	call	sem_init@PLT
	test	eax, eax
	jns	.L35
	lea	rdi, .LC23[rip]
	call	puts@PLT
.L35:
	mov	eax, DWORD PTR N[rip]
	mov	edx, eax
	mov	esi, 0
	lea	rdi, empty[rip]
	call	sem_init@PLT
	test	eax, eax
	jns	.L36
	lea	rdi, .LC23[rip]
	call	puts@PLT
.L36:
	mov	eax, DWORD PTR P[rip]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -88[rbp], rdx
	movsx	rdx, eax
	mov	QWORD PTR -160[rbp], rdx
	mov	QWORD PTR -152[rbp], 0
	movsx	rdx, eax
	mov	QWORD PTR -176[rbp], rdx
	mov	QWORD PTR -168[rbp], 0
	cdqe
	sal	rax, 4
	mov	rdx, rax
	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
.L37:
	cmp	rsp, rdx
	je	.L38
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L37
.L38:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L39
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L39:
	mov	rax, rsp
	add	rax, 7
	shr	rax, 3
	sal	rax, 3
	mov	QWORD PTR -80[rbp], rax
	mov	eax, DWORD PTR C[rip]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -72[rbp], rdx
	movsx	rdx, eax
	mov	r14, rdx
	mov	r15d, 0
	movsx	rdx, eax
	mov	r12, rdx
	mov	r13d, 0
	cdqe
	sal	rax, 4
	mov	rdx, rax
	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
.L40:
	cmp	rsp, rdx
	je	.L41
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L40
.L41:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L42
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L42:
	mov	rax, rsp
	add	rax, 7
	shr	rax, 3
	sal	rax, 3
	mov	QWORD PTR -64[rbp], rax
	mov	esi, 0
	lea	rdi, lock[rip]
	call	pthread_mutex_init@PLT
	test	eax, eax
	je	.L43
	lea	rdi, .LC24[rip]
	call	puts@PLT
.L43:
	mov	esi, 0
	lea	rdi, newLock[rip]
	call	pthread_mutex_init@PLT
	test	eax, eax
	je	.L44
	lea	rdi, .LC24[rip]
	call	puts@PLT
.L44:
	mov	DWORD PTR -112[rbp], 0
	jmp	.L45
.L47:
	mov	eax, DWORD PTR -112[rbp]
	lea	edx, 1[rax]
	mov	rcx, QWORD PTR -80[rbp]
	mov	eax, DWORD PTR -112[rbp]
	cdqe
	sal	rax, 4
	add	rax, rcx
	add	rax, 8
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -112[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -80[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -112[rbp]
	cdqe
	sal	rax, 4
	mov	rcx, rax
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, producer[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	jns	.L46
	lea	rdi, .LC25[rip]
	call	puts@PLT
.L46:
	add	DWORD PTR -112[rbp], 1
.L45:
	mov	eax, DWORD PTR P[rip]
	cmp	DWORD PTR -112[rbp], eax
	jl	.L47
	mov	DWORD PTR -116[rbp], 0
	jmp	.L48
.L50:
	mov	eax, DWORD PTR -116[rbp]
	lea	edx, 1[rax]
	mov	rcx, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR -116[rbp]
	cdqe
	sal	rax, 4
	add	rax, rcx
	add	rax, 8
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -116[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -64[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -116[rbp]
	cdqe
	sal	rax, 4
	mov	rcx, rax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, consumer[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	test	eax, eax
	jns	.L49
	lea	rdi, .LC25[rip]
	call	puts@PLT
.L49:
	add	DWORD PTR -116[rbp], 1
.L48:
	mov	eax, DWORD PTR C[rip]
	cmp	DWORD PTR -116[rbp], eax
	jl	.L50
	mov	DWORD PTR -120[rbp], 0
	jmp	.L51
.L53:
	mov	rdx, QWORD PTR -80[rbp]
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	sal	rax, 4
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	test	eax, eax
	je	.L52
	lea	rdi, .LC26[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L52:
	mov	eax, DWORD PTR -120[rbp]
	add	eax, 1
	mov	esi, eax
	lea	rdi, .LC27[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -120[rbp], 1
.L51:
	mov	eax, DWORD PTR P[rip]
	cmp	DWORD PTR -120[rbp], eax
	jl	.L53
	mov	DWORD PTR -124[rbp], 0
	jmp	.L54
.L56:
	mov	rdx, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR -124[rbp]
	cdqe
	sal	rax, 4
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	test	eax, eax
	je	.L55
	lea	rdi, .LC26[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L55:
	mov	eax, DWORD PTR -124[rbp]
	add	eax, 1
	mov	esi, eax
	lea	rdi, .LC28[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -124[rbp], 1
.L54:
	mov	eax, DWORD PTR C[rip]
	cmp	DWORD PTR -124[rbp], eax
	jl	.L56
	mov	edi, 0
	call	time@PLT
	mov	QWORD PTR -96[rbp], rax
	lea	rax, -96[rbp]
	mov	rdi, rax
	call	ctime@PLT
	mov	rsi, rax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, DWORD PTR P[rip]
	mov	eax, DWORD PTR X[rip]
	imul	eax, edx
	mov	DWORD PTR -108[rbp], eax
	mov	eax, DWORD PTR -108[rbp]
	movsx	rsi, eax
	mov	rax, QWORD PTR pArray[rip]
	lea	rcx, compare[rip]
	mov	edx, 4
	mov	rdi, rax
	call	qsort@PLT
	mov	eax, DWORD PTR -108[rbp]
	movsx	rsi, eax
	mov	rax, QWORD PTR cArray[rip]
	lea	rcx, compare[rip]
	mov	edx, 4
	mov	rdi, rax
	call	qsort@PLT
	mov	edi, 10
	call	putchar@PLT
	mov	eax, 0
	call	print
	mov	edi, 10
	call	putchar@PLT
	mov	rdx, QWORD PTR -104[rbp]
	mov	rax, QWORD PTR -96[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	difftime@PLT
	movq	rax, xmm0
	movq	xmm0, rax
	lea	rdi, .LC29[rip]
	mov	eax, 1
	call	printf@PLT
	lea	rdi, lock[rip]
	call	pthread_mutex_destroy@PLT
	mov	rax, QWORD PTR buffer[rip]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR pArray[rip]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR cArray[rip]
	mov	rdi, rax
	call	free@PLT
	lea	rdi, full[rip]
	call	sem_destroy@PLT
	lea	rdi, empty[rip]
	call	sem_destroy@PLT
	mov	rsp, rbx
	mov	eax, 0
	jmp	.L57
.L30:
	mov	rsp, rbx
.L57:
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L58
	call	__stack_chk_fail@PLT
.L58:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.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	"415993.c"
	.text
	.comm	N,4,4
	.comm	P,4,4
	.comm	C,4,4
	.comm	X,4,4
	.comm	PTime,4,4
	.comm	CTime,4,4
	.comm	CX,4,4
	.comm	extra,4,4
	.comm	distribution,4,4
	.comm	overconsumed,4,4
	.comm	buffer,4,4
	.comm	pArray,4,4
	.comm	cArray,4,4
	.comm	full,16,4
	.comm	empty,16,4
	.comm	lock,24,4
	.comm	newLock,24,4
	.global	in
	.bss
	.align	2
	.type	in, %object
	.size	in, 4
in:
	.space	4
	.global	out
	.align	2
	.type	out, %object
	.size	out, 4
out:
	.space	4
	.global	pIndex
	.align	2
	.type	pIndex, %object
	.size	pIndex, 4
pIndex:
	.space	4
	.global	cIndex
	.align	2
	.type	cIndex, %object
	.size	cIndex, 4
cIndex:
	.space	4
	.global	items
	.align	2
	.type	items, %object
	.size	items, 4
items:
	.space	4
	.global	__aeabi_idivmod
	.text
	.align	2
	.global	dequeue_item
	.syntax unified
	.arm
	.fpu softvfp
	.type	dequeue_item, %function
dequeue_item:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r3, .L3
	ldr	r2, [r3]
	ldr	r3, .L3+4
	ldr	r3, [r3]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, .L3+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L3+8
	ldr	r2, [r2]
	mov	r1, r2
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	mov	r2, r3
	ldr	r3, .L3+4
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	buffer
	.word	out
	.word	N
	.size	dequeue_item, .-dequeue_item
	.align	2
	.global	enqueue_item
	.syntax unified
	.arm
	.fpu softvfp
	.type	enqueue_item, %function
enqueue_item:
	@ 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, .L7
	ldr	r2, [r3]
	ldr	r3, .L7+4
	ldr	r3, [r3]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	ldr	r3, .L7+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L7+8
	ldr	r2, [r2]
	mov	r1, r2
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	mov	r2, r3
	ldr	r3, .L7+4
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	buffer
	.word	in
	.word	N
	.size	enqueue_item, .-enqueue_item
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%d was produced by producer-> %d\012\000"
	.align	2
.LC1:
	.ascii	"Something went wrong...\000"
	.text
	.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]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L10
.L12:
	ldr	r0, .L13
	bl	sem_wait
	ldr	r0, .L13+4
	bl	pthread_mutex_lock
	ldr	r3, .L13+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L13+8
	str	r3, [r2]
	ldr	r3, .L13+12
	ldr	r2, [r3]
	ldr	r3, .L13+16
	ldr	r3, [r3]
	add	r1, r3, #1
	ldr	r0, .L13+16
	str	r1, [r0]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, .L13+8
	ldr	r2, [r2]
	str	r2, [r3]
	ldr	r3, .L13+8
	ldr	r1, [r3]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r0, .L13+20
	bl	printf
	ldr	r3, .L13+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	enqueue_item
	mov	r3, r0
	cmp	r3, #0
	bne	.L11
	ldr	r0, .L13+24
	bl	puts
	mov	r0, #0
	bl	exit
.L11:
	ldr	r0, .L13+4
	bl	pthread_mutex_unlock
	ldr	r0, .L13+28
	bl	sem_post
	ldr	r3, .L13+32
	ldr	r3, [r3]
	mov	r0, r3
	bl	sleep
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L10:
	ldr	r3, .L13+36
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L12
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	empty
	.word	lock
	.word	items
	.word	pArray
	.word	pIndex
	.word	.LC0
	.word	.LC1
	.word	full
	.word	PTime
	.word	X
	.size	producer, .-producer
	.section	.rodata
	.align	2
.LC2:
	.ascii	"%d was consumed by consumer-> %d\012\000"
	.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, #-32]
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-16]
	ldr	r3, .L22
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L16
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	cmp	r3, #1
	bne	.L16
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L17
.L18:
	ldr	r0, .L22+4
	bl	sem_wait
	ldr	r0, .L22+8
	bl	pthread_mutex_lock
	bl	dequeue_item
	str	r0, [fp, #-12]
	ldr	r0, .L22+12
	bl	pthread_mutex_lock
	ldr	r3, .L22+16
	ldr	r2, [r3]
	ldr	r3, .L22+20
	ldr	r3, [r3]
	add	r1, r3, #1
	ldr	r0, .L22+20
	str	r1, [r0]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [fp, #-12]
	str	r2, [r3]
	ldr	r0, .L22+12
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r1, [fp, #-12]
	ldr	r0, .L22+24
	bl	printf
	ldr	r0, .L22+8
	bl	pthread_mutex_unlock
	ldr	r0, .L22+28
	bl	sem_post
	ldr	r3, .L22+32
	ldr	r3, [r3]
	mov	r0, r3
	bl	sleep
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L17:
	ldr	r3, .L22+36
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L18
	b	.L19
.L16:
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L20
.L21:
	ldr	r0, .L22+4
	bl	sem_wait
	ldr	r0, .L22+8
	bl	pthread_mutex_lock
	bl	dequeue_item
	str	r0, [fp, #-8]
	ldr	r0, .L22+8
	bl	pthread_mutex_unlock
	ldr	r0, .L22+28
	bl	sem_post
	ldr	r0, .L22+12
	bl	pthread_mutex_lock
	ldr	r3, .L22+16
	ldr	r2, [r3]
	ldr	r3, .L22+20
	ldr	r3, [r3]
	add	r1, r3, #1
	ldr	r0, .L22+20
	str	r1, [r0]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	ldr	r0, .L22+12
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r1, [fp, #-8]
	ldr	r0, .L22+24
	bl	printf
	ldr	r3, .L22+32
	ldr	r3, [r3]
	mov	r0, r3
	bl	sleep
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L20:
	ldr	r3, .L22+40
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L21
.L19:
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	distribution
	.word	full
	.word	lock
	.word	newLock
	.word	cArray
	.word	cIndex
	.word	.LC2
	.word	empty
	.word	CTime
	.word	overconsumed
	.word	CX
	.size	consumer, .-consumer
	.align	2
	.global	compare
	.syntax unified
	.arm
	.fpu softvfp
	.type	compare, %function
compare:
	@ 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]
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	sub	r3, r2, r3
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	compare, .-compare
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Consumer Array\000"
	.align	2
.LC4:
	.ascii	"|\000"
	.align	2
.LC5:
	.ascii	"Producer Array\000"
	.align	2
.LC6:
	.ascii	"%-15s%-4s%-4s\012\000"
	.align	2
.LC7:
	.ascii	"%-15d%-4s%-4d\012\000"
	.align	2
.LC8:
	.ascii	"\012Consumer and Producer Arrays Match!\000"
	.align	2
.LC9:
	.ascii	"\012Consumer and Producer Arrays Do Not Match!\000"
	.text
	.align	2
	.global	print
	.syntax unified
	.arm
	.fpu softvfp
	.type	print, %function
print:
	@ 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, .L36
	ldr	r3, [r3]
	ldr	r2, .L36+4
	ldr	r2, [r2]
	mul	r3, r2, r3
	str	r3, [fp, #-8]
	mov	r3, #1
	str	r3, [fp, #-20]
	ldr	r3, .L36+8
	ldr	r2, .L36+12
	ldr	r1, .L36+16
	ldr	r0, .L36+20
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L27
.L28:
	ldr	r3, .L36+24
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, .L36+28
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, .L36+12
	ldr	r0, .L36+32
	bl	printf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L27:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	blt	.L28
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L29
.L32:
	ldr	r3, .L36+24
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, .L36+28
	ldr	r1, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L30
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L31
.L30:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L29:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	blt	.L32
.L31:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L33
	ldr	r0, .L36+36
	bl	puts
	b	.L35
.L33:
	ldr	r0, .L36+40
	bl	puts
.L35:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L37:
	.align	2
.L36:
	.word	P
	.word	X
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	pArray
	.word	cArray
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	print, .-print
	.section	.rodata
	.align	2
.LC10:
	.ascii	"Current Time: %s\000"
	.align	2
.LC11:
	.ascii	"Insufficient arguments\000"
	.align	2
.LC12:
	.ascii	"Arguments must be greater than zero\000"
	.global	__aeabi_idiv
	.align	2
.LC13:
	.ascii	"Number of Buffers:\000"
	.align	2
.LC14:
	.ascii	"%42s %4d\012\000"
	.align	2
.LC15:
	.ascii	"Number of Producers:\000"
	.align	2
.LC16:
	.ascii	"Number of Consumers:\000"
	.align	2
.LC17:
	.ascii	"Number of items Produced by each producer:\000"
	.align	2
.LC18:
	.ascii	"Number of items consumed by each consumer:\000"
	.align	2
.LC19:
	.ascii	"Over consume on?:\000"
	.align	2
.LC20:
	.ascii	"Over consume amount:\000"
	.align	2
.LC21:
	.ascii	"Time each Producer Sleeps (seconds):\000"
	.align	2
.LC22:
	.ascii	"Time each Consumer Sleeps (seconds):\000"
	.align	2
.LC23:
	.ascii	"Error initializing semaphore\000"
	.align	2
.LC24:
	.ascii	"Cannot initialize mutex\000"
	.align	2
.LC25:
	.ascii	"Error Creating Thread..\000"
	.align	2
.LC26:
	.ascii	"Error joining Threads\000"
	.align	2
.LC27:
	.ascii	"Producer Thread joined: %d\012\000"
	.align	2
.LC28:
	.ascii	"Consumer Thread joined: %d\012\000"
	.align	2
.LC29:
	.ascii	"Total Runtime: %f secs.\012\000"
	.align	2
.LC30:
	.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, #60
	str	r0, [fp, #-64]
	str	r1, [fp, #-68]
	ldr	r3, .L63
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r4, r3
	mov	r0, #0
	bl	time
	mov	r3, r0
	str	r3, [fp, #-60]
	sub	r3, fp, #60
	mov	r0, r3
	bl	ctime
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L63+4
	bl	printf
	ldr	r3, [fp, #-64]
	cmp	r3, #7
	beq	.L39
	ldr	r0, .L63+8
	bl	puts
	mvn	r3, #0
	b	.L40
.L39:
	ldr	r3, [fp, #-68]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L63+12
	str	r3, [r2]
	ldr	r3, [fp, #-68]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L63+16
	str	r3, [r2]
	ldr	r3, [fp, #-68]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L63+20
	str	r3, [r2]
	ldr	r3, [fp, #-68]
	add	r3, r3, #16
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L63+24
	str	r3, [r2]
	ldr	r3, [fp, #-68]
	add	r3, r3, #20
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L63+28
	str	r3, [r2]
	ldr	r3, [fp, #-68]
	add	r3, r3, #24
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L63+32
	str	r3, [r2]
	ldr	r3, .L63+12
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L41
	ldr	r3, .L63+16
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L41
	ldr	r3, .L63+20
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L41
	ldr	r3, .L63+24
	ldr	r3, [r3]
	cmp	r3, #0
	bgt	.L42
.L41:
	ldr	r0, .L63+36
	bl	puts
	mvn	r3, #0
	b	.L40
.L42:
	ldr	r3, .L63+24
	ldr	r3, [r3]
	ldr	r2, .L63+16
	ldr	r2, [r2]
	mul	r3, r2, r3
	ldr	r2, .L63+20
	ldr	r2, [r2]
	mov	r1, r2
	mov	r0, r3
	bl	__aeabi_idiv
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+40
	str	r2, [r3]
	ldr	r3, .L63+44
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L63+24
	ldr	r3, [r3]
	ldr	r2, .L63+16
	ldr	r2, [r2]
	mul	r3, r2, r3
	ldr	r2, .L63+20
	ldr	r2, [r2]
	mov	r1, r2
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	mov	r2, r3
	ldr	r3, .L63+48
	str	r2, [r3]
	ldr	r3, .L63+48
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L43
	ldr	r3, .L63+44
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, .L63+40
	ldr	r2, [r3]
	ldr	r3, .L63+48
	ldr	r3, [r3]
	add	r3, r2, r3
	ldr	r2, .L63+52
	str	r3, [r2]
	b	.L44
.L43:
	ldr	r3, .L63+52
	mov	r2, #0
	str	r2, [r3]
.L44:
	mov	r0, #10
	bl	putchar
	ldr	r3, .L63+12
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+56
	ldr	r0, .L63+60
	bl	printf
	ldr	r3, .L63+16
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+64
	ldr	r0, .L63+60
	bl	printf
	ldr	r3, .L63+20
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+68
	ldr	r0, .L63+60
	bl	printf
	ldr	r3, .L63+24
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+72
	ldr	r0, .L63+60
	bl	printf
	ldr	r3, .L63+40
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+76
	ldr	r0, .L63+60
	bl	printf
	ldr	r3, .L63+44
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+80
	ldr	r0, .L63+60
	bl	printf
	ldr	r3, .L63+52
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+84
	ldr	r0, .L63+60
	bl	printf
	ldr	r3, .L63+28
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+88
	ldr	r0, .L63+60
	bl	printf
	ldr	r3, .L63+32
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L63+92
	ldr	r0, .L63+60
	bl	printf
	mov	r0, #10
	bl	putchar
	ldr	r3, .L63+12
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+96
	str	r2, [r3]
	ldr	r3, .L63+16
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r3, .L63+24
	ldr	r3, [r3]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+100
	str	r2, [r3]
	ldr	r3, .L63+16
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r3, .L63+24
	ldr	r3, [r3]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L63+104
	str	r2, [r3]
	mov	r2, #0
	mov	r1, #0
	ldr	r0, .L63+108
	bl	sem_init
	mov	r3, r0
	cmp	r3, #0
	bge	.L45
	ldr	r0, .L63+112
	bl	puts
.L45:
	ldr	r3, .L63+12
	ldr	r3, [r3]
	mov	r2, r3
	mov	r1, #0
	ldr	r0, .L63+116
	bl	sem_init
	mov	r3, r0
	cmp	r3, #0
	bge	.L46
	ldr	r0, .L63+112
	bl	puts
.L46:
	ldr	r3, .L63+16
	ldr	ip, [r3]
	sub	r3, ip, #1
	str	r3, [fp, #-36]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #6
	orr	r3, r3, r0, lsr #26
	lsl	r2, r0, #6
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #6
	orr	r3, r3, r0, lsr #26
	lsl	r2, r0, #6
	mov	r3, ip
	lsl	r3, r3, #3
	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, #-32]
	ldr	r3, .L63+20
	ldr	ip, [r3]
	sub	r3, ip, #1
	str	r3, [fp, #-28]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #6
	orr	r3, r3, r0, lsr #26
	lsl	r2, r0, #6
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #6
	orr	r3, r3, r0, lsr #26
	lsl	r2, r0, #6
	mov	r3, ip
	lsl	r3, r3, #3
	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, #-24]
	mov	r1, #0
	ldr	r0, .L63+120
	bl	pthread_mutex_init
	mov	r3, r0
	cmp	r3, #0
	beq	.L47
	ldr	r0, .L63+124
	bl	puts
.L47:
	mov	r1, #0
	ldr	r0, .L63+128
	bl	pthread_mutex_init
	mov	r3, r0
	cmp	r3, #0
	beq	.L48
	ldr	r0, .L63+124
	bl	puts
.L48:
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L49
.L51:
	ldr	r3, [fp, #-40]
	add	r2, r3, #1
	ldr	r1, [fp, #-32]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #3
	add	r3, r1, r3
	str	r2, [r3, #4]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-32]
	add	r0, r2, r3
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldr	r2, .L63+132
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	bge	.L50
	ldr	r0, .L63+136
	bl	puts
.L50:
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L49:
	ldr	r3, .L63+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-40]
	cmp	r2, r3
	blt	.L51
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L52
.L54:
	ldr	r3, [fp, #-44]
	add	r2, r3, #1
	ldr	r1, [fp, #-24]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #3
	add	r3, r1, r3
	str	r2, [r3, #4]
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-24]
	add	r0, r2, r3
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r2, .L63+140
	mov	r1, #0
	bl	pthread_create
	mov	r3, r0
	cmp	r3, #0
	bge	.L53
	ldr	r0, .L63+136
	bl	puts
.L53:
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L52:
	ldr	r3, .L63+20
	ldr	r3, [r3]
	ldr	r2, [fp, #-44]
	cmp	r2, r3
	blt	.L54
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L55
.L57:
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-48]
	ldr	r3, [r3, r2, lsl #3]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, r0
	cmp	r3, #0
	beq	.L56
	ldr	r0, .L63+144
	bl	puts
	mov	r0, #0
	bl	exit
.L56:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L63+148
	bl	printf
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L55:
	ldr	r3, .L63+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-48]
	cmp	r2, r3
	blt	.L57
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L58
.L60:
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-52]
	ldr	r3, [r3, r2, lsl #3]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, r0
	cmp	r3, #0
	beq	.L59
	ldr	r0, .L63+144
	bl	puts
	mov	r0, #0
	bl	exit
.L59:
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L63+152
	bl	printf
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L58:
	ldr	r3, .L63+20
	ldr	r3, [r3]
	ldr	r2, [fp, #-52]
	cmp	r2, r3
	blt	.L60
	mov	r0, #0
	bl	time
	mov	r3, r0
	str	r3, [fp, #-56]
	sub	r3, fp, #56
	mov	r0, r3
	bl	ctime
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L63+4
	bl	printf
	ldr	r3, .L63+16
	ldr	r3, [r3]
	ldr	r2, .L63+24
	ldr	r2, [r2]
	mul	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r3, .L63+100
	ldr	r0, [r3]
	ldr	r1, [fp, #-20]
	ldr	r3, .L63+156
	mov	r2, #4
	bl	qsort
	ldr	r3, .L63+104
	ldr	r0, [r3]
	ldr	r1, [fp, #-20]
	ldr	r3, .L63+156
	mov	r2, #4
	bl	qsort
	mov	r0, #10
	bl	putchar
	bl	print
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #-60]
	mov	r1, r2
	mov	r0, r3
	bl	difftime
	mov	r2, r0
	mov	r3, r1
	ldr	r0, .L63+160
	bl	printf
	ldr	r0, .L63+120
	bl	pthread_mutex_destroy
	ldr	r3, .L63+96
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L63+100
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L63+104
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r0, .L63+108
	bl	sem_destroy
	ldr	r0, .L63+116
	bl	sem_destroy
	mov	sp, r4
	mov	r3, #0
	b	.L61
.L40:
	mov	sp, r4
.L61:
	ldr	r2, .L63
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L62
	bl	__stack_chk_fail
.L62:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L64:
	.align	2
.L63:
	.word	.LC30
	.word	.LC10
	.word	.LC11
	.word	N
	.word	P
	.word	C
	.word	X
	.word	PTime
	.word	CTime
	.word	.LC12
	.word	CX
	.word	extra
	.word	distribution
	.word	overconsumed
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.word	buffer
	.word	pArray
	.word	cArray
	.word	full
	.word	.LC23
	.word	empty
	.word	lock
	.word	.LC24
	.word	newLock
	.word	producer
	.word	.LC25
	.word	consumer
	.word	.LC26
	.word	.LC27
	.word	.LC28
	.word	compare
	.word	.LC29
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
