	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tcp_twstart                    ## -- Begin function tcp_twstart
	.p2align	4, 0x90
_tcp_twstart:                           ## @tcp_twstart
	.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
	movq	%rdi, %r12
	movq	56(%rdi), %r15
	xorl	%eax, %eax
	callq	_NET_EPOCH_ASSERT
	movq	%r15, %rdi
	callq	_INP_WLOCK_ASSERT
	movq	_INP_DROPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	andl	(%r15), %eax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	_TCPS_TIME_WAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_tcp_state_change
	movq	_V_tcptw_zone@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_M_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_uma_zalloc
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_4
## %bb.1:
	movl	$1, %edi
	callq	_tcp_tw_2msl_scan
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_2
LBB0_4:
	movq	%r15, 64(%r13)
	movq	16(%r15), %r14
	leaq	12(%r14), %rdi
	callq	_sbspace
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_lmax
	movq	_TCP_MAXWIN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movb	(%r12), %cl
	shlq	%cl, %rsi
	movl	%eax, %edi
	callq	_lmin
	movl	%eax, %ebx
	movl	12(%r14), %eax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	cmpl	%ecx, %ebx
	jge	LBB0_6
## %bb.5:
	cmpl	8(%r12), %ebx
	movl	$0, %eax
	cmovll	%eax, %ebx
LBB0_6:
	movl	12(%r12), %edi
	movl	16(%r12), %esi
	callq	_SEQ_GT
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	12(%r12), %eax
	subl	16(%r12), %eax
	cmpl	%eax, %ebx
	cmovlel	%eax, %ebx
LBB0_8:
	movb	(%r12), %cl
	sarl	%cl, %ebx
	movslq	%ebx, %rax
	movq	%rax, 56(%r13)
	movl	20(%r12), %ebx
	movq	_TF_REQ_TSTMP@GOTPCREL(%rip), %rax
	movq	_TF_RCVD_TSTMP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_TF_NOOPT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%ecx, %eax
	andl	%ebx, %eax
	xorps	%xmm0, %xmm0
	cmpl	%ecx, %eax
	jne	LBB0_10
## %bb.9:
	movups	40(%r12), %xmm0
LBB0_10:
	movups	%xmm0, 40(%r13)
	movl	16(%r12), %eax
	movl	%eax, (%r13)
	movups	24(%r12), %xmm0
	movups	%xmm0, 24(%r13)
	movq	$0, 16(%r13)
	movq	_TF_ACKNOW@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_tcp_discardcb
	movq	%r14, %rdi
	callq	_soisdisconnected
	movl	8(%r14), %eax
	movl	%eax, 8(%r13)
	movq	_INP_TIMEWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
	testl	%ebx, %ebx
	je	LBB0_12
## %bb.11:
	movq	_TH_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_tcp_twrespond
LBB0_12:
	movq	%r15, %rdi
	callq	_in_pcbref
	movl	4(%r14), %edi
	callq	_crhold
	movl	%eax, 4(%r13)
	movq	%r13, 8(%r15)
	movq	_TCPS_TIME_WAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_TCPSTATES_INC
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_tcp_tw_2msl_reset
	movq	_INP_SOCKREF@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	testl	%eax, (%r15)
	je	LBB0_3
## %bb.13:
	movq	_SS_PROTOREF@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	andl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_KASSERT
	movl	(%rbx), %eax
	notl	%eax
	andl	%eax, (%r15)
	movq	%r15, %rdi
	callq	_INP_WUNLOCK
	movq	%r14, %rdi
	callq	_SOCK_LOCK
	movl	(%r12), %eax
	notl	%eax
	andl	%eax, (%r14)
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sofree                         ## TAILCALL
LBB0_2:
	movq	%r12, %rdi
	callq	_tcp_close
	testq	%rax, %rax
	je	LBB0_14
LBB0_3:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_INP_WUNLOCK                    ## TAILCALL
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INP_DROPPED,4,2                ## @INP_DROPPED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tcp_twstart: (inp->inp_flags & INP_DROPPED) != 0"

	.comm	_V_nolocaltimewait,8,3          ## @V_nolocaltimewait
	.comm	_TCPS_TIME_WAIT,4,2             ## @TCPS_TIME_WAIT
	.comm	_V_tcptw_zone,4,2               ## @V_tcptw_zone
	.comm	_M_NOWAIT,4,2                   ## @M_NOWAIT
	.comm	_TCP_MAXWIN,8,3                 ## @TCP_MAXWIN
	.comm	_TF_REQ_TSTMP,4,2               ## @TF_REQ_TSTMP
	.comm	_TF_RCVD_TSTMP,4,2              ## @TF_RCVD_TSTMP
	.comm	_TF_NOOPT,4,2                   ## @TF_NOOPT
	.comm	_TF_ACKNOW,4,2                  ## @TF_ACKNOW
	.comm	_INP_TIMEWAIT,4,2               ## @INP_TIMEWAIT
	.comm	_TH_ACK,4,2                     ## @TH_ACK
	.comm	_INP_SOCKREF,4,2                ## @INP_SOCKREF
	.comm	_SS_PROTOREF,4,2                ## @SS_PROTOREF
L_.str.1:                               ## @.str.1
	.asciz	"tcp_twstart: !SS_PROTOREF"

	.comm	_INC_ISIPV6,4,2                 ## @INC_ISIPV6
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tcp_twstart                    ; -- Begin function tcp_twstart
	.p2align	2
_tcp_twstart:                           ; @tcp_twstart
	.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, x0
	ldr	x19, [x0, #56]
	bl	_NET_EPOCH_ASSERT
	mov	x0, x19
	bl	_INP_WLOCK_ASSERT
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _INP_DROPPED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _INP_DROPPED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w0, eq
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
Lloh5:
	adrp	x24, _TCPS_TIME_WAIT@GOTPAGE
Lloh6:
	ldr	x24, [x24, _TCPS_TIME_WAIT@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x21
	bl	_tcp_state_change
Lloh7:
	adrp	x8, _V_tcptw_zone@GOTPAGE
Lloh8:
	ldr	x8, [x8, _V_tcptw_zone@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x8, _M_NOWAIT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _M_NOWAIT@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	bl	_uma_zalloc
	mov	x22, x0
	cbnz	x0, LBB0_2
; %bb.1:
	mov	w0, #1
	bl	_tcp_tw_2msl_scan
	mov	x22, x0
	cbz	x0, LBB0_12
LBB0_2:
	str	x19, [x22, #64]
	ldr	x20, [x19, #16]
	add	x0, x20, #12
	bl	_sbspace
	mov	w1, #0
	bl	_lmax
Lloh13:
	adrp	x8, _TCP_MAXWIN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _TCP_MAXWIN@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	ldr	x9, [x21]
	lsl	x1, x8, x9
	bl	_lmin
	mov	x23, x0
	ldr	w8, [x20, #12]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	cmp	w0, w8, asr #2
	b.ge	LBB0_4
; %bb.3:
	ldr	w8, [x21, #8]
	cmp	w23, w8
	csel	w23, wzr, w23, lt
LBB0_4:
	ldp	w0, w1, [x21, #12]
	bl	_SEQ_GT
	cbz	x0, LBB0_6
; %bb.5:
	ldp	w8, w9, [x21, #12]
	sub	w8, w8, w9
	cmp	w23, w8
	csel	w23, w23, w8, gt
LBB0_6:
	ldr	w8, [x21]
	asr	w8, w23, w8
	sxtw	x8, w8
	str	x8, [x22, #56]
Lloh16:
	adrp	x8, _TF_REQ_TSTMP@GOTPAGE
Lloh17:
	ldr	x8, [x8, _TF_REQ_TSTMP@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _TF_RCVD_TSTMP@GOTPAGE
Lloh20:
	ldr	x9, [x9, _TF_RCVD_TSTMP@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w9, w9, w8
Lloh22:
	adrp	x10, _TF_NOOPT@GOTPAGE
Lloh23:
	ldr	x10, [x10, _TF_NOOPT@GOTPAGEOFF]
	ldr	w8, [x21, #20]
Lloh24:
	ldr	w10, [x10]
	orr	w10, w9, w10
	and	w10, w10, w8
	movi.2d	v0, #0000000000000000
	cmp	w10, w9
	b.ne	LBB0_8
; %bb.7:
	ldur	q0, [x21, #40]
LBB0_8:
	stur	q0, [x22, #40]
	ldr	w9, [x21, #16]
	str	w9, [x22]
	ldur	q0, [x21, #24]
	stur	q0, [x22, #24]
	str	xzr, [x22, #16]
Lloh25:
	adrp	x9, _TF_ACKNOW@GOTPAGE
Lloh26:
	ldr	x9, [x9, _TF_ACKNOW@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	and	w23, w9, w8
	mov	x0, x21
	bl	_tcp_discardcb
	mov	x0, x20
	bl	_soisdisconnected
	ldr	w8, [x20, #8]
	str	w8, [x22, #8]
Lloh28:
	adrp	x8, _INP_TIMEWAIT@GOTPAGE
Lloh29:
	ldr	x8, [x8, _INP_TIMEWAIT@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	cbz	w23, LBB0_10
; %bb.9:
Lloh31:
	adrp	x8, _TH_ACK@GOTPAGE
Lloh32:
	ldr	x8, [x8, _TH_ACK@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_tcp_twrespond
LBB0_10:
	mov	x0, x19
	bl	_in_pcbref
	ldr	w0, [x20, #4]
	bl	_crhold
	str	w0, [x22, #4]
	str	x22, [x19, #8]
	ldr	w0, [x24]
	bl	_TCPSTATES_INC
	mov	x0, x22
	mov	w1, #0
	bl	_tcp_tw_2msl_reset
	ldr	w8, [x19]
Lloh34:
	adrp	x21, _INP_SOCKREF@GOTPAGE
Lloh35:
	ldr	x21, [x21, _INP_SOCKREF@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.11:
	ldr	w8, [x20]
Lloh36:
	adrp	x22, _SS_PROTOREF@GOTPAGE
Lloh37:
	ldr	x22, [x22, _SS_PROTOREF@GOTPAGEOFF]
	ldr	w9, [x22]
	and	w0, w9, w8
Lloh38:
	adrp	x1, l_.str.1@PAGE
Lloh39:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
	ldr	w8, [x21]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	mov	x0, x19
	bl	_INP_WUNLOCK
	mov	x0, x20
	bl	_SOCK_LOCK
	ldr	w8, [x22]
	ldr	w9, [x20]
	bic	w8, w9, w8
	str	w8, [x20]
	mov	x0, x20
	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	_sofree
LBB0_12:
	mov	x0, x21
	bl	_tcp_close
	cbz	x0, LBB0_14
LBB0_13:
	mov	x0, x19
	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	_INP_WUNLOCK
LBB0_14:
	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	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_INP_DROPPED,4,2                ; @INP_DROPPED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tcp_twstart: (inp->inp_flags & INP_DROPPED) != 0"

	.comm	_V_nolocaltimewait,8,3          ; @V_nolocaltimewait
	.comm	_TCPS_TIME_WAIT,4,2             ; @TCPS_TIME_WAIT
	.comm	_V_tcptw_zone,4,2               ; @V_tcptw_zone
	.comm	_M_NOWAIT,4,2                   ; @M_NOWAIT
	.comm	_TCP_MAXWIN,8,3                 ; @TCP_MAXWIN
	.comm	_TF_REQ_TSTMP,4,2               ; @TF_REQ_TSTMP
	.comm	_TF_RCVD_TSTMP,4,2              ; @TF_RCVD_TSTMP
	.comm	_TF_NOOPT,4,2                   ; @TF_NOOPT
	.comm	_TF_ACKNOW,4,2                  ; @TF_ACKNOW
	.comm	_INP_TIMEWAIT,4,2               ; @INP_TIMEWAIT
	.comm	_TH_ACK,4,2                     ; @TH_ACK
	.comm	_INP_SOCKREF,4,2                ; @INP_SOCKREF
	.comm	_SS_PROTOREF,4,2                ; @SS_PROTOREF
l_.str.1:                               ; @.str.1
	.asciz	"tcp_twstart: !SS_PROTOREF"

	.comm	_INC_ISIPV6,4,2                 ; @INC_ISIPV6
.subsections_via_symbols
