	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function menu_shader_manager_save_preset_internal
_menu_shader_manager_save_preset_internal: ## @menu_shader_manager_save_preset_internal
	.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	$88, %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, -92(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PATH_MAX_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r14, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	%r14, %rax
	callq	____chkstk_darwin
	movq	%r12, %rdi
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movb	$0, (%r12)
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	movb	$0, (%rbx)
	xorl	%ebx, %ebx
	testq	%rdi, %rdi
	je	LBB0_26
## %bb.1:
	cmpl	$0, (%rdi)
	je	LBB0_26
## %bb.2:
	movq	%rdi, -112(%rbp)                ## 8-byte Spill
	callq	_menu_shader_manager_get_type
	movq	_RARCH_SHADER_NONE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_26
## %bb.3:
	movl	%eax, -84(%rbp)                 ## 4-byte Spill
	movq	_menu_driver_shader_modified@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	cmpq	$0, (%rax)
	cmovel	%r15d, %ecx
	movl	%ecx, -88(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	callq	_string_is_empty
	testq	%rax, %rax
	je	LBB0_4
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	movq	-104(%rbp), %r15                ## 8-byte Reload
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_strlcpy
LBB0_8:
	movl	-84(%rbp), %edi                 ## 4-byte Reload
	callq	_video_shader_get_preset_extension
	movq	%r15, %rdi
	movq	%rax, %rsi
	movl	%r14d, %edx
	callq	_strlcat
	jmp	LBB0_9
LBB0_4:
	movq	-104(%rbp), %r15                ## 8-byte Reload
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	%r14d, %edx
	callq	_strlcpy
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_strstr
	testl	%eax, %eax
	jne	LBB0_9
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	callq	_strstr
	testl	%eax, %eax
	jne	LBB0_9
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	callq	_strstr
	testl	%eax, %eax
	je	LBB0_8
LBB0_9:
	movq	%r15, %rdi
	callq	_path_is_absolute
	testq	%rax, %rax
	je	LBB0_13
## %bb.10:
	movq	%r15, %rdi
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	movl	-88(%rbp), %edx                 ## 4-byte Reload
	callq	_video_shader_write_preset
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rdi
	movq	%r15, %rsi
	callq	_RARCH_LOG
	jmp	LBB0_23
LBB0_13:
	xorl	%eax, %eax
	callq	_config_get_ptr
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movq	%rsp, -128(%rbp)                ## 8-byte Spill
	movq	_PATH_MAX_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movb	$0, (%r15)
	movq	_RARCH_PATH_CONFIG@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_path_is_empty
	testl	%eax, %eax
	jne	LBB0_15
## %bb.14:
	movl	(%r13), %edi
	callq	_path_get
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_fill_pathname_basedir
LBB0_15:
	movq	-120(%rbp), %rax                ## 8-byte Reload
	movups	(%rax), %xmm0
	movaps	%xmm0, -80(%rbp)
	movq	%r15, -64(%rbp)
	leaq	-80(%rbp), %rdi
	callq	_ARRAY_SIZE
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	testq	%rax, %rax
	je	LBB0_21
## %bb.16:
	xorl	%r13d, %r13d
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_17 Depth=1
	incq	%r13
	leaq	-80(%rbp), %rdi
	callq	_ARRAY_SIZE
	cmpq	%rax, %r13
	jae	LBB0_21
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	-80(%rbp,%r13,8), %rdi
	callq	_string_is_empty
	testq	%rax, %rax
	jne	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	-80(%rbp,%r13,8), %rsi
	movq	%r12, %rdi
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	movl	%r14d, %ecx
	callq	_fill_pathname_join
	movq	%r12, %rdi
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	movl	-88(%rbp), %edx                 ## 4-byte Reload
	callq	_video_shader_write_preset
	testl	%eax, %eax
	jne	LBB0_28
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	leaq	L_.str.5(%rip), %rdi
	movq	%r12, %rsi
	callq	_RARCH_WARN
	movq	%r12, %r15
	jmp	LBB0_20
LBB0_21:
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_ERR
	movq	%r15, %r12
LBB0_22:
	movq	-128(%rbp), %rsp                ## 8-byte Reload
	movq	%r12, %r15
LBB0_23:
	movl	-92(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	je	LBB0_26
## %bb.24:
	testl	%ebx, %ebx
	je	LBB0_26
## %bb.25:
	xorl	%edi, %edi
	movl	-84(%rbp), %esi                 ## 4-byte Reload
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	_menu_shader_manager_set_preset
	jmp	LBB0_26
LBB0_12:
	leaq	L_.str.5(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_RARCH_ERR
LBB0_26:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_29
## %bb.27:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_28:
	movl	%eax, %r15d
	leaq	L_.str.4(%rip), %rdi
	movq	%r12, %rsi
	callq	_RARCH_LOG
	movl	%r15d, %ebx
	jmp	LBB0_22
LBB0_29:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RARCH_SHADER_NONE,4,2          ## @RARCH_SHADER_NONE
	.comm	_PATH_MAX_LENGTH,4,2            ## @PATH_MAX_LENGTH
	.comm	_menu_driver_shader_modified,8,3 ## @menu_driver_shader_modified
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	".cgp"

L_.str.1:                               ## @.str.1
	.asciz	".glslp"

L_.str.2:                               ## @.str.2
	.asciz	".slangp"

L_.str.3:                               ## @.str.3
	.asciz	"retroarch"

L_.str.4:                               ## @.str.4
	.asciz	"Saved shader preset to %s.\n"

L_.str.5:                               ## @.str.5
	.asciz	"Failed writing shader preset to %s.\n"

	.comm	_RARCH_PATH_CONFIG,4,2          ## @RARCH_PATH_CONFIG
L_.str.6:                               ## @.str.6
	.asciz	"Failed to write shader preset. Make sure shader directory and/or config directory are writable.\n"

	.no_dead_strip	_menu_shader_manager_save_preset_internal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function menu_shader_manager_save_preset_internal
_menu_shader_manager_save_preset_internal: ; @menu_shader_manager_save_preset_internal
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	sub	sp, sp, #48
	mov	x25, x3
	mov	x19, x2
	mov	x26, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x27, _PATH_MAX_LENGTH@GOTPAGE
Lloh4:
	ldr	x27, [x27, _PATH_MAX_LENGTH@GOTPAGEOFF]
	ldr	w24, [x27]
	mov	x9, x24
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x24, #15
	and	x12, x9, #0x1fffffff0
	sub	x21, x8, x12
	mov	sp, x21
	mov	x9, x24
Lloh7:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh8:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x23, x8, x12
	mov	sp, x23
	strb	wzr, [x23]
	strb	wzr, [x21]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w8, [x22]
	cbz	w8, LBB0_3
; %bb.2:
	mov	x0, x22
	bl	_menu_shader_manager_get_type
Lloh9:
	adrp	x8, _RARCH_SHADER_NONE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RARCH_SHADER_NONE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_6
LBB0_3:
	mov	w26, #0
LBB0_4:
	ldur	x8, [x29, #-88]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_29
; %bb.5:
	mov	x0, x26
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x20, x0
Lloh15:
	adrp	x8, _menu_driver_shader_modified@GOTPAGE
Lloh16:
	ldr	x8, [x8, _menu_driver_shader_modified@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cmp	x8, #0
	csel	w8, w25, wzr, eq
	stur	w8, [x29, #-116]                ; 4-byte Folded Spill
	mov	x0, x26
	bl	_string_is_empty
	cbz	x0, LBB0_9
; %bb.7:
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	mov	x2, x24
	bl	_strlcpy
LBB0_8:
	mov	x0, x20
	bl	_video_shader_get_preset_extension
	mov	x1, x0
	mov	x0, x21
	mov	x2, x24
	bl	_strlcat
	b	LBB0_12
LBB0_9:
	mov	x0, x21
	mov	x1, x26
	mov	x2, x24
	bl	_strlcpy
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x26
	bl	_strstr
	cbnz	w0, LBB0_12
; %bb.10:
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x26
	bl	_strstr
	cbnz	w0, LBB0_12
; %bb.11:
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x26
	bl	_strstr
	cbz	w0, LBB0_8
LBB0_12:
	mov	x0, x21
	bl	_path_is_absolute
	cbz	x0, LBB0_15
; %bb.13:
	mov	x0, x21
	mov	x1, x22
	ldur	w2, [x29, #-116]                ; 4-byte Folded Reload
	bl	_video_shader_write_preset
	mov	x26, x0
	cbz	w0, LBB0_27
; %bb.14:
Lloh26:
	adrp	x0, l_.str.4@PAGE
Lloh27:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x21
	bl	_RARCH_LOG
	cbnz	w19, LBB0_25
	b	LBB0_4
LBB0_15:
	bl	_config_get_ptr
	mov	x26, x0
	mov	x8, sp
	stur	x8, [x29, #-128]                ; 8-byte Folded Spill
	ldr	w28, [x27]
	mov	x9, x28
Lloh28:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh29:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x28, #15
	and	x9, x9, #0x1fffffff0
	sub	x27, x8, x9
	mov	sp, x27
	strb	wzr, [x27]
Lloh30:
	adrp	x25, _RARCH_PATH_CONFIG@GOTPAGE
Lloh31:
	ldr	x25, [x25, _RARCH_PATH_CONFIG@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_path_is_empty
	cbnz	w0, LBB0_17
; %bb.16:
	ldr	w0, [x25]
	bl	_path_get
	mov	x1, x0
	mov	x0, x27
	mov	x2, x28
	bl	_fill_pathname_basedir
LBB0_17:
	ldp	x8, x9, [x26]
	stp	x8, x9, [x29, #-112]
	stur	x27, [x29, #-96]
	sub	x28, x29, #112
	sub	x0, x29, #112
	bl	_ARRAY_SIZE
	mov	x25, #0
	cbz	x0, LBB0_23
; %bb.18:
	mov	x27, #0
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_20 Depth=1
	add	x27, x27, #1
	sub	x0, x29, #112
	bl	_ARRAY_SIZE
	cmp	x27, x0
	b.hs	LBB0_23
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x28, x27, lsl #3]
	bl	_string_is_empty
	cbnz	x0, LBB0_19
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x1, [x28, x27, lsl #3]
	mov	x0, x23
	mov	x2, x21
	mov	x3, x24
	bl	_fill_pathname_join
	mov	x0, x23
	mov	x1, x22
	ldur	w2, [x29, #-116]                ; 4-byte Folded Reload
	bl	_video_shader_write_preset
	cbnz	w0, LBB0_28
; %bb.22:                               ;   in Loop: Header=BB0_20 Depth=1
Lloh32:
	adrp	x0, l_.str.5@PAGE
Lloh33:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x23
	bl	_RARCH_WARN
	mov	x25, x23
	b	LBB0_19
LBB0_23:
Lloh34:
	adrp	x0, l_.str.6@PAGE
Lloh35:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_RARCH_ERR
	mov	w26, #0
	mov	x23, x25
LBB0_24:
	ldur	x8, [x29, #-128]                ; 8-byte Folded Reload
	mov	sp, x8
	mov	x21, x23
	cbz	w19, LBB0_4
LBB0_25:
	cbz	w26, LBB0_4
; %bb.26:
	mov	x0, #0
	mov	x1, x20
	mov	x2, x21
	mov	w3, #1
	bl	_menu_shader_manager_set_preset
	b	LBB0_4
LBB0_27:
	str	x21, [sp, #-16]!
Lloh36:
	adrp	x0, l_.str.5@PAGE
Lloh37:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_RARCH_ERR
	add	sp, sp, #16
	b	LBB0_4
LBB0_28:
	mov	x26, x0
Lloh38:
	adrp	x0, l_.str.4@PAGE
Lloh39:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x23
	bl	_RARCH_LOG
	b	LBB0_24
LBB0_29:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_RARCH_SHADER_NONE,4,2          ; @RARCH_SHADER_NONE
	.comm	_PATH_MAX_LENGTH,4,2            ; @PATH_MAX_LENGTH
	.comm	_menu_driver_shader_modified,8,3 ; @menu_driver_shader_modified
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	".cgp"

l_.str.1:                               ; @.str.1
	.asciz	".glslp"

l_.str.2:                               ; @.str.2
	.asciz	".slangp"

l_.str.3:                               ; @.str.3
	.asciz	"retroarch"

l_.str.4:                               ; @.str.4
	.asciz	"Saved shader preset to %s.\n"

l_.str.5:                               ; @.str.5
	.asciz	"Failed writing shader preset to %s.\n"

	.comm	_RARCH_PATH_CONFIG,4,2          ; @RARCH_PATH_CONFIG
l_.str.6:                               ; @.str.6
	.asciz	"Failed to write shader preset. Make sure shader directory and/or config directory are writable.\n"

	.no_dead_strip	_menu_shader_manager_save_preset_internal
.subsections_via_symbols
