	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vi_pci_read                    ## -- Begin function vi_pci_read
	.p2align	4, 0x90
_vi_pci_read:                           ## @vi_pci_read
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r13d
	movq	%r8, %r14
	movl	%ecx, %r12d
	movq	%rdx, %r15
	movq	(%rdx), %rbx
	movq	_VIRTIO_USE_MSIX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_3
## %bb.1:
	movq	%r15, %rdi
	callq	_pci_msix_table_bar
	cmpl	%r12d, %eax
	je	LBB0_40
## %bb.2:
	movq	%r15, %rdi
	callq	_pci_msix_pba_bar
	cmpl	%r12d, %eax
	jne	LBB0_3
LBB0_40:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%r13d, %edx
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pci_emul_msix_tread            ## TAILCALL
LBB0_3:
	xorl	%edi, %edi
	testl	%r12d, %r12d
	sete	%dil
	callq	_assert
	movq	32(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	callq	_pthread_mutex_lock
LBB0_5:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	48(%rbx), %rbx
	movq	(%rbx), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	cmpl	$2, %r13d
	sete	%al
	shll	$16, %eax
	decl	%eax
	cmpl	$1, %r13d
	movl	$255, %ecx
	cmovnel	%eax, %ecx
	movl	%ecx, -44(%rbp)
	cmpl	$4, %r13d
	ja	LBB0_13
## %bb.6:
	movl	$22, %eax
	btl	%r13d, %eax
	jae	LBB0_13
## %bb.7:
	movq	%r15, %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	%r14, %rax
	jg	LBB0_13
## %bb.11:
	movl	%r14d, %r12d
	subl	%eax, %r12d
	movslq	8(%rbx), %rax
	testq	%rax, %rax
	movabsq	$4294967296, %rcx               ## imm = 0x100000000
	cmovneq	%rax, %rcx
	leal	(%r12,%r13), %eax
	cltq
	cmpq	%rax, %rcx
	jl	LBB0_13
## %bb.12:
	movq	16(%rbx), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_DEV_SOFTC
	leaq	-44(%rbp), %rcx
	movl	%eax, %edi
	movl	%r12d, %esi
	movl	%r13d, %edx
	callq	*-72(%rbp)                      ## 8-byte Folded Reload
	testl	%eax, %eax
	je	LBB0_37
LBB0_13:
	movq	%r14, %rdi
	callq	_vi_find_cr
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	cmpl	%r13d, (%rax)
	jne	LBB0_15
## %bb.18:
	addq	$-128, %r14
	cmpq	$9, %r14
	ja	LBB0_37
## %bb.19:
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%r14,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_28:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	16(%rax), %eax
	jmp	LBB0_36
LBB0_16:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	%r14, %rcx
	jmp	LBB0_17
LBB0_15:
	movq	_stderr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	8(%rax), %rcx
	leaq	L_.str(%rip), %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
LBB0_17:
	movl	%r13d, %r8d
	callq	_fprintf
	jmp	LBB0_37
LBB0_32:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rax
	cmpq	32(%rbx), %rax
	jae	LBB0_33
## %bb.34:
	movq	40(%rcx), %rcx
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %rax
	addq	$8, %rax
	jmp	LBB0_35
LBB0_26:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %eax
	jmp	LBB0_36
LBB0_24:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	8(%rdx), %rcx
	xorl	%eax, %eax
	cmpq	32(%rbx), %rcx
	jae	LBB0_36
## %bb.25:
	movq	40(%rdx), %rax
	leaq	(%rcx,%rcx,2), %rcx
	movl	4(%rax,%rcx,4), %eax
	jmp	LBB0_36
LBB0_27:
	movl	$0, -44(%rbp)
	jmp	LBB0_37
LBB0_22:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	cmpq	32(%rbx), %rax
	jae	LBB0_37
## %bb.23:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	40(%rcx), %rcx
	leaq	(%rax,%rax,2), %rax
	movl	(%rcx,%rax,4), %eax
	jmp	LBB0_36
LBB0_20:
	movl	24(%rbx), %eax
	jmp	LBB0_36
LBB0_31:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	24(%rax), %eax
	jmp	LBB0_36
LBB0_29:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	20(%rcx), %eax
	movl	%eax, -44(%rbp)
	movl	$0, 20(%rcx)
	testl	%eax, %eax
	je	LBB0_37
## %bb.30:
	movq	%r15, %rdi
	callq	_pci_lintr_deassert
	jmp	LBB0_37
LBB0_21:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %eax
	jmp	LBB0_36
LBB0_33:
	movq	_VIRTIO_MSI_NO_VECTOR@GOTPCREL(%rip), %rax
LBB0_35:
	movl	(%rax), %eax
LBB0_36:
	movl	%eax, -44(%rbp)
LBB0_37:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	32(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_39
## %bb.38:
	callq	_pthread_mutex_unlock
LBB0_39:
	movslq	-44(%rbp), %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_28, LBB0_28-LJTI0_0
.set L0_0_set_32, LBB0_32-LJTI0_0
.set L0_0_set_26, LBB0_26-LJTI0_0
.set L0_0_set_24, LBB0_24-LJTI0_0
.set L0_0_set_27, LBB0_27-LJTI0_0
.set L0_0_set_22, LBB0_22-LJTI0_0
.set L0_0_set_29, LBB0_29-LJTI0_0
.set L0_0_set_20, LBB0_20-LJTI0_0
.set L0_0_set_21, LBB0_21-LJTI0_0
.set L0_0_set_31, LBB0_31-LJTI0_0
LJTI0_0:
	.long	L0_0_set_28
	.long	L0_0_set_32
	.long	L0_0_set_26
	.long	L0_0_set_24
	.long	L0_0_set_27
	.long	L0_0_set_22
	.long	L0_0_set_29
	.long	L0_0_set_20
	.long	L0_0_set_21
	.long	L0_0_set_31
	.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: read from %s: bad size %d\r\n"

L_.str.1:                               ## @.str.1
	.asciz	"%s: read from bad offset/size %jd/%d\r\n"

	.comm	_VIRTIO_MSI_NO_VECTOR,4,2       ## @VIRTIO_MSI_NO_VECTOR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vi_pci_read                    ; -- Begin function vi_pci_read
	.p2align	2
_vi_pci_read:                           ; @vi_pci_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x5
	mov	x22, x4
	mov	x23, x3
	mov	x21, 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, x21
	bl	_pci_msix_table_bar
	cmp	w0, w23
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x21
	bl	_pci_msix_pba_bar
	cmp	w0, w23
	b.ne	LBB0_4
LBB0_3:
	mov	x0, x21
	mov	x1, x22
	mov	x2, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_pci_emul_msix_tread
LBB0_4:
	cmp	w23, #0
	cset	w0, eq
	bl	_assert
	ldr	x0, [x19, #32]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_pthread_mutex_lock
LBB0_6:
	ldr	x25, [x19, #48]
	ldr	x23, [x25]
	cmp	w20, #2
	mov	w8, #65535
	csinv	w8, w8, wzr, eq
	mov	w9, #255
	cmp	w20, #1
	csel	w8, w9, w8, eq
	str	w8, [sp, #12]
	cmp	w20, #4
	b.hi	LBB0_11
; %bb.7:
	mov	w8, #1
	lsl	w8, w8, w20
	mov	w9, #22
	tst	w8, w9
	b.eq	LBB0_11
; %bb.8:
	mov	x0, x21
	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, w20
	cmp	x9, w8, sxtw
	b.lt	LBB0_11
; %bb.10:
	ldr	x26, [x25, #16]
	mov	x0, x19
	bl	_DEV_SOFTC
	add	x3, sp, #12
	mov	x1, x24
	mov	x2, x20
	blr	x26
	cbz	w0, LBB0_36
LBB0_11:
	mov	x0, x22
	bl	_vi_find_cr
	cbz	x0, LBB0_16
; %bb.12:
	ldr	w8, [x0]
	cmp	w8, w20
	b.ne	LBB0_17
; %bb.13:
	sub	x8, x22, #128
	cmp	x8, #9
	b.hi	LBB0_36
; %bb.14:
Lloh7:
	adrp	x9, lJTI0_0@PAGE
Lloh8:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_15
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_15:
	ldr	w8, [x19, #16]
	b	LBB0_35
LBB0_16:
Lloh9:
	adrp	x8, _stderr@GOTPAGE
Lloh10:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x23
	mov	x3, x22
	b	LBB0_18
LBB0_17:
Lloh14:
	adrp	x8, _stderr@GOTPAGE
Lloh15:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	x3, [x0, #8]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x8
	mov	x2, x23
LBB0_18:
	mov	x4, x20
	bl	_fprintf
	b	LBB0_36
LBB0_19:
	ldr	x8, [x19, #8]
	ldr	x9, [x25, #32]
	cmp	x8, x9
	b.hs	LBB0_32
; %bb.20:
	ldr	x9, [x19, #40]
	mov	w10, #12
	madd	x8, x8, x10, x9
	add	x8, x8, #8
	b	LBB0_33
LBB0_21:
	ldr	x8, [x19, #8]
	str	w8, [sp, #12]
	b	LBB0_36
LBB0_22:
	ldr	x8, [x19, #8]
	ldr	x9, [x25, #32]
	cmp	x8, x9
	b.hs	LBB0_34
; %bb.23:
	ldr	x9, [x19, #40]
	mov	w10, #12
	madd	x8, x8, x10, x9
	ldr	w8, [x8, #4]
	b	LBB0_35
LBB0_24:
	str	wzr, [sp, #12]
	b	LBB0_36
LBB0_25:
	ldr	x8, [x19, #8]
	ldr	x9, [x25, #32]
	cmp	x8, x9
	b.hs	LBB0_36
; %bb.26:
	ldr	x9, [x19, #40]
	mov	w10, #12
	mul	x8, x8, x10
	ldr	w8, [x9, x8]
	b	LBB0_35
LBB0_27:
	ldr	w8, [x25, #24]
	b	LBB0_35
LBB0_28:
	ldr	w8, [x19, #24]
	b	LBB0_35
LBB0_29:
	ldr	w8, [x19, #20]
	str	w8, [sp, #12]
	str	wzr, [x19, #20]
	cbz	w8, LBB0_36
; %bb.30:
	mov	x0, x21
	bl	_pci_lintr_deassert
	b	LBB0_36
LBB0_31:
	ldr	w8, [x19, #4]
	b	LBB0_35
LBB0_32:
Lloh19:
	adrp	x8, _VIRTIO_MSI_NO_VECTOR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _VIRTIO_MSI_NO_VECTOR@GOTPAGEOFF]
LBB0_33:
	ldr	w8, [x8]
	b	LBB0_35
LBB0_34:
	mov	w8, #0
LBB0_35:
	str	w8, [sp, #12]
LBB0_36:
	ldr	x0, [x19, #32]
	cbz	x0, LBB0_38
; %bb.37:
	bl	_pthread_mutex_unlock
LBB0_38:
	ldrsw	x0, [sp, #12]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_15-LBB0_15)>>2
	.byte	(LBB0_19-LBB0_15)>>2
	.byte	(LBB0_21-LBB0_15)>>2
	.byte	(LBB0_22-LBB0_15)>>2
	.byte	(LBB0_24-LBB0_15)>>2
	.byte	(LBB0_25-LBB0_15)>>2
	.byte	(LBB0_29-LBB0_15)>>2
	.byte	(LBB0_27-LBB0_15)>>2
	.byte	(LBB0_31-LBB0_15)>>2
	.byte	(LBB0_28-LBB0_15)>>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: read from %s: bad size %d\r\n"

l_.str.1:                               ; @.str.1
	.asciz	"%s: read from bad offset/size %jd/%d\r\n"

	.comm	_VIRTIO_MSI_NO_VECTOR,4,2       ; @VIRTIO_MSI_NO_VECTOR
.subsections_via_symbols
