	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sp_connect
_sp_connect:                            ## @sp_connect
	.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
	movq	%rcx, %r14
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	xorl	%edi, %edi
	testq	%rsi, %rsi
	setne	%dil
	callq	_PJDLOG_ASSERT
	xorl	%edi, %edi
	cmpl	$-1, %r12d
	setge	%dil
	callq	_PJDLOG_ASSERT
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	movl	$-1, %ebx
	testq	%rax, %rax
	je	LBB0_1
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	xorl	%edi, %edi
	testq	%r15, %r15
	sete	%dil
	callq	_PJDLOG_ASSERT
	movl	$12, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r15
	movq	_PF_UNIX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r15), %ecx
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	callq	_socketpair
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.5:
	movq	_SP_SIDE_UNDEF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	movq	_SP_CTX_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movq	%r15, (%r14)
	jmp	LBB0_6
LBB0_2:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_6
LBB0_4:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_free
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"socketpair://"

	.comm	_errno,4,2                      ## @errno
	.comm	_PF_UNIX,4,2                    ## @PF_UNIX
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_SP_SIDE_UNDEF,4,2              ## @SP_SIDE_UNDEF
	.comm	_SP_CTX_MAGIC,4,2               ## @SP_CTX_MAGIC
	.no_dead_strip	_sp_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sp_connect
_sp_connect:                            ; @sp_connect
	.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, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	cmp	x1, #0
	cset	w0, ne
	bl	_PJDLOG_ASSERT
	cmn	w21, #2
	cset	w0, gt
	bl	_PJDLOG_ASSERT
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_strcmp
	cbz	x0, LBB0_3
; %bb.1:
	mov	w21, #-1
LBB0_2:
	mov	x0, x21
	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
LBB0_3:
	cmp	x20, #0
	cset	w0, eq
	bl	_PJDLOG_ASSERT
	mov	w0, #12
	bl	_malloc
	cbz	x0, LBB0_6
; %bb.4:
	mov	x20, x0
Lloh2:
	adrp	x8, _PF_UNIX@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PF_UNIX@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	ldr	w3, [x20, #8]
	mov	w2, #0
	bl	_socketpair
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.5:
	mov	w21, #0
Lloh8:
	adrp	x8, _SP_SIDE_UNDEF@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SP_SIDE_UNDEF@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _SP_CTX_MAGIC@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SP_CTX_MAGIC@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	stp	w9, w8, [x20]
	str	x20, [x19]
	b	LBB0_2
LBB0_6:
Lloh14:
	adrp	x8, _errno@GOTPAGE
Lloh15:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh16:
	ldr	w21, [x8]
	b	LBB0_2
LBB0_7:
Lloh17:
	adrp	x8, _errno@GOTPAGE
Lloh18:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh19:
	ldr	w21, [x8]
	mov	x0, x20
	bl	_free
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"socketpair://"

	.comm	_errno,4,2                      ; @errno
	.comm	_PF_UNIX,4,2                    ; @PF_UNIX
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_SP_SIDE_UNDEF,4,2              ; @SP_SIDE_UNDEF
	.comm	_SP_CTX_MAGIC,4,2               ; @SP_CTX_MAGIC
	.no_dead_strip	_sp_connect
.subsections_via_symbols
