	.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), %r12
	testq	%r12, %r12
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	leaq	8(%r12), %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_14
## %bb.3:
	cmpq	$0, (%rbx)
	je	LBB0_4
## %bb.5:
	movq	(%r12), %rax
	movq	_SEM_VALUE_MAX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_9
## %bb.6:
	movl	12(%r12), %edi
	movl	$1, %esi
	callq	_pte_osSemaphorePost
	movq	(%r12), %rcx
	leaq	1(%rcx), %rdx
	movq	%rdx, (%r12)
	xorl	%r15d, %r15d
	testq	%rcx, %rcx
	jns	LBB0_11
## %bb.7:
	movq	_PTE_OS_OK@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	je	LBB0_11
## %bb.8:
	movq	%rcx, (%r12)
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testl	%r15d, %r15d
	je	LBB0_13
LBB0_14:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	%r15d, (%rax)
LBB0_15:
	movl	$-1, %eax
LBB0_16:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	jmp	LBB0_15
LBB0_9:
	movq	_ERANGE@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %r15d
LBB0_11:
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	testl	%r15d, %r15d
	jne	LBB0_14
LBB0_13:
	xorl	%eax, %eax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SEM_VALUE_MAX,8,3              ## @SEM_VALUE_MAX
	.comm	_PTE_OS_OK,8,3                  ## @PTE_OS_OK
	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_errno,4,2                      ## @errno
.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
	ldr	x22, [x0]
	cbz	x22, LBB0_7
; %bb.1:
	mov	x21, x0
	add	x19, x22, #8
	mov	x0, x19
	bl	_pthread_mutex_lock
	mov	x20, x0
	cbnz	w0, LBB0_8
; %bb.2:
	ldr	x8, [x21]
	cbz	x8, LBB0_11
; %bb.3:
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _SEM_VALUE_MAX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SEM_VALUE_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_12
; %bb.4:
	ldr	w0, [x22, #12]
	mov	w1, #1
	bl	_pte_osSemaphorePost
	mov	w20, #0
	ldr	x8, [x22]
	add	x9, x8, #1
	str	x9, [x22]
	tbz	x8, #63, LBB0_14
; %bb.5:
Lloh3:
	adrp	x9, _PTE_OS_OK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PTE_OS_OK@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x0, x9
	b.eq	LBB0_14
; %bb.6:
	str	x8, [x22]
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_13
LBB0_7:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w20, [x8]
	cbz	w20, LBB0_15
LBB0_8:
Lloh11:
	adrp	x8, _errno@GOTPAGE
Lloh12:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh13:
	str	w20, [x8]
LBB0_9:
	mov	w0, #-1
LBB0_10:
	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
LBB0_11:
	mov	x0, x19
	bl	_pthread_mutex_unlock
	b	LBB0_9
LBB0_12:
Lloh14:
	adrp	x8, _ERANGE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
LBB0_13:
	ldr	w20, [x8]
LBB0_14:
	mov	x0, x19
	bl	_pthread_mutex_unlock
	cbnz	w20, LBB0_8
LBB0_15:
	mov	w0, #0
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SEM_VALUE_MAX,8,3              ; @SEM_VALUE_MAX
	.comm	_PTE_OS_OK,8,3                  ; @PTE_OS_OK
	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
