	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmcr_set
_pmcr_set:                              ## @pmcr_set
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movq	(%rsi), %rax
	movq	8(%rax), %rcx
	testq	%rcx, %rcx
	js	LBB0_1
## %bb.3:
	movq	_npstates@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jge	LBB0_1
## %bb.4:
	movq	(%rax), %rsi
	movq	_PMCR_LOWERPS_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movq	%rsi, %rax
	shlq	%cl, %rax
	movq	_PMCR_LOWERPS_MASK@GOTPCREL(%rip), %rcx
	andq	(%rcx), %rax
	movq	_PMCR_UPPERPS_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shlq	%cl, %rsi
	movq	_PMCR_UPPERPS_MASK@GOTPCREL(%rip), %rcx
	andq	(%rcx), %rsi
	orq	%rax, %rsi
	movq	_PMCR_VERSION_1@GOTPCREL(%rip), %rax
	orq	(%rax), %rsi
	movq	_SPR_PMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_mtspr
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_powerpc_sync
	xorl	%eax, %eax
	callq	_isync
	jmp	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_npstates,8,3                   ## @npstates
	.comm	_PMCR_LOWERPS_SHIFT,8,3         ## @PMCR_LOWERPS_SHIFT
	.comm	_PMCR_LOWERPS_MASK,8,3          ## @PMCR_LOWERPS_MASK
	.comm	_PMCR_UPPERPS_SHIFT,8,3         ## @PMCR_UPPERPS_SHIFT
	.comm	_PMCR_UPPERPS_MASK,8,3          ## @PMCR_UPPERPS_MASK
	.comm	_PMCR_VERSION_1,8,3             ## @PMCR_VERSION_1
	.comm	_SPR_PMCR,4,2                   ## @SPR_PMCR
	.no_dead_strip	_pmcr_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pmcr_set
_pmcr_set:                              ; @pmcr_set
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	cbz	x1, LBB0_4
; %bb.1:
	ldr	x8, [x1]
	ldr	x9, [x8, #8]
	tbnz	x9, #63, LBB0_4
; %bb.2:
Lloh0:
	adrp	x10, _npstates@GOTPAGE
Lloh1:
	ldr	x10, [x10, _npstates@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ge	LBB0_4
; %bb.3:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _PMCR_LOWERPS_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PMCR_LOWERPS_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	lsl	x9, x8, x9
Lloh6:
	adrp	x10, _PMCR_LOWERPS_MASK@GOTPAGE
Lloh7:
	ldr	x10, [x10, _PMCR_LOWERPS_MASK@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	and	x9, x9, x10
Lloh9:
	adrp	x10, _PMCR_UPPERPS_SHIFT@GOTPAGE
Lloh10:
	ldr	x10, [x10, _PMCR_UPPERPS_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x10]
	lsl	x8, x8, x10
Lloh12:
	adrp	x10, _PMCR_UPPERPS_MASK@GOTPAGE
Lloh13:
	ldr	x10, [x10, _PMCR_UPPERPS_MASK@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x10]
	and	x8, x8, x10
Lloh15:
	adrp	x10, _PMCR_VERSION_1@GOTPAGE
Lloh16:
	ldr	x10, [x10, _PMCR_VERSION_1@GOTPAGEOFF]
	orr	x8, x8, x9
Lloh17:
	ldr	x9, [x10]
	orr	x1, x8, x9
Lloh18:
	adrp	x8, _SPR_PMCR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SPR_PMCR@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_mtspr
	bl	_powerpc_sync
	bl	_isync
	mov	w0, #0
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_4:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_npstates,8,3                   ; @npstates
	.comm	_PMCR_LOWERPS_SHIFT,8,3         ; @PMCR_LOWERPS_SHIFT
	.comm	_PMCR_LOWERPS_MASK,8,3          ; @PMCR_LOWERPS_MASK
	.comm	_PMCR_UPPERPS_SHIFT,8,3         ; @PMCR_UPPERPS_SHIFT
	.comm	_PMCR_UPPERPS_MASK,8,3          ; @PMCR_UPPERPS_MASK
	.comm	_PMCR_VERSION_1,8,3             ; @PMCR_VERSION_1
	.comm	_SPR_PMCR,4,2                   ; @SPR_PMCR
	.no_dead_strip	_pmcr_set
.subsections_via_symbols
