	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__libc_sem_trywait_compat       ## -- Begin function _libc_sem_trywait_compat
	.p2align	4, 0x90
__libc_sem_trywait_compat:              ## @_libc_sem_trywait_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_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movq	(%rbx), %rdi
	cmpq	$0, (%rdi)
	je	LBB0_2
## %bb.9:
	movl	12(%rdi), %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_ksem_trywait                   ## TAILCALL
LBB0_2:
	movl	8(%rdi), %esi
	testl	%esi, %esi
	jle	LBB0_7
## %bb.3:
	addq	$8, %rdi
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	leal	-1(%rsi), %edx
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_atomic_cmpset_acq_int
	testq	%rax, %rax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	(%rbx), %rdi
	movl	8(%rdi), %esi
	addq	$8, %rdi
	testl	%esi, %esi
	jg	LBB0_4
LBB0_7:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_8
LBB0_5:
	xorl	%r14d, %r14d
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.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_trywait_compat       ; -- Begin function _libc_sem_trywait_compat
	.p2align	2
__libc_sem_trywait_compat:              ; @_libc_sem_trywait_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_5
; %bb.4:
	ldr	w0, [x0, #12]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_ksem_trywait
LBB0_5:
	ldr	w1, [x0, #8]!
	cmp	w1, #1
	b.lt	LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	sub	w2, w1, #1
	bl	_atomic_cmpset_acq_int
	cbnz	x0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [x19]
	ldr	w1, [x0, #8]!
	cmp	w1, #0
	b.gt	LBB0_6
LBB0_8:
Lloh0:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _errno@GOTPAGE
Lloh4:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh5:
	str	w8, [x9]
	b	LBB0_1
LBB0_9:
	mov	w0, #0
	b	LBB0_2
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
