	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chan_set_ostate
_chan_set_ostate:                       ## @chan_set_ostate
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rsi
	movq	_CHAN_OUTPUT_CLOSED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rsi
	ja	LBB0_2
## %bb.1:
	cmpq	%r14, %rax
	jae	LBB0_3
LBB0_2:
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rdx
	callq	_fatal
	movq	(%rbx), %rsi
LBB0_3:
	movl	8(%rbx), %eax
	movq	_ostates@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%rsi,4), %edx
	movl	(%rcx,%r14,4), %ecx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_debug2
	movq	%r14, (%rbx)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CHAN_OUTPUT_CLOSED,8,3         ## @CHAN_OUTPUT_CLOSED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"chan_set_ostate: bad state %d -> %d"

L_.str.1:                               ## @.str.1
	.asciz	"channel %d: output %s -> %s"

	.comm	_ostates,8,3                    ## @ostates
	.no_dead_strip	_chan_set_ostate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chan_set_ostate
_chan_set_ostate:                       ; @chan_set_ostate
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	ldr	x1, [x0]
Lloh0:
	adrp	x8, _CHAN_OUTPUT_CLOSED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CHAN_OUTPUT_CLOSED@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x1, x8
	ccmp	x8, x19, #0, ls
	b.hs	LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x19
	bl	_fatal
	ldr	x1, [x20]
LBB0_2:
Lloh5:
	adrp	x9, _ostates@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ostates@GOTPAGEOFF]
	ldr	w8, [x20, #8]
Lloh7:
	ldr	x9, [x9]
	ldr	w2, [x9, x1, lsl #2]
	ldr	w3, [x9, x19, lsl #2]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x8
	bl	_debug2
	str	x19, [x20]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_CHAN_OUTPUT_CLOSED,8,3         ; @CHAN_OUTPUT_CLOSED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"chan_set_ostate: bad state %d -> %d"

l_.str.1:                               ; @.str.1
	.asciz	"channel %d: output %s -> %s"

	.comm	_ostates,8,3                    ; @ostates
	.no_dead_strip	_chan_set_ostate
.subsections_via_symbols
