	.file	"467686.c"
	.intel_syntax noprefix
	.text
	.globl	produce_id
	.bss
	.align 4
	.type	produce_id, @object
	.size	produce_id, 4
produce_id:
	.zero	4
	.globl	consume_id
	.align 4
	.type	consume_id, @object
	.size	consume_id, 4
consume_id:
	.zero	4
	.globl	mutex
	.align 32
	.type	mutex, @object
	.size	mutex, 40
mutex:
	.zero	40
	.globl	threads
	.align 16
	.type	threads, @object
	.size	threads, 24
threads:
	.zero	24
	.globl	cond
	.align 32
	.type	cond, @object
	.size	cond, 48
cond:
	.zero	48
	.globl	total
	.align 4
	.type	total, @object
	.size	total, 4
total:
	.zero	4
	.section	.rodata
.LC0:
	.string	"CONSUMER:%d is waiting...\n"
.LC1:
	.string	"CONSUMER:%d ends waiting\n"
.LC2:
	.string	"CONSUMER:%d is consuming...\n"
	.text
	.globl	handle_consume
	.type	handle_consume, @function
handle_consume:
.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	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
.L4:
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, mutex[rip]
	lea	rdi, cond[rip]
	call	pthread_cond_wait@PLT
.L2:
	mov	eax, DWORD PTR total[rip]
	test	eax, eax
	je	.L3
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR total[rip]
	sub	eax, 1
	mov	DWORD PTR total[rip], eax
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	edi, 3
	call	sleep@PLT
	jmp	.L4
	.cfi_endproc
.LFE6:
	.size	handle_consume, .-handle_consume
	.section	.rodata
.LC3:
	.string	"PRODUCER:%d is producing...\n"
.LC4:
	.string	"PRODUCER:%d signals\n"
	.text
	.globl	handle_produce
	.type	handle_produce, @function
handle_produce:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
.L6:
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR total[rip]
	add	eax, 1
	mov	DWORD PTR total[rip], eax
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, cond[rip]
	call	pthread_cond_signal@PLT
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	edi, 1
	call	sleep@PLT
	jmp	.L6
	.cfi_endproc
.LFE7:
	.size	handle_produce, .-handle_produce
	.section	.rodata
.LC5:
	.string	"pthread_create:%s\n"
.LC6:
	.string	"pthread_join:%s\n"
	.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, 32
	mov	esi, 0
	lea	rdi, mutex[rip]
	call	pthread_mutex_init@PLT
	mov	DWORD PTR -28[rbp], 0
	mov	DWORD PTR -28[rbp], 0
	jmp	.L8
.L10:
	mov	edi, 4
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -28[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, threads[rip]
	lea	rdi, [rdx+rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	lea	rdx, handle_consume[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	je	.L9
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	add	DWORD PTR -28[rbp], 1
.L8:
	cmp	DWORD PTR -28[rbp], 1
	jle	.L10
	mov	edi, 1
	call	sleep@PLT
	mov	DWORD PTR -28[rbp], 0
	jmp	.L11
.L13:
	mov	edi, 4
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR -28[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -28[rbp]
	add	eax, 2
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, threads[rip]
	lea	rdi, [rdx+rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, rax
	lea	rdx, handle_produce[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	je	.L12
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	add	DWORD PTR -28[rbp], 1
.L11:
	cmp	DWORD PTR -28[rbp], 0
	jle	.L13
	mov	DWORD PTR -28[rbp], 0
	jmp	.L14
.L16:
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, threads[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	je	.L15
	mov	eax, DWORD PTR -24[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L15:
	add	DWORD PTR -28[rbp], 1
.L14:
	cmp	DWORD PTR -28[rbp], 2
	jle	.L16
	lea	rdi, mutex[rip]
	call	pthread_mutex_destroy@PLT
	mov	eax, 0
	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	"467686.c"
	.text
	.global	produce_id
	.bss
	.align	2
	.type	produce_id, %object
	.size	produce_id, 4
produce_id:
	.space	4
	.global	consume_id
	.align	2
	.type	consume_id, %object
	.size	consume_id, 4
consume_id:
	.space	4
	.comm	mutex,24,4
	.comm	threads,12,4
	.comm	cond,48,8
	.global	total
	.align	2
	.type	total, %object
	.size	total, 4
total:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"CONSUMER:%d is waiting...\012\000"
	.align	2
.LC1:
	.ascii	"CONSUMER:%d ends waiting\012\000"
	.align	2
.LC2:
	.ascii	"CONSUMER:%d is consuming...\012\000"
	.text
	.align	2
	.global	handle_consume
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_consume, %function
handle_consume:
	@ 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]
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-16]
	bl	free
.L4:
	ldr	r0, .L5
	bl	pthread_mutex_lock
	b	.L2
.L3:
	ldr	r1, [fp, #-8]
	ldr	r0, .L5+4
	bl	printf
	ldr	r1, .L5
	ldr	r0, .L5+8
	bl	pthread_cond_wait
.L2:
	ldr	r3, .L5+12
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L3
	ldr	r1, [fp, #-8]
	ldr	r0, .L5+16
	bl	printf
	ldr	r1, [fp, #-8]
	ldr	r0, .L5+20
	bl	printf
	ldr	r3, .L5+12
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L5+12
	str	r3, [r2]
	ldr	r0, .L5
	bl	pthread_mutex_unlock
	mov	r0, #3
	bl	sleep
	b	.L4
.L6:
	.align	2
.L5:
	.word	mutex
	.word	.LC0
	.word	cond
	.word	total
	.word	.LC1
	.word	.LC2
	.size	handle_consume, .-handle_consume
	.section	.rodata
	.align	2
.LC3:
	.ascii	"PRODUCER:%d is producing...\012\000"
	.align	2
.LC4:
	.ascii	"PRODUCER:%d signals\012\000"
	.text
	.align	2
	.global	handle_produce
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_produce, %function
handle_produce:
	@ 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]
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-16]
	bl	free
.L8:
	ldr	r0, .L9
	bl	pthread_mutex_lock
	ldr	r1, [fp, #-8]
	ldr	r0, .L9+4
	bl	printf
	ldr	r3, .L9+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L9+8
	str	r3, [r2]
	ldr	r1, [fp, #-8]
	ldr	r0, .L9+12
	bl	printf
	ldr	r0, .L9+16
	bl	pthread_cond_signal
	ldr	r0, .L9
	bl	pthread_mutex_unlock
	mov	r0, #1
	bl	sleep
	b	.L8
.L10:
	.align	2
.L9:
	.word	mutex
	.word	.LC3
	.word	total
	.word	.LC4
	.word	cond
	.size	handle_produce, .-handle_produce
	.section	.rodata
	.align	2
.LC5:
	.ascii	"pthread_create:%s\012\000"
	.align	2
.LC6:
	.ascii	"pthread_join:%s\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	mov	r1, #0
	ldr	r0, .L22
	bl	pthread_mutex_init
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L12
.L14:
	mov	r0, #4
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-32]
	str	r2, [r3]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	ldr	r2, .L22+4
	add	r0, r3, r2
	ldr	r3, [fp, #-20]
	ldr	r2, .L22+8
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L13
	ldr	r3, .L22+12
	ldr	r4, [r3]
	ldr	r0, [fp, #-16]
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L22+16
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L13:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L12:
	ldr	r3, [fp, #-32]
	cmp	r3, #1
	ble	.L14
	mov	r0, #1
	bl	sleep
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L15
.L17:
	mov	r0, #4
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-32]
	str	r2, [r3]
	ldr	r3, [fp, #-32]
	add	r3, r3, #2
	lsl	r3, r3, #2
	ldr	r2, .L22+4
	add	r0, r3, r2
	ldr	r3, [fp, #-24]
	ldr	r2, .L22+20
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L16
	ldr	r3, .L22+12
	ldr	r4, [r3]
	ldr	r0, [fp, #-28]
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L22+16
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L16:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L15:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	ble	.L17
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L18
.L20:
	ldr	r2, .L22+4
	ldr	r3, [fp, #-32]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L19
	ldr	r3, .L22+12
	ldr	r4, [r3]
	ldr	r0, [fp, #-28]
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L22+24
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L19:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L18:
	ldr	r3, [fp, #-32]
	cmp	r3, #2
	ble	.L20
	ldr	r0, .L22
	bl	pthread_mutex_destroy
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L23:
	.align	2
.L22:
	.word	mutex
	.word	threads
	.word	handle_consume
	.word	stderr
	.word	.LC5
	.word	handle_produce
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
