	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__libc_sem_destroy_compat       ## -- Begin function _libc_sem_destroy_compat
	.p2align	4, 0x90
__libc_sem_destroy_compat:              ## @_libc_sem_destroy_compat
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	callq	_sem_check_validity
	movq	%rax, %rcx
	movl	$-1, %eax
	testq	%rcx, %rcx
	je	LBB0_1
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_1:
	movq	(%rbx), %rdi
	cmpq	$0, (%rdi)
	je	LBB0_2
## %bb.5:
	movl	24(%rdi), %edi
	callq	_ksem_destroy
	testl	%eax, %eax
	jne	LBB0_8
## %bb.6:
	movq	(%rbx), %rdi
	jmp	LBB0_7
LBB0_2:
	cmpq	$0, 8(%rdi)
	jle	LBB0_4
## %bb.3:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_errno@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	jmp	LBB0_8
LBB0_4:
	movq	$0, 16(%rdi)
LBB0_7:
	callq	_sem_free
	xorl	%eax, %eax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_errno,4,2                      ## @errno
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__libc_sem_destroy_compat       ; -- Begin function _libc_sem_destroy_compat
	.p2align	2
__libc_sem_destroy_compat:              ; @_libc_sem_destroy_compat
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_sem_check_validity
	cbz	x0, LBB0_3
LBB0_1:
	mov	w0, #-1
LBB0_2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_3:
	ldr	x0, [x19]
	ldr	x8, [x0]
	cbz	x8, LBB0_6
; %bb.4:
	ldr	w0, [x0, #24]
	bl	_ksem_destroy
	cbnz	w0, LBB0_2
; %bb.5:
	ldr	x0, [x19]
	b	LBB0_9
LBB0_6:
	ldr	x8, [x0, #8]
	cmp	x8, #1
	b.lt	LBB0_8
; %bb.7:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _errno@GOTPAGE
Lloh4:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh5:
	str	w8, [x9]
	b	LBB0_1
LBB0_8:
	str	xzr, [x0, #16]
LBB0_9:
	bl	_sem_free
	mov	w0, #0
	b	LBB0_2
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
