	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ng_attach_cntl
_ng_attach_cntl:                        ## @ng_attach_cntl
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_NG_CONTROL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_ng_attach_common
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	movq	%rbx, %rdi
	callq	_sotongpcb
	movq	%rax, %r14
	movq	_typestruct@GOTPCREL(%rip), %rdi
	leaq	-40(%rbp), %rsi
	callq	_ng_make_node_common
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %r12d
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_ng_detach_common
	jmp	LBB0_4
LBB0_3:
	movq	_M_NETGRAPH_SOCK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	$40, %edi
	callq	_malloc
	movq	%rax, %r15
	movl	(%rbx), %esi
	leaq	28(%rax), %rdx
	movl	$16, %edi
	callq	_hashinit
	movl	%eax, 32(%r15)
	leaq	24(%r15), %rdi
	movq	_MTX_DEF@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	xorl	%edx, %edx
	callq	_mtx_init
	movq	%r14, 16(%r15)
	movq	%r15, 8(%r14)
	incl	(%r15)
	movq	-40(%rbp), %rdi
	movq	%rdi, 8(%r15)
	movl	(%rdi), %eax
	movl	%eax, (%r14)
	movq	%r15, %rsi
	callq	_NG_NODE_SET_PRIVATE
	movq	8(%r15), %rdi
	callq	_NG_NODE_REF
	incl	(%r15)
LBB0_4:
	movl	%r12d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NG_CONTROL,4,2                 ## @NG_CONTROL
	.comm	_typestruct,4,2                 ## @typestruct
	.comm	_M_NETGRAPH_SOCK,4,2            ## @M_NETGRAPH_SOCK
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ng_socket"

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
	.no_dead_strip	_ng_attach_cntl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ng_attach_cntl
_ng_attach_cntl:                        ; @ng_attach_cntl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _NG_CONTROL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _NG_CONTROL@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_ng_attach_common
	mov	x20, x0
	cbnz	w0, LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_sotongpcb
	mov	x19, x0
Lloh2:
	adrp	x0, _typestruct@GOTPAGE
Lloh3:
	ldr	x0, [x0, _typestruct@GOTPAGEOFF]
	add	x1, sp, #8
	bl	_ng_make_node_common
	cbz	w0, LBB0_3
; %bb.2:
	mov	x20, x0
	ldr	w1, [x21]
	mov	x0, x19
	bl	_ng_detach_common
	b	LBB0_4
LBB0_3:
Lloh4:
	adrp	x20, _M_NETGRAPH_SOCK@GOTPAGE
Lloh5:
	ldr	x20, [x20, _M_NETGRAPH_SOCK@GOTPAGEOFF]
Lloh6:
	adrp	x8, _M_WAITOK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _M_WAITOK@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh10:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w0, #40
	bl	_malloc
	mov	x21, x0
	ldr	w1, [x20]
	add	x2, x0, #28
	mov	w0, #16
	bl	_hashinit
	str	w0, [x21, #32]
	add	x0, x21, #24
Lloh12:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, #0
	bl	_mtx_init
	str	x21, [x19, #8]
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
	ldr	x0, [sp, #8]
	stp	x0, x19, [x21, #8]
	ldr	w8, [x0]
	str	w8, [x19]
	mov	x1, x21
	bl	_NG_NODE_SET_PRIVATE
	ldr	x0, [x21, #8]
	bl	_NG_NODE_REF
	mov	w20, #0
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
LBB0_4:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_NG_CONTROL,4,2                 ; @NG_CONTROL
	.comm	_typestruct,4,2                 ; @typestruct
	.comm	_M_NETGRAPH_SOCK,4,2            ; @M_NETGRAPH_SOCK
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ng_socket"

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
	.no_dead_strip	_ng_attach_cntl
.subsections_via_symbols
