	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__libc_sem_close_compat         ## -- Begin function _libc_sem_close_compat
	.p2align	4, 0x90
__libc_sem_close_compat:                ## @_libc_sem_close_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_sem_check_validity
	movl	$-1, %r14d
	testq	%rax, %rax
	je	LBB0_1
LBB0_6:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movq	(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.3:
	movq	_named_sems_mtx@GOTPCREL(%rip), %rdi
	callq	__pthread_mutex_lock
	movq	(%rbx), %rax
	movl	8(%rax), %edi
	callq	_ksem_close
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_named_sems_mtx@GOTPCREL(%rip), %rdi
	callq	__pthread_mutex_unlock
	jmp	LBB0_6
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_6
LBB0_5:
	movq	(%rbx), %rdi
	movq	_entry@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LIST_REMOVE
	movq	_named_sems_mtx@GOTPCREL(%rip), %rdi
	callq	__pthread_mutex_unlock
	movq	(%rbx), %rdi
	callq	_sem_free
	movq	$0, (%rbx)
	movq	%rbx, %rdi
	callq	_free
	xorl	%r14d, %r14d
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_named_sems_mtx,4,2             ## @named_sems_mtx
	.comm	_entry,4,2                      ## @entry
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__libc_sem_close_compat         ; -- Begin function _libc_sem_close_compat
	.p2align	2
__libc_sem_close_compat:                ; @_libc_sem_close_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	x8, [x19]
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.4:
Lloh0:
	adrp	x0, _named_sems_mtx@GOTPAGE
Lloh1:
	ldr	x0, [x0, _named_sems_mtx@GOTPAGEOFF]
	bl	__pthread_mutex_lock
	ldr	x8, [x19]
	ldr	w0, [x8, #8]
	bl	_ksem_close
	cbz	x0, LBB0_7
; %bb.5:
Lloh2:
	adrp	x0, _named_sems_mtx@GOTPAGE
Lloh3:
	ldr	x0, [x0, _named_sems_mtx@GOTPAGEOFF]
	bl	__pthread_mutex_unlock
	b	LBB0_1
LBB0_6:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _errno@GOTPAGE
Lloh8:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh9:
	str	w8, [x9]
	b	LBB0_1
LBB0_7:
	ldr	x0, [x19]
Lloh10:
	adrp	x8, _entry@GOTPAGE
Lloh11:
	ldr	x8, [x8, _entry@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	bl	_LIST_REMOVE
Lloh13:
	adrp	x0, _named_sems_mtx@GOTPAGE
Lloh14:
	ldr	x0, [x0, _named_sems_mtx@GOTPAGEOFF]
	bl	__pthread_mutex_unlock
	ldr	x0, [x19]
	bl	_sem_free
	str	xzr, [x19]
	mov	x0, x19
	bl	_free
	mov	w0, #0
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_named_sems_mtx,4,2             ; @named_sems_mtx
	.comm	_entry,4,2                      ; @entry
.subsections_via_symbols
