	.file	"634405.c"
	.intel_syntax noprefix
	.text
	.globl	buffer
	.bss
	.align 32
	.type	buffer, @object
	.size	buffer, 40
buffer:
	.zero	40
	.globl	countproduced
	.align 4
	.type	countproduced, @object
	.size	countproduced, 4
countproduced:
	.zero	4
	.globl	countconsumed
	.align 4
	.type	countconsumed, @object
	.size	countconsumed, 4
countconsumed:
	.zero	4
	.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	nextproduced
	.align 8
	.type	nextproduced, @object
	.size	nextproduced, 8
nextproduced:
	.zero	8
	.globl	nextconsumed
	.align 8
	.type	nextconsumed, @object
	.size	nextconsumed, 8
nextconsumed:
	.zero	8
	.section	.rodata
.LC0:
	.string	"\nConsumer thread"
.LC1:
	.string	"\n\t Buffer Empty"
.LC2:
	.string	"\n\tConsumed : %d "
	.text
	.globl	Consumer
	.type	Consumer, @function
Consumer:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
.L6:
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L2
.L3:
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	sleep@PLT
.L2:
	mov	edx, DWORD PTR in[rip]
	mov	eax, DWORD PTR out[rip]
	cmp	edx, eax
	je	.L3
	mov	eax, DWORD PTR out[rip]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, buffer[rip]
	add	rax, rdx
	mov	QWORD PTR nextconsumed[rip], rax
	mov	eax, DWORD PTR countconsumed[rip]
	add	eax, 1
	mov	DWORD PTR countconsumed[rip], eax
	mov	eax, DWORD PTR countconsumed[rip]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR out[rip]
	lea	ecx, 1[rax]
	movsx	rax, ecx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	esi, ecx
	sar	esi, 31
	sub	eax, esi
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	sub	ecx, eax
	mov	edx, ecx
	mov	DWORD PTR out[rip], edx
	mov	eax, DWORD PTR countconsumed[rip]
	cmp	eax, 20
	je	.L9
	jmp	.L6
.L9:
	nop
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	Consumer, .-Consumer
	.section	.rodata
.LC3:
	.string	"\nProducer thread"
.LC4:
	.string	"\n\t Buffer Full"
.LC5:
	.string	"\n\tProduced : %d "
	.text
	.globl	Producer
	.type	Producer, @function
Producer:
.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	QWORD PTR -8[rbp], rdi
.L15:
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L12:
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	sleep@PLT
.L11:
	mov	eax, DWORD PTR in[rip]
	lea	ecx, 1[rax]
	movsx	rax, ecx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	esi, ecx
	sar	esi, 31
	sub	eax, esi
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	sub	ecx, eax
	mov	edx, ecx
	mov	eax, DWORD PTR out[rip]
	cmp	edx, eax
	je	.L12
	mov	edi, 8
	call	malloc@PLT
	mov	QWORD PTR nextproduced[rip], rax
	mov	eax, DWORD PTR countproduced[rip]
	add	eax, 1
	mov	DWORD PTR countproduced[rip], eax
	mov	rax, QWORD PTR nextproduced[rip]
	mov	edx, DWORD PTR countproduced[rip]
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR countproduced[rip]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR nextproduced[rip]
	mov	edx, DWORD PTR in[rip]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, buffer[rip]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR in[rip]
	lea	ecx, 1[rax]
	movsx	rax, ecx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	esi, ecx
	sar	esi, 31
	sub	eax, esi
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	sub	ecx, eax
	mov	edx, ecx
	mov	DWORD PTR in[rip], edx
	mov	eax, DWORD PTR countproduced[rip]
	cmp	eax, 20
	je	.L18
	jmp	.L15
.L18:
	nop
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	Producer, .-Producer
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -24[rbp]
	mov	ecx, 0
	lea	rdx, Producer[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rax, -16[rbp]
	mov	ecx, 0
	lea	rdx, Consumer[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	eax, 0
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"634405.c"
	.text
	.comm	buffer,40,4
	.global	countproduced
	.bss
	.align	2
	.type	countproduced, %object
	.size	countproduced, 4
countproduced:
	.space	4
	.global	countconsumed
	.align	2
	.type	countconsumed, %object
	.size	countconsumed, 4
countconsumed:
	.space	4
	.global	in
	.align	2
	.type	in, %object
	.size	in, 4
in:
	.space	4
	.global	out
	.align	2
	.type	out, %object
	.size	out, 4
out:
	.space	4
	.comm	nextproduced,4,4
	.comm	nextconsumed,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012Consumer thread\000"
	.align	2
.LC1:
	.ascii	"\012\011 Buffer Empty\000"
	.align	2
.LC2:
	.ascii	"\012\011Consumed : %d \000"
	.text
	.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]
.L6:
	ldr	r0, .L10
	bl	printf
	b	.L2
.L3:
	ldr	r0, .L10+4
	bl	printf
	mov	r0, #1
	bl	sleep
.L2:
	ldr	r3, .L10+8
	ldr	r2, [r3]
	ldr	r3, .L10+12
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L3
	ldr	r3, .L10+12
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, .L10+16
	add	r3, r3, r2
	ldr	r2, .L10+20
	str	r3, [r2]
	ldr	r3, .L10+24
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L10+24
	str	r3, [r2]
	ldr	r3, .L10+24
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L10+28
	bl	printf
	ldr	r3, .L10+12
	ldr	r3, [r3]
	add	r1, r3, #1
	ldr	r3, .L10+32
	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
	ldr	r3, .L10+12
	str	r2, [r3]
	ldr	r3, .L10+24
	ldr	r3, [r3]
	cmp	r3, #20
	beq	.L9
	b	.L6
.L9:
	nop
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC0
	.word	.LC1
	.word	in
	.word	out
	.word	buffer
	.word	nextconsumed
	.word	countconsumed
	.word	.LC2
	.word	1717986919
	.size	Consumer, .-Consumer
	.section	.rodata
	.align	2
.LC3:
	.ascii	"\012Producer thread\000"
	.align	2
.LC4:
	.ascii	"\012\011 Buffer Full\000"
	.align	2
.LC5:
	.ascii	"\012\011Produced : %d \000"
	.text
	.align	2
	.global	Producer
	.syntax unified
	.arm
	.fpu softvfp
	.type	Producer, %function
Producer:
	@ 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]
.L17:
	ldr	r0, .L21
	bl	printf
	b	.L13
.L14:
	ldr	r0, .L21+4
	bl	printf
	mov	r0, #1
	bl	sleep
.L13:
	ldr	r3, .L21+8
	ldr	r3, [r3]
	add	r1, r3, #1
	ldr	r3, .L21+12
	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
	ldr	r3, .L21+16
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L14
	mov	r0, #4
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L21+20
	str	r2, [r3]
	ldr	r3, .L21+24
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L21+24
	str	r3, [r2]
	ldr	r3, .L21+20
	ldr	r3, [r3]
	ldr	r2, .L21+24
	ldr	r2, [r2]
	str	r2, [r3]
	ldr	r3, .L21+24
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L21+28
	bl	printf
	ldr	r3, .L21+20
	ldr	r2, [r3]
	ldr	r3, .L21+8
	ldr	r3, [r3]
	ldr	r1, .L21+32
	ldr	r2, [r2]
	str	r2, [r1, r3, lsl #2]
	ldr	r3, .L21+8
	ldr	r3, [r3]
	add	r1, r3, #1
	ldr	r3, .L21+12
	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
	ldr	r3, .L21+8
	str	r2, [r3]
	ldr	r3, .L21+24
	ldr	r3, [r3]
	cmp	r3, #20
	beq	.L20
	b	.L17
.L20:
	nop
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC3
	.word	.LC4
	.word	in
	.word	1717986919
	.word	out
	.word	nextproduced
	.word	countproduced
	.word	.LC5
	.word	buffer
	.size	Producer, .-Producer
	.section	.rodata
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r0, fp, #16
	mov	r3, #0
	ldr	r2, .L26+4
	mov	r1, #0
	bl	pthread_create
	sub	r0, fp, #12
	mov	r3, #0
	ldr	r2, .L26+8
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-16]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-12]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, #0
	ldr	r2, .L26
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L25
	bl	__stack_chk_fail
.L25:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC6
	.word	Producer
	.word	Consumer
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
