	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smsc75xx_phy_gig_workaround
_smsc75xx_phy_gig_workaround:           ## @smsc75xx_phy_gig_workaround
	.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, %r12
	movl	(%rdi), %edi
	movl	4(%r12), %esi
	movq	_MII_BMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$16448, %ecx                    ## imm = 0x4040
	callq	_smsc75xx_mdio_write
	movl	$-1, %ebx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	movq	%r12, %rdi
	callq	_smsc75xx_link_ok_nopm
	movl	%eax, %r14d
	movl	$10000, %edi                    ## imm = 0x2710
	movl	$20000, %esi                    ## imm = 0x4E20
	callq	_usleep_range
	testl	%r14d, %r14d
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$999, %ebx                      ## imm = 0x3E7
	jb	LBB0_1
LBB0_3:
	cmpl	$999, %ebx                      ## imm = 0x3E7
	jb	LBB0_5
## %bb.4:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
LBB0_15:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_netdev_warn
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_16
LBB0_5:
	movq	_PMT_CTL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	callq	_smsc75xx_read_reg
	testl	%eax, %eax
	js	LBB0_6
## %bb.8:
	movq	_PMT_CTL_PHY_RST@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %edx
	orl	(%rax), %edx
	movl	%edx, -44(%rbp)
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_smsc75xx_write_reg
	testl	%eax, %eax
	js	LBB0_17
## %bb.9:
	movl	$-1, %r13d
	leaq	-44(%rbp), %r15
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	$10000, %edi                    ## imm = 0x2710
	movl	$20000, %esi                    ## imm = 0x4E20
	callq	_usleep_range
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_smsc75xx_read_reg
	testl	%eax, %eax
	js	LBB0_6
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	incl	%r13d
	movq	_PMT_CTL_PHY_RST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -44(%rbp)
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$99, %r13d
	jb	LBB0_10
LBB0_13:
	xorl	%r14d, %r14d
	cmpl	$99, %r13d
	jb	LBB0_16
## %bb.14:
	movl	(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_15
LBB0_6:
	movl	%eax, %r14d
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_7
LBB0_17:
	movl	%eax, %r14d
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_7:
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_netdev_warn
LBB0_16:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout waiting for PHY link up\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_PMT_CTL,4,2                    ## @PMT_CTL
L_.str.1:                               ## @.str.1
	.asciz	"Failed to read PMT_CTL: %d\n"

	.comm	_PMT_CTL_PHY_RST,4,2            ## @PMT_CTL_PHY_RST
L_.str.2:                               ## @.str.2
	.asciz	"Failed to write PMT_CTL: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"timeout waiting for PHY Reset\n"

	.no_dead_strip	_smsc75xx_phy_gig_workaround
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smsc75xx_phy_gig_workaround
_smsc75xx_phy_gig_workaround:           ; @smsc75xx_phy_gig_workaround
	.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	w0, [x0]
	ldr	w1, [x19, #4]
Lloh0:
	adrp	x8, _MII_BMCR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MII_BMCR@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w3, #16448
	bl	_smsc75xx_mdio_write
	mov	w21, #-1
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	w21, w21, #1
	mov	x0, x19
	bl	_smsc75xx_link_ok_nopm
	mov	x20, x0
	mov	w0, #10000
	mov	w1, #20000
	bl	_usleep_range
	cbnz	w20, LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w21, #999
	b.lo	LBB0_1
LBB0_3:
	cmp	w21, #999
	b.lo	LBB0_6
; %bb.4:
	ldr	w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
LBB0_5:
	bl	_netdev_warn
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_18
LBB0_6:
Lloh8:
	adrp	x21, _PMT_CTL@GOTPAGE
Lloh9:
	ldr	x21, [x21, _PMT_CTL@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_smsc75xx_read_reg
	tbnz	w0, #31, LBB0_14
; %bb.7:
Lloh10:
	adrp	x22, _PMT_CTL_PHY_RST@GOTPAGE
Lloh11:
	ldr	x22, [x22, _PMT_CTL_PHY_RST@GOTPAGEOFF]
	ldr	w8, [x22]
	ldr	w9, [sp, #12]
	orr	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_smsc75xx_write_reg
	tbnz	w0, #31, LBB0_15
; %bb.8:
	mov	w23, #-1
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #10000
	mov	w1, #20000
	bl	_usleep_range
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_smsc75xx_read_reg
	tbnz	w0, #31, LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	w23, w23, #1
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w23, #99
	b.lo	LBB0_9
LBB0_12:
	cmp	w23, #99
	b.lo	LBB0_19
; %bb.13:
	ldr	w0, [x19]
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_5
LBB0_14:
	mov	x20, x0
	ldr	w0, [x19]
	str	x20, [sp]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_netdev_warn
	b	LBB0_18
LBB0_15:
	mov	x20, x0
	ldr	w0, [x19]
	str	x20, [sp]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_17
LBB0_16:
	mov	x20, x0
	ldr	w0, [x19]
	str	x20, [sp]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_17:
	bl	_netdev_warn
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
LBB0_18:
	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_19:
	mov	w20, #0
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout waiting for PHY link up\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_PMT_CTL,4,2                    ; @PMT_CTL
l_.str.1:                               ; @.str.1
	.asciz	"Failed to read PMT_CTL: %d\n"

	.comm	_PMT_CTL_PHY_RST,4,2            ; @PMT_CTL_PHY_RST
l_.str.2:                               ; @.str.2
	.asciz	"Failed to write PMT_CTL: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"timeout waiting for PHY Reset\n"

	.no_dead_strip	_smsc75xx_phy_gig_workaround
.subsections_via_symbols
