	.file	"39897.c"
	.intel_syntax noprefix
	.text
	.globl	producer
	.bss
	.align 8
	.type	producer, @object
	.size	producer, 8
producer:
	.zero	8
	.globl	consumer
	.align 8
	.type	consumer, @object
	.size	consumer, 8
consumer:
	.zero	8
	.globl	cmd_mbox
	.align 32
	.type	cmd_mbox, @object
	.size	cmd_mbox, 144
cmd_mbox:
	.zero	144
	.section	.rodata
.LC0:
	.string	"Producer enq %d exe %d\n"
	.text
	.globl	producer_thread
	.type	producer_thread, @function
producer_thread:
.LFB0:
	.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
	jmp	.L2
.L5:
	lea	rdi, cmd_mbox[rip+8]
	call	pthread_mutex_lock@PLT
	jmp	.L3
.L4:
	lea	rsi, cmd_mbox[rip+8]
	lea	rdi, cmd_mbox[rip+96]
	call	pthread_cond_wait@PLT
.L3:
	mov	eax, DWORD PTR cmd_mbox[rip]
	test	eax, eax
	jg	.L4
	mov	eax, DWORD PTR cmd_mbox[rip]
	add	eax, 1
	mov	DWORD PTR cmd_mbox[rip], eax
	mov	eax, DWORD PTR cmd_mbox[rip+4]
	sub	eax, 1
	mov	DWORD PTR cmd_mbox[rip+4], eax
	mov	edx, DWORD PTR cmd_mbox[rip+4]
	mov	eax, DWORD PTR cmd_mbox[rip]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, cmd_mbox[rip+48]
	call	pthread_cond_signal@PLT
	lea	rdi, cmd_mbox[rip+8]
	call	pthread_mutex_unlock@PLT
.L2:
	mov	eax, DWORD PTR cmd_mbox[rip+4]
	test	eax, eax
	jne	.L5
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	producer_thread, .-producer_thread
	.section	.rodata
.LC1:
	.string	"Consumer deq %d exe %d\n"
	.text
	.globl	consumer_thread
	.type	consumer_thread, @function
consumer_thread:
.LFB1:
	.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
	jmp	.L8
.L11:
	lea	rdi, cmd_mbox[rip+8]
	call	pthread_mutex_lock@PLT
	jmp	.L9
.L10:
	lea	rsi, cmd_mbox[rip+8]
	lea	rdi, cmd_mbox[rip+48]
	call	pthread_cond_wait@PLT
.L9:
	mov	eax, DWORD PTR cmd_mbox[rip]
	test	eax, eax
	jle	.L10
	mov	eax, DWORD PTR cmd_mbox[rip]
	sub	eax, 1
	mov	DWORD PTR cmd_mbox[rip], eax
	mov	edx, DWORD PTR cmd_mbox[rip+4]
	mov	eax, DWORD PTR cmd_mbox[rip]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, cmd_mbox[rip+96]
	call	pthread_cond_signal@PLT
	lea	rdi, cmd_mbox[rip+8]
	call	pthread_mutex_unlock@PLT
.L8:
	mov	eax, DWORD PTR cmd_mbox[rip+4]
	test	eax, eax
	jne	.L11
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	consumer_thread, .-consumer_thread
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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	QWORD PTR -16[rbp], rsi
	mov	DWORD PTR cmd_mbox[rip], 0
	mov	DWORD PTR cmd_mbox[rip+4], 5
	mov	esi, 0
	lea	rdi, cmd_mbox[rip+8]
	call	pthread_mutex_init@PLT
	mov	esi, 0
	lea	rdi, cmd_mbox[rip+48]
	call	pthread_cond_init@PLT
	mov	esi, 0
	lea	rdi, cmd_mbox[rip+96]
	call	pthread_cond_init@PLT
	mov	ecx, 0
	lea	rdx, producer_thread[rip]
	mov	esi, 0
	lea	rdi, producer[rip]
	call	pthread_create@PLT
	mov	ecx, 0
	lea	rdx, consumer_thread[rip]
	mov	esi, 0
	lea	rdi, consumer[rip]
	call	pthread_create@PLT
	mov	rax, QWORD PTR producer[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR consumer[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	"39897.c"
	.text
	.comm	producer,4,4
	.comm	consumer,4,4
	.comm	cmd_mbox,128,8
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Producer enq %d exe %d\012\000"
	.text
	.align	2
	.global	producer_thread
	.syntax unified
	.arm
	.fpu softvfp
	.type	producer_thread, %function
producer_thread:
	@ 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]
	b	.L2
.L5:
	ldr	r0, .L7
	bl	pthread_mutex_lock
	b	.L3
.L4:
	ldr	r1, .L7
	ldr	r0, .L7+4
	bl	pthread_cond_wait
.L3:
	ldr	r3, .L7+8
	ldr	r3, [r3]
	cmp	r3, #0
	bgt	.L4
	ldr	r3, .L7+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L7+8
	str	r3, [r2]
	ldr	r3, .L7+8
	ldr	r3, [r3, #4]
	sub	r3, r3, #1
	ldr	r2, .L7+8
	str	r3, [r2, #4]
	ldr	r3, .L7+8
	ldr	r3, [r3]
	ldr	r2, .L7+8
	ldr	r2, [r2, #4]
	mov	r1, r3
	ldr	r0, .L7+12
	bl	printf
	ldr	r0, .L7+16
	bl	pthread_cond_signal
	ldr	r0, .L7
	bl	pthread_mutex_unlock
.L2:
	ldr	r3, .L7+8
	ldr	r3, [r3, #4]
	cmp	r3, #0
	bne	.L5
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	cmd_mbox+8
	.word	cmd_mbox+80
	.word	cmd_mbox
	.word	.LC0
	.word	cmd_mbox+32
	.size	producer_thread, .-producer_thread
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Consumer deq %d exe %d\012\000"
	.text
	.align	2
	.global	consumer_thread
	.syntax unified
	.arm
	.fpu softvfp
	.type	consumer_thread, %function
consumer_thread:
	@ 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]
	b	.L10
.L13:
	ldr	r0, .L15
	bl	pthread_mutex_lock
	b	.L11
.L12:
	ldr	r1, .L15
	ldr	r0, .L15+4
	bl	pthread_cond_wait
.L11:
	ldr	r3, .L15+8
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L12
	ldr	r3, .L15+8
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L15+8
	str	r3, [r2]
	ldr	r3, .L15+8
	ldr	r3, [r3]
	ldr	r2, .L15+8
	ldr	r2, [r2, #4]
	mov	r1, r3
	ldr	r0, .L15+12
	bl	printf
	ldr	r0, .L15+16
	bl	pthread_cond_signal
	ldr	r0, .L15
	bl	pthread_mutex_unlock
.L10:
	ldr	r3, .L15+8
	ldr	r3, [r3, #4]
	cmp	r3, #0
	bne	.L13
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	cmd_mbox+8
	.word	cmd_mbox+32
	.word	cmd_mbox
	.word	.LC1
	.word	cmd_mbox+80
	.size	consumer_thread, .-consumer_thread
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	str	r1, [fp, #-12]
	ldr	r3, .L19
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L19
	mov	r2, #5
	str	r2, [r3, #4]
	mov	r1, #0
	ldr	r0, .L19+4
	bl	pthread_mutex_init
	mov	r1, #0
	ldr	r0, .L19+8
	bl	pthread_cond_init
	mov	r1, #0
	ldr	r0, .L19+12
	bl	pthread_cond_init
	mov	r3, #0
	ldr	r2, .L19+16
	mov	r1, #0
	ldr	r0, .L19+20
	bl	pthread_create
	mov	r3, #0
	ldr	r2, .L19+24
	mov	r1, #0
	ldr	r0, .L19+28
	bl	pthread_create
	ldr	r3, .L19+20
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, .L19+28
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	cmd_mbox
	.word	cmd_mbox+8
	.word	cmd_mbox+32
	.word	cmd_mbox+80
	.word	producer_thread
	.word	producer
	.word	consumer_thread
	.word	consumer
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
