	.file	"248718.c"
	.intel_syntax noprefix
	.text
	.globl	mutex
	.data
	.align 4
	.type	mutex, @object
	.size	mutex, 4
mutex:
	.long	1
	.globl	full
	.bss
	.align 4
	.type	full, @object
	.size	full, 4
full:
	.zero	4
	.globl	empty
	.data
	.align 4
	.type	empty, @object
	.size	empty, 4
empty:
	.long	10
	.globl	x
	.bss
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.section	.rodata
.LC0:
	.string	"\nProducer produces item %d"
	.text
	.globl	producer
	.type	producer, @function
producer:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR mutex[rip]
	sub	eax, 1
	mov	DWORD PTR mutex[rip], eax
	mov	eax, DWORD PTR full[rip]
	add	eax, 1
	mov	DWORD PTR full[rip], eax
	mov	eax, DWORD PTR empty[rip]
	sub	eax, 1
	mov	DWORD PTR empty[rip], eax
	mov	eax, DWORD PTR x[rip]
	add	eax, 1
	mov	DWORD PTR x[rip], eax
	mov	eax, DWORD PTR x[rip]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR mutex[rip]
	add	eax, 1
	mov	DWORD PTR mutex[rip], eax
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	producer, .-producer
	.section	.rodata
.LC1:
	.string	"\nConsumer consumes item %d"
	.text
	.globl	consumer
	.type	consumer, @function
consumer:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR mutex[rip]
	sub	eax, 1
	mov	DWORD PTR mutex[rip], eax
	mov	eax, DWORD PTR full[rip]
	sub	eax, 1
	mov	DWORD PTR full[rip], eax
	mov	eax, DWORD PTR empty[rip]
	add	eax, 1
	mov	DWORD PTR empty[rip], eax
	mov	eax, DWORD PTR x[rip]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR x[rip]
	sub	eax, 1
	mov	DWORD PTR x[rip], eax
	mov	eax, DWORD PTR mutex[rip]
	add	eax, 1
	mov	DWORD PTR mutex[rip], eax
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	consumer, .-consumer
	.section	.rodata
	.align 8
.LC2:
	.string	"\n1. Press 1 for Producer\n2. Press 2 for Consume \n3. Press 3 for Exit"
.LC3:
	.string	"\nEnter your choice:"
.LC4:
	.string	"%d"
.LC5:
	.string	"Buffer is full!"
.LC6:
	.string	"Buffer is empty!"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -12[rbp], 1
	jmp	.L4
.L13:
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, 3
	je	.L5
	cmp	eax, 3
	jg	.L6
	cmp	eax, 1
	je	.L7
	cmp	eax, 2
	je	.L8
	jmp	.L6
.L7:
	mov	eax, DWORD PTR mutex[rip]
	cmp	eax, 1
	jne	.L9
	mov	eax, DWORD PTR empty[rip]
	test	eax, eax
	je	.L9
	mov	eax, 0
	call	producer
	jmp	.L6
.L9:
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L6
.L8:
	mov	eax, DWORD PTR mutex[rip]
	cmp	eax, 1
	jne	.L11
	mov	eax, DWORD PTR full[rip]
	test	eax, eax
	je	.L11
	mov	eax, 0
	call	consumer
	jmp	.L6
.L11:
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L6
.L5:
	mov	edi, 0
	call	exit@PLT
.L6:
	add	DWORD PTR -12[rbp], 1
.L4:
	cmp	DWORD PTR -12[rbp], 0
	jg	.L13
	mov	eax, 0
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"248718.c"
	.text
	.global	mutex
	.data
	.align	2
	.type	mutex, %object
	.size	mutex, 4
mutex:
	.word	1
	.global	full
	.bss
	.align	2
	.type	full, %object
	.size	full, 4
full:
	.space	4
	.global	empty
	.data
	.align	2
	.type	empty, %object
	.size	empty, 4
empty:
	.word	10
	.global	x
	.bss
	.align	2
	.type	x, %object
	.size	x, 4
x:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012Producer produces item %d\000"
	.text
	.align	2
	.global	producer
	.syntax unified
	.arm
	.fpu softvfp
	.type	producer, %function
producer:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L2
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L2
	str	r3, [r2]
	ldr	r3, .L2+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L2+4
	str	r3, [r2]
	ldr	r3, .L2+8
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L2+8
	str	r3, [r2]
	ldr	r3, .L2+12
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L2+12
	str	r3, [r2]
	ldr	r3, .L2+12
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L2+16
	bl	printf
	ldr	r3, .L2
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L2
	str	r3, [r2]
	nop
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	mutex
	.word	full
	.word	empty
	.word	x
	.word	.LC0
	.size	producer, .-producer
	.section	.rodata
	.align	2
.LC1:
	.ascii	"\012Consumer consumes item %d\000"
	.text
	.align	2
	.global	consumer
	.syntax unified
	.arm
	.fpu softvfp
	.type	consumer, %function
consumer:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L5
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L5
	str	r3, [r2]
	ldr	r3, .L5+4
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L5+4
	str	r3, [r2]
	ldr	r3, .L5+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L5+8
	str	r3, [r2]
	ldr	r3, .L5+12
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L5+16
	bl	printf
	ldr	r3, .L5+12
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L5+12
	str	r3, [r2]
	ldr	r3, .L5
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L5
	str	r3, [r2]
	nop
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	mutex
	.word	full
	.word	empty
	.word	x
	.word	.LC1
	.size	consumer, .-consumer
	.section	.rodata
	.align	2
.LC2:
	.ascii	"\0121. Press 1 for Producer\0122. Press 2 for Consu"
	.ascii	"me \0123. Press 3 for Exit\000"
	.align	2
.LC3:
	.ascii	"\012Enter your choice:\000"
	.align	2
.LC4:
	.ascii	"%d\000"
	.align	2
.LC5:
	.ascii	"Buffer is full!\000"
	.align	2
.LC6:
	.ascii	"Buffer is empty!\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L20+4
	bl	printf
	mov	r3, #1
	str	r3, [fp, #-12]
	b	.L8
.L17:
	ldr	r0, .L20+8
	bl	printf
	sub	r3, fp, #16
	mov	r1, r3
	ldr	r0, .L20+12
	bl	__isoc99_scanf
	ldr	r3, [fp, #-16]
	cmp	r3, #3
	beq	.L9
	cmp	r3, #3
	bgt	.L10
	cmp	r3, #1
	beq	.L11
	cmp	r3, #2
	beq	.L12
	b	.L10
.L11:
	ldr	r3, .L20+16
	ldr	r3, [r3]
	cmp	r3, #1
	bne	.L13
	ldr	r3, .L20+20
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L13
	bl	producer
	b	.L10
.L13:
	ldr	r0, .L20+24
	bl	printf
	b	.L10
.L12:
	ldr	r3, .L20+16
	ldr	r3, [r3]
	cmp	r3, #1
	bne	.L15
	ldr	r3, .L20+28
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L15
	bl	consumer
	b	.L10
.L15:
	ldr	r0, .L20+32
	bl	printf
	b	.L10
.L9:
	mov	r0, #0
	bl	exit
.L10:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L8:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bgt	.L17
	mov	r3, #0
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC7
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	mutex
	.word	empty
	.word	.LC5
	.word	full
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
