	.file	"extr_mtd.c_mtd_check_open.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Could not open mtd device: %s\n"
	.align 8
.LC1:
	.string	"Could not get MTD device info from %s\n"
	.text
	.p2align 4
	.globl	mtd_check_open
	.type	mtd_check_open, @function
mtd_check_open:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xor	esi, esi
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	sub	rsp, 40
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	mtd_open@PLT
	test	eax, eax
	js	.L8
	mov	esi, DWORD PTR MEMGETINFO[rip]
	lea	rdx, 12[rsp]
	mov	edi, eax
	mov	r12d, eax
	call	ioctl@PLT
	test	rax, rax
	jne	.L9
	mov	eax, DWORD PTR 20[rsp]
	mov	DWORD PTR mtdsize[rip], eax
	mov	eax, DWORD PTR 16[rsp]
	mov	DWORD PTR erasesize[rip], eax
	mov	eax, DWORD PTR 12[rsp]
	mov	DWORD PTR mtdtype[rip], eax
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L10
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	mov	edi, DWORD PTR stderr[rip]
	mov	rdx, r13
	lea	rsi, .LC0[rip]
	mov	r12d, -1
	call	fprintf@PLT
	jmp	.L1
.L9:
	mov	edi, DWORD PTR stderr[rip]
	mov	rdx, r13
	lea	rsi, .LC1[rip]
	call	fprintf@PLT
	mov	edi, r12d
	mov	r12d, -1
	call	close@PLT
	jmp	.L1
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	mtd_check_open, .-mtd_check_open
	.comm	stderr,4,4
	.comm	mtdtype,4,4
	.comm	mtdsize,4,4
	.comm	erasesize,4,4
	.comm	MEMGETINFO,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_mtd.c_mtd_check_open.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Could not open mtd device: %s\012\000"
	.align	2
.LC1:
	.ascii	"Could not get MTD device info from %s\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	mtd_check_open
	.syntax unified
	.arm
	.fpu softvfp
	.type	mtd_check_open, %function
mtd_check_open:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, lr}
	ldr	r3, .L11
	sub	sp, sp, #20
	mov	r1, #0
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	mov	r4, r0
	bl	mtd_open
	subs	r5, r0, #0
	blt	.L8
	ldr	r3, .L11+4
	mov	r2, sp
	ldr	r1, [r3]
	bl	ioctl
	cmp	r0, #0
	bne	.L9
	ldr	r2, .L11+8
	ldr	ip, [sp, #8]
	ldr	r1, .L11+12
	ldr	r0, [sp, #4]
	ldr	r3, .L11+16
	str	ip, [r2]
	ldr	r2, [sp]
	str	r0, [r1]
	str	r2, [r3]
.L1:
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L10
	mov	r0, r5
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, pc}
.L8:
	ldr	r3, .L11+20
	mov	r2, r4
	ldr	r0, [r3]
	ldr	r1, .L11+24
	bl	fprintf
	mvn	r5, #0
	b	.L1
.L9:
	ldr	r3, .L11+20
	mov	r2, r4
	ldr	r0, [r3]
	ldr	r1, .L11+28
	bl	fprintf
	mov	r0, r5
	bl	close
	mvn	r5, #0
	b	.L1
.L10:
	bl	__stack_chk_fail
.L12:
	.align	2
.L11:
	.word	.LC2
	.word	MEMGETINFO
	.word	mtdsize
	.word	erasesize
	.word	mtdtype
	.word	stderr
	.word	.LC0
	.word	.LC1
	.size	mtd_check_open, .-mtd_check_open
	.comm	stderr,4,4
	.comm	mtdtype,4,4
	.comm	mtdsize,4,4
	.comm	erasesize,4,4
	.comm	MEMGETINFO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
