	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_GetDirectory              ## -- Begin function CARD_GetDirectory
	.p2align	4, 0x90
_CARD_GetDirectory:                     ## @CARD_GetDirectory
	.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
	movq	$0, -56(%rbp)
	movq	_EXI_CHANNEL_0@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jg	LBB0_2
## %bb.1:
	movq	_EXI_CHANNEL_2@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jle	LBB0_2
## %bb.3:
	movl	%ecx, %r13d
	movq	%rdx, %r14
	movq	%rsi, %r12
	leaq	-56(%rbp), %rsi
	callq	___card_getcntrlblock
	movq	%rax, %rbx
	testq	%rax, %rax
	js	LBB0_22
## %bb.4:
	movq	-56(%rbp), %rdi
	cmpl	$0, 4(%rdi)
	je	LBB0_2
## %bb.5:
	callq	___card_getdirblock
	movq	_CARD_MAXFILES@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	jle	LBB0_6
## %bb.7:
	movq	(%rax), %r14
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	_CARD_MAXFILES@GOTPCREL(%rip), %rbx
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	jmp	LBB0_8
LBB0_2:
	movq	_CARD_ERROR_NOCARD@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_22
LBB0_6:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
LBB0_17:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	je	LBB0_19
## %bb.18:
	movq	%rcx, (%rax)
LBB0_19:
	testq	%rcx, %rcx
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_21
## %bb.20:
	movq	_CARD_ERROR_NOFILE@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_21:
	movq	-56(%rbp), %rdi
	movq	%rbx, %rsi
	callq	___card_putcntrlblock
LBB0_22:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	(%r14), %rsi
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %r13
	shlq	$5, %r13
	movq	%r15, 24(%r12,%r13)
	movl	32(%r14), %eax
	movl	%eax, 16(%r12,%r13)
	movq	-56(%rbp), %rax
	movl	(%rax), %eax
	imull	16(%r14), %eax
	movl	%eax, (%r12,%r13)
	movl	12(%r12,%r13), %edi
	movl	$4, %edx
	callq	_memcpy
	movl	8(%r12,%r13), %edi
	movq	8(%r14), %rsi
	movl	$2, %edx
	callq	_memcpy
	movl	4(%r12,%r13), %edi
	movq	24(%r14), %rsi
	movq	_CARD_FILENAMELEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
	incq	%rbx
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	-60(%rbp), %r13d                ## 4-byte Reload
	movq	_CARD_MAXFILES@GOTPCREL(%rip), %rbx
LBB0_16:                                ##   in Loop: Header=BB0_8 Depth=1
	incq	%r15
	addq	$40, %r14
	cmpq	(%rbx), %r15
	jge	LBB0_17
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rsi
	cmpl	$255, (%rsi)
	je	LBB0_16
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	testl	%r13d, %r13d
	jne	LBB0_15
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	_card_gamecode@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	$255, (%rax)
	je	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%rsi, %rdi
	movq	%rax, %rsi
	movl	$4, %edx
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_16
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	_card_company@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	cmpl	$255, (%rsi)
	je	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	8(%r14), %rdi
	movl	$2, %edx
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_16
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_CARD_ERROR_READY,8,3           ## @CARD_ERROR_READY
	.comm	_EXI_CHANNEL_0,8,3              ## @EXI_CHANNEL_0
	.comm	_EXI_CHANNEL_2,8,3              ## @EXI_CHANNEL_2
	.comm	_CARD_ERROR_NOCARD,8,3          ## @CARD_ERROR_NOCARD
	.comm	_CARD_MAXFILES,8,3              ## @CARD_MAXFILES
	.comm	_card_gamecode,8,3              ## @card_gamecode
	.comm	_card_company,8,3               ## @card_company
	.comm	_CARD_FILENAMELEN,4,2           ## @CARD_FILENAMELEN
	.comm	_CARD_ERROR_NOFILE,8,3          ## @CARD_ERROR_NOFILE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_GetDirectory              ; -- Begin function CARD_GetDirectory
	.p2align	2
_CARD_GetDirectory:                     ; @CARD_GetDirectory
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _EXI_CHANNEL_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EXI_CHANNEL_0@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _EXI_CHANNEL_2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EXI_CHANNEL_2@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x0
	ccmp	x9, x0, #4, le
	b.gt	LBB0_2
LBB0_1:
Lloh6:
	adrp	x8, _CARD_ERROR_NOCARD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CARD_ERROR_NOCARD@GOTPAGEOFF]
Lloh8:
	ldr	x19, [x8]
	b	LBB0_10
LBB0_2:
	mov	x21, x3
	mov	x20, x2
	mov	x22, x1
	add	x1, sp, #8
	bl	___card_getcntrlblock
	mov	x19, x0
	tbnz	x0, #63, LBB0_10
; %bb.3:
	ldr	x0, [sp, #8]
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_1
; %bb.4:
	bl	___card_getdirblock
Lloh9:
	adrp	x24, _CARD_MAXFILES@GOTPAGE
Lloh10:
	ldr	x24, [x24, _CARD_MAXFILES@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x8, #1
	b.lt	LBB0_6
; %bb.5:
	mov	x23, #0
	mov	x25, #0
	ldr	x26, [x0]
Lloh11:
	adrp	x28, _CARD_FILENAMELEN@GOTPAGE
Lloh12:
	ldr	x28, [x28, _CARD_FILENAMELEN@GOTPAGEOFF]
	b	LBB0_14
LBB0_6:
	mov	x23, #0
LBB0_7:
	cbz	x20, LBB0_9
; %bb.8:
	str	x23, [x20]
LBB0_9:
Lloh13:
	adrp	x8, _CARD_ERROR_NOFILE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CARD_ERROR_NOFILE@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cmp	x23, #0
	csel	x19, x8, x19, eq
	ldr	x0, [sp, #8]
	mov	x1, x19
	bl	___card_putcntrlblock
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_11:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	x1, [x26]
LBB0_12:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x27, x22, x23, lsl #5
	str	x25, [x27, #24]
	ldr	w8, [x26, #32]
	str	w8, [x27, #16]
	ldr	w8, [x26, #16]
	ldr	x9, [sp, #8]
	ldr	w9, [x9]
	mul	w8, w9, w8
	str	w8, [x27]
	ldr	w0, [x27, #12]
	mov	w2, #4
	bl	_memcpy
	ldr	w0, [x27, #8]
	ldr	x1, [x26, #8]
	mov	w2, #2
	bl	_memcpy
	ldr	w0, [x27, #4]
	ldr	x1, [x26, #24]
	ldr	w2, [x28]
	bl	_memcpy
	add	x23, x23, #1
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x25, x25, #1
	ldr	x8, [x24]
	add	x26, x26, #40
	cmp	x25, x8
	b.ge	LBB0_7
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x26]
	ldr	w8, [x1]
	cmp	w8, #255
	b.eq	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	cbnz	w21, LBB0_12
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
Lloh16:
	adrp	x8, _card_gamecode@GOTPAGE
Lloh17:
	ldr	x8, [x8, _card_gamecode@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldr	w9, [x8]
	cmp	w9, #255
	b.eq	LBB0_13
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x1
	mov	x1, x8
	mov	w2, #4
	bl	_memcmp
	cbnz	x0, LBB0_13
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=1
Lloh19:
	adrp	x8, _card_company@GOTPAGE
Lloh20:
	ldr	x8, [x8, _card_company@GOTPAGEOFF]
Lloh21:
	ldr	x1, [x8]
	ldr	w8, [x1]
	cmp	w8, #255
	b.eq	LBB0_13
; %bb.19:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x0, [x26, #8]
	mov	w2, #2
	bl	_memcmp
	cbnz	x0, LBB0_13
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_CARD_ERROR_READY,8,3           ; @CARD_ERROR_READY
	.comm	_EXI_CHANNEL_0,8,3              ; @EXI_CHANNEL_0
	.comm	_EXI_CHANNEL_2,8,3              ; @EXI_CHANNEL_2
	.comm	_CARD_ERROR_NOCARD,8,3          ; @CARD_ERROR_NOCARD
	.comm	_CARD_MAXFILES,8,3              ; @CARD_MAXFILES
	.comm	_card_gamecode,8,3              ; @card_gamecode
	.comm	_card_company,8,3               ; @card_company
	.comm	_CARD_FILENAMELEN,4,2           ; @CARD_FILENAMELEN
	.comm	_CARD_ERROR_NOFILE,8,3          ; @CARD_ERROR_NOFILE
.subsections_via_symbols
