	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ps_files_write
_ps_files_write:                        ## @ps_files_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
	movq	%rdx, %r14
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	callq	_ZSTR_VAL
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_ps_files_open
	movq	_FAILURE@GOTPCREL(%rip), %r12
	cmpq	$0, (%rbx)
	js	LBB0_8
## %bb.1:
	movq	%r14, %rdi
	callq	_ZSTR_LEN
	cmpq	8(%rbx), %rax
	jae	LBB0_3
## %bb.2:
	movq	(%rbx), %rdi
	xorl	%esi, %esi
	callq	_ftruncate
	movl	%eax, %edi
	callq	_php_ignore_value
LBB0_3:
	movq	(%rbx), %rdi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_lseek
	movq	(%rbx), %r15
	movq	%r14, %rdi
	callq	_ZSTR_VAL
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_ZSTR_LEN
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_write
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_ZSTR_LEN
	cmpq	%rax, %rbx
	jne	LBB0_5
## %bb.4:
	movq	_SUCCESS@GOTPCREL(%rip), %r12
	jmp	LBB0_8
LBB0_5:
	movq	_E_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	cmpq	$-1, %rbx
	je	LBB0_6
## %bb.7:
	leaq	L_.str.1(%rip), %rdx
	xorl	%edi, %edi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_php_error_docref
	jmp	LBB0_8
LBB0_6:
	movq	_errno@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_strerror
	movl	(%rbx), %r8d
	leaq	L_.str(%rip), %rdx
	xorl	%edi, %edi
	movl	%r14d, %esi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_php_error_docref
LBB0_8:
	movl	(%r12), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FAILURE,4,2                    ## @FAILURE
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_E_WARNING,4,2                  ## @E_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write failed: %s (%d)"

	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"write wrote less bytes than requested"

	.comm	_SUCCESS,4,2                    ## @SUCCESS
	.comm	_UINT_MAX,4,2                   ## @UINT_MAX
	.no_dead_strip	_ps_files_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ps_files_write
_ps_files_write:                        ; @ps_files_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x2
	mov	x20, x0
	mov	x0, x1
	bl	_ZSTR_VAL
	mov	x1, x0
	mov	x0, x20
	bl	_ps_files_open
	ldr	x8, [x20]
	tbnz	x8, #63, LBB0_9
; %bb.1:
	mov	x0, x19
	bl	_ZSTR_LEN
	ldr	x8, [x20, #8]
	cmp	x0, x8
	b.hs	LBB0_3
; %bb.2:
	ldr	x0, [x20]
	mov	w1, #0
	bl	_ftruncate
	bl	_php_ignore_value
LBB0_3:
	ldr	x0, [x20]
Lloh0:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_lseek
	ldr	x20, [x20]
	mov	x0, x19
	bl	_ZSTR_VAL
	mov	x21, x0
	mov	x0, x19
	bl	_ZSTR_LEN
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_write
	mov	x20, x0
	mov	x0, x19
	bl	_ZSTR_LEN
	cmp	x20, x0
	b.ne	LBB0_5
; %bb.4:
Lloh3:
	adrp	x8, _SUCCESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SUCCESS@GOTPAGEOFF]
	b	LBB0_10
LBB0_5:
Lloh5:
	adrp	x8, _E_WARNING@GOTPAGE
Lloh6:
	ldr	x8, [x8, _E_WARNING@GOTPAGEOFF]
Lloh7:
	ldr	w19, [x8]
	cmn	x20, #1
	b.eq	LBB0_7
; %bb.6:
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh10:
	adrp	x20, _errno@GOTPAGE
Lloh11:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x20]
	stp	x0, x8, [sp]
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
LBB0_8:
	mov	x0, #0
	mov	x1, x19
	bl	_php_error_docref
LBB0_9:
Lloh14:
	adrp	x8, _FAILURE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _FAILURE@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_FAILURE,4,2                    ; @FAILURE
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_E_WARNING,4,2                  ; @E_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write failed: %s (%d)"

	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"write wrote less bytes than requested"

	.comm	_SUCCESS,4,2                    ; @SUCCESS
	.comm	_UINT_MAX,4,2                   ; @UINT_MAX
	.no_dead_strip	_ps_files_write
.subsections_via_symbols
