	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function armada8k_pcie_setup_phys
_armada8k_pcie_setup_phys:              ## @armada8k_pcie_setup_phys
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	16(%rdi), %rax
	movq	(%rax), %r14
	movq	_ARMADA8K_PCIE_MAX_LANES@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_7
## %bb.1:
	movq	(%r14), %r12
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	(%r15)
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movslq	(%r13), %rax
	cmpq	%rax, %rbx
	jge	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_devm_of_phy_get_by_index
	movq	8(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	8(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_PTR_ERR
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_13
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r15), %rax
	movq	$0, (%rax,%rbx,8)
	jmp	LBB0_6
LBB0_7:
	cmpl	$0, (%r15)
	jne	LBB0_9
## %bb.8:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_warn
LBB0_9:
	movq	%r15, %rdi
	callq	_armada8k_pcie_enable_phys
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_12
LBB0_10:
	xorl	%ebx, %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	8(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ARMADA8K_PCIE_MAX_LANES,4,2    ## @ARMADA8K_PCIE_MAX_LANES
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No available PHY\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to initialize PHY(s) (%d)\n"

	.no_dead_strip	_armada8k_pcie_setup_phys
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function armada8k_pcie_setup_phys
_armada8k_pcie_setup_phys:              ; @armada8k_pcie_setup_phys
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	ldr	x8, [x0, #16]
	ldr	x19, [x8]
Lloh0:
	adrp	x23, _ARMADA8K_PCIE_MAX_LANES@GOTPAGE
Lloh1:
	ldr	x23, [x23, _ARMADA8K_PCIE_MAX_LANES@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x21, #0
	ldr	x22, [x19]
Lloh2:
	adrp	x24, _ENODEV@GOTPAGE
Lloh3:
	ldr	x24, [x24, _ENODEV@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x23]
	cmp	x21, x8
	b.ge	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_devm_of_phy_get_by_index
	ldr	x8, [x20, #8]
	lsl	x9, x21, #3
	str	x0, [x8, x9]
	ldr	x8, [x20, #8]
	ldr	x0, [x8, x9]
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, #8]
	ldr	x0, [x8, x21, lsl #3]
	bl	_PTR_ERR
	ldr	w8, [x24]
	cmn	w0, w8
	b.ne	LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, #8]
	str	xzr, [x8, x21, lsl #3]
	b	LBB0_3
LBB0_7:
	ldr	w8, [x20]
	cbnz	w8, LBB0_9
; %bb.8:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
LBB0_9:
	mov	x0, x20
	bl	_armada8k_pcie_enable_phys
	mov	x20, x0
	cbz	w0, LBB0_11
; %bb.10:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dev_err
LBB0_11:
	mov	x0, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	x8, [x20, #8]
	ldr	x0, [x8, x21, lsl #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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_PTR_ERR
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ARMADA8K_PCIE_MAX_LANES,4,2    ; @ARMADA8K_PCIE_MAX_LANES
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No available PHY\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to initialize PHY(s) (%d)\n"

	.no_dead_strip	_armada8k_pcie_setup_phys
.subsections_via_symbols
