	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt753x_mii_rw
_mt753x_mii_rw:                         ## @mt753x_mii_rw
	.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	%r9d, -60(%rbp)                 ## 4-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, %edi
	movl	$100000, %esi                   ## imm = 0x186A0
	callq	_ktime_add_us
	movl	%eax, %r14d
	movq	_PHY_IAC@GOTPCREL(%rip), %r12
	movq	_PHY_ACS_ST@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_mt753x_reg_read
	movl	(%r15), %ebx
	testl	%eax, %ebx
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, %edi
	movl	%r14d, %esi
	callq	_ktime_compare
	testq	%rax, %rax
	jle	LBB0_1
	jmp	LBB0_3
LBB0_4:
	movq	_MDIO_ST_S@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	movl	-60(%rbp), %r9d                 ## 4-byte Reload
	shll	%cl, %r9d
	movq	_MDIO_CMD_S@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	%r8d, %r10d
	shll	%cl, %r10d
	movq	_MDIO_CMD_M@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r10d
	movq	_MDIO_PHY_ADDR_S@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	shll	%cl, %eax
	movq	_MDIO_PHY_ADDR_M@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_MDIO_REG_ADDR_S@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	movq	_MDIO_REG_ADDR_M@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edx
	movq	_MDIO_CMD_WRITE@GOTPCREL(%rip), %r11
	movq	_MDIO_RW_DATA_M@GOTPCREL(%rip), %r14
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	andl	(%r14), %ecx
	movq	_MDIO_CMD_ADDR@GOTPCREL(%rip), %rsi
	cmpl	%r8d, (%rsi)
	movl	$0, %edi
	cmovel	%ecx, %edi
	cmpl	%r8d, (%r11)
	cmovel	%ecx, %edi
	movl	(%r12), %esi
	orl	%ebx, %r9d
	orl	%r10d, %r9d
	orl	%eax, %edx
	orl	%r9d, %edx
	orl	%edi, %edx
	movq	%r13, %rdi
	callq	_mt753x_reg_write
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, %edi
	movl	$100000, %esi                   ## imm = 0x186A0
	callq	_ktime_add_us
	movl	%eax, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_mt753x_reg_read
	testl	%eax, (%r15)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_ktime_compare
	testq	%rax, %rax
	jle	LBB0_5
LBB0_3:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_MDIO_CMD_READ@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	cmpl	%edx, (%rax)
	je	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	movq	_MDIO_CMD_READ_C45@GOTPCREL(%rip), %rcx
	cmpl	%edx, (%rcx)
	jne	LBB0_10
LBB0_9:
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_mt753x_reg_read
	andl	(%r14), %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_PHY_IAC,4,2                    ## @PHY_IAC
	.comm	_PHY_ACS_ST,4,2                 ## @PHY_ACS_ST
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_MDIO_ST_S,4,2                  ## @MDIO_ST_S
	.comm	_MDIO_CMD_S,4,2                 ## @MDIO_CMD_S
	.comm	_MDIO_CMD_M,4,2                 ## @MDIO_CMD_M
	.comm	_MDIO_PHY_ADDR_S,4,2            ## @MDIO_PHY_ADDR_S
	.comm	_MDIO_PHY_ADDR_M,4,2            ## @MDIO_PHY_ADDR_M
	.comm	_MDIO_REG_ADDR_S,4,2            ## @MDIO_REG_ADDR_S
	.comm	_MDIO_REG_ADDR_M,4,2            ## @MDIO_REG_ADDR_M
	.comm	_MDIO_CMD_WRITE,4,2             ## @MDIO_CMD_WRITE
	.comm	_MDIO_CMD_ADDR,4,2              ## @MDIO_CMD_ADDR
	.comm	_MDIO_RW_DATA_M,4,2             ## @MDIO_RW_DATA_M
	.comm	_MDIO_CMD_READ,4,2              ## @MDIO_CMD_READ
	.comm	_MDIO_CMD_READ_C45,4,2          ## @MDIO_CMD_READ_C45
	.no_dead_strip	_mt753x_mii_rw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt753x_mii_rw
_mt753x_mii_rw:                         ; @mt753x_mii_rw
	.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	x24, x5
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	bl	_ktime_get
	mov	w1, #34464
	movk	w1, #1, lsl #16
	bl	_ktime_add_us
	mov	x25, x0
Lloh0:
	adrp	x26, _PHY_IAC@GOTPAGE
Lloh1:
	ldr	x26, [x26, _PHY_IAC@GOTPAGEOFF]
Lloh2:
	adrp	x27, _PHY_ACS_ST@GOTPAGE
Lloh3:
	ldr	x27, [x27, _PHY_ACS_ST@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	x0, x19
	bl	_mt753x_reg_read
	ldr	w8, [x27]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_ktime_get
	mov	x1, x25
	bl	_ktime_compare
	cmp	x0, #1
	b.lt	LBB0_1
	b	LBB0_6
LBB0_3:
Lloh4:
	adrp	x9, _MDIO_ST_S@GOTPAGE
Lloh5:
	ldr	x9, [x9, _MDIO_ST_S@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
Lloh7:
	adrp	x10, _MDIO_CMD_S@GOTPAGE
Lloh8:
	ldr	x10, [x10, _MDIO_CMD_S@GOTPAGEOFF]
	lsl	w9, w24, w9
Lloh9:
	ldr	w10, [x10]
	lsl	w10, w20, w10
Lloh10:
	adrp	x11, _MDIO_CMD_M@GOTPAGE
Lloh11:
	ldr	x11, [x11, _MDIO_CMD_M@GOTPAGEOFF]
Lloh12:
	ldr	w11, [x11]
	and	w10, w10, w11
Lloh13:
	adrp	x11, _MDIO_PHY_ADDR_S@GOTPAGE
Lloh14:
	ldr	x11, [x11, _MDIO_PHY_ADDR_S@GOTPAGEOFF]
Lloh15:
	ldr	w11, [x11]
Lloh16:
	adrp	x12, _MDIO_PHY_ADDR_M@GOTPAGE
Lloh17:
	ldr	x12, [x12, _MDIO_PHY_ADDR_M@GOTPAGEOFF]
	lsl	w11, w23, w11
Lloh18:
	ldr	w12, [x12]
	and	w11, w11, w12
Lloh19:
	adrp	x12, _MDIO_REG_ADDR_S@GOTPAGE
Lloh20:
	ldr	x12, [x12, _MDIO_REG_ADDR_S@GOTPAGEOFF]
Lloh21:
	ldr	w12, [x12]
	lsl	w12, w22, w12
Lloh22:
	adrp	x13, _MDIO_REG_ADDR_M@GOTPAGE
Lloh23:
	ldr	x13, [x13, _MDIO_REG_ADDR_M@GOTPAGEOFF]
Lloh24:
	ldr	w13, [x13]
Lloh25:
	adrp	x14, _MDIO_CMD_WRITE@GOTPAGE
Lloh26:
	ldr	x14, [x14, _MDIO_CMD_WRITE@GOTPAGEOFF]
	and	w12, w12, w13
Lloh27:
	ldr	w13, [x14]
Lloh28:
	adrp	x14, _MDIO_CMD_ADDR@GOTPAGE
Lloh29:
	ldr	x14, [x14, _MDIO_CMD_ADDR@GOTPAGEOFF]
Lloh30:
	ldr	w14, [x14]
	cmp	w14, w20
	ccmp	w13, w20, #4, ne
Lloh31:
	adrp	x22, _MDIO_RW_DATA_M@GOTPAGE
Lloh32:
	ldr	x22, [x22, _MDIO_RW_DATA_M@GOTPAGEOFF]
	ldr	w13, [x22]
	and	w13, w13, w21
	csel	w13, w13, wzr, eq
	ldr	w1, [x26]
	orr	w8, w9, w8
	orr	w8, w8, w10
	orr	w8, w8, w11
	orr	w8, w8, w12
	orr	w2, w8, w13
	mov	x0, x19
	bl	_mt753x_reg_write
	bl	_ktime_get
	mov	w1, #34464
	movk	w1, #1, lsl #16
	bl	_ktime_add_us
	mov	x21, x0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	x0, x19
	bl	_mt753x_reg_read
	ldr	w8, [x27]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_ktime_get
	mov	x1, x21
	bl	_ktime_compare
	cmp	x0, #1
	b.lt	LBB0_4
LBB0_6:
Lloh33:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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_8:
Lloh36:
	adrp	x8, _MDIO_CMD_READ@GOTPAGE
Lloh37:
	ldr	x8, [x8, _MDIO_CMD_READ@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
Lloh39:
	adrp	x9, _MDIO_CMD_READ_C45@GOTPAGE
Lloh40:
	ldr	x9, [x9, _MDIO_CMD_READ_C45@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	cmp	w8, w20
	ccmp	w9, w20, #4, ne
	b.ne	LBB0_10
; %bb.9:
	ldr	w1, [x26]
	mov	x0, x19
	bl	_mt753x_reg_read
	ldr	w8, [x22]
	and	w0, w8, w0
	b	LBB0_7
LBB0_10:
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_PHY_IAC,4,2                    ; @PHY_IAC
	.comm	_PHY_ACS_ST,4,2                 ; @PHY_ACS_ST
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_MDIO_ST_S,4,2                  ; @MDIO_ST_S
	.comm	_MDIO_CMD_S,4,2                 ; @MDIO_CMD_S
	.comm	_MDIO_CMD_M,4,2                 ; @MDIO_CMD_M
	.comm	_MDIO_PHY_ADDR_S,4,2            ; @MDIO_PHY_ADDR_S
	.comm	_MDIO_PHY_ADDR_M,4,2            ; @MDIO_PHY_ADDR_M
	.comm	_MDIO_REG_ADDR_S,4,2            ; @MDIO_REG_ADDR_S
	.comm	_MDIO_REG_ADDR_M,4,2            ; @MDIO_REG_ADDR_M
	.comm	_MDIO_CMD_WRITE,4,2             ; @MDIO_CMD_WRITE
	.comm	_MDIO_CMD_ADDR,4,2              ; @MDIO_CMD_ADDR
	.comm	_MDIO_RW_DATA_M,4,2             ; @MDIO_RW_DATA_M
	.comm	_MDIO_CMD_READ,4,2              ; @MDIO_CMD_READ
	.comm	_MDIO_CMD_READ_C45,4,2          ; @MDIO_CMD_READ_C45
	.no_dead_strip	_mt753x_mii_rw
.subsections_via_symbols
