	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vi_pci_write                   ## -- Begin function vi_pci_write
	.p2align	4, 0x90
_vi_pci_write:                          ## @vi_pci_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	%r9d, %r14d
	movq	%r8, %r13
	movl	%ecx, %r15d
	movq	%rdx, %rbx
	movq	16(%rbp), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdx), %r12
	movq	_VIRTIO_USE_MSIX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_pci_msix_table_bar
	cmpl	%r15d, %eax
	je	LBB0_41
## %bb.2:
	movq	%rbx, %rdi
	callq	_pci_msix_pba_bar
	cmpl	%r15d, %eax
	jne	LBB0_3
LBB0_41:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movl	%r14d, %edx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pci_emul_msix_twrite           ## TAILCALL
LBB0_3:
	xorl	%edi, %edi
	testl	%r15d, %r15d
	sete	%dil
	callq	_assert
	movq	16(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	callq	_pthread_mutex_lock
LBB0_5:
	movq	56(%r12), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	cmpl	$4, %r14d
	ja	LBB0_13
## %bb.6:
	movl	$22, %eax
	btl	%r14d, %eax
	jae	LBB0_13
## %bb.7:
	movq	%rbx, %rdi
	callq	_pci_msix_enabled
	testq	%rax, %rax
	jne	LBB0_8
## %bb.9:
	movq	_VTCFG_R_CFG0@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	movq	_VTCFG_R_CFG1@GOTPCREL(%rip), %rax
LBB0_10:
	movq	(%rax), %rax
	cmpq	%r13, %rax
	jg	LBB0_13
## %bb.11:
	movl	%r13d, %ebx
	subl	%eax, %ebx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movslq	8(%rax), %rax
	testq	%rax, %rax
	movabsq	$4294967296, %rcx               ## imm = 0x100000000
	cmovneq	%rax, %rcx
	leal	(%rbx,%r14), %eax
	cltq
	cmpq	%rax, %rcx
	jl	LBB0_13
## %bb.12:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %r15
	movq	%r12, %rdi
	callq	_DEV_SOFTC
	movl	%eax, %edi
	movl	%ebx, %esi
	movl	%r14d, %edx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	*%r15
	testl	%eax, %eax
	je	LBB0_39
LBB0_13:
	movq	%r13, %rdi
	callq	_vi_find_cr
	testq	%rax, %rax
	je	LBB0_20
## %bb.14:
	movq	%rax, %r15
	cmpl	%r14d, (%rax)
	jne	LBB0_18
## %bb.15:
	cmpq	$0, 16(%r15)
	jne	LBB0_19
## %bb.16:
	addq	$-128, %r13
	cmpq	$6, %r13
	ja	LBB0_39
## %bb.17:
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%r13,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_33:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 40(%r12)
	testq	%rax, %rax
	jne	LBB0_39
## %bb.34:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	40(%rax), %rbx
	movq	%r12, %rdi
	callq	_DEV_SOFTC
	movl	%eax, %edi
	callq	*%rbx
	jmp	LBB0_39
LBB0_20:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%r13d, %ecx
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_39
LBB0_18:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r15), %rcx
	leaq	L_.str(%rip), %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_fprintf
	cmpq	$0, 16(%r15)
	je	LBB0_39
LBB0_19:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r15), %rcx
	leaq	L_.str.1(%rip), %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_fprintf
LBB0_39:
	movq	16(%r12), %rdi
	addq	$24, %rsp
	testq	%rdi, %rdi
	je	LBB0_40
## %bb.42:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pthread_mutex_unlock           ## TAILCALL
LBB0_40:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_36:
	movq	8(%r12), %r8
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	32(%rax), %r9
	cmpq	%r9, %r8
	jge	LBB0_38
## %bb.37:
	movq	24(%r12), %rax
	shlq	$4, %r8
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rax,%r8)
	jmp	LBB0_39
LBB0_25:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%r12)
	jmp	LBB0_39
LBB0_26:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rcx, 32(%rax)
	jle	LBB0_27
## %bb.29:
	movq	24(%r12), %rax
	movq	%rcx, %rdx
	shlq	$4, %rdx
	leaq	(%rax,%rdx), %r14
	movq	8(%rax,%rdx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_30
## %bb.31:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	48(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_32
LBB0_30:
	movq	%r12, %rdi
	callq	_DEV_SOFTC
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	*%rbx
	jmp	LBB0_39
LBB0_23:
	movq	8(%r12), %r8
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	32(%rax), %r9
	cmpq	%r9, %r8
	jge	LBB0_38
## %bb.24:
	movq	%r12, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_vi_vq_init
	jmp	LBB0_39
LBB0_21:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	andq	24(%rcx), %rax
	movq	%rax, 48(%r12)
	movq	56(%rcx), %rbx
	testq	%rbx, %rbx
	je	LBB0_39
## %bb.22:
	movq	%r12, %rdi
	callq	_DEV_SOFTC
	movq	48(%r12), %rsi
	movl	%eax, %edi
	callq	*%rbx
	jmp	LBB0_39
LBB0_35:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 32(%r12)
	jmp	LBB0_39
LBB0_38:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r15), %rcx
	leaq	L_.str.5(%rip), %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_39
LBB0_27:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
LBB0_28:
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_39
LBB0_32:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_28
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_33, LBB0_33-LJTI0_0
.set L0_0_set_36, LBB0_36-LJTI0_0
.set L0_0_set_25, LBB0_25-LJTI0_0
.set L0_0_set_26, LBB0_26-LJTI0_0
.set L0_0_set_23, LBB0_23-LJTI0_0
.set L0_0_set_21, LBB0_21-LJTI0_0
.set L0_0_set_35, LBB0_35-LJTI0_0
LJTI0_0:
	.long	L0_0_set_33
	.long	L0_0_set_36
	.long	L0_0_set_25
	.long	L0_0_set_26
	.long	L0_0_set_23
	.long	L0_0_set_21
	.long	L0_0_set_35
	.end_data_region
                                        ## -- End function
	.comm	_VIRTIO_USE_MSIX,4,2            ## @VIRTIO_USE_MSIX
	.comm	_VTCFG_R_CFG1,8,3               ## @VTCFG_R_CFG1
	.comm	_VTCFG_R_CFG0,8,3               ## @VTCFG_R_CFG0
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: write to %s: bad size %d\r\n"

L_.str.1:                               ## @.str.1
	.asciz	"%s: write to read-only reg %s\r\n"

L_.str.2:                               ## @.str.2
	.asciz	"%s: write to bad offset/size %jd/%d\r\n"

L_.str.3:                               ## @.str.3
	.asciz	"%s: queue %d notify out of range\r\n"

L_.str.4:                               ## @.str.4
	.asciz	"%s: qnotify queue %d: missing vq/vc notify\r\n"

L_.str.5:                               ## @.str.5
	.asciz	"%s: write config reg %s: curq %d >= max %d\r\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vi_pci_write                   ; -- Begin function vi_pci_write
	.p2align	2
_vi_pci_write:                          ; @vi_pci_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x6
	mov	x23, x5
	mov	x22, x4
	mov	x20, x3
	mov	x24, x2
	ldr	x19, [x2]
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _VIRTIO_USE_MSIX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VIRTIO_USE_MSIX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	mov	x0, x24
	bl	_pci_msix_table_bar
	cmp	w0, w20
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x24
	bl	_pci_msix_pba_bar
	cmp	w0, w20
	b.ne	LBB0_4
LBB0_3:
	mov	x0, x24
	mov	x1, x22
	mov	x2, x23
	mov	x3, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_pci_emul_msix_twrite
LBB0_4:
	cmp	w20, #0
	cset	w0, eq
	bl	_assert
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_pthread_mutex_lock
LBB0_6:
	ldr	x25, [x19, #56]
	ldr	x20, [x25]
	cmp	w23, #4
	b.hi	LBB0_11
; %bb.7:
	mov	w8, #1
	lsl	w8, w8, w23
	mov	w9, #22
	tst	w8, w9
	b.eq	LBB0_11
; %bb.8:
	mov	x0, x24
	bl	_pci_msix_enabled
Lloh3:
	adrp	x8, _VTCFG_R_CFG0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VTCFG_R_CFG0@GOTPAGEOFF]
Lloh5:
	adrp	x9, _VTCFG_R_CFG1@GOTPAGE
Lloh6:
	ldr	x9, [x9, _VTCFG_R_CFG1@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x8, x9, eq
	ldr	x8, [x8]
	cmp	x8, x22
	b.gt	LBB0_11
; %bb.9:
	ldrsw	x9, [x25, #8]
	cmp	w9, #0
	mov	x10, #4294967296
	csel	x9, x10, x9, eq
	sub	w24, w22, w8
	add	w8, w24, w23
	cmp	x9, w8, sxtw
	b.lt	LBB0_11
; %bb.10:
	ldr	x26, [x25, #16]
	mov	x0, x19
	bl	_DEV_SOFTC
	mov	x1, x24
	mov	x2, x23
	mov	x3, x21
	blr	x26
	cbz	w0, LBB0_22
LBB0_11:
	mov	x0, x22
	bl	_vi_find_cr
	cbz	x0, LBB0_18
; %bb.12:
	mov	x24, x0
	ldr	w8, [x0]
Lloh7:
	adrp	x26, _stderr@GOTPAGE
Lloh8:
	ldr	x26, [x26, _stderr@GOTPAGEOFF]
	cmp	w8, w23
	b.ne	LBB0_19
; %bb.13:
	ldr	x8, [x24, #16]
	cbnz	x8, LBB0_20
; %bb.14:
	sub	x8, x22, #128
	cmp	x8, #6
	b.hi	LBB0_22
; %bb.15:
Lloh9:
	adrp	x9, lJTI0_0@PAGE
Lloh10:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_16
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_16:
	str	x21, [x19, #40]
	cbnz	x21, LBB0_22
; %bb.17:
	ldr	x20, [x25, #40]
	mov	x0, x19
	bl	_DEV_SOFTC
	blr	x20
	b	LBB0_22
LBB0_18:
Lloh11:
	adrp	x8, _stderr@GOTPAGE
Lloh12:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	stp	x22, x23, [sp]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_21
LBB0_19:
	ldr	w0, [x26]
	ldr	x8, [x24, #8]
	stp	x8, x23, [sp]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_fprintf
	ldr	x8, [x24, #16]
	cbz	x8, LBB0_22
LBB0_20:
	ldr	w0, [x26]
	ldr	x8, [x24, #8]
	str	x8, [sp]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_21:
	mov	x2, x20
	bl	_fprintf
LBB0_22:
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_24
; %bb.23:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_pthread_mutex_unlock
LBB0_24:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_25:
	ldr	x8, [x19, #8]
	ldr	x9, [x25, #32]
	cmp	x8, x9
	b.ge	LBB0_37
; %bb.26:
	ldr	x9, [x19, #24]
	lsl	x8, x8, #4
	str	x21, [x9, x8]
	b	LBB0_22
LBB0_27:
	str	x21, [x19, #8]
	b	LBB0_22
LBB0_28:
	ldr	x8, [x25, #32]
	cmp	x8, x21
	b.le	LBB0_38
; %bb.29:
	ldr	x8, [x19, #24]
	add	x22, x8, x21, lsl #4
	ldr	x23, [x22, #8]
	cbnz	x23, LBB0_31
; %bb.30:
	ldr	x23, [x25, #48]
	cbz	x23, LBB0_39
LBB0_31:
	mov	x0, x19
	bl	_DEV_SOFTC
	mov	x1, x22
	blr	x23
	b	LBB0_22
LBB0_32:
	ldr	x8, [x19, #8]
	ldr	x9, [x25, #32]
	cmp	x8, x9
	b.ge	LBB0_37
; %bb.33:
	mov	x0, x19
	mov	x1, x21
	bl	_vi_vq_init
	b	LBB0_22
LBB0_34:
	ldr	x8, [x25, #24]
	and	x8, x8, x21
	str	x8, [x19, #48]
	ldr	x20, [x25, #56]
	cbz	x20, LBB0_22
; %bb.35:
	mov	x0, x19
	bl	_DEV_SOFTC
	ldr	x1, [x19, #48]
	blr	x20
	b	LBB0_22
LBB0_36:
	str	x21, [x19, #32]
	b	LBB0_22
LBB0_37:
	ldr	w0, [x26]
	ldr	x10, [x24, #8]
	stp	x8, x9, [sp, #8]
	str	x10, [sp]
Lloh20:
	adrp	x1, l_.str.5@PAGE
Lloh21:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_21
LBB0_38:
	ldr	w0, [x26]
	str	x21, [sp]
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_21
LBB0_39:
	ldr	w0, [x26]
	str	x21, [sp]
Lloh24:
	adrp	x1, l_.str.4@PAGE
Lloh25:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_21
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_16-LBB0_16)>>2
	.byte	(LBB0_25-LBB0_16)>>2
	.byte	(LBB0_27-LBB0_16)>>2
	.byte	(LBB0_28-LBB0_16)>>2
	.byte	(LBB0_32-LBB0_16)>>2
	.byte	(LBB0_34-LBB0_16)>>2
	.byte	(LBB0_36-LBB0_16)>>2
                                        ; -- End function
	.comm	_VIRTIO_USE_MSIX,4,2            ; @VIRTIO_USE_MSIX
	.comm	_VTCFG_R_CFG1,8,3               ; @VTCFG_R_CFG1
	.comm	_VTCFG_R_CFG0,8,3               ; @VTCFG_R_CFG0
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: write to %s: bad size %d\r\n"

l_.str.1:                               ; @.str.1
	.asciz	"%s: write to read-only reg %s\r\n"

l_.str.2:                               ; @.str.2
	.asciz	"%s: write to bad offset/size %jd/%d\r\n"

l_.str.3:                               ; @.str.3
	.asciz	"%s: queue %d notify out of range\r\n"

l_.str.4:                               ; @.str.4
	.asciz	"%s: qnotify queue %d: missing vq/vc notify\r\n"

l_.str.5:                               ; @.str.5
	.asciz	"%s: write config reg %s: curq %d >= max %d\r\n"

.subsections_via_symbols
