	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_enetc_mdio_read                ## -- Begin function enetc_mdio_read
	.p2align	4, 0x90
_enetc_mdio_read:                       ## @enetc_mdio_read
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movq	(%rax), %rbx
	movq	_ENETC_MDC_DIV@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MDIO_CFG_CLKDIV
	movq	_MDIO_CFG_NEG@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_MII_ADDR_C45@GOTPCREL(%rip), %rcx
	testl	%r12d, (%rcx)
	je	LBB0_2
## %bb.1:
	movl	%r12d, %r13d
	sarl	$16, %r13d
	movq	_MDIO_CFG_ENC45@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	jmp	LBB0_3
LBB0_2:
	movq	_MDIO_CFG_ENC45@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %eax
	movl	%r12d, %r13d
LBB0_3:
	movq	_MDIO_CFG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_enetc_mdio_wr
	movq	%rbx, %rdi
	callq	_enetc_mdio_wait_complete
	testl	%eax, %eax
	je	LBB0_4
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	andl	$31, %r13d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_MDIO_CTL_PORT_ADDR
	movl	%eax, %r15d
	movl	%r13d, %edi
	callq	_MDIO_CTL_DEV_ADDR
	movl	%eax, %r14d
	orl	%r15d, %r14d
	movq	_MDIO_CTL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_enetc_mdio_wr
	movq	_MII_ADDR_C45@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_6
## %bb.5:
	movq	_MDIO_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzwl	%r12w, %edx
	movq	%rbx, %rdi
	callq	_enetc_mdio_wr
	movq	%rbx, %rdi
	callq	_enetc_mdio_wait_complete
	testl	%eax, %eax
	jne	LBB0_10
LBB0_6:
	movl	(%r15), %esi
	movq	_MDIO_CTL_READ@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_enetc_mdio_wr
	movq	%rbx, %rdi
	callq	_enetc_mdio_wait_complete
	testl	%eax, %eax
	jne	LBB0_10
## %bb.7:
	movq	_MDIO_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_enetc_mdio_rd
	movq	_MDIO_CFG_RD_ER@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.8:
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %ecx
	movl	%r12d, %r8d
	callq	_dev_dbg
	movl	$65535, %eax                    ## imm = 0xFFFF
	jmp	LBB0_10
LBB0_9:
	movq	_MDIO_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_enetc_mdio_rd
	movzwl	%ax, %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_ENETC_MDC_DIV,4,2              ## @ENETC_MDC_DIV
	.comm	_MDIO_CFG_NEG,4,2               ## @MDIO_CFG_NEG
	.comm	_MII_ADDR_C45,4,2               ## @MII_ADDR_C45
	.comm	_MDIO_CFG_ENC45,4,2             ## @MDIO_CFG_ENC45
	.comm	_MDIO_CFG,4,2                   ## @MDIO_CFG
	.comm	_MDIO_CTL,4,2                   ## @MDIO_CTL
	.comm	_MDIO_ADDR,4,2                  ## @MDIO_ADDR
	.comm	_MDIO_CTL_READ,4,2              ## @MDIO_CTL_READ
	.comm	_MDIO_CFG_RD_ER,4,2             ## @MDIO_CFG_RD_ER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error while reading PHY%d reg at %d.%hhu\n"

	.comm	_MDIO_DATA,4,2                  ## @MDIO_DATA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_enetc_mdio_read                ; -- Begin function enetc_mdio_read
	.p2align	2
_enetc_mdio_read:                       ; @enetc_mdio_read
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	x22, [x8]
Lloh0:
	adrp	x8, _ENETC_MDC_DIV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENETC_MDC_DIV@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_MDIO_CFG_CLKDIV
Lloh3:
	adrp	x8, _MDIO_CFG_NEG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MDIO_CFG_NEG@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh6:
	adrp	x26, _MII_ADDR_C45@GOTPAGE
Lloh7:
	ldr	x26, [x26, _MII_ADDR_C45@GOTPAGEOFF]
	ldr	w9, [x26]
	tst	w9, w19
	b.eq	LBB0_2
; %bb.1:
	asr	w23, w19, #16
Lloh8:
	adrp	x9, _MDIO_CFG_ENC45@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MDIO_CFG_ENC45@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w2, w9, w8
	b	LBB0_3
LBB0_2:
Lloh11:
	adrp	x9, _MDIO_CFG_ENC45@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MDIO_CFG_ENC45@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	bic	w2, w8, w9
	mov	x23, x19
LBB0_3:
Lloh14:
	adrp	x25, _MDIO_CFG@GOTPAGE
Lloh15:
	ldr	x25, [x25, _MDIO_CFG@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x22
	bl	_enetc_mdio_wr
	mov	x0, x22
	bl	_enetc_mdio_wait_complete
	cbz	w0, LBB0_5
LBB0_4:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_5:
	and	w23, w23, #0x1f
	mov	x0, x20
	bl	_MDIO_CTL_PORT_ADDR
	mov	x24, x0
	mov	x0, x23
	bl	_MDIO_CTL_DEV_ADDR
	orr	w24, w0, w24
Lloh16:
	adrp	x27, _MDIO_CTL@GOTPAGE
Lloh17:
	ldr	x27, [x27, _MDIO_CTL@GOTPAGEOFF]
	ldr	w1, [x27]
	mov	x0, x22
	mov	x2, x24
	bl	_enetc_mdio_wr
	ldr	w8, [x26]
	tst	w8, w19
	b.eq	LBB0_7
; %bb.6:
Lloh18:
	adrp	x8, _MDIO_ADDR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MDIO_ADDR@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	and	w2, w19, #0xffff
	mov	x0, x22
	bl	_enetc_mdio_wr
	mov	x0, x22
	bl	_enetc_mdio_wait_complete
	cbnz	w0, LBB0_4
LBB0_7:
	ldr	w1, [x27]
Lloh21:
	adrp	x8, _MDIO_CTL_READ@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MDIO_CTL_READ@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	orr	w2, w8, w24
	mov	x0, x22
	bl	_enetc_mdio_wr
	mov	x0, x22
	bl	_enetc_mdio_wait_complete
	cbnz	w0, LBB0_4
; %bb.8:
	ldr	w1, [x25]
	mov	x0, x22
	bl	_enetc_mdio_rd
Lloh24:
	adrp	x8, _MDIO_CFG_RD_ER@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MDIO_CFG_RD_ER@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_10
; %bb.9:
Lloh27:
	adrp	x1, l_.str@PAGE
Lloh28:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	mov	x3, x23
	mov	x4, x19
	bl	_dev_dbg
	mov	w0, #65535
	b	LBB0_4
LBB0_10:
Lloh29:
	adrp	x8, _MDIO_DATA@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MDIO_DATA@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_enetc_mdio_rd
	and	w0, w0, #0xffff
	b	LBB0_4
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_ENETC_MDC_DIV,4,2              ; @ENETC_MDC_DIV
	.comm	_MDIO_CFG_NEG,4,2               ; @MDIO_CFG_NEG
	.comm	_MII_ADDR_C45,4,2               ; @MII_ADDR_C45
	.comm	_MDIO_CFG_ENC45,4,2             ; @MDIO_CFG_ENC45
	.comm	_MDIO_CFG,4,2                   ; @MDIO_CFG
	.comm	_MDIO_CTL,4,2                   ; @MDIO_CTL
	.comm	_MDIO_ADDR,4,2                  ; @MDIO_ADDR
	.comm	_MDIO_CTL_READ,4,2              ; @MDIO_CTL_READ
	.comm	_MDIO_CFG_RD_ER,4,2             ; @MDIO_CFG_RD_ER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error while reading PHY%d reg at %d.%hhu\n"

	.comm	_MDIO_DATA,4,2                  ; @MDIO_DATA
.subsections_via_symbols
