	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __tun_detach
___tun_detach:                          ## @__tun_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	32(%rdi), %rdi
	callq	_rtnl_dereference
	movq	%rax, %rbx
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.1:
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	callq	_tun_napi_disable
	movq	%r14, %rdi
	callq	_tun_napi_del
LBB0_3:
	movq	24(%r14), %rax
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.4:
	testq	%rax, %rax
	jne	LBB0_9
## %bb.5:
	movq	(%r14), %r12
	xorl	%edi, %edi
	cmpq	(%rbx), %r12
	setae	%dil
	callq	_BUG_ON
	movq	(%rbx), %rax
	movq	32(%rbx), %rcx
	movq	(%rcx,%r12,8), %rdi
	movq	-8(%rcx,%rax,8), %rsi
	callq	_rcu_assign_pointer
	movq	32(%rbx), %rax
	movq	(%rax,%r12,8), %rdi
	callq	_rtnl_dereference
	movq	%r12, (%rax)
	movq	(%rbx), %rax
	movq	32(%rbx), %rcx
	movq	-8(%rcx,%rax,8), %rdi
	xorl	%esi, %esi
	callq	_rcu_assign_pointer
	decq	(%rbx)
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.6:
	movq	32(%r14), %rdi
	xorl	%esi, %esi
	callq	_RCU_INIT_POINTER
	leaq	8(%r14), %rdi
	callq	_sock_put
	jmp	LBB0_8
LBB0_9:
	testl	%r15d, %r15d
	je	LBB0_12
## %bb.10:
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	%r14, %rdi
	callq	_tun_enable_queue
	movq	%rax, %rbx
	leaq	8(%r14), %rdi
	callq	_sock_put
LBB0_12:
	testl	%r15d, %r15d
	je	LBB0_21
LBB0_13:
	testq	%rbx, %rbx
	je	LBB0_20
## %bb.14:
	cmpq	$0, (%rbx)
	jne	LBB0_19
## %bb.15:
	cmpq	$0, 8(%rbx)
	jne	LBB0_19
## %bb.16:
	movq	24(%rbx), %rdi
	callq	_netif_carrier_off
	movq	_IFF_PERSIST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%rbx)
	jne	LBB0_19
## %bb.17:
	movq	24(%rbx), %rdi
	movq	(%rdi), %rax
	movq	_NETREG_REGISTERED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.18:
	callq	_unregister_netdevice
LBB0_19:
	leaq	16(%r14), %rdi
	callq	_xdp_rxq_info_unreg
LBB0_20:
	leaq	12(%r14), %rdi
	movq	_tun_ptr_free@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ptr_ring_cleanup
	addq	$8, %r14
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sock_put                       ## TAILCALL
LBB0_7:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_tun_disable_queue
LBB0_8:
	xorl	%eax, %eax
	callq	_synchronize_net
	movl	(%rbx), %esi
	incl	%esi
	movq	%rbx, %rdi
	callq	_tun_flow_delete_by_queue
	movq	%r14, %rdi
	callq	_tun_queue_purge
	movq	%rbx, %rdi
	callq	_tun_set_real_num_queues
	testl	%r15d, %r15d
	jne	LBB0_13
LBB0_21:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IFF_PERSIST,4,2                ## @IFF_PERSIST
	.comm	_NETREG_REGISTERED,8,3          ## @NETREG_REGISTERED
	.comm	_tun_ptr_free,4,2               ## @tun_ptr_free
	.no_dead_strip	___tun_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __tun_detach
___tun_detach:                          ; @__tun_detach
	.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, x1
	mov	x19, x0
	ldr	x0, [x0, #32]
	bl	_rtnl_dereference
	mov	x20, x0
	cbz	w21, LBB0_3
; %bb.1:
	cbz	x20, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_tun_napi_disable
	mov	x0, x19
	bl	_tun_napi_del
LBB0_3:
	ldr	x8, [x19, #24]
	cmp	x20, #0
	ccmp	x8, #0, #0, ne
	b.eq	LBB0_16
; %bb.4:
	cbz	w21, LBB0_7
; %bb.5:
	cbz	x8, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_tun_enable_queue
	mov	x20, x0
	add	x0, x19, #8
	bl	_sock_put
LBB0_7:
	cbz	w21, LBB0_20
LBB0_8:
	cbz	x20, LBB0_15
; %bb.9:
	ldr	x8, [x20]
	cbnz	x8, LBB0_14
; %bb.10:
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_14
; %bb.11:
	ldr	x0, [x20, #24]
	bl	_netif_carrier_off
	ldr	w8, [x20, #16]
Lloh0:
	adrp	x9, _IFF_PERSIST@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IFF_PERSIST@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_14
; %bb.12:
	ldr	x0, [x20, #24]
	ldr	x8, [x0]
Lloh3:
	adrp	x9, _NETREG_REGISTERED@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NETREG_REGISTERED@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.13:
	bl	_unregister_netdevice
LBB0_14:
	add	x0, x19, #16
	bl	_xdp_rxq_info_unreg
LBB0_15:
	add	x0, x19, #12
Lloh6:
	adrp	x8, _tun_ptr_free@GOTPAGE
Lloh7:
	ldr	x8, [x8, _tun_ptr_free@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_ptr_ring_cleanup
	add	x0, x19, #8
	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
	b	_sock_put
LBB0_16:
	ldr	x22, [x19]
	ldr	x8, [x20]
	cmp	x22, x8
	cset	w0, hs
	bl	_BUG_ON
	ldr	x8, [x20, #32]
	lsl	x23, x22, #3
	ldr	x0, [x8, x23]
	ldr	x9, [x20]
	add	x8, x8, x9, lsl #3
	ldur	x1, [x8, #-8]
	bl	_rcu_assign_pointer
	ldr	x8, [x20, #32]
	ldr	x0, [x8, x23]
	bl	_rtnl_dereference
	str	x22, [x0]
	ldr	x8, [x20, #32]
	ldr	x9, [x20]
	add	x8, x8, x9, lsl #3
	ldur	x0, [x8, #-8]
	mov	x1, #0
	bl	_rcu_assign_pointer
	ldr	x8, [x20]
	sub	x8, x8, #1
	str	x8, [x20]
	cbz	w21, LBB0_18
; %bb.17:
	ldr	x0, [x19, #32]
	mov	x1, #0
	bl	_RCU_INIT_POINTER
	add	x0, x19, #8
	bl	_sock_put
	b	LBB0_19
LBB0_18:
	mov	x0, x20
	mov	x1, x19
	bl	_tun_disable_queue
LBB0_19:
	bl	_synchronize_net
	ldr	w8, [x20]
	add	w1, w8, #1
	mov	x0, x20
	bl	_tun_flow_delete_by_queue
	mov	x0, x19
	bl	_tun_queue_purge
	mov	x0, x20
	bl	_tun_set_real_num_queues
	cbnz	w21, LBB0_8
LBB0_20:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_IFF_PERSIST,4,2                ; @IFF_PERSIST
	.comm	_NETREG_REGISTERED,8,3          ; @NETREG_REGISTERED
	.comm	_tun_ptr_free,4,2               ; @tun_ptr_free
	.no_dead_strip	___tun_detach
.subsections_via_symbols
