	.file	"852892.c"
	.intel_syntax noprefix
	.text
	.type	remove_sem, @function
remove_sem:
.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	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	sem_unlink@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	remove_sem, .-remove_sem
	.section	.rodata
.LC0:
	.string	"/glibc-tst-sem4"
	.align 8
.LC1:
	.string	"sem_open not supported.  Oh well."
	.align 8
.LC2:
	.string	"sem_open not allowed.  Oh well."
.LC3:
	.string	"sem_open: %m\n"
.LC4:
	.string	"2nd sem_open didn't fail"
	.align 8
.LC5:
	.string	"2nd sem_open returned wrong error"
.LC6:
	.string	"getvalue failed"
	.align 8
.LC7:
	.string	"initial value wrong: got %d, expected 1\n"
.LC8:
	.string	"1st sem_wait failed"
.LC9:
	.string	"fork failed: %m\n"
.LC10:
	.string	"child: getvalue failed"
	.align 8
.LC11:
	.string	"child: value wrong: got %d, expect 0\n"
.LC12:
	.string	"child: post failed"
.LC13:
	.string	"2nd sem_wait failed"
.LC14:
	.string	"parent: 2nd getvalue failed"
	.align 8
.LC15:
	.string	"parent: value wrong: got %d, expected 0\n"
	.text
	.globl	main
	.type	main, @function
main:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	ecx, 1
	mov	edx, 384
	mov	esi, 64
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L3
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 38
	jne	.L4
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, 0
	jmp	.L19
.L4:
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 13
	jne	.L6
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	eax, 0
	jmp	.L19
.L6:
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L19
.L3:
	lea	rsi, .LC0[rip]
	lea	rdi, remove_sem[rip]
	call	on_exit@PLT
	mov	ecx, 1
	mov	edx, 384
	mov	esi, 192
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	sem_open@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	je	.L7
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L19
.L7:
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 17
	je	.L8
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L19
.L8:
	lea	rdx, -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	sem_getvalue@PLT
	cmp	eax, -1
	jne	.L9
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L19
.L9:
	mov	eax, DWORD PTR -32[rbp]
	cmp	eax, 1
	je	.L10
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L19
.L10:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	edi, eax
	mov	eax, 0
	call	TEMP_FAILURE_RETRY@PLT
	cmp	eax, -1
	jne	.L11
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L19
.L11:
	call	fork@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], -1
	jne	.L12
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L19
.L12:
	cmp	DWORD PTR -28[rbp], 0
	jne	.L13
	lea	rdx, -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	sem_getvalue@PLT
	cmp	eax, -1
	jne	.L14
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L19
.L14:
	mov	eax, DWORD PTR -32[rbp]
	test	eax, eax
	je	.L15
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L19
.L15:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	cmp	eax, -1
	jne	.L16
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L19
.L13:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	edi, eax
	mov	eax, 0
	call	TEMP_FAILURE_RETRY@PLT
	cmp	eax, -1
	jne	.L17
	lea	rdi, .LC13[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L19
.L17:
	lea	rdx, -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	sem_getvalue@PLT
	cmp	eax, -1
	jne	.L18
	lea	rdi, .LC14[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L19
.L18:
	mov	eax, DWORD PTR -32[rbp]
	test	eax, eax
	je	.L16
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L19
.L16:
	mov	eax, 0
.L19:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"852892.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	remove_sem, %function
remove_sem:
	@ 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	r0, [fp, #-12]
	bl	sem_unlink
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	remove_sem, .-remove_sem
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/glibc-tst-sem4\000"
	.align	2
.LC1:
	.ascii	"sem_open not supported.  Oh well.\000"
	.align	2
.LC2:
	.ascii	"sem_open not allowed.  Oh well.\000"
	.align	2
.LC3:
	.ascii	"sem_open: %m\012\000"
	.align	2
.LC4:
	.ascii	"2nd sem_open didn't fail\000"
	.align	2
.LC5:
	.ascii	"2nd sem_open returned wrong error\000"
	.align	2
.LC6:
	.ascii	"getvalue failed\000"
	.align	2
.LC7:
	.ascii	"initial value wrong: got %d, expected 1\012\000"
	.align	2
.LC8:
	.ascii	"1st sem_wait failed\000"
	.align	2
.LC9:
	.ascii	"fork failed: %m\012\000"
	.align	2
.LC10:
	.ascii	"child: getvalue failed\000"
	.align	2
.LC11:
	.ascii	"child: value wrong: got %d, expect 0\012\000"
	.align	2
.LC12:
	.ascii	"child: post failed\000"
	.align	2
.LC13:
	.ascii	"2nd sem_wait failed\000"
	.align	2
.LC14:
	.ascii	"parent: 2nd getvalue failed\000"
	.align	2
.LC15:
	.ascii	"parent: value wrong: got %d, expected 0\012\000"
	.align	2
.LC16:
	.word	__stack_chk_guard
	.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	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	mov	r2, #384
	mov	r1, #64
	ldr	r0, .L21+4
	bl	sem_open
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L3
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #38
	bne	.L4
	ldr	r0, .L21+8
	bl	puts
	mov	r3, #0
	b	.L19
.L4:
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #13
	bne	.L6
	ldr	r0, .L21+12
	bl	puts
	mov	r3, #0
	b	.L19
.L6:
	ldr	r0, .L21+16
	bl	printf
	mov	r3, #1
	b	.L19
.L3:
	ldr	r1, .L21+4
	ldr	r0, .L21+20
	bl	on_exit
	mov	r3, #1
	mov	r2, #384
	mov	r1, #192
	ldr	r0, .L21+4
	bl	sem_open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L7
	ldr	r0, .L21+24
	bl	puts
	mov	r3, #1
	b	.L19
.L7:
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #17
	beq	.L8
	ldr	r0, .L21+28
	bl	puts
	mov	r3, #1
	b	.L19
.L8:
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, [fp, #-20]
	bl	sem_getvalue
	mov	r3, r0
	cmn	r3, #1
	bne	.L9
	ldr	r0, .L21+32
	bl	puts
	mov	r3, #1
	b	.L19
.L9:
	ldr	r3, [fp, #-24]
	cmp	r3, #1
	beq	.L10
	ldr	r3, [fp, #-24]
	mov	r1, r3
	ldr	r0, .L21+36
	bl	printf
	mov	r3, #1
	b	.L19
.L10:
	ldr	r0, [fp, #-20]
	bl	sem_wait
	mov	r3, r0
	mov	r0, r3
	bl	TEMP_FAILURE_RETRY
	mov	r3, r0
	cmn	r3, #1
	bne	.L11
	ldr	r0, .L21+40
	bl	puts
	mov	r3, #1
	b	.L19
.L11:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L12
	ldr	r0, .L21+44
	bl	printf
	mov	r3, #1
	b	.L19
.L12:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L13
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, [fp, #-20]
	bl	sem_getvalue
	mov	r3, r0
	cmn	r3, #1
	bne	.L14
	ldr	r0, .L21+48
	bl	puts
	mov	r3, #1
	b	.L19
.L14:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L15
	ldr	r3, [fp, #-24]
	mov	r1, r3
	ldr	r0, .L21+52
	bl	printf
	mov	r3, #1
	b	.L19
.L15:
	ldr	r0, [fp, #-20]
	bl	sem_post
	mov	r3, r0
	cmn	r3, #1
	bne	.L16
	ldr	r0, .L21+56
	bl	puts
	mov	r3, #1
	b	.L19
.L13:
	ldr	r0, [fp, #-20]
	bl	sem_wait
	mov	r3, r0
	mov	r0, r3
	bl	TEMP_FAILURE_RETRY
	mov	r3, r0
	cmn	r3, #1
	bne	.L17
	ldr	r0, .L21+60
	bl	puts
	mov	r3, #1
	b	.L19
.L17:
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, [fp, #-20]
	bl	sem_getvalue
	mov	r3, r0
	cmn	r3, #1
	bne	.L18
	ldr	r0, .L21+64
	bl	puts
	mov	r3, #1
	b	.L19
.L18:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L16
	ldr	r3, [fp, #-24]
	mov	r1, r3
	ldr	r0, .L21+68
	bl	printf
	mov	r3, #1
	b	.L19
.L16:
	mov	r3, #0
.L19:
	ldr	r2, .L21
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L20
	bl	__stack_chk_fail
.L20:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC16
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	remove_sem
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
