	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_atl1c_phy_init                 ## -- Begin function atl1c_phy_init
	.p2align	4, 0x90
_atl1c_phy_init:                        ## @atl1c_phy_init
	.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, %rbx
	movq	16(%rdi), %r13
	movq	(%r13), %r15
	movq	_BMCR_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_MII_PHYSID1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	12(%rdi), %rdx
	callq	_atl1c_read_phy_reg
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_MII_PHYSID2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	8(%rbx), %rdx
	movq	%rbx, %rdi
	callq	_atl1c_read_phy_reg
	testq	%rax, %rax
	je	LBB0_3
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movl	$-1, %r12d
LBB0_18:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	(%rbx), %eax
	addl	$-128, %eax
	cmpl	$4, %eax
	ja	LBB0_12
## %bb.4:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_5:
	movq	%rbx, %rdi
	callq	_atl1c_phy_setup_adv
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_netif_msg_link
	testl	%eax, %eax
	je	LBB0_18
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_18
LBB0_12:
	movq	%r13, %rdi
	callq	_netif_msg_link
	movl	$-1, %r12d
	testl	%eax, %eax
	je	LBB0_18
## %bb.13:
	movl	(%rbx), %edx
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_18
LBB0_11:
	movq	_BMCR_FULLDPLX@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_14:
	movq	_BMCR_SPEED100@GOTPCREL(%rip), %rax
LBB0_15:
	orl	(%rax), %r14d
	jmp	LBB0_16
LBB0_10:
	movq	_BMCR_SPEED100@GOTPCREL(%rip), %rax
	movq	_BMCR_FULLDPLX@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_8:
	movq	_BMCR_ANENABLE@GOTPCREL(%rip), %rax
	movq	_BMCR_ANRESTART@GOTPCREL(%rip), %rcx
LBB0_9:
	orl	(%rax), %r14d
	orl	(%rcx), %r14d
LBB0_16:
	movq	_MII_BMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_atl1c_write_phy_reg
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_18
## %bb.17:
	movl	$1, 4(%rbx)
	xorl	%r12d, %r12d
	jmp	LBB0_18
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
LJTI0_0:
	.long	L0_0_set_5
	.long	L0_0_set_16
	.long	L0_0_set_11
	.long	L0_0_set_14
	.long	L0_0_set_10
	.end_data_region
                                        ## -- End function
	.comm	_BMCR_RESET,4,2                 ## @BMCR_RESET
	.comm	_MII_PHYSID1,4,2                ## @MII_PHYSID1
	.comm	_MII_PHYSID2,4,2                ## @MII_PHYSID2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error get phy ID\n"

L_.str.1:                               ## @.str.1
	.asciz	"Error Setting up Auto-Negotiation\n"

	.comm	_BMCR_ANENABLE,4,2              ## @BMCR_ANENABLE
	.comm	_BMCR_ANRESTART,4,2             ## @BMCR_ANRESTART
	.comm	_BMCR_SPEED100,4,2              ## @BMCR_SPEED100
	.comm	_BMCR_FULLDPLX,4,2              ## @BMCR_FULLDPLX
L_.str.2:                               ## @.str.2
	.asciz	"Wrong Media type %d\n"

	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_atl1c_phy_init                 ; -- Begin function atl1c_phy_init
	.p2align	2
_atl1c_phy_init:                        ; @atl1c_phy_init
	.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
	ldr	x22, [x0, #16]
Lloh0:
	adrp	x8, _BMCR_RESET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BMCR_RESET@GOTPAGEOFF]
	ldr	x21, [x22]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x8, _MII_PHYSID1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MII_PHYSID1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, x0, #12
	bl	_atl1c_read_phy_reg
	cbnz	x0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _MII_PHYSID2@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MII_PHYSID2@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, x19, #8
	mov	x0, x19
	bl	_atl1c_read_phy_reg
	cbz	x0, LBB0_6
LBB0_2:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
LBB0_3:
	mov	x0, x21
	bl	_dev_err
LBB0_4:
	mov	w23, #-1
LBB0_5:
	mov	x0, x23
	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:
	ldr	w8, [x19]
	sub	w8, w8, #128
	cmp	w8, #4
	b.hi	LBB0_11
; %bb.7:
Lloh11:
	adrp	x9, lJTI0_0@PAGE
Lloh12:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_8
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_8:
	mov	x0, x19
	bl	_atl1c_phy_setup_adv
	cbz	w0, LBB0_17
; %bb.9:
	mov	x23, x0
	mov	x0, x22
	bl	_netif_msg_link
	cbz	w0, LBB0_5
; %bb.10:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	b	LBB0_5
LBB0_11:
	mov	x0, x22
	bl	_netif_msg_link
	cbz	w0, LBB0_4
; %bb.12:
	ldr	w8, [x19]
	str	x8, [sp]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_3
LBB0_13:
Lloh17:
	adrp	x8, _BMCR_FULLDPLX@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BMCR_FULLDPLX@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
Lloh19:
	adrp	x8, _BMCR_SPEED100@GOTPAGE
Lloh20:
	ldr	x8, [x8, _BMCR_SPEED100@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	orr	w20, w8, w20
	b	LBB0_19
LBB0_16:
Lloh21:
	adrp	x8, _BMCR_SPEED100@GOTPAGE
Lloh22:
	ldr	x8, [x8, _BMCR_SPEED100@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _BMCR_FULLDPLX@GOTPAGE
Lloh25:
	ldr	x9, [x9, _BMCR_FULLDPLX@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:
Lloh26:
	adrp	x8, _BMCR_ANENABLE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BMCR_ANENABLE@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
Lloh29:
	adrp	x9, _BMCR_ANRESTART@GOTPAGE
Lloh30:
	ldr	x9, [x9, _BMCR_ANRESTART@GOTPAGEOFF]
LBB0_18:
	ldr	w9, [x9]
	orr	w8, w8, w20
	orr	w20, w8, w9
LBB0_19:
Lloh31:
	adrp	x8, _MII_BMCR@GOTPAGE
Lloh32:
	ldr	x8, [x8, _MII_BMCR@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_atl1c_write_phy_reg
	mov	x23, x0
	cbnz	w0, LBB0_5
; %bb.20:
	mov	w8, #1
	str	w8, [x19, #4]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_8-LBB0_8)>>2
	.byte	(LBB0_19-LBB0_8)>>2
	.byte	(LBB0_13-LBB0_8)>>2
	.byte	(LBB0_14-LBB0_8)>>2
	.byte	(LBB0_16-LBB0_8)>>2
                                        ; -- End function
	.comm	_BMCR_RESET,4,2                 ; @BMCR_RESET
	.comm	_MII_PHYSID1,4,2                ; @MII_PHYSID1
	.comm	_MII_PHYSID2,4,2                ; @MII_PHYSID2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error get phy ID\n"

l_.str.1:                               ; @.str.1
	.asciz	"Error Setting up Auto-Negotiation\n"

	.comm	_BMCR_ANENABLE,4,2              ; @BMCR_ANENABLE
	.comm	_BMCR_ANRESTART,4,2             ; @BMCR_ANRESTART
	.comm	_BMCR_SPEED100,4,2              ; @BMCR_SPEED100
	.comm	_BMCR_FULLDPLX,4,2              ; @BMCR_FULLDPLX
l_.str.2:                               ; @.str.2
	.asciz	"Wrong Media type %d\n"

	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
.subsections_via_symbols
