	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function emulate_pci_command_write
_emulate_pci_command_write:             ## @emulate_pci_command_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, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r12
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_vgpu_cfg_space
	movl	%ebx, %ecx
	movl	(%rax,%rcx,4), %r13d
	movl	(%r12), %r14d
	xorl	%r13d, %r14d
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%r12, %rdx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_vgpu_pci_cfg_mem_write
	movq	_PCI_COMMAND_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%eax, %eax
	testl	%r14d, %ecx
	je	LBB0_8
## %bb.1:
	testl	%r13d, %ecx
	je	LBB0_4
## %bb.2:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_trap_gttmmio
	testl	%eax, %eax
	jne	LBB0_8
## %bb.3:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	jmp	LBB0_6
LBB0_4:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_trap_gttmmio
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:
	movq	%rbx, %rdi
	movl	$1, %esi
LBB0_6:
	callq	_map_aperture
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	xorl	%eax, %eax
LBB0_8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_COMMAND_MEMORY,4,2         ## @PCI_COMMAND_MEMORY
	.no_dead_strip	_emulate_pci_command_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_command_write
_emulate_pci_command_write:             ; @emulate_pci_command_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, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	bl	_vgpu_cfg_space
	ldr	w23, [x0, w22, uxtw #2]
	ldr	w8, [x21]
	eor	w24, w8, w23
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	bl	_vgpu_pci_cfg_mem_write
Lloh0:
	adrp	x8, _PCI_COMMAND_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_COMMAND_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_6
; %bb.1:
	mov	x0, x19
	tst	w8, w23
	b.eq	LBB0_4
; %bb.2:
	mov	w1, #0
	bl	_trap_gttmmio
	cbnz	w0, LBB0_7
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	bl	_map_aperture
	cbnz	w0, LBB0_7
	b	LBB0_6
LBB0_4:
	mov	w1, #1
	bl	_trap_gttmmio
	cbnz	w0, LBB0_7
; %bb.5:
	mov	x0, x19
	mov	w1, #1
	bl	_map_aperture
	cbnz	w0, LBB0_7
LBB0_6:
	mov	w0, #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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_COMMAND_MEMORY,4,2         ; @PCI_COMMAND_MEMORY
	.no_dead_strip	_emulate_pci_command_write
.subsections_via_symbols
