	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __upstream_bridge_distance
___upstream_bridge_distance:            ## @__upstream_bridge_distance
	.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
	movq	%r8, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r13
	testq	%rcx, %rcx
	je	LBB0_2
## %bb.1:
	movl	$0, (%rcx)
LBB0_2:
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	testq	%r13, %r13
	je	LBB0_3
## %bb.4:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	xorl	%edx, %edx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rdi
	callq	_pci_upstream_bridge
	movq	%rax, %r13
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	incl	%edx
	testq	%rax, %rax
	je	LBB0_21
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	callq	_pci_bridge_has_acs_redir
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_seq_buf_print_bus_devfn
	incl	%r14d
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r15d, %r15d
	testq	%rbx, %rbx
	je	LBB0_20
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rax
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%rax, %r13
	je	LBB0_10
## %bb.19:                              ##   in Loop: Header=BB0_9 Depth=2
	movq	%rax, %rdi
	callq	_pci_upstream_bridge
	incl	%r15d
	testq	%rax, %rax
	jne	LBB0_9
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	%rbx, %rdi
	callq	_pci_upstream_bridge
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%rax, %rbx
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%rbx, %r13
	je	LBB0_15
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%rbx, %rdi
	callq	_pci_bridge_has_acs_redir
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_seq_buf_print_bus_devfn
	incl	%r14d
	jmp	LBB0_13
LBB0_15:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	addl	%r15d, %ecx
	movl	%ecx, (%rax)
LBB0_17:
	testl	%r14d, %r14d
	jne	LBB0_18
## %bb.23:
	movq	_PCI_P2PDMA_MAP_BUS_ADDR@GOTPCREL(%rip), %rax
	jmp	LBB0_24
LBB0_3:
	xorl	%edx, %edx
	xorl	%r15d, %r15d
LBB0_21:
	movq	_PCI_P2PDMA_MAP_THRU_HOST_BRIDGE@GOTPCREL(%rip), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_27
## %bb.22:
	addl	%edx, %r15d
	movl	%r15d, (%rcx)
	jmp	LBB0_27
LBB0_18:
	movq	_PCI_P2PDMA_MAP_THRU_HOST_BRIDGE@GOTPCREL(%rip), %rax
LBB0_24:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_27
## %bb.25:
	testl	%r14d, %r14d
	je	LBB0_27
## %bb.26:
	movl	$1, (%rcx)
	movq	_PCI_P2PDMA_MAP_THRU_HOST_BRIDGE@GOTPCREL(%rip), %rax
LBB0_27:
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_P2PDMA_MAP_THRU_HOST_BRIDGE,4,2 ## @PCI_P2PDMA_MAP_THRU_HOST_BRIDGE
	.comm	_PCI_P2PDMA_MAP_BUS_ADDR,4,2    ## @PCI_P2PDMA_MAP_BUS_ADDR
	.no_dead_strip	___upstream_bridge_distance
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __upstream_bridge_distance
___upstream_bridge_distance:            ; @__upstream_bridge_distance
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x4
	mov	x19, x3
	mov	x20, x2
	mov	x22, x1
	mov	x23, x0
	cbz	x3, LBB0_2
; %bb.1:
	str	wzr, [x19]
LBB0_2:
	cbz	x23, LBB0_21
; %bb.3:
	mov	w24, #0
	mov	w25, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x23
	bl	_pci_upstream_bridge
	mov	x23, x0
	add	w25, w25, #1
	cbz	x0, LBB0_22
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	mov	x0, x23
	bl	_pci_bridge_has_acs_redir
	cbz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	mov	x1, x23
	bl	_seq_buf_print_bus_devfn
	add	w24, w24, #1
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w26, #0
	cbz	x22, LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
LBB0_9:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x23, x0
	b.eq	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	bl	_pci_upstream_bridge
	add	w26, w26, #1
	cbnz	x0, LBB0_9
	b	LBB0_4
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x22
	bl	_pci_upstream_bridge
	cbz	x0, LBB0_16
; %bb.12:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x22, x0
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	cmp	x23, x22
	b.eq	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x22
	bl	_pci_bridge_has_acs_redir
	cbz	x0, LBB0_11
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x21
	mov	x1, x22
	bl	_seq_buf_print_bus_devfn
	add	w24, w24, #1
	b	LBB0_11
LBB0_16:
	cbz	x20, LBB0_18
; %bb.17:
	add	w8, w25, w26
	str	w8, [x20]
LBB0_18:
Lloh0:
	adrp	x8, _PCI_P2PDMA_MAP_THRU_HOST_BRIDGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_P2PDMA_MAP_THRU_HOST_BRIDGE@GOTPAGEOFF]
Lloh2:
	adrp	x9, _PCI_P2PDMA_MAP_BUS_ADDR@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PCI_P2PDMA_MAP_BUS_ADDR@GOTPAGEOFF]
	cmp	w24, #0
	csel	x8, x9, x8, eq
	cbz	x19, LBB0_25
; %bb.19:
	cbz	w24, LBB0_25
; %bb.20:
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_24
LBB0_21:
	mov	w25, #0
	mov	w26, #0
LBB0_22:
	cbz	x20, LBB0_24
; %bb.23:
	add	w8, w26, w25
	str	w8, [x20]
LBB0_24:
Lloh4:
	adrp	x8, _PCI_P2PDMA_MAP_THRU_HOST_BRIDGE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PCI_P2PDMA_MAP_THRU_HOST_BRIDGE@GOTPAGEOFF]
LBB0_25:
	ldr	w0, [x8]
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_P2PDMA_MAP_THRU_HOST_BRIDGE,4,2 ; @PCI_P2PDMA_MAP_THRU_HOST_BRIDGE
	.comm	_PCI_P2PDMA_MAP_BUS_ADDR,4,2    ; @PCI_P2PDMA_MAP_BUS_ADDR
	.no_dead_strip	___upstream_bridge_distance
.subsections_via_symbols
