	.file	"extr_pack.c_git_packfile_alloc.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"invalid packfile path"
.LC1:
	.string	".idx"
.LC2:
	.string	".keep"
.LC3:
	.string	".pack"
.LC4:
	.string	"packfile not found"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC5:
	.string	"failed to initialize packfile mutex"
	.text
	.p2align 4
	.globl	git_packfile_alloc
	.type	git_packfile_alloc, @function
git_packfile_alloc:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 56
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	test	rsi, rsi
	je	.L20
	mov	rdi, rsi
	mov	rbp, rsi
	call	strlen@PLT
	mov	QWORD PTR [r12], 0
	mov	rbx, rax
	cmp	rax, 3
	ja	.L4
.L3:
	xor	edx, edx
	xor	esi, esi
	lea	rdi, .LC0[rip]
	call	git_odb__error_notfound@PLT
.L1:
	mov	rcx, QWORD PTR 40[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L21
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	lea	r13, 8[rsp]
	mov	edx, eax
	mov	esi, 48
	mov	rdi, r13
	call	GIT_ERROR_CHECK_ALLOC_ADD@PLT
	mov	rsi, QWORD PTR 8[rsp]
	mov	edx, 2
	mov	rdi, r13
	call	GIT_ERROR_CHECK_ALLOC_ADD@PLT
	mov	rsi, QWORD PTR 8[rsp]
	mov	edi, 1
	call	git__calloc@PLT
	mov	r13, rax
	mov	rdi, rax
	call	GIT_ERROR_CHECK_ALLOC@PLT
	mov	rdi, QWORD PTR 40[r13]
	mov	rsi, rbp
	lea	edx, 1[rbx]
	call	memcpy@PLT
	lea	rsi, .LC1[rip]
	mov	rdi, rbp
	call	git__suffixcmp@PLT
	test	rax, rax
	jne	.L6
	mov	rdi, QWORD PTR 40[r13]
	mov	eax, DWORD PTR git_disable_pack_keep_file_checks[rip]
	sub	rbx, 4
	add	rdi, rbx
	test	eax, eax
	je	.L22
.L7:
	mov	edx, 6
	lea	rsi, .LC3[rip]
	call	memcpy@PLT
.L6:
	mov	rdi, QWORD PTR 40[r13]
	lea	rsi, 16[rsp]
	call	p_stat@PLT
	test	rax, rax
	js	.L10
	mov	edi, DWORD PTR 28[rsp]
	call	S_ISREG@PLT
	test	eax, eax
	jne	.L23
.L10:
	mov	rdi, r13
	call	git__free@PLT
	xor	edx, edx
	xor	esi, esi
	lea	rdi, .LC4[rip]
	call	git_odb__error_notfound@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L23:
	mov	eax, DWORD PTR 24[rsp]
	mov	DWORD PTR 32[r13], -1
	lea	rdi, 16[r13]
	mov	DWORD PTR 36[r13], eax
	mov	rax, QWORD PTR 16[rsp]
	mov	QWORD PTR 24[r13], rax
	movabs	rax, -4294967295
	mov	QWORD PTR 4[r13], rax
	call	git_mutex_init@PLT
	test	rax, rax
	jne	.L24
	lea	rdi, 12[r13]
	call	cache_init@PLT
	test	rax, rax
	js	.L25
	mov	QWORD PTR [r12], r13
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L22:
	mov	edx, 6
	lea	rsi, .LC2[rip]
	call	memcpy@PLT
	mov	rdi, QWORD PTR 40[r13]
	call	git_path_exists@PLT
	cmp	eax, 1
	je	.L8
.L18:
	add	rbx, QWORD PTR 40[r13]
	mov	rdi, rbx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	mov	QWORD PTR [rdi], 0
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	mov	DWORD PTR 0[r13], 1
	jmp	.L18
.L24:
	mov	edi, DWORD PTR GIT_ERROR_OS[rip]
	lea	rsi, .LC5[rip]
	call	git_error_set@PLT
	mov	rdi, r13
	call	git__free@PLT
	mov	eax, -1
	jmp	.L1
.L25:
	mov	rdi, r13
	call	git__free@PLT
	or	eax, -1
	jmp	.L1
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	git_packfile_alloc, .-git_packfile_alloc
	.comm	git_disable_pack_keep_file_checks,4,4
	.comm	GIT_ERROR_OS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_pack.c_git_packfile_alloc.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"invalid packfile path\000"
	.align	2
.LC1:
	.ascii	".idx\000"
	.align	2
.LC2:
	.ascii	".keep\000"
	.align	2
.LC3:
	.ascii	".pack\000"
	.align	2
.LC4:
	.ascii	"packfile not found\000"
	.align	2
.LC5:
	.ascii	"failed to initialize packfile mutex\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	git_packfile_alloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	git_packfile_alloc, %function
git_packfile_alloc:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L23
	sub	sp, sp, #28
	subs	r4, r1, #0
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	mov	r6, r0
	streq	r4, [r0]
	beq	.L3
	mov	r0, r4
	bl	strlen
	mov	r3, #0
	cmp	r0, #3
	mov	r5, r0
	str	r3, [r6]
	bhi	.L4
.L3:
	mov	r2, #0
	ldr	r0, .L23+4
	mov	r1, r2
	bl	git_odb__error_notfound
	mov	r4, r0
.L1:
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L19
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L4:
	mov	r2, r5
	mov	r1, #36
	add	r0, sp, #4
	bl	GIT_ERROR_CHECK_ALLOC_ADD
	mov	r2, #2
	ldr	r1, [sp, #4]
	add	r0, sp, #4
	bl	GIT_ERROR_CHECK_ALLOC_ADD
	ldr	r1, [sp, #4]
	mov	r0, #1
	bl	git__calloc
	mov	r7, r0
	bl	GIT_ERROR_CHECK_ALLOC
	mov	r1, r4
	add	r2, r5, #1
	ldr	r0, [r7, #32]
	bl	memcpy
	mov	r0, r4
	ldr	r1, .L23+8
	bl	git__suffixcmp
	cmp	r0, #0
	bne	.L6
	ldr	r3, .L23+12
	ldr	r0, [r7, #32]
	ldr	r3, [r3]
	sub	r5, r5, #4
	cmp	r3, #0
	add	r0, r5, r0
	beq	.L20
.L7:
	mov	r2, #6
	ldr	r1, .L23+16
	bl	memcpy
.L6:
	ldr	r0, [r7, #32]
	add	r1, sp, #8
	bl	p_stat
	cmp	r0, #0
	blt	.L10
	ldr	r0, [sp, #16]
	bl	S_ISREG
	cmp	r0, #0
	bne	.L21
.L10:
	mov	r0, r7
	bl	git__free
	mov	r2, #0
	ldr	r0, .L23+20
	mov	r1, r2
	bl	git_odb__error_notfound
	mov	r4, r0
	b	.L1
.L21:
	mvn	r5, #0
	mov	r1, #1
	ldr	r2, [sp, #12]
	ldr	r3, [sp, #8]
	stmib	r7, {r1, r5}
	str	r5, [r7, #24]
	str	r2, [r7, #28]
	str	r3, [r7, #20]
	add	r0, r7, #16
	bl	git_mutex_init
	subs	r4, r0, #0
	bne	.L22
	add	r0, r7, #12
	bl	cache_init
	cmp	r0, #0
	strge	r7, [r6]
	bge	.L1
	mov	r0, r7
	bl	git__free
	mov	r4, r5
	b	.L1
.L20:
	mov	r2, #6
	ldr	r1, .L23+24
	bl	memcpy
	ldr	r0, [r7, #32]
	bl	git_path_exists
	cmp	r0, #1
	ldrne	r0, [r7, #32]
	ldreq	r3, [r7, #32]
	streq	r0, [r7]
	addne	r0, r5, r0
	addeq	r0, r5, r3
	b	.L7
.L22:
	ldr	r3, .L23+28
	ldr	r1, .L23+32
	ldr	r0, [r3]
	bl	git_error_set
	mov	r0, r7
	mov	r4, r5
	bl	git__free
	b	.L1
.L19:
	bl	__stack_chk_fail
.L24:
	.align	2
.L23:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	git_disable_pack_keep_file_checks
	.word	.LC3
	.word	.LC4
	.word	.LC2
	.word	GIT_ERROR_OS
	.word	.LC5
	.size	git_packfile_alloc, .-git_packfile_alloc
	.comm	git_disable_pack_keep_file_checks,4,4
	.comm	GIT_ERROR_OS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
