	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qed_init_pci
_qed_init_pci:                          ## @qed_init_pci
	.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
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	%rsi, 16(%rdi)
	movq	%rsi, %rdi
	callq	_pci_enable_device
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_DP_NOTICE
	jmp	LBB0_32
LBB0_2:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_pci_resource_flags
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %r12
	testl	%eax, (%r12)
	je	LBB0_3
## %bb.5:
	movq	%r14, %rdi
	callq	_IS_PF
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	%r15, %rdi
	movl	$2, %esi
	callq	_pci_resource_flags
	testl	%eax, (%r12)
	je	LBB0_7
LBB0_8:
	leaq	4(%r15), %rdi
	callq	_atomic_read
	cmpl	$1, %eax
	jne	LBB0_13
## %bb.9:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	callq	_pci_request_regions
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_DP_NOTICE
	jmp	LBB0_11
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
LBB0_4:
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_DP_NOTICE
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_12:
	movq	%r15, %rdi
	callq	_pci_set_master
	movq	%r15, %rdi
	callq	_pci_save_state
LBB0_13:
	movq	_PCI_REVISION_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_byte
	movq	-40(%rbp), %rdx
	movq	_PCI_REVISION_ID_ERROR_VAL@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jne	LBB0_15
## %bb.14:
	leaq	L_.str.5(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_DP_NOTICE
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_15:
	movq	%r15, %rdi
	callq	_pci_is_pcie
	testl	%eax, %eax
	je	LBB0_16
## %bb.17:
	movq	_PCI_CAP_ID_PM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_pci_find_capability
	movl	%eax, 48(%r14)
	movq	%r14, %rdi
	callq	_IS_PF
	testq	%rax, %rax
	je	LBB0_20
## %bb.18:
	cmpl	$0, 48(%r14)
	jne	LBB0_20
## %bb.19:
	leaq	L_.str.7(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_DP_NOTICE
LBB0_20:
	movq	%r14, %rdi
	callq	_qed_set_coherency_mask
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_24
## %bb.21:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_pci_resource_start
	movq	%rax, 40(%r14)
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_pci_resource_end
	movl	%eax, 36(%r14)
	movl	(%r15), %eax
	movl	%eax, 32(%r14)
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_pci_ioremap_bar
	movl	%eax, 24(%r14)
	testl	%eax, %eax
	je	LBB0_22
## %bb.25:
	movq	16(%r14), %rdi
	movl	$2, %esi
	callq	_pci_resource_start
	movq	%rax, 8(%r14)
	movq	16(%r14), %rdi
	movl	$2, %esi
	callq	_pci_resource_len
	movl	%eax, 4(%r14)
	testl	%eax, %eax
	je	LBB0_26
## %bb.29:
	movq	8(%r14), %rdi
	movl	%eax, %esi
	callq	_ioremap_wc
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jne	LBB0_32
## %bb.30:
	leaq	L_.str.10(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_DP_NOTICE
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_31
LBB0_16:
	leaq	L_.str.6(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_DP_NOTICE
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_23:
	subl	(%rax), %ebx
LBB0_24:
	movq	%r15, %rdi
	callq	_pci_release_regions
LBB0_11:
	movq	%r15, %rdi
	callq	_pci_disable_device
LBB0_32:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	leaq	L_.str.8(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_DP_NOTICE
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_26:
	movq	%r14, %rdi
	callq	_IS_PF
	testq	%rax, %rax
	je	LBB0_27
## %bb.28:
	leaq	L_.str.9(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_DP_NOTICE
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_31:
	subl	(%rax), %ebx
	jmp	LBB0_32
LBB0_27:
	xorl	%ebx, %ebx
	jmp	LBB0_32
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot enable PCI device\n"

	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
L_.str.1:                               ## @.str.1
	.asciz	"No memory region found in bar #0\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"No memory region found in bar #2\n"

L_.str.3:                               ## @.str.3
	.asciz	"qed"

L_.str.4:                               ## @.str.4
	.asciz	"Failed to request PCI memory resources\n"

	.comm	_PCI_REVISION_ID,4,2            ## @PCI_REVISION_ID
	.comm	_PCI_REVISION_ID_ERROR_VAL,8,3  ## @PCI_REVISION_ID_ERROR_VAL
L_.str.5:                               ## @.str.5
	.asciz	"Detected PCI device error [rev_id 0x%x]. Probably due to prior indication. Aborting.\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.6:                               ## @.str.6
	.asciz	"The bus is not PCI Express\n"

	.comm	_PCI_CAP_ID_PM,4,2              ## @PCI_CAP_ID_PM
L_.str.7:                               ## @.str.7
	.asciz	"Cannot find power management capability\n"

L_.str.8:                               ## @.str.8
	.asciz	"Cannot map register space, aborting\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.9:                               ## @.str.9
	.asciz	"No Doorbell bar available\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.10:                              ## @.str.10
	.asciz	"Cannot map doorbell space\n"

	.no_dead_strip	_qed_init_pci
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qed_init_pci
_qed_init_pci:                          ; @qed_init_pci
	.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	x19, x1
	mov	x20, x0
	str	x1, [x0, #16]
	mov	x0, x1
	bl	_pci_enable_device
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_DP_NOTICE
	b	LBB0_27
LBB0_2:
	mov	x0, x19
	mov	w1, #0
	bl	_pci_resource_flags
Lloh2:
	adrp	x21, _IORESOURCE_MEM@GOTPAGE
Lloh3:
	ldr	x21, [x21, _IORESOURCE_MEM@GOTPAGEOFF]
	ldr	w8, [x21]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.3:
	mov	x0, x20
	bl	_IS_PF
	cbz	x0, LBB0_5
; %bb.4:
	mov	x0, x19
	mov	w1, #2
	bl	_pci_resource_flags
	ldr	w8, [x21]
	tst	w8, w0
	b.eq	LBB0_9
LBB0_5:
	add	x0, x19, #4
	bl	_atomic_read
	cmp	w0, #1
	b.ne	LBB0_12
; %bb.6:
Lloh4:
	adrp	x1, l_.str.3@PAGE
Lloh5:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_pci_request_regions
	cbz	w0, LBB0_11
; %bb.7:
	mov	x21, x0
Lloh6:
	adrp	x1, l_.str.4@PAGE
Lloh7:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_DP_NOTICE
	b	LBB0_26
LBB0_8:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_9:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_10:
	mov	x0, x20
	bl	_DP_NOTICE
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_26
LBB0_11:
	mov	x0, x19
	bl	_pci_set_master
	mov	x0, x19
	bl	_pci_save_state
LBB0_12:
Lloh15:
	adrp	x8, _PCI_REVISION_ID@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PCI_REVISION_ID@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_pci_read_config_byte
	ldr	x8, [sp, #8]
Lloh18:
	adrp	x9, _PCI_REVISION_ID_ERROR_VAL@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PCI_REVISION_ID_ERROR_VAL@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.13:
	str	x8, [sp]
Lloh21:
	adrp	x1, l_.str.5@PAGE
Lloh22:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	_DP_NOTICE
Lloh23:
	adrp	x8, _ENODEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_24
LBB0_14:
	mov	x0, x19
	bl	_pci_is_pcie
	cbz	w0, LBB0_23
; %bb.15:
Lloh25:
	adrp	x8, _PCI_CAP_ID_PM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PCI_CAP_ID_PM@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pci_find_capability
	str	w0, [x20, #48]
	mov	x0, x20
	bl	_IS_PF
	cbz	x0, LBB0_18
; %bb.16:
	ldr	w8, [x20, #48]
	cbnz	w8, LBB0_18
; %bb.17:
Lloh28:
	adrp	x1, l_.str.7@PAGE
Lloh29:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x20
	bl	_DP_NOTICE
LBB0_18:
	mov	x0, x20
	bl	_qed_set_coherency_mask
	mov	x21, x0
	cbnz	w0, LBB0_25
; %bb.19:
	mov	x0, x19
	mov	w1, #0
	bl	_pci_resource_start
	str	x0, [x20, #40]
	mov	x0, x19
	mov	w1, #0
	bl	_pci_resource_end
	ldr	w8, [x19]
	stp	w8, w0, [x20, #32]
	mov	x0, x19
	mov	w1, #0
	bl	_pci_ioremap_bar
	str	w0, [x20, #24]
	cbz	w0, LBB0_28
; %bb.20:
	ldr	x0, [x20, #16]
	mov	w1, #2
	bl	_pci_resource_start
	str	x0, [x20, #8]
	ldr	x0, [x20, #16]
	mov	w1, #2
	bl	_pci_resource_len
	str	w0, [x20, #4]
	cbz	w0, LBB0_29
; %bb.21:
	mov	x1, x0
	ldr	x0, [x20, #8]
	bl	_ioremap_wc
	str	w0, [x20]
	cbnz	w0, LBB0_32
; %bb.22:
Lloh30:
	adrp	x1, l_.str.10@PAGE
Lloh31:
	add	x1, x1, l_.str.10@PAGEOFF
	mov	x0, x20
	bl	_DP_NOTICE
Lloh32:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_31
LBB0_23:
Lloh34:
	adrp	x1, l_.str.6@PAGE
Lloh35:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_DP_NOTICE
Lloh36:
	adrp	x8, _EIO@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_24:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_25:
	mov	x0, x19
	bl	_pci_release_regions
LBB0_26:
	mov	x0, x19
	bl	_pci_disable_device
LBB0_27:
	mov	x0, x21
	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_28:
Lloh38:
	adrp	x1, l_.str.8@PAGE
Lloh39:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x0, x20
	bl	_DP_NOTICE
Lloh40:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_24
LBB0_29:
	mov	x0, x20
	bl	_IS_PF
	cbz	x0, LBB0_32
; %bb.30:
Lloh42:
	adrp	x1, l_.str.9@PAGE
Lloh43:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	x0, x20
	bl	_DP_NOTICE
Lloh44:
	adrp	x8, _EINVAL@GOTPAGE
Lloh45:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_31:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_27
LBB0_32:
	mov	w21, #0
	b	LBB0_27
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot enable PCI device\n"

	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
l_.str.1:                               ; @.str.1
	.asciz	"No memory region found in bar #0\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"No memory region found in bar #2\n"

l_.str.3:                               ; @.str.3
	.asciz	"qed"

l_.str.4:                               ; @.str.4
	.asciz	"Failed to request PCI memory resources\n"

	.comm	_PCI_REVISION_ID,4,2            ; @PCI_REVISION_ID
	.comm	_PCI_REVISION_ID_ERROR_VAL,8,3  ; @PCI_REVISION_ID_ERROR_VAL
l_.str.5:                               ; @.str.5
	.asciz	"Detected PCI device error [rev_id 0x%x]. Probably due to prior indication. Aborting.\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.6:                               ; @.str.6
	.asciz	"The bus is not PCI Express\n"

	.comm	_PCI_CAP_ID_PM,4,2              ; @PCI_CAP_ID_PM
l_.str.7:                               ; @.str.7
	.asciz	"Cannot find power management capability\n"

l_.str.8:                               ; @.str.8
	.asciz	"Cannot map register space, aborting\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.9:                               ; @.str.9
	.asciz	"No Doorbell bar available\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.10:                              ; @.str.10
	.asciz	"Cannot map doorbell space\n"

	.no_dead_strip	_qed_init_pci
.subsections_via_symbols
