	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tbnet_tear_down
_tbnet_tear_down:                       ## @tbnet_tear_down
	.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
	movl	%esi, %r15d
	movq	%rdi, %r13
	movl	24(%rdi), %edi
	callq	_netif_carrier_off
	movl	24(%r13), %edi
	callq	_netif_stop_queue
	movq	%r13, %rdi
	callq	_stop_login
	leaq	8(%r13), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	cmpl	$0, (%r13)
	je	LBB0_8
## %bb.1:
	cmpl	$0, 4(%r13)
	je	LBB0_8
## %bb.2:
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.3:
	movq	_TBNET_LOGOUT_RETRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	incl	%ebx
	movq	_ETIMEDOUT@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	decl	%ebx
	testl	%ebx, %ebx
	jle	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	callq	_tbnet_logout_request
	addl	(%r15), %eax
	je	LBB0_4
LBB0_6:
	leaq	36(%r13), %r15
	movl	36(%r13), %edi
	callq	_tb_ring_stop
	leaq	32(%r13), %r12
	movl	32(%r13), %edi
	callq	_tb_ring_stop
	movq	%r15, %rdi
	callq	_tbnet_free_buffers
	movq	%r12, %rdi
	callq	_tbnet_free_buffers
	movl	28(%r13), %edi
	callq	_tb_xdomain_disable_paths
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	24(%r13), %edi
	leaq	L_.str(%rip), %rsi
	callq	_netdev_warn
LBB0_8:
	movq	$0, 16(%r13)
	movq	$0, (%r13)
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TBNET_LOGOUT_RETRIES,4,2       ## @TBNET_LOGOUT_RETRIES
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to disable DMA paths\n"

	.no_dead_strip	_tbnet_tear_down
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tbnet_tear_down
_tbnet_tear_down:                       ; @tbnet_tear_down
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x0, #24]
	bl	_netif_carrier_off
	ldr	w0, [x19, #24]
	bl	_netif_stop_queue
	mov	x0, x19
	bl	_stop_login
	add	x20, x19, #8
	mov	x0, x20
	bl	_mutex_lock
	ldr	w8, [x19]
	cbz	w8, LBB0_8
; %bb.1:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_8
; %bb.2:
	cbz	w21, LBB0_6
; %bb.3:
Lloh0:
	adrp	x8, _TBNET_LOGOUT_RETRIES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TBNET_LOGOUT_RETRIES@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	add	w21, w8, #1
Lloh3:
	adrp	x22, _ETIMEDOUT@GOTPAGE
Lloh4:
	ldr	x22, [x22, _ETIMEDOUT@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	w21, w21, #1
	cmp	w21, #1
	b.lt	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	bl	_tbnet_logout_request
	ldr	w8, [x22]
	cmn	w0, w8
	b.eq	LBB0_4
LBB0_6:
	mov	x21, x19
	ldr	w0, [x21, #36]!
	bl	_tb_ring_stop
	mov	x22, x19
	ldr	w0, [x22, #32]!
	bl	_tb_ring_stop
	mov	x0, x21
	bl	_tbnet_free_buffers
	mov	x0, x22
	bl	_tbnet_free_buffers
	ldur	w0, [x22, #-4]
	bl	_tb_xdomain_disable_paths
	cbz	x0, LBB0_8
; %bb.7:
	ldr	w0, [x19, #24]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_netdev_warn
LBB0_8:
	str	xzr, [x19, #16]
	str	xzr, [x19]
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_TBNET_LOGOUT_RETRIES,4,2       ; @TBNET_LOGOUT_RETRIES
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to disable DMA paths\n"

	.no_dead_strip	_tbnet_tear_down
.subsections_via_symbols
