	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipc_connect                    ## -- Begin function ipc_connect
	.p2align	4, 0x90
_ipc_connect:                           ## @ipc_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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_sstrdup
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_6
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%rax, %rdi
	callq	_sstrdup
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_6
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_root_atom_contents
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
	callq	_sstrdup
	movq	%rax, %r14
LBB0_6:
	movq	_AF_LOCAL@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movl	%eax, %ebx
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_err
LBB0_8:
	movq	_F_SETFD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_FD_CLOEXEC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	callq	_fcntl
	leaq	-40(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movl	(%r12), %eax
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %edi
	movq	%r14, %rsi
	movl	$3, %edx
	callq	_strncpy
	movl	%ebx, %edi
	movq	%r15, %rsi
	movl	$8, %edx
	callq	_connect
	testq	%rax, %rax
	jns	LBB0_10
## %bb.9:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_10:
	movq	%r14, %rdi
	callq	_free
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"I3SOCK"

L_.str.1:                               ## @.str.1
	.asciz	"I3_SOCKET_PATH"

L_.str.2:                               ## @.str.2
	.asciz	"/tmp/i3-ipc.sock"

	.comm	_AF_LOCAL,4,2                   ## @AF_LOCAL
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
L_.str.3:                               ## @.str.3
	.asciz	"Could not create socket"

	.comm	_F_SETFD,4,2                    ## @F_SETFD
	.comm	_FD_CLOEXEC,4,2                 ## @FD_CLOEXEC
L_.str.4:                               ## @.str.4
	.asciz	"Could not connect to i3 on socket %s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipc_connect                    ; -- Begin function ipc_connect
	.p2align	2
_ipc_connect:                           ; @ipc_connect
	.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
	cbz	x0, LBB0_2
; %bb.1:
	bl	_sstrdup
	mov	x19, x0
	cbnz	x0, LBB0_6
LBB0_2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
	cbz	x0, LBB0_4
; %bb.3:
	bl	_sstrdup
	mov	x19, x0
	cbnz	x0, LBB0_6
LBB0_4:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, #0
	mov	w2, #0
	bl	_root_atom_contents
	mov	x19, x0
	cbnz	x0, LBB0_6
; %bb.5:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_sstrdup
	mov	x19, x0
LBB0_6:
Lloh6:
	adrp	x21, _AF_LOCAL@GOTPAGE
Lloh7:
	ldr	x21, [x21, _AF_LOCAL@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh8:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	mov	x20, x0
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.7:
Lloh11:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_err
LBB0_8:
Lloh16:
	adrp	x8, _F_SETFD@GOTPAGE
Lloh17:
	ldr	x8, [x8, _F_SETFD@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x8, _FD_CLOEXEC@GOTPAGE
Lloh20:
	ldr	x8, [x8, _FD_CLOEXEC@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_fcntl
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	w8, [x21]
	str	w8, [sp, #12]
	ldr	w0, [sp, #8]
	mov	x1, x19
	mov	w2, #3
	bl	_strncpy
	add	x1, sp, #8
	mov	x0, x20
	mov	w2, #8
	bl	_connect
	tbz	x0, #63, LBB0_10
; %bb.9:
Lloh22:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	str	x19, [sp]
Lloh25:
	adrp	x1, l_.str.4@PAGE
Lloh26:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_err
LBB0_10:
	mov	x0, x19
	bl	_free
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"I3SOCK"

l_.str.1:                               ; @.str.1
	.asciz	"I3_SOCKET_PATH"

l_.str.2:                               ; @.str.2
	.asciz	"/tmp/i3-ipc.sock"

	.comm	_AF_LOCAL,4,2                   ; @AF_LOCAL
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
l_.str.3:                               ; @.str.3
	.asciz	"Could not create socket"

	.comm	_F_SETFD,4,2                    ; @F_SETFD
	.comm	_FD_CLOEXEC,4,2                 ; @FD_CLOEXEC
l_.str.4:                               ; @.str.4
	.asciz	"Could not connect to i3 on socket %s"

.subsections_via_symbols
