	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pte_setthreadpriority          ## -- Begin function pte_setthreadpriority
	.p2align	4, 0x90
_pte_setthreadpriority:                 ## @pte_setthreadpriority
	.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
	movl	%edx, %r12d
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	%esi, %edi
	callq	_sched_get_priority_min
	cmpl	%r12d, %eax
	jg	LBB0_2
## %bb.1:
	movl	%ebx, %edi
	callq	_sched_get_priority_max
	cmpl	%r12d, %eax
	jge	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	4(%r14), %r15
	movq	%r15, %rdi
	callq	_pthread_mutex_lock
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.4:
	movl	8(%r14), %edi
	movl	%r12d, %esi
	callq	_pte_osThreadSetPriority
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_7
LBB0_6:
	movl	%r12d, (%r14)
	xorl	%ebx, %ebx
LBB0_7:
	movq	%r15, %rdi
	callq	_pthread_mutex_unlock
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pte_setthreadpriority          ; -- Begin function pte_setthreadpriority
	.p2align	2
_pte_setthreadpriority:                 ; @pte_setthreadpriority
	.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, x2
	mov	x21, x1
	mov	x20, x0
	mov	x0, x1
	bl	_sched_get_priority_min
	cmp	w0, w19
	b.gt	LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_sched_get_priority_max
	cmp	w0, w19
	b.ge	LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
LBB0_3:
	mov	x0, x22
	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_4:
	add	x21, x20, #4
	mov	x0, x21
	bl	_pthread_mutex_lock
	mov	x22, x0
	cbnz	w0, LBB0_3
; %bb.5:
	ldr	w0, [x20, #8]
	mov	x1, x19
	bl	_pte_osThreadSetPriority
	cbz	x0, LBB0_7
; %bb.6:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	b	LBB0_8
LBB0_7:
	mov	w22, #0
	str	w19, [x20]
LBB0_8:
	mov	x0, x21
	bl	_pthread_mutex_unlock
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
