	.file	"extr_panel.c_lcd_open.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	lcd_open, @function
lcd_open:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12d, DWORD PTR EBUSY[rip]
	neg	r12d
	cmp	QWORD PTR lcd_open_cnt[rip], 0
	jne	.L1
	mov	r12d, DWORD PTR [rsi]
	and	r12d, DWORD PTR FMODE_READ[rip]
	jne	.L11
	mov	rax, QWORD PTR lcd_must_clear[rip]
	test	rax, rax
	jne	.L12
.L5:
	add	rax, 1
	mov	QWORD PTR lcd_open_cnt[rip], rax
.L1:
	mov	eax, r12d
	pop	r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	r12d, DWORD PTR EPERM[rip]
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	xor	eax, eax
	call	lcd_clear_display@PLT
	mov	rax, QWORD PTR lcd_open_cnt[rip]
	mov	QWORD PTR lcd_must_clear[rip], 0
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	lcd_open, .-lcd_open
	.comm	lcd_open_cnt,8,8
	.comm	lcd_must_clear,8,8
	.comm	FMODE_READ,4,4
	.comm	EPERM,4,4
	.comm	EBUSY,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_panel.c_lcd_open.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	lcd_open, %function
lcd_open:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r5, .L14
	ldr	r3, [r5]
	cmp	r3, #0
	bne	.L11
	ldr	r3, .L14+4
	ldr	r4, [r1]
	ldr	r3, [r3]
	ands	r4, r4, r3
	bne	.L12
	ldr	r6, .L14+8
	ldr	r3, [r6]
	cmp	r3, #0
	bne	.L13
.L5:
	add	r3, r3, #1
	mov	r0, r4
	str	r3, [r5]
	pop	{r4, r5, r6, pc}
.L12:
	ldr	r3, .L14+12
	ldr	r4, [r3]
	rsb	r4, r4, #0
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L11:
	ldr	r3, .L14+16
	ldr	r4, [r3]
	rsb	r4, r4, #0
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L13:
	bl	lcd_clear_display
	ldr	r3, [r5]
	str	r4, [r6]
	b	.L5
.L15:
	.align	2
.L14:
	.word	lcd_open_cnt
	.word	FMODE_READ
	.word	lcd_must_clear
	.word	EPERM
	.word	EBUSY
	.size	lcd_open, .-lcd_open
	.comm	lcd_open_cnt,4,4
	.comm	lcd_must_clear,4,4
	.comm	FMODE_READ,4,4
	.comm	EPERM,4,4
	.comm	EBUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
