	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gl2_renderchain_init_hw_render
_gl2_renderchain_init_hw_render:        ## @gl2_renderchain_init_hw_render
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movl	%edx, %ebx
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_video_driver_get_hw_context
	movq	%rax, %r13
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_gl2_context_bind_hw_render
	leaq	L_.str(%rip), %rdi
	movl	%ebx, -56(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	movl	%r15d, -60(%rbp)                ## 4-byte Spill
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_RARCH_LOG
	movq	_GL_MAX_TEXTURE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-48(%rbp), %rsi
	callq	_glGetIntegerv
	movq	_RARCH_GL_MAX_RENDERBUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-44(%rbp), %rsi
	callq	_glGetIntegerv
	movl	-48(%rbp), %esi
	movl	-44(%rbp), %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	cmpl	$0, 24(%r12)
	je	LBB0_11
## %bb.1:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	movq	_GL_TEXTURE_2D@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_glBindTexture
	movl	(%r12), %edi
	movq	16(%r12), %rsi
	callq	_gl2_gen_fb
	movl	(%r13), %eax
	movl	4(%r13), %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	(%r12), %edi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	8(%rbx), %rsi
	callq	_gl2_gen_rb
	movl	$1, (%rbx)
LBB0_3:
	cmpl	$0, (%r12)
	je	LBB0_10
## %bb.4:
	xorl	%ebx, %ebx
	movq	_RARCH_GL_FRAMEBUFFER@GOTPCREL(%rip), %r13
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_gl2_bind_fb
	movl	(%r13), %edi
	movq	_RARCH_GL_COLOR_ATTACHMENT0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GL_TEXTURE_2D@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	8(%r12), %rax
	movl	(%rax,%rbx,4), %ecx
	xorl	%r8d, %r8d
	callq	_gl2_fb_texture_2d
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_RARCH_GL_RENDERBUFFER@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	8(%r12), %rax
	movl	(%rax,%rbx,4), %esi
	callq	_gl2_bind_rb
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	movq	_RARCH_GL_DEPTH24_STENCIL8@GOTPCREL(%rip), %rax
	cmoveq	_GL_DEPTH_COMPONENT16@GOTPCREL(%rip), %rax
	movl	(%r15), %edi
	movl	(%rax), %esi
	movq	_GL_DEPTH_STENCIL_ATTACHMENT@GOTPCREL(%rip), %r14
	cmoveq	_RARCH_GL_DEPTH_ATTACHMENT@GOTPCREL(%rip), %r14
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	callq	_gl2_rb_storage
	movl	(%r15), %edi
	xorl	%esi, %esi
	callq	_gl2_bind_rb
	movl	(%r13), %edi
	movl	(%r14), %esi
	movl	(%r15), %edx
	movq	8(%r12), %rax
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movl	(%rax,%rbx,4), %ecx
	callq	_gl2_fb_rb
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r13), %edi
	callq	_gl2_check_fb_status
	movq	_RARCH_GL_FRAMEBUFFER_COMPLETE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	movl	(%r12), %eax
	cmpq	%rax, %rbx
	jb	LBB0_5
LBB0_10:
	xorl	%eax, %eax
	callq	_gl2_renderchain_bind_backbuffer
	movl	$1, 4(%r12)
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_gl2_context_bind_hw_render
	movl	$1, %r14d
	jmp	LBB0_11
LBB0_8:
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %esi
	movq	%rax, %rdx
	callq	_RARCH_ERR
	xorl	%r14d, %r14d
LBB0_11:
	movl	%r14d, %eax
	addq	$40, %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]: Initializing HW render (%u x %u).\n"

	.comm	_GL_MAX_TEXTURE_SIZE,4,2        ## @GL_MAX_TEXTURE_SIZE
	.comm	_RARCH_GL_MAX_RENDERBUFFER_SIZE,4,2 ## @RARCH_GL_MAX_RENDERBUFFER_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"[GL]: Max texture size: %d px, renderbuffer size: %d px.\n"

L_.str.2:                               ## @.str.2
	.asciz	"[GL]: Supports FBO (render-to-texture).\n"

	.comm	_GL_TEXTURE_2D,4,2              ## @GL_TEXTURE_2D
	.comm	_RARCH_GL_FRAMEBUFFER,4,2       ## @RARCH_GL_FRAMEBUFFER
	.comm	_RARCH_GL_COLOR_ATTACHMENT0,4,2 ## @RARCH_GL_COLOR_ATTACHMENT0
	.comm	_RARCH_GL_RENDERBUFFER,4,2      ## @RARCH_GL_RENDERBUFFER
	.comm	_RARCH_GL_DEPTH24_STENCIL8,4,2  ## @RARCH_GL_DEPTH24_STENCIL8
	.comm	_GL_DEPTH_COMPONENT16,4,2       ## @GL_DEPTH_COMPONENT16
	.comm	_GL_DEPTH_STENCIL_ATTACHMENT,4,2 ## @GL_DEPTH_STENCIL_ATTACHMENT
	.comm	_RARCH_GL_DEPTH_ATTACHMENT,4,2  ## @RARCH_GL_DEPTH_ATTACHMENT
	.comm	_RARCH_GL_FRAMEBUFFER_COMPLETE,8,3 ## @RARCH_GL_FRAMEBUFFER_COMPLETE
L_.str.3:                               ## @.str.3
	.asciz	"[GL]: Failed to create HW render FBO #%u, error: 0x%04x.\n"

	.comm	_RARCH_GL_STENCIL_ATTACHMENT,4,2 ## @RARCH_GL_STENCIL_ATTACHMENT
	.no_dead_strip	_gl2_renderchain_init_hw_render
.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_hw_render
_gl2_renderchain_init_hw_render:        ; @gl2_renderchain_init_hw_render
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	str	xzr, [sp, #40]
	bl	_video_driver_get_hw_context
	mov	x23, x0
	mov	x0, x19
	mov	w1, #1
	bl	_gl2_context_bind_hw_render
	stp	x21, x20, [sp, #24]             ; 16-byte Folded Spill
	stp	x21, x20, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_LOG
Lloh2:
	adrp	x8, _GL_MAX_TEXTURE_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GL_MAX_TEXTURE_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	add	x1, sp, #44
	bl	_glGetIntegerv
Lloh5:
	adrp	x8, _RARCH_GL_MAX_RENDERBUFFER_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RARCH_GL_MAX_RENDERBUFFER_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x1, sp, #40
	bl	_glGetIntegerv
	ldp	w9, w8, [sp, #40]
	stp	x8, x9, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_RARCH_LOG
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_11
; %bb.1:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_RARCH_LOG
Lloh12:
	adrp	x8, _GL_TEXTURE_2D@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GL_TEXTURE_2D@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_glBindTexture
	ldr	w0, [x19]
	ldr	x1, [x19, #16]
	bl	_gl2_gen_fb
	ldp	w25, w26, [x23]
	cbz	w25, LBB0_3
; %bb.2:
	ldr	w0, [x19]
	ldr	x1, [x22, #8]
	bl	_gl2_gen_rb
	mov	w8, #1
	str	w8, [x22]
LBB0_3:
	ldr	w8, [x19]
	cbz	w8, LBB0_9
; %bb.4:
	mov	x23, #0
Lloh15:
	adrp	x27, _RARCH_GL_FRAMEBUFFER@GOTPAGE
Lloh16:
	ldr	x27, [x27, _RARCH_GL_FRAMEBUFFER@GOTPAGEOFF]
Lloh17:
	adrp	x24, _RARCH_GL_FRAMEBUFFER_COMPLETE@GOTPAGE
Lloh18:
	ldr	x24, [x24, _RARCH_GL_FRAMEBUFFER_COMPLETE@GOTPAGEOFF]
Lloh19:
	adrp	x20, _RARCH_GL_RENDERBUFFER@GOTPAGE
Lloh20:
	ldr	x20, [x20, _RARCH_GL_RENDERBUFFER@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	lsl	x21, x23, #2
	ldr	w0, [x8, x21]
	bl	_gl2_bind_fb
	ldr	w0, [x27]
Lloh21:
	adrp	x8, _RARCH_GL_COLOR_ATTACHMENT0@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RARCH_GL_COLOR_ATTACHMENT0@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _GL_TEXTURE_2D@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GL_TEXTURE_2D@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	ldr	x8, [x19, #8]
	ldr	w3, [x8, x21]
	mov	w4, #0
	bl	_gl2_fb_texture_2d
	cbz	w25, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x20]
	ldr	x8, [x22, #8]
	ldr	w1, [x8, x21]
	bl	_gl2_bind_rb
	ldr	w0, [x20]
	cmp	w26, #0
Lloh27:
	adrp	x8, _RARCH_GL_DEPTH24_STENCIL8@GOTPAGE
Lloh28:
	ldr	x8, [x8, _RARCH_GL_DEPTH24_STENCIL8@GOTPAGEOFF]
Lloh29:
	adrp	x9, _GL_DEPTH_COMPONENT16@GOTPAGE
Lloh30:
	ldr	x9, [x9, _GL_DEPTH_COMPONENT16@GOTPAGEOFF]
	csel	x8, x9, x8, eq
	ldr	w1, [x8]
Lloh31:
	adrp	x8, _RARCH_GL_DEPTH_ATTACHMENT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _RARCH_GL_DEPTH_ATTACHMENT@GOTPAGEOFF]
Lloh33:
	adrp	x9, _GL_DEPTH_STENCIL_ATTACHMENT@GOTPAGE
Lloh34:
	ldr	x9, [x9, _GL_DEPTH_STENCIL_ATTACHMENT@GOTPAGEOFF]
	csel	x28, x8, x9, eq
	ldp	x2, x3, [sp, #24]               ; 16-byte Folded Reload
                                        ; kill: def $w2 killed $w2 killed $x2
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_gl2_rb_storage
	ldr	w0, [x20]
	mov	w1, #0
	bl	_gl2_bind_rb
	ldr	w0, [x27]
	ldr	w1, [x28]
	ldr	w2, [x20]
	ldr	x8, [x22, #8]
	ldr	w3, [x8, x21]
	bl	_gl2_fb_rb
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x27]
	bl	_gl2_check_fb_status
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x23, x23, #1
	ldr	w8, [x19]
	cmp	x23, x8
	b.lo	LBB0_5
LBB0_9:
	bl	_gl2_renderchain_bind_backbuffer
	mov	w20, #1
	str	w20, [x19, #4]
	mov	x0, x19
	mov	w1, #0
	bl	_gl2_context_bind_hw_render
	b	LBB0_12
LBB0_10:
	mov	x2, x0
Lloh35:
	adrp	x0, l_.str.3@PAGE
Lloh36:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x23
	bl	_RARCH_ERR
LBB0_11:
	mov	w20, #0
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[GL]: Initializing HW render (%u x %u).\n"

	.comm	_GL_MAX_TEXTURE_SIZE,4,2        ; @GL_MAX_TEXTURE_SIZE
	.comm	_RARCH_GL_MAX_RENDERBUFFER_SIZE,4,2 ; @RARCH_GL_MAX_RENDERBUFFER_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"[GL]: Max texture size: %d px, renderbuffer size: %d px.\n"

l_.str.2:                               ; @.str.2
	.asciz	"[GL]: Supports FBO (render-to-texture).\n"

	.comm	_GL_TEXTURE_2D,4,2              ; @GL_TEXTURE_2D
	.comm	_RARCH_GL_FRAMEBUFFER,4,2       ; @RARCH_GL_FRAMEBUFFER
	.comm	_RARCH_GL_COLOR_ATTACHMENT0,4,2 ; @RARCH_GL_COLOR_ATTACHMENT0
	.comm	_RARCH_GL_RENDERBUFFER,4,2      ; @RARCH_GL_RENDERBUFFER
	.comm	_RARCH_GL_DEPTH24_STENCIL8,4,2  ; @RARCH_GL_DEPTH24_STENCIL8
	.comm	_GL_DEPTH_COMPONENT16,4,2       ; @GL_DEPTH_COMPONENT16
	.comm	_GL_DEPTH_STENCIL_ATTACHMENT,4,2 ; @GL_DEPTH_STENCIL_ATTACHMENT
	.comm	_RARCH_GL_DEPTH_ATTACHMENT,4,2  ; @RARCH_GL_DEPTH_ATTACHMENT
	.comm	_RARCH_GL_FRAMEBUFFER_COMPLETE,8,3 ; @RARCH_GL_FRAMEBUFFER_COMPLETE
l_.str.3:                               ; @.str.3
	.asciz	"[GL]: Failed to create HW render FBO #%u, error: 0x%04x.\n"

	.comm	_RARCH_GL_STENCIL_ATTACHMENT,4,2 ; @RARCH_GL_STENCIL_ATTACHMENT
	.no_dead_strip	_gl2_renderchain_init_hw_render
.subsections_via_symbols
