	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ng_ksocket_shutdown
_ng_ksocket_shutdown:                   ## @ng_ksocket_shutdown
	.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
	movl	%edi, %r14d
	callq	_NG_NODE_PRIVATE
	movq	%rax, %rbx
	movq	%rax, %r15
	movq	16(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	addq	$4, %rdi
	callq	_SOCKBUF_LOCK
	movq	16(%r15), %rdi
	movq	_SO_RCV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_soupcall_clear
	movq	16(%r15), %rdi
	addq	$4, %rdi
	callq	_SOCKBUF_UNLOCK
	movq	16(%r15), %rdi
	callq	_SOCKBUF_LOCK
	movq	16(%r15), %rdi
	movq	_SO_SND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_soupcall_clear
	movq	16(%r15), %rdi
	callq	_SOCKBUF_UNLOCK
	movq	16(%r15), %rdi
	callq	_soclose
	movq	$0, 16(%r15)
LBB0_2:
	movq	_KSF_EMBRYONIC@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, (%r15)
	je	LBB0_4
## %bb.3:
	movq	_siblings@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_LIST_REMOVE
	movl	(%r12), %eax
	notl	%eax
	andl	%eax, (%r15)
LBB0_4:
	addq	$8, %rbx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_LIST_EMPTY
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	callq	_LIST_FIRST
	movl	4(%rax), %edi
	callq	_ng_rmnode_self
	jmp	LBB0_6
LBB0_7:
	movq	%r15, %rdi
	movl	$24, %esi
	callq	_bzero
	movq	_M_NETGRAPH_KSOCKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_free
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_NG_NODE_SET_PRIVATE
	movl	%r14d, %edi
	callq	_NG_NODE_UNREF
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SO_RCV,4,2                     ## @SO_RCV
	.comm	_SO_SND,4,2                     ## @SO_SND
	.comm	_KSF_EMBRYONIC,4,2              ## @KSF_EMBRYONIC
	.comm	_siblings,4,2                   ## @siblings
	.comm	_M_NETGRAPH_KSOCKET,4,2         ## @M_NETGRAPH_KSOCKET
	.no_dead_strip	_ng_ksocket_shutdown
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ng_ksocket_shutdown
_ng_ksocket_shutdown:                   ; @ng_ksocket_shutdown
	.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	x19, x0
	bl	_NG_NODE_PRIVATE
	mov	x20, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_2
; %bb.1:
	add	x0, x8, #4
	bl	_SOCKBUF_LOCK
	ldr	x0, [x20, #16]
Lloh0:
	adrp	x8, _SO_RCV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SO_RCV@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_soupcall_clear
	ldr	x8, [x20, #16]
	add	x0, x8, #4
	bl	_SOCKBUF_UNLOCK
	ldr	x0, [x20, #16]
	bl	_SOCKBUF_LOCK
	ldr	x0, [x20, #16]
Lloh3:
	adrp	x8, _SO_SND@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SO_SND@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_soupcall_clear
	ldr	x0, [x20, #16]
	bl	_SOCKBUF_UNLOCK
	ldr	x0, [x20, #16]
	bl	_soclose
	str	xzr, [x20, #16]
LBB0_2:
	ldr	w8, [x20]
Lloh6:
	adrp	x21, _KSF_EMBRYONIC@GOTPAGE
Lloh7:
	ldr	x21, [x21, _KSF_EMBRYONIC@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _siblings@GOTPAGE
Lloh9:
	ldr	x8, [x8, _siblings@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_LIST_REMOVE
	ldr	w8, [x21]
	ldr	w9, [x20]
	bic	w8, w9, w8
	str	w8, [x20]
LBB0_4:
	add	x21, x20, #8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_LIST_EMPTY
	cbnz	w0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	bl	_LIST_FIRST
	ldr	w0, [x0, #4]
	bl	_ng_rmnode_self
	b	LBB0_5
LBB0_7:
	mov	x0, x20
	mov	w1, #24
	bl	_bzero
Lloh11:
	adrp	x8, _M_NETGRAPH_KSOCKET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _M_NETGRAPH_KSOCKET@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_free
	mov	x0, x19
	mov	x1, #0
	bl	_NG_NODE_SET_PRIVATE
	mov	x0, x19
	bl	_NG_NODE_UNREF
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SO_RCV,4,2                     ; @SO_RCV
	.comm	_SO_SND,4,2                     ; @SO_SND
	.comm	_KSF_EMBRYONIC,4,2              ; @KSF_EMBRYONIC
	.comm	_siblings,4,2                   ; @siblings
	.comm	_M_NETGRAPH_KSOCKET,4,2         ; @M_NETGRAPH_KSOCKET
	.no_dead_strip	_ng_ksocket_shutdown
.subsections_via_symbols
