	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function PHY_Setup
_PHY_Setup:                             ## @PHY_Setup
	.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, %r14
	movq	_PHY_ID_0_REG@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	-48(%rbp), %rdx
	callq	_ql_mii_read_reg
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_4
LBB0_2:
	movq	_PHY_ID_1_REG@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_ql_mii_read_reg
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	movl	%eax, %ebx
	movl	8(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_4:
	callq	_netdev_err
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	-48(%rbp), %esi
	cmpl	$65535, %esi                    ## imm = 0xFFFF
	sete	%al
	movl	-44(%rbp), %edx
	cmpl	$65535, %edx                    ## imm = 0xFFFF
	sete	%r12b
	orb	%al, %r12b
	xorl	%ebx, %ebx
	cmpb	$1, %r12b
	jne	LBB0_15
## %bb.7:
	cmpq	$0, (%r14)
	jne	LBB0_9
## %bb.8:
	movq	_MII_AGERE_ADDR_1@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_9:
	movq	_MII_AGERE_ADDR_2@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
	movl	(%r13), %esi
	movl	%eax, %r13d
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movl	%eax, %ecx
	callq	_ql_mii_read_reg_ex
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %ebx
	movl	8(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_4
LBB0_12:
	movl	(%r15), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movl	%r13d, %ecx
	callq	_ql_mii_read_reg_ex
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %ebx
	movl	8(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_4
LBB0_14:
	movl	-48(%rbp), %esi
	movl	-44(%rbp), %edx
	movl	%r13d, %ebx
LBB0_15:
	movq	%r14, %rdi
	callq	_getPhyType
	movl	%eax, 12(%r14)
	movq	_PHY_AGERE_ET1011C@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	sete	%cl
	andb	%r12b, %cl
	cmpb	$1, %cl
	jne	LBB0_17
## %bb.16:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_phyAgereSpecificInit
	xorl	%ebx, %ebx
	jmp	LBB0_5
LBB0_17:
	movq	_PHY_TYPE_UNKNOWN@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.18:
	movl	8(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_netdev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_PHY_ID_0_REG,4,2               ## @PHY_ID_0_REG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not read from reg PHY_ID_0_REG\n"

	.comm	_PHY_ID_1_REG,4,2               ## @PHY_ID_1_REG
L_.str.1:                               ## @.str.1
	.asciz	"Could not read from reg PHY_ID_1_REG\n"

	.comm	_MII_AGERE_ADDR_1,4,2           ## @MII_AGERE_ADDR_1
	.comm	_MII_AGERE_ADDR_2,4,2           ## @MII_AGERE_ADDR_2
L_.str.2:                               ## @.str.2
	.asciz	"Could not read from reg PHY_ID_0_REG after Agere detected\n"

L_.str.3:                               ## @.str.3
	.asciz	"Could not read from reg PHY_ID_1_REG after Agere detected\n"

	.comm	_PHY_AGERE_ET1011C,4,2          ## @PHY_AGERE_ET1011C
	.comm	_PHY_TYPE_UNKNOWN,4,2           ## @PHY_TYPE_UNKNOWN
L_.str.4:                               ## @.str.4
	.asciz	"PHY is unknown\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_PHY_Setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function PHY_Setup
_PHY_Setup:                             ; @PHY_Setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
Lloh0:
	adrp	x24, _PHY_ID_0_REG@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PHY_ID_0_REG@GOTPAGEOFF]
	ldr	w1, [x24]
	add	x2, sp, #12
	bl	_ql_mii_read_reg
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19, #8]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
Lloh4:
	adrp	x23, _PHY_ID_1_REG@GOTPAGE
Lloh5:
	ldr	x23, [x23, _PHY_ID_1_REG@GOTPAGEOFF]
	ldr	w1, [x23]
	add	x2, sp, #8
	mov	x0, x19
	bl	_ql_mii_read_reg
	cbz	w0, LBB0_6
; %bb.3:
	mov	x20, x0
	ldr	w0, [x19, #8]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_4:
	bl	_netdev_err
LBB0_5:
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
LBB0_6:
	ldp	w2, w1, [sp, #8]
	mov	w8, #65535
	cmp	w1, w8
	ccmp	w2, w8, #4, ne
	cset	w22, eq
	b.ne	LBB0_9
; %bb.7:
	ldr	x8, [x19]
Lloh8:
	adrp	x9, _MII_AGERE_ADDR_1@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MII_AGERE_ADDR_1@GOTPAGEOFF]
Lloh10:
	adrp	x10, _MII_AGERE_ADDR_2@GOTPAGE
Lloh11:
	ldr	x10, [x10, _MII_AGERE_ADDR_2@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x9, x10, eq
	ldr	w21, [x8]
	ldr	w1, [x24]
	add	x2, sp, #12
	mov	x0, x19
	mov	x3, x21
	bl	_ql_mii_read_reg_ex
	cbz	w0, LBB0_14
; %bb.8:
	mov	x20, x0
	ldr	w0, [x19, #8]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_9:
	mov	w21, #0
LBB0_10:
	mov	x0, x19
	bl	_getPhyType
Lloh14:
	adrp	x8, _PHY_AGERE_ET1011C@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PHY_AGERE_ET1011C@GOTPAGEOFF]
	str	w0, [x19, #12]
Lloh16:
	ldr	w8, [x8]
	cmp	w0, w8
	cset	w8, eq
	and	w8, w8, w22
	cmp	w8, #1
	b.ne	LBB0_12
; %bb.11:
	mov	x0, x19
	mov	x1, x21
	bl	_phyAgereSpecificInit
	mov	w20, #0
	b	LBB0_5
LBB0_12:
Lloh17:
	adrp	x8, _PHY_TYPE_UNKNOWN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PHY_TYPE_UNKNOWN@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_16
; %bb.13:
	ldr	w0, [x19, #8]
Lloh20:
	adrp	x1, l_.str.4@PAGE
Lloh21:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_netdev_err
Lloh22:
	adrp	x8, _EIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_14:
	ldr	w1, [x23]
	add	x2, sp, #8
	mov	x0, x19
	mov	x3, x21
	bl	_ql_mii_read_reg_ex
	cbz	w0, LBB0_17
; %bb.15:
	mov	x20, x0
	ldr	w0, [x19, #8]
Lloh25:
	adrp	x1, l_.str.3@PAGE
Lloh26:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_4
LBB0_16:
	mov	w20, #0
	b	LBB0_5
LBB0_17:
	ldp	w2, w1, [sp, #8]
	b	LBB0_10
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_PHY_ID_0_REG,4,2               ; @PHY_ID_0_REG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not read from reg PHY_ID_0_REG\n"

	.comm	_PHY_ID_1_REG,4,2               ; @PHY_ID_1_REG
l_.str.1:                               ; @.str.1
	.asciz	"Could not read from reg PHY_ID_1_REG\n"

	.comm	_MII_AGERE_ADDR_1,4,2           ; @MII_AGERE_ADDR_1
	.comm	_MII_AGERE_ADDR_2,4,2           ; @MII_AGERE_ADDR_2
l_.str.2:                               ; @.str.2
	.asciz	"Could not read from reg PHY_ID_0_REG after Agere detected\n"

l_.str.3:                               ; @.str.3
	.asciz	"Could not read from reg PHY_ID_1_REG after Agere detected\n"

	.comm	_PHY_AGERE_ET1011C,4,2          ; @PHY_AGERE_ET1011C
	.comm	_PHY_TYPE_UNKNOWN,4,2           ; @PHY_TYPE_UNKNOWN
l_.str.4:                               ; @.str.4
	.asciz	"PHY is unknown\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_PHY_Setup
.subsections_via_symbols
