	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_vtrnd_init
_pci_vtrnd_init:                        ## @pci_vtrnd_init
	.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
	movq	%rsi, %r12
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_open
	movl	%eax, %r13d
	movl	%eax, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	movq	_CAP_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_cap_rights_init
	movl	%r13d, %edi
	movq	%rbx, %rsi
	callq	_caph_rights_limit
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.1:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_errx
LBB0_2:
	leaq	-48(%rbp), %rsi
	movl	%r13d, %edi
	movl	$4, %edx
	callq	_read
	testl	%eax, %eax
	jle	LBB0_3
## %bb.4:
	movl	$1, %r14d
	movl	$1, %edi
	movl	$24, %esi
	callq	_calloc
	movq	%rax, %rbx
	leaq	8(%rax), %r15
	leaq	16(%rax), %r8
	movq	_vtrnd_vi_consts@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	movq	%rax, %rdx
	movq	%r12, %rcx
	callq	_vi_softc_linkup
	leaq	20(%rbx), %rax
	movq	%rax, 8(%rbx)
	movq	_VTRND_RINGSZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movl	%r13d, (%rbx)
	movq	_PCIR_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VIRTIO_DEV_RANDOM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_pci_set_cfgdata16
	movq	_PCIR_VENDOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VIRTIO_VENDOR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r12, %rdi
	callq	_pci_set_cfgdata16
	movq	_PCIR_CLASS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PCIC_CRYPTO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_pci_set_cfgdata8
	movq	_PCIR_SUBDEV_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VIRTIO_TYPE_ENTROPY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_pci_set_cfgdata16
	movq	_PCIR_SUBVEND_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	%r12, %rdi
	callq	_pci_set_cfgdata16
	xorl	%eax, %eax
	callq	_fbsdrun_virtio_msix
	movq	%r15, %rdi
	movl	$1, %esi
	movl	%eax, %edx
	callq	_vi_intr_init
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_vi_set_io_bar
	xorl	%r14d, %r14d
	jmp	LBB0_6
LBB0_3:
	movslq	%eax, %rdi
	callq	_WPRINTF
	movl	%r13d, %edi
	callq	_close
	movl	$1, %r14d
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/random"

	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_CAP_READ,4,2                   ## @CAP_READ
	.comm	_EX_OSERR,4,2                   ## @EX_OSERR
L_.str.1:                               ## @.str.1
	.asciz	"Unable to apply rights for sandbox"

	.comm	_vtrnd_vi_consts,4,2            ## @vtrnd_vi_consts
	.comm	_VTRND_RINGSZ,4,2               ## @VTRND_RINGSZ
	.comm	_PCIR_DEVICE,4,2                ## @PCIR_DEVICE
	.comm	_VIRTIO_DEV_RANDOM,4,2          ## @VIRTIO_DEV_RANDOM
	.comm	_PCIR_VENDOR,4,2                ## @PCIR_VENDOR
	.comm	_VIRTIO_VENDOR,4,2              ## @VIRTIO_VENDOR
	.comm	_PCIR_CLASS,4,2                 ## @PCIR_CLASS
	.comm	_PCIC_CRYPTO,4,2                ## @PCIC_CRYPTO
	.comm	_PCIR_SUBDEV_0,4,2              ## @PCIR_SUBDEV_0
	.comm	_VIRTIO_TYPE_ENTROPY,4,2        ## @VIRTIO_TYPE_ENTROPY
	.comm	_PCIR_SUBVEND_0,4,2             ## @PCIR_SUBVEND_0
	.no_dead_strip	_pci_vtrnd_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_vtrnd_init
_pci_vtrnd_init:                        ; @pci_vtrnd_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x1
Lloh0:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_open
	mov	x22, x0
	mvn	w8, w0
	lsr	w0, w8, #31
	bl	_assert
Lloh8:
	adrp	x8, _CAP_READ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CAP_READ@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_cap_rights_init
	add	x1, sp, #8
	mov	x0, x22
	bl	_caph_rights_limit
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
Lloh11:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_errx
LBB0_2:
	add	x1, sp, #12
	mov	x0, x22
	mov	w2, #4
	bl	_read
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, #0
	b.le	LBB0_5
; %bb.3:
	mov	w20, #1
	mov	w0, #1
	mov	w1, #24
	bl	_calloc
	mov	x23, x0
	add	x21, x0, #8
	add	x4, x0, #16
Lloh16:
	adrp	x1, _vtrnd_vi_consts@GOTPAGE
Lloh17:
	ldr	x1, [x1, _vtrnd_vi_consts@GOTPAGEOFF]
	mov	x0, x21
	mov	x2, x23
	mov	x3, x19
	bl	_vi_softc_linkup
	add	x8, x23, #20
	str	x8, [x23, #8]
Lloh18:
	adrp	x8, _VTRND_RINGSZ@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VTRND_RINGSZ@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x23, #16]
	str	w22, [x23]
Lloh21:
	adrp	x8, _PCIR_DEVICE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PCIR_DEVICE@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _VIRTIO_DEV_RANDOM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _VIRTIO_DEV_RANDOM@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_pci_set_cfgdata16
Lloh27:
	adrp	x8, _PCIR_VENDOR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PCIR_VENDOR@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x22, _VIRTIO_VENDOR@GOTPAGE
Lloh31:
	ldr	x22, [x22, _VIRTIO_VENDOR@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_pci_set_cfgdata16
Lloh32:
	adrp	x8, _PCIR_CLASS@GOTPAGE
Lloh33:
	ldr	x8, [x8, _PCIR_CLASS@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
Lloh35:
	adrp	x8, _PCIC_CRYPTO@GOTPAGE
Lloh36:
	ldr	x8, [x8, _PCIC_CRYPTO@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_pci_set_cfgdata8
Lloh38:
	adrp	x8, _PCIR_SUBDEV_0@GOTPAGE
Lloh39:
	ldr	x8, [x8, _PCIR_SUBDEV_0@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
Lloh41:
	adrp	x8, _VIRTIO_TYPE_ENTROPY@GOTPAGE
Lloh42:
	ldr	x8, [x8, _VIRTIO_TYPE_ENTROPY@GOTPAGEOFF]
Lloh43:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_pci_set_cfgdata16
Lloh44:
	adrp	x8, _PCIR_SUBVEND_0@GOTPAGE
Lloh45:
	ldr	x8, [x8, _PCIR_SUBVEND_0@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_pci_set_cfgdata16
	bl	_fbsdrun_virtio_msix
	mov	x2, x0
	mov	x0, x21
	mov	w1, #1
	bl	_vi_intr_init
	cbnz	x0, LBB0_6
; %bb.4:
	mov	x0, x21
	mov	w1, #0
	bl	_vi_set_io_bar
	mov	w20, #0
	b	LBB0_6
LBB0_5:
	sxtw	x0, w0
	bl	_WPRINTF
	mov	x0, x22
	bl	_close
	mov	w20, #1
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/random"

	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_CAP_READ,4,2                   ; @CAP_READ
	.comm	_EX_OSERR,4,2                   ; @EX_OSERR
l_.str.1:                               ; @.str.1
	.asciz	"Unable to apply rights for sandbox"

	.comm	_vtrnd_vi_consts,4,2            ; @vtrnd_vi_consts
	.comm	_VTRND_RINGSZ,4,2               ; @VTRND_RINGSZ
	.comm	_PCIR_DEVICE,4,2                ; @PCIR_DEVICE
	.comm	_VIRTIO_DEV_RANDOM,4,2          ; @VIRTIO_DEV_RANDOM
	.comm	_PCIR_VENDOR,4,2                ; @PCIR_VENDOR
	.comm	_VIRTIO_VENDOR,4,2              ; @VIRTIO_VENDOR
	.comm	_PCIR_CLASS,4,2                 ; @PCIR_CLASS
	.comm	_PCIC_CRYPTO,4,2                ; @PCIC_CRYPTO
	.comm	_PCIR_SUBDEV_0,4,2              ; @PCIR_SUBDEV_0
	.comm	_VIRTIO_TYPE_ENTROPY,4,2        ; @VIRTIO_TYPE_ENTROPY
	.comm	_PCIR_SUBVEND_0,4,2             ; @PCIR_SUBVEND_0
	.no_dead_strip	_pci_vtrnd_init
.subsections_via_symbols
