	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tcp_close                      ## -- Begin function tcp_close
	.p2align	4, 0x90
_tcp_close:                             ## @tcp_close
	.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
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	movq	_V_tcbinfo@GOTPCREL(%rip), %rdi
	callq	_INP_INFO_LOCK_ASSERT
	movq	%r14, %rdi
	callq	_INP_WLOCK_ASSERT
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_tcp_fastopen_decrement_counter
	movq	$0, 8(%rbx)
LBB0_2:
	movq	%r14, %rdi
	callq	_in_pcbdrop
	movq	_tcps_closed@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_TCPSTAT_INC
	movq	_TCPS_CLOSED@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	cmpq	%rsi, (%rbx)
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	callq	_tcp_state_change
LBB0_4:
	xorl	%edi, %edi
	cmpq	$0, 8(%r14)
	setne	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	8(%r14), %r15
	movq	%r15, %rdi
	callq	_soisdisconnected
	movq	_INP_SOCKREF@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, (%r14)
	je	LBB0_6
## %bb.5:
	movq	_SS_PROTOREF@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	andl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_KASSERT
	movl	(%r12), %eax
	notl	%eax
	andl	%eax, (%r14)
	movq	%r14, %rdi
	callq	_INP_WUNLOCK
	movq	%r15, %rdi
	callq	_SOCK_LOCK
	movl	(%rbx), %eax
	notl	%eax
	andl	%eax, (%r15)
	movq	%r15, %rdi
	callq	_sofree
	xorl	%ebx, %ebx
LBB0_6:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V_tcbinfo,4,2                  ## @V_tcbinfo
	.comm	_tcps_closed,4,2                ## @tcps_closed
	.comm	_TCPS_CLOSED,8,3                ## @TCPS_CLOSED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tcp_close: inp_socket NULL"

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

	.comm	_TCPS_LISTEN,8,3                ## @TCPS_LISTEN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tcp_close                      ; -- Begin function tcp_close
	.p2align	2
_tcp_close:                             ; @tcp_close
	.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, x0
	ldr	x19, [x0, #16]
Lloh0:
	adrp	x0, _V_tcbinfo@GOTPAGE
Lloh1:
	ldr	x0, [x0, _V_tcbinfo@GOTPAGEOFF]
	bl	_INP_INFO_LOCK_ASSERT
	mov	x0, x19
	bl	_INP_WLOCK_ASSERT
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_tcp_fastopen_decrement_counter
	str	xzr, [x20, #8]
LBB0_2:
	mov	x0, x19
	bl	_in_pcbdrop
Lloh2:
	adrp	x8, _tcps_closed@GOTPAGE
Lloh3:
	ldr	x8, [x8, _tcps_closed@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_TCPSTAT_INC
	ldr	x8, [x20]
Lloh5:
	adrp	x9, _TCPS_CLOSED@GOTPAGE
Lloh6:
	ldr	x9, [x9, _TCPS_CLOSED@GOTPAGEOFF]
Lloh7:
	ldr	x1, [x9]
	cmp	x8, x1
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_tcp_state_change
LBB0_4:
	ldr	x8, [x19, #8]
	cmp	x8, #0
	cset	w0, ne
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	ldr	x21, [x19, #8]
	mov	x0, x21
	bl	_soisdisconnected
	ldr	w8, [x19]
Lloh10:
	adrp	x22, _INP_SOCKREF@GOTPAGE
Lloh11:
	ldr	x22, [x22, _INP_SOCKREF@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	ldr	w8, [x21]
Lloh12:
	adrp	x20, _SS_PROTOREF@GOTPAGE
Lloh13:
	ldr	x20, [x20, _SS_PROTOREF@GOTPAGEOFF]
	ldr	w9, [x20]
	and	w0, w9, w8
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
	ldr	w8, [x22]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	mov	x0, x19
	bl	_INP_WUNLOCK
	mov	x0, x21
	bl	_SOCK_LOCK
	ldr	w8, [x20]
	ldr	w9, [x21]
	bic	w8, w9, w8
	str	w8, [x21]
	mov	x0, x21
	bl	_sofree
	mov	x20, #0
LBB0_6:
	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
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_V_tcbinfo,4,2                  ; @V_tcbinfo
	.comm	_tcps_closed,4,2                ; @tcps_closed
	.comm	_TCPS_CLOSED,8,3                ; @TCPS_CLOSED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tcp_close: inp_socket NULL"

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

	.comm	_TCPS_LISTEN,8,3                ; @TCPS_LISTEN
.subsections_via_symbols
