	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sem_post_multiple              ## -- Begin function sem_post_multiple
	.p2align	4, 0x90
_sem_post_multiple:                     ## @sem_post_multiple
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	jle	LBB0_2
## %bb.1:
	movq	%rdi, %rbx
	movq	(%rdi), %r13
	testq	%r13, %r13
	je	LBB0_2
## %bb.3:
	movl	%esi, %r15d
	leaq	4(%r13), %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.4:
	cmpq	$0, (%rbx)
	je	LBB0_5
## %bb.6:
	movl	(%r13), %esi
	movq	_SEM_VALUE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subl	%r15d, %eax
	cmpl	%eax, %esi
	jle	LBB0_7
## %bb.9:
	movq	_ERANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	jmp	LBB0_10
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	testl	%r12d, %r12d
	je	LBB0_12
LBB0_13:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	%r12d, (%rax)
LBB0_14:
	movl	$-1, %eax
	jmp	LBB0_15
LBB0_5:
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	jmp	LBB0_14
LBB0_7:
	leal	(%rsi,%r15), %eax
	movl	%eax, (%r13)
	xorl	%r12d, %r12d
	testl	%esi, %esi
	jns	LBB0_10
## %bb.8:
	negl	%esi
	movl	8(%r13), %edi
	cmpl	%r15d, %esi
	cmovgel	%r15d, %esi
	callq	_pte_osSemaphorePost
LBB0_10:
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	testl	%r12d, %r12d
	jne	LBB0_13
LBB0_12:
	xorl	%eax, %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SEM_VALUE_MAX,4,2              ## @SEM_VALUE_MAX
	.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_multiple              ; -- Begin function sem_post_multiple
	.p2align	2
_sem_post_multiple:                     ; @sem_post_multiple
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	cmp	w1, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x22, x0
	ldr	x23, [x0]
	cbz	x23, LBB0_6
; %bb.2:
	mov	x20, x1
	add	x19, x23, #4
	mov	x0, x19
	bl	_pthread_mutex_lock
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.3:
	ldr	x8, [x22]
	cbz	x8, LBB0_9
; %bb.4:
	ldr	w8, [x23]
Lloh0:
	adrp	x9, _SEM_VALUE_MAX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SEM_VALUE_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sub	w9, w9, w20
	cmp	w8, w9
	b.le	LBB0_10
; %bb.5:
Lloh3:
	adrp	x8, _ERANGE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	b	LBB0_13
LBB0_6:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x8]
	cbz	w21, LBB0_14
LBB0_7:
Lloh9:
	adrp	x8, _errno@GOTPAGE
Lloh10:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh11:
	str	w21, [x8]
LBB0_8:
	mov	w0, #-1
	b	LBB0_15
LBB0_9:
	mov	x0, x19
	bl	_pthread_mutex_unlock
	b	LBB0_8
LBB0_10:
	add	w9, w8, w20
	str	w9, [x23]
	tbz	w8, #31, LBB0_12
; %bb.11:
	ldr	w0, [x23, #8]
	neg	w9, w8
	cmp	w9, w20
	csneg	w1, w20, w8, ge
	bl	_pte_osSemaphorePost
LBB0_12:
	mov	w21, #0
LBB0_13:
	mov	x0, x19
	bl	_pthread_mutex_unlock
	cbnz	w21, LBB0_7
LBB0_14:
	mov	w0, #0
LBB0_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotStr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SEM_VALUE_MAX,4,2              ; @SEM_VALUE_MAX
	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
