	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt7603_wtbl_set_key            ## -- Begin function mt7603_wtbl_set_key
	.p2align	4, 0x90
_mt7603_wtbl_set_key:                   ## @mt7603_wtbl_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	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	%esi, %edi
	callq	_mt7603_wtbl3_addr
	movq	%rax, %r13
	leaq	-176(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_mt7603_mac_get_key_info
	movl	%eax, %r12d
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.1:
	movq	_MT_CIPHER_NONE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_3
## %bb.2:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_3:
	movl	$128, %ecx
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.4:
	movq	_MT_CIPHER_WEP40@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	je	LBB0_6
## %bb.5:
	movq	_MT_CIPHER_WEP104@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_7
LBB0_6:
	movslq	(%rbx), %rax
	shlq	$4, %rax
	addq	%rax, %r13
	movl	$16, %ecx
LBB0_7:
	leaq	-176(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_mt76_wr_copy
	movl	%r15d, %edi
	callq	_mt7603_wtbl1_addr
	movq	%rax, %r15
	leaq	8(%rax), %rsi
	movq	_MT_WTBL1_W2_KEY_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%r12d, %ecx
	callq	_mt76_rmw_field
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.8:
	movq	_MT_WTBL1_W0_KEY_IDX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%rbx), %ecx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_mt76_rmw_field
LBB0_9:
	xorl	%ecx, %ecx
	testq	%rbx, %rbx
	setne	%cl
	movq	_MT_WTBL1_W0_RX_KEY_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_mt76_rmw_field
	xorl	%eax, %eax
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_12
## %bb.11:
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_CIPHER_NONE,4,2             ## @MT_CIPHER_NONE
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_MT_CIPHER_WEP40,4,2            ## @MT_CIPHER_WEP40
	.comm	_MT_CIPHER_WEP104,4,2           ## @MT_CIPHER_WEP104
	.comm	_MT_WTBL1_W2_KEY_TYPE,4,2       ## @MT_WTBL1_W2_KEY_TYPE
	.comm	_MT_WTBL1_W0_KEY_IDX,4,2        ## @MT_WTBL1_W0_KEY_IDX
	.comm	_MT_WTBL1_W0_RX_KEY_VALID,4,2   ## @MT_WTBL1_W0_RX_KEY_VALID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt7603_wtbl_set_key            ; -- Begin function mt7603_wtbl_set_key
	.p2align	2
_mt7603_wtbl_set_key:                   ; @mt7603_wtbl_set_key
	.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	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]
	mov	x0, x1
	bl	_mt7603_wtbl3_addr
	mov	x23, x0
	add	x1, sp, #8
	mov	x0, x20
	bl	_mt7603_mac_get_key_info
	mov	x22, x0
	cbz	x20, 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_10
LBB0_3:
	cbz	x20, LBB0_6
; %bb.4:
Lloh9:
	adrp	x8, _MT_CIPHER_WEP40@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MT_CIPHER_WEP40@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _MT_CIPHER_WEP104@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MT_CIPHER_WEP104@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w22, w8
	ccmp	w22, w9, #4, ne
	b.ne	LBB0_6
; %bb.5:
	ldrsw	x8, [x20]
	add	x23, x23, x8, lsl #4
	mov	w3, #16
	b	LBB0_7
LBB0_6:
	mov	w3, #128
LBB0_7:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x23
	bl	_mt76_wr_copy
	mov	x0, x21
	bl	_mt7603_wtbl1_addr
	mov	x21, x0
	add	x1, x0, #8
Lloh15:
	adrp	x8, _MT_WTBL1_W2_KEY_TYPE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MT_WTBL1_W2_KEY_TYPE@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x22
	bl	_mt76_rmw_field
	cbz	x20, LBB0_9
; %bb.8:
Lloh18:
	adrp	x8, _MT_WTBL1_W0_KEY_IDX@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MT_WTBL1_W0_KEY_IDX@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	ldr	w3, [x20]
	mov	x0, x19
	mov	x1, x21
	bl	_mt76_rmw_field
LBB0_9:
	cmp	x20, #0
	cset	w3, ne
Lloh21:
	adrp	x8, _MT_WTBL1_W0_RX_KEY_VALID@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MT_WTBL1_W0_RX_KEY_VALID@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_mt76_rmw_field
	mov	w0, #0
LBB0_10:
	ldur	x8, [x29, #-56]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	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_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.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	_MT_CIPHER_NONE,4,2             ; @MT_CIPHER_NONE
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_MT_CIPHER_WEP40,4,2            ; @MT_CIPHER_WEP40
	.comm	_MT_CIPHER_WEP104,4,2           ; @MT_CIPHER_WEP104
	.comm	_MT_WTBL1_W2_KEY_TYPE,4,2       ; @MT_WTBL1_W2_KEY_TYPE
	.comm	_MT_WTBL1_W0_KEY_IDX,4,2        ; @MT_WTBL1_W0_KEY_IDX
	.comm	_MT_WTBL1_W0_RX_KEY_VALID,4,2   ; @MT_WTBL1_W0_RX_KEY_VALID
.subsections_via_symbols
