	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ssh_packet_write_poll          ## -- Begin function ssh_packet_write_poll
	.p2align	4, 0x90
_ssh_packet_write_poll:                 ## @ssh_packet_write_poll
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r15
	movl	(%r15), %edi
	callq	_sshbuf_len
	testl	%eax, %eax
	jle	LBB0_8
## %bb.1:
	movl	%eax, %ebx
	movl	(%r15), %edi
	movl	4(%r15), %r14d
	callq	_sshbuf_ptr
	movl	%r14d, %edi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_write
	testl	%eax, %eax
	je	LBB0_6
## %bb.2:
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.3:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_EINTR@GOTPCREL(%rip), %rdx
	movq	_EAGAIN@GOTPCREL(%rip), %rdi
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rbx
	xorl	%esi, %esi
	movl	$0, %eax
	cmpq	(%rbx), %rcx
	je	LBB0_5
## %bb.4:
	movq	_SSH_ERR_SYSTEM_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_5:
	cmpq	(%rdi), %rcx
	cmovel	%esi, %eax
	cmpq	(%rdx), %rcx
	cmovel	%esi, %eax
	jmp	LBB0_9
LBB0_6:
	movq	_SSH_ERR_CONN_CLOSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_9
LBB0_7:
	movl	(%r15), %edi
	movl	%eax, %esi
	callq	_sshbuf_consume
	testl	%eax, %eax
	jne	LBB0_9
LBB0_8:
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
	.comm	_EAGAIN,8,3                     ## @EAGAIN
	.comm	_EWOULDBLOCK,8,3                ## @EWOULDBLOCK
	.comm	_SSH_ERR_SYSTEM_ERROR,4,2       ## @SSH_ERR_SYSTEM_ERROR
	.comm	_SSH_ERR_CONN_CLOSED,4,2        ## @SSH_ERR_CONN_CLOSED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ssh_packet_write_poll          ; -- Begin function ssh_packet_write_poll
	.p2align	2
_ssh_packet_write_poll:                 ; @ssh_packet_write_poll
	.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
	ldr	x21, [x0]
	ldr	w0, [x21]
	bl	_sshbuf_len
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x19, x0
	ldp	w0, w20, [x21]
	bl	_sshbuf_ptr
	mov	x1, x0
	mov	x0, x20
	mov	x2, x19
	bl	_write
	cbz	w0, LBB0_4
; %bb.2:
	mov	x1, x0
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.3:
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _EINTR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EINTR@GOTPAGEOFF]
Lloh5:
	adrp	x10, _EAGAIN@GOTPAGE
Lloh6:
	ldr	x10, [x10, _EAGAIN@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
Lloh8:
	ldr	x10, [x10]
Lloh9:
	adrp	x11, _EWOULDBLOCK@GOTPAGE
Lloh10:
	ldr	x11, [x11, _EWOULDBLOCK@GOTPAGEOFF]
Lloh11:
	ldr	x11, [x11]
	cmp	x8, x11
	ccmp	x8, x10, #4, ne
	ccmp	x8, x9, #4, ne
Lloh12:
	adrp	x8, _SSH_ERR_SYSTEM_ERROR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SSH_ERR_SYSTEM_ERROR@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	csel	w0, wzr, w8, eq
	b	LBB0_7
LBB0_4:
Lloh15:
	adrp	x8, _SSH_ERR_CONN_CLOSED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SSH_ERR_CONN_CLOSED@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	b	LBB0_7
LBB0_5:
	ldr	w0, [x21]
	bl	_sshbuf_consume
	cbnz	w0, LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	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 AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
	.comm	_EAGAIN,8,3                     ; @EAGAIN
	.comm	_EWOULDBLOCK,8,3                ; @EWOULDBLOCK
	.comm	_SSH_ERR_SYSTEM_ERROR,4,2       ; @SSH_ERR_SYSTEM_ERROR
	.comm	_SSH_ERR_CONN_CLOSED,4,2        ; @SSH_ERR_CONN_CLOSED
.subsections_via_symbols
