	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function failsafe_emulate_mmio_rw
_failsafe_emulate_mmio_rw:              ## @failsafe_emulate_mmio_rw
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.1:
	movq	%rdx, %r15
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.2:
	movl	%r8d, %r12d
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	16(%rdi), %r14
	callq	_mutex_lock
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_intel_vgpu_gpa_to_mmio_offset
	movl	%eax, %r13d
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_reg_is_mmio
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movq	%r15, %rdx
	testl	%r12d, %r12d
	je	LBB0_5
## %bb.4:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_intel_vgpu_default_mmio_read
	jmp	LBB0_11
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_reg_is_gtt
	testq	%rax, %rax
	je	LBB0_11
## %bb.7:
	movl	(%r14), %eax
	subl	%eax, %r13d
	movq	8(%rbx), %rax
	addq	(%rax), %r13
	testl	%r12d, %r12d
	je	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	movq	%r13, %rsi
	jmp	LBB0_10
LBB0_5:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_intel_vgpu_default_mmio_write
	jmp	LBB0_11
LBB0_9:
	movq	%r13, %rdi
	movq	%r15, %rsi
LBB0_10:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_memcpy
LBB0_11:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_failsafe_emulate_mmio_rw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function failsafe_emulate_mmio_rw
_failsafe_emulate_mmio_rw:              ; @failsafe_emulate_mmio_rw
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	cbz	x0, LBB0_5
; %bb.1:
	mov	x21, x2
	cbz	x2, LBB0_5
; %bb.2:
	mov	x22, x4
	mov	x20, x3
	mov	x23, x1
	mov	x19, x0
	ldr	x24, [x0, #16]
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x23
	bl	_intel_vgpu_gpa_to_mmio_offset
	mov	x23, x0
	mov	x0, x24
	mov	x1, x23
	bl	_reg_is_mmio
	cbz	x0, LBB0_6
; %bb.3:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x21
	mov	x3, x20
	cbz	w22, LBB0_9
; %bb.4:
	bl	_intel_vgpu_default_mmio_read
	b	LBB0_12
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x0, x24
	mov	x1, x23
	bl	_reg_is_gtt
	cbz	x0, LBB0_12
; %bb.7:
	ldr	w8, [x24]
	ldr	x9, [x19, #8]
	ldr	x9, [x9]
	sub	w8, w23, w8
	add	x1, x9, x8
	cbz	w22, LBB0_10
; %bb.8:
	mov	x0, x21
	b	LBB0_11
LBB0_9:
	bl	_intel_vgpu_default_mmio_write
	b	LBB0_12
LBB0_10:
	mov	x0, x1
	mov	x1, x21
LBB0_11:
	mov	x2, x20
	bl	_memcpy
LBB0_12:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_mutex_unlock
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_failsafe_emulate_mmio_rw
.subsections_via_symbols
