	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_vgpu_emulate_mmio_write  ## -- Begin function intel_vgpu_emulate_mmio_write
	.p2align	4, 0x90
_intel_vgpu_emulate_mmio_write:         ## @intel_vgpu_emulate_mmio_write
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movl	%esi, %r12d
	movq	%rdi, %rbx
	xorl	%r15d, %r15d
	cmpq	$0, 8(%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	%r14d, %ecx
	xorl	%r8d, %r8d
	callq	_failsafe_emulate_mmio_rw
	jmp	LBB0_17
LBB0_2:
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	16(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_intel_vgpu_gpa_to_mmio_offset
	movl	%eax, %r13d
	xorl	%edi, %edi
	cmpl	$9, %r14d
	setae	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_3
LBB0_15:
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	movl	%r14d, %edx
	callq	_gvt_vgpu_err
LBB0_16:
	movq	%rbx, %rdi
	callq	_mutex_unlock
LBB0_17:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_reg_is_gtt
	testq	%rax, %rax
	je	LBB0_11
## %bb.4:
	movl	%r13d, %edi
	movl	$4, %esi
	callq	_IS_ALIGNED
	xorl	%edi, %edi
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movl	%r13d, %edi
	movl	$8, %esi
	callq	_IS_ALIGNED
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
LBB0_6:
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_15
## %bb.7:
	leal	-4(%r14), %eax
	xorl	%edi, %edi
	testl	$-5, %eax
	setne	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_15
## %bb.8:
	leal	(%r14,%r13), %esi
	decl	%esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_reg_is_gtt
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_15
## %bb.9:
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%r14d, %ecx
	callq	_intel_vgpu_emulate_ggtt_mmio_write
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_15
## %bb.10:
	xorl	%r15d, %r15d
	jmp	LBB0_16
LBB0_11:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_reg_is_mmio
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%r14d, %ecx
	callq	_intel_gvt_hypervisor_write_gpa
	movl	%eax, %r15d
	jmp	LBB0_16
LBB0_13:
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%r14d, %ecx
	xorl	%r8d, %r8d
	callq	_intel_vgpu_mmio_reg_rw
	testl	%eax, %eax
	js	LBB0_14
## %bb.18:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_intel_gvt_mmio_set_accessed
	jmp	LBB0_16
LBB0_14:
	movl	%eax, %r15d
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fail to emulate MMIO write %08x len %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_vgpu_emulate_mmio_write  ; -- Begin function intel_vgpu_emulate_mmio_write
	.p2align	2
_intel_vgpu_emulate_mmio_write:         ; @intel_vgpu_emulate_mmio_write
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x3
	mov	x23, x2
	mov	x25, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x25
	mov	x2, x23
	mov	x3, x20
	mov	w4, #0
	bl	_failsafe_emulate_mmio_rw
	mov	w22, #0
	b	LBB0_5
LBB0_2:
	ldr	x24, [x19, #16]
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x25
	bl	_intel_vgpu_gpa_to_mmio_offset
	mov	x21, x0
	cmp	w20, #8
	cset	w0, hi
	bl	_WARN_ON
	cbz	x0, LBB0_6
LBB0_3:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x20
	bl	_gvt_vgpu_err
LBB0_4:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_5:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x0, x24
	mov	x1, x21
	bl	_reg_is_gtt
	cbz	x0, LBB0_9
; %bb.7:
	mov	x0, x21
	mov	w1, #4
	bl	_IS_ALIGNED
	cbz	w0, LBB0_11
; %bb.8:
	mov	w0, #0
	bl	_WARN_ON
	cbnz	x0, LBB0_3
	b	LBB0_12
LBB0_9:
	mov	x0, x24
	mov	x1, x21
	bl	_reg_is_mmio
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_15
; %bb.10:
	mov	x0, x19
	mov	x1, x25
	mov	x2, x23
	mov	x3, x20
	bl	_intel_gvt_hypervisor_write_gpa
	mov	x22, x0
	b	LBB0_4
LBB0_11:
	mov	x0, x21
	mov	w1, #8
	bl	_IS_ALIGNED
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON
	cbnz	x0, LBB0_3
LBB0_12:
	cmp	w20, #4
	ccmp	w20, #8, #4, ne
	cset	w0, ne
	bl	_WARN_ON
	cbnz	x0, LBB0_3
; %bb.13:
	add	w8, w20, w21
	sub	w1, w8, #1
	mov	x0, x24
	bl	_reg_is_gtt
	cmp	x0, #0
	cset	w0, eq
	bl	_WARN_ON
	cbnz	x0, LBB0_3
; %bb.14:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	mov	x3, x20
	bl	_intel_vgpu_emulate_ggtt_mmio_write
	mov	x22, x0
	cbnz	w0, LBB0_3
	b	LBB0_4
LBB0_15:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x23
	mov	x3, x20
	mov	w4, #0
	bl	_intel_vgpu_mmio_reg_rw
	tbnz	w0, #31, LBB0_17
; %bb.16:
	mov	x0, x24
	mov	x1, x21
	bl	_intel_gvt_mmio_set_accessed
	mov	w22, #0
	b	LBB0_4
LBB0_17:
	mov	x22, x0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fail to emulate MMIO write %08x len %d\n"

.subsections_via_symbols
