	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_channel_close                  ## -- Begin function channel_close
	.p2align	4, 0x90
_channel_close:                         ## @channel_close
	.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, %r14
	movq	(%rdi), %rax
	movq	_CHANNEL_CLOSED@GOTPCREL(%rip), %rbx
	xorl	%edi, %edi
	cmpq	(%rbx), %rax
	setne	%dil
	callq	_assert
	movl	40(%r14), %esi
	leaq	L_.str(%rip), %rdi
	callq	_log_debug
	movq	(%rbx), %rax
	movq	%rax, (%r14)
	leaq	48(%r14), %rdi
	callq	_event_del
	leaq	44(%r14), %rdi
	callq	_event_del
	movl	40(%r14), %edi
	callq	_close
	decq	8(%r14)
	movq	$0, 32(%r14)
	leaq	28(%r14), %r15
	movq	%r15, %rdi
	callq	_STAILQ_FIRST
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %rbx
	movq	_next@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_STAILQ_REMOVE_HEAD
	movq	%rbx, %rdi
	callq	_pkthdr_free
	decl	24(%r14)
	movq	%r15, %rdi
	callq	_STAILQ_FIRST
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
LBB0_3:
	movq	16(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	callq	_pidfile_remove
	movq	$0, 16(%r14)
LBB0_5:
	cmpq	$0, 8(%r14)
	je	LBB0_7
## %bb.6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_channel_free                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CHANNEL_CLOSED,8,3             ## @CHANNEL_CLOSED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(fd#%d)"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_channel_close                  ; -- Begin function channel_close
	.p2align	2
_channel_close:                         ; @channel_close
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x20, _CHANNEL_CLOSED@GOTPAGE
Lloh1:
	ldr	x20, [x20, _CHANNEL_CLOSED@GOTPAGEOFF]
	ldr	x9, [x20]
	cmp	x8, x9
	cset	w0, ne
	bl	_assert
	ldr	w1, [x19, #40]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_log_debug
	ldr	x8, [x20]
	str	x8, [x19]
	add	x0, x19, #48
	bl	_event_del
	add	x0, x19, #44
	bl	_event_del
	ldr	w0, [x19, #40]
	bl	_close
	ldr	x8, [x19, #8]
	sub	x8, x8, #1
	str	x8, [x19, #8]
	str	xzr, [x19, #32]
	add	x20, x19, #28
	mov	x0, x20
	bl	_STAILQ_FIRST
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
Lloh4:
	adrp	x22, _next@GOTPAGE
Lloh5:
	ldr	x22, [x22, _next@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x20
	bl	_STAILQ_REMOVE_HEAD
	mov	x0, x21
	bl	_pkthdr_free
	ldr	w8, [x19, #24]
	sub	w8, w8, #1
	str	w8, [x19, #24]
	mov	x0, x20
	bl	_STAILQ_FIRST
	mov	x21, x0
	cbnz	x0, LBB0_2
LBB0_3:
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_5
; %bb.4:
	bl	_pidfile_remove
	str	xzr, [x19, #16]
LBB0_5:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_7
; %bb.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:
	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_free
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_CHANNEL_CLOSED,8,3             ; @CHANNEL_CLOSED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(fd#%d)"

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