	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rt2800_config_shared_key       ## -- Begin function rt2800_config_shared_key
	.p2align	4, 0x90
_rt2800_config_shared_key:              ## @rt2800_config_shared_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	(%rsi), %rax
	movq	_SET_KEY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movl	8(%r12), %eax
	shll	$2, %eax
	addl	4(%rbx), %eax
	movl	%eax, (%rbx)
	movl	28(%r12), %esi
	movl	$4, %edx
	callq	_memcpy
	movl	24(%r12), %esi
	movl	$4, %edx
	callq	_memcpy
	movl	20(%r12), %esi
	movl	$4, %edx
	callq	_memcpy
	movl	(%rbx), %edi
	callq	_SHARED_KEY_ENTRY
	leaq	-72(%rbp), %rdx
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	$12, %ecx
	callq	_rt2800_register_multiwrite
LBB0_2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %ebx
	leal	7(%rbx), %edi
	testl	%ebx, %ebx
	cmovnsl	%ebx, %edi
	movl	%edi, %eax
	andl	$-8, %eax
	subl	%eax, %ebx
	shll	$2, %ebx
	movl	$7, %r14d
	movl	%ebx, %ecx
	shll	%cl, %r14d
	sarl	$3, %edi
	callq	_SHARED_KEY_MODE_ENTRY
	movl	%eax, %r13d
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_rt2800_register_read
	movl	%eax, -44(%rbp)
	movq	(%r12), %rax
	movl	$0, %edx
	movq	_SET_KEY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movl	12(%r12), %edx
LBB0_4:
	shlq	$32, %r14
	orq	%r14, %rbx
	leaq	-44(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_rt2x00_set_field32
	movl	-44(%rbp), %edx
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_rt2800_register_write
	movl	16(%r12), %esi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edx
	movq	%r15, %rdi
	callq	_rt2800_config_wcid
	movl	(%rbx), %esi
	movl	8(%r12), %edx
	movq	%r15, %rdi
	callq	_rt2800_config_wcid_attr_bssidx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_rt2800_config_wcid_attr_cipher
	xorl	%eax, %eax
	addq	$40, %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
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rt2800_config_shared_key       ; -- Begin function rt2800_config_shared_key
	.p2align	2
_rt2800_config_shared_key:              ; @rt2800_config_shared_key
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x8, [x1]
Lloh0:
	adrp	x24, _SET_KEY@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SET_KEY@GOTPAGEOFF]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x20, #8]
	ldr	w9, [x19, #4]
	add	w8, w9, w8, lsl #2
	str	w8, [x19]
	ldr	w1, [x20, #28]
	mov	w2, #4
	bl	_memcpy
	ldr	w1, [x20, #24]
	mov	w2, #4
	bl	_memcpy
	ldr	w1, [x20, #20]
	mov	w2, #4
	bl	_memcpy
	ldr	w0, [x19]
	bl	_SHARED_KEY_ENTRY
	mov	x1, x0
	add	x2, sp, #16
	mov	x0, x21
	mov	w3, #12
	bl	_rt2800_register_multiwrite
LBB0_2:
	ldr	w8, [x19]
	add	w9, w8, #7
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w0, w9, #3
	and	w9, w9, #0x3ffffff8
	sub	w8, w8, w9
	lsl	w22, w8, #2
	mov	w8, #7
	lsl	w25, w8, w22
	bl	_SHARED_KEY_MODE_ENTRY
	mov	x23, x0
	mov	x0, x21
	mov	x1, x23
	bl	_rt2800_register_read
	str	w0, [sp, #12]
	ldr	x8, [x20]
	ldr	x9, [x24]
	ldr	w10, [x20, #12]
	cmp	x8, x9
	csel	w2, w10, wzr, eq
	bfi	x22, x25, #32, #32
	add	x0, sp, #12
	mov	x1, x22
	bl	_rt2x00_set_field32
	ldr	w2, [sp, #12]
	mov	x0, x21
	mov	x1, x23
	bl	_rt2800_register_write
	ldr	w1, [x20, #16]
	ldr	w2, [x19]
	mov	x0, x21
	bl	_rt2800_config_wcid
	ldr	w1, [x19]
	ldr	w2, [x20, #8]
	mov	x0, x21
	bl	_rt2800_config_wcid_attr_bssidx
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_rt2800_config_wcid_attr_cipher
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_SET_KEY,8,3                    ; @SET_KEY
.subsections_via_symbols
