	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_chan_rcvd_oclose               ## -- Begin function chan_rcvd_oclose
	.p2align	4, 0x90
_chan_rcvd_oclose:                      ## @chan_rcvd_oclose
	.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	%rsi, %rbx
	movq	%rdi, %r14
	movl	24(%rsi), %esi
	leaq	L_.str(%rip), %rdi
	callq	_debug2
	movl	(%rbx), %eax
	movq	_CHAN_LOCAL@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	jne	LBB0_4
## %bb.1:
	movq	_CHAN_CLOSE_RCVD@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	testl	%eax, %ecx
	je	LBB0_3
## %bb.2:
	movl	24(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_error
	movl	(%r12), %ecx
	movl	(%rbx), %eax
LBB0_3:
	orl	%ecx, %eax
	movl	%eax, (%rbx)
LBB0_4:
	movq	8(%rbx), %rax
	movq	_SSH_CHANNEL_LARVAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	_CHAN_OUTPUT_CLOSED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_chan_set_ostate
	jmp	LBB0_13
LBB0_6:
	cmpl	$128, 16(%rbx)
	jne	LBB0_8
## %bb.7:
	movq	_CHAN_OUTPUT_WAIT_DRAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_chan_set_ostate
LBB0_8:
	movl	20(%rbx), %eax
	cmpl	$129, %eax
	je	LBB0_11
## %bb.9:
	cmpl	$130, %eax
	jne	LBB0_14
## %bb.10:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_chan_shutdown_read
	jmp	LBB0_13
LBB0_11:
	movl	(%r15), %eax
	testl	%eax, (%rbx)
	jne	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_chan_send_eof2
LBB0_13:
	movq	_CHAN_INPUT_CLOSED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_chan_set_istate                ## TAILCALL
LBB0_14:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"channel %d: rcvd close"

	.comm	_CHAN_LOCAL,4,2                 ## @CHAN_LOCAL
	.comm	_CHAN_CLOSE_RCVD,4,2            ## @CHAN_CLOSE_RCVD
L_.str.1:                               ## @.str.1
	.asciz	"channel %d: protocol error: close rcvd twice"

	.comm	_SSH_CHANNEL_LARVAL,8,3         ## @SSH_CHANNEL_LARVAL
	.comm	_CHAN_OUTPUT_CLOSED,4,2         ## @CHAN_OUTPUT_CLOSED
	.comm	_CHAN_INPUT_CLOSED,4,2          ## @CHAN_INPUT_CLOSED
	.comm	_CHAN_OUTPUT_WAIT_DRAIN,4,2     ## @CHAN_OUTPUT_WAIT_DRAIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_chan_rcvd_oclose               ; -- Begin function chan_rcvd_oclose
	.p2align	2
_chan_rcvd_oclose:                      ; @chan_rcvd_oclose
	.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, x1
	mov	x20, x0
	ldr	w1, [x1, #24]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_debug2
	ldr	w8, [x19]
Lloh2:
	adrp	x21, _CHAN_LOCAL@GOTPAGE
Lloh3:
	ldr	x21, [x21, _CHAN_LOCAL@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	b.ne	LBB0_4
; %bb.1:
Lloh4:
	adrp	x22, _CHAN_CLOSE_RCVD@GOTPAGE
Lloh5:
	ldr	x22, [x22, _CHAN_CLOSE_RCVD@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	ldr	w1, [x19, #24]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_error
	ldr	w9, [x22]
	ldr	w8, [x19]
LBB0_3:
	orr	w8, w8, w9
	str	w8, [x19]
LBB0_4:
	ldr	x8, [x19, #8]
Lloh8:
	adrp	x9, _SSH_CHANNEL_LARVAL@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SSH_CHANNEL_LARVAL@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
Lloh11:
	adrp	x8, _CHAN_OUTPUT_CLOSED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CHAN_OUTPUT_CLOSED@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_chan_set_ostate
	b	LBB0_13
LBB0_6:
	ldr	w8, [x19, #16]
	cmp	w8, #128
	b.ne	LBB0_8
; %bb.7:
Lloh14:
	adrp	x8, _CHAN_OUTPUT_WAIT_DRAIN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CHAN_OUTPUT_WAIT_DRAIN@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_chan_set_ostate
LBB0_8:
	ldr	w8, [x19, #20]
	cmp	w8, #129
	b.eq	LBB0_11
; %bb.9:
	cmp	w8, #130
	b.ne	LBB0_14
; %bb.10:
	mov	x0, x20
	mov	x1, x19
	bl	_chan_shutdown_read
	b	LBB0_13
LBB0_11:
	ldr	w8, [x19]
	ldr	w9, [x21]
	tst	w9, w8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x20
	mov	x1, x19
	bl	_chan_send_eof2
LBB0_13:
Lloh17:
	adrp	x8, _CHAN_INPUT_CLOSED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CHAN_INPUT_CLOSED@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	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	_chan_set_istate
LBB0_14:
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"channel %d: rcvd close"

	.comm	_CHAN_LOCAL,4,2                 ; @CHAN_LOCAL
	.comm	_CHAN_CLOSE_RCVD,4,2            ; @CHAN_CLOSE_RCVD
l_.str.1:                               ; @.str.1
	.asciz	"channel %d: protocol error: close rcvd twice"

	.comm	_SSH_CHANNEL_LARVAL,8,3         ; @SSH_CHANNEL_LARVAL
	.comm	_CHAN_OUTPUT_CLOSED,4,2         ; @CHAN_OUTPUT_CLOSED
	.comm	_CHAN_INPUT_CLOSED,4,2          ; @CHAN_INPUT_CLOSED
	.comm	_CHAN_OUTPUT_WAIT_DRAIN,4,2     ; @CHAN_OUTPUT_WAIT_DRAIN
.subsections_via_symbols
