	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_video_shader_read_reference_path ## -- Begin function video_shader_read_reference_path
	.p2align	4, 0x90
_video_shader_read_reference_path:      ## @video_shader_read_reference_path
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_string_is_empty
	testq	%rax, %rax
	je	LBB0_3
LBB0_1:
	xorl	%ebx, %ebx
LBB0_2:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r15, %rdi
	callq	_path_is_valid
	testl	%eax, %eax
	je	LBB0_1
## %bb.4:
	movq	_RETRO_VFS_FILE_ACCESS_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_filestream_open
	testq	%rax, %rax
	je	LBB0_1
## %bb.5:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_filestream_getline
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_filestream_close
	testq	%r14, %r14
	je	LBB0_1
## %bb.6:
	leaq	L_.str(%rip), %rbx
	movq	%rbx, %rdi
	callq	_STRLEN_CONST
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_strncmp
	testl	%eax, %eax
	je	LBB0_12
LBB0_7:
	xorl	%ebx, %ebx
LBB0_8:
	movq	%r14, %rdi
	callq	_free
	jmp	LBB0_2
LBB0_12:
	leaq	L_.str(%rip), %rdi
	callq	_STRLEN_CONST
	movslq	%eax, %r12
	movsbl	(%r14,%r12), %edi
	callq	_isspace
	testq	%rax, %rax
	je	LBB0_7
## %bb.13:
	movq	%r14, %rbx
	addq	%r12, %rbx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movsbl	1(%rbx), %edi
	incq	%rbx
	callq	_isspace
	testq	%rax, %rax
	jne	LBB0_14
## %bb.15:
	cmpb	$34, (%rbx)
	jne	LBB0_21
## %bb.16:
	leaq	1(%rbx), %r12
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movzbl	1(%rbx), %eax
	cmpb	$34, %al
	je	LBB0_24
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	testb	%al, %al
	je	LBB0_30
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	incq	%rbx
	jmp	LBB0_17
LBB0_21:
	movq	%rbx, %rdi
	callq	_strlen
	movslq	%eax, %r12
	movsbl	-1(%rbx,%r12), %edi
	callq	_isspace
	testq	%rax, %rax
	je	LBB0_23
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movb	$0, -1(%rbx,%r12)
	movsbl	-2(%rbx,%r12), %edi
	callq	_isspace
	decq	%r12
	testq	%rax, %rax
	jne	LBB0_22
LBB0_23:
	movq	%rbx, %r12
	jmp	LBB0_25
LBB0_24:
	movb	$0, 1(%rbx)
LBB0_25:
	movq	%r12, %rdi
	callq	_string_is_empty
	testq	%rax, %rax
	jne	LBB0_7
## %bb.27:
	movq	_PATH_MAX_LENGTH@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.28:
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_path_is_absolute
	movl	(%r13), %ecx
	movq	%rbx, %rdi
	testl	%eax, %eax
	je	LBB0_34
## %bb.29:
	movq	%r12, %rsi
	movl	%ecx, %edx
	callq	_strlcpy
	jmp	LBB0_8
LBB0_30:
	movsbl	(%rbx), %edi
LBB0_31:                                ## =>This Inner Loop Header: Depth=1
	callq	_isspace
	testq	%rax, %rax
	je	LBB0_25
## %bb.32:                              ##   in Loop: Header=BB0_31 Depth=1
	movb	$0, (%rbx)
	movsbl	-1(%rbx), %edi
	decq	%rbx
	jmp	LBB0_31
LBB0_34:
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_fill_pathname_resolve_relative
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_RETRO_VFS_FILE_ACCESS_READ,4,2 ## @RETRO_VFS_FILE_ACCESS_READ
	.comm	_RETRO_VFS_FILE_ACCESS_HINT_NONE,4,2 ## @RETRO_VFS_FILE_ACCESS_HINT_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"#reference"

	.comm	_PATH_MAX_LENGTH,4,2            ## @PATH_MAX_LENGTH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_video_shader_read_reference_path ; -- Begin function video_shader_read_reference_path
	.p2align	2
_video_shader_read_reference_path:      ; @video_shader_read_reference_path
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
	bl	_string_is_empty
	cbz	x0, LBB0_3
LBB0_1:
	mov	x21, #0
LBB0_2:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x0, x20
	bl	_path_is_valid
	cbz	w0, LBB0_1
; %bb.4:
Lloh0:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_READ@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_filestream_open
	mov	x21, x0
	cbz	x0, LBB0_2
; %bb.5:
	mov	x0, x21
	bl	_filestream_getline
	mov	x19, x0
	mov	x0, x21
	bl	_filestream_close
	cbz	x19, LBB0_1
; %bb.6:
Lloh6:
	adrp	x21, l_.str@PAGE
Lloh7:
	add	x21, x21, l_.str@PAGEOFF
	mov	x0, x21
	bl	_STRLEN_CONST
	mov	x2, x0
	mov	x0, x21
	mov	x1, x19
	bl	_strncmp
	cbz	w0, LBB0_9
LBB0_7:
	mov	x21, #0
LBB0_8:
	mov	x0, x19
	bl	_free
	b	LBB0_2
LBB0_9:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_STRLEN_CONST
	add	x21, x19, w0, sxtw
	ldrsb	w0, [x21]
	bl	_isspace
	cbz	x0, LBB0_7
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldrsb	w0, [x21, #1]!
	bl	_isspace
	cbnz	x0, LBB0_10
; %bb.11:
	ldrb	w8, [x21]
	cmp	w8, #34
	b.ne	LBB0_16
; %bb.12:
	add	x22, x21, #1
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldrb	w8, [x21, #1]
	cmp	w8, #34
	b.eq	LBB0_19
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	cbz	w8, LBB0_20
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x21, x21, #1
	b	LBB0_13
LBB0_16:
	mov	x0, x21
	bl	_strlen
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x22, w0
	add	x8, x21, x22
	ldursb	w0, [x8, #-1]
	bl	_isspace
	cbz	x0, LBB0_18
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	add	x8, x21, x22
	sturb	wzr, [x8, #-1]
	ldursb	w0, [x8, #-2]
	bl	_isspace
	sub	x22, x22, #1
	cbnz	x0, LBB0_17
LBB0_18:
	mov	x22, x21
	b	LBB0_22
LBB0_19:
	strb	wzr, [x21, #1]
	b	LBB0_22
LBB0_20:
	ldrsb	w0, [x21]
	bl	_isspace
	cbz	x0, LBB0_22
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	strb	wzr, [x21]
	ldrsb	w0, [x21, #-1]!
	bl	_isspace
	cbnz	x0, LBB0_21
LBB0_22:
	mov	x0, x22
	bl	_string_is_empty
	cbnz	x0, LBB0_7
; %bb.23:
Lloh10:
	adrp	x23, _PATH_MAX_LENGTH@GOTPAGE
Lloh11:
	ldr	x23, [x23, _PATH_MAX_LENGTH@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_malloc
	mov	x21, x0
	cbz	x0, LBB0_8
; %bb.24:
	mov	x0, x22
	bl	_path_is_absolute
	ldr	w3, [x23]
	cbz	w0, LBB0_26
; %bb.25:
	mov	x0, x21
	mov	x1, x22
	mov	x2, x3
	bl	_strlcpy
	b	LBB0_8
LBB0_26:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	bl	_fill_pathname_resolve_relative
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_RETRO_VFS_FILE_ACCESS_READ,4,2 ; @RETRO_VFS_FILE_ACCESS_READ
	.comm	_RETRO_VFS_FILE_ACCESS_HINT_NONE,4,2 ; @RETRO_VFS_FILE_ACCESS_HINT_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"#reference"

	.comm	_PATH_MAX_LENGTH,4,2            ; @PATH_MAX_LENGTH
.subsections_via_symbols
