	.file	"extr_init-db.c_copy_templates_1.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"cannot stat '%s'"
.LC1:
	.string	"cannot stat template '%s'"
.LC2:
	.string	"cannot opendir '%s'"
.LC3:
	.string	"cannot readlink '%s'"
.LC4:
	.string	"cannot symlink '%s' '%s'"
.LC5:
	.string	"cannot copy '%s' to '%s'"
.LC6:
	.string	"ignoring template %s"
	.text
	.p2align 4
	.type	copy_templates_1, @function
copy_templates_1:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	r15, QWORD PTR [rdi]
	mov	edi, DWORD PTR 8[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	mov	r14, QWORD PTR [rsi]
	mov	esi, 1
	call	safe_create_dir@PLT
	lea	rax, 16[rsp]
	mov	QWORD PTR [rsp], rax
.L2:
	mov	rdi, r12
	call	readdir@PLT
	mov	r13, rax
	test	rax, rax
	je	.L29
.L13:
	mov	rsi, r15
	mov	rdi, rbp
	call	strbuf_setlen@PLT
	mov	rsi, r14
	mov	rdi, rbx
	call	strbuf_setlen@PLT
	mov	rsi, QWORD PTR 0[r13]
	cmp	BYTE PTR [rsi], 46
	je	.L2
	mov	rdi, rbp
	call	strbuf_addstr@PLT
	mov	rsi, QWORD PTR 0[r13]
	mov	rdi, rbx
	mov	r13d, 1
	call	strbuf_addstr@PLT
	mov	edi, DWORD PTR 8[rbp]
	mov	rsi, QWORD PTR [rsp]
	call	lstat@PLT
	test	rax, rax
	je	.L4
	mov	rax, QWORD PTR ENOENT[rip]
	xor	r13d, r13d
	cmp	QWORD PTR errno[rip], rax
	je	.L4
	mov	esi, DWORD PTR 8[rbp]
	lea	rdi, .LC0[rip]
	mov	DWORD PTR 8[rsp], esi
	call	_@PLT
	mov	esi, DWORD PTR 8[rsp]
	mov	edi, eax
	xor	eax, eax
	call	die_errno@PLT
.L4:
	mov	edi, DWORD PTR 8[rbx]
	lea	rsi, 24[rsp]
	call	lstat@PLT
	test	rax, rax
	jne	.L30
.L5:
	mov	edi, DWORD PTR 24[rsp]
	call	S_ISDIR@PLT
	test	rax, rax
	jne	.L31
	test	r13d, r13d
	jne	.L2
	mov	edi, DWORD PTR 24[rsp]
	call	S_ISLNK@PLT
	test	rax, rax
	je	.L9
	movdqu	xmm0, XMMWORD PTR STRBUF_INIT[rip]
	lea	r13, 32[rsp]
	mov	esi, DWORD PTR 8[rbx]
	mov	edx, DWORD PTR 28[rsp]
	mov	rdi, r13
	movaps	XMMWORD PTR 32[rsp], xmm0
	call	strbuf_readlink@PLT
	test	rax, rax
	js	.L32
.L10:
	mov	esi, DWORD PTR 8[rbp]
	mov	edi, DWORD PTR 40[rsp]
	call	symlink@PLT
	test	rax, rax
	jne	.L33
.L11:
	mov	rdi, r13
	call	strbuf_release@PLT
	mov	rdi, r12
	call	readdir@PLT
	mov	r13, rax
	test	rax, rax
	jne	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	mov	rax, QWORD PTR 56[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L34
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L31:
	.cfi_restore_state
	mov	edi, DWORD PTR 8[rbx]
	call	opendir@PLT
	mov	r13, rax
	test	rax, rax
	je	.L35
.L7:
	mov	rdi, rbp
	mov	esi, 47
	call	strbuf_addch@PLT
	mov	rdi, rbx
	mov	esi, 47
	call	strbuf_addch@PLT
	mov	rdi, rbp
	mov	rdx, r13
	mov	rsi, rbx
	call	copy_templates_1
	mov	rdi, r13
	call	closedir@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L30:
	mov	esi, DWORD PTR 8[rbx]
	lea	rdi, .LC1[rip]
	mov	DWORD PTR 8[rsp], esi
	call	_@PLT
	mov	esi, DWORD PTR 8[rsp]
	mov	edi, eax
	xor	eax, eax
	call	die_errno@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edi, DWORD PTR 24[rsp]
	call	S_ISREG@PLT
	test	rax, rax
	je	.L12
	mov	esi, DWORD PTR 8[rbx]
	mov	edi, DWORD PTR 8[rbp]
	mov	edx, DWORD PTR 24[rsp]
	call	copy_file@PLT
	test	rax, rax
	je	.L2
	mov	edx, DWORD PTR 8[rbp]
	mov	r13d, DWORD PTR 8[rbx]
	lea	rdi, .LC5[rip]
	mov	DWORD PTR 8[rsp], edx
	call	_@PLT
	mov	edx, DWORD PTR 8[rsp]
	mov	esi, r13d
	mov	edi, eax
	xor	eax, eax
	call	die_errno@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	mov	r13d, DWORD PTR 8[rbx]
	lea	rdi, .LC6[rip]
	call	_@PLT
	mov	edi, eax
	mov	esi, r13d
	call	error@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L35:
	mov	esi, DWORD PTR 8[rbx]
	lea	rdi, .LC2[rip]
	mov	DWORD PTR 8[rsp], esi
	call	_@PLT
	mov	esi, DWORD PTR 8[rsp]
	mov	edi, eax
	xor	eax, eax
	call	die_errno@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L33:
	mov	edx, DWORD PTR 8[rbp]
	mov	esi, DWORD PTR 40[rsp]
	lea	rdi, .LC4[rip]
	mov	DWORD PTR 12[rsp], edx
	mov	DWORD PTR 8[rsp], esi
	call	_@PLT
	mov	edx, DWORD PTR 12[rsp]
	mov	esi, DWORD PTR 8[rsp]
	mov	edi, eax
	xor	eax, eax
	call	die_errno@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L32:
	mov	esi, DWORD PTR 8[rbx]
	lea	rdi, .LC3[rip]
	mov	DWORD PTR 8[rsp], esi
	call	_@PLT
	mov	esi, DWORD PTR 8[rsp]
	mov	edi, eax
	xor	eax, eax
	call	die_errno@PLT
	jmp	.L10
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	copy_templates_1, .-copy_templates_1
	.comm	errno,8,8
	.comm	STRBUF_INIT,16,16
	.comm	ENOENT,8,8
	.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_init-db.c_copy_templates_1.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"cannot stat '%s'\000"
	.align	2
.LC1:
	.ascii	"cannot stat template '%s'\000"
	.align	2
.LC2:
	.ascii	"cannot opendir '%s'\000"
	.align	2
.LC3:
	.ascii	"cannot readlink '%s'\000"
	.align	2
.LC4:
	.ascii	"cannot symlink '%s' '%s'\000"
	.align	2
.LC5:
	.ascii	"cannot copy '%s' to '%s'\000"
	.align	2
.LC6:
	.ascii	"ignoring template %s\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	copy_templates_1, %function
copy_templates_1:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r0
	mov	r5, r1
	ldr	r3, .L38
	sub	sp, sp, #36
	mov	r1, #1
	ldr	r0, [r0, #4]
	mov	r7, r2
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	ldr	r9, [r6]
	ldr	r8, [r5]
	bl	safe_create_dir
	ldr	fp, .L38+4
	ldr	r10, .L38+8
.L2:
	mov	r0, r7
	bl	readdir
	subs	r4, r0, #0
	beq	.L31
.L13:
	mov	r1, r9
	mov	r0, r6
	bl	strbuf_setlen
	mov	r1, r8
	mov	r0, r5
	bl	strbuf_setlen
	ldr	r1, [r4]
	ldrb	r3, [r1]	@ zero_extendqisi2
	cmp	r3, #46
	beq	.L2
	mov	r0, r6
	bl	strbuf_addstr
	ldr	r1, [r4]
	mov	r0, r5
	bl	strbuf_addstr
	ldr	r0, [r6, #4]
	add	r1, sp, #4
	bl	lstat
	cmp	r0, #0
	moveq	r4, #1
	beq	.L4
	ldr	r2, .L38+12
	ldr	r3, .L38+16
	ldr	r2, [r2]
	ldr	r3, [r3]
	cmp	r2, r3
	moveq	r4, #0
	beq	.L4
	ldr	r0, .L38+20
	bl	_
	ldr	r1, [r6, #4]
	bl	die_errno
	mov	r4, #0
.L4:
	ldr	r0, [r5, #4]
	add	r1, sp, #12
	bl	lstat
	cmp	r0, #0
	bne	.L32
.L5:
	ldr	r0, [sp, #12]
	bl	S_ISDIR
	cmp	r0, #0
	bne	.L33
	cmp	r4, #0
	bne	.L2
	ldr	r0, [sp, #12]
	bl	S_ISLNK
	cmp	r0, #0
	beq	.L9
	ldm	r10, {r0, r1}
	add	r4, sp, #20
	stm	r4, {r0, r1}
	ldr	r2, [sp, #16]
	mov	r0, r4
	ldr	r1, [r5, #4]
	bl	strbuf_readlink
	cmp	r0, #0
	blt	.L34
.L10:
	ldr	r1, [r6, #4]
	ldr	r0, [sp, #24]
	bl	symlink
	cmp	r0, #0
	bne	.L35
.L11:
	mov	r0, r4
	bl	strbuf_release
	mov	r0, r7
	bl	readdir
	subs	r4, r0, #0
	bne	.L13
.L31:
	ldr	r3, .L38
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L36
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L33:
	ldr	r0, [r5, #4]
	bl	opendir
	subs	r4, r0, #0
	beq	.L37
.L7:
	mov	r1, #47
	mov	r0, r6
	bl	strbuf_addch
	mov	r1, #47
	mov	r0, r5
	bl	strbuf_addch
	mov	r0, r6
	mov	r2, r4
	mov	r1, r5
	bl	copy_templates_1
	mov	r0, r4
	bl	closedir
	b	.L2
.L32:
	ldr	r0, .L38+24
	bl	_
	ldr	r1, [r5, #4]
	bl	die_errno
	b	.L5
.L9:
	ldr	r0, [sp, #12]
	bl	S_ISREG
	cmp	r0, #0
	beq	.L12
	ldr	r2, [sp, #12]
	ldr	r1, [r5, #4]
	ldr	r0, [r6, #4]
	bl	copy_file
	cmp	r0, #0
	beq	.L2
	ldr	r0, .L38+28
	bl	_
	ldr	r2, [r6, #4]
	ldr	r1, [r5, #4]
	bl	die_errno
	b	.L2
.L12:
	mov	r0, fp
	bl	_
	ldr	r1, [r5, #4]
	bl	error
	b	.L2
.L37:
	ldr	r0, .L38+32
	bl	_
	ldr	r1, [r5, #4]
	bl	die_errno
	b	.L7
.L35:
	ldr	r0, .L38+36
	bl	_
	ldr	r2, [r6, #4]
	ldr	r1, [sp, #24]
	bl	die_errno
	b	.L11
.L34:
	ldr	r0, .L38+40
	bl	_
	ldr	r1, [r5, #4]
	bl	die_errno
	b	.L10
.L36:
	bl	__stack_chk_fail
.L39:
	.align	2
.L38:
	.word	.LC7
	.word	.LC6
	.word	STRBUF_INIT
	.word	errno
	.word	ENOENT
	.word	.LC0
	.word	.LC1
	.word	.LC5
	.word	.LC2
	.word	.LC4
	.word	.LC3
	.size	copy_templates_1, .-copy_templates_1
	.comm	errno,4,4
	.comm	STRBUF_INIT,8,4
	.comm	ENOENT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
