	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fetch_and_setup_pack_index
_fetch_and_setup_pack_index:            ## @fetch_and_setup_pack_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	%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	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_has_pack_index
	movq	%rbx, %rdi
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	callq	_sha1_pack_index_name
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_parse_pack_index
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_2
LBB0_9:
	movq	(%r14), %rax
	movq	%rax, (%r13)
	movq	%r13, (%r14)
	xorl	%r15d, %r15d
	jmp	LBB0_10
LBB0_3:
	movq	%r15, %rsi
	callq	_fetch_pack_index
	movl	$-1, %r15d
	testq	%rax, %rax
	je	LBB0_10
## %bb.4:
	movq	%rax, %r12
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_parse_pack_index
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_verify_pack_index
	testl	%eax, %eax
	jne	LBB0_7
## %bb.8:
	movq	%r13, %rdi
	callq	_close_pack_index
	movq	%rbx, %rdi
	callq	_sha1_pack_index_name
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_finalize_object_file
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_free
	testl	%ebx, %ebx
	jne	LBB0_10
	jmp	LBB0_9
LBB0_2:
	movl	$-1, %r15d
	jmp	LBB0_10
LBB0_5:
	movq	%r12, %rdi
	callq	_unlink
LBB0_7:
	movq	%r12, %rdi
	callq	_free
LBB0_10:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_fetch_and_setup_pack_index
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fetch_and_setup_pack_index
_fetch_and_setup_pack_index:            ; @fetch_and_setup_pack_index
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	mov	x0, x1
	bl	_has_pack_index
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x20
	bl	_sha1_pack_index_name
	mov	x1, x0
	mov	x0, x20
	bl	_parse_pack_index
	mov	x22, x0
	cbz	x0, LBB0_9
LBB0_2:
	mov	w0, #0
	ldr	x8, [x19]
	str	x8, [x22]
	str	x22, [x19]
	b	LBB0_10
LBB0_3:
	mov	x0, x20
	mov	x1, x21
	bl	_fetch_pack_index
	cbz	x0, LBB0_9
; %bb.4:
	mov	x21, x0
	mov	x0, x20
	mov	x1, x21
	bl	_parse_pack_index
	cbz	x0, LBB0_7
; %bb.5:
	mov	x22, x0
	bl	_verify_pack_index
	cbnz	w0, LBB0_8
; %bb.6:
	mov	x0, x22
	bl	_close_pack_index
	mov	x0, x20
	bl	_sha1_pack_index_name
	mov	x1, x0
	mov	x0, x21
	bl	_finalize_object_file
	mov	x20, x0
	mov	x0, x21
	bl	_free
	cbnz	w20, LBB0_9
	b	LBB0_2
LBB0_7:
	mov	x0, x21
	bl	_unlink
LBB0_8:
	mov	x0, x21
	bl	_free
LBB0_9:
	mov	w0, #-1
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_fetch_and_setup_pack_index
.subsections_via_symbols
