	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mv88e6060_switch_reset
_mv88e6060_switch_reset:                ## @mv88e6060_switch_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	%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	%rdi, %r15
	movq	_MV88E6060_PORTS@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_6
## %bb.1:
	xorl	%r14d, %r14d
	movq	_PORT_CONTROL@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %edi
	callq	_REG_PORT
	movl	(%r13), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_reg_read
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_15
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r14d, %edi
	callq	_REG_PORT
	movl	(%r13), %edx
	movq	_PORT_CONTROL_STATE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %ebx
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	%ebx, %ecx
	callq	_reg_write
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	incl	%r14d
	cmpl	(%r12), %r14d
	jl	LBB0_3
LBB0_6:
	movl	$2000, %edi                     ## imm = 0x7D0
	movl	$4000, %esi                     ## imm = 0xFA0
	callq	_usleep_range
	movq	_REG_GLOBAL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_GLOBAL_ATU_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_GLOBAL_ATU_CONTROL_SWRESET@GOTPCREL(%rip), %rax
	movq	_GLOBAL_ATU_CONTROL_LEARNDIS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_reg_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.7:
	movq	_jiffies@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdi
	movq	_HZ@GOTPCREL(%rip), %rax
	movslq	(%rax), %r14
	addq	%rdi, %r14
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r14, %rsi
	callq	_time_before
	testq	%rax, %rax
	je	LBB0_12
## %bb.8:
	movq	_GLOBAL_STATUS@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movl	(%r13), %edx
	movq	%r15, %rdi
	callq	_reg_read
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_15
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_GLOBAL_STATUS_INIT_READY@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_time_before
	testq	%rax, %rax
	jne	LBB0_9
LBB0_12:
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_time_after
	testq	%rax, %rax
	je	LBB0_13
## %bb.14:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_5:
	movl	%eax, %ebx
	jmp	LBB0_15
LBB0_13:
	xorl	%ebx, %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MV88E6060_PORTS,4,2            ## @MV88E6060_PORTS
	.comm	_PORT_CONTROL,4,2               ## @PORT_CONTROL
	.comm	_PORT_CONTROL_STATE_MASK,4,2    ## @PORT_CONTROL_STATE_MASK
	.comm	_REG_GLOBAL,4,2                 ## @REG_GLOBAL
	.comm	_GLOBAL_ATU_CONTROL,4,2         ## @GLOBAL_ATU_CONTROL
	.comm	_GLOBAL_ATU_CONTROL_SWRESET,4,2 ## @GLOBAL_ATU_CONTROL_SWRESET
	.comm	_GLOBAL_ATU_CONTROL_LEARNDIS,4,2 ## @GLOBAL_ATU_CONTROL_LEARNDIS
	.comm	_jiffies,4,2                    ## @jiffies
	.comm	_HZ,4,2                         ## @HZ
	.comm	_GLOBAL_STATUS,4,2              ## @GLOBAL_STATUS
	.comm	_GLOBAL_STATUS_INIT_READY,4,2   ## @GLOBAL_STATUS_INIT_READY
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_mv88e6060_switch_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mv88e6060_switch_reset
_mv88e6060_switch_reset:                ; @mv88e6060_switch_reset
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x22, _MV88E6060_PORTS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MV88E6060_PORTS@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	w20, #0
Lloh2:
	adrp	x23, _PORT_CONTROL@GOTPAGE
Lloh3:
	ldr	x23, [x23, _PORT_CONTROL@GOTPAGEOFF]
Lloh4:
	adrp	x24, _PORT_CONTROL_STATE_MASK@GOTPAGE
Lloh5:
	ldr	x24, [x24, _PORT_CONTROL_STATE_MASK@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_REG_PORT
	mov	x1, x0
	ldr	w2, [x23]
	mov	x0, x19
	bl	_reg_read
	mov	x21, x0
	tbnz	w0, #31, LBB0_15
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	bl	_REG_PORT
	mov	x1, x0
	ldr	w2, [x23]
	ldr	w8, [x24]
	bic	w3, w21, w8
	mov	x0, x19
	bl	_reg_write
	cbnz	w0, LBB0_13
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w20, w20, #1
	ldr	w8, [x22]
	cmp	w20, w8
	b.lt	LBB0_2
LBB0_5:
	mov	w0, #2000
	mov	w1, #4000
	bl	_usleep_range
Lloh6:
	adrp	x22, _REG_GLOBAL@GOTPAGE
Lloh7:
	ldr	x22, [x22, _REG_GLOBAL@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh8:
	adrp	x8, _GLOBAL_ATU_CONTROL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GLOBAL_ATU_CONTROL@GOTPAGEOFF]
Lloh10:
	adrp	x9, _GLOBAL_ATU_CONTROL_SWRESET@GOTPAGE
Lloh11:
	ldr	x9, [x9, _GLOBAL_ATU_CONTROL_SWRESET@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
Lloh13:
	ldr	w8, [x9]
Lloh14:
	adrp	x9, _GLOBAL_ATU_CONTROL_LEARNDIS@GOTPAGE
Lloh15:
	ldr	x9, [x9, _GLOBAL_ATU_CONTROL_LEARNDIS@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, x19
	bl	_reg_write
	mov	x21, x0
	cbnz	w0, LBB0_15
; %bb.6:
Lloh17:
	adrp	x23, _jiffies@GOTPAGE
Lloh18:
	ldr	x23, [x23, _jiffies@GOTPAGEOFF]
	ldrsw	x0, [x23]
Lloh19:
	adrp	x8, _HZ@GOTPAGE
Lloh20:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh21:
	ldrsw	x8, [x8]
	add	x20, x8, x0
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	x1, x20
	bl	_time_before
	cbz	x0, LBB0_11
; %bb.7:
Lloh22:
	adrp	x24, _GLOBAL_STATUS@GOTPAGE
Lloh23:
	ldr	x24, [x24, _GLOBAL_STATUS@GOTPAGEOFF]
Lloh24:
	adrp	x25, _GLOBAL_STATUS_INIT_READY@GOTPAGE
Lloh25:
	ldr	x25, [x25, _GLOBAL_STATUS_INIT_READY@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	ldr	w2, [x24]
	mov	x0, x19
	bl	_reg_read
	mov	x21, x0
	tbnz	w0, #31, LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x25]
	tst	w8, w21
	b.ne	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	ldr	w0, [x23]
	mov	x1, x20
	bl	_time_before
	cbnz	x0, LBB0_8
LBB0_11:
	ldr	w0, [x23]
	mov	x1, x20
	bl	_time_after
	cbz	x0, LBB0_14
; %bb.12:
Lloh26:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_15
LBB0_13:
	mov	x21, x0
	b	LBB0_15
LBB0_14:
	mov	w21, #0
LBB0_15:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_MV88E6060_PORTS,4,2            ; @MV88E6060_PORTS
	.comm	_PORT_CONTROL,4,2               ; @PORT_CONTROL
	.comm	_PORT_CONTROL_STATE_MASK,4,2    ; @PORT_CONTROL_STATE_MASK
	.comm	_REG_GLOBAL,4,2                 ; @REG_GLOBAL
	.comm	_GLOBAL_ATU_CONTROL,4,2         ; @GLOBAL_ATU_CONTROL
	.comm	_GLOBAL_ATU_CONTROL_SWRESET,4,2 ; @GLOBAL_ATU_CONTROL_SWRESET
	.comm	_GLOBAL_ATU_CONTROL_LEARNDIS,4,2 ; @GLOBAL_ATU_CONTROL_LEARNDIS
	.comm	_jiffies,4,2                    ; @jiffies
	.comm	_HZ,4,2                         ; @HZ
	.comm	_GLOBAL_STATUS,4,2              ; @GLOBAL_STATUS
	.comm	_GLOBAL_STATUS_INIT_READY,4,2   ; @GLOBAL_STATUS_INIT_READY
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_mv88e6060_switch_reset
.subsections_via_symbols
