	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ksz9477_reset_switch
_ksz9477_reset_switch:                  ## @ksz9477_reset_switch
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_REG_SW_OPERATION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SW_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %ecx
	callq	_ksz_cfg
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	movq	_REG_SW_GLOBAL_SERIAL_CTRL_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SPI_AUTO_EDGE_DETECTION@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	_regmap_update_bits
	movq	_REG_SW_LUE_CTRL_1@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	-20(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_ksz_read8
	movq	_SW_AGING_ENABLE@GOTPCREL(%rip), %rax
	movq	_SW_LINK_AUTO_AGING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_SW_SRC_ADDR_FILTER@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_SW_FLUSH_STP_TABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_SW_FLUSH_MSTP_TABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	%edx, -20(%rbp)
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_ksz_write8
	movq	_REG_SW_INT_MASK__4@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SWITCH_INT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_ksz_write32
	movq	_REG_SW_PORT_INT_MASK__4@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$127, %edx
	callq	_ksz_write32
	movq	_REG_SW_PORT_INT_STATUS__4@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-24(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_ksz_read32
	movq	8(%rbx), %rax
	movl	4(%rax), %edi
	movq	_REG_SW_MAC_CTRL_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BROADCAST_STORM_RATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BROADCAST_STORM_VALUE@GOTPCREL(%rip), %rax
	movq	_BROADCAST_STORM_PROT_RATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	imull	(%rax), %ecx
	movslq	%ecx, %rax
	imulq	$1374389535, %rax, %rcx         ## imm = 0x51EB851F
	movq	%rcx, %rax
	shrq	$63, %rax
	sarq	$37, %rcx
	addl	%eax, %ecx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_regmap_update_bits
	cmpq	$0, (%rbx)
	je	LBB0_2
## %bb.1:
	movq	_REG_SW_GLOBAL_OUTPUT_CTRL__1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SW_ENABLE_REFCLKO@GOTPCREL(%rip), %rax
	movq	_SW_REFCLKO_IS_125MHZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_ksz_write8
LBB0_2:
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_SW_OPERATION,4,2           ## @REG_SW_OPERATION
	.comm	_SW_RESET,4,2                   ## @SW_RESET
	.comm	_REG_SW_GLOBAL_SERIAL_CTRL_0,4,2 ## @REG_SW_GLOBAL_SERIAL_CTRL_0
	.comm	_SPI_AUTO_EDGE_DETECTION,4,2    ## @SPI_AUTO_EDGE_DETECTION
	.comm	_REG_SW_LUE_CTRL_1,4,2          ## @REG_SW_LUE_CTRL_1
	.comm	_SW_AGING_ENABLE,4,2            ## @SW_AGING_ENABLE
	.comm	_SW_LINK_AUTO_AGING,4,2         ## @SW_LINK_AUTO_AGING
	.comm	_SW_SRC_ADDR_FILTER,4,2         ## @SW_SRC_ADDR_FILTER
	.comm	_SW_FLUSH_STP_TABLE,4,2         ## @SW_FLUSH_STP_TABLE
	.comm	_SW_FLUSH_MSTP_TABLE,4,2        ## @SW_FLUSH_MSTP_TABLE
	.comm	_REG_SW_INT_MASK__4,4,2         ## @REG_SW_INT_MASK__4
	.comm	_SWITCH_INT_MASK,4,2            ## @SWITCH_INT_MASK
	.comm	_REG_SW_PORT_INT_MASK__4,4,2    ## @REG_SW_PORT_INT_MASK__4
	.comm	_REG_SW_PORT_INT_STATUS__4,4,2  ## @REG_SW_PORT_INT_STATUS__4
	.comm	_REG_SW_MAC_CTRL_2,4,2          ## @REG_SW_MAC_CTRL_2
	.comm	_BROADCAST_STORM_RATE,4,2       ## @BROADCAST_STORM_RATE
	.comm	_BROADCAST_STORM_VALUE,4,2      ## @BROADCAST_STORM_VALUE
	.comm	_BROADCAST_STORM_PROT_RATE,4,2  ## @BROADCAST_STORM_PROT_RATE
	.comm	_REG_SW_GLOBAL_OUTPUT_CTRL__1,4,2 ## @REG_SW_GLOBAL_OUTPUT_CTRL__1
	.comm	_SW_ENABLE_REFCLKO,4,2          ## @SW_ENABLE_REFCLKO
	.comm	_SW_REFCLKO_IS_125MHZ,4,2       ## @SW_REFCLKO_IS_125MHZ
	.no_dead_strip	_ksz9477_reset_switch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ksz9477_reset_switch
_ksz9477_reset_switch:                  ; @ksz9477_reset_switch
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _REG_SW_OPERATION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_SW_OPERATION@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _SW_RESET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SW_RESET@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	w3, #1
	bl	_ksz_cfg
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _REG_SW_GLOBAL_SERIAL_CTRL_0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_SW_GLOBAL_SERIAL_CTRL_0@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _SPI_AUTO_EDGE_DETECTION@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SPI_AUTO_EDGE_DETECTION@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	w3, #0
	bl	_regmap_update_bits
Lloh12:
	adrp	x20, _REG_SW_LUE_CTRL_1@GOTPAGE
Lloh13:
	ldr	x20, [x20, _REG_SW_LUE_CTRL_1@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #12
	mov	x0, x19
	bl	_ksz_read8
Lloh14:
	adrp	x8, _SW_AGING_ENABLE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SW_AGING_ENABLE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _SW_LINK_AUTO_AGING@GOTPAGE
Lloh18:
	ldr	x9, [x9, _SW_LINK_AUTO_AGING@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh20:
	adrp	x9, _SW_SRC_ADDR_FILTER@GOTPAGE
Lloh21:
	ldr	x9, [x9, _SW_SRC_ADDR_FILTER@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh23:
	adrp	x9, _SW_FLUSH_STP_TABLE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _SW_FLUSH_STP_TABLE@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh26:
	adrp	x9, _SW_FLUSH_MSTP_TABLE@GOTPAGE
Lloh27:
	ldr	x9, [x9, _SW_FLUSH_MSTP_TABLE@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w2, w8, w9
	str	w2, [sp, #12]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ksz_write8
Lloh29:
	adrp	x8, _REG_SW_INT_MASK__4@GOTPAGE
Lloh30:
	ldr	x8, [x8, _REG_SW_INT_MASK__4@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x8, _SWITCH_INT_MASK@GOTPAGE
Lloh33:
	ldr	x8, [x8, _SWITCH_INT_MASK@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_ksz_write32
Lloh35:
	adrp	x8, _REG_SW_PORT_INT_MASK__4@GOTPAGE
Lloh36:
	ldr	x8, [x8, _REG_SW_PORT_INT_MASK__4@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #127
	bl	_ksz_write32
Lloh38:
	adrp	x8, _REG_SW_PORT_INT_STATUS__4@GOTPAGE
Lloh39:
	ldr	x8, [x8, _REG_SW_PORT_INT_STATUS__4@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_ksz_read32
	ldr	x8, [x19, #8]
	ldr	w0, [x8, #4]
Lloh41:
	adrp	x8, _REG_SW_MAC_CTRL_2@GOTPAGE
Lloh42:
	ldr	x8, [x8, _REG_SW_MAC_CTRL_2@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
Lloh44:
	adrp	x8, _BROADCAST_STORM_RATE@GOTPAGE
Lloh45:
	ldr	x8, [x8, _BROADCAST_STORM_RATE@GOTPAGEOFF]
Lloh46:
	ldr	w2, [x8]
Lloh47:
	adrp	x8, _BROADCAST_STORM_VALUE@GOTPAGE
Lloh48:
	ldr	x8, [x8, _BROADCAST_STORM_VALUE@GOTPAGEOFF]
Lloh49:
	ldr	w8, [x8]
Lloh50:
	adrp	x9, _BROADCAST_STORM_PROT_RATE@GOTPAGE
Lloh51:
	ldr	x9, [x9, _BROADCAST_STORM_PROT_RATE@GOTPAGEOFF]
Lloh52:
	ldr	w9, [x9]
	mul	w8, w9, w8
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w3, w8, w9
	bl	_regmap_update_bits
	ldr	x8, [x19]
	cbz	x8, LBB0_2
; %bb.1:
Lloh53:
	adrp	x8, _REG_SW_GLOBAL_OUTPUT_CTRL__1@GOTPAGE
Lloh54:
	ldr	x8, [x8, _REG_SW_GLOBAL_OUTPUT_CTRL__1@GOTPAGEOFF]
Lloh55:
	adrp	x9, _SW_ENABLE_REFCLKO@GOTPAGE
Lloh56:
	ldr	x9, [x9, _SW_ENABLE_REFCLKO@GOTPAGEOFF]
Lloh57:
	ldr	w1, [x8]
Lloh58:
	ldr	w8, [x9]
Lloh59:
	adrp	x9, _SW_REFCLKO_IS_125MHZ@GOTPAGE
Lloh60:
	ldr	x9, [x9, _SW_REFCLKO_IS_125MHZ@GOTPAGEOFF]
Lloh61:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_ksz_write8
LBB0_2:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh58
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh57
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_SW_OPERATION,4,2           ; @REG_SW_OPERATION
	.comm	_SW_RESET,4,2                   ; @SW_RESET
	.comm	_REG_SW_GLOBAL_SERIAL_CTRL_0,4,2 ; @REG_SW_GLOBAL_SERIAL_CTRL_0
	.comm	_SPI_AUTO_EDGE_DETECTION,4,2    ; @SPI_AUTO_EDGE_DETECTION
	.comm	_REG_SW_LUE_CTRL_1,4,2          ; @REG_SW_LUE_CTRL_1
	.comm	_SW_AGING_ENABLE,4,2            ; @SW_AGING_ENABLE
	.comm	_SW_LINK_AUTO_AGING,4,2         ; @SW_LINK_AUTO_AGING
	.comm	_SW_SRC_ADDR_FILTER,4,2         ; @SW_SRC_ADDR_FILTER
	.comm	_SW_FLUSH_STP_TABLE,4,2         ; @SW_FLUSH_STP_TABLE
	.comm	_SW_FLUSH_MSTP_TABLE,4,2        ; @SW_FLUSH_MSTP_TABLE
	.comm	_REG_SW_INT_MASK__4,4,2         ; @REG_SW_INT_MASK__4
	.comm	_SWITCH_INT_MASK,4,2            ; @SWITCH_INT_MASK
	.comm	_REG_SW_PORT_INT_MASK__4,4,2    ; @REG_SW_PORT_INT_MASK__4
	.comm	_REG_SW_PORT_INT_STATUS__4,4,2  ; @REG_SW_PORT_INT_STATUS__4
	.comm	_REG_SW_MAC_CTRL_2,4,2          ; @REG_SW_MAC_CTRL_2
	.comm	_BROADCAST_STORM_RATE,4,2       ; @BROADCAST_STORM_RATE
	.comm	_BROADCAST_STORM_VALUE,4,2      ; @BROADCAST_STORM_VALUE
	.comm	_BROADCAST_STORM_PROT_RATE,4,2  ; @BROADCAST_STORM_PROT_RATE
	.comm	_REG_SW_GLOBAL_OUTPUT_CTRL__1,4,2 ; @REG_SW_GLOBAL_OUTPUT_CTRL__1
	.comm	_SW_ENABLE_REFCLKO,4,2          ; @SW_ENABLE_REFCLKO
	.comm	_SW_REFCLKO_IS_125MHZ,4,2       ; @SW_REFCLKO_IS_125MHZ
	.no_dead_strip	_ksz9477_reset_switch
.subsections_via_symbols
