	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tcp_twclose                    ## -- Begin function tcp_twclose
	.p2align	4, 0x90
_tcp_twclose:                           ## @tcp_twclose
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	(%rdi), %rbx
	movq	_INP_TIMEWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	%rbx, %rdi
	callq	_intotw
	xorl	%edi, %edi
	cmpq	%r15, %rax
	sete	%dil
	leaq	L_.str.1(%rip), %rsi
	callq	_KASSERT
	xorl	%eax, %eax
	callq	_NET_EPOCH_ASSERT
	movq	%rbx, %rdi
	callq	_INP_WLOCK_ASSERT
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_tcp_tw_2msl_stop
	movq	$0, 16(%rbx)
	movq	%rbx, %rdi
	callq	_in_pcbdrop
	movq	8(%rbx), %r14
	testq	%r14, %r14
	je	LBB0_4
## %bb.1:
	movl	(%rbx), %eax
	movq	_INP_SOCKREF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_3
## %bb.2:
	notl	%ecx
	andl	%ecx, %eax
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	callq	_INP_WUNLOCK
	movq	%r14, %rdi
	callq	_SOCK_LOCK
	movq	_SS_PROTOREF@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	andl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_KASSERT
	movl	(%rbx), %eax
	notl	%eax
	andl	%eax, (%r14)
	movq	%r14, %rdi
	callq	_sofree
	jmp	LBB0_5
LBB0_4:
	movq	%rbx, %rdi
	callq	_in_pcbfree
	jmp	LBB0_5
LBB0_3:
	movq	%rbx, %rdi
	callq	_INP_WUNLOCK
LBB0_5:
	movq	_tcps_closed@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_TCPSTAT_INC                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_INP_TIMEWAIT,4,2               ## @INP_TIMEWAIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tcp_twclose: !timewait"

L_.str.1:                               ## @.str.1
	.asciz	"tcp_twclose: inp_ppcb != tw"

	.comm	_INP_SOCKREF,4,2                ## @INP_SOCKREF
	.comm	_SS_PROTOREF,4,2                ## @SS_PROTOREF
L_.str.2:                               ## @.str.2
	.asciz	"tcp_twclose: INP_SOCKREF && !SS_PROTOREF"

	.comm	_tcps_closed,4,2                ## @tcps_closed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tcp_twclose                    ; -- Begin function tcp_twclose
	.p2align	2
_tcp_twclose:                           ; @tcp_twclose
	.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	x20, x1
	mov	x21, x0
	ldr	x19, [x0]
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _INP_TIMEWAIT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _INP_TIMEWAIT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w0, w9, w8
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	mov	x0, x19
	bl	_intotw
	cmp	x0, x21
	cset	w0, eq
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
	bl	_NET_EPOCH_ASSERT
	mov	x0, x19
	bl	_INP_WLOCK_ASSERT
	mov	x0, x21
	mov	x1, x20
	bl	_tcp_tw_2msl_stop
	str	xzr, [x19, #16]
	mov	x0, x19
	bl	_in_pcbdrop
	ldr	x20, [x19, #8]
	cbz	x20, LBB0_3
; %bb.1:
	ldr	w8, [x19]
Lloh7:
	adrp	x9, _INP_SOCKREF@GOTPAGE
Lloh8:
	ldr	x9, [x9, _INP_SOCKREF@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
	bic	w8, w8, w9
	str	w8, [x19]
	mov	x0, x19
	bl	_INP_WUNLOCK
	mov	x0, x20
	bl	_SOCK_LOCK
	ldr	w8, [x20]
Lloh10:
	adrp	x19, _SS_PROTOREF@GOTPAGE
Lloh11:
	ldr	x19, [x19, _SS_PROTOREF@GOTPAGEOFF]
	ldr	w9, [x19]
	and	w0, w9, w8
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_KASSERT
	ldr	w8, [x19]
	ldr	w9, [x20]
	bic	w8, w9, w8
	str	w8, [x20]
	mov	x0, x20
	bl	_sofree
	b	LBB0_5
LBB0_3:
	mov	x0, x19
	bl	_in_pcbfree
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_INP_WUNLOCK
LBB0_5:
Lloh14:
	adrp	x8, _tcps_closed@GOTPAGE
Lloh15:
	ldr	x8, [x8, _tcps_closed@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	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	_TCPSTAT_INC
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_INP_TIMEWAIT,4,2               ; @INP_TIMEWAIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tcp_twclose: !timewait"

l_.str.1:                               ; @.str.1
	.asciz	"tcp_twclose: inp_ppcb != tw"

	.comm	_INP_SOCKREF,4,2                ; @INP_SOCKREF
	.comm	_SS_PROTOREF,4,2                ; @SS_PROTOREF
l_.str.2:                               ; @.str.2
	.asciz	"tcp_twclose: INP_SOCKREF && !SS_PROTOREF"

	.comm	_tcps_closed,4,2                ; @tcps_closed
.subsections_via_symbols
