	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ng_ksocket_newhook
_ng_ksocket_newhook:                    ## @ng_ksocket_newhook
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_curthread@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	callq	_NG_NODE_PRIVATE
	movq	%rax, %rbx
	movq	_NG_HOOKSIZ@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r13, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rsi
	cmpq	$0, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movq	_EISCONN@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %eax
	jmp	LBB0_14
LBB0_2:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %eax
	movq	_KSF_CLONED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.3:
	movq	_KSF_EMBRYONIC@GOTPCREL(%rip), %r14
	testl	%eax, (%r14)
	je	LBB0_5
## %bb.4:
	movq	_siblings@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_LIST_REMOVE
	movl	(%r14), %eax
	notl	%eax
	andl	%eax, (%rbx)
LBB0_5:
	movq	%r15, 8(%rbx)
	movq	%r15, %rdi
	callq	_NG_HOOK_FORCE_QUEUE
	xorl	%eax, %eax
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_16
## %bb.15:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rdx
	movq	%rsi, %r15
	movq	%rsi, %rdi
	movl	%r13d, %esi
	movq	%r14, %rcx
	callq	_snprintf
	movq	%r15, %rdi
	movl	$47, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_12
## %bb.7:
	movq	%rax, %r13
	movb	$0, (%rax)
	movq	_ng_ksocket_families@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_ng_ksocket_parse
	cmpl	$-1, %eax
	je	LBB0_12
## %bb.8:
	movl	%eax, %r12d
	incq	%r13
	movq	%r13, %rdi
	movl	$47, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	movq	%rax, %r15
	movb	$0, (%rax)
	movq	_ng_ksocket_types@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_ng_ksocket_parse
	cmpl	$-1, %eax
	je	LBB0_12
## %bb.10:
	movl	%eax, %r13d
	incq	%r15
	movq	_ng_ksocket_protos@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	movl	%r12d, %edx
	callq	_ng_ksocket_parse
	cmpl	$-1, %eax
	je	LBB0_12
## %bb.11:
	movq	%rbx, %rsi
	addq	$16, %rsi
	movq	-64(%rbp), %r9                  ## 8-byte Reload
	movl	(%r9), %r8d
	movl	%r12d, %edi
	movl	%r13d, %edx
	movl	%eax, %ecx
	callq	_socreate
	testl	%eax, %eax
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_14
	jmp	LBB0_5
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_curthread,8,3                  ## @curthread
	.comm	_NG_HOOKSIZ,4,2                 ## @NG_HOOKSIZ
	.comm	_EISCONN,4,2                    ## @EISCONN
	.comm	_KSF_CLONED,4,2                 ## @KSF_CLONED
	.comm	_KSF_EMBRYONIC,4,2              ## @KSF_EMBRYONIC
	.comm	_siblings,4,2                   ## @siblings
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ng_ksocket_families,4,2        ## @ng_ksocket_families
	.comm	_ng_ksocket_types,4,2           ## @ng_ksocket_types
	.comm	_ng_ksocket_protos,4,2          ## @ng_ksocket_protos
	.no_dead_strip	_ng_ksocket_newhook
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ng_ksocket_newhook
_ng_ksocket_newhook:                    ; @ng_ksocket_newhook
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x22, x2
	mov	x19, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x8, _curthread@GOTPAGE
Lloh4:
	ldr	x8, [x8, _curthread@GOTPAGEOFF]
Lloh5:
	ldr	x21, [x8]
	bl	_NG_NODE_PRIVATE
	mov	x20, x0
Lloh6:
	adrp	x8, _NG_HOOKSIZ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NG_HOOKSIZ@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x9, x1
Lloh9:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh10:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x1, #15
	and	x9, x9, #0x1fffffff0
	sub	x23, x8, x9
	mov	sp, x23
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh11:
	adrp	x8, _EISCONN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EISCONN@GOTPAGEOFF]
LBB0_2:
	ldr	w0, [x8]
	b	LBB0_7
LBB0_3:
	ldr	w8, [x20]
Lloh13:
	adrp	x9, _KSF_CLONED@GOTPAGE
Lloh14:
	ldr	x9, [x9, _KSF_CLONED@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.4:
Lloh16:
	adrp	x21, _KSF_EMBRYONIC@GOTPAGE
Lloh17:
	ldr	x21, [x21, _KSF_EMBRYONIC@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
Lloh18:
	adrp	x8, _siblings@GOTPAGE
Lloh19:
	ldr	x8, [x8, _siblings@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_LIST_REMOVE
	ldr	w8, [x21]
	ldr	w9, [x20]
	bic	w8, w9, w8
	str	w8, [x20]
LBB0_6:
	str	x19, [x20, #8]
	mov	x0, x19
	bl	_NG_HOOK_FORCE_QUEUE
	mov	w0, #0
LBB0_7:
	ldur	x8, [x29, #-72]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.8:
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh24:
	adrp	x2, l_.str@PAGE
Lloh25:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x23
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x3, x22
	bl	_snprintf
	mov	x0, x23
	mov	w1, #47
	bl	_strchr
	cbz	x0, LBB0_15
; %bb.10:
	mov	x24, x0
	strb	wzr, [x24], #1
Lloh26:
	adrp	x8, _ng_ksocket_families@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ng_ksocket_families@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	mov	x1, x23
	mov	w2, #0
	bl	_ng_ksocket_parse
	cmn	w0, #1
	b.eq	LBB0_15
; %bb.11:
	mov	x22, x0
	mov	x0, x24
	mov	w1, #47
	bl	_strchr
	cbz	x0, LBB0_15
; %bb.12:
	mov	x25, x0
	strb	wzr, [x0]
Lloh29:
	adrp	x8, _ng_ksocket_types@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ng_ksocket_types@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	mov	x1, x24
	mov	w2, #0
	bl	_ng_ksocket_parse
	cmn	w0, #1
	b.eq	LBB0_15
; %bb.13:
	mov	x23, x0
	add	x1, x25, #1
Lloh32:
	adrp	x8, _ng_ksocket_protos@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ng_ksocket_protos@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	mov	x2, x22
	bl	_ng_ksocket_parse
	cmn	w0, #1
	b.eq	LBB0_15
; %bb.14:
	mov	x3, x0
	add	x1, x20, #16
	ldr	w4, [x21]
	mov	x0, x22
	mov	x2, x23
	mov	x5, x21
	bl	_socreate
	cbnz	w0, LBB0_7
	b	LBB0_6
LBB0_15:
Lloh35:
	adrp	x8, _EINVAL@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_2
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_curthread,8,3                  ; @curthread
	.comm	_NG_HOOKSIZ,4,2                 ; @NG_HOOKSIZ
	.comm	_EISCONN,4,2                    ; @EISCONN
	.comm	_KSF_CLONED,4,2                 ; @KSF_CLONED
	.comm	_KSF_EMBRYONIC,4,2              ; @KSF_EMBRYONIC
	.comm	_siblings,4,2                   ; @siblings
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ng_ksocket_families,4,2        ; @ng_ksocket_families
	.comm	_ng_ksocket_types,4,2           ; @ng_ksocket_types
	.comm	_ng_ksocket_protos,4,2          ; @ng_ksocket_protos
	.no_dead_strip	_ng_ksocket_newhook
.subsections_via_symbols
