	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpmac_mdio_reset
_cpmac_mdio_reset:                      ## @cpmac_mdio_reset
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	addq	$4, %rdi
	leaq	L_.str(%rip), %rsi
	callq	_clk_get
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
	movl	$-1, %eax
	jmp	LBB0_3
LBB0_2:
	movq	_AR7_RESET_BIT_MDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ar7_device_reset
	movl	(%r14), %r14d
	movq	_CPMAC_MDIO_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_MDIOC_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%rbx, %rdi
	callq	_clk_get_rate
	cltq
	imulq	$511772685, %rax, %rax          ## imm = 0x1E81080D
	movq	%rax, %rcx
	sarq	$50, %rcx
	shrq	$63, %rax
	leal	(%rcx,%rax), %edi
	decl	%edi
	callq	_MDIOC_CLKDIV
	orl	%eax, %r12d
	movl	%r14d, %edi
	movl	%r15d, %esi
	movl	%r12d, %edx
	callq	_cpmac_write
	xorl	%eax, %eax
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cpmac"

L_.str.1:                               ## @.str.1
	.asciz	"unable to get cpmac clock\n"

	.comm	_AR7_RESET_BIT_MDIO,4,2         ## @AR7_RESET_BIT_MDIO
	.comm	_CPMAC_MDIO_CONTROL,4,2         ## @CPMAC_MDIO_CONTROL
	.comm	_MDIOC_ENABLE,4,2               ## @MDIOC_ENABLE
	.no_dead_strip	_cpmac_mdio_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpmac_mdio_reset
_cpmac_mdio_reset:                      ; @cpmac_mdio_reset
	.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	x19, x0
	add	x0, x0, #4
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_clk_get
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	mov	w0, #-1
	b	LBB0_3
LBB0_2:
Lloh4:
	adrp	x8, _AR7_RESET_BIT_MDIO@GOTPAGE
Lloh5:
	ldr	x8, [x8, _AR7_RESET_BIT_MDIO@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	bl	_ar7_device_reset
	ldr	w19, [x19]
Lloh7:
	adrp	x8, _CPMAC_MDIO_CONTROL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CPMAC_MDIO_CONTROL@GOTPAGEOFF]
Lloh9:
	ldr	w21, [x8]
Lloh10:
	adrp	x8, _MDIOC_ENABLE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MDIOC_ENABLE@GOTPAGEOFF]
Lloh12:
	ldr	w22, [x8]
	mov	x0, x20
	bl	_clk_get_rate
	mov	w8, #2061
	movk	w8, #7809, lsl #16
	smull	x8, w0, w8
	lsr	x9, x8, #63
	asr	x8, x8, #50
	add	w8, w8, w9
	sub	w0, w8, #1
	bl	_MDIOC_CLKDIV
	orr	w2, w0, w22
	mov	x0, x19
	mov	x1, x21
	bl	_cpmac_write
	mov	w0, #0
LBB0_3:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cpmac"

l_.str.1:                               ; @.str.1
	.asciz	"unable to get cpmac clock\n"

	.comm	_AR7_RESET_BIT_MDIO,4,2         ; @AR7_RESET_BIT_MDIO
	.comm	_CPMAC_MDIO_CONTROL,4,2         ; @CPMAC_MDIO_CONTROL
	.comm	_MDIOC_ENABLE,4,2               ; @MDIOC_ENABLE
	.no_dead_strip	_cpmac_mdio_reset
.subsections_via_symbols
