	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function emulate_mtspr
_emulate_mtspr:                         ## @emulate_mtspr
	.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
	movq	%rdx, %rbx
	movq	_curthread@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_SPR_DSCR@GOTPCREL(%rip), %rdx
	movq	_SPR_DSCRP@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rdx)
	je	LBB0_2
## %bb.1:
	cmpl	%edi, (%rax)
	jne	LBB0_4
LBB0_2:
	movq	_cpu_features2@GOTPCREL(%rip), %rdx
	movq	_PPC_FEATURE2_DSCR@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	testl	%edi, (%rdx)
	je	LBB0_4
## %bb.3:
	movq	_PCB_CDSCR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	(%rcx), %rcx
	orl	%edx, 4(%rcx)
	movq	8(%rbx), %rdx
	movslq	%esi, %rsi
	movl	(%rdx,%rsi,4), %edi
	movl	%edi, (%rcx)
	movl	(%rax), %edi
	movl	(%rdx,%rsi,4), %esi
	callq	_mtspr
	addl	$4, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_4:
	movq	_SIGILL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_curthread,8,3                  ## @curthread
	.comm	_SPR_DSCR,4,2                   ## @SPR_DSCR
	.comm	_SPR_DSCRP,4,2                  ## @SPR_DSCRP
	.comm	_cpu_features2,4,2              ## @cpu_features2
	.comm	_PPC_FEATURE2_DSCR,4,2          ## @PPC_FEATURE2_DSCR
	.comm	_SIGILL,4,2                     ## @SIGILL
	.comm	_PCB_CDSCR,4,2                  ## @PCB_CDSCR
	.no_dead_strip	_emulate_mtspr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function emulate_mtspr
_emulate_mtspr:                         ; @emulate_mtspr
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
                                        ; kill: def $w1 killed $w1 def $x1
Lloh0:
	adrp	x8, _SPR_DSCR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SPR_DSCR@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
Lloh3:
	adrp	x8, _SPR_DSCRP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SPR_DSCRP@GOTPAGEOFF]
	ldr	w10, [x8]
	cmp	w9, w0
	ccmp	w10, w0, #4, ne
	b.ne	LBB0_3
; %bb.1:
Lloh5:
	adrp	x9, _cpu_features2@GOTPAGE
Lloh6:
	ldr	x9, [x9, _cpu_features2@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _PPC_FEATURE2_DSCR@GOTPAGE
Lloh9:
	ldr	x10, [x10, _PPC_FEATURE2_DSCR@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_3
; %bb.2:
	mov	x19, x2
Lloh11:
	adrp	x9, _curthread@GOTPAGE
Lloh12:
	ldr	x9, [x9, _curthread@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
Lloh14:
	adrp	x10, _PCB_CDSCR@GOTPAGE
Lloh15:
	ldr	x10, [x10, _PCB_CDSCR@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	ldr	x9, [x9]
	ldr	w11, [x9, #4]
	orr	w10, w11, w10
	str	w10, [x9, #4]
	ldr	x10, [x2, #8]
	sbfiz	x11, x1, #2, #32
	ldr	w12, [x10, x11]
	str	w12, [x9]
	ldr	w0, [x8]
	ldr	w1, [x10, x11]
	bl	_mtspr
	mov	w0, #0
	ldr	w8, [x19]
	add	w8, w8, #4
	str	w8, [x19]
	b	LBB0_4
LBB0_3:
Lloh17:
	adrp	x8, _SIGILL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SIGILL@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_curthread,8,3                  ; @curthread
	.comm	_SPR_DSCR,4,2                   ; @SPR_DSCR
	.comm	_SPR_DSCRP,4,2                  ; @SPR_DSCRP
	.comm	_cpu_features2,4,2              ; @cpu_features2
	.comm	_PPC_FEATURE2_DSCR,4,2          ; @PPC_FEATURE2_DSCR
	.comm	_SIGILL,4,2                     ; @SIGILL
	.comm	_PCB_CDSCR,4,2                  ; @PCB_CDSCR
	.no_dead_strip	_emulate_mtspr
.subsections_via_symbols
