	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msr_bitmap_change_access       ## -- Begin function msr_bitmap_change_access
	.p2align	4, 0x90
_msr_bitmap_change_access:              ## @msr_bitmap_change_access
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
                                        ## kill: def $esi killed $esi def $rsi
	cmpl	$8191, %esi                     ## imm = 0x1FFF
	jg	LBB0_6
## %bb.1:
	leal	7(%rsi), %eax
	testl	%esi, %esi
	cmovnsl	%esi, %eax
	sarl	$3, %eax
	movq	_MSR_BITMAP_ACCESS_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	andb	$7, %sil
	movl	$1, %r8d
	movl	%esi, %ecx
	shll	%cl, %r8d
	andl	%edx, %r9d
	movslq	%eax, %rsi
	movb	(%rdi,%rsi), %al
	movl	%eax, %ecx
	orb	%r8b, %cl
	movl	%r8d, %r10d
	notb	%r10b
	andb	%r10b, %al
	testl	%r9d, %r9d
	movzbl	%cl, %ecx
	movzbl	%al, %eax
	cmovel	%ecx, %eax
	movb	%al, (%rdi,%rsi)
	movq	_MSR_BITMAP_ACCESS_WRITE@GOTPCREL(%rip), %rcx
	movb	2048(%rdi,%rsi), %al
	testl	%edx, (%rcx)
	je	LBB0_3
## %bb.2:
	andb	%r10b, %al
	jmp	LBB0_4
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbp
	retq
LBB0_3:
	orb	%r8b, %al
LBB0_4:
	movb	%al, 2048(%rdi,%rsi)
	xorl	%eax, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MSR_BITMAP_ACCESS_READ,4,2     ## @MSR_BITMAP_ACCESS_READ
	.comm	_MSR_BITMAP_ACCESS_WRITE,4,2    ## @MSR_BITMAP_ACCESS_WRITE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msr_bitmap_change_access       ; -- Begin function msr_bitmap_change_access
	.p2align	2
_msr_bitmap_change_access:              ; @msr_bitmap_change_access
	.cfi_startproc
; %bb.0:
	cmp	w1, #2, lsl #12                 ; =8192
	b.ge	LBB0_3
; %bb.1:
	add	w8, w1, #7
	cmp	w1, #0
	csel	w8, w8, w1, lt
	and	w9, w1, #0x7
Lloh0:
	adrp	x10, _MSR_BITMAP_ACCESS_READ@GOTPAGE
Lloh1:
	ldr	x10, [x10, _MSR_BITMAP_ACCESS_READ@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	mov	w11, #1
	lsl	w9, w11, w9
	sbfx	x8, x8, #3, #29
	ldrb	w11, [x0, x8]
	orr	w12, w11, w9
	bic	w11, w11, w9
	tst	w10, w2
	csel	w10, w12, w11, eq
	strb	w10, [x0, x8]
	add	x10, x8, #2048
Lloh3:
	adrp	x8, _MSR_BITMAP_ACCESS_WRITE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MSR_BITMAP_ACCESS_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldrb	w11, [x0, x10]
	tst	w8, w2
	b.eq	LBB0_4
; %bb.2:
	mov	w8, #0
	mvn	w9, w9
	and	w9, w11, w9
	b	LBB0_5
LBB0_3:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ret
LBB0_4:
	mov	w8, #0
	orr	w9, w11, w9
LBB0_5:
	strb	w9, [x0, x10]
	mov	x0, x8
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MSR_BITMAP_ACCESS_READ,4,2     ; @MSR_BITMAP_ACCESS_READ
	.comm	_MSR_BITMAP_ACCESS_WRITE,4,2    ; @MSR_BITMAP_ACCESS_WRITE
.subsections_via_symbols
