	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath_hw_keyreset                ## -- Begin function ath_hw_keyreset
	.p2align	4, 0x90
_ath_hw_keyreset:                       ## @ath_hw_keyreset
	.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	%rsi, %rbx
	movq	%rdi, %r15
	cmpq	%rsi, (%rdi)
	jle	LBB0_1
## %bb.2:
	movq	16(%r15), %r14
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_TYPE
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_REG_READ
	movq	%rax, %r12
	movq	%r14, %rdi
	callq	_ENABLE_REGWRITE_BUFFER
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_KEY0
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_REG_WRITE
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_KEY1
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_REG_WRITE
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_KEY2
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_REG_WRITE
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_KEY3
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_REG_WRITE
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_KEY4
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_REG_WRITE
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_TYPE
	movq	_AR_KEYTABLE_TYPE_CLR@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_REG_WRITE
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_MAC0
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_REG_WRITE
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_MAC1
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_REG_WRITE
	movq	_AR_KEYTABLE_TYPE_TKIP@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jne	LBB0_5
## %bb.3:
	addq	$64, %rbx
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_KEY0
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_REG_WRITE
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_KEY1
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_REG_WRITE
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_KEY2
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_REG_WRITE
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_KEY3
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_REG_WRITE
	movq	_ATH_CRYPT_CAP_MIC_COMBINED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r15)
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_KEY4
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_REG_WRITE
	movq	%rbx, %rdi
	callq	_AR_KEYTABLE_TYPE
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_REG_WRITE
LBB0_5:
	movq	%r14, %rdi
	callq	_REGWRITE_BUFFER_FLUSH
	movl	$1, %eax
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_ath_err
	xorl	%eax, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"keyreset: keycache entry %u out of range\n"

	.comm	_AR_KEYTABLE_TYPE_CLR,4,2       ## @AR_KEYTABLE_TYPE_CLR
	.comm	_AR_KEYTABLE_TYPE_TKIP,8,3      ## @AR_KEYTABLE_TYPE_TKIP
	.comm	_ATH_CRYPT_CAP_MIC_COMBINED,4,2 ## @ATH_CRYPT_CAP_MIC_COMBINED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath_hw_keyreset                ; -- Begin function ath_hw_keyreset
	.p2align	2
_ath_hw_keyreset:                       ; @ath_hw_keyreset
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x0]
	cmp	x8, x1
	b.le	LBB0_5
; %bb.1:
	ldr	x19, [x20, #16]
	mov	x0, x21
	bl	_AR_KEYTABLE_TYPE
	mov	x1, x0
	mov	x0, x19
	bl	_REG_READ
	mov	x22, x0
	mov	x0, x19
	bl	_ENABLE_REGWRITE_BUFFER
	mov	x0, x21
	bl	_AR_KEYTABLE_KEY0
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WRITE
	mov	x0, x21
	bl	_AR_KEYTABLE_KEY1
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WRITE
	mov	x0, x21
	bl	_AR_KEYTABLE_KEY2
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WRITE
	mov	x0, x21
	bl	_AR_KEYTABLE_KEY3
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WRITE
	mov	x0, x21
	bl	_AR_KEYTABLE_KEY4
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WRITE
	mov	x0, x21
	bl	_AR_KEYTABLE_TYPE
	mov	x1, x0
Lloh0:
	adrp	x23, _AR_KEYTABLE_TYPE_CLR@GOTPAGE
Lloh1:
	ldr	x23, [x23, _AR_KEYTABLE_TYPE_CLR@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_REG_WRITE
	mov	x0, x21
	bl	_AR_KEYTABLE_MAC0
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WRITE
	mov	x0, x21
	bl	_AR_KEYTABLE_MAC1
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WRITE
Lloh2:
	adrp	x8, _AR_KEYTABLE_TYPE_TKIP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AR_KEYTABLE_TYPE_TKIP@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x22, x8
	b.ne	LBB0_4
; %bb.2:
	add	x21, x21, #64
	mov	x0, x21
	bl	_AR_KEYTABLE_KEY0
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WRITE
	mov	x0, x21
	bl	_AR_KEYTABLE_KEY1
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WRITE
	mov	x0, x21
	bl	_AR_KEYTABLE_KEY2
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WRITE
	mov	x0, x21
	bl	_AR_KEYTABLE_KEY3
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WRITE
	ldr	w8, [x20, #8]
Lloh5:
	adrp	x9, _ATH_CRYPT_CAP_MIC_COMBINED@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ATH_CRYPT_CAP_MIC_COMBINED@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x21
	bl	_AR_KEYTABLE_KEY4
	mov	x1, x0
	mov	x0, x19
	mov	w2, #0
	bl	_REG_WRITE
	mov	x0, x21
	bl	_AR_KEYTABLE_TYPE
	mov	x1, x0
	ldr	w2, [x23]
	mov	x0, x19
	bl	_REG_WRITE
LBB0_4:
	mov	x0, x19
	bl	_REGWRITE_BUFFER_FLUSH
	mov	w0, #1
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_ath_err
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"keyreset: keycache entry %u out of range\n"

	.comm	_AR_KEYTABLE_TYPE_CLR,4,2       ; @AR_KEYTABLE_TYPE_CLR
	.comm	_AR_KEYTABLE_TYPE_TKIP,8,3      ; @AR_KEYTABLE_TYPE_TKIP
	.comm	_ATH_CRYPT_CAP_MIC_COMBINED,4,2 ; @ATH_CRYPT_CAP_MIC_COMBINED
.subsections_via_symbols
