	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function save_todo
_save_todo:                             ## @save_todo
	.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, %r12
	movq	%rdi, %r14
	movq	_LOCK_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	%rsi, %rdi
	callq	_get_todo_path
	movq	%rax, %r15
	movl	(%r14), %r13d
	movq	%r12, %rdi
	callq	_is_rebase_i
	cmpq	$1, %rax
	sbbl	$-1, %r13d
	leaq	-48(%rbp), %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_hold_lock_file_for_update
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	%eax, %ebx
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_get_item_line_offset
	cltq
	movq	16(%r14), %rsi
	addq	%rax, %rsi
	movq	8(%r14), %rdx
	subq	%rax, %rdx
	movl	%ebx, %edi
	callq	_write_in_full
	testq	%rax, %rax
	js	LBB0_3
## %bb.4:
	leaq	-48(%rbp), %rdi
	callq	_commit_lock_file
	testq	%rax, %rax
	js	LBB0_5
## %bb.6:
	movq	%r12, %rdi
	callq	_is_rebase_i
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_15
## %bb.7:
	testl	%r13d, %r13d
	jle	LBB0_15
## %bb.8:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_rebase_path_done
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movq	_O_WRONLY@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	(%rcx), %esi
	movq	%rax, %r15
	movq	_O_APPEND@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%r15, %rdi
	movl	$438, %edx                      ## imm = 0x1B6
	callq	_open
	testl	%eax, %eax
	js	LBB0_15
## %bb.9:
	movl	%eax, %ebx
	decl	%r13d
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_get_item_line
	movq	%rax, %r12
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_get_item_line_length
	movl	%ebx, %edi
	movq	%r12, %rsi
	movq	%rax, %rdx
	callq	_write_in_full
	xorl	%r12d, %r12d
	testq	%rax, %rax
	jns	LBB0_11
## %bb.10:
	leaq	L_.str.1(%rip), %rdi
	callq	__
	movl	%eax, %edi
	movq	%r15, %rsi
	callq	_error_errno
	movl	%eax, %r12d
LBB0_11:
	movl	%ebx, %edi
	callq	_close
	testq	%rax, %rax
	jns	LBB0_15
## %bb.12:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_13
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_13
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
LBB0_13:
	callq	__
	movl	%eax, %edi
	movq	%r15, %rsi
	callq	_error_errno
LBB0_14:
	movl	%eax, %r12d
LBB0_15:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	L_.str.2(%rip), %rdi
	callq	__
	movl	%eax, %edi
	movq	%r15, %rsi
	callq	_error
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_LOCK_INIT,4,2                  ## @LOCK_INIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not lock '%s'"

L_.str.1:                               ## @.str.1
	.asciz	"could not write to '%s'"

L_.str.2:                               ## @.str.2
	.asciz	"failed to finalize '%s'"

	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_APPEND,4,2                   ## @O_APPEND
	.no_dead_strip	_save_todo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function save_todo
_save_todo:                             ; @save_todo
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _LOCK_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LOCK_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #8]
	mov	x0, x1
	bl	_get_todo_path
	mov	x20, x0
	ldr	w22, [x19]
	mov	x0, x21
	bl	_is_rebase_i
	cmp	x0, #0
	cinc	w22, w22, ne
	add	x0, sp, #8
	mov	x1, x20
	mov	w2, #0
	bl	_hold_lock_file_for_update
	tbnz	w0, #31, LBB0_8
; %bb.1:
	mov	x23, x0
	mov	x0, x19
	mov	x1, x22
	bl	_get_item_line_offset
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	ldp	x10, x9, [x19, #8]
	add	x1, x9, x8
	sub	x2, x10, x8
	mov	x0, x23
	bl	_write_in_full
	tbnz	x0, #63, LBB0_9
; %bb.2:
	add	x0, sp, #8
	bl	_commit_lock_file
	tbnz	x0, #63, LBB0_13
; %bb.3:
	mov	x0, x21
	bl	_is_rebase_i
	mov	w23, #0
	cbz	x0, LBB0_12
; %bb.4:
	subs	w22, w22, #1
	b.lt	LBB0_12
; %bb.5:
	bl	_rebase_path_done
	mov	x20, x0
Lloh3:
	adrp	x8, _O_CREAT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _O_CREAT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _O_WRONLY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_WRONLY@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _O_APPEND@GOTPAGE
Lloh10:
	ldr	x9, [x9, _O_APPEND@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	w2, #438
	bl	_open
	tbnz	w0, #31, LBB0_14
; %bb.6:
	mov	x21, x0
	mov	x0, x19
	mov	x1, x22
	bl	_get_item_line
	mov	x23, x0
	mov	x0, x19
	mov	x1, x22
	bl	_get_item_line_length
	mov	x2, x0
	mov	x0, x21
	mov	x1, x23
	bl	_write_in_full
	tbnz	x0, #63, LBB0_15
; %bb.7:
	mov	w23, #0
	b	LBB0_16
LBB0_8:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_10
LBB0_9:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_10:
	bl	__
	mov	x1, x20
	bl	_error_errno
LBB0_11:
	mov	x23, x0
LBB0_12:
	mov	x0, x23
	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
	add	sp, sp, #80
	ret
LBB0_13:
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	__
	mov	x1, x20
	bl	_error
	b	LBB0_11
LBB0_14:
	mov	w23, #0
	b	LBB0_12
LBB0_15:
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	__
	mov	x1, x20
	bl	_error_errno
	mov	x23, x0
LBB0_16:
	mov	x0, x21
	bl	_close
	tbz	x0, #63, LBB0_12
; %bb.17:
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_LOCK_INIT,4,2                  ; @LOCK_INIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not lock '%s'"

l_.str.1:                               ; @.str.1
	.asciz	"could not write to '%s'"

l_.str.2:                               ; @.str.2
	.asciz	"failed to finalize '%s'"

	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_APPEND,4,2                   ; @O_APPEND
	.no_dead_strip	_save_todo
.subsections_via_symbols
