	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qtnf_core_mac_detach
_qtnf_core_mac_detach:                  ## @qtnf_core_mac_detach
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movl	%esi, %ecx
	movq	(%rax,%rcx,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_14
## %bb.1:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_priv_to_wiphy
	movq	%rax, %r12
	movq	_QTNF_MAX_INTF@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_7
## %bb.2:
	movl	$8, %r14d
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_rtnl_unlock
	leaq	(%r15,%r14), %rdi
	addq	$-4, %rdi
	callq	_qtnf_sta_list_free
	movl	-8(%r15,%r14), %edi
	callq	_free_percpu
	incq	%r13
	movq	_QTNF_MAX_INTF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$24, %r14
	cmpq	%rax, %r13
	jae	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%rbx), %r15
	xorl	%eax, %eax
	callq	_rtnl_lock
	movq	8(%r15,%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r15,%r14), %rax
	movq	_NL80211_IFTYPE_UNSPECIFIED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%r15,%r14), %rbx
	callq	_qtnf_virtual_intf_cleanup
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	callq	_qtnf_del_virtual_intf
	jmp	LBB0_6
LBB0_7:
	cmpq	$0, 16(%rbx)
	je	LBB0_9
## %bb.8:
	movq	%r12, %rdi
	callq	_wiphy_unregister
LBB0_9:
	movq	_NL80211_BAND_2GHZ@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_NUM_NL80211_BANDS@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	cmpl	%eax, %ebx
	jb	LBB0_10
LBB0_13:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_qtnf_mac_iface_comb_free
	movq	%rbx, %rdi
	callq	_qtnf_mac_ext_caps_free
	movq	8(%rbx), %rdi
	callq	_kfree
	movq	(%rbx), %rdi
	callq	_kfree
	movq	$0, (%rbx)
	movq	%r12, %rdi
	callq	_wiphy_free
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	$0, (%rax,%rcx,8)
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%rbx
	movl	%eax, %ecx
	cmpq	%rcx, %rbx
	jae	LBB0_13
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rcx
	movq	(%rcx,%rbx,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	8(%rcx), %rdi
	callq	_kfree
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	movq	$0, (%rdi)
	callq	_kfree
	movq	(%r12), %rax
	movq	$0, (%rax,%rbx,8)
	movl	(%r14), %eax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_QTNF_MAX_INTF,4,2              ## @QTNF_MAX_INTF
	.comm	_NL80211_IFTYPE_UNSPECIFIED,8,3 ## @NL80211_IFTYPE_UNSPECIFIED
	.comm	_NL80211_BAND_2GHZ,4,2          ## @NL80211_BAND_2GHZ
	.comm	_NUM_NL80211_BANDS,4,2          ## @NUM_NL80211_BANDS
	.no_dead_strip	_qtnf_core_mac_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qtnf_core_mac_detach
_qtnf_core_mac_detach:                  ; @qtnf_core_mac_detach
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x8, [x0]
	ldr	x20, [x8, w1, uxtw #3]
	cbz	x20, LBB0_11
; %bb.1:
	mov	x22, x1
	mov	x19, x0
	mov	x0, x20
	bl	_priv_to_wiphy
	mov	x21, x0
Lloh0:
	adrp	x24, _QTNF_MAX_INTF@GOTPAGE
Lloh1:
	ldr	x24, [x24, _QTNF_MAX_INTF@GOTPAGEOFF]
	ldr	w8, [x24]
	cbz	w8, LBB0_7
; %bb.2:
	mov	x25, #0
	mov	x26, #0
Lloh2:
	adrp	x27, _NL80211_IFTYPE_UNSPECIFIED@GOTPAGE
Lloh3:
	ldr	x27, [x27, _NL80211_IFTYPE_UNSPECIFIED@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	bl	_rtnl_unlock
	add	x0, x28, #4
	bl	_qtnf_sta_list_free
	ldr	w0, [x28]
	bl	_free_percpu
	add	x26, x26, #1
	ldr	w8, [x24]
	add	x25, x25, #24
	cmp	x26, x8
	b.hs	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x23, [x20, #24]
	bl	_rtnl_lock
	add	x28, x23, x25
	ldr	x0, [x28, #16]
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x28
	ldr	x8, [x23, #8]!
	ldr	x9, [x27]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_qtnf_virtual_intf_cleanup
	mov	x0, x21
	mov	x1, x23
	bl	_qtnf_del_virtual_intf
	b	LBB0_3
LBB0_7:
	mov	w22, w22
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x21
	bl	_wiphy_unregister
LBB0_9:
Lloh4:
	adrp	x8, _NL80211_BAND_2GHZ@GOTPAGE
Lloh5:
	ldr	x8, [x8, _NL80211_BAND_2GHZ@GOTPAGEOFF]
Lloh6:
	ldr	w23, [x8]
Lloh7:
	adrp	x24, _NUM_NL80211_BANDS@GOTPAGE
Lloh8:
	ldr	x24, [x24, _NUM_NL80211_BANDS@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w23, w8
	b.lo	LBB0_13
LBB0_10:
	mov	x0, x20
	bl	_qtnf_mac_iface_comb_free
	mov	x0, x20
	bl	_qtnf_mac_ext_caps_free
	ldr	x0, [x20, #8]
	bl	_kfree
	ldr	x0, [x20]
	bl	_kfree
	str	xzr, [x20]
	mov	x0, x21
	bl	_wiphy_free
	ldr	x8, [x19]
	str	xzr, [x8, x22, lsl #3]
LBB0_11:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x23, x23, #1
	cmp	x23, w8, uxtw
	b.hs	LBB0_10
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x21]
	ldr	x9, [x9, x23, lsl #3]
	cbz	x9, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x0, [x9, #8]
	bl	_kfree
	ldr	x8, [x21]
	lsl	x25, x23, #3
	ldr	x0, [x8, x25]
	str	xzr, [x0]
	bl	_kfree
	ldr	x8, [x21]
	str	xzr, [x8, x25]
	ldr	w8, [x24]
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_QTNF_MAX_INTF,4,2              ; @QTNF_MAX_INTF
	.comm	_NL80211_IFTYPE_UNSPECIFIED,8,3 ; @NL80211_IFTYPE_UNSPECIFIED
	.comm	_NL80211_BAND_2GHZ,4,2          ; @NL80211_BAND_2GHZ
	.comm	_NUM_NL80211_BANDS,4,2          ; @NUM_NL80211_BANDS
	.no_dead_strip	_qtnf_core_mac_detach
.subsections_via_symbols
