	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function channel_start
_channel_start:                         ## @channel_start
	.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	%rdx, %r15
	movl	$1, (%rdx)
	cmpq	$0, 8(%rdx)
	jle	LBB0_6
## %bb.1:
	leaq	24(%r15), %r14
	movq	_next@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_STAILQ_FIRST
	movq	%rax, %rbx
	movq	%r15, %rdi
	movl	$10, %esi
	callq	_channel_timeout
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	*16(%r15)
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_STAILQ_REMOVE_HEAD
	movq	%rbx, %rdi
	callq	_pkthdr_free
	movq	8(%r15), %rax
	leaq	-1(%rax), %rcx
	movq	%rcx, 8(%r15)
	cmpq	$1, %rax
	jg	LBB0_2
LBB0_6:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_channel_timeout
	movl	$0, (%r15)
	jmp	LBB0_7
LBB0_3:
	leaq	28(%r15), %rdi
	xorl	%esi, %esi
	callq	_event_add
	cmpl	$-1, %eax
	je	LBB0_4
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_log_err
	movq	%r15, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_channel_close                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not add channel write event: %m"

	.comm	_next,4,2                       ## @next
	.no_dead_strip	_channel_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function channel_start
_channel_start:                         ; @channel_start
	.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, x2
	mov	w8, #1
	str	w8, [x2]
	ldr	x8, [x2, #8]
	cmp	x8, #1
	b.lt	LBB0_4
; %bb.1:
	add	x20, x19, #24
Lloh0:
	adrp	x22, _next@GOTPAGE
Lloh1:
	ldr	x22, [x22, _next@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_STAILQ_FIRST
	mov	x21, x0
	mov	x0, x19
	mov	w1, #10
	bl	_channel_timeout
	ldr	x8, [x19, #16]
	ldr	w1, [x21]
	mov	x0, x19
	blr	x8
	cbz	w0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x22]
	mov	x0, x20
	bl	_STAILQ_REMOVE_HEAD
	mov	x0, x21
	bl	_pkthdr_free
	ldr	x8, [x19, #8]
	subs	x8, x8, #1
	str	x8, [x19, #8]
	b.gt	LBB0_2
LBB0_4:
	mov	x0, x19
	mov	w1, #0
	bl	_channel_timeout
	str	wzr, [x19]
	b	LBB0_6
LBB0_5:
	add	x0, x19, #28
	mov	x1, #0
	bl	_event_add
	cmn	w0, #1
	b.eq	LBB0_7
LBB0_6:
	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_7:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_log_err
	mov	x0, x19
	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
	b	_channel_close
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not add channel write event: %m"

	.comm	_next,4,2                       ; @next
	.no_dead_strip	_channel_start
.subsections_via_symbols
