	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function emulate_pci_bar_write
_emulate_pci_bar_write:                 ## @emulate_pci_bar_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	(%rdx), %r12d
	movl	%esi, %edi
	movl	$8, %esi
	callq	_IS_ALIGNED
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_vgpu_cfg_space
	cmpl	$-1, %r12d
	je	LBB0_1
## %bb.8:
	movq	_PCI_COMMAND@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_PCI_COMMAND_MEMORY@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r13d
	andl	(%rax,%rcx,4), %r13d
	leal	-128(%rbx), %eax
	cmpl	$2, %eax
	jb	LBB0_11
## %bb.9:
	leal	-130(%rbx), %eax
	cmpl	$1, %eax
	ja	LBB0_12
## %bb.10:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_trap_gttmmio
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	callq	_intel_vgpu_write_pci_bar
	movq	%r14, %rdi
	movl	%r13d, %esi
	jmp	LBB0_4
LBB0_1:
	movq	(%r14), %rax
	leal	-128(%rbx), %ecx
	cmpl	$2, %ecx
	jb	LBB0_5
## %bb.2:
	leal	-130(%rbx), %ecx
	cmpl	$1, %ecx
	ja	LBB0_7
## %bb.3:
	movq	_INTEL_GVT_PCI_BAR_GTTMMIO@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%edx, %edx
	subl	(%rax,%rcx,4), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r15d, %ecx
	callq	_intel_vgpu_write_pci_bar
	movq	%r14, %rdi
	xorl	%esi, %esi
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_trap_gttmmio                   ## TAILCALL
LBB0_11:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_map_aperture
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	callq	_intel_vgpu_write_pci_bar
	movq	%r14, %rdi
	movl	%r13d, %esi
	jmp	LBB0_6
LBB0_5:
	movq	_INTEL_GVT_PCI_BAR_APERTURE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%edx, %edx
	subl	(%rax,%rcx,4), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r15d, %ecx
	callq	_intel_vgpu_write_pci_bar
	movq	%r14, %rdi
	xorl	%esi, %esi
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_map_aperture                   ## TAILCALL
LBB0_12:
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	jmp	LBB0_13
LBB0_7:
	movq	%r14, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
LBB0_13:
	callq	_intel_vgpu_write_pci_bar
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_COMMAND,8,3                ## @PCI_COMMAND
	.comm	_PCI_COMMAND_MEMORY,4,2         ## @PCI_COMMAND_MEMORY
	.comm	_INTEL_GVT_PCI_BAR_GTTMMIO,8,3  ## @INTEL_GVT_PCI_BAR_GTTMMIO
	.comm	_INTEL_GVT_PCI_BAR_APERTURE,8,3 ## @INTEL_GVT_PCI_BAR_APERTURE
	.no_dead_strip	_emulate_pci_bar_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function emulate_pci_bar_write
_emulate_pci_bar_write:                 ; @emulate_pci_bar_write
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	w22, [x2]
	mov	x0, x1
	mov	w1, #8
	bl	_IS_ALIGNED
	mov	x21, x0
	mov	x0, x19
	bl	_vgpu_cfg_space
	cmn	w22, #1
	b.eq	LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _PCI_COMMAND@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_COMMAND@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w8, [x0, x8, lsl #2]
Lloh3:
	adrp	x9, _PCI_COMMAND_MEMORY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PCI_COMMAND_MEMORY@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w23, w9, w8
	sub	w8, w20, #128
	cmp	w8, #2
	b.lo	LBB0_8
; %bb.2:
	sub	w8, w20, #130
	cmp	w8, #1
	b.hi	LBB0_11
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	bl	_trap_gttmmio
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	mov	x3, x21
	bl	_intel_vgpu_write_pci_bar
	mov	x0, x19
	mov	x1, x23
	b	LBB0_7
LBB0_4:
	ldr	x8, [x19]
	sub	w9, w20, #128
	cmp	w9, #2
	b.lo	LBB0_9
; %bb.5:
	sub	w9, w20, #130
	cmp	w9, #1
	b.hi	LBB0_12
; %bb.6:
Lloh6:
	adrp	x9, _INTEL_GVT_PCI_BAR_GTTMMIO@GOTPAGE
Lloh7:
	ldr	x9, [x9, _INTEL_GVT_PCI_BAR_GTTMMIO@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
	neg	w2, w8
	mov	x0, x19
	mov	x1, x20
	mov	x3, x21
	bl	_intel_vgpu_write_pci_bar
	mov	x0, x19
	mov	w1, #0
LBB0_7:
	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	_trap_gttmmio
LBB0_8:
	mov	x0, x19
	mov	w1, #0
	bl	_map_aperture
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	mov	x3, x21
	bl	_intel_vgpu_write_pci_bar
	mov	x0, x19
	mov	x1, x23
	b	LBB0_10
LBB0_9:
Lloh9:
	adrp	x9, _INTEL_GVT_PCI_BAR_APERTURE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _INTEL_GVT_PCI_BAR_APERTURE@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
	neg	w2, w8
	mov	x0, x19
	mov	x1, x20
	mov	x3, x21
	bl	_intel_vgpu_write_pci_bar
	mov	x0, x19
	mov	w1, #0
LBB0_10:
	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	_map_aperture
LBB0_11:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	mov	x3, x21
	b	LBB0_13
LBB0_12:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	mov	w3, #0
LBB0_13:
	bl	_intel_vgpu_write_pci_bar
	mov	w0, #0
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_COMMAND,8,3                ; @PCI_COMMAND
	.comm	_PCI_COMMAND_MEMORY,4,2         ; @PCI_COMMAND_MEMORY
	.comm	_INTEL_GVT_PCI_BAR_GTTMMIO,8,3  ; @INTEL_GVT_PCI_BAR_GTTMMIO
	.comm	_INTEL_GVT_PCI_BAR_APERTURE,8,3 ; @INTEL_GVT_PCI_BAR_APERTURE
	.no_dead_strip	_emulate_pci_bar_write
.subsections_via_symbols
