	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gl_cg_load_preset
_gl_cg_load_preset:                     ## @gl_cg_load_preset
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_gl_cg_load_stock
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	je	LBB0_23
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	callq	_RARCH_LOG
	movq	%rbx, %rdi
	callq	_video_shader_read_preset
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r14
	movl	$1, %edi
	movl	$16, %esi
	callq	_calloc
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_video_shader_read_conf_preset
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movq	8(%r15), %rsi
	movq	%r14, %rdi
	callq	_video_shader_resolve_parameters
	movq	%r14, %rdi
	callq	_config_file_free
	movq	8(%r15), %rdi
	movl	(%rdi), %eax
	movq	_GFX_MAX_SHADERS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	addl	$-3, %esi
	cmpl	%esi, %eax
	jle	LBB0_9
## %bb.8:
	leaq	L_.str.3(%rip), %rdi
	callq	_RARCH_WARN
	movl	(%rbx), %eax
	addl	$-3, %eax
	movq	8(%r15), %rdi
	movl	%eax, (%rdi)
LBB0_9:
	testl	%eax, %eax
	je	LBB0_19
## %bb.10:
	xorl	%ebx, %ebx
	leaq	L_.str.4(%rip), %r14
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%rbx
	movl	(%rdi), %eax
	cmpq	%rax, %rbx
	jae	LBB0_14
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rdi), %rax
	movq	(%rax,%rbx,8), %rcx
	cmpb	$0, (%rcx)
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	16(%r15), %rax
	movl	(%rax,%rbx,4), %edi
	movl	$4, %esi
	movq	%r14, %rdx
	callq	_snprintf
	movq	8(%r15), %rdi
	jmp	LBB0_13
LBB0_2:
	leaq	L_.str.1(%rip), %rdi
LBB0_21:
	callq	_RARCH_ERR
	jmp	LBB0_22
LBB0_14:
	testl	%eax, %eax
	je	LBB0_19
## %bb.15:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_gl_cg_load_shader
	testl	%eax, %eax
	je	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_17 Depth=1
	incl	%ebx
	movq	8(%r15), %rdi
	cmpl	(%rdi), %ebx
	jb	LBB0_17
LBB0_19:
	movl	(%r15), %esi
	callq	_gl_load_luts
	movl	%eax, %ecx
	movl	$1, %eax
	testl	%ecx, %ecx
	jne	LBB0_23
## %bb.20:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_21
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	callq	_RARCH_ERR
LBB0_4:
	movq	%r14, %rdi
	callq	_config_file_free
LBB0_22:
	xorl	%eax, %eax
LBB0_23:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[CG]: Loading Cg meta-shader: %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to load preset.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to parse CGP file.\n"

	.comm	_GFX_MAX_SHADERS,4,2            ## @GFX_MAX_SHADERS
L_.str.3:                               ## @.str.3
	.asciz	"Too many shaders ... Capping shader amount to %d.\n"

L_.str.4:                               ## @.str.4
	.asciz	"-D%s_ALIAS"

L_.str.5:                               ## @.str.5
	.asciz	"Failed to load shaders ...\n"

L_.str.6:                               ## @.str.6
	.asciz	"Failed to load lookup textures ...\n"

	.no_dead_strip	_gl_cg_load_preset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gl_cg_load_preset
_gl_cg_load_preset:                     ; @gl_cg_load_preset
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_gl_cg_load_stock
	cbz	w0, LBB0_22
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_RARCH_LOG
	mov	x0, x20
	bl	_video_shader_read_preset
	cbz	x0, LBB0_11
; %bb.2:
	mov	x20, x0
	mov	w0, #1
	mov	w1, #16
	bl	_calloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_20
; %bb.3:
	mov	x1, x0
	mov	x0, x20
	bl	_video_shader_read_conf_preset
	cbz	w0, LBB0_19
; %bb.4:
	ldr	x1, [x19, #8]
	mov	x0, x20
	bl	_video_shader_resolve_parameters
	mov	x0, x20
	bl	_config_file_free
	ldr	x0, [x19, #8]
	ldr	w8, [x0]
Lloh2:
	adrp	x20, _GFX_MAX_SHADERS@GOTPAGE
Lloh3:
	ldr	x20, [x20, _GFX_MAX_SHADERS@GOTPAGEOFF]
	ldr	w9, [x20]
	sub	w1, w9, #3
	cmp	w8, w1
	b.le	LBB0_6
; %bb.5:
Lloh4:
	adrp	x0, l_.str.3@PAGE
Lloh5:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_RARCH_WARN
	ldr	w8, [x20]
	sub	w8, w8, #3
	ldr	x0, [x19, #8]
	str	w8, [x0]
LBB0_6:
	cbz	w8, LBB0_17
; %bb.7:
	mov	x21, #0
Lloh6:
	adrp	x20, l_.str.4@PAGE
Lloh7:
	add	x20, x20, l_.str.4@PAGEOFF
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x21, x21, #1
	ldr	w8, [x0]
	cmp	x21, x8
	b.hs	LBB0_13
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x0, #8]
	ldr	x3, [x8, x21, lsl #3]
	ldrb	w8, [x3]
	cbz	w8, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x21, lsl #2]
	mov	w1, #4
	mov	x2, x20
	bl	_snprintf
	ldr	x0, [x19, #8]
	b	LBB0_8
LBB0_11:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_12:
	bl	_RARCH_ERR
	b	LBB0_21
LBB0_13:
	cbz	w8, LBB0_17
; %bb.14:
	mov	w20, #0
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_gl_cg_load_shader
	cbz	w0, LBB0_24
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	add	w20, w20, #1
	ldr	x0, [x19, #8]
	ldr	w8, [x0]
	cmp	w20, w8
	b.lo	LBB0_15
LBB0_17:
	ldr	w1, [x19]
	bl	_gl_load_luts
	cbz	w0, LBB0_23
; %bb.18:
	mov	w0, #1
	b	LBB0_22
LBB0_19:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_RARCH_ERR
LBB0_20:
	mov	x0, x20
	bl	_config_file_free
LBB0_21:
	mov	w0, #0
LBB0_22:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_23:
Lloh12:
	adrp	x0, l_.str.6@PAGE
Lloh13:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_12
LBB0_24:
Lloh14:
	adrp	x0, l_.str.5@PAGE
Lloh15:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_12
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[CG]: Loading Cg meta-shader: %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to load preset.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to parse CGP file.\n"

	.comm	_GFX_MAX_SHADERS,4,2            ; @GFX_MAX_SHADERS
l_.str.3:                               ; @.str.3
	.asciz	"Too many shaders ... Capping shader amount to %d.\n"

l_.str.4:                               ; @.str.4
	.asciz	"-D%s_ALIAS"

l_.str.5:                               ; @.str.5
	.asciz	"Failed to load shaders ...\n"

l_.str.6:                               ; @.str.6
	.asciz	"Failed to load lookup textures ...\n"

	.no_dead_strip	_gl_cg_load_preset
.subsections_via_symbols
