	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_daemon_open_shared_ports       ## -- Begin function daemon_open_shared_ports
	.p2align	4, 0x90
_daemon_open_shared_ports:              ## @daemon_open_shared_ports
	.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	%rdi, %r12
	callq	_log_assert
	movq	32(%r12), %rdi
	movq	(%rdi), %rax
	cmpq	(%r12), %rax
	je	LBB0_19
## %bb.1:
	leaq	8(%r12), %r14
	movl	$0, 8(%r12)
	movq	48(%r12), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	cmpq	$0, 16(%r12)
	je	LBB0_5
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rax,%rbx,8), %rdi
	callq	_listening_ports_free
	incq	%rbx
	movq	48(%r12), %rax
	cmpq	16(%r12), %rbx
	jb	LBB0_4
LBB0_5:
	movq	%rax, %rdi
	callq	_free
	movq	$0, 48(%r12)
	movq	32(%r12), %rdi
LBB0_6:
	movq	%r14, %rsi
	callq	_listening_ports_open
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	%rax, %r15
	cmpl	$0, (%r14)
	je	LBB0_10
## %bb.8:
	movq	32(%r12), %rax
	movq	8(%rax), %rdi
	jmp	LBB0_11
LBB0_9:
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	_listening_ports_free
	jmp	LBB0_32
LBB0_10:
	movl	$1, %edi
LBB0_11:
	movq	%rdi, 16(%r12)
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$8, %esi
	callq	_calloc
	movq	%rax, 48(%r12)
	testq	%rax, %rax
	je	LBB0_25
## %bb.12:
	movq	%r15, (%rax)
	cmpl	$0, (%r14)
	je	LBB0_18
## %bb.13:
	cmpq	$2, 16(%r12)
	jb	LBB0_18
## %bb.14:
	movl	$1, %r15d
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %rdi
	movq	%r14, %rsi
	callq	_listening_ports_open
	movq	48(%r12), %rcx
	movq	%rax, (%rcx,%r15,8)
	testq	%rax, %rax
	je	LBB0_27
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	cmpl	$0, (%r14)
	je	LBB0_27
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=1
	incq	%r15
	cmpq	16(%r12), %r15
	jb	LBB0_15
LBB0_18:
	movq	32(%r12), %rdi
	movq	(%rdi), %rax
	movq	%rax, (%r12)
LBB0_19:
	cmpq	$0, 24(%rdi)
	je	LBB0_23
LBB0_20:
	movq	16(%rdi), %rax
	movl	$1, %r14d
	cmpq	24(%r12), %rax
	je	LBB0_32
## %bb.21:
	movq	40(%r12), %rdi
	callq	_listening_ports_free
	movq	32(%r12), %rdi
	callq	_daemon_remote_open_ports
	movq	%rax, 40(%r12)
	testq	%rax, %rax
	je	LBB0_31
## %bb.22:
	movq	32(%r12), %rax
	movq	16(%rax), %rax
	movq	%rax, 24(%r12)
	jmp	LBB0_32
LBB0_23:
	movl	$1, %r14d
	cmpq	$0, 24(%r12)
	je	LBB0_32
## %bb.24:
	movq	40(%r12), %rdi
	callq	_listening_ports_free
	movq	$0, 40(%r12)
	movq	$0, 24(%r12)
	movq	32(%r12), %rdi
	cmpq	$0, 24(%rdi)
	jne	LBB0_20
	jmp	LBB0_32
LBB0_25:
	movq	%r15, %rdi
	callq	_listening_ports_free
	jmp	LBB0_31
LBB0_27:
	cmpq	$0, 16(%r12)
	je	LBB0_30
## %bb.28:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movq	48(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_listening_ports_free
	incq	%rbx
	cmpq	16(%r12), %rbx
	jb	LBB0_29
LBB0_30:
	movq	48(%r12), %rdi
	callq	_free
	movq	$0, 48(%r12)
LBB0_31:
	xorl	%r14d, %r14d
LBB0_32:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_daemon_open_shared_ports       ; -- Begin function daemon_open_shared_ports
	.p2align	2
_daemon_open_shared_ports:              ; @daemon_open_shared_ports
	.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, x0
	bl	_log_assert
	ldr	x0, [x19, #32]
	ldr	x8, [x0]
	ldr	x9, [x19]
	cmp	x8, x9
	b.eq	LBB0_18
; %bb.1:
	mov	x20, x19
	str	wzr, [x20, #8]!
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_6
; %bb.2:
	ldr	x9, [x19, #16]
	cbz	x9, LBB0_5
; %bb.3:
	mov	x21, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x8, x21, lsl #3]
	bl	_listening_ports_free
	add	x21, x21, #1
	ldr	x9, [x19, #16]
	ldr	x8, [x19, #48]
	cmp	x21, x9
	b.lo	LBB0_4
LBB0_5:
	mov	x0, x8
	bl	_free
	str	xzr, [x19, #48]
	ldr	x0, [x19, #32]
LBB0_6:
	mov	x1, x20
	bl	_listening_ports_open
	cbz	x0, LBB0_26
; %bb.7:
	mov	x21, x0
	ldr	w8, [x20]
	cbz	w8, LBB0_9
; %bb.8:
	ldr	x8, [x19, #32]
	ldr	x0, [x8, #8]
	b	LBB0_10
LBB0_9:
	mov	w0, #1
LBB0_10:
	str	x0, [x19, #16]
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	w1, #8
	bl	_calloc
	str	x0, [x19, #48]
	cbz	x0, LBB0_25
; %bb.11:
	str	x21, [x0]
	ldr	w8, [x20]
	cbz	w8, LBB0_17
; %bb.12:
	ldr	x8, [x19, #16]
	cmp	x8, #2
	b.lo	LBB0_17
; %bb.13:
	mov	w21, #1
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19, #32]
	mov	x1, x20
	bl	_listening_ports_open
	ldr	x8, [x19, #48]
	str	x0, [x8, x21, lsl #3]
	cbz	x0, LBB0_28
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x20]
	cbz	w8, LBB0_28
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	add	x21, x21, #1
	ldr	x8, [x19, #16]
	cmp	x21, x8
	b.lo	LBB0_14
LBB0_17:
	ldr	x0, [x19, #32]
	ldr	x8, [x0]
	str	x8, [x19]
LBB0_18:
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_22
LBB0_19:
	ldr	x8, [x0, #16]
	ldr	x9, [x19, #24]
	cmp	x8, x9
	b.eq	LBB0_24
; %bb.20:
	ldr	x0, [x19, #40]
	bl	_listening_ports_free
	ldr	x0, [x19, #32]
	bl	_daemon_remote_open_ports
	str	x0, [x19, #40]
	cbz	x0, LBB0_27
; %bb.21:
	ldr	x8, [x19, #32]
	ldr	x8, [x8, #16]
	str	x8, [x19, #24]
	b	LBB0_24
LBB0_22:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_24
; %bb.23:
	ldr	x0, [x19, #40]
	bl	_listening_ports_free
	str	xzr, [x19, #40]
	str	xzr, [x19, #24]
	ldr	x0, [x19, #32]
	ldr	x8, [x0, #24]
	cbnz	x8, LBB0_19
LBB0_24:
	mov	w0, #1
	b	LBB0_27
LBB0_25:
	mov	x0, x21
LBB0_26:
	bl	_listening_ports_free
	mov	w0, #0
LBB0_27:
	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_28:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_31
; %bb.29:
	mov	x20, #0
LBB0_30:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #48]
	ldr	x0, [x8, x20, lsl #3]
	bl	_listening_ports_free
	add	x20, x20, #1
	ldr	x8, [x19, #16]
	cmp	x20, x8
	b.lo	LBB0_30
LBB0_31:
	ldr	x0, [x19, #48]
	bl	_free
	mov	w0, #0
	str	xzr, [x19, #48]
	b	LBB0_27
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
