	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8366_getPhyReg
_rtl8366_getPhyReg:                     ## @rtl8366_getPhyReg
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_RTL8366S_PHY_NO_MAX@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jge	LBB0_3
## %bb.1:
	leaq	L_str.2(%rip), %rdi
	jmp	LBB0_2
LBB0_3:
	movl	%edi, %ebx
	movq	_RTL8366S_PHY_ADDR_MAX@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jge	LBB0_5
## %bb.4:
	leaq	L_str(%rip), %rdi
LBB0_2:
	callq	_puts
	movl	$-1, %r15d
LBB0_10:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rdx, %r14
	movl	%esi, %r12d
	movq	_RTL8366S_PHY_ACCESS_CTRL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_RTL8366S_PHY_CTRL_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_rtl8366_writeRegister
	movl	$-1, %r15d
	testq	%rax, %rax
	jne	LBB0_10
## %bb.6:
	movq	_RTL8366S_PHY_NO_OFFSET@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	movq	_RTL8366S_PHY_REG_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r12d
	btsl	%ebx, %r12d
	orl	$32768, %r12d                   ## imm = 0x8000
	movl	%r12d, %edi
	xorl	%esi, %esi
	callq	_rtl8366_writeRegister
	testq	%rax, %rax
	jne	LBB0_10
## %bb.7:
	movq	_RTL8366S_PHY_ACCESS_DATA_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-36(%rbp), %rsi
	callq	_rtl8366_readRegister
	testq	%rax, %rax
	jne	LBB0_10
## %bb.8:
	xorl	%r15d, %r15d
	testq	%r14, %r14
	je	LBB0_10
## %bb.9:
	movl	-36(%rbp), %eax
	movl	%eax, (%r14)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8366S_PHY_NO_MAX,4,2        ## @RTL8366S_PHY_NO_MAX
	.comm	_RTL8366S_PHY_ADDR_MAX,4,2      ## @RTL8366S_PHY_ADDR_MAX
	.comm	_RTL8366S_PHY_ACCESS_CTRL_REG,4,2 ## @RTL8366S_PHY_ACCESS_CTRL_REG
	.comm	_RTL8366S_PHY_CTRL_READ,4,2     ## @RTL8366S_PHY_CTRL_READ
	.comm	_RTL8366S_PHY_NO_OFFSET,4,2     ## @RTL8366S_PHY_NO_OFFSET
	.comm	_RTL8366S_PHY_REG_MASK,4,2      ## @RTL8366S_PHY_REG_MASK
	.comm	_RTL8366S_PHY_ACCESS_DATA_REG,4,2 ## @RTL8366S_PHY_ACCESS_DATA_REG
	.section	__TEXT,__cstring,cstring_literals
L_str:                                  ## @str
	.asciz	"rtl8366s: invalid phy register number!"

L_str.2:                                ## @str.2
	.asciz	"rtl8366s: invalid phy number!"

	.no_dead_strip	_rtl8366_getPhyReg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8366_getPhyReg
_rtl8366_getPhyReg:                     ; @rtl8366_getPhyReg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x8, _RTL8366S_PHY_NO_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RTL8366S_PHY_NO_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.ge	LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_str.2@PAGE
Lloh4:
	add	x0, x0, l_str.2@PAGEOFF
	b	LBB0_4
LBB0_2:
	mov	x21, x0
Lloh5:
	adrp	x8, _RTL8366S_PHY_ADDR_MAX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RTL8366S_PHY_ADDR_MAX@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w0
	b.ge	LBB0_7
; %bb.3:
Lloh8:
	adrp	x0, l_str@PAGE
Lloh9:
	add	x0, x0, l_str@PAGEOFF
LBB0_4:
	bl	_puts
LBB0_5:
	mov	w0, #-1
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_7:
	mov	x19, x2
	mov	x20, x1
Lloh10:
	adrp	x8, _RTL8366S_PHY_ACCESS_CTRL_REG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RTL8366S_PHY_ACCESS_CTRL_REG@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x8, _RTL8366S_PHY_CTRL_READ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _RTL8366S_PHY_CTRL_READ@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	bl	_rtl8366_writeRegister
	cbnz	x0, LBB0_5
; %bb.8:
Lloh16:
	adrp	x8, _RTL8366S_PHY_NO_OFFSET@GOTPAGE
Lloh17:
	ldr	x8, [x8, _RTL8366S_PHY_NO_OFFSET@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	add	w8, w8, w21
	mov	w9, #1
	lsl	w8, w9, w8
Lloh19:
	adrp	x9, _RTL8366S_PHY_REG_MASK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _RTL8366S_PHY_REG_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	and	w9, w9, w20
	orr	w8, w9, w8
	orr	w0, w8, #0x8000
	mov	w1, #0
	bl	_rtl8366_writeRegister
	cbnz	x0, LBB0_5
; %bb.9:
Lloh22:
	adrp	x8, _RTL8366S_PHY_ACCESS_DATA_REG@GOTPAGE
Lloh23:
	ldr	x8, [x8, _RTL8366S_PHY_ACCESS_DATA_REG@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	add	x1, sp, #12
	bl	_rtl8366_readRegister
	cbnz	x0, LBB0_5
; %bb.10:
	mov	w0, #0
	cbz	x19, LBB0_6
; %bb.11:
	ldr	w8, [sp, #12]
	str	w8, [x19]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8366S_PHY_NO_MAX,4,2        ; @RTL8366S_PHY_NO_MAX
	.comm	_RTL8366S_PHY_ADDR_MAX,4,2      ; @RTL8366S_PHY_ADDR_MAX
	.comm	_RTL8366S_PHY_ACCESS_CTRL_REG,4,2 ; @RTL8366S_PHY_ACCESS_CTRL_REG
	.comm	_RTL8366S_PHY_CTRL_READ,4,2     ; @RTL8366S_PHY_CTRL_READ
	.comm	_RTL8366S_PHY_NO_OFFSET,4,2     ; @RTL8366S_PHY_NO_OFFSET
	.comm	_RTL8366S_PHY_REG_MASK,4,2      ; @RTL8366S_PHY_REG_MASK
	.comm	_RTL8366S_PHY_ACCESS_DATA_REG,4,2 ; @RTL8366S_PHY_ACCESS_DATA_REG
	.section	__TEXT,__cstring,cstring_literals
l_str:                                  ; @str
	.asciz	"rtl8366s: invalid phy register number!"

l_str.2:                                ; @str.2
	.asciz	"rtl8366s: invalid phy number!"

	.no_dead_strip	_rtl8366_getPhyReg
.subsections_via_symbols
