	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LSAPI_Write_Stderr_r           ## -- Begin function LSAPI_Write_Stderr_r
	.p2align	4, 0x90
_LSAPI_Write_Stderr_r:                  ## @LSAPI_Write_Stderr_r
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	_s_stderr_log_path@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
LBB0_5:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.6:
	movl	$2, %edi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_write                          ## TAILCALL
LBB0_1:
	movl	$-1, %r12d
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	movl	%r12d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rdi, %r15
	movl	(%rdi), %eax
	cmpl	$-1, %eax
	je	LBB0_5
## %bb.4:
	cmpl	4(%r15), %eax
	je	LBB0_5
## %bb.7:
	movq	8(%r15), %rax
	cmpq	16(%r15), %rax
	je	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	callq	_LSAPI_Flush_r
LBB0_9:
	movq	%r12, %rax
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	testl	%ebx, %ebx
	jle	LBB0_14
## %bb.10:
	movq	%rbx, %rax
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	addq	%r12, %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
                                        ## kill: def $ebx killed $ebx killed $rbx def $rbx
	subl	%r12d, %ebx
	testl	%ebx, %ebx
	jle	LBB0_14
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	_LSAPI_MAX_DATA_PACKET_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%ebx, %eax
	cmovll	%eax, %ebx
	movq	_LSAPI_STDERR_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movslq	%ebx, %r13
	movq	_LSAPI_PACKET_HEADER_LEN@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	addq	%r13, %rdx
	leaq	-112(%rbp), %r14
	movq	%r14, %rdi
	callq	_lsapi_buildPacketHeader
	movl	(%rbx), %ebx
	movq	%r14, -72(%rbp)
	movl	%ebx, -80(%rbp)
	addl	%r13d, %ebx
	movq	%r12, -56(%rbp)
	movl	%r13d, -64(%rbp)
	addq	%r13, %r12
	leaq	-80(%rbp), %rax
	movq	%rax, -104(%rbp)
	movl	(%r15), %edi
	leaq	-104(%rbp), %rsi
	movl	$2, %edx
	movl	%ebx, %ecx
	callq	_lsapi_writev
	cmpl	%ebx, %eax
	jge	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r15, %rdi
	callq	_lsapi_close_connection
	jmp	LBB0_13
LBB0_14:
	subl	-88(%rbp), %r12d                ## 4-byte Folded Reload
	jmp	LBB0_15
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_s_stderr_log_path,8,3          ## @s_stderr_log_path
	.comm	_LSAPI_MAX_DATA_PACKET_LEN,4,2  ## @LSAPI_MAX_DATA_PACKET_LEN
	.comm	_LSAPI_STDERR_STREAM,4,2        ## @LSAPI_STDERR_STREAM
	.comm	_LSAPI_PACKET_HEADER_LEN,8,3    ## @LSAPI_PACKET_HEADER_LEN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LSAPI_Write_Stderr_r           ; -- Begin function LSAPI_Write_Stderr_r
	.p2align	2
_LSAPI_Write_Stderr_r:                  ; @LSAPI_Write_Stderr_r
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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 w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x2
	mov	x19, x1
Lloh3:
	adrp	x8, _s_stderr_log_path@GOTPAGE
Lloh4:
	ldr	x8, [x8, _s_stderr_log_path@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cbz	x8, LBB0_7
LBB0_2:
	ldr	x8, [sp, #56]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.3:
	mov	w0, #2
	mov	x1, x19
	mov	x2, x21
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	b	_write
LBB0_4:
	mov	w0, #-1
LBB0_5:
	ldr	x8, [sp, #56]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.6:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_7:
	mov	x20, x0
	ldr	w8, [x0]
	cmn	w8, #1
	b.eq	LBB0_2
; %bb.8:
	ldr	w9, [x20, #4]
	cmp	w8, w9
	b.eq	LBB0_2
; %bb.9:
	ldp	x8, x9, [x20, #8]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.10:
	mov	x0, x20
	bl	_LSAPI_Flush_r
LBB0_11:
	mov	x25, x19
	cmp	w21, #1
	b.lt	LBB0_16
; %bb.12:
	add	x24, x19, x21
	add	x26, sp, #16
Lloh12:
	adrp	x27, _LSAPI_PACKET_HEADER_LEN@GOTPAGE
Lloh13:
	ldr	x27, [x27, _LSAPI_PACKET_HEADER_LEN@GOTPAGEOFF]
	add	x28, sp, #24
	mov	x25, x19
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x25, x25, x22
	sub	w21, w24, w25
	cmp	w21, #0
	b.le	LBB0_16
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
Lloh14:
	adrp	x8, _LSAPI_MAX_DATA_PACKET_LEN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _LSAPI_MAX_DATA_PACKET_LEN@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w8, w21
	csel	w23, w8, w21, lt
Lloh17:
	adrp	x8, _LSAPI_STDERR_STREAM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _LSAPI_STDERR_STREAM@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldr	x8, [x27]
	sxtw	x22, w23
	add	x2, x8, x22
	add	x0, sp, #16
	bl	_lsapi_buildPacketHeader
	ldr	x8, [x27]
	add	w21, w8, w23
	str	x26, [sp, #32]
	str	w8, [sp, #24]
	str	x25, [sp, #48]
	str	w23, [sp, #40]
	str	x28, [sp, #8]
	ldr	w0, [x20]
	add	x1, sp, #8
	mov	w2, #2
	mov	x3, x21
	bl	_lsapi_writev
	cmp	w0, w21
	b.ge	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x20
	bl	_lsapi_close_connection
	b	LBB0_13
LBB0_16:
	sub	w0, w25, w19
	b	LBB0_5
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_s_stderr_log_path,8,3          ; @s_stderr_log_path
	.comm	_LSAPI_MAX_DATA_PACKET_LEN,4,2  ; @LSAPI_MAX_DATA_PACKET_LEN
	.comm	_LSAPI_STDERR_STREAM,4,2        ; @LSAPI_STDERR_STREAM
	.comm	_LSAPI_PACKET_HEADER_LEN,8,3    ; @LSAPI_PACKET_HEADER_LEN
.subsections_via_symbols
