	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ngs_disconnect
_ngs_disconnect:                        ## @ngs_disconnect
	.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	%edi, %ebx
	callq	_NG_HOOK_NODE
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_NG_NODE_PRIVATE
	movq	%rax, %r15
	movl	%ebx, %edi
	callq	_NG_HOOK_PRIVATE
	movq	%rax, %rbx
	movq	_next@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_LIST_REMOVE
	movq	_M_NETGRAPH_SOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_free
	movq	8(%r15), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.2:
	movl	%r14d, %edi
	callq	_NG_NODE_NUMHOOKS
	movq	_SS_ISCONNECTED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpq	$1, %rax
	jne	LBB0_4
## %bb.3:
	movq	8(%r15), %rax
	movq	(%rax), %rax
	orl	%ecx, (%rax)
	jmp	LBB0_5
LBB0_4:
	notl	%ecx
	movq	8(%r15), %rax
	movq	(%rax), %rax
	andl	%ecx, (%rax)
LBB0_5:
	movq	_NGS_FLAG_NOLINGER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_9
## %bb.6:
	movl	%r14d, %edi
	callq	_NG_NODE_NUMHOOKS
	testq	%rax, %rax
	jne	LBB0_9
## %bb.7:
	movl	%r14d, %edi
	callq	_NG_NODE_IS_VALID
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movl	%r14d, %edi
	callq	_ng_rmnode_self
LBB0_9:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_next,4,2                       ## @next
	.comm	_M_NETGRAPH_SOCK,4,2            ## @M_NETGRAPH_SOCK
	.comm	_SS_ISCONNECTED,4,2             ## @SS_ISCONNECTED
	.comm	_NGS_FLAG_NOLINGER,4,2          ## @NGS_FLAG_NOLINGER
	.no_dead_strip	_ngs_disconnect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ngs_disconnect
_ngs_disconnect:                        ; @ngs_disconnect
	.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, x0
	bl	_NG_HOOK_NODE
	mov	x19, x0
	bl	_NG_NODE_PRIVATE
	mov	x20, x0
	mov	x0, x21
	bl	_NG_HOOK_PRIVATE
	mov	x21, x0
Lloh0:
	adrp	x8, _next@GOTPAGE
Lloh1:
	ldr	x8, [x8, _next@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_LIST_REMOVE
Lloh3:
	adrp	x8, _M_NETGRAPH_SOCK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _M_NETGRAPH_SOCK@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_free
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_6
; %bb.1:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.2:
	mov	x0, x19
	bl	_NG_NODE_NUMHOOKS
Lloh6:
	adrp	x8, _SS_ISCONNECTED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SS_ISCONNECTED@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	x0, #1
	b.ne	LBB0_4
; %bb.3:
	ldr	x9, [x20, #8]
	ldr	x9, [x9]
	ldr	w10, [x9]
	orr	w8, w10, w8
	b	LBB0_5
LBB0_4:
	ldr	x9, [x20, #8]
	ldr	x9, [x9]
	ldr	w10, [x9]
	bic	w8, w10, w8
LBB0_5:
	str	w8, [x9]
LBB0_6:
	ldr	w8, [x20]
Lloh9:
	adrp	x9, _NGS_FLAG_NOLINGER@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NGS_FLAG_NOLINGER@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.7:
	mov	x0, x19
	bl	_NG_NODE_NUMHOOKS
	cbnz	x0, LBB0_10
; %bb.8:
	mov	x0, x19
	bl	_NG_NODE_IS_VALID
	cbz	x0, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_ng_rmnode_self
LBB0_10:
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_next,4,2                       ; @next
	.comm	_M_NETGRAPH_SOCK,4,2            ; @M_NETGRAPH_SOCK
	.comm	_SS_ISCONNECTED,4,2             ; @SS_ISCONNECTED
	.comm	_NGS_FLAG_NOLINGER,4,2          ; @NGS_FLAG_NOLINGER
	.no_dead_strip	_ngs_disconnect
.subsections_via_symbols
