	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rockchip_set_polarity
_rockchip_set_polarity:                 ## @rockchip_set_polarity
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_MII_INTERNAL_CTRL_STATUS@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_phy_read
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	_MII_AUTO_MDIX_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %eax
	xorl	%ecx, %ecx
	cmpl	$128, %ebx
	je	LBB0_5
## %bb.3:
	cmpl	$131, %ebx
	jne	LBB0_9
## %bb.4:
	movq	_MII_MDIX_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	cmpl	%eax, %edx
	jne	LBB0_7
	jmp	LBB0_8
LBB0_1:
	movl	%eax, %ecx
	jmp	LBB0_9
LBB0_5:
	movq	_MII_MDIX_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	%eax, %edx
	cmpl	%eax, %edx
	je	LBB0_8
LBB0_7:
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_phy_write
	movl	%eax, %ecx
	testl	%eax, %eax
	jne	LBB0_9
LBB0_8:
	xorl	%ecx, %ecx
LBB0_9:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_INTERNAL_CTRL_STATUS,4,2   ## @MII_INTERNAL_CTRL_STATUS
	.comm	_MII_AUTO_MDIX_EN,4,2           ## @MII_AUTO_MDIX_EN
	.comm	_MII_MDIX_EN,4,2                ## @MII_MDIX_EN
	.no_dead_strip	_rockchip_set_polarity
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rockchip_set_polarity
_rockchip_set_polarity:                 ; @rockchip_set_polarity
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _MII_INTERNAL_CTRL_STATUS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MII_INTERNAL_CTRL_STATUS@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_phy_read
	tbnz	w0, #31, LBB0_7
; %bb.1:
Lloh2:
	adrp	x8, _MII_AUTO_MDIX_EN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MII_AUTO_MDIX_EN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	bic	w8, w0, w8
	cmp	w20, #128
	b.eq	LBB0_4
; %bb.2:
	cmp	w20, #131
	b.ne	LBB0_6
; %bb.3:
Lloh5:
	adrp	x9, _MII_MDIX_EN@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MII_MDIX_EN@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	bic	w2, w8, w9
	cmp	w2, w8
	b.ne	LBB0_5
	b	LBB0_6
LBB0_4:
Lloh8:
	adrp	x9, _MII_MDIX_EN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MII_MDIX_EN@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w2, w9, w8
	cmp	w2, w8
	b.eq	LBB0_6
LBB0_5:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_phy_write
	cbnz	w0, LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_INTERNAL_CTRL_STATUS,4,2   ; @MII_INTERNAL_CTRL_STATUS
	.comm	_MII_AUTO_MDIX_EN,4,2           ; @MII_AUTO_MDIX_EN
	.comm	_MII_MDIX_EN,4,2                ; @MII_MDIX_EN
	.no_dead_strip	_rockchip_set_polarity
.subsections_via_symbols
