	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8367_read_phy_reg
_rtl8367_read_phy_reg:                  ## @rtl8367_read_phy_reg
	.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	_RTL8367_PHY_ADDR_MAX@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jl	LBB0_1
## %bb.3:
	movq	%rdx, %r14
	movq	_RTL8367_PHY_REG_MAX@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	jge	LBB0_4
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%rcx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	_RTL8367_IA_STATUS_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	callq	_REG_RD
	movq	_RTL8367_IA_STATUS_PHY_BUSY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, -48(%rbp)
	je	LBB0_6
## %bb.5:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_6:
	movq	_RTL8367_IA_ADDRESS_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_RTL8367_INTERNAL_PHY_REG
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_REG_WR
	movq	_RTL8367_IA_CTRL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RTL8367_IA_CTRL_CMD_MASK@GOTPCREL(%rip), %rax
	movq	_RTL8367_IA_CTRL_RW_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r12, %rdi
	callq	_REG_WR
	movq	_RTL8367_IA_STATUS_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	callq	_REG_RD
	movq	_RTL8367_IA_STATUS_PHY_BUSY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, -48(%rbp)
	je	LBB0_8
## %bb.7:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_8:
	movq	_RTL8367_IA_READ_DATA_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_REG_RD
	movl	(%r12), %edi
	movq	(%r15), %r8
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	callq	_dev_dbg
	xorl	%eax, %eax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8367_PHY_ADDR_MAX,8,3       ## @RTL8367_PHY_ADDR_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RTL8367_PHY_REG_MAX,8,3        ## @RTL8367_PHY_REG_MAX
	.comm	_RTL8367_IA_STATUS_REG,4,2      ## @RTL8367_IA_STATUS_REG
	.comm	_RTL8367_IA_STATUS_PHY_BUSY,8,3 ## @RTL8367_IA_STATUS_PHY_BUSY
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_RTL8367_IA_ADDRESS_REG,4,2     ## @RTL8367_IA_ADDRESS_REG
	.comm	_RTL8367_IA_CTRL_REG,4,2        ## @RTL8367_IA_CTRL_REG
	.comm	_RTL8367_IA_CTRL_CMD_MASK,4,2   ## @RTL8367_IA_CTRL_CMD_MASK
	.comm	_RTL8367_IA_CTRL_RW_READ,4,2    ## @RTL8367_IA_CTRL_RW_READ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"phy read timed out\n"

	.comm	_RTL8367_IA_READ_DATA_REG,4,2   ## @RTL8367_IA_READ_DATA_REG
L_.str.1:                               ## @.str.1
	.asciz	"phy_read: addr:%02x, reg:%02x, val:%04x\n"

	.no_dead_strip	_rtl8367_read_phy_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8367_read_phy_reg
_rtl8367_read_phy_reg:                  ; @rtl8367_read_phy_reg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
Lloh0:
	adrp	x8, _RTL8367_PHY_ADDR_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RTL8367_PHY_ADDR_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x1
	b.lt	LBB0_2
; %bb.1:
	mov	x19, x2
Lloh3:
	adrp	x8, _RTL8367_PHY_REG_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RTL8367_PHY_REG_MAX@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x2
	b.ge	LBB0_3
LBB0_2:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_3:
	mov	x21, x3
	mov	x20, x1
	mov	x22, x0
Lloh8:
	adrp	x24, _RTL8367_IA_STATUS_REG@GOTPAGE
Lloh9:
	ldr	x24, [x24, _RTL8367_IA_STATUS_REG@GOTPAGEOFF]
	ldr	w1, [x24]
	add	x2, sp, #8
	bl	_REG_RD
	ldr	x8, [sp, #8]
Lloh10:
	adrp	x25, _RTL8367_IA_STATUS_PHY_BUSY@GOTPAGE
Lloh11:
	ldr	x25, [x25, _RTL8367_IA_STATUS_PHY_BUSY@GOTPAGEOFF]
	ldr	x9, [x25]
	tst	x9, x8
	b.ne	LBB0_6
; %bb.4:
Lloh12:
	adrp	x8, _RTL8367_IA_ADDRESS_REG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RTL8367_IA_ADDRESS_REG@GOTPAGEOFF]
Lloh14:
	ldr	w23, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_RTL8367_INTERNAL_PHY_REG
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_REG_WR
Lloh15:
	adrp	x8, _RTL8367_IA_CTRL_REG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RTL8367_IA_CTRL_REG@GOTPAGEOFF]
Lloh17:
	adrp	x9, _RTL8367_IA_CTRL_CMD_MASK@GOTPAGE
Lloh18:
	ldr	x9, [x9, _RTL8367_IA_CTRL_CMD_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	ldr	w8, [x9]
Lloh21:
	adrp	x9, _RTL8367_IA_CTRL_RW_READ@GOTPAGE
Lloh22:
	ldr	x9, [x9, _RTL8367_IA_CTRL_RW_READ@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x22
	bl	_REG_WR
	ldr	w1, [x24]
	add	x2, sp, #8
	mov	x0, x22
	bl	_REG_RD
	ldr	x8, [sp, #8]
	ldr	x9, [x25]
	tst	x9, x8
	b.eq	LBB0_9
; %bb.5:
	ldr	w0, [x22]
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_6:
Lloh26:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	add	sp, sp, #96
	ret
LBB0_9:
Lloh28:
	adrp	x8, _RTL8367_IA_READ_DATA_REG@GOTPAGE
Lloh29:
	ldr	x8, [x8, _RTL8367_IA_READ_DATA_REG@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x22
	mov	x2, x21
	bl	_REG_RD
	ldr	w0, [x22]
	ldr	x4, [x21]
Lloh31:
	adrp	x1, l_.str.1@PAGE
Lloh32:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	mov	x3, x19
	bl	_dev_dbg
	mov	w0, #0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8367_PHY_ADDR_MAX,8,3       ; @RTL8367_PHY_ADDR_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RTL8367_PHY_REG_MAX,8,3        ; @RTL8367_PHY_REG_MAX
	.comm	_RTL8367_IA_STATUS_REG,4,2      ; @RTL8367_IA_STATUS_REG
	.comm	_RTL8367_IA_STATUS_PHY_BUSY,8,3 ; @RTL8367_IA_STATUS_PHY_BUSY
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_RTL8367_IA_ADDRESS_REG,4,2     ; @RTL8367_IA_ADDRESS_REG
	.comm	_RTL8367_IA_CTRL_REG,4,2        ; @RTL8367_IA_CTRL_REG
	.comm	_RTL8367_IA_CTRL_CMD_MASK,4,2   ; @RTL8367_IA_CTRL_CMD_MASK
	.comm	_RTL8367_IA_CTRL_RW_READ,4,2    ; @RTL8367_IA_CTRL_RW_READ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"phy read timed out\n"

	.comm	_RTL8367_IA_READ_DATA_REG,4,2   ; @RTL8367_IA_READ_DATA_REG
l_.str.1:                               ; @.str.1
	.asciz	"phy_read: addr:%02x, reg:%02x, val:%04x\n"

	.no_dead_strip	_rtl8367_read_phy_reg
.subsections_via_symbols
