	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x02_set_key                ## -- Begin function mt76x02_set_key
	.p2align	4, 0x90
_mt76x02_set_key:                       ## @mt76x02_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	%rcx, %rbx
	movl	4(%r8), %eax
	movl	%eax, %ecx
	andl	$-4, %ecx
	cmpl	$128, %ecx
	jne	LBB0_1
## %bb.3:
	movq	%r8, %r13
	movq	%rdx, %r15
	movl	%esi, %r12d
	movq	(%rdi), %r14
	movq	8(%rdx), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	(%rdx), %rcx
	movq	_NL80211_IFTYPE_ADHOC@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	sete	%dl
	movq	_NL80211_IFTYPE_MESH_POINT@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rcx
	movl	(%r8), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	sete	%cl
	orb	%dl, %cl
	cmpb	$1, %cl
	jne	LBB0_6
## %bb.4:
	andl	$-2, %eax
	cmpl	$130, %eax
	jne	LBB0_6
## %bb.5:
	movq	_IEEE80211_KEY_FLAG_PAIRWISE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r13)
	je	LBB0_1
LBB0_6:
	movq	%r14, %rdi
	callq	_mt76_is_usb
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	(%r15), %rax
	movq	_NL80211_IFTYPE_AP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:
	movq	_IEEE80211_KEY_FLAG_PAIRWISE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r13)
	je	LBB0_1
LBB0_9:
	testq	%rbx, %rbx
	je	LBB0_10
## %bb.11:
	movq	(%rbx), %r15
	jmp	LBB0_12
LBB0_1:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_2:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	xorl	%r15d, %r15d
LBB0_12:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	4(%rax), %rbx
	testq	%r15, %r15
	cmovneq	%r15, %rbx
	movq	_SET_KEY@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_15
## %bb.13:
	movl	8(%rbx), %eax
	movl	%eax, 12(%r13)
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, (%rbx)
	movl	8(%r13), %eax
	movq	_IEEE80211_KEY_FLAG_RX_MGMT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_19
## %bb.14:
	movq	_IEEE80211_KEY_FLAG_SW_MGMT_TX@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 8(%r13)
	movl	$1, %eax
	jmp	LBB0_18
LBB0_15:
	xorl	%eax, %eax
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	cmpl	(%rbx), %r12d
	jne	LBB0_16
## %bb.17:
	movl	$-1, (%rbx)
	xorl	%r13d, %r13d
LBB0_18:
	movl	%eax, 4(%rbx)
	jmp	LBB0_19
LBB0_16:
	xorl	%r13d, %r13d
LBB0_19:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	_mt76_wcid_key_setup
	testq	%r15, %r15
	je	LBB0_20
## %bb.24:
	movl	8(%r15), %esi
	movq	%r14, %rdi
	movq	%r13, %rdx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mt76x02_mac_wcid_set_key       ## TAILCALL
LBB0_20:
	testq	%r13, %r13
	jne	LBB0_22
## %bb.21:
	cmpl	%r12d, (%rbx)
	jne	LBB0_23
LBB0_22:
	movl	8(%rbx), %esi
	movq	%r14, %rdi
	movq	%r13, %rdx
	callq	_mt76x02_mac_wcid_set_key
	testl	%eax, %eax
	jne	LBB0_2
LBB0_23:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	movq	%r13, %rcx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mt76x02_mac_shared_key_setup   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_NL80211_IFTYPE_ADHOC,8,3       ## @NL80211_IFTYPE_ADHOC
	.comm	_NL80211_IFTYPE_MESH_POINT,8,3  ## @NL80211_IFTYPE_MESH_POINT
	.comm	_IEEE80211_KEY_FLAG_PAIRWISE,4,2 ## @IEEE80211_KEY_FLAG_PAIRWISE
	.comm	_NL80211_IFTYPE_AP,8,3          ## @NL80211_IFTYPE_AP
	.comm	_SET_KEY,4,2                    ## @SET_KEY
	.comm	_IEEE80211_KEY_FLAG_RX_MGMT,4,2 ## @IEEE80211_KEY_FLAG_RX_MGMT
	.comm	_IEEE80211_KEY_FLAG_SW_MGMT_TX,4,2 ## @IEEE80211_KEY_FLAG_SW_MGMT_TX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x02_set_key                ; -- Begin function mt76x02_set_key
	.p2align	2
_mt76x02_set_key:                       ; @mt76x02_set_key
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	w8, [x4, #4]
	and	w9, w8, #0xfffffffc
	cmp	w9, #128
	b.ne	LBB0_9
; %bb.1:
	mov	x19, x4
	mov	x23, x3
	mov	x24, x2
	mov	x22, x1
	ldr	x20, [x0]
	ldr	w21, [x4]
	ldp	x9, x25, [x2]
Lloh0:
	adrp	x10, _NL80211_IFTYPE_ADHOC@GOTPAGE
Lloh1:
	ldr	x10, [x10, _NL80211_IFTYPE_ADHOC@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
Lloh3:
	adrp	x11, _NL80211_IFTYPE_MESH_POINT@GOTPAGE
Lloh4:
	ldr	x11, [x11, _NL80211_IFTYPE_MESH_POINT@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
	cmp	x9, x11
	ccmp	x9, x10, #4, ne
	b.ne	LBB0_4
; %bb.2:
	and	w8, w8, #0xfffffffe
	cmp	w8, #130
	b.ne	LBB0_4
; %bb.3:
	ldr	w8, [x19, #8]
Lloh6:
	adrp	x9, _IEEE80211_KEY_FLAG_PAIRWISE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IEEE80211_KEY_FLAG_PAIRWISE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
LBB0_4:
	mov	x0, x20
	bl	_mt76_is_usb
	cbz	x0, LBB0_7
; %bb.5:
	ldr	x8, [x24]
Lloh9:
	adrp	x9, _NL80211_IFTYPE_AP@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NL80211_IFTYPE_AP@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	ldr	w8, [x19, #8]
Lloh12:
	adrp	x9, _IEEE80211_KEY_FLAG_PAIRWISE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _IEEE80211_KEY_FLAG_PAIRWISE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
LBB0_7:
	cbz	x23, LBB0_11
; %bb.8:
	ldr	x24, [x23]
	b	LBB0_12
LBB0_9:
Lloh15:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_11:
	mov	x24, #0
LBB0_12:
	add	x8, x25, #4
	cmp	x24, #0
	csel	x23, x8, x24, eq
Lloh18:
	adrp	x8, _SET_KEY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SET_KEY@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_15
; %bb.13:
	ldr	w8, [x23, #8]
	str	w8, [x19, #12]
	str	w21, [x23]
	ldr	w8, [x19, #8]
Lloh21:
	adrp	x9, _IEEE80211_KEY_FLAG_RX_MGMT@GOTPAGE
Lloh22:
	ldr	x9, [x9, _IEEE80211_KEY_FLAG_RX_MGMT@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.14:
Lloh24:
	adrp	x9, _IEEE80211_KEY_FLAG_SW_MGMT_TX@GOTPAGE
Lloh25:
	ldr	x9, [x9, _IEEE80211_KEY_FLAG_SW_MGMT_TX@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #8]
	mov	w8, #1
	b	LBB0_17
LBB0_15:
	ldr	w8, [x23]
	cmp	w21, w8
	b.ne	LBB0_18
; %bb.16:
	mov	w8, #0
	mov	x19, #0
	mov	w9, #-1
	str	w9, [x23]
LBB0_17:
	str	w8, [x23, #4]
	b	LBB0_19
LBB0_18:
	mov	x19, #0
LBB0_19:
	mov	x0, x20
	mov	x1, x23
	mov	x2, x19
	bl	_mt76_wcid_key_setup
	cbz	x24, LBB0_21
; %bb.20:
	ldr	w1, [x24, #8]
	mov	x0, x20
	mov	x2, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_mt76x02_mac_wcid_set_key
LBB0_21:
	cbnz	x19, LBB0_23
; %bb.22:
	ldr	w8, [x23]
	cmp	w8, w21
	b.ne	LBB0_24
LBB0_23:
	ldr	w1, [x23, #8]
	mov	x0, x20
	mov	x2, x19
	bl	_mt76x02_mac_wcid_set_key
	cbnz	w0, LBB0_10
LBB0_24:
	ldr	w1, [x25]
	mov	x0, x20
	mov	x2, x21
	mov	x3, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_mt76x02_mac_shared_key_setup
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_NL80211_IFTYPE_ADHOC,8,3       ; @NL80211_IFTYPE_ADHOC
	.comm	_NL80211_IFTYPE_MESH_POINT,8,3  ; @NL80211_IFTYPE_MESH_POINT
	.comm	_IEEE80211_KEY_FLAG_PAIRWISE,4,2 ; @IEEE80211_KEY_FLAG_PAIRWISE
	.comm	_NL80211_IFTYPE_AP,8,3          ; @NL80211_IFTYPE_AP
	.comm	_SET_KEY,4,2                    ; @SET_KEY
	.comm	_IEEE80211_KEY_FLAG_RX_MGMT,4,2 ; @IEEE80211_KEY_FLAG_RX_MGMT
	.comm	_IEEE80211_KEY_FLAG_SW_MGMT_TX,4,2 ; @IEEE80211_KEY_FLAG_SW_MGMT_TX
.subsections_via_symbols
