	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7603_pse_reset
_mt7603_pse_reset:                      ## @mt7603_pse_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, %rbx
	movq	(%rdi), %rax
	movq	_RESET_CAUSE_RESET_FAILED@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	cmpl	$0, (%rax,%rcx,4)
	jne	LBB0_2
## %bb.1:
	movq	_MT_MCU_DEBUG_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_MCU_DEBUG_RESET_PSE_S@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mt76_clear
LBB0_2:
	movq	_MT_MCU_DEBUG_RESET@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_MT_MCU_DEBUG_RESET_PSE@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_mt76_set
	movl	(%r15), %esi
	movq	_MT_MCU_DEBUG_RESET_PSE_S@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	%ecx, %edx
	movl	$500, %r8d                      ## imm = 0x1F4
	callq	_mt76_poll_msec
	movq	(%rbx), %rcx
	movq	(%r14), %rdx
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	movq	_MT_MCU_DEBUG_RESET_QUEUES@GOTPCREL(%rip), %r12
	jmp	LBB0_5
LBB0_4:
	movl	(%rcx,%rdx,4), %eax
	incl	%eax
LBB0_5:
	movl	%eax, (%rcx,%rdx,4)
	movl	(%r15), %esi
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_mt76_clear
	movq	(%rbx), %rax
	movq	(%r14), %rcx
	cmpl	$3, (%rax,%rcx,4)
	jl	LBB0_7
## %bb.6:
	movl	$0, (%rax,%rcx,4)
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RESET_CAUSE_RESET_FAILED,8,3   ## @RESET_CAUSE_RESET_FAILED
	.comm	_MT_MCU_DEBUG_RESET,4,2         ## @MT_MCU_DEBUG_RESET
	.comm	_MT_MCU_DEBUG_RESET_PSE_S,4,2   ## @MT_MCU_DEBUG_RESET_PSE_S
	.comm	_MT_MCU_DEBUG_RESET_PSE,4,2     ## @MT_MCU_DEBUG_RESET_PSE
	.comm	_MT_MCU_DEBUG_RESET_QUEUES,4,2  ## @MT_MCU_DEBUG_RESET_QUEUES
	.no_dead_strip	_mt7603_pse_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7603_pse_reset
_mt7603_pse_reset:                      ; @mt7603_pse_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
	ldr	x8, [x0]
Lloh0:
	adrp	x20, _RESET_CAUSE_RESET_FAILED@GOTPAGE
Lloh1:
	ldr	x20, [x20, _RESET_CAUSE_RESET_FAILED@GOTPAGEOFF]
	ldr	x9, [x20]
	ldr	w8, [x8, x9, lsl #2]
Lloh2:
	adrp	x21, _MT_MCU_DEBUG_RESET@GOTPAGE
Lloh3:
	ldr	x21, [x21, _MT_MCU_DEBUG_RESET@GOTPAGEOFF]
Lloh4:
	adrp	x22, _MT_MCU_DEBUG_RESET_PSE_S@GOTPAGE
Lloh5:
	ldr	x22, [x22, _MT_MCU_DEBUG_RESET_PSE_S@GOTPAGEOFF]
	cbnz	w8, LBB0_2
; %bb.1:
	ldr	w1, [x21]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_mt76_clear
LBB0_2:
	ldr	w1, [x21]
Lloh6:
	adrp	x8, _MT_MCU_DEBUG_RESET_PSE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MT_MCU_DEBUG_RESET_PSE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mt76_set
	ldr	w1, [x21]
	ldr	w2, [x22]
	mov	x0, x19
	mov	x3, x2
	mov	w4, #500
	bl	_mt76_poll_msec
	ldr	x8, [x19]
	ldr	x9, [x20]
	cbz	w0, LBB0_4
; %bb.3:
	mov	w11, #0
Lloh9:
	adrp	x10, _MT_MCU_DEBUG_RESET_QUEUES@GOTPAGE
Lloh10:
	ldr	x10, [x10, _MT_MCU_DEBUG_RESET_QUEUES@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
	ldr	w10, [x8, x9, lsl #2]
	add	w11, w10, #1
Lloh11:
	adrp	x10, _MT_MCU_DEBUG_RESET_PSE@GOTPAGE
Lloh12:
	ldr	x10, [x10, _MT_MCU_DEBUG_RESET_PSE@GOTPAGEOFF]
LBB0_5:
	str	w11, [x8, x9, lsl #2]
	ldr	w1, [x21]
	ldr	w2, [x10]
	mov	x0, x19
	bl	_mt76_clear
	ldr	x8, [x19]
	ldr	x9, [x20]
	ldr	w10, [x8, x9, lsl #2]
	cmp	w10, #3
	b.lt	LBB0_7
; %bb.6:
	str	wzr, [x8, x9, lsl #2]
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	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_RESET_CAUSE_RESET_FAILED,8,3   ; @RESET_CAUSE_RESET_FAILED
	.comm	_MT_MCU_DEBUG_RESET,4,2         ; @MT_MCU_DEBUG_RESET
	.comm	_MT_MCU_DEBUG_RESET_PSE_S,4,2   ; @MT_MCU_DEBUG_RESET_PSE_S
	.comm	_MT_MCU_DEBUG_RESET_PSE,4,2     ; @MT_MCU_DEBUG_RESET_PSE
	.comm	_MT_MCU_DEBUG_RESET_QUEUES,4,2  ; @MT_MCU_DEBUG_RESET_QUEUES
	.no_dead_strip	_mt7603_pse_reset
.subsections_via_symbols
