	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chan_shutdown_write
_chan_shutdown_write:                   ## @chan_shutdown_write
	.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, %rbx
	movq	%rdi, %r14
	movl	20(%rsi), %edi
	callq	_sshbuf_reset
	movq	(%rbx), %rax
	movq	_SSH_CHANNEL_LARVAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.1:
	movl	16(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_debug2
	movl	8(%rbx), %edi
	cmpl	$-1, %edi
	je	LBB0_4
## %bb.2:
	movq	_SHUT_WR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_shutdown
	testq	%rax, %rax
	jns	LBB0_5
## %bb.3:
	movl	8(%rbx), %r14d
	movl	16(%rbx), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_debug2                         ## TAILCALL
LBB0_4:
	leaq	12(%rbx), %rsi
	movq	%r14, %rdi
	callq	_channel_close_fd
	testq	%rax, %rax
	js	LBB0_6
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	movl	12(%rbx), %r14d
	movl	16(%rbx), %ebx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	movl	%eax, %ecx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_logit                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SSH_CHANNEL_LARVAL,8,3         ## @SSH_CHANNEL_LARVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"channel %d: close_write"

	.comm	_SHUT_WR,4,2                    ## @SHUT_WR
L_.str.1:                               ## @.str.1
	.asciz	"channel %d: chan_shutdown_write: shutdown() failed for fd %d: %.100s"

	.comm	_errno,4,2                      ## @errno
L_.str.2:                               ## @.str.2
	.asciz	"channel %d: chan_shutdown_write: close() failed for fd %d: %.100s"

	.no_dead_strip	_chan_shutdown_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chan_shutdown_write
_chan_shutdown_write:                   ; @chan_shutdown_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x1, #20]
	bl	_sshbuf_reset
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _SSH_CHANNEL_LARVAL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SSH_CHANNEL_LARVAL@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.1:
	ldr	w1, [x19, #16]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_debug2
	ldr	w0, [x19, #8]
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.2:
Lloh5:
	adrp	x8, _SHUT_WR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SHUT_WR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_shutdown
	tbz	x0, #63, LBB0_5
; %bb.3:
	ldr	w20, [x19, #16]
Lloh8:
	adrp	x8, _errno@GOTPAGE
Lloh9:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldr	w19, [x19, #8]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x19, x0, [sp]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_debug2
	b	LBB0_5
LBB0_4:
	add	x1, x19, #12
	mov	x0, x20
	bl	_channel_close_fd
	tbnz	x0, #63, LBB0_6
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_6:
	ldp	w19, w20, [x19, #12]
Lloh13:
	adrp	x8, _errno@GOTPAGE
Lloh14:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_strerror
	mov	x3, x0
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	mov	x2, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_logit
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_SSH_CHANNEL_LARVAL,8,3         ; @SSH_CHANNEL_LARVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"channel %d: close_write"

	.comm	_SHUT_WR,4,2                    ; @SHUT_WR
l_.str.1:                               ; @.str.1
	.asciz	"channel %d: chan_shutdown_write: shutdown() failed for fd %d: %.100s"

	.comm	_errno,4,2                      ; @errno
l_.str.2:                               ; @.str.2
	.asciz	"channel %d: chan_shutdown_write: close() failed for fd %d: %.100s"

	.no_dead_strip	_chan_shutdown_write
.subsections_via_symbols
