	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cfg80211_wext_siwencode
_cfg80211_wext_siwencode:               ## @cfg80211_wext_siwencode
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movq	%rdx, %r13
	movq	%rdi, %r14
	movq	(%rdi), %r12
	movl	24(%r12), %edi
	callq	_wiphy_to_dev
	movq	%rax, %r15
	movq	(%r12), %rax
	movq	_NL80211_IFTYPE_STATION@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.1:
	movq	_NL80211_IFTYPE_ADHOC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
LBB0_4:
	movq	(%r15), %rax
	cmpl	$0, 8(%rax)
	je	LBB0_2
## %bb.5:
	cmpl	$0, 4(%rax)
	je	LBB0_2
## %bb.6:
	cmpl	$0, (%rax)
	je	LBB0_2
## %bb.7:
	movl	(%r13), %edx
	movq	_IW_ENCODE_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	%edx, %ecx
	je	LBB0_8
## %bb.9:
	leal	-5(%rcx), %eax
	cmpl	$-5, %eax
	ja	LBB0_11
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_25:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	8(%r12), %eax
	xorl	%ecx, %ecx
	testl	%eax, %eax
	cmovgl	%eax, %ecx
	jmp	LBB0_12
LBB0_11:
	decl	%ecx
LBB0_12:
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	_IW_ENCODE_DISABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %eax
	testl	%edx, %ecx
	jne	LBB0_18
## %bb.13:
	xorl	%eax, %eax
	cmpl	$0, 4(%r13)
	je	LBB0_14
LBB0_18:
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	leaq	-80(%rbp), %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	%rbx, -80(%rbp)
	movl	4(%r13), %eax
	movl	%eax, -72(%rbp)
	cmpl	$5, %eax
	je	LBB0_19
## %bb.20:
	cmpl	$13, %eax
	jne	LBB0_23
## %bb.21:
	movq	_WLAN_CIPHER_SUITE_WEP104@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_19:
	movq	_WLAN_CIPHER_SUITE_WEP40@GOTPCREL(%rip), %rax
LBB0_22:
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
	jmp	LBB0_24
LBB0_23:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, -56(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_10
LBB0_24:
	xorl	%r9d, %r9d
	cmpl	$-1, 8(%r12)
	sete	%r9b
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	-60(%rbp), %r8d                 ## 4-byte Reload
	leaq	-80(%rbp), %rax
	pushq	%rax
	pushq	-48(%rbp)                       ## 8-byte Folded Reload
	callq	_cfg80211_set_encryption
	addq	$16, %rsp
	movl	%eax, %ebx
	jmp	LBB0_25
LBB0_14:
	movq	%r12, %rdi
	callq	_wdev_lock
	cmpq	$0, 16(%r12)
	je	LBB0_16
## %bb.15:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movl	$1, %ecx
	movl	$1, %r8d
	callq	_rdev_set_default_key
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_17
LBB0_16:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, 8(%r12)
	xorl	%ebx, %ebx
LBB0_17:
	movq	%r12, %rdi
	callq	_wdev_unlock
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.comm	_NL80211_IFTYPE_STATION,8,3     ## @NL80211_IFTYPE_STATION
	.comm	_NL80211_IFTYPE_ADHOC,8,3       ## @NL80211_IFTYPE_ADHOC
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_IW_ENCODE_INDEX,4,2            ## @IW_ENCODE_INDEX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IW_ENCODE_DISABLED,4,2         ## @IW_ENCODE_DISABLED
	.comm	_WLAN_CIPHER_SUITE_WEP40,4,2    ## @WLAN_CIPHER_SUITE_WEP40
	.comm	_WLAN_CIPHER_SUITE_WEP104,4,2   ## @WLAN_CIPHER_SUITE_WEP104
	.no_dead_strip	_cfg80211_wext_siwencode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cfg80211_wext_siwencode
_cfg80211_wext_siwencode:               ; @cfg80211_wext_siwencode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x24, x3
	mov	x23, x2
	mov	x20, x0
	ldr	x19, [x0]
	ldr	w0, [x19, #24]
	bl	_wiphy_to_dev
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _NL80211_IFTYPE_STATION@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NL80211_IFTYPE_STATION@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _NL80211_IFTYPE_ADHOC@GOTPAGE
Lloh4:
	ldr	x10, [x10, _NL80211_IFTYPE_ADHOC@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_7
; %bb.1:
	mov	x21, x0
	ldr	x8, [x0]
	ldr	w9, [x8, #8]
	cbz	w9, LBB0_7
; %bb.2:
	ldr	w9, [x8, #4]
	cbz	w9, LBB0_7
; %bb.3:
	ldr	w8, [x8]
	cbz	w8, LBB0_7
; %bb.4:
	ldr	w8, [x23]
Lloh6:
	adrp	x9, _IW_ENCODE_INDEX@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IW_ENCODE_INDEX@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	ands	w9, w9, w8
	b.eq	LBB0_10
; %bb.5:
	sub	w10, w9, #5
	cmn	w10, #5
	b.hi	LBB0_11
LBB0_6:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh11:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_10:
	ldr	w9, [x19, #8]
	cmp	w9, #0
	csel	w22, w9, wzr, gt
	b	LBB0_12
LBB0_11:
	sub	w22, w9, #1
LBB0_12:
Lloh13:
	adrp	x9, _IW_ENCODE_DISABLED@GOTPAGE
Lloh14:
	ldr	x9, [x9, _IW_ENCODE_DISABLED@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	ands	w26, w9, w8
	b.eq	LBB0_14
; %bb.13:
	mov	w25, #1
	b	LBB0_16
LBB0_14:
	ldr	w8, [x23, #4]
	cbz	w8, LBB0_23
; %bb.15:
	mov	w25, #0
LBB0_16:
	mov	x0, sp
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	str	x24, [sp]
	ldr	w8, [x23, #4]
	str	w8, [sp, #8]
	cmp	w8, #5
	b.eq	LBB0_19
; %bb.17:
	cmp	w8, #13
	b.ne	LBB0_21
; %bb.18:
Lloh16:
	adrp	x8, _WLAN_CIPHER_SUITE_WEP104@GOTPAGE
Lloh17:
	ldr	x8, [x8, _WLAN_CIPHER_SUITE_WEP104@GOTPAGEOFF]
	b	LBB0_20
LBB0_19:
Lloh18:
	adrp	x8, _WLAN_CIPHER_SUITE_WEP40@GOTPAGE
Lloh19:
	ldr	x8, [x8, _WLAN_CIPHER_SUITE_WEP40@GOTPAGEOFF]
LBB0_20:
	ldr	w8, [x8]
	str	w8, [sp, #12]
	b	LBB0_22
LBB0_21:
	cbz	w26, LBB0_6
LBB0_22:
	ldr	w8, [x19, #8]
	cmn	w8, #1
	cset	w5, eq
	mov	x7, sp
	mov	x0, x21
	mov	x1, x20
	mov	w2, #0
	mov	x3, #0
	mov	x4, x25
	mov	x6, x22
	bl	_cfg80211_set_encryption
	mov	x20, x0
	b	LBB0_9
LBB0_23:
	mov	x0, x19
	bl	_wdev_lock
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_25
; %bb.24:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	mov	w3, #1
	mov	w4, #1
	bl	_rdev_set_default_key
	mov	x20, x0
	cbnz	w0, LBB0_26
LBB0_25:
	mov	w20, #0
	str	w22, [x19, #8]
LBB0_26:
	mov	x0, x19
	bl	_wdev_unlock
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_NL80211_IFTYPE_STATION,8,3     ; @NL80211_IFTYPE_STATION
	.comm	_NL80211_IFTYPE_ADHOC,8,3       ; @NL80211_IFTYPE_ADHOC
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_IW_ENCODE_INDEX,4,2            ; @IW_ENCODE_INDEX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IW_ENCODE_DISABLED,4,2         ; @IW_ENCODE_DISABLED
	.comm	_WLAN_CIPHER_SUITE_WEP40,4,2    ; @WLAN_CIPHER_SUITE_WEP40
	.comm	_WLAN_CIPHER_SUITE_WEP104,4,2   ; @WLAN_CIPHER_SUITE_WEP104
	.no_dead_strip	_cfg80211_wext_siwencode
.subsections_via_symbols
