	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x02_mac_shared_key_setup   ## -- Begin function mt76x02_mac_shared_key_setup
	.p2align	4, 0x90
_mt76x02_mac_shared_key_setup:          ## @mt76x02_mac_shared_key_setup
	.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	$152, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	-176(%rbp), %rsi
	movq	%rcx, %rdi
	callq	_mt76x02_mac_get_key_info
	movl	%eax, %r13d
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.1:
	movq	_MT_CIPHER_NONE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_3
## %bb.2:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_4
LBB0_3:
	movl	%r12d, %edi
	callq	_MT_SKEY_MODE
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mt76_rr
	movl	%eax, %ebx
	movq	_MT_SKEY_MODE_MASK@GOTPCREL(%rip), %rax
	movq	%r14, -184(%rbp)                ## 8-byte Spill
	movl	(%rax), %r14d
	movl	%r12d, %edi
	movl	%r15d, %esi
	callq	_MT_SKEY_MODE_SHIFT
	movl	%eax, %ecx
	shll	%cl, %r14d
	notl	%r14d
	andl	%ebx, %r14d
	movl	%r12d, %edi
	movl	%r15d, %esi
	callq	_MT_SKEY_MODE_SHIFT
	movl	%eax, %ecx
	shll	%cl, %r13d
	orl	%r14d, %r13d
	movl	%r12d, %edi
	callq	_MT_SKEY_MODE
	movq	-184(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	%r13d, %edx
	callq	_mt76_wr
	movl	%r12d, %edi
	movl	%r15d, %esi
	callq	_MT_SKEY
	leaq	-176(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	$128, %ecx
	callq	_mt76_wr_copy
	xorl	%eax, %eax
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_6
## %bb.5:
	addq	$152, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_CIPHER_NONE,4,2             ## @MT_CIPHER_NONE
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_MT_SKEY_MODE_MASK,4,2          ## @MT_SKEY_MODE_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x02_mac_shared_key_setup   ; -- Begin function mt76x02_mac_shared_key_setup
	.p2align	2
_mt76x02_mac_shared_key_setup:          ; @mt76x02_mac_shared_key_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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	x23, x3
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	add	x1, sp, #8
	mov	x0, x3
	bl	_mt76x02_mac_get_key_info
	mov	x22, x0
	cbz	x23, LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _MT_CIPHER_NONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_CIPHER_NONE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_3:
	mov	x0, x21
	bl	_MT_SKEY_MODE
	mov	x1, x0
	mov	x0, x19
	bl	_mt76_rr
	mov	x23, x0
Lloh9:
	adrp	x8, _MT_SKEY_MODE_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MT_SKEY_MODE_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w24, [x8]
	mov	x0, x21
	mov	x1, x20
	bl	_MT_SKEY_MODE_SHIFT
	lsl	w8, w24, w0
	bic	w23, w23, w8
	mov	x0, x21
	mov	x1, x20
	bl	_MT_SKEY_MODE_SHIFT
	lsl	w8, w22, w0
	orr	w22, w23, w8
	mov	x0, x21
	bl	_MT_SKEY_MODE
	mov	x1, x0
	mov	x0, x19
	mov	x2, x22
	bl	_mt76_wr
	mov	x0, x21
	mov	x1, x20
	bl	_MT_SKEY
	mov	x1, x0
	add	x2, sp, #8
	mov	x0, x19
	mov	w3, #128
	bl	_mt76_wr_copy
	mov	w0, #0
LBB0_4:
	ldur	x8, [x29, #-56]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MT_CIPHER_NONE,4,2             ; @MT_CIPHER_NONE
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_MT_SKEY_MODE_MASK,4,2          ; @MT_SKEY_MODE_MASK
.subsections_via_symbols
