	.file	"61935.c"
	.intel_syntax noprefix
	.text
	.globl	buf
	.bss
	.align 16
	.type	buf, @object
	.size	buf, 20
buf:
	.zero	20
	.globl	f
	.align 4
	.type	f, @object
	.size	f, 4
f:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	mutex
	.align 32
	.type	mutex, @object
	.size	mutex, 32
mutex:
	.zero	32
	.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
	.section	.rodata
.LC0:
	.string	"produced item is %d\n"
.LC1:
	.string	"producer : full %u\n"
	.text
	.globl	produce
	.type	produce, @function
produce:
.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 fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -12[rbp], 0
	jmp	.L2
.L3:
	lea	rdi, empty[rip]
	call	sem_wait@PLT
	lea	rdi, mutex[rip]
	call	sem_wait@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR r[rip]
	add	eax, 1
	mov	DWORD PTR r[rip], eax
	mov	edx, DWORD PTR r[rip]
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	sal	ecx, 2
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rdx, buf[rip]
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	mov	edi, 1
	mov	eax, 0
	call	sleep@PLT
	lea	rdi, mutex[rip]
	call	sem_post@PLT
	lea	rdi, full[rip]
	call	sem_post@PLT
	lea	rax, -16[rbp]
	mov	rsi, rax
	lea	rdi, full[rip]
	call	sem_getvalue@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -12[rbp], 1
.L2:
	cmp	DWORD PTR -12[rbp], 9
	jle	.L3
	nop
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	produce, .-produce
	.section	.rodata
.LC2:
	.string	"consumer : full %u\n"
.LC3:
	.string	"consumed item is %d\n"
	.text
	.globl	consume
	.type	consume, @function
consume:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -16[rbp], 0
	jmp	.L6
.L7:
	lea	rdi, full[rip]
	call	sem_wait@PLT
	lea	rax, -20[rbp]
	mov	rsi, rax
	lea	rdi, full[rip]
	call	sem_getvalue@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, mutex[rip]
	call	sem_wait@PLT
	mov	eax, DWORD PTR f[rip]
	add	eax, 1
	mov	DWORD PTR f[rip], eax
	mov	edx, DWORD PTR f[rip]
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	sal	ecx, 2
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, buf[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	mov	eax, 0
	call	sleep@PLT
	lea	rdi, mutex[rip]
	call	sem_post@PLT
	lea	rdi, empty[rip]
	call	sem_post@PLT
	add	DWORD PTR -16[rbp], 1
.L6:
	cmp	DWORD PTR -16[rbp], 9
	jle	.L7
	nop
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	consume, .-consume
	.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
	mov	edx, 1
	mov	esi, 0
	lea	rdi, mutex[rip]
	call	sem_init@PLT
	mov	edx, 1
	mov	esi, 0
	lea	rdi, full[rip]
	call	sem_init@PLT
	mov	edx, 5
	mov	esi, 0
	lea	rdi, empty[rip]
	call	sem_init@PLT
	lea	rax, -24[rbp]
	mov	ecx, 0
	lea	rdx, produce[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rax, -16[rbp]
	mov	ecx, 0
	lea	rdx, consume[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
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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	"61935.c"
	.text
	.comm	buf,20,4
	.comm	f,4,4
	.comm	r,4,4
	.comm	mutex,16,4
	.comm	full,16,4
	.comm	empty,16,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"produced item is %d\012\000"
	.align	2
.LC1:
	.ascii	"producer : full %u\012\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	produce
	.syntax unified
	.arm
	.fpu softvfp
	.type	produce, %function
produce:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L5
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L2
.L3:
	ldr	r0, .L5+4
	bl	sem_wait
	ldr	r0, .L5+8
	bl	sem_wait
	ldr	r1, [fp, #-12]
	ldr	r0, .L5+12
	bl	printf
	ldr	r3, .L5+16
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L5+16
	str	r3, [r2]
	ldr	r3, .L5+16
	ldr	r1, [r3]
	ldr	r3, .L5+20
	smull	r2, r3, r1, r3
	asr	r2, r3, #1
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	sub	r2, r1, r3
	ldr	r1, .L5+24
	ldr	r3, [fp, #-12]
	str	r3, [r1, r2, lsl #2]
	mov	r0, #1
	bl	sleep
	ldr	r0, .L5+8
	bl	sem_post
	ldr	r0, .L5+28
	bl	sem_post
	sub	r3, fp, #16
	mov	r1, r3
	ldr	r0, .L5+28
	bl	sem_getvalue
	ldr	r3, [fp, #-16]
	mov	r1, r3
	ldr	r0, .L5+32
	bl	printf
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L2:
	ldr	r3, [fp, #-12]
	cmp	r3, #9
	ble	.L3
	nop
	ldr	r2, .L5
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L4
	bl	__stack_chk_fail
.L4:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC2
	.word	empty
	.word	mutex
	.word	.LC0
	.word	r
	.word	1717986919
	.word	buf
	.word	full
	.word	.LC1
	.size	produce, .-produce
	.section	.rodata
	.align	2
.LC3:
	.ascii	"consumer : full %u\012\000"
	.align	2
.LC4:
	.ascii	"consumed item is %d\012\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	consume
	.syntax unified
	.arm
	.fpu softvfp
	.type	consume, %function
consume:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L8
.L9:
	ldr	r0, .L11+4
	bl	sem_wait
	sub	r3, fp, #20
	mov	r1, r3
	ldr	r0, .L11+4
	bl	sem_getvalue
	ldr	r3, [fp, #-20]
	mov	r1, r3
	ldr	r0, .L11+8
	bl	printf
	ldr	r0, .L11+12
	bl	sem_wait
	ldr	r3, .L11+16
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L11+16
	str	r3, [r2]
	ldr	r3, .L11+16
	ldr	r1, [r3]
	ldr	r3, .L11+20
	smull	r2, r3, r1, r3
	asr	r2, r3, #1
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	sub	r2, r1, r3
	ldr	r3, .L11+24
	ldr	r3, [r3, r2, lsl #2]
	str	r3, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, .L11+28
	bl	printf
	mov	r0, #1
	bl	sleep
	ldr	r0, .L11+12
	bl	sem_post
	ldr	r0, .L11+32
	bl	sem_post
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L8:
	ldr	r3, [fp, #-16]
	cmp	r3, #9
	ble	.L9
	nop
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC5
	.word	full
	.word	.LC3
	.word	mutex
	.word	f
	.word	1717986919
	.word	buf
	.word	.LC4
	.word	empty
	.size	consume, .-consume
	.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, .L15
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #1
	mov	r1, #0
	ldr	r0, .L15+4
	bl	sem_init
	mov	r2, #1
	mov	r1, #0
	ldr	r0, .L15+8
	bl	sem_init
	mov	r2, #5
	mov	r1, #0
	ldr	r0, .L15+12
	bl	sem_init
	sub	r0, fp, #16
	mov	r3, #0
	ldr	r2, .L15+16
	mov	r1, #0
	bl	pthread_create
	sub	r0, fp, #12
	mov	r3, #0
	ldr	r2, .L15+20
	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
	nop
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC6
	.word	mutex
	.word	full
	.word	empty
	.word	produce
	.word	consume
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
