	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rewind_copy_file_range
_rewind_copy_file_range:                ## @rewind_copy_file_range
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movl	%esi, %r13d
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAXPGPATH@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r14, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	_datadir_source@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movq	%r12, %r14
	movq	%r12, %r8
	callq	_snprintf
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movq	_PG_BINARY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_open
	movl	%eax, %r12d
	testl	%eax, %eax
	jns	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_pg_fatal
LBB0_2:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_lseek
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_pg_fatal
LBB0_4:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_open_target_file
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	subl	%r13d, %edx
	jle	LBB0_10
## %bb.5:
	movl	$4, %r14d
	leaq	L_.str.3(%rip), %r15
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_pg_fatal
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	%r13d, %esi
	movl	%ebx, %edx
	callq	_write_target_range
	addl	%ebx, %r13d
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	subl	%r13d, %edx
	jle	LBB0_10
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$4, %edx
	cmovael	%r14d, %edx
	movl	%r12d, %edi
	callq	_read
	movl	%eax, %ebx
	movq	%r15, %rdi
	testl	%eax, %eax
	js	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	leaq	L_.str.4(%rip), %rdi
	jne	LBB0_9
	jmp	LBB0_8
LBB0_10:
	movl	%r12d, %edi
	callq	_close
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.5(%rip), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_pg_fatal
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXPGPATH,4,2                  ## @MAXPGPATH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/%s"

	.comm	_datadir_source,8,3             ## @datadir_source
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_PG_BINARY,4,2                  ## @PG_BINARY
L_.str.1:                               ## @.str.1
	.asciz	"could not open source file \"%s\": %m"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.2:                               ## @.str.2
	.asciz	"could not seek in source file: %m"

L_.str.3:                               ## @.str.3
	.asciz	"could not read file \"%s\": %m"

L_.str.4:                               ## @.str.4
	.asciz	"unexpected EOF while reading file \"%s\""

L_.str.5:                               ## @.str.5
	.asciz	"could not close file \"%s\": %m"

	.no_dead_strip	_rewind_copy_file_range
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rewind_copy_file_range
_rewind_copy_file_range:                ; @rewind_copy_file_range
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [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 w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x23, x3
	mov	x19, x2
	mov	x20, x1
	mov	x24, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x8, _MAXPGPATH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAXPGPATH@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x9, x1
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x1, #15
	and	x9, x9, #0x1fffffff0
	sub	x21, x8, x9
	mov	sp, x21
Lloh8:
	adrp	x8, _datadir_source@GOTPAGE
Lloh9:
	ldr	x8, [x8, _datadir_source@GOTPAGEOFF]
Lloh10:
	ldr	x3, [x8]
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x4, x24
	bl	_snprintf
Lloh13:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _PG_BINARY@GOTPAGE
Lloh17:
	ldr	x9, [x9, _PG_BINARY@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x21
	mov	w2, #0
	bl	_open
	mov	x22, x0
	tbz	w0, #31, LBB0_2
; %bb.1:
	str	x21, [sp, #-16]!
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pg_fatal
	add	sp, sp, #16
LBB0_2:
Lloh21:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x22
	mov	x1, x20
	bl	_lseek
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pg_fatal
LBB0_4:
	mov	x0, x24
	mov	x1, x23
	bl	_open_target_file
	sub	w8, w19, w20
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.5:
	mov	w24, #4
Lloh26:
	adrp	x25, l_.str.3@PAGE
Lloh27:
	add	x25, x25, l_.str.3@PAGEOFF
Lloh28:
	adrp	x26, l_.str.4@PAGE
Lloh29:
	add	x26, x26, l_.str.4@PAGEOFF
	b	LBB0_9
LBB0_6:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x25
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	str	x21, [sp, #-16]!
	bl	_pg_fatal
	add	sp, sp, #16
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	x1, x20
	mov	x2, x23
	bl	_write_target_range
	add	w20, w23, w20
	sub	w8, w19, w20
	cmp	w8, #0
	b.le	LBB0_12
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w8, #4
	csel	w2, w8, w24, lo
	mov	x0, x22
	bl	_read
	mov	x23, x0
	tbnz	w0, #31, LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	cbnz	w23, LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x26
	b	LBB0_7
LBB0_12:
	mov	x0, x22
	bl	_close
	cbz	x0, LBB0_14
; %bb.13:
	str	x21, [sp, #-16]!
Lloh30:
	adrp	x0, l_.str.5@PAGE
Lloh31:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pg_fatal
	add	sp, sp, #16
LBB0_14:
	ldur	x8, [x29, #-72]
Lloh32:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh33:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.15:
	sub	sp, x29, #64
	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	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXPGPATH,4,2                  ; @MAXPGPATH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/%s"

	.comm	_datadir_source,8,3             ; @datadir_source
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_PG_BINARY,4,2                  ; @PG_BINARY
l_.str.1:                               ; @.str.1
	.asciz	"could not open source file \"%s\": %m"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.2:                               ; @.str.2
	.asciz	"could not seek in source file: %m"

l_.str.3:                               ; @.str.3
	.asciz	"could not read file \"%s\": %m"

l_.str.4:                               ; @.str.4
	.asciz	"unexpected EOF while reading file \"%s\""

l_.str.5:                               ; @.str.5
	.asciz	"could not close file \"%s\": %m"

	.no_dead_strip	_rewind_copy_file_range
.subsections_via_symbols
