	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function walk_p2p_bridge
_walk_p2p_bridge:                       ## @walk_p2p_bridge
	.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
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%edi, %r15d
	movq	8(%rdx), %r14
	movq	16(%rdx), %r12
	leaq	L_.str(%rip), %rsi
	leaq	-44(%rbp), %rdx
	callq	_acpi_get_handle
	movl	%eax, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	jne	LBB0_7
## %bb.1:
	leaq	L_.str(%rip), %rsi
	leaq	-40(%rbp), %rcx
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_acpi_evaluate_integer
	movl	%eax, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	jne	LBB0_7
## %bb.2:
	movl	-40(%rbp), %edi
	movzwl	%di, %esi
	shrl	$16, %edi
	callq	_PCI_DEVFN
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_pci_get_slot
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	(%r12), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	%rax, -56(%rbp)
	movq	%r14, -64(%rbp)
	movl	(%rbx), %ecx
	movl	%ecx, -72(%rbp)
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_dbg
	movq	_ACPI_TYPE_DEVICE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	leaq	-72(%rbp), %r8
	movl	%r15d, %esi
	movl	$1, %edx
	movq	%r14, %rcx
	xorl	%r9d, %r9d
	callq	_acpi_walk_namespace
	movl	%eax, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movl	(%rbx), %edi
	leaq	_walk_p2p_bridge(%rip), %rcx
	leaq	-72(%rbp), %r8
	movl	%r15d, %esi
	movl	$1, %edx
	xorl	%r9d, %r9d
	callq	_acpi_walk_namespace
LBB0_6:
	movq	%r12, %rdi
	callq	_pci_dev_put
LBB0_7:
	movq	_AE_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"_ADR"

	.comm	_AE_OK,4,2                      ## @AE_OK
L_.str.1:                               ## @.str.1
	.asciz	"p2p bridge walk, pci_bus = %x\n"

	.comm	_ACPI_TYPE_DEVICE,4,2           ## @ACPI_TYPE_DEVICE
	.no_dead_strip	_walk_p2p_bridge
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function walk_p2p_bridge
_walk_p2p_bridge:                       ; @walk_p2p_bridge
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x2
	mov	x19, x0
	ldp	x20, x22, [x2, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #36
	bl	_acpi_get_handle
	bl	_ACPI_FAILURE
	cbnz	x0, LBB0_7
; %bb.1:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	add	x3, sp, #40
	mov	x0, x19
	mov	x2, #0
	bl	_acpi_evaluate_integer
	bl	_ACPI_FAILURE
	cbnz	x0, LBB0_7
; %bb.2:
	ldr	w8, [sp, #40]
	lsr	w0, w8, #16
	and	w1, w8, #0xffff
	bl	_PCI_DEVFN
	mov	x1, x0
	mov	x0, x22
	bl	_pci_get_slot
	mov	x22, x0
	cbz	x0, LBB0_6
; %bb.3:
	ldr	x8, [x22]
	cbz	x8, LBB0_6
; %bb.4:
	stp	x20, x8, [sp, #16]
	ldr	w9, [x21]
	str	w9, [sp, #8]
	ldr	w1, [x8]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dbg
Lloh6:
	adrp	x21, _ACPI_TYPE_DEVICE@GOTPAGE
Lloh7:
	ldr	x21, [x21, _ACPI_TYPE_DEVICE@GOTPAGEOFF]
	ldr	w0, [x21]
	add	x4, sp, #8
	mov	x1, x19
	mov	w2, #1
	mov	x3, x20
	mov	x5, #0
	bl	_acpi_walk_namespace
	bl	_ACPI_FAILURE
	cbnz	x0, LBB0_6
; %bb.5:
	ldr	w0, [x21]
Lloh8:
	adrp	x3, _walk_p2p_bridge@PAGE
Lloh9:
	add	x3, x3, _walk_p2p_bridge@PAGEOFF
	add	x4, sp, #8
	mov	x1, x19
	mov	w2, #1
	mov	x5, #0
	bl	_acpi_walk_namespace
LBB0_6:
	mov	x0, x22
	bl	_pci_dev_put
LBB0_7:
Lloh10:
	adrp	x8, _AE_OK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AE_OK@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"_ADR"

	.comm	_AE_OK,4,2                      ; @AE_OK
l_.str.1:                               ; @.str.1
	.asciz	"p2p bridge walk, pci_bus = %x\n"

	.comm	_ACPI_TYPE_DEVICE,4,2           ; @ACPI_TYPE_DEVICE
	.no_dead_strip	_walk_p2p_bridge
.subsections_via_symbols
