	.file	"extr_lfs1.c_lfs1_file_opencfg.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	lfs1_file_opencfg
	.type	lfs1_file_opencfg, @function
lfs1_file_opencfg:
.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
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, ecx
	sub	rsp, 104
	.cfi_def_cfa_offset 160
	mov	QWORD PTR 8[rsp], rdx
	mov	QWORD PTR [rsp], r8
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 88[rsp], rax
	xor	eax, eax
	mov	eax, ecx
	and	eax, 3
	cmp	eax, DWORD PTR LFS1_O_RDONLY[rip]
	je	.L5
	mov	eax, DWORD PTR 16[rdi]
	test	eax, eax
	je	.L43
.L5:
	lea	rbp, 32[rsp]
	lea	r15, 24[rsp]
	mov	rdi, r14
	lea	rcx, 8[rsp]
	mov	rdx, rbp
	mov	rsi, r15
	call	lfs1_dir_find@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L4
	cmp	DWORD PTR LFS1_ERR_NOENT[rip], eax
	je	.L44
.L1:
	mov	rax, QWORD PTR 88[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L45
	add	rsp, 104
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L44:
	.cfi_restore_state
	mov	rdi, QWORD PTR 8[rsp]
	mov	esi, 47
	call	strchr@PLT
	test	rax, rax
	jne	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	cmp	DWORD PTR LFS1_ERR_NOENT[rip], r12d
	je	.L46
	mov	rax, QWORD PTR LFS1_TYPE_DIR[rip]
	mov	r12d, DWORD PTR LFS1_ERR_ISDIR[rip]
	cmp	QWORD PTR 32[rsp], rax
	je	.L1
	mov	r12d, DWORD PTR LFS1_ERR_EXIST[rip]
	test	DWORD PTR LFS1_O_EXCL[rip], ebx
	jne	.L1
.L9:
	mov	rdx, QWORD PTR 24[rsp]
	mov	rax, QWORD PTR [rsp]
	mov	ecx, DWORD PTR [rdx]
	mov	QWORD PTR 48[r13], rax
	mov	rax, QWORD PTR 72[r13]
	mov	DWORD PTR [rax], ecx
	mov	edx, DWORD PTR 4[rdx]
	mov	DWORD PTR 4[rax], edx
	mov	eax, DWORD PTR 80[rsp]
	mov	DWORD PTR 16[r13], ebx
	mov	DWORD PTR 64[r13], eax
	mov	eax, DWORD PTR 48[rsp]
	mov	QWORD PTR 56[r13], 0
	mov	DWORD PTR 0[r13], eax
	mov	rax, QWORD PTR 56[rsp]
	mov	QWORD PTR 8[r13], rax
	test	DWORD PTR LFS1_O_TRUNC[rip], ebx
	je	.L11
	test	rax, rax
	je	.L12
	or	ebx, DWORD PTR LFS1_F_DIRTY[rip]
	mov	DWORD PTR 16[r13], ebx
.L12:
	mov	DWORD PTR 0[r13], -1
	mov	QWORD PTR 8[r13], 0
.L11:
	mov	rax, QWORD PTR [rsp]
	mov	DWORD PTR 32[r13], -1
	test	rax, rax
	je	.L13
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L13
.L16:
	mov	QWORD PTR 40[r13], rax
.L14:
	lea	rbp, 32[r13]
	mov	rdi, r14
	mov	rsi, rbp
	call	lfs1_cache_drop@PLT
	mov	eax, DWORD PTR 16[r13]
	and	eax, 3
	cmp	eax, DWORD PTR LFS1_O_RDONLY[rip]
	je	.L19
	mov	rsi, rbp
	mov	rdi, r14
	call	lfs1_cache_zero@PLT
.L19:
	mov	rax, QWORD PTR [r14]
	xor	r12d, r12d
	mov	QWORD PTR 24[r13], rax
	mov	QWORD PTR [r14], r13
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L43:
	call	lfs1_deorphan@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L5
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L46:
	test	DWORD PTR LFS1_O_CREAT[rip], ebx
	je	.L1
	mov	rax, QWORD PTR LFS1_TYPE_REG[rip]
	mov	rdi, QWORD PTR 8[rsp]
	mov	DWORD PTR 40[rsp], 44
	mov	QWORD PTR 72[rsp], 0
	mov	QWORD PTR 32[rsp], rax
	call	strlen@PLT
	mov	rcx, QWORD PTR 8[rsp]
	mov	rdx, rbp
	mov	rsi, r15
	mov	rdi, r14
	mov	DWORD PTR 64[rsp], eax
	mov	DWORD PTR 48[rsp], -1
	mov	QWORD PTR 56[rsp], 0
	call	lfs1_dir_append@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L9
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdx, QWORD PTR 8[r14]
	mov	rax, QWORD PTR 8[rdx]
	test	rax, rax
	je	.L15
	cmp	QWORD PTR [r14], 0
	je	.L16
.L41:
	mov	r12d, DWORD PTR LFS1_ERR_NOMEM[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L15:
	mov	eax, DWORD PTR 16[r13]
	and	eax, 3
	cmp	eax, DWORD PTR LFS1_O_RDONLY[rip]
	je	.L47
	mov	edi, DWORD PTR [rdx]
	call	lfs1_malloc@PLT
	mov	QWORD PTR 40[r13], rax
	test	rax, rax
	jne	.L14
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L47:
	mov	edi, DWORD PTR 4[rdx]
	call	lfs1_malloc@PLT
	mov	QWORD PTR 40[r13], rax
	test	rax, rax
	jne	.L14
	jmp	.L41
.L45:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	lfs1_file_opencfg, .-lfs1_file_opencfg
	.comm	LFS1_TYPE_REG,8,8
	.comm	LFS1_TYPE_DIR,8,8
	.comm	LFS1_O_TRUNC,4,4
	.comm	LFS1_O_RDONLY,4,4
	.comm	LFS1_O_EXCL,4,4
	.comm	LFS1_O_CREAT,4,4
	.comm	LFS1_F_DIRTY,4,4
	.comm	LFS1_ERR_NOMEM,4,4
	.comm	LFS1_ERR_NOENT,4,4
	.comm	LFS1_ERR_ISDIR,4,4
	.comm	LFS1_ERR_EXIST,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_lfs1.c_lfs1_file_opencfg.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	lfs1_file_opencfg
	.syntax unified
	.arm
	.fpu softvfp
	.type	lfs1_file_opencfg, %function
lfs1_file_opencfg:
	@ args = 4, pretend = 0, frame = 48
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r8, .L50
	and	ip, r3, #3
	mov	r7, r3
	ldr	r3, [r8]
	sub	sp, sp, #48
	cmp	ip, r3
	ldr	r3, .L50+4
	str	r2, [sp, #4]
	mov	r5, r1
	ldr	r3, [r3]
	str	r3, [sp, #44]
	mov	r3,#0
	mov	r6, r0
	ldr	r10, [sp, #80]
	beq	.L5
	ldr	r3, [r0, #8]
	cmp	r3, #0
	beq	.L43
.L5:
	mov	r0, r6
	add	r2, sp, #16
	add	r1, sp, #12
	add	r3, sp, #4
	bl	lfs1_dir_find
	subs	r4, r0, #0
	ldr	r9, .L50+8
	beq	.L4
	ldr	r3, [r9]
	cmp	r3, r4
	beq	.L44
.L1:
	ldr	r3, .L50+4
	ldr	r2, [r3]
	ldr	r3, [sp, #44]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L45
	mov	r0, r4
	add	sp, sp, #48
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L44:
	mov	r1, #47
	ldr	r0, [sp, #4]
	bl	strchr
	cmp	r0, #0
	bne	.L1
.L4:
	ldr	r3, [r9]
	cmp	r3, r4
	beq	.L46
	ldr	r3, .L50+12
	ldr	r2, [sp, #16]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L47
	ldr	r3, .L50+16
	ldr	r3, [r3]
	tst	r7, r3
	bne	.L48
.L9:
	mov	r1, #0
	ldr	r2, [sp, #12]
	ldr	r3, [r5, #36]
	ldr	r0, [r2]
	str	r10, [r5, #24]
	str	r0, [r3]
	ldr	r0, [r2, #4]
	ldr	r2, .L50+20
	str	r0, [r3, #4]
	ldr	r3, [r2]
	ldr	r0, [sp, #40]
	ldr	r2, [sp, #24]
	tst	r7, r3
	ldr	r3, [sp, #28]
	str	r7, [r5, #8]
	str	r0, [r5, #32]
	str	r2, [r5]
	str	r1, [r5, #28]
	str	r3, [r5, #4]
	beq	.L11
	cmp	r3, r1
	ldrne	r3, .L50+24
	mvn	r2, #0
	ldrne	r3, [r3]
	orrne	r7, r3, r7
	mov	r3, #0
	stm	r5, {r2, r3}
	strne	r7, [r5, #8]
.L11:
	mvn	r3, #0
	cmp	r10, #0
	str	r3, [r5, #16]
	beq	.L13
	ldr	r3, [r10]
	cmp	r3, #0
	beq	.L13
.L16:
	str	r3, [r5, #20]
.L14:
	add	r4, r5, #16
	mov	r1, r4
	mov	r0, r6
	bl	lfs1_cache_drop
	ldr	r3, [r5, #8]
	ldr	r2, [r8]
	and	r3, r3, #3
	cmp	r3, r2
	beq	.L19
	mov	r1, r4
	mov	r0, r6
	bl	lfs1_cache_zero
.L19:
	ldr	r3, [r6]
	mov	r4, #0
	str	r3, [r5, #12]
	str	r5, [r6]
	b	.L1
.L43:
	bl	lfs1_deorphan
	subs	r4, r0, #0
	beq	.L5
	b	.L1
.L46:
	ldr	r3, .L50+28
	ldr	r3, [r3]
	tst	r7, r3
	beq	.L1
	mov	r2, #20
	mov	r4, #0
	ldr	r3, .L50+32
	ldr	r9, [sp, #4]
	ldr	r3, [r3]
	mov	r0, r9
	str	r2, [sp, #20]
	str	r3, [sp, #16]
	str	r4, [sp, #36]
	bl	strlen
	mvn	ip, #0
	mov	lr, r0
	mov	r3, r9
	mov	r0, r6
	add	r2, sp, #16
	add	r1, sp, #12
	str	r4, [sp, #28]
	str	lr, [sp, #32]
	str	ip, [sp, #24]
	bl	lfs1_dir_append
	subs	r4, r0, #0
	beq	.L9
	b	.L1
.L48:
	ldr	r3, .L50+36
	ldr	r4, [r3]
	b	.L1
.L13:
	ldr	r2, [r6, #4]
	ldr	r3, [r2, #8]
	cmp	r3, #0
	beq	.L15
	ldr	r2, [r6]
	cmp	r2, #0
	beq	.L16
.L41:
	ldr	r3, .L50+40
	ldr	r4, [r3]
	b	.L1
.L47:
	ldr	r3, .L50+44
	ldr	r4, [r3]
	b	.L1
.L15:
	ldr	r3, [r5, #8]
	ldr	r1, [r8]
	and	r3, r3, #3
	cmp	r3, r1
	beq	.L49
	ldr	r0, [r2]
	bl	lfs1_malloc
	cmp	r0, #0
	str	r0, [r5, #20]
	bne	.L14
	b	.L41
.L49:
	ldr	r0, [r2, #4]
	bl	lfs1_malloc
	cmp	r0, #0
	str	r0, [r5, #20]
	bne	.L14
	b	.L41
.L45:
	bl	__stack_chk_fail
.L51:
	.align	2
.L50:
	.word	LFS1_O_RDONLY
	.word	.LC0
	.word	LFS1_ERR_NOENT
	.word	LFS1_TYPE_DIR
	.word	LFS1_O_EXCL
	.word	LFS1_O_TRUNC
	.word	LFS1_F_DIRTY
	.word	LFS1_O_CREAT
	.word	LFS1_TYPE_REG
	.word	LFS1_ERR_EXIST
	.word	LFS1_ERR_NOMEM
	.word	LFS1_ERR_ISDIR
	.size	lfs1_file_opencfg, .-lfs1_file_opencfg
	.comm	LFS1_TYPE_REG,4,4
	.comm	LFS1_TYPE_DIR,4,4
	.comm	LFS1_O_TRUNC,4,4
	.comm	LFS1_O_RDONLY,4,4
	.comm	LFS1_O_EXCL,4,4
	.comm	LFS1_O_CREAT,4,4
	.comm	LFS1_F_DIRTY,4,4
	.comm	LFS1_ERR_NOMEM,4,4
	.comm	LFS1_ERR_NOENT,4,4
	.comm	LFS1_ERR_ISDIR,4,4
	.comm	LFS1_ERR_EXIST,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
