	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdvi_find_iommu
_amdvi_find_iommu:                      ## @amdvi_find_iommu
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_ivhd_count@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	movq	_ivhd_devs@GOTPCREL(%rip), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_device_get_softc
	cmpq	%r15, (%rax)
	jg	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%r15, 8(%rax)
	jl	LBB0_4
## %bb.6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r15, %rdi
	callq	_RID2PCI_STR
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_printf
	movq	_ivhd_devs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_device_get_softc               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ivhd_count,4,2                 ## @ivhd_count
	.comm	_ivhd_devs,8,3                  ## @ivhd_devs
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"BIOS bug device(%d.%d.%d) doesn't have IVHD entry.\n"

	.no_dead_strip	_amdvi_find_iommu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdvi_find_iommu
_amdvi_find_iommu:                      ; @amdvi_find_iommu
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _ivhd_count@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ivhd_count@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh2:
	adrp	x20, _ivhd_devs@GOTPAGE
Lloh3:
	ldr	x20, [x20, _ivhd_devs@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x22, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x21]
	cmp	x22, x8
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	w0, [x8, x22, lsl #2]
	bl	_device_get_softc
	ldr	x8, [x0]
	cmp	x8, x19
	b.gt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x0, #8]
	cmp	x8, x19
	b.lt	LBB0_2
; %bb.5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x0, x19
	bl	_RID2PCI_STR
	mov	x1, x0
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	ldr	x8, [x20]
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_device_get_softc
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ivhd_count,4,2                 ; @ivhd_count
	.comm	_ivhd_devs,8,3                  ; @ivhd_devs
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"BIOS bug device(%d.%d.%d) doesn't have IVHD entry.\n"

	.no_dead_strip	_amdvi_find_iommu
.subsections_via_symbols
