	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath_reset_internal
_ath_reset_internal:                    ## @ath_reset_internal
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	24(%rdi), %r12
	movq	%r12, %rdi
	callq	_ath9k_hw_common
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	___ath_cancel_work
	movl	12(%rbx), %edi
	callq	_disable_irq
	movq	%rbx, %rdi
	callq	_tasklet_disable
	leaq	4(%rbx), %rdi
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	callq	_tasklet_disable
	leaq	8(%rbx), %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_bh
	movq	16(%rbx), %rax
	leaq	12(%rax), %rcx
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	cmpq	$0, (%rax)
	setne	%al
	cmovneq	%r15, %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	testq	%r14, %r14
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	movb	%al, %r13b
	jmp	LBB0_3
LBB0_2:
	movq	(%r12), %r14
	xorl	%r13d, %r13d
LBB0_3:
	movq	%rbx, %rdi
	callq	_ath_prepare_reset
	testl	%eax, %eax
	cmovel	%eax, %r13d
	xorl	%eax, %eax
	callq	_ath9k_is_chanctx_enabled
	testq	%rax, %rax
	cmovnel	%r15d, %r13d
	leaq	32(%rbx), %r12
	movq	%r12, %rdi
	callq	_spin_lock_bh
	movq	16(%rbx), %rax
	movl	8(%rax), %eax
	movl	%eax, 36(%rbx)
	movq	%r12, %rdi
	callq	_spin_unlock_bh
	movq	_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	(%r14), %r15d
	movq	%r14, %rdi
	callq	_IS_CHAN_HT40
	leaq	L_.str(%rip), %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	movl	%r15d, %ecx
	movl	%eax, %r8d
	movl	%r13d, %r9d
	callq	_ath_dbg
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%r13d, %ecx
	callq	_ath9k_hw_reset
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	callq	_ath_err
	movq	%r15, %rdi
	callq	_ath9k_hw_enable_interrupts
	movq	_RESET_TYPE_BB_HANG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ath9k_queue_reset
	jmp	LBB0_10
LBB0_5:
	movq	24(%rbx), %rdi
	callq	_ath9k_hw_mci_is_enabled
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	movq	16(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_ath9k_mci_set_txpower
LBB0_8:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_ath_complete_reset
	xorl	%r14d, %r14d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_10:
	movl	12(%rbx), %edi
	callq	_enable_irq
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_bh
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_tasklet_enable
	movq	%rbx, %rdi
	callq	_tasklet_enable
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CONFIG,4,2                     ## @CONFIG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reset to %u MHz, HT40: %d fastcc: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Unable to reset channel, reset status %d\n"

	.comm	_RESET_TYPE_BB_HANG,4,2         ## @RESET_TYPE_BB_HANG
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_ath_reset_internal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath_reset_internal
_ath_reset_internal:                    ; @ath_reset_internal
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x1
	mov	x19, x0
	ldr	x22, [x0, #24]
	mov	x0, x22
	bl	_ath9k_hw_common
	mov	x23, x0
	mov	x0, x19
	bl	___ath_cancel_work
	ldr	w0, [x19, #12]
	bl	_disable_irq
	mov	x0, x19
	bl	_tasklet_disable
	add	x20, x19, #4
	mov	x0, x20
	bl	_tasklet_disable
	add	x21, x19, #8
	mov	x0, x21
	bl	_spin_lock_bh
	ldr	x8, [x19, #16]
	ldr	x9, [x8], #12
	cmp	x9, #0
	csel	x25, x8, xzr, eq
	cset	w26, ne
	cbnz	x24, LBB0_2
; %bb.1:
	mov	w26, #0
	ldr	x24, [x22]
LBB0_2:
	mov	x0, x19
	bl	_ath_prepare_reset
	cmp	w0, #0
	csel	w26, wzr, w26, eq
	bl	_ath9k_is_chanctx_enabled
	cmp	x0, #0
	csel	w26, w26, wzr, eq
	add	x27, x19, #32
	mov	x0, x27
	bl	_spin_lock_bh
	ldr	x8, [x19, #16]
	ldr	w8, [x8, #8]
	str	w8, [x19, #36]
	mov	x0, x27
	bl	_spin_unlock_bh
Lloh0:
	adrp	x8, _CONFIG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CONFIG@GOTPAGEOFF]
Lloh2:
	ldr	w27, [x8]
	ldr	w28, [x24]
	mov	x0, x24
	bl	_IS_CHAN_HT40
	mov	x4, x0
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x23
	mov	x1, x27
	mov	x3, x28
	mov	x5, x26
	bl	_ath_dbg
	mov	x0, x22
	mov	x1, x24
	mov	x2, x25
	mov	x3, x26
	bl	_ath9k_hw_reset
	cbz	w0, LBB0_4
; %bb.3:
	mov	x24, x0
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	mov	x2, x24
	bl	_ath_err
	mov	x0, x22
	bl	_ath9k_hw_enable_interrupts
Lloh7:
	adrp	x8, _RESET_TYPE_BB_HANG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RESET_TYPE_BB_HANG@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ath9k_queue_reset
	b	LBB0_10
LBB0_4:
	ldr	x0, [x19, #24]
	bl	_ath9k_hw_mci_is_enabled
	cbz	x0, LBB0_7
; %bb.5:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:
	mov	x0, x19
	mov	w1, #1
	mov	w2, #0
	bl	_ath9k_mci_set_txpower
LBB0_7:
	mov	x0, x19
	mov	w1, #1
	bl	_ath_complete_reset
	cbz	w0, LBB0_9
; %bb.8:
	mov	w24, #0
	b	LBB0_10
LBB0_9:
Lloh10:
	adrp	x8, _EIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_10:
	ldr	w0, [x19, #12]
	bl	_enable_irq
	mov	x0, x21
	bl	_spin_unlock_bh
	mov	x0, x20
	bl	_tasklet_enable
	mov	x0, x19
	bl	_tasklet_enable
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_CONFIG,4,2                     ; @CONFIG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reset to %u MHz, HT40: %d fastcc: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Unable to reset channel, reset status %d\n"

	.comm	_RESET_TYPE_BB_HANG,4,2         ; @RESET_TYPE_BB_HANG
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_ath_reset_internal
.subsections_via_symbols
