	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_checkpoint
_write_checkpoint:                      ## @write_checkpoint
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PATH_MAX@GOTPCREL(%rip), %r12
	movl	(%r12), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%r14, %rcx
	callq	_snprintf
	cmpl	$-1, %eax
	je	LBB0_2
## %bb.1:
	cmpl	(%r12), %eax
	jge	LBB0_2
## %bb.3:
	movq	%r15, %rdi
	callq	_mkstemp
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.5:
	movl	%eax, %r12d
	movq	%r13, %rbx
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edi
	callq	_fdopen
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r13
	leaq	L_.str.5(%rip), %rsi
	movq	%rax, %rdi
	movq	%rbx, %rdx
	callq	_fprintf
	testq	%rax, %rax
	jle	LBB0_11
## %bb.8:
	movq	%r13, %rdi
	callq	_fclose
	testq	%rax, %rax
	jne	LBB0_11
## %bb.9:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_rename
	testq	%rax, %rax
	je	LBB0_10
LBB0_11:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.7(%rip), %rdi
	movq	%r14, %rsi
	jmp	LBB0_12
LBB0_2:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_logit
	jmp	LBB0_13
LBB0_4:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
LBB0_12:
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_logit
	jmp	LBB0_13
LBB0_6:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_logit
	movq	%r15, %rdi
	callq	_unlink
	movl	%r12d, %edi
	callq	_close
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	leaq	L_.str.6(%rip), %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_debug3
	jmp	LBB0_13
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PATH_MAX,4,2                   ## @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s.XXXXXXXXXX"

L_.str.1:                               ## @.str.1
	.asciz	"write_checkpoint: temp pathname too long"

L_.str.2:                               ## @.str.2
	.asciz	"mkstemp(%s): %s"

	.comm	_errno,4,2                      ## @errno
L_.str.3:                               ## @.str.3
	.asciz	"w"

L_.str.4:                               ## @.str.4
	.asciz	"write_checkpoint: fdopen: %s"

L_.str.5:                               ## @.str.5
	.asciz	"%lu\n"

L_.str.6:                               ## @.str.6
	.asciz	"wrote checkpoint line %lu to '%s'"

L_.str.7:                               ## @.str.7
	.asciz	"failed to write to checkpoint file '%s': %s"

	.no_dead_strip	_write_checkpoint
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_checkpoint
_write_checkpoint:                      ; @write_checkpoint
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #16
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x22, _PATH_MAX@GOTPAGE
Lloh4:
	ldr	x22, [x22, _PATH_MAX@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x9, x1
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x1, #15
	and	x9, x9, #0x1fffffff0
	sub	x20, x8, x9
	mov	sp, x20
Lloh7:
	adrp	x2, l_.str@PAGE
Lloh8:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x3, x19
	bl	_snprintf
	ldr	w8, [x22]
	cmn	w0, #1
	ccmp	w0, w8, #0, ne
	b.lt	LBB0_2
; %bb.1:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_logit
	b	LBB0_11
LBB0_2:
	mov	x0, x20
	bl	_mkstemp
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.3:
	mov	x22, x0
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fdopen
	cbz	x0, LBB0_10
; %bb.4:
	mov	x23, x0
Lloh13:
	adrp	x1, l_.str.5@PAGE
Lloh14:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x2, x21
	bl	_fprintf
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.5:
	mov	x0, x23
	bl	_fclose
	cbnz	x0, LBB0_7
; %bb.6:
	mov	x0, x20
	mov	x1, x19
	bl	_rename
	cbz	x0, LBB0_13
LBB0_7:
Lloh15:
	adrp	x8, _errno@GOTPAGE
Lloh16:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x19, x0, [sp, #-16]!
Lloh18:
	adrp	x0, l_.str.7@PAGE
Lloh19:
	add	x0, x0, l_.str.7@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh20:
	adrp	x8, _errno@GOTPAGE
Lloh21:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x20, x0, [sp, #-16]!
Lloh23:
	adrp	x0, l_.str.2@PAGE
Lloh24:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_9:
	bl	_logit
	add	sp, sp, #16
	b	LBB0_11
LBB0_10:
Lloh25:
	adrp	x8, _errno@GOTPAGE
Lloh26:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp, #-16]!
Lloh28:
	adrp	x0, l_.str.4@PAGE
Lloh29:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_logit
	add	sp, sp, #16
	mov	x0, x20
	bl	_unlink
	mov	x0, x22
	bl	_close
LBB0_11:
	ldur	x8, [x29, #-56]
Lloh30:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.12:
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_13:
Lloh33:
	adrp	x0, l_.str.6@PAGE
Lloh34:
	add	x0, x0, l_.str.6@PAGEOFF
	mov	x1, x21
	mov	x2, x19
	bl	_debug3
	b	LBB0_11
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_PATH_MAX,4,2                   ; @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s.XXXXXXXXXX"

l_.str.1:                               ; @.str.1
	.asciz	"write_checkpoint: temp pathname too long"

l_.str.2:                               ; @.str.2
	.asciz	"mkstemp(%s): %s"

	.comm	_errno,4,2                      ; @errno
l_.str.3:                               ; @.str.3
	.asciz	"w"

l_.str.4:                               ; @.str.4
	.asciz	"write_checkpoint: fdopen: %s"

l_.str.5:                               ; @.str.5
	.asciz	"%lu\n"

l_.str.6:                               ; @.str.6
	.asciz	"wrote checkpoint line %lu to '%s'"

l_.str.7:                               ; @.str.7
	.asciz	"failed to write to checkpoint file '%s': %s"

	.no_dead_strip	_write_checkpoint
.subsections_via_symbols
