	.file	"extr_gl.c_gl2_free.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	gl2_free, @function
gl2_free:
.LFB0:
	.cfi_startproc
	endbr64
	test	rdi, rdi
	je	.L1
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xor	esi, esi
	mov	rbp, rdi
	sub	rsp, 16
	.cfi_def_cfa_offset 32
	call	gl2_context_bind_hw_render@PLT
	cmp	QWORD PTR 88[rbp], 0
	jne	.L10
.L3:
	xor	eax, eax
	call	font_driver_free_osd@PLT
	mov	rax, QWORD PTR 80[rbp]
	mov	edi, DWORD PTR 72[rbp]
	call	[QWORD PTR [rax]]
	mov	rsi, QWORD PTR 64[rbp]
	mov	edi, DWORD PTR 0[rbp]
	call	glDeleteTextures@PLT
	lea	rdi, 48[rbp]
	call	scaler_ctx_gen_reset@PLT
	cmp	QWORD PTR 40[rbp], 0
	jne	.L11
	cmp	QWORD PTR 16[rbp], 0
	mov	rsi, QWORD PTR 8[rbp]
	jne	.L12
.L5:
	mov	rdi, rbp
	call	gl2_renderchain_deinit_fbo@PLT
	mov	rsi, QWORD PTR 8[rbp]
	mov	rdi, rbp
	call	gl2_renderchain_deinit_hw_render@PLT
	mov	rdi, rbp
	call	gl2_deinit_chain@PLT
	xor	eax, eax
	call	video_context_driver_free@PLT
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	mov	rdi, rbp
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	gl2_destroy_resources@PLT
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	xor	edi, edi
	mov	QWORD PTR 8[rsp], rsi
	call	glBindVertexArray@PLT
	mov	rsi, QWORD PTR 8[rsp]
	mov	edi, 1
	call	glDeleteVertexArrays@PLT
	mov	rsi, QWORD PTR 8[rbp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rsi, QWORD PTR 32[rbp]
	mov	edi, 4
	call	glDeleteBuffers@PLT
	lea	rdi, 24[rbp]
	call	scaler_ctx_gen_reset@PLT
	cmp	QWORD PTR 16[rbp], 0
	mov	rsi, QWORD PTR 8[rbp]
	je	.L5
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rsi, QWORD PTR 8[rbp]
	mov	rdi, rbp
	call	gl2_renderchain_fence_free@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L1:
	.cfi_def_cfa_offset 8
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE0:
	.size	gl2_free, .-gl2_free
	.comm	GL_TEXTURE_REFERENCE_BUFFER_SCE,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_gl.c_gl2_free.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	gl2_free, %function
gl2_free:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	subs	r4, r0, #0
	popeq	{r4, r5, r6, pc}
	mov	r1, #0
	bl	gl2_context_bind_hw_render
	ldr	r3, [r4, #48]
	cmp	r3, #0
	bne	.L17
.L3:
	mov	r5, r4
	bl	font_driver_free_osd
	ldr	r3, [r4, #44]
	ldr	r0, [r4, #40]
	ldr	r3, [r3]
	blx	r3
	ldr	r0, [r5], #24
	ldr	r1, [r4, #36]
	bl	glDeleteTextures
	mov	r0, r5
	bl	scaler_ctx_gen_reset
	ldr	r3, [r4, #20]
	cmp	r3, #0
	bne	.L18
	ldr	r3, [r4, #8]
	ldr	r5, [r4, #4]
	cmp	r3, #0
	bne	.L19
.L5:
	mov	r1, r5
	mov	r0, r4
	bl	gl2_renderchain_deinit_fbo
	ldr	r1, [r4, #4]
	mov	r0, r4
	bl	gl2_renderchain_deinit_hw_render
	mov	r0, r4
	bl	gl2_deinit_chain
	bl	video_context_driver_free
	mov	r0, r4
	pop	{r4, r5, r6, lr}
	b	gl2_destroy_resources
.L19:
	mov	r0, #0
	bl	glBindVertexArray
	mov	r1, r5
	mov	r0, #1
	bl	glDeleteVertexArrays
	ldr	r5, [r4, #4]
	b	.L5
.L18:
	ldr	r1, [r4, #16]
	mov	r0, #4
	bl	glDeleteBuffers
	add	r0, r4, #12
	bl	scaler_ctx_gen_reset
	ldr	r3, [r4, #8]
	ldr	r5, [r4, #4]
	cmp	r3, #0
	beq	.L5
	b	.L19
.L17:
	mov	r0, r4
	ldr	r1, [r4, #4]
	bl	gl2_renderchain_fence_free
	b	.L3
	.size	gl2_free, .-gl2_free
	.comm	GL_TEXTURE_REFERENCE_BUFFER_SCE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
