	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ng_attach_common
_ng_attach_common:                      ## @ng_attach_common
	.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	%esi, %r15d
	movq	%rdi, %r12
	movq	_ngpdg_sendspace@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ngpdg_recvspace@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_soreserve
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	_M_PCB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	$16, %edi
	callq	_malloc
	movq	%rax, %rbx
	movl	%r15d, (%rax)
	movq	%rax, (%r12)
	movq	%r12, 8(%rax)
	movq	_ngsocketlist_mtx@GOTPCREL(%rip), %r15
	movq	%r15, %rdi
	callq	_mtx_lock
	movq	_socks@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ngsocklist@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_LIST_INSERT_HEAD
	movq	%r15, %rdi
	callq	_mtx_unlock
LBB0_2:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ngpdg_sendspace,4,2            ## @ngpdg_sendspace
	.comm	_ngpdg_recvspace,4,2            ## @ngpdg_recvspace
	.comm	_M_PCB,4,2                      ## @M_PCB
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_ngsocketlist_mtx,4,2           ## @ngsocketlist_mtx
	.comm	_ngsocklist,4,2                 ## @ngsocklist
	.comm	_socks,4,2                      ## @socks
	.no_dead_strip	_ng_attach_common
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ng_attach_common
_ng_attach_common:                      ; @ng_attach_common
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _ngpdg_sendspace@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ngpdg_sendspace@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _ngpdg_recvspace@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ngpdg_recvspace@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_soreserve
	mov	x19, x0
	cbnz	w0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _M_PCB@GOTPAGE
Lloh7:
	ldr	x8, [x8, _M_PCB@GOTPAGEOFF]
Lloh8:
	adrp	x9, _M_WAITOK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _M_WAITOK@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	ldr	w8, [x9]
Lloh12:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh13:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w0, #16
	bl	_malloc
	mov	x22, x0
	str	w21, [x0]
	str	x0, [x20]
	str	x20, [x0, #8]
Lloh15:
	adrp	x20, _ngsocketlist_mtx@GOTPAGE
Lloh16:
	ldr	x20, [x20, _ngsocketlist_mtx@GOTPAGEOFF]
	mov	x0, x20
	bl	_mtx_lock
Lloh17:
	adrp	x8, _socks@GOTPAGE
Lloh18:
	ldr	x8, [x8, _socks@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
Lloh20:
	adrp	x0, _ngsocklist@GOTPAGE
Lloh21:
	ldr	x0, [x0, _ngsocklist@GOTPAGEOFF]
	mov	x1, x22
	bl	_LIST_INSERT_HEAD
	mov	x0, x20
	bl	_mtx_unlock
LBB0_2:
	mov	x0, x19
	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	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ngpdg_sendspace,4,2            ; @ngpdg_sendspace
	.comm	_ngpdg_recvspace,4,2            ; @ngpdg_recvspace
	.comm	_M_PCB,4,2                      ; @M_PCB
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_ngsocketlist_mtx,4,2           ; @ngsocketlist_mtx
	.comm	_ngsocklist,4,2                 ; @ngsocklist
	.comm	_socks,4,2                      ; @socks
	.no_dead_strip	_ng_attach_common
.subsections_via_symbols
