	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_save_index                     ## -- Begin function save_index
	.p2align	4, 0x90
_save_index:                            ## @save_index
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_engine_snapshot_replica@GOTPCREL(%rip), %r14
	movq	(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_5
## %bb.1:
	xorl	%eax, %eax
	callq	_log_cur_pos
	movq	(%r14), %rcx
	movl	(%rcx), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_get_new_snapshot_name
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	%rax, %rbx
	cmpb	$45, (%rax)
	je	LBB0_5
## %bb.3:
	xorl	%edi, %edi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_open_file
	movq	_fd@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movl	(%rax), %edi
	callq	_set_read_file
	movq	(%r14), %rax
	movl	(%rax), %edi
	callq	_set_write_file
	xorl	%eax, %eax
	callq	_sort_items
	xorl	%eax, %eax
	callq	_write_header0
	xorl	%eax, %eax
	callq	_write_text
	xorl	%eax, %eax
	callq	_build_pairs_from_text
	xorl	%eax, %eax
	callq	_build_word_lists
	xorl	%eax, %eax
	callq	_write_header1
	movq	(%r14), %rax
	movl	(%rax), %edi
	callq	_fsync
	shrq	$63, %rax
	xorl	$1, %eax
	movl	%eax, %edi
	callq	_assert
	movq	(%r14), %rax
	movl	(%rax), %edi
	callq	_close
	shrq	$63, %rax
	xorl	$1, %eax
	movl	%eax, %edi
	callq	_assert
	movq	%rbx, %rdi
	callq	_rename_temporary_snapshot
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_print_snapshot_name            ## TAILCALL
LBB0_5:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
	movl	$1, %edi
	callq	_exit
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	callq	_kprintf
	movq	%rbx, %rdi
	callq	_unlink
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_engine_snapshot_replica,8,3    ## @engine_snapshot_replica
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot write index: cannot compute its name\n"

	.comm	_fd,8,3                         ## @fd
L_.str.1:                               ## @.str.1
	.asciz	"cannot rename new index file from %s: %m\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_save_index                     ; -- Begin function save_index
	.p2align	2
_save_index:                            ; @save_index
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x20, _engine_snapshot_replica@GOTPAGE
Lloh1:
	ldr	x20, [x20, _engine_snapshot_replica@GOTPAGEOFF]
	ldr	x19, [x20]
	cbz	x19, LBB0_5
; %bb.1:
	bl	_log_cur_pos
	mov	x1, x0
	ldr	x8, [x20]
	ldr	w2, [x8]
	mov	x0, x19
	bl	_get_new_snapshot_name
	cbz	x0, LBB0_5
; %bb.2:
	mov	x19, x0
	ldrb	w8, [x0]
	cmp	w8, #45
	b.eq	LBB0_5
; %bb.3:
	mov	w0, #0
	mov	x1, x19
	mov	w2, #1
	bl	_open_file
Lloh2:
	adrp	x20, _fd@GOTPAGE
Lloh3:
	ldr	x20, [x20, _fd@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	w0, [x8]
	bl	_set_read_file
	ldr	x8, [x20]
	ldr	w0, [x8]
	bl	_set_write_file
	bl	_sort_items
	bl	_write_header0
	bl	_write_text
	bl	_build_pairs_from_text
	bl	_build_word_lists
	bl	_write_header1
	ldr	x8, [x20]
	ldr	w0, [x8]
	bl	_fsync
	lsr	x8, x0, #63
	eor	w0, w8, #0x1
	bl	_assert
	ldr	x8, [x20]
	ldr	w0, [x8]
	bl	_close
	lsr	x8, x0, #63
	eor	w0, w8, #0x1
	bl	_assert
	mov	x0, x19
	bl	_rename_temporary_snapshot
	cbnz	x0, LBB0_6
; %bb.4:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_print_snapshot_name
LBB0_5:
Lloh4:
	adrp	x8, _stderr@GOTPAGE
Lloh5:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	mov	w0, #1
	bl	_exit
LBB0_6:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_kprintf
	mov	x0, x19
	bl	_unlink
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_engine_snapshot_replica,8,3    ; @engine_snapshot_replica
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot write index: cannot compute its name\n"

	.comm	_fd,8,3                         ; @fd
l_.str.1:                               ; @.str.1
	.asciz	"cannot rename new index file from %s: %m\n"

.subsections_via_symbols
