	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ieee80211_ioctl_setkey
_ieee80211_ioctl_setkey:                ## @ieee80211_ioctl_setkey
	.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
	cmpl	$40, (%rsi)
	jne	LBB0_13
## %bb.1:
	movq	%rdi, %r13
	movl	4(%rsi), %edi
	leaq	-80(%rbp), %rsi
	movl	$40, %edx
	callq	_copyin
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.2:
	cmpl	$5, -80(%rbp)
	jb	LBB0_4
## %bb.3:
	movq	_E2BIG@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_4:
	movq	-72(%rbp), %r14
	movq	_IEEE80211_KEYIX_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %r14
	jne	LBB0_9
## %bb.5:
	movq	_IEEE80211_KEY_XMIT@GOTPCREL(%rip), %rax
	movq	_IEEE80211_KEY_RECV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	cmpl	%ecx, -64(%rbp)
	jne	LBB0_13
## %bb.6:
	movq	(%r13), %rax
	movq	_IEEE80211_M_STA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.7:
	movl	24(%r13), %edi
	callq	_ieee80211_ref_node
	movq	%rax, %r15
	movl	-60(%rbp), %edi
	movl	48(%rax), %esi
	callq	_IEEE80211_ADDR_EQ
	testl	%eax, %eax
	jne	LBB0_17
## %bb.8:
	movq	%r15, %rdi
	callq	_ieee80211_free_node
	movq	_EADDRNOTAVAIL@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_9:
	movq	_IEEE80211_WEP_NKID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r14
	jae	LBB0_13
## %bb.10:
	movq	8(%r13), %rcx
	leaq	(%r14,%r14,4), %rdx
	leaq	(%rcx,%rdx,8), %r12
	cmpq	%rax, (%rcx,%rdx,8)
	jne	LBB0_12
## %bb.11:
	movq	%r14, (%r12)
LBB0_12:
	xorl	%r15d, %r15d
	jmp	LBB0_18
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	16(%r13), %rdi
	movl	-60(%rbp), %edx
	movq	%r13, %rsi
	callq	_ieee80211_find_vap_node
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_33
LBB0_17:
	leaq	8(%r15), %r12
LBB0_18:
	movq	%r13, %rdi
	callq	_ieee80211_key_update_begin
	movl	-64(%rbp), %edx
	movl	-48(%rbp), %esi
	movq	%r13, %rdi
	movq	%r12, %rcx
	callq	_ieee80211_crypto_newkey
	testq	%rax, %rax
	je	LBB0_24
## %bb.19:
	movl	-80(%rbp), %eax
	movq	_IEEE80211_KEYBUF_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	cmovll	%eax, %ecx
	movl	%ecx, 8(%r12)
	movq	_IEEE80211_TID_SIZE@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_22
## %bb.20:
	movq	32(%r12), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movl	-52(%rbp), %esi
	movl	%esi, (%rcx,%rdx,4)
	incq	%rdx
	movslq	(%rax), %rsi
	cmpq	%rsi, %rdx
	jl	LBB0_21
LBB0_22:
	movq	$0, 24(%r12)
	movl	16(%r12), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movl	16(%r12), %edi
	movl	-80(%rbp), %edx
	movl	-56(%rbp), %esi
	callq	_memcpy
	movl	12(%r12), %edi
	testq	%r15, %r15
	je	LBB0_25
## %bb.23:
	movl	(%r15), %esi
	jmp	LBB0_26
LBB0_24:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_30
LBB0_25:
	movl	-60(%rbp), %esi
LBB0_26:
	callq	_IEEE80211_ADDR_COPY
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ieee80211_crypto_setkey
	testl	%eax, %eax
	je	LBB0_29
## %bb.27:
	movq	_IEEE80211_KEY_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ebx, %ebx
	testl	%eax, -64(%rbp)
	je	LBB0_31
## %bb.28:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_ieee80211_crypto_set_deftxkey
	jmp	LBB0_31
LBB0_29:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_30:
	movl	(%rax), %ebx
LBB0_31:
	movq	%r13, %rdi
	callq	_ieee80211_key_update_end
	testq	%r15, %r15
	je	LBB0_15
## %bb.32:
	movq	%r15, %rdi
	callq	_ieee80211_free_node
	jmp	LBB0_15
LBB0_33:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_E2BIG,4,2                      ## @E2BIG
	.comm	_IEEE80211_KEYIX_NONE,8,3       ## @IEEE80211_KEYIX_NONE
	.comm	_IEEE80211_KEY_XMIT,4,2         ## @IEEE80211_KEY_XMIT
	.comm	_IEEE80211_KEY_RECV,4,2         ## @IEEE80211_KEY_RECV
	.comm	_IEEE80211_M_STA,8,3            ## @IEEE80211_M_STA
	.comm	_EADDRNOTAVAIL,4,2              ## @EADDRNOTAVAIL
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_IEEE80211_WEP_NKID,8,3         ## @IEEE80211_WEP_NKID
	.comm	_IEEE80211_KEYBUF_SIZE,4,2      ## @IEEE80211_KEYBUF_SIZE
	.comm	_IEEE80211_TID_SIZE,4,2         ## @IEEE80211_TID_SIZE
	.comm	_EIO,4,2                        ## @EIO
	.comm	_IEEE80211_KEY_DEFAULT,4,2      ## @IEEE80211_KEY_DEFAULT
	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_ieee80211_ioctl_setkey
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ieee80211_ioctl_setkey
_ieee80211_ioctl_setkey:                ; @ieee80211_ioctl_setkey
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	ldr	w8, [x1]
	cmp	w8, #40
	b.ne	LBB0_12
; %bb.1:
	mov	x19, x0
	ldr	w0, [x1, #4]
	add	x1, sp, #8
	mov	w2, #40
	bl	_copyin
	mov	x20, x0
	cbnz	w0, LBB0_14
; %bb.2:
	ldr	w8, [sp, #8]
	cmp	w8, #5
	b.lo	LBB0_4
; %bb.3:
Lloh0:
	adrp	x8, _E2BIG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _E2BIG@GOTPAGEOFF]
	b	LBB0_13
LBB0_4:
	ldr	x20, [sp, #16]
Lloh2:
	adrp	x8, _IEEE80211_KEYIX_NONE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IEEE80211_KEYIX_NONE@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x20, x8
	b.ne	LBB0_9
; %bb.5:
	ldr	w8, [sp, #24]
Lloh5:
	adrp	x9, _IEEE80211_KEY_XMIT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IEEE80211_KEY_XMIT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _IEEE80211_KEY_RECV@GOTPAGE
Lloh9:
	ldr	x10, [x10, _IEEE80211_KEY_RECV@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	orr	w9, w10, w9
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.6:
	ldr	x8, [x19]
Lloh11:
	adrp	x9, _IEEE80211_M_STA@GOTPAGE
Lloh12:
	ldr	x9, [x9, _IEEE80211_M_STA@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.7:
	ldr	w0, [x19, #24]
	bl	_ieee80211_ref_node
	mov	x21, x0
	ldr	w0, [sp, #28]
	ldr	w1, [x21, #48]
	bl	_IEEE80211_ADDR_EQ
	cbnz	w0, LBB0_16
; %bb.8:
	mov	x0, x21
	bl	_ieee80211_free_node
Lloh14:
	adrp	x8, _EADDRNOTAVAIL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EADDRNOTAVAIL@GOTPAGEOFF]
	b	LBB0_13
LBB0_9:
Lloh16:
	adrp	x9, _IEEE80211_WEP_NKID@GOTPAGE
Lloh17:
	ldr	x9, [x9, _IEEE80211_WEP_NKID@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x20, x9
	b.hs	LBB0_12
; %bb.10:
	ldr	x9, [x19, #8]
	mov	w10, #40
	madd	x22, x20, x10, x9
	ldr	x9, [x22]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.11:
	mov	x21, #0
	str	x20, [x22]
	b	LBB0_18
LBB0_12:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_13:
	ldr	w20, [x8]
LBB0_14:
	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
	add	sp, sp, #96
	ret
LBB0_15:
	ldr	x0, [x19, #16]
	ldr	w2, [sp, #28]
	mov	x1, x19
	bl	_ieee80211_find_vap_node
	mov	x21, x0
	cbz	x0, LBB0_34
LBB0_16:
	add	x22, x21, #8
	b	LBB0_18
LBB0_17:
	mov	x21, #0
LBB0_18:
	mov	x0, x19
	bl	_ieee80211_key_update_begin
	ldr	w1, [sp, #40]
	ldr	w2, [sp, #24]
	mov	x0, x19
	mov	x3, x22
	bl	_ieee80211_crypto_newkey
	cbz	x0, LBB0_24
; %bb.19:
	ldr	w8, [sp, #8]
Lloh21:
	adrp	x9, _IEEE80211_KEYBUF_SIZE@GOTPAGE
Lloh22:
	ldr	x9, [x9, _IEEE80211_KEYBUF_SIZE@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w8, w8, w9, lt
	str	w8, [x22, #8]
Lloh24:
	adrp	x8, _IEEE80211_TID_SIZE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IEEE80211_TID_SIZE@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_22
; %bb.20:
	mov	x9, #0
	ldr	x10, [x22, #32]
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [sp, #36]
	str	w11, [x10, x9, lsl #2]
	add	x9, x9, #1
	ldrsw	x11, [x8]
	cmp	x9, x11
	b.lt	LBB0_21
LBB0_22:
	str	xzr, [x22, #24]
	ldr	w0, [x22, #16]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	w0, [x22, #16]
	ldr	w1, [sp, #32]
	ldr	w2, [sp, #8]
	bl	_memcpy
	ldr	w0, [x22, #12]
	cbz	x21, LBB0_25
; %bb.23:
	ldr	w1, [x21]
	b	LBB0_26
LBB0_24:
Lloh26:
	adrp	x8, _ENXIO@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_30
LBB0_25:
	ldr	w1, [sp, #28]
LBB0_26:
	bl	_IEEE80211_ADDR_COPY
	mov	x0, x19
	mov	x1, x22
	bl	_ieee80211_crypto_setkey
	cbz	w0, LBB0_29
; %bb.27:
	ldr	w8, [sp, #24]
Lloh28:
	adrp	x9, _IEEE80211_KEY_DEFAULT@GOTPAGE
Lloh29:
	ldr	x9, [x9, _IEEE80211_KEY_DEFAULT@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_33
; %bb.28:
	mov	x0, x19
	mov	x1, x20
	bl	_ieee80211_crypto_set_deftxkey
	mov	w20, #0
	b	LBB0_31
LBB0_29:
Lloh31:
	adrp	x8, _EIO@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_30:
	ldr	w20, [x8]
LBB0_31:
	mov	x0, x19
	bl	_ieee80211_key_update_end
	cbz	x21, LBB0_14
; %bb.32:
	mov	x0, x21
	bl	_ieee80211_free_node
	b	LBB0_14
LBB0_33:
	mov	w20, #0
	b	LBB0_31
LBB0_34:
Lloh33:
	adrp	x8, _ENOENT@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_E2BIG,4,2                      ; @E2BIG
	.comm	_IEEE80211_KEYIX_NONE,8,3       ; @IEEE80211_KEYIX_NONE
	.comm	_IEEE80211_KEY_XMIT,4,2         ; @IEEE80211_KEY_XMIT
	.comm	_IEEE80211_KEY_RECV,4,2         ; @IEEE80211_KEY_RECV
	.comm	_IEEE80211_M_STA,8,3            ; @IEEE80211_M_STA
	.comm	_EADDRNOTAVAIL,4,2              ; @EADDRNOTAVAIL
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_IEEE80211_WEP_NKID,8,3         ; @IEEE80211_WEP_NKID
	.comm	_IEEE80211_KEYBUF_SIZE,4,2      ; @IEEE80211_KEYBUF_SIZE
	.comm	_IEEE80211_TID_SIZE,4,2         ; @IEEE80211_TID_SIZE
	.comm	_EIO,4,2                        ; @EIO
	.comm	_IEEE80211_KEY_DEFAULT,4,2      ; @IEEE80211_KEY_DEFAULT
	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_ieee80211_ioctl_setkey
.subsections_via_symbols
