	.file	"extr_graphics.c_gx_priv_open_screen.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Could not open dispmanx display %d"
	.text
	.p2align 4
	.type	gx_priv_open_screen, @function
gx_priv_open_screen:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	lea	rdi, gx[rip+16]
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rsi
	call	vcos_mutex_lock@PLT
	mov	rax, QWORD PTR gx[rip]
	lea	rax, [rax+rbp*4]
	mov	r12d, DWORD PTR [rax]
	test	r12d, r12d
	je	.L2
	mov	rdx, QWORD PTR gx[rip+8]
	add	r12d, 1
	mov	rdx, QWORD PTR [rdx+rbp*8]
	mov	QWORD PTR [rbx], rdx
	mov	DWORD PTR [rax], r12d
	xor	r12d, r12d
.L3:
	lea	rdi, gx[rip+16]
	call	vcos_mutex_unlock@PLT
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rdi, rbp
	call	vc_dispmanx_display_open@PLT
	cmp	QWORD PTR DISPMANX_NO_HANDLE[rip], rax
	je	.L7
	mov	rdx, QWORD PTR gx[rip+8]
	mov	QWORD PTR [rdx+rbp*8], rax
	mov	rdx, QWORD PTR gx[rip]
	mov	DWORD PTR [rdx+rbp*4], 1
	mov	QWORD PTR [rbx], rax
	jmp	.L3
.L7:
	mov	rsi, rbp
	lea	rdi, .LC0[rip]
	or	r12d, -1
	call	GX_LOG@PLT
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	gx_priv_open_screen, .-gx_priv_open_screen
	.comm	gx,24,16
	.comm	DISPMANX_NO_HANDLE,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_graphics.c_gx_priv_open_screen.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Could not open dispmanx display %d\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	gx_priv_open_screen, %function
gx_priv_open_screen:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	ldr	r6, .L8
	mov	r7, r1
	mov	r0, r6
	bl	vcos_mutex_lock
	ldr	r3, [r6, #-8]
	sub	r8, r6, #8
	ldr	r5, [r3, r4, lsl #2]
	cmp	r5, #0
	beq	.L2
	add	r2, r5, #1
	mov	r5, #0
	ldr	r1, [r8, #4]
	ldr	r1, [r1, r4, lsl #2]
	str	r1, [r7]
	str	r2, [r3, r4, lsl #2]
.L3:
	ldr	r0, .L8
	bl	vcos_mutex_unlock
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	mov	r0, r4
	bl	vc_dispmanx_display_open
	ldr	r3, .L8+4
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L7
	mov	r2, #1
	ldr	r1, [r8, #4]
	ldr	r3, [r6, #-8]
	str	r0, [r1, r4, lsl #2]
	str	r2, [r3, r4, lsl #2]
	str	r0, [r7]
	b	.L3
.L7:
	mov	r1, r4
	ldr	r0, .L8+8
	bl	GX_LOG
	mvn	r5, #0
	b	.L3
.L9:
	.align	2
.L8:
	.word	gx+8
	.word	DISPMANX_NO_HANDLE
	.word	.LC0
	.size	gx_priv_open_screen, .-gx_priv_open_screen
	.comm	gx,12,4
	.comm	DISPMANX_NO_HANDLE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
