	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nixge_mdio_read
_nixge_mdio_read:                       ## @nixge_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
	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	_MII_ADDR_C45@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_3
## %bb.1:
	movl	%edx, %r12d
	shrl	$16, %r12d
	andl	$31, %r12d
	movq	_NIXGE_REG_MDIO_ADDR@GOTPCREL(%rip), %rax
	movl	%esi, %r14d
	movl	(%rax), %esi
	movzwl	%dx, %edx
	movq	%r15, %rdi
	callq	_nixge_ctrl_write_reg
	movq	_NIXGE_MDIO_CLAUSE45@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_NIXGE_MDIO_OP_ADDRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_NIXGE_MDIO_OP
	movl	%eax, %r13d
	movl	%r14d, %edi
	callq	_NIXGE_MDIO_ADDR
	orl	%eax, %ebx
	orl	%r13d, %ebx
	movl	%r12d, %edi
	callq	_NIXGE_MDIO_MMD
	orl	%eax, %ebx
	movq	_NIXGE_REG_MDIO_OP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_nixge_ctrl_write_reg
	movq	_NIXGE_REG_MDIO_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_nixge_ctrl_write_reg
	movl	(%rbx), %esi
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	movl	$10, %r8d
	movl	$1000, %r9d                     ## imm = 0x3E8
	callq	_nixge_ctrl_poll_timeout
	testl	%eax, %eax
	je	LBB0_2
## %bb.7:
	movl	%eax, %ebx
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_8
LBB0_3:
	movl	%esi, %r14d
	andl	$31, %edx
	movq	_NIXGE_MDIO_C22_READ@GOTPCREL(%rip), %rax
	movq	_NIXGE_MDIO_CLAUSE22@GOTPCREL(%rip), %rcx
	movl	%edx, %r12d
	jmp	LBB0_4
LBB0_2:
	movq	_NIXGE_MDIO_C45_READ@GOTPCREL(%rip), %rax
	movq	_NIXGE_MDIO_CLAUSE45@GOTPCREL(%rip), %rcx
LBB0_4:
	movl	(%rcx), %ebx
	movl	(%rax), %edi
	callq	_NIXGE_MDIO_OP
	movl	%eax, %r13d
	movl	%r14d, %edi
	callq	_NIXGE_MDIO_ADDR
	orl	%eax, %ebx
	orl	%r13d, %ebx
	movl	%r12d, %edi
	callq	_NIXGE_MDIO_MMD
	orl	%eax, %ebx
	movq	_NIXGE_REG_MDIO_OP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_nixge_ctrl_write_reg
	movq	_NIXGE_REG_MDIO_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_nixge_ctrl_write_reg
	movl	(%rbx), %esi
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	movl	$10, %r8d
	movl	$1000, %r9d                     ## imm = 0x3E8
	callq	_nixge_ctrl_poll_timeout
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_8:
	callq	_dev_err
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_NIXGE_REG_MDIO_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nixge_ctrl_read_reg            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_ADDR_C45,4,2               ## @MII_ADDR_C45
	.comm	_NIXGE_REG_MDIO_ADDR,4,2        ## @NIXGE_REG_MDIO_ADDR
	.comm	_NIXGE_MDIO_CLAUSE45,4,2        ## @NIXGE_MDIO_CLAUSE45
	.comm	_NIXGE_MDIO_OP_ADDRESS,4,2      ## @NIXGE_MDIO_OP_ADDRESS
	.comm	_NIXGE_REG_MDIO_OP,4,2          ## @NIXGE_REG_MDIO_OP
	.comm	_NIXGE_REG_MDIO_CTRL,4,2        ## @NIXGE_REG_MDIO_CTRL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout setting address"

	.comm	_NIXGE_MDIO_C45_READ,4,2        ## @NIXGE_MDIO_C45_READ
	.comm	_NIXGE_MDIO_CLAUSE22,4,2        ## @NIXGE_MDIO_CLAUSE22
	.comm	_NIXGE_MDIO_C22_READ,4,2        ## @NIXGE_MDIO_C22_READ
L_.str.1:                               ## @.str.1
	.asciz	"timeout setting read command"

	.comm	_NIXGE_REG_MDIO_DATA,4,2        ## @NIXGE_REG_MDIO_DATA
	.no_dead_strip	_nixge_mdio_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nixge_mdio_read
_nixge_mdio_read:                       ; @nixge_mdio_read
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _MII_ADDR_C45@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MII_ADDR_C45@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x24, _NIXGE_REG_MDIO_OP@GOTPAGE
Lloh4:
	ldr	x24, [x24, _NIXGE_REG_MDIO_OP@GOTPAGEOFF]
Lloh5:
	adrp	x23, _NIXGE_REG_MDIO_CTRL@GOTPAGE
Lloh6:
	ldr	x23, [x23, _NIXGE_REG_MDIO_CTRL@GOTPAGEOFF]
	tst	w8, w2
	b.eq	LBB0_3
; %bb.1:
	ubfx	w21, w2, #16, #5
Lloh7:
	adrp	x8, _NIXGE_REG_MDIO_ADDR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _NIXGE_REG_MDIO_ADDR@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	and	w2, w2, #0xffff
	mov	x0, x19
	bl	_nixge_ctrl_write_reg
Lloh10:
	adrp	x25, _NIXGE_MDIO_CLAUSE45@GOTPAGE
Lloh11:
	ldr	x25, [x25, _NIXGE_MDIO_CLAUSE45@GOTPAGEOFF]
	ldr	w22, [x25]
Lloh12:
	adrp	x8, _NIXGE_MDIO_OP_ADDRESS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NIXGE_MDIO_OP_ADDRESS@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_NIXGE_MDIO_OP
	orr	w22, w0, w22
	mov	x0, x20
	bl	_NIXGE_MDIO_ADDR
	orr	w22, w22, w0
	mov	x0, x21
	bl	_NIXGE_MDIO_MMD
	orr	w2, w22, w0
	ldr	w1, [x24]
	mov	x0, x19
	bl	_nixge_ctrl_write_reg
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #1
	bl	_nixge_ctrl_write_reg
	ldr	w1, [x23]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #10
	mov	w5, #1000
	bl	_nixge_ctrl_poll_timeout
	cbz	w0, LBB0_4
; %bb.2:
	mov	x22, x0
	ldr	w0, [x19]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_3:
	and	w21, w2, #0x1f
Lloh17:
	adrp	x8, _NIXGE_MDIO_C22_READ@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NIXGE_MDIO_C22_READ@GOTPAGEOFF]
Lloh19:
	adrp	x25, _NIXGE_MDIO_CLAUSE22@GOTPAGE
Lloh20:
	ldr	x25, [x25, _NIXGE_MDIO_CLAUSE22@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh21:
	adrp	x8, _NIXGE_MDIO_C45_READ@GOTPAGE
Lloh22:
	ldr	x8, [x8, _NIXGE_MDIO_C45_READ@GOTPAGEOFF]
LBB0_5:
	ldr	w22, [x25]
	ldr	w0, [x8]
	bl	_NIXGE_MDIO_OP
	orr	w22, w0, w22
	mov	x0, x20
	bl	_NIXGE_MDIO_ADDR
	orr	w20, w22, w0
	mov	x0, x21
	bl	_NIXGE_MDIO_MMD
	orr	w2, w20, w0
	ldr	w1, [x24]
	mov	x0, x19
	bl	_nixge_ctrl_write_reg
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #1
	bl	_nixge_ctrl_write_reg
	ldr	w1, [x23]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #10
	mov	w5, #1000
	bl	_nixge_ctrl_poll_timeout
	cbz	w0, LBB0_8
; %bb.6:
	mov	x22, x0
	ldr	w0, [x19]
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	bl	_dev_err
	mov	x0, x22
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_8:
Lloh25:
	adrp	x8, _NIXGE_REG_MDIO_DATA@GOTPAGE
Lloh26:
	ldr	x8, [x8, _NIXGE_REG_MDIO_DATA@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_nixge_ctrl_read_reg
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_ADDR_C45,4,2               ; @MII_ADDR_C45
	.comm	_NIXGE_REG_MDIO_ADDR,4,2        ; @NIXGE_REG_MDIO_ADDR
	.comm	_NIXGE_MDIO_CLAUSE45,4,2        ; @NIXGE_MDIO_CLAUSE45
	.comm	_NIXGE_MDIO_OP_ADDRESS,4,2      ; @NIXGE_MDIO_OP_ADDRESS
	.comm	_NIXGE_REG_MDIO_OP,4,2          ; @NIXGE_REG_MDIO_OP
	.comm	_NIXGE_REG_MDIO_CTRL,4,2        ; @NIXGE_REG_MDIO_CTRL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout setting address"

	.comm	_NIXGE_MDIO_C45_READ,4,2        ; @NIXGE_MDIO_C45_READ
	.comm	_NIXGE_MDIO_CLAUSE22,4,2        ; @NIXGE_MDIO_CLAUSE22
	.comm	_NIXGE_MDIO_C22_READ,4,2        ; @NIXGE_MDIO_C22_READ
l_.str.1:                               ; @.str.1
	.asciz	"timeout setting read command"

	.comm	_NIXGE_REG_MDIO_DATA,4,2        ; @NIXGE_REG_MDIO_DATA
	.no_dead_strip	_nixge_mdio_read
.subsections_via_symbols
