	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2800_config_wcid_attr_cipher
_rt2800_config_wcid_attr_cipher:        ## @rt2800_config_wcid_attr_cipher
	.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	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	8(%rdx), %edi
	callq	_MAC_WCID_ATTR_ENTRY
	movq	(%r14), %r13
	movq	_SET_KEY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movl	%eax, %r12d
	movl	%eax, %esi
	callq	_rt2800_register_read
	movl	%eax, -44(%rbp)
	movq	_MAC_WCID_ATTRIBUTE_KEYTAB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpq	%rbx, %r13
	jne	LBB0_2
## %bb.1:
	movq	_IEEE80211_KEY_FLAG_PAIRWISE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edx, %edx
	andl	(%r15), %eax
	setne	%dl
	leaq	-44(%rbp), %r13
	movq	%r13, %rdi
	callq	_rt2x00_set_field32
	movq	_MAC_WCID_ATTRIBUTE_CIPHER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r14), %edx
	andl	$7, %edx
	movq	%r13, %rdi
	callq	_rt2x00_set_field32
	movq	_MAC_WCID_ATTRIBUTE_CIPHER_EXT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r14), %edx
	shrl	$3, %edx
	andl	$1, %edx
	movq	%r13, %rdi
	callq	_rt2x00_set_field32
	movq	_MAC_WCID_ATTRIBUTE_RX_WIUDF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r14), %edx
	movq	%r13, %rdi
	jmp	LBB0_3
LBB0_2:
	leaq	-44(%rbp), %r13
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field32
	movq	_MAC_WCID_ATTRIBUTE_CIPHER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field32
	movq	_MAC_WCID_ATTRIBUTE_CIPHER_EXT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field32
	movq	_MAC_WCID_ATTRIBUTE_RX_WIUDF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
LBB0_3:
	callq	_rt2x00_set_field32
	movl	-44(%rbp), %edx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_rt2800_register_write
	movl	8(%r15), %edi
	callq	_MAC_IVEIV_ENTRY
	movl	%eax, %r12d
	movq	(%r14), %rax
	movq	_SET_KEY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.4:
	leaq	-56(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	$8, %ecx
	callq	_rt2800_register_multiread
	movl	8(%r14), %edx
	movq	_CIPHER_TKIP@GOTPCREL(%rip), %rsi
	movq	-56(%rbp), %rax
	movl	12(%rax), %ecx
	cmpl	(%rsi), %edx
	je	LBB0_7
## %bb.5:
	movq	_CIPHER_TKIP_NO_MIC@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	je	LBB0_7
## %bb.6:
	movq	_CIPHER_AES@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	jne	LBB0_8
LBB0_7:
	orl	$32, %ecx
	movl	%ecx, 12(%rax)
LBB0_8:
	movl	4(%r15), %edx
	shll	$6, %edx
	orl	%ecx, %edx
	movl	%edx, 12(%rax)
	jmp	LBB0_10
LBB0_9:
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
LBB0_10:
	leaq	-56(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	$8, %ecx
	callq	_rt2800_register_multiwrite
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SET_KEY,8,3                    ## @SET_KEY
	.comm	_MAC_WCID_ATTRIBUTE_KEYTAB,4,2  ## @MAC_WCID_ATTRIBUTE_KEYTAB
	.comm	_IEEE80211_KEY_FLAG_PAIRWISE,4,2 ## @IEEE80211_KEY_FLAG_PAIRWISE
	.comm	_MAC_WCID_ATTRIBUTE_CIPHER,4,2  ## @MAC_WCID_ATTRIBUTE_CIPHER
	.comm	_MAC_WCID_ATTRIBUTE_CIPHER_EXT,4,2 ## @MAC_WCID_ATTRIBUTE_CIPHER_EXT
	.comm	_MAC_WCID_ATTRIBUTE_RX_WIUDF,4,2 ## @MAC_WCID_ATTRIBUTE_RX_WIUDF
	.comm	_CIPHER_TKIP,4,2                ## @CIPHER_TKIP
	.comm	_CIPHER_TKIP_NO_MIC,4,2         ## @CIPHER_TKIP_NO_MIC
	.comm	_CIPHER_AES,4,2                 ## @CIPHER_AES
	.no_dead_strip	_rt2800_config_wcid_attr_cipher
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2800_config_wcid_attr_cipher
_rt2800_config_wcid_attr_cipher:        ; @rt2800_config_wcid_attr_cipher
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x2, #8]
	bl	_MAC_WCID_ATTR_ENTRY
	mov	x22, x0
	ldr	x24, [x21]
Lloh0:
	adrp	x23, _SET_KEY@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SET_KEY@GOTPAGEOFF]
	ldr	x25, [x23]
	mov	x0, x19
	mov	x1, x22
	bl	_rt2800_register_read
	str	w0, [sp, #4]
Lloh2:
	adrp	x8, _MAC_WCID_ATTRIBUTE_KEYTAB@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAC_WCID_ATTRIBUTE_KEYTAB@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	cmp	x24, x25
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x20]
Lloh5:
	adrp	x9, _IEEE80211_KEY_FLAG_PAIRWISE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IEEE80211_KEY_FLAG_PAIRWISE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w2, ne
	add	x0, sp, #4
	bl	_rt2x00_set_field32
Lloh8:
	adrp	x8, _MAC_WCID_ATTRIBUTE_CIPHER@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MAC_WCID_ATTRIBUTE_CIPHER@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	ldr	w8, [x21, #8]
	and	w2, w8, #0x7
	add	x0, sp, #4
	bl	_rt2x00_set_field32
Lloh11:
	adrp	x8, _MAC_WCID_ATTRIBUTE_CIPHER_EXT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MAC_WCID_ATTRIBUTE_CIPHER_EXT@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	ldr	w8, [x21, #8]
	ubfx	w2, w8, #3, #1
	add	x0, sp, #4
	bl	_rt2x00_set_field32
Lloh14:
	adrp	x8, _MAC_WCID_ATTRIBUTE_RX_WIUDF@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MAC_WCID_ATTRIBUTE_RX_WIUDF@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	ldr	w2, [x21, #8]
	add	x0, sp, #4
	b	LBB0_3
LBB0_2:
	add	x0, sp, #4
	mov	w2, #0
	bl	_rt2x00_set_field32
Lloh17:
	adrp	x8, _MAC_WCID_ATTRIBUTE_CIPHER@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MAC_WCID_ATTRIBUTE_CIPHER@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	add	x0, sp, #4
	mov	w2, #0
	bl	_rt2x00_set_field32
Lloh20:
	adrp	x8, _MAC_WCID_ATTRIBUTE_CIPHER_EXT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MAC_WCID_ATTRIBUTE_CIPHER_EXT@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	add	x0, sp, #4
	mov	w2, #0
	bl	_rt2x00_set_field32
Lloh23:
	adrp	x8, _MAC_WCID_ATTRIBUTE_RX_WIUDF@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MAC_WCID_ATTRIBUTE_RX_WIUDF@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	add	x0, sp, #4
	mov	w2, #0
LBB0_3:
	bl	_rt2x00_set_field32
	ldr	w2, [sp, #4]
	mov	x0, x19
	mov	x1, x22
	bl	_rt2800_register_write
	ldr	w0, [x20, #8]
	bl	_MAC_IVEIV_ENTRY
	mov	x22, x0
	ldr	x8, [x21]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.4:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x22
	mov	w3, #8
	bl	_rt2800_register_multiread
	ldr	w10, [x21, #8]
Lloh26:
	adrp	x8, _CIPHER_TKIP@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CIPHER_TKIP@GOTPAGEOFF]
Lloh28:
	ldr	w11, [x8]
	ldr	x8, [sp, #8]
	ldr	w9, [x8, #12]
	cmp	w10, w11
	b.eq	LBB0_7
; %bb.5:
Lloh29:
	adrp	x11, _CIPHER_TKIP_NO_MIC@GOTPAGE
Lloh30:
	ldr	x11, [x11, _CIPHER_TKIP_NO_MIC@GOTPAGEOFF]
Lloh31:
	ldr	w11, [x11]
	cmp	w10, w11
	b.eq	LBB0_7
; %bb.6:
Lloh32:
	adrp	x11, _CIPHER_AES@GOTPAGE
Lloh33:
	ldr	x11, [x11, _CIPHER_AES@GOTPAGEOFF]
Lloh34:
	ldr	w11, [x11]
	cmp	w10, w11
	b.ne	LBB0_8
LBB0_7:
	orr	w9, w9, #0x20
	str	w9, [x8, #12]
LBB0_8:
	ldr	w10, [x20, #4]
	orr	w9, w9, w10, lsl #6
	str	w9, [x8, #12]
	b	LBB0_10
LBB0_9:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
LBB0_10:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x22
	mov	w3, #8
	bl	_rt2800_register_multiwrite
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_SET_KEY,8,3                    ; @SET_KEY
	.comm	_MAC_WCID_ATTRIBUTE_KEYTAB,4,2  ; @MAC_WCID_ATTRIBUTE_KEYTAB
	.comm	_IEEE80211_KEY_FLAG_PAIRWISE,4,2 ; @IEEE80211_KEY_FLAG_PAIRWISE
	.comm	_MAC_WCID_ATTRIBUTE_CIPHER,4,2  ; @MAC_WCID_ATTRIBUTE_CIPHER
	.comm	_MAC_WCID_ATTRIBUTE_CIPHER_EXT,4,2 ; @MAC_WCID_ATTRIBUTE_CIPHER_EXT
	.comm	_MAC_WCID_ATTRIBUTE_RX_WIUDF,4,2 ; @MAC_WCID_ATTRIBUTE_RX_WIUDF
	.comm	_CIPHER_TKIP,4,2                ; @CIPHER_TKIP
	.comm	_CIPHER_TKIP_NO_MIC,4,2         ; @CIPHER_TKIP_NO_MIC
	.comm	_CIPHER_AES,4,2                 ; @CIPHER_AES
	.no_dead_strip	_rt2800_config_wcid_attr_cipher
.subsections_via_symbols
