	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function edit_and_replace
_edit_and_replace:                      ## @edit_and_replace
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, %r13d
	movq	%rdi, %r12
	movq	_STRBUF_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	leaq	-48(%rbp), %rsi
	callq	_get_oid
	testq	%rax, %rax
	js	LBB0_1
## %bb.3:
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movq	_the_repository@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_oid_object_info
	movl	%eax, %r15d
	leaq	-72(%rbp), %rsi
	leaq	-64(%rbp), %r14
	movq	%rbx, %rdi
	movq	%r14, %rdx
	movl	%r13d, %ecx
	callq	_check_ref_valid
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_strbuf_release
	movl	$-1, %r14d
	testq	%rbx, %rbx
	jne	LBB0_13
## %bb.4:
	movl	%r13d, -68(%rbp)                ## 4-byte Spill
	leaq	L_.str.2(%rip), %rdi
	callq	_git_pathdup
	movq	%rax, %r13
	leaq	-48(%rbp), %rdi
	movl	%r15d, %esi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movq	%rax, %rcx
	callq	_export_object
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%r13, %rdi
	callq	_free
	jmp	LBB0_13
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	__
	movl	%eax, %edi
	movq	%r12, %rsi
LBB0_2:
	xorl	%eax, %eax
	callq	_error
LBB0_12:
	movl	%eax, %r14d
LBB0_13:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_launch_editor
	testq	%rax, %rax
	js	LBB0_7
## %bb.8:
	leaq	-56(%rbp), %rdi
	movl	%r15d, %esi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movq	%r13, %rcx
	callq	_import_object
	movq	%rax, %rbx
	movq	%r13, %rdi
	callq	_free
	testq	%rbx, %rbx
	jne	LBB0_13
## %bb.9:
	leaq	-48(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	callq	_oideq
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.4(%rip), %rdi
	callq	__
	movl	%eax, %ebx
	leaq	-48(%rbp), %rdi
	callq	_oid_to_hex
	movl	%ebx, %edi
	movq	%rax, %rsi
	jmp	LBB0_2
LBB0_7:
	movq	%r13, %rdi
	callq	_free
	leaq	L_.str.3(%rip), %rdi
	callq	__
	movl	%eax, %edi
	xorl	%eax, %eax
	callq	_error
	jmp	LBB0_12
LBB0_11:
	leaq	L_.str.5(%rip), %rdx
	leaq	-48(%rbp), %rsi
	leaq	-56(%rbp), %rcx
	movq	%r12, %rdi
	movl	-68(%rbp), %r8d                 ## 4-byte Reload
	callq	_replace_object_oid
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_STRBUF_INIT,4,2                ## @STRBUF_INIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"not a valid object name: '%s'"

	.comm	_the_repository,4,2             ## @the_repository
L_.str.2:                               ## @.str.2
	.asciz	"REPLACE_EDITOBJ"

L_.str.3:                               ## @.str.3
	.asciz	"editing object file failed"

L_.str.4:                               ## @.str.4
	.asciz	"new object is the same as the old one: '%s'"

L_.str.5:                               ## @.str.5
	.asciz	"replacement"

	.no_dead_strip	_edit_and_replace
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function edit_and_replace
_edit_and_replace:                      ; @edit_and_replace
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _STRBUF_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STRBUF_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #16]
	add	x1, sp, #40
	bl	_get_oid
	tbnz	x0, #63, LBB0_5
; %bb.1:
Lloh3:
	adrp	x8, _the_repository@GOTPAGE
Lloh4:
	ldr	x8, [x8, _the_repository@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	add	x1, sp, #40
	mov	x2, #0
	bl	_oid_object_info
	mov	x22, x0
	add	x0, sp, #40
	add	x1, sp, #24
	add	x2, sp, #16
	mov	x3, x20
	bl	_check_ref_valid
	mov	x23, x0
	add	x0, sp, #16
	bl	_strbuf_release
	cbnz	x23, LBB0_4
; %bb.2:
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_git_pathdup
	mov	x23, x0
	add	x0, sp, #40
	mov	x1, x22
	mov	x2, x21
	mov	x3, x23
	bl	_export_object
	cbz	x0, LBB0_7
; %bb.3:
	mov	x0, x23
	bl	_free
LBB0_4:
	mov	w0, #-1
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	__
	str	x19, [sp]
	bl	_error
LBB0_6:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_7:
	mov	x0, x23
	mov	x1, #0
	mov	x2, #0
	bl	_launch_editor
	tbnz	x0, #63, LBB0_11
; %bb.8:
	add	x0, sp, #32
	mov	x1, x22
	mov	x2, x21
	mov	x3, x23
	bl	_import_object
	mov	x21, x0
	mov	x0, x23
	bl	_free
	cbnz	x21, LBB0_4
; %bb.9:
	add	x0, sp, #40
	add	x1, sp, #32
	bl	_oideq
	cbz	x0, LBB0_12
; %bb.10:
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	__
	mov	x19, x0
	add	x0, sp, #40
	bl	_oid_to_hex
	str	x0, [sp]
	mov	x0, x19
	bl	_error
	b	LBB0_6
LBB0_11:
	mov	x0, x23
	bl	_free
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	__
	bl	_error
	b	LBB0_6
LBB0_12:
Lloh14:
	adrp	x2, l_.str.5@PAGE
Lloh15:
	add	x2, x2, l_.str.5@PAGEOFF
	add	x1, sp, #40
	add	x3, sp, #32
	mov	x0, x19
	mov	x4, x20
	bl	_replace_object_oid
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_STRBUF_INIT,4,2                ; @STRBUF_INIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"not a valid object name: '%s'"

	.comm	_the_repository,4,2             ; @the_repository
l_.str.2:                               ; @.str.2
	.asciz	"REPLACE_EDITOBJ"

l_.str.3:                               ; @.str.3
	.asciz	"editing object file failed"

l_.str.4:                               ; @.str.4
	.asciz	"new object is the same as the old one: '%s'"

l_.str.5:                               ; @.str.5
	.asciz	"replacement"

	.no_dead_strip	_edit_and_replace
.subsections_via_symbols
