	.file	"extr_gl.c_gl2_renderchain_init.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"[GL]: Failed to locate FBO functions. Won't be able to use render-to-texture.\n"
	.align 8
.LC2:
	.string	"[GL]: Creating FBO %d @ %ux%u\n"
	.align 8
.LC3:
	.string	"[GL]: Creating feedback FBO %d @ %ux%u\n"
	.align 8
.LC4:
	.string	"[GL]: Tried to create feedback FBO of pass #%u, but there are only %d FBO passes. Will use input texture as feedback texture.\n"
	.align 8
.LC5:
	.string	"[GL]: Failed to create FBO targets. Will continue without FBO.\n"
	.text
	.p2align 4
	.type	gl2_renderchain_init, @function
gl2_renderchain_init:
.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
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, ecx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 136
	.cfi_def_cfa_offset 192
	mov	DWORD PTR 4[rsp], edx
	lea	rsi, 28[rsp]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 120[rsp], rax
	xor	eax, eax
	call	gl2_shader_info@PLT
	test	eax, eax
	je	.L1
	test	rbx, rbx
	je	.L1
	mov	r11d, DWORD PTR 28[rsp]
	test	r11d, r11d
	jne	.L29
.L1:
	mov	rax, QWORD PTR 120[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L30
	add	rsp, 136
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L29:
	.cfi_restore_state
	mov	eax, DWORD PTR [rbx]
	lea	r14, 32[rsp]
	mov	rdi, rbx
	mov	DWORD PTR 32[rsp], 1
	mov	rsi, r14
	mov	DWORD PTR 8[rsp], eax
	mov	eax, DWORD PTR 4[rbx]
	mov	DWORD PTR 12[rsp], eax
	lea	rax, 48[rsp]
	mov	QWORD PTR 40[rsp], rax
	call	gl2_shader_scale@PLT
	mov	eax, DWORD PTR 28[rsp]
	mov	rsi, r14
	mov	rdi, rbx
	mov	DWORD PTR 32[rsp], eax
	lea	rax, 80[rsp]
	mov	QWORD PTR 40[rsp], rax
	call	gl2_shader_scale@PLT
	mov	eax, DWORD PTR 28[rsp]
	cmp	eax, 1
	je	.L31
.L3:
	mov	r9d, DWORD PTR 48[rbx]
	test	r9d, r9d
	je	.L32
	mov	r8d, DWORD PTR 80[rsp]
	lea	esi, -1[rax]
	mov	DWORD PTR 0[rbp], esi
	test	r8d, r8d
	je	.L6
	mov	DWORD PTR 0[rbp], eax
	mov	esi, eax
.L6:
	mov	edi, DWORD PTR 48[rsp]
	test	edi, edi
	jne	.L7
	mov	rax, QWORD PTR RARCH_SCALE_INPUT[rip]
	mov	DWORD PTR 56[rsp], 0x3f800000
	mov	QWORD PTR 64[rsp], rax
	mov	QWORD PTR 72[rsp], rax
	movabs	rax, 4575657221408423937
	mov	QWORD PTR 48[rsp], rax
.L7:
	mov	rax, QWORD PTR 8[rbp]
	movdqa	xmm1, XMMWORD PTR 48[rsp]
	mov	r12d, 32
	mov	r15d, 1
	movups	XMMWORD PTR [rax], xmm1
	movdqa	xmm2, XMMWORD PTR 64[rsp]
	movups	XMMWORD PTR 16[rax], xmm2
	cmp	esi, 1
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L8:
	add	rax, r12
	mov	rsi, r14
	add	r15d, 1
	mov	rdi, rbx
	mov	DWORD PTR 32[rsp], r15d
	mov	QWORD PTR 40[rsp], rax
	call	gl2_shader_scale@PLT
	mov	rax, QWORD PTR 8[rbp]
	lea	rsi, [rax+r12]
	mov	edx, DWORD PTR [rsi]
	test	edx, edx
	jne	.L11
	mov	rdi, QWORD PTR RARCH_SCALE_INPUT[rip]
	movss	xmm0, DWORD PTR .LC1[rip]
	movabs	rcx, 4575657221408423937
	mov	QWORD PTR [rsi], rcx
	mov	QWORD PTR 16[rsi], rdi
	mov	QWORD PTR 24[rsi], rdi
	movss	DWORD PTR 8[rsi], xmm0
.L11:
	add	r12, 32
	cmp	r15d, DWORD PTR 0[rbp]
	jl	.L8
.L12:
	mov	r9d, DWORD PTR 12[rsp]
	mov	r8d, DWORD PTR 8[rsp]
	mov	ecx, r13d
	mov	rsi, rbp
	mov	edx, DWORD PTR 4[rsp]
	mov	rdi, rbx
	xor	r12d, r12d
	xor	r13d, r13d
	lea	r14, .LC2[rip]
	call	gl2_renderchain_recompute_pass_sizes@PLT
	mov	ecx, DWORD PTR 0[rbp]
	test	ecx, ecx
	jle	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	mov	r15, QWORD PTR 24[rbx]
	add	r15, r12
	mov	edi, DWORD PTR 20[r15]
	call	next_pow2@PLT
	mov	QWORD PTR 8[r15], rax
	mov	r15, QWORD PTR 24[rbx]
	add	r15, r12
	mov	edi, DWORD PTR 16[r15]
	call	next_pow2@PLT
	mov	esi, r13d
	mov	rdi, r14
	add	r13d, 1
	mov	QWORD PTR [r15], rax
	mov	rax, QWORD PTR 24[rbx]
	add	rax, r12
	add	r12, 24
	mov	rdx, QWORD PTR 8[rax]
	mov	rcx, QWORD PTR [rax]
	call	RARCH_LOG@PLT
	cmp	DWORD PTR 0[rbp], r13d
	jg	.L9
.L10:
	mov	rax, QWORD PTR 40[rbx]
	mov	edi, DWORD PTR 32[rbx]
	lea	rsi, 12[rbx]
	call	[QWORD PTR [rax]]
	mov	DWORD PTR 8[rbx], eax
	test	eax, eax
	je	.L13
	mov	esi, DWORD PTR 12[rbx]
	mov	edx, DWORD PTR 0[rbp]
	cmp	esi, edx
	jb	.L33
	lea	rdi, .LC4[rip]
	call	RARCH_WARN@PLT
	mov	DWORD PTR 8[rbx], 0
.L13:
	mov	rsi, rbp
	mov	rdi, rbx
	call	gl2_create_fbo_textures@PLT
	mov	rsi, rbp
	mov	rdi, rbx
	call	gl2_create_fbo_targets@PLT
	test	eax, eax
	je	.L34
	mov	DWORD PTR 16[rbx], 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L31:
	mov	r10d, DWORD PTR 48[rsp]
	test	r10d, r10d
	jne	.L3
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L32:
	lea	rdi, .LC0[rip]
	call	RARCH_ERR@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L34:
	mov	edi, DWORD PTR 0[rbp]
	mov	esi, DWORD PTR 4[rbp]
	call	glDeleteTextures@PLT
	lea	rdi, .LC5[rip]
	call	RARCH_ERR@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L33:
	mov	rax, QWORD PTR 24[rbx]
	lea	rdx, [rsi+rsi*2]
	lea	rdi, .LC3[rip]
	mov	esi, r13d
	lea	rax, [rax+rdx*8]
	mov	rdx, QWORD PTR 8[rax]
	mov	rcx, QWORD PTR [rax]
	call	RARCH_LOG@PLT
	jmp	.L13
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	gl2_renderchain_init, .-gl2_renderchain_init
	.comm	RARCH_SCALE_INPUT,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC1:
	.long	1065353216
	.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_renderchain_init.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"[GL]: Failed to locate FBO functions. Won't be able"
	.ascii	" to use render-to-texture.\012\000"
	.align	2
.LC1:
	.ascii	"[GL]: Creating FBO %d @ %ux%u\012\000"
	.align	2
.LC2:
	.ascii	"[GL]: Creating feedback FBO %d @ %ux%u\012\000"
	.align	2
.LC3:
	.ascii	"[GL]: Tried to create feedback FBO of pass #%u, but"
	.ascii	" there are only %d FBO passes. Will use input textu"
	.ascii	"re as feedback texture.\012\000"
	.align	2
.LC4:
	.ascii	"[GL]: Failed to create FBO targets. Will continue w"
	.ascii	"ithout FBO.\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	gl2_renderchain_init, %function
gl2_renderchain_init:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r7, r3
	sub	sp, sp, #76
	ldr	r3, .L41
	mov	r5, r1
	add	r1, sp, #16
	mov	r4, r0
	mov	r6, r2
	ldr	r3, [r3]
	str	r3, [sp, #68]
	mov	r3,#0
	bl	gl2_shader_info
	cmp	r4, #0
	cmpne	r0, #0
	beq	.L1
	ldr	r3, [sp, #16]
	cmp	r3, #0
	bne	.L36
.L1:
	ldr	r3, .L41
	ldr	r2, [r3]
	ldr	r3, [sp, #68]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L37
	add	sp, sp, #76
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L36:
	mov	r3, #1
	str	r3, [sp, #20]
	ldr	r3, [r4]
	add	r1, sp, #20
	str	r3, [sp, #8]
	ldr	r3, [r4, #4]
	mov	r0, r4
	add	r8, sp, #28
	str	r3, [sp, #12]
	str	r8, [sp, #24]
	bl	gl2_shader_scale
	ldr	r2, [sp, #16]
	add	r3, sp, #48
	mov	r0, r4
	add	r1, sp, #20
	str	r3, [sp, #24]
	str	r2, [sp, #20]
	bl	gl2_shader_scale
	ldr	r3, [sp, #16]
	cmp	r3, #1
	beq	.L38
.L3:
	ldr	r2, [r4, #32]
	cmp	r2, #0
	beq	.L39
	ldr	r2, [sp, #48]
	sub	r9, r3, #1
	cmp	r2, #0
	str	r9, [r5]
	movne	r9, r3
	strne	r3, [r5]
	ldr	r3, [sp, #28]
	cmp	r3, #0
	bne	.L7
	mov	r2, #1
	ldr	r3, .L41+4
	str	r2, [sp, #28]
	ldr	r2, [r3]
	mov	r3, #1065353216
	str	r2, [sp, #40]
	str	r2, [sp, #44]
	str	r3, [sp, #32]	@ float
	str	r3, [sp, #36]	@ float
.L7:
	ldr	ip, [r5, #8]
	mov	lr, r8
	mov	r8, ip
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	r8!, {r0, r1, r2, r3}
	ldr	r3, [lr]
	cmp	r9, #1
	str	r3, [r8]
	ble	.L12
	mov	fp, #1
	mov	r10, #20
	mov	r8, #1065353216
	ldr	r9, .L41+4
.L8:
	add	ip, ip, r10
	mov	r0, r4
	add	fp, fp, #1
	add	r1, sp, #20
	str	ip, [sp, #24]
	str	fp, [sp, #20]
	bl	gl2_shader_scale
	ldr	ip, [r5, #8]
	ldr	r2, [ip, r10]
	add	r3, ip, r10
	cmp	r2, #0
	bne	.L11
	ldr	r2, [r9]
	str	r8, [r3, #8]	@ float
	str	r8, [r3, #4]	@ float
	str	r2, [r3, #12]
	str	r2, [r3, #16]
	mov	r3, #1
	str	r3, [ip, r10]
.L11:
	ldr	r3, [r5]
	add	r10, r10, #20
	cmp	fp, r3
	blt	.L8
.L12:
	ldr	r3, [sp, #12]
	mov	r2, r6
	str	r3, [sp, #4]
	ldr	r3, [sp, #8]
	mov	r1, r5
	str	r3, [sp]
	mov	r0, r4
	mov	r3, r7
	bl	gl2_renderchain_recompute_pass_sizes
	ldr	r3, [r5]
	mov	r6, #0
	cmp	r3, #0
	ldrgt	r9, .L41+8
	ble	.L10
.L9:
	ldr	r8, [r4, #20]
	lsl	r7, r6, #4
	add	r8, r8, r6, lsl #4
	ldr	r0, [r8, #12]
	bl	next_pow2
	ldr	r10, [r4, #20]
	str	r0, [r8, #4]
	add	r3, r10, r7
	ldr	r0, [r3, #8]
	bl	next_pow2
	ldr	r3, [r4, #20]
	str	r0, [r10, r6, lsl #4]
	add	r7, r3, r7
	mov	r1, r6
	ldr	r3, [r3, r6, lsl #4]
	mov	r0, r9
	ldr	r2, [r7, #4]
	bl	RARCH_LOG
	ldr	r3, [r5]
	add	r6, r6, #1
	cmp	r3, r6
	bgt	.L9
.L10:
	ldr	r3, [r4, #28]
	ldr	r0, [r4, #24]
	ldr	r3, [r3]
	add	r1, r4, #12
	blx	r3
	cmp	r0, #0
	str	r0, [r4, #8]
	beq	.L13
	ldr	r3, [r4, #12]
	ldr	r2, [r5]
	cmp	r3, r2
	bcc	.L40
	mov	r1, r3
	ldr	r0, .L41+12
	bl	RARCH_WARN
	mov	r3, #0
	str	r3, [r4, #8]
.L13:
	mov	r1, r5
	mov	r0, r4
	bl	gl2_create_fbo_textures
	mov	r1, r5
	mov	r0, r4
	bl	gl2_create_fbo_targets
	cmp	r0, #0
	movne	r3, #1
	strne	r3, [r4, #16]
	bne	.L1
	ldm	r5, {r0, r1}
	bl	glDeleteTextures
	ldr	r0, .L41+16
	bl	RARCH_ERR
	b	.L1
.L38:
	ldr	r2, [sp, #28]
	cmp	r2, #0
	bne	.L3
	b	.L1
.L39:
	ldr	r0, .L41+20
	bl	RARCH_ERR
	b	.L1
.L40:
	ldr	r0, [r4, #20]
	mov	r1, r6
	add	r2, r0, r3, lsl #4
	ldr	r2, [r2, #4]
	ldr	r3, [r0, r3, lsl #4]
	ldr	r0, .L41+24
	bl	RARCH_LOG
	b	.L13
.L37:
	bl	__stack_chk_fail
.L42:
	.align	2
.L41:
	.word	.LC5
	.word	RARCH_SCALE_INPUT
	.word	.LC1
	.word	.LC3
	.word	.LC4
	.word	.LC0
	.word	.LC2
	.size	gl2_renderchain_init, .-gl2_renderchain_init
	.comm	RARCH_SCALE_INPUT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
