	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function send_msg
_send_msg:                              ## @send_msg
	.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	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	%rsi, %rdi
	callq	_sshbuf_len
	movq	_SFTP_MAX_MSG_LENGTH@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_sshbuf_len
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_fatal
LBB0_2:
	movq	%r14, %rdi
	callq	_sshbuf_len
	leaq	-48(%rbp), %r15
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_put_u32
	movq	%r15, -72(%rbp)
	movl	$16, -80(%rbp)
	movq	%r14, %rdi
	callq	_sshbuf_ptr
	movq	%rax, -56(%rbp)
	movq	%r14, %rdi
	callq	_sshbuf_len
	movl	%eax, -64(%rbp)
	movq	_writev@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	12(%rbx), %esi
	cmpq	$0, (%rbx)
	jle	LBB0_3
## %bb.4:
	movq	_sftpio@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	jmp	LBB0_5
LBB0_3:
	xorl	%r8d, %r8d
LBB0_5:
	addq	$8, %rbx
	leaq	-80(%rbp), %rdx
	movl	$2, %ecx
	movq	%rbx, %r9
	callq	_atomiciov6
	movslq	%eax, %rbx
	movq	%r14, %rdi
	callq	_sshbuf_len
	cltq
	addq	$16, %rax
	cmpq	%rbx, %rax
	je	LBB0_7
## %bb.6:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_fatal
LBB0_7:
	movq	%r14, %rdi
	callq	_sshbuf_reset
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	addq	$56, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SFTP_MAX_MSG_LENGTH,4,2        ## @SFTP_MAX_MSG_LENGTH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Outbound message too long %zu"

	.comm	_writev,4,2                     ## @writev
	.comm	_sftpio,8,3                     ## @sftpio
L_.str.1:                               ## @.str.1
	.asciz	"Couldn't send packet: %s"

	.comm	_errno,4,2                      ## @errno
	.no_dead_strip	_send_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function send_msg
_send_msg:                              ; @send_msg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	mov	x0, x1
	bl	_sshbuf_len
Lloh3:
	adrp	x8, _SFTP_MAX_MSG_LENGTH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SFTP_MAX_MSG_LENGTH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w0, w8
	b.le	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_sshbuf_len
	mov	x1, x0
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fatal
LBB0_2:
	mov	x0, x19
	bl	_sshbuf_len
	mov	x1, x0
	add	x21, sp, #40
	add	x0, sp, #40
	bl	_put_u32
	str	x21, [sp, #16]
	mov	w8, #16
	str	w8, [sp, #8]
	mov	x0, x19
	bl	_sshbuf_ptr
	str	x0, [sp, #32]
	mov	x0, x19
	bl	_sshbuf_len
	str	w0, [sp, #24]
Lloh8:
	adrp	x8, _writev@GOTPAGE
Lloh9:
	ldr	x8, [x8, _writev@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldr	w1, [x20, #12]
	ldr	x8, [x20]
Lloh11:
	adrp	x9, _sftpio@GOTPAGE
Lloh12:
	ldr	x9, [x9, _sftpio@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, #0
	csel	x4, x9, xzr, gt
	add	x5, x20, #8
	add	x2, sp, #8
	mov	w3, #2
	bl	_atomiciov6
	mov	x20, x0
	mov	x0, x19
	bl	_sshbuf_len
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	add	x8, x8, #16
	cmp	x8, w20, sxtw
	b.eq	LBB0_4
; %bb.3:
Lloh14:
	adrp	x8, _errno@GOTPAGE
Lloh15:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_strerror
	mov	x1, x0
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_fatal
LBB0_4:
	mov	x0, x19
	bl	_sshbuf_reset
	ldur	x8, [x29, #-40]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_SFTP_MAX_MSG_LENGTH,4,2        ; @SFTP_MAX_MSG_LENGTH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Outbound message too long %zu"

	.comm	_writev,4,2                     ; @writev
	.comm	_sftpio,8,3                     ; @sftpio
l_.str.1:                               ; @.str.1
	.asciz	"Couldn't send packet: %s"

	.comm	_errno,4,2                      ; @errno
	.no_dead_strip	_send_msg
.subsections_via_symbols
