	.file	"788707.c"
	.intel_syntax noprefix
	.text
	.globl	sem_post
	.type	sem_post, @function
sem_post:
.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
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 48
	mov	rdi, rax
	call	pthread_cond_signal@PLT
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	sem_post, .-sem_post
	.globl	sem_wait
	.type	sem_wait, @function
sem_wait:
.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
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	jmp	.L3
.L4:
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 8[rax]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 48
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_cond_wait@PLT
.L3:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	je	.L4
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sem_wait, .-sem_wait
	.globl	sem_init
	.type	sem_init, @function
sem_init:
.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	QWORD PTR -8[rbp], rdi
	mov	DWORD PTR -12[rbp], esi
	mov	DWORD PTR -16[rbp], edx
	cmp	DWORD PTR -12[rbp], 0
	je	.L6
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 38
	mov	eax, -1
	jmp	.L7
.L6:
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -16[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 48
	mov	esi, 0
	mov	rdi, rax
	call	pthread_cond_init@PLT
	mov	eax, 0
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sem_init, .-sem_init
	.globl	producer
	.type	producer, @function
producer:
.LFB9:
	.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]
	add	rax, 96
	mov	rdi, rax
	call	sem_wait
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 200
	mov	rdi, rax
	call	sem_wait
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 392
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	edi, 112
	call	putchar@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L9
.L10:
	mov	edi, 42
	call	putchar@PLT
	add	DWORD PTR -4[rbp], 1
.L9:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 192[rax]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L10
	mov	edi, 10
	call	putchar@PLT
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 392
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 192[rax]
	lea	edx, 2[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 192[rax], edx
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 200
	mov	rdi, rax
	call	sem_post
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	sem_post
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	producer, .-producer
	.section	.rodata
.LC0:
	.string	"errno %d\n"
	.text
	.globl	consumer
	.type	consumer, @function
consumer:
.LFB10:
	.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	rdi, rax
	call	sem_wait
	mov	DWORD PTR -4[rbp], eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 296
	mov	rdi, rax
	call	sem_wait
	cmp	DWORD PTR -4[rbp], 0
	je	.L12
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
.L12:
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 392
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	edi, 99
	call	putchar@PLT
	mov	DWORD PTR -8[rbp], 0
	jmp	.L13
.L14:
	mov	edi, 42
	call	putchar@PLT
	add	DWORD PTR -8[rbp], 1
.L13:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 196[rax]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L14
	mov	edi, 10
	call	putchar@PLT
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 392
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 196[rax]
	lea	edx, 2[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 196[rax], edx
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 296
	mov	rdi, rax
	call	sem_post
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 96
	mov	rdi, rax
	call	sem_post
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	consumer, .-consumer
	.section	.rodata
	.align 8
.LC1:
	.string	"example for producer and consumer problem"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 480
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC1[rip]
	call	puts@PLT
	lea	rax, -448[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	sem_init
	lea	rax, -448[rbp]
	add	rax, 96
	mov	edx, 1
	mov	esi, 0
	mov	rdi, rax
	call	sem_init
	lea	rax, -448[rbp]
	add	rax, 200
	mov	edx, 1
	mov	esi, 0
	mov	rdi, rax
	call	sem_init
	lea	rax, -448[rbp]
	add	rax, 296
	mov	edx, 1
	mov	esi, 0
	mov	rdi, rax
	call	sem_init
	lea	rax, -448[rbp]
	add	rax, 392
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	mov	DWORD PTR -256[rbp], 1
	mov	DWORD PTR -252[rbp], 2
	mov	DWORD PTR -468[rbp], 20
	jmp	.L16
.L17:
	lea	rdx, -448[rbp]
	lea	rax, -456[rbp]
	mov	rcx, rdx
	lea	rdx, consumer[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
.L16:
	mov	eax, DWORD PTR -468[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -468[rbp], edx
	test	eax, eax
	jne	.L17
	mov	DWORD PTR -468[rbp], 20
	jmp	.L18
.L19:
	lea	rdx, -448[rbp]
	lea	rax, -464[rbp]
	mov	rcx, rdx
	lea	rdx, producer[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
.L18:
	mov	eax, DWORD PTR -468[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -468[rbp], edx
	test	eax, eax
	jne	.L19
	mov	edi, 2
	call	sleep@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	"788707.c"
	.text
	.align	2
	.global	sem_post
	.syntax unified
	.arm
	.fpu softvfp
	.type	sem_post, %function
sem_post:
	@ 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]
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #32
	mov	r0, r3
	bl	pthread_cond_signal
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_unlock
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	sem_post, .-sem_post
	.align	2
	.global	sem_wait
	.syntax unified
	.arm
	.fpu softvfp
	.type	sem_wait, %function
sem_wait:
	@ 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]
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_lock
	b	.L3
.L4:
	ldr	r3, [fp, #-8]
	add	r2, r3, #32
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r1, r3
	mov	r0, r2
	bl	pthread_cond_wait
.L3:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L4
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	sub	r2, r3, #1
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_unlock
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	sem_wait, .-sem_wait
	.align	2
	.global	sem_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	sem_init, %function
sem_init:
	@ 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, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L6
	bl	__errno_location
	mov	r3, r0
	mov	r2, #38
	str	r2, [r3]
	mvn	r3, #0
	b	.L7
.L6:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	ldr	r3, [fp, #-8]
	add	r3, r3, #32
	mov	r1, #0
	mov	r0, r3
	bl	pthread_cond_init
	mov	r3, #0
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	sem_init, .-sem_init
	.align	2
	.global	producer
	.syntax unified
	.arm
	.fpu softvfp
	.type	producer, %function
producer:
	@ 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]
	add	r3, r3, #80
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-16]
	add	r3, r3, #168
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-16]
	add	r3, r3, #328
	mov	r0, r3
	bl	pthread_mutex_lock
	mov	r0, #112
	bl	putchar
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L9
.L10:
	mov	r0, #42
	bl	putchar
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L9:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #160]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L10
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-16]
	add	r3, r3, #328
	mov	r0, r3
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #160]
	add	r2, r3, #2
	ldr	r3, [fp, #-16]
	str	r2, [r3, #160]
	ldr	r3, [fp, #-16]
	add	r3, r3, #168
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	sem_post
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	producer, .-producer
	.section	.rodata
	.align	2
.LC0:
	.ascii	"errno %d\012\000"
	.text
	.align	2
	.global	consumer
	.syntax unified
	.arm
	.fpu softvfp
	.type	consumer, %function
consumer:
	@ 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]
	mov	r0, r3
	bl	sem_wait
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-16]
	add	r3, r3, #248
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L12
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L15
	bl	printf
.L12:
	ldr	r3, [fp, #-16]
	add	r3, r3, #328
	mov	r0, r3
	bl	pthread_mutex_lock
	mov	r0, #99
	bl	putchar
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L13
.L14:
	mov	r0, #42
	bl	putchar
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L13:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #164]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L14
	mov	r0, #10
	bl	putchar
	ldr	r3, [fp, #-16]
	add	r3, r3, #328
	mov	r0, r3
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #164]
	add	r2, r3, #2
	ldr	r3, [fp, #-16]
	str	r2, [r3, #164]
	ldr	r3, [fp, #-16]
	add	r3, r3, #248
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-16]
	add	r3, r3, #80
	mov	r0, r3
	bl	sem_post
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC0
	.size	consumer, .-consumer
	.section	.rodata
	.align	2
.LC1:
	.ascii	"example for producer and consumer problem\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 376
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #376
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L24+4
	bl	puts
	sub	r3, fp, #364
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	sem_init
	sub	r3, fp, #364
	add	r3, r3, #80
	mov	r2, #1
	mov	r1, #0
	mov	r0, r3
	bl	sem_init
	sub	r3, fp, #364
	add	r3, r3, #168
	mov	r2, #1
	mov	r1, #0
	mov	r0, r3
	bl	sem_init
	sub	r3, fp, #364
	add	r3, r3, #248
	mov	r2, #1
	mov	r1, #0
	mov	r0, r3
	bl	sem_init
	sub	r3, fp, #364
	add	r3, r3, #328
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	mov	r3, #1
	str	r3, [fp, #-204]
	mov	r3, #2
	str	r3, [fp, #-200]
	mov	r3, #20
	str	r3, [fp, #-368]
	b	.L18
.L19:
	sub	r3, fp, #364
	sub	r0, fp, #372
	ldr	r2, .L24+8
	mov	r1, #0
	bl	pthread_create
.L18:
	ldr	r3, [fp, #-368]
	sub	r2, r3, #1
	str	r2, [fp, #-368]
	cmp	r3, #0
	bne	.L19
	mov	r3, #20
	str	r3, [fp, #-368]
	b	.L20
.L21:
	sub	r3, fp, #364
	sub	r0, fp, #376
	ldr	r2, .L24+12
	mov	r1, #0
	bl	pthread_create
.L20:
	ldr	r3, [fp, #-368]
	sub	r2, r3, #1
	str	r2, [fp, #-368]
	cmp	r3, #0
	bne	.L21
	mov	r0, #2
	bl	sleep
	mov	r3, #0
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC2
	.word	.LC1
	.word	consumer
	.word	producer
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
