	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__sem_post                      ## -- Begin function _sem_post
	.p2align	4, 0x90
__sem_post:                             ## @_sem_post
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_sem_check_validity
	movl	$-1, %r14d
	testq	%rax, %rax
	jne	LBB0_7
## %bb.1:
	movq	_SEM_VALUE_MAX@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %ebx
	movl	%ebx, %edi
	callq	_USEM_COUNT
	cmpq	(%r12), %rax
	jge	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	1(%rbx), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_atomic_cmpset_rel_int
	testl	%eax, %eax
	je	LBB0_2
## %bb.5:
	movq	_USEM_HAS_WAITERS@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	testl	%ebx, (%rax)
	je	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	callq	_usem_wake
	jmp	LBB0_7
LBB0_3:
	movq	_EOVERFLOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_7:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SEM_VALUE_MAX,8,3              ## @SEM_VALUE_MAX
	.comm	_EOVERFLOW,4,2                  ## @EOVERFLOW
	.comm	_errno,4,2                      ## @errno
	.comm	_USEM_HAS_WAITERS,4,2           ## @USEM_HAS_WAITERS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__sem_post                      ; -- Begin function _sem_post
	.p2align	2
__sem_post:                             ; @_sem_post
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	bl	_sem_check_validity
	cbnz	x0, LBB0_8
; %bb.1:
Lloh0:
	adrp	x21, _SEM_VALUE_MAX@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SEM_VALUE_MAX@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w20, [x19]
	mov	x0, x20
	bl	_USEM_COUNT
	ldr	x8, [x21]
	cmp	x0, x8
	b.ge	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w2, w20, #1
	mov	x0, x19
	mov	x1, x20
	bl	_atomic_cmpset_rel_int
	cbz	w0, LBB0_2
; %bb.4:
Lloh2:
	adrp	x8, _USEM_HAS_WAITERS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _USEM_HAS_WAITERS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_usem_wake
LBB0_6:
	mov	w0, #0
	b	LBB0_9
LBB0_7:
Lloh5:
	adrp	x8, _EOVERFLOW@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EOVERFLOW@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _errno@GOTPAGE
Lloh9:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh10:
	str	w8, [x9]
LBB0_8:
	mov	w0, #-1
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SEM_VALUE_MAX,8,3              ; @SEM_VALUE_MAX
	.comm	_EOVERFLOW,4,2                  ; @EOVERFLOW
	.comm	_errno,4,2                      ; @errno
	.comm	_USEM_HAS_WAITERS,4,2           ; @USEM_HAS_WAITERS
.subsections_via_symbols
