	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sm_connect_unix                ## -- Begin function sm_connect_unix
	.p2align	4, 0x90
_sm_connect_unix:                       ## @sm_connect_unix
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	leaq	-24(%rbp), %rsi
	callq	_stat
	testq	%rax, %rax
	je	LBB0_1
LBB0_2:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movq	%r14, %rdx
	movq	%rax, %rcx
	callq	_fprintf
LBB0_10:
	movl	$-1, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movl	-24(%rbp), %edi
	callq	_S_ISSOCK
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movq	_PF_UNIX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movl	%eax, %ebx
	movq	_F_GETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_fcntl
	movq	_F_SETFL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%ebx, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fcntl
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movq	_AF_UNIX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movq	%r14, %rsi
	movl	$3, %edx
	callq	_strncpy
	leaq	-32(%rbp), %rsi
	movl	%ebx, %edi
	movl	$8, %edx
	callq	_connect
	testq	%rax, %rax
	jns	LBB0_11
## %bb.8:
	movl	%ebx, %edi
	callq	_close
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_9
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_9
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
LBB0_9:
	callq	_perror
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"File '%s' is not a socket: %s\n"

	.comm	_errno,4,2                      ## @errno
	.comm	_PF_UNIX,4,2                    ## @PF_UNIX
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
L_.str.1:                               ## @.str.1
	.asciz	"create socket failed"

	.comm	_F_GETFL,4,2                    ## @F_GETFL
	.comm	_F_SETFL,4,2                    ## @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
L_.str.2:                               ## @.str.2
	.asciz	"failed to set socket to non-blocking"

	.comm	_AF_UNIX,4,2                    ## @AF_UNIX
L_.str.3:                               ## @.str.3
	.asciz	"connect failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sm_connect_unix                ; -- Begin function sm_connect_unix
	.p2align	2
_sm_connect_unix:                       ; @sm_connect_unix
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
	add	x1, sp, #16
	bl	_stat
	cbz	x0, LBB0_4
LBB0_1:
Lloh0:
	adrp	x8, _stderr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x8, _errno@GOTPAGE
Lloh4:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_strerror
	mov	x3, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_fprintf
LBB0_2:
	mov	w20, #-1
LBB0_3:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_4:
	ldr	w0, [sp, #16]
	bl	_S_ISSOCK
	cbz	w0, LBB0_1
; %bb.5:
Lloh8:
	adrp	x8, _PF_UNIX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PF_UNIX@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	tbnz	w0, #31, LBB0_9
; %bb.6:
	mov	x20, x0
Lloh14:
	adrp	x8, _F_GETFL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _F_GETFL@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_fcntl
Lloh17:
	adrp	x8, _F_SETFL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _F_SETFL@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _O_NONBLOCK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _O_NONBLOCK@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	orr	w8, w8, w0
	str	x8, [sp]
	mov	x0, x20
	bl	_fcntl
	tbnz	w0, #31, LBB0_10
; %bb.7:
Lloh23:
	adrp	x8, _AF_UNIX@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AF_UNIX@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	str	w8, [sp, #28]
	mov	x1, x19
	mov	w2, #3
	bl	_strncpy
	add	x1, sp, #24
	mov	x0, x20
	mov	w2, #8
	bl	_connect
	tbz	x0, #63, LBB0_3
; %bb.8:
	mov	x0, x20
	bl	_close
Lloh26:
	adrp	x0, l_.str.3@PAGE
Lloh27:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_11
LBB0_9:
Lloh28:
	adrp	x0, l_.str.1@PAGE
Lloh29:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh30:
	adrp	x0, l_.str.2@PAGE
Lloh31:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_11:
	bl	_perror
	b	LBB0_2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"File '%s' is not a socket: %s\n"

	.comm	_errno,4,2                      ; @errno
	.comm	_PF_UNIX,4,2                    ; @PF_UNIX
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
l_.str.1:                               ; @.str.1
	.asciz	"create socket failed"

	.comm	_F_GETFL,4,2                    ; @F_GETFL
	.comm	_F_SETFL,4,2                    ; @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
l_.str.2:                               ; @.str.2
	.asciz	"failed to set socket to non-blocking"

	.comm	_AF_UNIX,4,2                    ; @AF_UNIX
l_.str.3:                               ; @.str.3
	.asciz	"connect failed"

.subsections_via_symbols
