	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function safe_write
_safe_write:                            ## @safe_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%edx, %edx
	jle	LBB0_4
## %bb.1:
	movq	%rcx, %r14
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movl	%edi, %r12d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_write
	testl	%eax, %eax
	js	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %ecx
	addq	%rcx, %rbx
	subl	%eax, %r15d
	jg	LBB0_2
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_pname@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	xorl	%edi, %edi
	movq	%r14, %rsi
	callq	_shortpath
	movl	%eax, %ebx
	movl	%r12d, %edi
	callq	_xstrerror
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_notice                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: error writing file '%s': %s\n"

	.comm	_pname,4,2                      ## @pname
	.comm	_EINTR,4,2                      ## @EINTR
	.no_dead_strip	_safe_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function safe_write
_safe_write:                            ; @safe_write
	.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
	cmp	w2, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_write
	tbnz	w0, #31, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x21, x21, w0, uxtw
	sub	w20, w20, w0
	cmp	w20, #0
	b.gt	LBB0_2
LBB0_4:
	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
LBB0_5:
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x8, _pname@GOTPAGE
Lloh4:
	ldr	x8, [x8, _pname@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	mov	x0, #0
	mov	x1, x19
	bl	_shortpath
	mov	x19, x0
	mov	x0, x20
	bl	_xstrerror
	mov	x3, x0
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x19
	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
	b	_notice
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: error writing file '%s': %s\n"

	.comm	_pname,4,2                      ; @pname
	.comm	_EINTR,4,2                      ; @EINTR
	.no_dead_strip	_safe_write
.subsections_via_symbols
