	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath9k_htc_set_key
_ath9k_htc_set_key:                     ## @ath9k_htc_set_key
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r12
	movq	%rcx, %rbx
	movq	%rdx, %r13
	movl	%esi, %r15d
	movq	(%rdi), %r14
	movq	8(%r14), %rdi
	callq	_ath9k_hw_common
	movq	_htc_modparam_nohwcrypt@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_3
## %bb.1:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_21
LBB0_3:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rdx
	movq	_NL80211_IFTYPE_ADHOC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	je	LBB0_5
## %bb.4:
	movq	_NL80211_IFTYPE_MESH_POINT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_9
LBB0_5:
	movq	(%r12), %rdx
	movq	_WLAN_CIPHER_SUITE_TKIP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	je	LBB0_7
## %bb.6:
	movq	_WLAN_CIPHER_SUITE_CCMP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_9
LBB0_7:
	movq	_IEEE80211_KEY_FLAG_PAIRWISE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 8(%r12)
	je	LBB0_8
LBB0_9:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %r13
	movq	%rbx, %rdi
	callq	_ath_dbg
	movq	%r14, %rdi
	callq	_ath9k_htc_ps_wakeup
	cmpl	$129, %r15d
	je	LBB0_18
## %bb.10:
	cmpl	$128, %r15d
	jne	LBB0_19
## %bb.11:
	movq	%r13, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%r12, %rcx
	callq	_ath_key_config
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_20
## %bb.12:
	movl	%ebx, 12(%r12)
	movq	_IEEE80211_KEY_FLAG_GENERATE_IV@GOTPCREL(%rip), %rcx
	movl	8(%r12), %eax
	orl	(%rcx), %eax
	movl	%eax, 8(%r12)
	movq	(%r12), %rcx
	movq	_WLAN_CIPHER_SUITE_TKIP@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_13
## %bb.14:
	movq	_IEEE80211_KEY_FLAG_GENERATE_MMIC@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movq	%r12, %rsi
	movl	%eax, 8(%r12)
	jmp	LBB0_15
LBB0_18:
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ath_key_delete
	xorl	%ebx, %ebx
	jmp	LBB0_20
LBB0_19:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_20
LBB0_8:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_13:
	movq	%r12, %rsi
LBB0_15:
	movq	8(%r14), %rdx
	xorl	%ebx, %ebx
	cmpl	$0, (%rdx)
	je	LBB0_20
## %bb.16:
	movq	_WLAN_CIPHER_SUITE_CCMP@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_20
## %bb.17:
	movq	_IEEE80211_KEY_FLAG_SW_MGMT_TX@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 8(%rsi)
LBB0_20:
	movq	%r14, %rdi
	callq	_ath9k_htc_ps_restore
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_21:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_htc_modparam_nohwcrypt,8,3     ## @htc_modparam_nohwcrypt
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_NL80211_IFTYPE_ADHOC,8,3       ## @NL80211_IFTYPE_ADHOC
	.comm	_NL80211_IFTYPE_MESH_POINT,8,3  ## @NL80211_IFTYPE_MESH_POINT
	.comm	_WLAN_CIPHER_SUITE_TKIP,8,3     ## @WLAN_CIPHER_SUITE_TKIP
	.comm	_WLAN_CIPHER_SUITE_CCMP,8,3     ## @WLAN_CIPHER_SUITE_CCMP
	.comm	_IEEE80211_KEY_FLAG_PAIRWISE,4,2 ## @IEEE80211_KEY_FLAG_PAIRWISE
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_CONFIG,4,2                     ## @CONFIG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Set HW Key\n"

	.comm	_IEEE80211_KEY_FLAG_GENERATE_IV,4,2 ## @IEEE80211_KEY_FLAG_GENERATE_IV
	.comm	_IEEE80211_KEY_FLAG_GENERATE_MMIC,4,2 ## @IEEE80211_KEY_FLAG_GENERATE_MMIC
	.comm	_IEEE80211_KEY_FLAG_SW_MGMT_TX,4,2 ## @IEEE80211_KEY_FLAG_SW_MGMT_TX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ath9k_htc_set_key
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath9k_htc_set_key
_ath9k_htc_set_key:                     ; @ath9k_htc_set_key
	.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	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	ldr	x19, [x0]
	ldr	x0, [x19, #8]
	bl	_ath9k_hw_common
Lloh0:
	adrp	x8, _htc_modparam_nohwcrypt@GOTPAGE
Lloh1:
	ldr	x8, [x8, _htc_modparam_nohwcrypt@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_16
LBB0_3:
	mov	x24, x0
	ldr	x8, [x22]
Lloh5:
	adrp	x9, _NL80211_IFTYPE_ADHOC@GOTPAGE
Lloh6:
	ldr	x9, [x9, _NL80211_IFTYPE_ADHOC@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
Lloh8:
	adrp	x10, _NL80211_IFTYPE_MESH_POINT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _NL80211_IFTYPE_MESH_POINT@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_6
; %bb.4:
	ldr	x8, [x20]
Lloh11:
	adrp	x9, _WLAN_CIPHER_SUITE_TKIP@GOTPAGE
Lloh12:
	ldr	x9, [x9, _WLAN_CIPHER_SUITE_TKIP@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
Lloh14:
	adrp	x10, _WLAN_CIPHER_SUITE_CCMP@GOTPAGE
Lloh15:
	ldr	x10, [x10, _WLAN_CIPHER_SUITE_CCMP@GOTPAGEOFF]
Lloh16:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_6
; %bb.5:
	ldr	w8, [x20, #8]
Lloh17:
	adrp	x9, _IEEE80211_KEY_FLAG_PAIRWISE@GOTPAGE
Lloh18:
	ldr	x9, [x9, _IEEE80211_KEY_FLAG_PAIRWISE@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_17
LBB0_6:
	mov	x0, x19
	bl	_mutex_lock
Lloh20:
	adrp	x8, _CONFIG@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CONFIG@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x2, l_.str@PAGE
Lloh24:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x24
	bl	_ath_dbg
	mov	x0, x19
	bl	_ath9k_htc_ps_wakeup
	cmp	w23, #129
	b.eq	LBB0_13
; %bb.7:
	cmp	w23, #128
	b.ne	LBB0_14
; %bb.8:
	mov	x0, x24
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	bl	_ath_key_config
	mov	x21, x0
	tbnz	w0, #31, LBB0_15
; %bb.9:
Lloh25:
	adrp	x8, _IEEE80211_KEY_FLAG_GENERATE_IV@GOTPAGE
Lloh26:
	ldr	x8, [x8, _IEEE80211_KEY_FLAG_GENERATE_IV@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	ldr	w9, [x20, #8]
	orr	w8, w9, w8
	stp	w8, w21, [x20, #8]
	ldr	x9, [x20]
Lloh28:
	adrp	x10, _WLAN_CIPHER_SUITE_TKIP@GOTPAGE
Lloh29:
	ldr	x10, [x10, _WLAN_CIPHER_SUITE_TKIP@GOTPAGEOFF]
Lloh30:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_11
; %bb.10:
Lloh31:
	adrp	x10, _IEEE80211_KEY_FLAG_GENERATE_MMIC@GOTPAGE
Lloh32:
	ldr	x10, [x10, _IEEE80211_KEY_FLAG_GENERATE_MMIC@GOTPAGEOFF]
Lloh33:
	ldr	w10, [x10]
	orr	w8, w10, w8
	str	w8, [x20, #8]
LBB0_11:
	ldr	x10, [x19, #8]
	ldr	w10, [x10]
Lloh34:
	adrp	x11, _WLAN_CIPHER_SUITE_CCMP@GOTPAGE
Lloh35:
	ldr	x11, [x11, _WLAN_CIPHER_SUITE_CCMP@GOTPAGEOFF]
Lloh36:
	ldr	x11, [x11]
	cmp	w10, #0
	mov	w21, #0
	ccmp	x9, x11, #0, ne
	b.ne	LBB0_15
; %bb.12:
Lloh37:
	adrp	x9, _IEEE80211_KEY_FLAG_SW_MGMT_TX@GOTPAGE
Lloh38:
	ldr	x9, [x9, _IEEE80211_KEY_FLAG_SW_MGMT_TX@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x20, #8]
	b	LBB0_15
LBB0_13:
	mov	x0, x24
	mov	x1, x20
	bl	_ath_key_delete
	mov	w21, #0
	b	LBB0_15
LBB0_14:
Lloh40:
	adrp	x8, _EINVAL@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_15:
	mov	x0, x19
	bl	_ath9k_htc_ps_restore
	mov	x0, x19
	bl	_mutex_unlock
LBB0_16:
	mov	x0, x21
	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
LBB0_17:
Lloh43:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh44:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_htc_modparam_nohwcrypt,8,3     ; @htc_modparam_nohwcrypt
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_NL80211_IFTYPE_ADHOC,8,3       ; @NL80211_IFTYPE_ADHOC
	.comm	_NL80211_IFTYPE_MESH_POINT,8,3  ; @NL80211_IFTYPE_MESH_POINT
	.comm	_WLAN_CIPHER_SUITE_TKIP,8,3     ; @WLAN_CIPHER_SUITE_TKIP
	.comm	_WLAN_CIPHER_SUITE_CCMP,8,3     ; @WLAN_CIPHER_SUITE_CCMP
	.comm	_IEEE80211_KEY_FLAG_PAIRWISE,4,2 ; @IEEE80211_KEY_FLAG_PAIRWISE
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_CONFIG,4,2                     ; @CONFIG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Set HW Key\n"

	.comm	_IEEE80211_KEY_FLAG_GENERATE_IV,4,2 ; @IEEE80211_KEY_FLAG_GENERATE_IV
	.comm	_IEEE80211_KEY_FLAG_GENERATE_MMIC,4,2 ; @IEEE80211_KEY_FLAG_GENERATE_MMIC
	.comm	_IEEE80211_KEY_FLAG_SW_MGMT_TX,4,2 ; @IEEE80211_KEY_FLAG_SW_MGMT_TX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ath9k_htc_set_key
.subsections_via_symbols
