	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gl2_renderchain_init
_gl2_renderchain_init:                  ## @gl2_renderchain_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movl	%edx, %ebx
	movq	%rsi, %r14
	movq	%rdi, %r13
	leaq	-48(%rbp), %rsi
	callq	_gl2_shader_info
	testl	%eax, %eax
	je	LBB0_26
## %bb.1:
	testq	%r13, %r13
	je	LBB0_26
## %bb.2:
	cmpl	$0, -48(%rbp)
	je	LBB0_26
## %bb.3:
	movl	(%r13), %eax
	movl	%eax, -80(%rbp)                 ## 4-byte Spill
	movl	4(%r13), %eax
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	movl	$1, -64(%rbp)
	leaq	-112(%rbp), %rax
	movq	%rax, -56(%rbp)
	leaq	-64(%rbp), %r15
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_gl2_shader_scale
	movl	-48(%rbp), %eax
	movl	%eax, -64(%rbp)
	leaq	-144(%rbp), %rax
	movq	%rax, -56(%rbp)
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_gl2_shader_scale
	movl	-48(%rbp), %eax
	movl	-112(%rbp), %ecx
	cmpl	$1, %eax
	jne	LBB0_5
## %bb.4:
	testl	%ecx, %ecx
	je	LBB0_26
LBB0_5:
	cmpl	$0, 48(%r13)
	je	LBB0_16
## %bb.6:
	movl	%ebx, -68(%rbp)                 ## 4-byte Spill
	movl	%r12d, -72(%rbp)                ## 4-byte Spill
	cmpl	$1, -144(%rbp)
	sbbl	$0, %eax
	movl	%eax, (%r14)
	testl	%ecx, %ecx
	jne	LBB0_8
## %bb.7:
	movl	$1065353216, -104(%rbp)         ## imm = 0x3F800000
	movq	_RARCH_SCALE_INPUT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -96(%rbp)
	movq	%rax, -88(%rbp)
	movabsq	$4575657221408423937, %rax      ## imm = 0x3F80000000000001
	movq	%rax, -112(%rbp)
LBB0_8:
	movq	8(%r14), %rax
	movups	-112(%rbp), %xmm0
	movups	-96(%rbp), %xmm1
	movups	%xmm1, 16(%rax)
	movups	%xmm0, (%rax)
	cmpl	$2, (%r14)
	jl	LBB0_13
## %bb.9:
	movq	8(%r14), %rax
	movl	$1, %r15d
	movl	$32, %r12d
	leaq	-64(%rbp), %rbx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_11 Depth=1
	movslq	(%r14), %rcx
	addq	$32, %r12
	cmpq	%rcx, %r15
	jge	LBB0_13
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	incq	%r15
	movl	%r15d, -64(%rbp)
	addq	%r12, %rax
	movq	%rax, -56(%rbp)
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_gl2_shader_scale
	movq	8(%r14), %rax
	cmpl	$0, (%rax,%r12)
	jne	LBB0_10
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movabsq	$4575657222473777152, %rcx      ## imm = 0x3F8000003F800000
	movq	%rcx, 4(%rax,%r12)
	movq	_RARCH_SCALE_INPUT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 16(%rax,%r12)
	movq	%rcx, 24(%rax,%r12)
	movl	$1, (%rax,%r12)
	jmp	LBB0_10
LBB0_13:
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	movl	-72(%rbp), %ecx                 ## 4-byte Reload
	movl	-80(%rbp), %r8d                 ## 4-byte Reload
	movl	-76(%rbp), %r9d                 ## 4-byte Reload
	callq	_gl2_renderchain_recompute_pass_sizes
	cmpl	$0, (%r14)
	jle	LBB0_17
## %bb.14:
	xorl	%ebx, %ebx
	leaq	L_.str.1(%rip), %r15
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r13), %rax
	movl	20(%rax,%rbx), %edi
	callq	_next_pow2
	movq	24(%r13), %rcx
	movq	%rax, 8(%rcx,%rbx)
	movl	16(%rcx,%rbx), %edi
	callq	_next_pow2
	movq	24(%r13), %rcx
	movq	%rax, (%rcx,%rbx)
	movq	8(%rcx,%rbx), %rdx
	movq	%r15, %rdi
	movl	%r12d, %esi
	movq	%rax, %rcx
	callq	_RARCH_LOG
	incq	%r12
	movslq	(%r14), %rax
	addq	$24, %rbx
	cmpq	%rax, %r12
	jl	LBB0_15
	jmp	LBB0_18
LBB0_16:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_25
LBB0_17:
	xorl	%r12d, %r12d
LBB0_18:
	movq	40(%r13), %rax
	movl	32(%r13), %edi
	leaq	12(%r13), %r15
	movq	%r15, %rsi
	callq	*(%rax)
	movl	%eax, 8(%r13)
	testl	%eax, %eax
	je	LBB0_22
## %bb.19:
	movl	(%r15), %esi
	movl	(%r14), %edx
	cmpl	%edx, %esi
	jae	LBB0_21
## %bb.20:
	movq	24(%r13), %rax
	leaq	(%rsi,%rsi,2), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	8(%rax,%rdx,8), %rdx
	leaq	L_.str.2(%rip), %rdi
	movl	%r12d, %esi
	callq	_RARCH_LOG
	jmp	LBB0_22
LBB0_21:
	leaq	L_.str.3(%rip), %rdi
	callq	_RARCH_WARN
	movl	$0, 8(%r13)
LBB0_22:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_gl2_create_fbo_textures
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_gl2_create_fbo_targets
	testl	%eax, %eax
	je	LBB0_24
## %bb.23:
	movl	$1, 16(%r13)
	jmp	LBB0_26
LBB0_24:
	movl	(%r14), %edi
	movl	4(%r14), %esi
	callq	_glDeleteTextures
	leaq	L_.str.4(%rip), %rdi
LBB0_25:
	callq	_RARCH_ERR
LBB0_26:
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[GL]: Failed to locate FBO functions. Won't be able to use render-to-texture.\n"

	.comm	_RARCH_SCALE_INPUT,8,3          ## @RARCH_SCALE_INPUT
L_.str.1:                               ## @.str.1
	.asciz	"[GL]: Creating FBO %d @ %ux%u\n"

L_.str.2:                               ## @.str.2
	.asciz	"[GL]: Creating feedback FBO %d @ %ux%u\n"

L_.str.3:                               ## @.str.3
	.asciz	"[GL]: Tried to create feedback FBO of pass #%u, but there are only %d FBO passes. Will use input texture as feedback texture.\n"

L_.str.4:                               ## @.str.4
	.asciz	"[GL]: Failed to create FBO targets. Will continue without FBO.\n"

	.no_dead_strip	_gl2_renderchain_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gl2_renderchain_init
_gl2_renderchain_init:                  ; @gl2_renderchain_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	d9, d8, [sp, #96]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #112]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #128]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x21, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	add	x1, sp, #72
	bl	_gl2_shader_info
	cbz	w0, LBB0_26
; %bb.1:
	cbz	x20, LBB0_26
; %bb.2:
	ldr	w8, [sp, #72]
	cbz	w8, LBB0_26
; %bb.3:
	ldp	w23, w24, [x20]
	mov	w8, #1
	str	w8, [sp, #80]
	add	x8, sp, #40
	str	x8, [sp, #88]
	add	x1, sp, #80
	mov	x0, x20
	bl	_gl2_shader_scale
	ldr	w8, [sp, #72]
	str	w8, [sp, #80]
	add	x8, sp, #8
	str	x8, [sp, #88]
	add	x1, sp, #80
	mov	x0, x20
	bl	_gl2_shader_scale
	ldr	w9, [sp, #72]
	ldr	w8, [sp, #40]
	cmp	w9, #1
	b.ne	LBB0_5
; %bb.4:
	cbz	w8, LBB0_26
LBB0_5:
	ldr	w10, [x20, #48]
	cbz	w10, LBB0_16
; %bb.6:
	ldr	w10, [sp, #8]
	cmp	w10, #0
	cset	w10, eq
	sub	w9, w9, w10
	str	w9, [x19]
	cbnz	w8, LBB0_8
; %bb.7:
	fmov.2s	v0, #1.00000000
Lloh0:
	adrp	x8, _RARCH_SCALE_INPUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RARCH_SCALE_INPUT@GOTPAGEOFF]
	stur	d0, [sp, #44]
Lloh2:
	ldr	x8, [x8]
	stp	x8, x8, [sp, #56]
	mov	w8, #1
	str	w8, [sp, #40]
LBB0_8:
	ldr	x8, [x19, #8]
	ldur	q0, [sp, #40]
	ldur	q1, [sp, #56]
	stp	q0, q1, [x8]
	ldr	w8, [x19]
	cmp	w8, #1
	b.le	LBB0_13
; %bb.9:
	mov	x25, #0
	ldr	x8, [x19, #8]
	mov	w26, #1
	fmov.2s	v8, #1.00000000
Lloh3:
	adrp	x27, _RARCH_SCALE_INPUT@GOTPAGE
Lloh4:
	ldr	x27, [x27, _RARCH_SCALE_INPUT@GOTPAGEOFF]
	mov	w28, #1
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	ldrsw	x9, [x19]
	add	x25, x25, #32
	cmp	x28, x9
	b.ge	LBB0_13
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	add	x28, x28, #1
	str	w28, [sp, #80]
	add	x8, x8, x25
	add	x8, x8, #32
	str	x8, [sp, #88]
	add	x1, sp, #80
	mov	x0, x20
	bl	_gl2_shader_scale
	ldr	x8, [x19, #8]
	add	x9, x8, x25
	ldr	w10, [x9, #32]
	cbnz	w10, LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	stur	d8, [x9, #36]
	ldr	x10, [x27]
	stp	x10, x10, [x9, #48]
	str	w26, [x9, #32]
	b	LBB0_10
LBB0_13:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	mov	x3, x21
	mov	x4, x23
	mov	x5, x24
	bl	_gl2_renderchain_recompute_pass_sizes
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.14:
	mov	x23, #0
	mov	x21, #0
Lloh5:
	adrp	x22, l_.str.1@PAGE
Lloh6:
	add	x22, x22, l_.str.1@PAGEOFF
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #24]
	add	x8, x8, x23
	ldr	w0, [x8, #20]
	bl	_next_pow2
	ldr	x8, [x20, #24]
	add	x8, x8, x23
	str	x0, [x8, #8]
	ldr	w0, [x8, #16]
	bl	_next_pow2
	mov	x3, x0
	ldr	x8, [x20, #24]
	add	x8, x8, x23
	str	x0, [x8]
	ldr	x2, [x8, #8]
	mov	x0, x22
	mov	x1, x21
	bl	_RARCH_LOG
	add	x21, x21, #1
	ldrsw	x8, [x19]
	add	x23, x23, #24
	cmp	x21, x8
	b.lt	LBB0_15
	b	LBB0_18
LBB0_16:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_25
LBB0_17:
	mov	w21, #0
LBB0_18:
	ldr	x8, [x20, #40]
	ldr	x8, [x8]
	ldr	w0, [x20, #32]
	add	x22, x20, #12
	mov	x1, x22
	blr	x8
	str	w0, [x20, #8]
	cbz	w0, LBB0_22
; %bb.19:
	ldr	w1, [x22]
	ldr	w2, [x19]
	cmp	w1, w2
	b.hs	LBB0_21
; %bb.20:
	ldr	x8, [x20, #24]
	mov	w9, #24
	madd	x8, x1, x9, x8
	ldp	x3, x2, [x8]
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	bl	_RARCH_LOG
	b	LBB0_22
LBB0_21:
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_RARCH_WARN
	str	wzr, [x20, #8]
LBB0_22:
	mov	x0, x20
	mov	x1, x19
	bl	_gl2_create_fbo_textures
	mov	x0, x20
	mov	x1, x19
	bl	_gl2_create_fbo_targets
	cbz	w0, LBB0_24
; %bb.23:
	mov	w8, #1
	str	w8, [x20, #16]
	b	LBB0_26
LBB0_24:
	ldp	w0, w1, [x19]
	bl	_glDeleteTextures
Lloh13:
	adrp	x0, l_.str.4@PAGE
Lloh14:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_25:
	bl	_RARCH_ERR
LBB0_26:
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #128]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #112]            ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #96]               ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[GL]: Failed to locate FBO functions. Won't be able to use render-to-texture.\n"

	.comm	_RARCH_SCALE_INPUT,8,3          ; @RARCH_SCALE_INPUT
l_.str.1:                               ; @.str.1
	.asciz	"[GL]: Creating FBO %d @ %ux%u\n"

l_.str.2:                               ; @.str.2
	.asciz	"[GL]: Creating feedback FBO %d @ %ux%u\n"

l_.str.3:                               ; @.str.3
	.asciz	"[GL]: Tried to create feedback FBO of pass #%u, but there are only %d FBO passes. Will use input texture as feedback texture.\n"

l_.str.4:                               ; @.str.4
	.asciz	"[GL]: Failed to create FBO targets. Will continue without FBO.\n"

	.no_dead_strip	_gl2_renderchain_init
.subsections_via_symbols
