	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_p2pdma_distance_many       ## -- Begin function pci_p2pdma_distance_many
	.p2align	4, 0x90
_pci_p2pdma_distance_many:              ## @pci_p2pdma_distance_many
	.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
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	$-1, %eax
	testl	%edx, %edx
	je	LBB0_24
## %bb.1:
	jle	LBB0_15
## %bb.2:
	movl	%ecx, %r13d
	movl	%edx, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	addl	-44(%rbp), %r15d
	incq	%r12
	movl	%ecx, %ebx
	cmpq	%r12, -72(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_18
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_CONFIG_DMA_VIRT_OPS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_IS_ENABLED
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx,%r12,8), %rdi
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_dma_virt_ops@GOTPCREL(%rip), %rax
	cmpq	%rax, (%rdi)
	je	LBB0_19
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	callq	_find_parent_pci_dev
	testq	%rax, %rax
	je	LBB0_16
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r14
	testl	%r13d, %r13d
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	leaq	-44(%rbp), %rdx
	callq	_upstream_bridge_distance_warn
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	leaq	-44(%rbp), %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_upstream_bridge_distance
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %r13d
	movq	%r14, %rdi
	callq	_pci_dev_put
	movl	$1, %ecx
	movq	_PCI_P2PDMA_MAP_NOT_SUPPORTED@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %ecx
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	testl	%r13d, %r13d
	jne	LBB0_3
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	testl	%ecx, %ecx
	je	LBB0_3
	jmp	LBB0_23
LBB0_15:
	xorl	%eax, %eax
	jmp	LBB0_24
LBB0_16:
	testl	%r13d, %r13d
	je	LBB0_23
## %bb.17:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%r12,8), %rdi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_21
LBB0_18:
	xorl	%eax, %eax
	negl	%ecx
	sbbl	%eax, %eax
	orl	%r15d, %eax
	jmp	LBB0_24
LBB0_19:
	testl	%r13d, %r13d
	je	LBB0_23
## %bb.20:
	leaq	L_.str(%rip), %rsi
LBB0_21:
	callq	_dev_warn
LBB0_23:
	movl	$-1, %eax
LBB0_24:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CONFIG_DMA_VIRT_OPS,4,2        ## @CONFIG_DMA_VIRT_OPS
	.comm	_dma_virt_ops,4,2               ## @dma_virt_ops
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot be used for peer-to-peer DMA because the driver makes use of dma_virt_ops\n"

L_.str.1:                               ## @.str.1
	.asciz	"cannot be used for peer-to-peer DMA as it is not a PCI device\n"

	.comm	_PCI_P2PDMA_MAP_NOT_SUPPORTED,4,2 ## @PCI_P2PDMA_MAP_NOT_SUPPORTED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_p2pdma_distance_many       ; -- Begin function pci_p2pdma_distance_many
	.p2align	2
_pci_p2pdma_distance_many:              ; @pci_p2pdma_distance_many
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cbz	w2, LBB0_19
; %bb.1:
	cmp	w2, #1
	b.lt	LBB0_12
; %bb.2:
	mov	x19, x3
	mov	x20, x1
	mov	x21, x0
	mov	w24, #0
	mov	w25, #0
Lloh0:
	adrp	x26, _CONFIG_DMA_VIRT_OPS@GOTPAGE
Lloh1:
	ldr	x26, [x26, _CONFIG_DMA_VIRT_OPS@GOTPAGEOFF]
Lloh2:
	adrp	x27, _PCI_P2PDMA_MAP_NOT_SUPPORTED@GOTPAGE
Lloh3:
	ldr	x27, [x27, _PCI_P2PDMA_MAP_NOT_SUPPORTED@GOTPAGEOFF]
	mov	w28, w2
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #12]
	add	w24, w8, w24
	add	x20, x20, #8
	subs	x28, x28, #1
	b.eq	LBB0_15
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x26]
	bl	_IS_ENABLED
	mov	x8, x0
	ldr	x0, [x20]
	cbz	x8, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x0]
Lloh4:
	adrp	x9, _dma_virt_ops@GOTPAGE
Lloh5:
	ldr	x9, [x9, _dma_virt_ops@GOTPAGEOFF]
	cmp	x8, x9
	b.eq	LBB0_16
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	bl	_find_parent_pci_dev
	cbz	x0, LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x22, x0
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x22
	cbz	w19, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_upstream_bridge_distance_warn
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x3, #0
	mov	x4, #0
	bl	_upstream_bridge_distance
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x0
	mov	x0, x22
	bl	_pci_dev_put
	ldr	w8, [x27]
	cmp	w23, w8
	csinc	w25, w25, wzr, ne
	cbnz	w19, LBB0_3
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	cbz	w25, LBB0_3
	b	LBB0_19
LBB0_12:
	mov	w0, #0
	b	LBB0_20
LBB0_13:
	cbz	w19, LBB0_19
; %bb.14:
	ldr	x0, [x20]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_18
LBB0_15:
	cmp	w25, #0
	csinv	w0, w24, wzr, eq
	b	LBB0_20
LBB0_16:
	cbz	w19, LBB0_19
; %bb.17:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
LBB0_18:
	bl	_dev_warn
LBB0_19:
	mov	w0, #-1
LBB0_20:
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_CONFIG_DMA_VIRT_OPS,4,2        ; @CONFIG_DMA_VIRT_OPS
	.comm	_dma_virt_ops,4,2               ; @dma_virt_ops
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot be used for peer-to-peer DMA because the driver makes use of dma_virt_ops\n"

l_.str.1:                               ; @.str.1
	.asciz	"cannot be used for peer-to-peer DMA as it is not a PCI device\n"

	.comm	_PCI_P2PDMA_MAP_NOT_SUPPORTED,4,2 ; @PCI_P2PDMA_MAP_NOT_SUPPORTED
.subsections_via_symbols
