	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rpc_write_out
_rpc_write_out:                         ## @rpc_write_out
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rdi)
	js	LBB0_1
## %bb.2:
	movl	%edx, %r14d
	testl	%edx, %edx
	je	LBB0_3
## %bb.4:
	movq	%rsi, %r15
	movq	%rdi, %r13
	movsd	%xmm0, -48(%rbp)                ## 8-byte Spill
	movq	_write_out@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_ADD_CNT
	movl	(%rbx), %edi
	callq	_START_TIMER
	movl	8(%r13), %r12d
	leal	(%r12,%r14), %esi
	movq	_RPC_OUT_BUF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%esi, %ecx
	subl	%r8d, %ecx
	jge	LBB0_6
## %bb.5:
	movl	%r14d, %r12d
	jmp	LBB0_9
LBB0_1:
	movl	$-1, %ebx
	jmp	LBB0_16
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_6:
	addl	$1024, %ecx                     ## imm = 0x400
	movq	%r13, %rdi
	movsd	-48(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_rpc_sock_write
	movl	$-1, %ebx
	testl	%eax, %eax
	js	LBB0_15
## %bb.7:
	xorl	%ecx, %ecx
	subl	%r12d, %eax
	cmovlel	%ecx, %eax
	movl	%r14d, %r12d
	subl	%eax, %r12d
	movl	8(%r13), %esi
	addl	%r12d, %esi
	movq	_RPC_OUT_BUF_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	cmpl	%r8d, %esi
	jge	LBB0_17
## %bb.8:
	cltq
	addq	%rax, %r15
LBB0_9:
	movl	%esi, 8(%r13)
	movq	24(%r13), %rdi
	cmpq	%rdi, 16(%r13)
	jle	LBB0_10
## %bb.13:
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	movslq	%r12d, %rax
	addq	%rax, 24(%r13)
	jmp	LBB0_14
LBB0_10:
	movslq	%r12d, %rdx
	leaq	(%rdi,%rdx), %rax
	movslq	%r8d, %rbx
	addq	32(%r13), %rbx
	cmpq	%rbx, %rax
	jle	LBB0_11
## %bb.12:
	subq	%rdi, %rbx
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movl	32(%r13), %edi
	movslq	%ebx, %rax
	addq	%rax, %r15
	subl	%eax, %r12d
	movq	%r15, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	movslq	%r12d, %rax
	addq	32(%r13), %rax
	movq	%rax, 24(%r13)
	jmp	LBB0_14
LBB0_11:
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r15, %rsi
	movq	%rdx, %rbx
	callq	_memcpy
	addq	%rbx, 24(%r13)
LBB0_14:
	movl	%r14d, %ebx
LBB0_15:
	movq	_write_out@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_END_TIMER
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_rpc_server_seterror
	movq	%r13, %rdi
	callq	_rpc_server_failure
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_write_out,4,2                  ## @write_out
	.comm	_RPC_OUT_BUF_SIZE,4,2           ## @RPC_OUT_BUF_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Write timeout"

	.no_dead_strip	_rpc_write_out
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rpc_write_out
_rpc_write_out:                         ; @rpc_write_out
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-80]!             ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset b8, -72
	.cfi_offset b9, -80
	ldr	x8, [x0]
	tbnz	x8, #63, LBB0_4
; %bb.1:
	mov	x19, x2
	cbz	w2, LBB0_16
; %bb.2:
	fmov	d8, d0
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x24, _write_out@GOTPAGE
Lloh1:
	ldr	x24, [x24, _write_out@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_ADD_CNT
	ldr	w0, [x24]
	bl	_START_TIMER
	ldr	w22, [x20, #8]
Lloh2:
	adrp	x23, _RPC_OUT_BUF_SIZE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _RPC_OUT_BUF_SIZE@GOTPAGEOFF]
	ldr	w8, [x23]
	add	w9, w22, w19
	subs	w10, w9, w8
	b.ge	LBB0_5
; %bb.3:
	mov	x22, x19
	b	LBB0_8
LBB0_4:
	mov	w19, #-1
	b	LBB0_16
LBB0_5:
	add	w3, w10, #1024
	mov	x0, x20
	fmov	d0, d8
	mov	x1, x21
	mov	x2, x19
	bl	_rpc_sock_write
	tbnz	w0, #31, LBB0_12
; %bb.6:
	subs	w8, w0, w22
	csel	w10, w8, wzr, gt
	ldr	w8, [x20, #8]
	sub	w22, w19, w10
	add	w9, w8, w22
	ldr	w8, [x23]
	cmp	w9, w8
	b.ge	LBB0_17
; %bb.7:
	add	x21, x21, w10, sxtw
LBB0_8:
	str	w9, [x20, #8]
	ldp	x9, x0, [x20, #16]
	cmp	x9, x0
	b.le	LBB0_10
; %bb.9:
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	x1, x21
	mov	x2, x22
	bl	_memcpy
	ldr	x8, [x20, #24]
	add	x8, x8, w22, sxtw
	b	LBB0_14
LBB0_10:
	sxtw	x23, w22
	ldr	x9, [x20, #32]
	add	x8, x9, w8, sxtw
	add	x9, x0, x23
	cmp	x9, x8
	b.le	LBB0_13
; %bb.11:
	sub	x23, x8, x0
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	x1, x21
	mov	x2, x23
	bl	_memcpy
	ldr	w0, [x20, #32]
	add	x1, x21, w23, sxtw
	sub	w21, w22, w23
	mov	x2, x21
	bl	_memcpy
	ldr	x8, [x20, #32]
	add	x8, x8, w21, sxtw
	b	LBB0_14
LBB0_12:
	mov	w19, #-1
	b	LBB0_15
LBB0_13:
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	x1, x21
	mov	x2, x22
	bl	_memcpy
	ldr	x8, [x20, #24]
	add	x8, x8, x23
LBB0_14:
	str	x8, [x20, #24]
LBB0_15:
	ldr	w0, [x24]
	bl	_END_TIMER
LBB0_16:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #80               ; 16-byte Folded Reload
	ret
LBB0_17:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	w2, #0
	bl	_rpc_server_seterror
	mov	x0, x20
	bl	_rpc_server_failure
	mov	w19, #-1
	b	LBB0_15
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_write_out,4,2                  ; @write_out
	.comm	_RPC_OUT_BUF_SIZE,4,2           ; @RPC_OUT_BUF_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Write timeout"

	.no_dead_strip	_rpc_write_out
.subsections_via_symbols
