	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CDVD_Cache_Dir                 ## -- Begin function CDVD_Cache_Dir
	.p2align	4, 0x90
_CDVD_Cache_Dir:                        ## @CDVD_Cache_Dir
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_CachedDirInfo@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	_TRUE@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_16
## %bb.1:
	movl	%esi, %ebx
	movq	%r14, %rdi
	callq	_ComparePath
	movq	_MATCH@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.2:
	movq	_CACHE_START@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_10
## %bb.3:
	cmpq	$0, 8(%r15)
	je	LBB0_4
## %bb.5:
	movq	$0, 8(%r15)
	movq	_MAX_DIR_CACHE_SECTORS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	24(%r15), %rsi
	cmpq	%rax, %rsi
	cmovaq	%rax, %rsi
	movq	32(%r15), %rdi
	movq	%rsi, 16(%r15)
	jmp	LBB0_6
LBB0_12:
	movq	%r14, %rdi
	callq	_ComparePath
	movq	_SUBDIR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.13:
	cmpq	$0, 8(%r15)
	je	LBB0_15
## %bb.14:
	movq	$0, 8(%r15)
	movq	_MAX_DIR_CACHE_SECTORS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	24(%r15), %rsi
	cmpq	%rax, %rsi
	cmovaq	%rax, %rsi
	movq	32(%r15), %rdi
	movq	%rsi, 16(%r15)
	movl	48(%r15), %edx
	movq	_cdReadMode@GOTPCREL(%rip), %rcx
	callq	_ReadSect
	cmpq	(%r12), %rax
	jne	LBB0_7
LBB0_15:
	movq	40(%r15), %rdi
	callq	_strlen
	cltq
	addq	%rax, %r14
	jmp	LBB0_19
LBB0_16:
	xorl	%eax, %eax
	callq	_isValidDisc
	movl	$-1, %ebx
	testl	%eax, %eax
	je	LBB0_9
## %bb.17:
	xorl	%edi, %edi
	callq	_sceCdDiskReady
	xorl	%eax, %eax
	callq	_CDVD_GetVolumeDescriptor
	cmpq	(%r12), %rax
	jne	LBB0_9
## %bb.18:
	movq	$0, 56(%r15)
	movq	40(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_strcpy
	movq	$0, 8(%r15)
	movq	_CDVolDesc@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rdi, 32(%r15)
	movl	8(%rax), %eax
	movl	%eax, %ecx
	sarl	$11, %ecx
	andl	$2047, %eax                     ## imm = 0x7FF
	cmpl	$1, %eax
	sbbl	$-1, %ecx
	movslq	%ecx, %rsi
	movq	%rsi, 24(%r15)
	movq	_MAX_DIR_CACHE_SECTORS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rsi, %rax
	cmovbq	%rax, %rsi
	movq	%rsi, 16(%r15)
	movl	48(%r15), %edx
	movq	_cdReadMode@GOTPCREL(%rip), %rcx
	callq	_ReadSect
	cmpq	(%r12), %rax
	jne	LBB0_7
LBB0_19:
	leaq	_CDVD_Cache_Dir.dirname(%rip), %rbx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_strcpy
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_FindPath                       ## TAILCALL
LBB0_10:
	movq	16(%r15), %rdi
	movq	24(%r15), %rsi
	addq	8(%r15), %rdi
	movq	%rdi, 8(%r15)
	subq	%rdi, %rsi
	movq	_MAX_DIR_CACHE_SECTORS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rsi
	cmovaq	%rax, %rsi
	movq	%rsi, 16(%r15)
	addq	32(%r15), %rdi
LBB0_6:
	movl	48(%r15), %edx
	movq	_cdReadMode@GOTPCREL(%rip), %rcx
	callq	_ReadSect
	cmpq	(%r12), %rax
	jne	LBB0_7
## %bb.11:
	movq	%rax, %rbx
	jmp	LBB0_8
LBB0_7:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rbx
LBB0_8:
	movq	%rbx, (%r15)
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	(%r12), %rbx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_CDVD_Cache_Dir.dirname,1024,4 ## @CDVD_Cache_Dir.dirname
	.comm	_CachedDirInfo,64,3             ## @CachedDirInfo
	.comm	_TRUE,8,3                       ## @TRUE
	.comm	_MATCH,8,3                      ## @MATCH
	.comm	_CACHE_START,4,2                ## @CACHE_START
	.comm	_MAX_DIR_CACHE_SECTORS,8,3      ## @MAX_DIR_CACHE_SECTORS
	.comm	_cdReadMode,4,2                 ## @cdReadMode
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_SUBDIR,8,3                     ## @SUBDIR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

	.comm	_CDVolDesc,16,3                 ## @CDVolDesc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CDVD_Cache_Dir                 ; -- Begin function CDVD_Cache_Dir
	.p2align	2
_CDVD_Cache_Dir:                        ; @CDVD_Cache_Dir
	.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	x19, x0
Lloh0:
	adrp	x21, _CachedDirInfo@GOTPAGE
Lloh1:
	ldr	x21, [x21, _CachedDirInfo@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh2:
	adrp	x22, _TRUE@GOTPAGE
Lloh3:
	ldr	x22, [x22, _TRUE@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.1:
	mov	x20, x1
	mov	x0, x19
	bl	_ComparePath
Lloh4:
	adrp	x8, _MATCH@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MATCH@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.2:
Lloh7:
	adrp	x8, _CACHE_START@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CACHE_START@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_15
; %bb.3:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_20
; %bb.4:
Lloh10:
	adrp	x8, _MAX_DIR_CACHE_SECTORS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MAX_DIR_CACHE_SECTORS@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	ldp	x9, x0, [x21, #24]
	cmp	x9, x8
	csel	x1, x8, x9, hi
	stp	xzr, x1, [x21, #8]
	b	LBB0_16
LBB0_5:
	mov	x0, x19
	bl	_ComparePath
Lloh13:
	adrp	x8, _SUBDIR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SUBDIR@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.6:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_8
; %bb.7:
Lloh16:
	adrp	x8, _MAX_DIR_CACHE_SECTORS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MAX_DIR_CACHE_SECTORS@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldp	x9, x0, [x21, #24]
	cmp	x9, x8
	csel	x1, x8, x9, hi
	stp	xzr, x1, [x21, #8]
	ldr	w2, [x21, #48]
Lloh19:
	adrp	x3, _cdReadMode@GOTPAGE
Lloh20:
	ldr	x3, [x3, _cdReadMode@GOTPAGEOFF]
	bl	_ReadSect
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_17
LBB0_8:
	ldr	x0, [x21, #40]
	bl	_strlen
	add	x1, x19, w0, sxtw
Lloh21:
	adrp	x19, _CDVD_Cache_Dir.dirname@PAGE
Lloh22:
	add	x19, x19, _CDVD_Cache_Dir.dirname@PAGEOFF
	mov	x0, x19
	bl	_strcpy
	mov	x0, x19
	b	LBB0_13
LBB0_9:
	bl	_isValidDisc
	cbz	w0, LBB0_14
; %bb.10:
	mov	w0, #0
	bl	_sceCdDiskReady
	bl	_CDVD_GetVolumeDescriptor
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.11:
	str	xzr, [x21, #56]
	ldr	x0, [x21, #40]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcpy
Lloh25:
	adrp	x8, _CDVolDesc@GOTPAGE
Lloh26:
	ldr	x8, [x8, _CDVolDesc@GOTPAGEOFF]
	ldr	x0, [x8]
	ldr	w8, [x8, #8]
	asr	w9, w8, #11
	tst	w8, #0x7ff
	cinc	w8, w9, ne
	sxtw	x8, w8
	stp	x8, x0, [x21, #24]
Lloh27:
	adrp	x9, _MAX_DIR_CACHE_SECTORS@GOTPAGE
Lloh28:
	ldr	x9, [x9, _MAX_DIR_CACHE_SECTORS@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x9, x8
	csel	x1, x9, x8, lo
	stp	xzr, x1, [x21, #8]
	ldr	w2, [x21, #48]
Lloh30:
	adrp	x3, _cdReadMode@GOTPAGE
Lloh31:
	ldr	x3, [x3, _cdReadMode@GOTPAGEOFF]
	bl	_ReadSect
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_17
; %bb.12:
Lloh32:
	adrp	x20, _CDVD_Cache_Dir.dirname@PAGE
Lloh33:
	add	x20, x20, _CDVD_Cache_Dir.dirname@PAGEOFF
	mov	x0, x20
	mov	x1, x19
	bl	_strcpy
	mov	x0, x20
LBB0_13:
	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
	b	_FindPath
LBB0_14:
	mov	w0, #-1
	b	LBB0_19
LBB0_15:
	ldp	x9, x8, [x21, #8]
	ldp	x10, x11, [x21, #24]
	add	x8, x8, x9
	sub	x9, x10, x8
Lloh34:
	adrp	x10, _MAX_DIR_CACHE_SECTORS@GOTPAGE
Lloh35:
	ldr	x10, [x10, _MAX_DIR_CACHE_SECTORS@GOTPAGEOFF]
Lloh36:
	ldr	x10, [x10]
	cmp	x9, x10
	csel	x1, x10, x9, hi
	stp	x8, x1, [x21, #8]
	add	x0, x11, x8
LBB0_16:
	ldr	w2, [x21, #48]
Lloh37:
	adrp	x3, _cdReadMode@GOTPAGE
Lloh38:
	ldr	x3, [x3, _cdReadMode@GOTPAGEOFF]
	bl	_ReadSect
	ldr	x8, [x22]
	cmp	x0, x8
	b.eq	LBB0_18
LBB0_17:
Lloh39:
	adrp	x8, _FALSE@GOTPAGE
Lloh40:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh41:
	ldrsw	x0, [x8]
LBB0_18:
	str	x0, [x21]
                                        ; kill: def $w0 killed $w0 killed $x0 def $x0
LBB0_19:
                                        ; kill: def $w0 killed $w0 killed $x0
	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_20:
	ldr	x0, [x22]
	str	x0, [x21]
	b	LBB0_19
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_CDVD_Cache_Dir.dirname,1024,0 ; @CDVD_Cache_Dir.dirname
	.comm	_CachedDirInfo,64,3             ; @CachedDirInfo
	.comm	_TRUE,8,3                       ; @TRUE
	.comm	_MATCH,8,3                      ; @MATCH
	.comm	_CACHE_START,4,2                ; @CACHE_START
	.comm	_MAX_DIR_CACHE_SECTORS,8,3      ; @MAX_DIR_CACHE_SECTORS
	.comm	_cdReadMode,4,2                 ; @cdReadMode
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_SUBDIR,8,3                     ; @SUBDIR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

	.comm	_CDVolDesc,16,3                 ; @CDVolDesc
.subsections_via_symbols
