	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_af_flr
_pci_af_flr:                            ## @pci_af_flr
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %r14
	movq	_PCI_CAP_ID_AF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pci_find_capability
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_PCI_DEV_FLAGS_NO_FLR_RESET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%r14)
	je	LBB0_3
LBB0_1:
	movq	_ENOTTY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movslq	%eax, %r15
	movq	_PCI_AF_CAP@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r15, %rsi
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_byte
	movl	-36(%rbp), %eax
	movq	_PCI_AF_CAP_TP@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_1
## %bb.4:
	movq	_PCI_AF_CAP_FLR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_1
## %bb.5:
	xorl	%ebx, %ebx
	testl	%r12d, %r12d
	jne	LBB0_10
## %bb.6:
	movq	_PCI_AF_CTRL@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	addq	%r15, %rsi
	movq	_PCI_AF_STATUS_TP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	shll	$8, %edx
	movq	%r14, %rdi
	callq	_pci_wait_for_pending
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_pci_err
LBB0_8:
	addq	(%r12), %r15
	movq	_PCI_AF_CTRL_FLR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_pci_write_config_byte
	cmpq	$0, 8(%r14)
	jne	LBB0_10
## %bb.9:
	movl	$100, %edi
	callq	_msleep
	movq	_PCIE_RESET_READY_POLL_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_pci_dev_wait
	movl	%eax, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_CAP_ID_AF,4,2              ## @PCI_CAP_ID_AF
	.comm	_ENOTTY,4,2                     ## @ENOTTY
	.comm	_PCI_DEV_FLAGS_NO_FLR_RESET,4,2 ## @PCI_DEV_FLAGS_NO_FLR_RESET
	.comm	_PCI_AF_CAP,8,3                 ## @PCI_AF_CAP
	.comm	_PCI_AF_CAP_TP,4,2              ## @PCI_AF_CAP_TP
	.comm	_PCI_AF_CAP_FLR,4,2             ## @PCI_AF_CAP_FLR
	.comm	_PCI_AF_CTRL,8,3                ## @PCI_AF_CTRL
	.comm	_PCI_AF_STATUS_TP,4,2           ## @PCI_AF_STATUS_TP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timed out waiting for pending transaction; performing AF function level reset anyway\n"

	.comm	_PCI_AF_CTRL_FLR,4,2            ## @PCI_AF_CTRL_FLR
L_.str.1:                               ## @.str.1
	.asciz	"AF_FLR"

	.comm	_PCIE_RESET_READY_POLL_MS,4,2   ## @PCIE_RESET_READY_POLL_MS
	.no_dead_strip	_pci_af_flr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_af_flr
_pci_af_flr:                            ; @pci_af_flr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _PCI_CAP_ID_AF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_CAP_ID_AF@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_pci_find_capability
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w8, [x19]
Lloh3:
	adrp	x9, _PCI_DEV_FLAGS_NO_FLR_RESET@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PCI_DEV_FLAGS_NO_FLR_RESET@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
LBB0_2:
Lloh6:
	adrp	x8, _ENOTTY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOTTY@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_4:
	sxtw	x21, w0
Lloh9:
	adrp	x8, _PCI_AF_CAP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PCI_AF_CAP@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	add	x1, x8, x21
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_byte
	ldr	w8, [sp, #12]
Lloh12:
	adrp	x9, _PCI_AF_CAP_TP@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PCI_AF_CAP_TP@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.5:
Lloh15:
	adrp	x9, _PCI_AF_CAP_FLR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PCI_AF_CAP_FLR@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.6:
	cbnz	w20, LBB0_10
; %bb.7:
Lloh18:
	adrp	x20, _PCI_AF_CTRL@GOTPAGE
Lloh19:
	ldr	x20, [x20, _PCI_AF_CTRL@GOTPAGEOFF]
	ldr	x8, [x20]
	add	x1, x8, x21
Lloh20:
	adrp	x8, _PCI_AF_STATUS_TP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PCI_AF_STATUS_TP@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	lsl	w2, w8, #8
	mov	x0, x19
	bl	_pci_wait_for_pending
	cbnz	w0, LBB0_9
; %bb.8:
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_pci_err
LBB0_9:
	ldr	x8, [x20]
	add	x1, x8, x21
Lloh25:
	adrp	x8, _PCI_AF_CTRL_FLR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PCI_AF_CTRL_FLR@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_pci_write_config_byte
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_11
LBB0_10:
	mov	w0, #0
	b	LBB0_3
LBB0_11:
	mov	w0, #100
	bl	_msleep
Lloh28:
	adrp	x8, _PCIE_RESET_READY_POLL_MS@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PCIE_RESET_READY_POLL_MS@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
Lloh31:
	adrp	x1, l_.str.1@PAGE
Lloh32:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_pci_dev_wait
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_CAP_ID_AF,4,2              ; @PCI_CAP_ID_AF
	.comm	_ENOTTY,4,2                     ; @ENOTTY
	.comm	_PCI_DEV_FLAGS_NO_FLR_RESET,4,2 ; @PCI_DEV_FLAGS_NO_FLR_RESET
	.comm	_PCI_AF_CAP,8,3                 ; @PCI_AF_CAP
	.comm	_PCI_AF_CAP_TP,4,2              ; @PCI_AF_CAP_TP
	.comm	_PCI_AF_CAP_FLR,4,2             ; @PCI_AF_CAP_FLR
	.comm	_PCI_AF_CTRL,8,3                ; @PCI_AF_CTRL
	.comm	_PCI_AF_STATUS_TP,4,2           ; @PCI_AF_STATUS_TP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timed out waiting for pending transaction; performing AF function level reset anyway\n"

	.comm	_PCI_AF_CTRL_FLR,4,2            ; @PCI_AF_CTRL_FLR
l_.str.1:                               ; @.str.1
	.asciz	"AF_FLR"

	.comm	_PCIE_RESET_READY_POLL_MS,4,2   ; @PCIE_RESET_READY_POLL_MS
	.no_dead_strip	_pci_af_flr
.subsections_via_symbols
