	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_set_encode
_atmel_set_encode:                      ## @atmel_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %r14
	callq	_netdev_priv
	movq	%rax, %rbx
	movl	(%r14), %eax
	movl	4(%r14), %esi
	movq	_IW_ENCODE_INDEX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%esi, %edx
	leal	-1(%rdx), %ecx
	testl	%eax, %eax
	jle	LBB0_3
## %bb.1:
	cmpl	$13, %eax
	jbe	LBB0_5
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_25
LBB0_3:
	cmpl	$3, %ecx
	ja	LBB0_13
## %bb.4:
	movl	%ecx, (%rbx)
	jmp	LBB0_16
LBB0_5:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %r12d
	addl	$-5, %edx
	movl	%r12d, %r13d
	cmpl	$-4, %edx
	jb	LBB0_7
## %bb.6:
	movl	%ecx, (%rbx)
	movl	%ecx, %r13d
LBB0_7:
	xorl	%ecx, %ecx
	cmpl	$6, %eax
	setae	%cl
	movq	8(%rbx), %rax
	movslq	%r13d, %r15
	leal	5(,%rcx,8), %ecx
	movl	%ecx, (%rax,%r15,4)
	movq	_IW_ENCODE_NOKEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r14)
	jne	LBB0_9
## %bb.8:
	movq	40(%rbx), %rax
	movl	(%rax,%r15,4), %edi
	xorl	%esi, %esi
	movl	$13, %edx
	callq	_memset
	movq	40(%rbx), %rax
	movl	(%rax,%r15,4), %edi
	movl	(%r14), %edx
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_memcpy
LBB0_9:
	cmpl	%r12d, %r13d
	jne	LBB0_16
## %bb.10:
	movslq	%r12d, %rax
	movq	8(%rbx), %rcx
	cmpl	$0, (%rcx,%rax,4)
	jle	LBB0_16
## %bb.11:
	movabsq	$4294967297, %rdx               ## imm = 0x100000001
	movq	%rdx, 16(%rbx)
	cmpl	$6, (%rcx,%rax,4)
	jl	LBB0_15
## %bb.12:
	movl	$2, 24(%rbx)
	jmp	LBB0_16
LBB0_13:
	movq	_IW_ENCODE_MODE@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	jne	LBB0_16
	jmp	LBB0_2
LBB0_15:
	movl	$1, 24(%rbx)
LBB0_16:
	movl	4(%r14), %eax
	movq	_IW_ENCODE_DISABLED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_18
## %bb.17:
	movl	$0, 16(%rbx)
	movl	$0, 24(%rbx)
	movq	_CIPHER_SUITE_NONE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 32(%rbx)
	jmp	LBB0_21
LBB0_18:
	movl	$1, 16(%rbx)
	movq	8(%rbx), %rcx
	movslq	(%rbx), %rdx
	cmpl	$6, (%rcx,%rdx,4)
	jl	LBB0_20
## %bb.19:
	movq	_CIPHER_SUITE_WEP_128@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 32(%rbx)
	movl	$2, 24(%rbx)
	jmp	LBB0_21
LBB0_20:
	movq	_CIPHER_SUITE_WEP_64@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 32(%rbx)
	movl	$1, 24(%rbx)
LBB0_21:
	movq	_IW_ENCODE_RESTRICTED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_23
## %bb.22:
	movl	$1, 20(%rbx)
LBB0_23:
	movq	_IW_ENCODE_OPEN@GOTPCREL(%rip), %rdx
	movq	_EINPROGRESS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rdx)
	je	LBB0_25
## %bb.24:
	movl	$0, 20(%rbx)
LBB0_25:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IW_ENCODE_INDEX,4,2            ## @IW_ENCODE_INDEX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IW_ENCODE_NOKEY,4,2            ## @IW_ENCODE_NOKEY
	.comm	_CIPHER_SUITE_WEP_128,8,3       ## @CIPHER_SUITE_WEP_128
	.comm	_CIPHER_SUITE_WEP_64,8,3        ## @CIPHER_SUITE_WEP_64
	.comm	_IW_ENCODE_MODE,4,2             ## @IW_ENCODE_MODE
	.comm	_IW_ENCODE_DISABLED,4,2         ## @IW_ENCODE_DISABLED
	.comm	_CIPHER_SUITE_NONE,8,3          ## @CIPHER_SUITE_NONE
	.comm	_IW_ENCODE_RESTRICTED,4,2       ## @IW_ENCODE_RESTRICTED
	.comm	_IW_ENCODE_OPEN,4,2             ## @IW_ENCODE_OPEN
	.comm	_EINPROGRESS,4,2                ## @EINPROGRESS
	.no_dead_strip	_atmel_set_encode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_set_encode
_atmel_set_encode:                      ; @atmel_set_encode
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x3
	mov	x20, x2
	bl	_netdev_priv
	mov	x19, x0
	ldp	w8, w10, [x20]
Lloh0:
	adrp	x9, _IW_ENCODE_INDEX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IW_ENCODE_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w11, w9, w10
	sub	w9, w11, #1
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	cmp	w8, #13
	b.ls	LBB0_5
LBB0_2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_27
LBB0_3:
	cmp	w9, #3
	b.hi	LBB0_13
; %bb.4:
	str	w9, [x19]
	b	LBB0_16
LBB0_5:
	ldr	w22, [x19]
	sub	w11, w11, #5
	mov	x10, x22
	cmn	w11, #4
	b.lo	LBB0_7
; %bb.6:
	str	w9, [x19]
	mov	x10, x9
LBB0_7:
	ldr	x9, [x19, #8]
	mov	w11, #5
	mov	w12, #13
	cmp	w8, #5
	csel	w8, w12, w11, hi
	str	w8, [x9, w10, sxtw #2]
	sxtw	x23, w10
	ldr	w8, [x20, #4]
Lloh5:
	adrp	x9, _IW_ENCODE_NOKEY@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IW_ENCODE_NOKEY@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_9
; %bb.8:
	ldr	x8, [x19, #40]
	lsl	x24, x23, #2
	ldr	w0, [x8, x24]
	mov	w1, #0
	mov	w2, #13
	bl	_memset
	ldr	x8, [x19, #40]
	ldr	w0, [x8, x24]
	ldr	w2, [x20]
	mov	x1, x21
	bl	_memcpy
LBB0_9:
	cmp	w23, w22
	b.ne	LBB0_16
; %bb.10:
	sxtw	x8, w22
	ldr	x9, [x19, #8]
	ldr	w10, [x9, x8, lsl #2]
	cmp	w10, #1
	b.lt	LBB0_16
; %bb.11:
	movi.2s	v0, #1
	str	d0, [x19, #16]
	ldr	w8, [x9, x8, lsl #2]
	cmp	w8, #6
	b.lt	LBB0_14
; %bb.12:
	mov	w8, #2
	b	LBB0_15
LBB0_13:
Lloh8:
	adrp	x8, _IW_ENCODE_MODE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IW_ENCODE_MODE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w10
	b.ne	LBB0_16
	b	LBB0_2
LBB0_14:
	mov	w8, #1
LBB0_15:
	str	w8, [x19, #24]
LBB0_16:
	ldr	w8, [x20, #4]
Lloh11:
	adrp	x9, _IW_ENCODE_DISABLED@GOTPAGE
Lloh12:
	ldr	x9, [x9, _IW_ENCODE_DISABLED@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.17:
	str	wzr, [x19, #16]
	str	wzr, [x19, #24]
Lloh14:
	adrp	x9, _CIPHER_SUITE_NONE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CIPHER_SUITE_NONE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	str	x9, [x19, #32]
	b	LBB0_22
LBB0_18:
	mov	w9, #1
	str	w9, [x19, #16]
	ldr	x10, [x19, #8]
	ldrsw	x11, [x19]
	ldr	w10, [x10, x11, lsl #2]
	cmp	w10, #6
	b.lt	LBB0_20
; %bb.19:
Lloh17:
	adrp	x9, _CIPHER_SUITE_WEP_128@GOTPAGE
Lloh18:
	ldr	x9, [x9, _CIPHER_SUITE_WEP_128@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	str	x9, [x19, #32]
	mov	w9, #2
	b	LBB0_21
LBB0_20:
Lloh20:
	adrp	x10, _CIPHER_SUITE_WEP_64@GOTPAGE
Lloh21:
	ldr	x10, [x10, _CIPHER_SUITE_WEP_64@GOTPAGEOFF]
Lloh22:
	ldr	x10, [x10]
	str	x10, [x19, #32]
LBB0_21:
	str	w9, [x19, #24]
LBB0_22:
Lloh23:
	adrp	x9, _IW_ENCODE_RESTRICTED@GOTPAGE
Lloh24:
	ldr	x9, [x9, _IW_ENCODE_RESTRICTED@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_24
; %bb.23:
	mov	w9, #1
	str	w9, [x19, #20]
LBB0_24:
Lloh26:
	adrp	x9, _IW_ENCODE_OPEN@GOTPAGE
Lloh27:
	ldr	x9, [x9, _IW_ENCODE_OPEN@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_26
; %bb.25:
	str	wzr, [x19, #20]
LBB0_26:
Lloh29:
	adrp	x8, _EINPROGRESS@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EINPROGRESS@GOTPAGEOFF]
LBB0_27:
	ldr	w8, [x8]
	neg	w0, w8
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_IW_ENCODE_INDEX,4,2            ; @IW_ENCODE_INDEX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IW_ENCODE_NOKEY,4,2            ; @IW_ENCODE_NOKEY
	.comm	_CIPHER_SUITE_WEP_128,8,3       ; @CIPHER_SUITE_WEP_128
	.comm	_CIPHER_SUITE_WEP_64,8,3        ; @CIPHER_SUITE_WEP_64
	.comm	_IW_ENCODE_MODE,4,2             ; @IW_ENCODE_MODE
	.comm	_IW_ENCODE_DISABLED,4,2         ; @IW_ENCODE_DISABLED
	.comm	_CIPHER_SUITE_NONE,8,3          ; @CIPHER_SUITE_NONE
	.comm	_IW_ENCODE_RESTRICTED,4,2       ; @IW_ENCODE_RESTRICTED
	.comm	_IW_ENCODE_OPEN,4,2             ; @IW_ENCODE_OPEN
	.comm	_EINPROGRESS,4,2                ; @EINPROGRESS
	.no_dead_strip	_atmel_set_encode
.subsections_via_symbols
