	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zd1201_set_encode
_zd1201_set_encode:                     ## @zd1201_set_encode
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %r12
	callq	_netdev_priv
	movq	%rax, %r14
	movl	4(%r12), %eax
	movq	_ZD1201_MAXKEYLEN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_2
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_18
LBB0_2:
	movq	_IW_ENCODE_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	andl	(%r12), %ebx
	movq	_ZD1201_RID_CNFDEFAULTKEYID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	subw	$1, %bx
	movw	%bx, -34(%rbp)
	jae	LBB0_5
## %bb.3:
	leaq	-34(%rbp), %rdx
	movq	%r14, %rdi
	callq	_zd1201_getconfig16
	testl	%eax, %eax
	jne	LBB0_18
## %bb.4:
	movzwl	-34(%rbp), %ebx
	jmp	LBB0_6
LBB0_5:
	movswl	%bx, %edx
	movq	%r14, %rdi
	callq	_zd1201_setconfig16
	testl	%eax, %eax
	jne	LBB0_18
LBB0_6:
	testw	%bx, %bx
	js	LBB0_1
## %bb.7:
	movq	_ZD1201_NUMKEYS@GOTPCREL(%rip), %rax
	cmpw	(%rax), %bx
	jge	LBB0_1
## %bb.8:
	movzwl	%bx, %eax
	movq	_ZD1201_RID_CNFDEFAULTKEY0@GOTPCREL(%rip), %rcx
	movswl	(%rcx), %esi
	addl	%eax, %esi
	movl	4(%r12), %ecx
	movq	%r14, %rdi
	movq	%r15, %rdx
	movl	$1, %r8d
	callq	_zd1201_setconfig
	testl	%eax, %eax
	jne	LBB0_18
## %bb.9:
	movl	4(%r12), %eax
	movq	16(%r14), %rcx
	movswq	-34(%rbp), %rdx
	movl	%eax, (%rcx,%rdx,4)
	movq	8(%r14), %rax
	movl	(%rax,%rdx,4), %edi
	movl	4(%r12), %edx
	movq	%r15, %rsi
	callq	_memcpy
	movw	$0, -34(%rbp)
	movl	(%r12), %ecx
	movq	_IW_ENCODE_DISABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%ecx, %edx
	movq	_IW_ENCODE_MODE@GOTPCREL(%rip), %rsi
	xorl	%eax, %eax
	andl	(%rsi), %edx
	sete	%al
	movw	%ax, -34(%rbp)
	movl	%eax, (%r14)
	movq	_IW_ENCODE_RESTRICTED@GOTPCREL(%rip), %rdx
	andl	(%rdx), %ecx
	testl	%ecx, (%rsi)
	je	LBB0_10
## %bb.11:
	movzwl	%ax, %eax
	orl	$2, %eax
	movw	%ax, -34(%rbp)
	movl	$1, %ecx
	jmp	LBB0_12
LBB0_10:
	xorl	%ecx, %ecx
LBB0_12:
	movl	%ecx, 4(%r14)
	movq	_ZD1201_RID_CNFWEBFLAGS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movzwl	%ax, %edx
	movq	%r14, %rdi
	callq	_zd1201_setconfig16
	testl	%eax, %eax
	jne	LBB0_18
## %bb.13:
	cmpl	$0, (%r14)
	jne	LBB0_14
## %bb.15:
	movq	_ZD1201_CNFAUTHENTICATION_OPENSYSTEM@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_14:
	movq	_ZD1201_CNFAUTHENTICATION_SHAREDKEY@GOTPCREL(%rip), %rax
LBB0_16:
	movswl	(%rax), %edx
	movw	%dx, -34(%rbp)
	movq	_ZD1201_RID_CNFAUTHENTICATION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_zd1201_setconfig16
	testl	%eax, %eax
	jne	LBB0_18
## %bb.17:
	movq	%r14, %rdi
	callq	_zd1201_mac_reset
LBB0_18:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ZD1201_MAXKEYLEN,4,2           ## @ZD1201_MAXKEYLEN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IW_ENCODE_INDEX,4,2            ## @IW_ENCODE_INDEX
	.comm	_ZD1201_RID_CNFDEFAULTKEYID,4,2 ## @ZD1201_RID_CNFDEFAULTKEYID
	.comm	_ZD1201_NUMKEYS,2,1             ## @ZD1201_NUMKEYS
	.comm	_ZD1201_RID_CNFDEFAULTKEY0,2,1  ## @ZD1201_RID_CNFDEFAULTKEY0
	.comm	_IW_ENCODE_DISABLED,4,2         ## @IW_ENCODE_DISABLED
	.comm	_IW_ENCODE_MODE,4,2             ## @IW_ENCODE_MODE
	.comm	_IW_ENCODE_RESTRICTED,4,2       ## @IW_ENCODE_RESTRICTED
	.comm	_ZD1201_RID_CNFWEBFLAGS,4,2     ## @ZD1201_RID_CNFWEBFLAGS
	.comm	_ZD1201_CNFAUTHENTICATION_SHAREDKEY,2,1 ## @ZD1201_CNFAUTHENTICATION_SHAREDKEY
	.comm	_ZD1201_CNFAUTHENTICATION_OPENSYSTEM,2,1 ## @ZD1201_CNFAUTHENTICATION_OPENSYSTEM
	.comm	_ZD1201_RID_CNFAUTHENTICATION,4,2 ## @ZD1201_RID_CNFAUTHENTICATION
	.no_dead_strip	_zd1201_set_encode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zd1201_set_encode
_zd1201_set_encode:                     ; @zd1201_set_encode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x3
	mov	x20, x2
	bl	_netdev_priv
	ldr	w8, [x20, #4]
Lloh0:
	adrp	x9, _ZD1201_MAXKEYLEN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ZD1201_MAXKEYLEN@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_2
LBB0_1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_2:
	mov	x19, x0
	ldr	w8, [x20]
Lloh6:
	adrp	x9, _IW_ENCODE_INDEX@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IW_ENCODE_INDEX@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w8, w9, w8
	sub	w22, w8, #1
	strh	w22, [sp, #14]
Lloh9:
	adrp	x9, _ZD1201_RID_CNFDEFAULTKEYID@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ZD1201_RID_CNFDEFAULTKEYID@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x9]
	and	w8, w8, #0xffff
	cbz	w8, LBB0_5
; %bb.3:
	sxth	w2, w22
	mov	x0, x19
	bl	_zd1201_setconfig16
	cbnz	w0, LBB0_15
; %bb.4:
	tbz	w22, #15, LBB0_7
	b	LBB0_1
LBB0_5:
	add	x2, sp, #14
	mov	x0, x19
	bl	_zd1201_getconfig16
	cbnz	w0, LBB0_15
; %bb.6:
	ldrh	w22, [sp, #14]
	tbnz	w22, #15, LBB0_1
LBB0_7:
Lloh12:
	adrp	x8, _ZD1201_NUMKEYS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ZD1201_NUMKEYS@GOTPAGEOFF]
Lloh14:
	ldrsh	w8, [x8]
	cmp	w8, w22, sxth
	b.le	LBB0_1
; %bb.8:
Lloh15:
	adrp	x8, _ZD1201_RID_CNFDEFAULTKEY0@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ZD1201_RID_CNFDEFAULTKEY0@GOTPAGEOFF]
Lloh17:
	ldrsh	w8, [x8]
	add	w1, w8, w22, uxth
	ldr	w3, [x20, #4]
	mov	x0, x19
	mov	x2, x21
	mov	w4, #1
	bl	_zd1201_setconfig
	cbnz	w0, LBB0_15
; %bb.9:
	ldr	w8, [x20, #4]
	ldrsh	x9, [sp, #14]
	lsl	x9, x9, #2
	ldp	x11, x10, [x19, #8]
	str	w8, [x10, x9]
	ldr	w0, [x11, x9]
	ldr	w2, [x20, #4]
	mov	x1, x21
	bl	_memcpy
	ldr	w8, [x20]
Lloh18:
	adrp	x9, _IW_ENCODE_DISABLED@GOTPAGE
Lloh19:
	ldr	x9, [x9, _IW_ENCODE_DISABLED@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _IW_ENCODE_MODE@GOTPAGE
Lloh22:
	ldr	x10, [x10, _IW_ENCODE_MODE@GOTPAGEOFF]
	and	w9, w9, w8
	ldr	w11, [x10]
	tst	w9, w11
	cset	w2, eq
	strh	w2, [sp, #14]
	str	w2, [x19]
Lloh23:
	adrp	x9, _IW_ENCODE_RESTRICTED@GOTPAGE
Lloh24:
	ldr	x9, [x9, _IW_ENCODE_RESTRICTED@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	and	w8, w9, w8
	ldr	w9, [x10]
	tst	w8, w9
	b.eq	LBB0_11
; %bb.10:
	orr	w2, w2, #0x2
	strh	w2, [sp, #14]
	mov	w8, #1
	b	LBB0_12
LBB0_11:
	mov	w8, #0
LBB0_12:
	str	w8, [x19, #4]
Lloh26:
	adrp	x8, _ZD1201_RID_CNFWEBFLAGS@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ZD1201_RID_CNFWEBFLAGS@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_zd1201_setconfig16
	cbnz	w0, LBB0_15
; %bb.13:
	ldr	w8, [x19]
Lloh29:
	adrp	x9, _ZD1201_CNFAUTHENTICATION_OPENSYSTEM@GOTPAGE
Lloh30:
	ldr	x9, [x9, _ZD1201_CNFAUTHENTICATION_OPENSYSTEM@GOTPAGEOFF]
Lloh31:
	adrp	x10, _ZD1201_CNFAUTHENTICATION_SHAREDKEY@GOTPAGE
Lloh32:
	ldr	x10, [x10, _ZD1201_CNFAUTHENTICATION_SHAREDKEY@GOTPAGEOFF]
	cmp	w8, #0
	csel	x8, x9, x10, eq
	ldrsh	w2, [x8]
	strh	w2, [sp, #14]
Lloh33:
	adrp	x8, _ZD1201_RID_CNFAUTHENTICATION@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ZD1201_RID_CNFAUTHENTICATION@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_zd1201_setconfig16
	cbnz	w0, LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_zd1201_mac_reset
LBB0_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_ZD1201_MAXKEYLEN,4,2           ; @ZD1201_MAXKEYLEN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IW_ENCODE_INDEX,4,2            ; @IW_ENCODE_INDEX
	.comm	_ZD1201_RID_CNFDEFAULTKEYID,4,2 ; @ZD1201_RID_CNFDEFAULTKEYID
	.comm	_ZD1201_NUMKEYS,2,1             ; @ZD1201_NUMKEYS
	.comm	_ZD1201_RID_CNFDEFAULTKEY0,2,1  ; @ZD1201_RID_CNFDEFAULTKEY0
	.comm	_IW_ENCODE_DISABLED,4,2         ; @IW_ENCODE_DISABLED
	.comm	_IW_ENCODE_MODE,4,2             ; @IW_ENCODE_MODE
	.comm	_IW_ENCODE_RESTRICTED,4,2       ; @IW_ENCODE_RESTRICTED
	.comm	_ZD1201_RID_CNFWEBFLAGS,4,2     ; @ZD1201_RID_CNFWEBFLAGS
	.comm	_ZD1201_CNFAUTHENTICATION_SHAREDKEY,2,1 ; @ZD1201_CNFAUTHENTICATION_SHAREDKEY
	.comm	_ZD1201_CNFAUTHENTICATION_OPENSYSTEM,2,1 ; @ZD1201_CNFAUTHENTICATION_OPENSYSTEM
	.comm	_ZD1201_RID_CNFAUTHENTICATION,4,2 ; @ZD1201_RID_CNFAUTHENTICATION
	.no_dead_strip	_zd1201_set_encode
.subsections_via_symbols
