	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function il4965_set_tkip_dynamic_key_info
_il4965_set_tkip_dynamic_key_info:      ## @il4965_set_tkip_dynamic_key_info
	.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	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_STA_KEY_FLG_TKIP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_STA_KEY_FLG_MAP_KEY_MSK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	(%rsi), %edi
	movq	_STA_KEY_FLG_KEYID_POS@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edi
	callq	_cpu_to_le16
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_STA_KEY_FLG_INVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	16(%r14), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_STA_KEY_MULTICAST_MSK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_IEEE80211_KEY_FLAG_GENERATE_IV@GOTPCREL(%rip), %rax
	movl	12(%rbx), %ecx
	orl	(%rax), %ecx
	movq	_IEEE80211_KEY_FLAG_GENERATE_MMIC@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 12(%rbx)
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movl	8(%rbx), %ecx
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rax
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%rdx,4), %r14
	movl	%ecx, 32(%rax,%r14,8)
	movl	$16, 24(%rax,%r14,8)
	movq	_STA_KEY_FLG_ENCRYPT_MSK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax,%r14,8), %ecx
	movq	_STA_KEY_FLG_NO_ENC@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_1
## %bb.2:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_il_get_free_ucode_key_idx
	movq	8(%rbx), %rcx
	movq	%rax, 8(%rcx,%r14,8)
	jmp	LBB0_3
LBB0_1:
	movq	8(%rax,%r14,8), %rax
LBB0_3:
	orl	-48(%rbp), %r12d                ## 4-byte Folded Reload
	orl	-44(%rbp), %r12d                ## 4-byte Folded Reload
	notl	%r15d
	andl	%r12d, %r15d
	xorl	%ecx, %ecx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	cmpq	%rbx, -72(%rbp)                 ## 8-byte Folded Reload
	cmovnel	%ecx, %r13d
	orl	%r15d, %r13d
	movq	_WEP_INVALID_OFFSET@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_WARN
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	8(%r14), %rax
	shlq	$3, %rbx
	leaq	(%rbx,%rbx,4), %rbx
	movl	%r13d, (%rax,%rbx)
	movl	28(%rax,%rbx), %edi
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movl	4(%r15), %esi
	movl	$16, %edx
	callq	_memcpy
	movq	8(%r14), %rax
	movl	16(%rax,%rbx), %edi
	movl	4(%r15), %esi
	movl	$16, %edx
	callq	_memcpy
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STA_KEY_FLG_TKIP,4,2           ## @STA_KEY_FLG_TKIP
	.comm	_STA_KEY_FLG_MAP_KEY_MSK,4,2    ## @STA_KEY_FLG_MAP_KEY_MSK
	.comm	_STA_KEY_FLG_KEYID_POS,4,2      ## @STA_KEY_FLG_KEYID_POS
	.comm	_STA_KEY_FLG_INVALID,4,2        ## @STA_KEY_FLG_INVALID
	.comm	_STA_KEY_MULTICAST_MSK,4,2      ## @STA_KEY_MULTICAST_MSK
	.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	_STA_KEY_FLG_ENCRYPT_MSK,4,2    ## @STA_KEY_FLG_ENCRYPT_MSK
	.comm	_STA_KEY_FLG_NO_ENC,4,2         ## @STA_KEY_FLG_NO_ENC
	.comm	_WEP_INVALID_OFFSET,8,3         ## @WEP_INVALID_OFFSET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no space for a new key"

	.no_dead_strip	_il4965_set_tkip_dynamic_key_info
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function il4965_set_tkip_dynamic_key_info
_il4965_set_tkip_dynamic_key_info:      ; @il4965_set_tkip_dynamic_key_info
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _STA_KEY_FLG_TKIP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STA_KEY_FLG_TKIP@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
Lloh3:
	adrp	x8, _STA_KEY_FLG_MAP_KEY_MSK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STA_KEY_FLG_MAP_KEY_MSK@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
	ldr	w8, [x1]
Lloh6:
	adrp	x9, _STA_KEY_FLG_KEYID_POS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _STA_KEY_FLG_KEYID_POS@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	lsl	w0, w8, w9
	bl	_cpu_to_le16
	mov	x22, x0
Lloh9:
	adrp	x8, _STA_KEY_FLG_INVALID@GOTPAGE
Lloh10:
	ldr	x8, [x8, _STA_KEY_FLG_INVALID@GOTPAGEOFF]
Lloh11:
	ldr	w25, [x8]
Lloh12:
	adrp	x8, _STA_KEY_MULTICAST_MSK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _STA_KEY_MULTICAST_MSK@GOTPAGEOFF]
	ldr	x27, [x19, #16]
Lloh14:
	ldr	w26, [x8]
Lloh15:
	adrp	x8, _IEEE80211_KEY_FLAG_GENERATE_IV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IEEE80211_KEY_FLAG_GENERATE_IV@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w9, [x20, #12]
	orr	w8, w9, w8
Lloh18:
	adrp	x9, _IEEE80211_KEY_FLAG_GENERATE_MMIC@GOTPAGE
Lloh19:
	ldr	x9, [x9, _IEEE80211_KEY_FLAG_GENERATE_MMIC@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x20, #12]
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	w9, [x20, #8]
	ldr	x8, [x19, #8]
	mov	w10, #40
	madd	x10, x21, x10, x8
	str	w9, [x10, #32]
	mov	w9, #16
	str	w9, [x10, #24]
	ldr	w9, [x10]
Lloh21:
	adrp	x10, _STA_KEY_FLG_ENCRYPT_MSK@GOTPAGE
Lloh22:
	ldr	x10, [x10, _STA_KEY_FLG_ENCRYPT_MSK@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	and	w9, w10, w9
Lloh24:
	adrp	x10, _STA_KEY_FLG_NO_ENC@GOTPAGE
Lloh25:
	ldr	x10, [x10, _STA_KEY_FLG_NO_ENC@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_il_get_free_ucode_key_idx
	ldr	x8, [x19, #8]
	mov	w9, #40
	madd	x8, x21, x9, x8
	str	x0, [x8, #8]
	b	LBB0_3
LBB0_2:
	mov	w9, #40
	madd	x8, x21, x9, x8
	ldr	x0, [x8, #8]
LBB0_3:
	orr	w8, w24, w23
	orr	w8, w8, w22
	bic	w8, w8, w25
	cmp	x27, x21
	csel	w9, w26, wzr, eq
	orr	w22, w9, w8
Lloh27:
	adrp	x8, _WEP_INVALID_OFFSET@GOTPAGE
Lloh28:
	ldr	x8, [x8, _WEP_INVALID_OFFSET@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w0, eq
Lloh30:
	adrp	x1, l_.str@PAGE
Lloh31:
	add	x1, x1, l_.str@PAGEOFF
	bl	_WARN
	ldr	x8, [x19, #8]
	add	x9, x21, x21, lsl #2
	lsl	x21, x9, #3
	add	x8, x8, x21
	str	w22, [x8]
	ldr	w0, [x8, #28]
	ldr	w1, [x20, #4]
	mov	w2, #16
	bl	_memcpy
	ldr	x8, [x19, #8]
	add	x8, x8, x21
	ldr	w0, [x8, #16]
	ldr	w1, [x20, #4]
	mov	w2, #16
	bl	_memcpy
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_STA_KEY_FLG_TKIP,4,2           ; @STA_KEY_FLG_TKIP
	.comm	_STA_KEY_FLG_MAP_KEY_MSK,4,2    ; @STA_KEY_FLG_MAP_KEY_MSK
	.comm	_STA_KEY_FLG_KEYID_POS,4,2      ; @STA_KEY_FLG_KEYID_POS
	.comm	_STA_KEY_FLG_INVALID,4,2        ; @STA_KEY_FLG_INVALID
	.comm	_STA_KEY_MULTICAST_MSK,4,2      ; @STA_KEY_MULTICAST_MSK
	.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	_STA_KEY_FLG_ENCRYPT_MSK,4,2    ; @STA_KEY_FLG_ENCRYPT_MSK
	.comm	_STA_KEY_FLG_NO_ENC,4,2         ; @STA_KEY_FLG_NO_ENC
	.comm	_WEP_INVALID_OFFSET,8,3         ; @WEP_INVALID_OFFSET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no space for a new key"

	.no_dead_strip	_il4965_set_tkip_dynamic_key_info
.subsections_via_symbols
