	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CacheInitializeDrive           ## -- Begin function CacheInitializeDrive
	.p2align	4, 0x90
_CacheInitializeDrive:                  ## @CacheInitializeDrive
	.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	_CacheManagerInitialized@GOTPCREL(%rip), %rdx
	cmpq	$0, (%rdx)
	je	LBB0_1
## %bb.2:
	movq	_CacheManagerDrive@GOTPCREL(%rip), %r15
	movq	_CacheManagerDataInvalid@GOTPCREL(%rip), %rax
	cmpl	$128, %edi
	jl	LBB0_6
## %bb.3:
	cmpl	%edi, (%r15)
	jne	LBB0_6
## %bb.4:
	cmpq	$0, (%rax)
	jne	LBB0_6
## %bb.5:
	movq	_TRUE@GOTPCREL(%rip), %rbx
	jmp	LBB0_12
LBB0_1:
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movq	_FALSE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_CacheManagerDataInvalid@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	jmp	LBB0_9
LBB0_6:
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movq	_FALSE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax)
	movq	%rcx, (%rdx)
	movq	_CacheBlockCount@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_TRACE
	movq	_CacheSizeLimit@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_TRACE
	movq	_CacheSizeCurrent@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdi
	callq	_TRACE
	addq	$12, %r15
	movq	%r15, %rdi
	callq	_IsListEmpty
	testl	%eax, %eax
	jne	LBB0_9
## %bb.7:
	movq	_ListEntry@GOTPCREL(%rip), %r12
	movq	_TAG_CACHE_DATA@GOTPCREL(%rip), %r14
	movq	_TAG_CACHE_BLOCK@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_RemoveHeadList
	movq	_CACHE_BLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%r12), %edx
	movl	%eax, %edi
	callq	_CONTAINING_RECORD
	movq	%rax, %rbx
	movq	(%rax), %rdi
	movl	(%r14), %esi
	callq	_FrLdrTempFree
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_FrLdrTempFree
	movq	%r15, %rdi
	callq	_IsListEmpty
	testl	%eax, %eax
	je	LBB0_8
LBB0_9:
	movq	_CacheManagerDrive@GOTPCREL(%rip), %r15
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_RtlZeroMemory
	leaq	12(%r15), %rdi
	callq	_InitializeListHead
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, (%r15)
	leaq	-48(%rbp), %rsi
	movl	%r12d, %edi
	callq	_MachDiskGetDriveGeometry
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movl	-48(%rbp), %eax
	movl	%eax, 4(%r15)
	movl	%r12d, %edi
	callq	_MachDiskGetCacheableBlockCount
	movl	%eax, 8(%r15)
	movq	_CacheBlockCount@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movq	_CacheSizeCurrent@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movq	_TotalPagesInLookupTable@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	7(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$3, %edi
	movq	_MM_PAGE_SIZE@GOTPCREL(%rip), %rax
	imull	(%rax), %edi
	movq	_CacheSizeLimit@GOTPCREL(%rip), %r14
	movl	%edi, (%r14)
	movq	_TEMP_HEAP_SIZE@GOTPCREL(%rip), %rax
	movq	$-131072, %rsi                  ## imm = 0xFFFE0000
	addq	(%rax), %rsi
	callq	_min
	movl	%eax, (%r14)
	movq	_TRUE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	_CacheManagerInitialized@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	leaq	L_.str.3(%rip), %rdi
	movl	%r12d, %esi
	callq	_TRACE
	movl	4(%r15), %esi
	leaq	L_.str.4(%rip), %rdi
	callq	_TRACE
	movl	8(%r15), %esi
	leaq	L_.str.5(%rip), %rdi
	callq	_TRACE
	movl	(%r14), %esi
	leaq	L_.str.6(%rip), %rdi
	callq	_TRACE
	jmp	LBB0_12
LBB0_10:
	movq	_FALSE@GOTPCREL(%rip), %rbx
LBB0_12:
	movq	(%rbx), %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CacheManagerInitialized,8,3    ## @CacheManagerInitialized
	.comm	_CacheManagerDrive,16,2         ## @CacheManagerDrive
	.comm	_CacheManagerDataInvalid,8,3    ## @CacheManagerDataInvalid
	.comm	_TRUE,8,3                       ## @TRUE
	.comm	_FALSE,8,3                      ## @FALSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CacheBlockCount: %d\n"

	.comm	_CacheBlockCount,4,2            ## @CacheBlockCount
L_.str.1:                               ## @.str.1
	.asciz	"CacheSizeLimit: %d\n"

	.comm	_CacheSizeLimit,4,2             ## @CacheSizeLimit
L_.str.2:                               ## @.str.2
	.asciz	"CacheSizeCurrent: %d\n"

	.comm	_CacheSizeCurrent,4,2           ## @CacheSizeCurrent
	.comm	_CACHE_BLOCK,4,2                ## @CACHE_BLOCK
	.comm	_ListEntry,4,2                  ## @ListEntry
	.comm	_TAG_CACHE_DATA,4,2             ## @TAG_CACHE_DATA
	.comm	_TAG_CACHE_BLOCK,4,2            ## @TAG_CACHE_BLOCK
	.comm	_TotalPagesInLookupTable,4,2    ## @TotalPagesInLookupTable
	.comm	_MM_PAGE_SIZE,4,2               ## @MM_PAGE_SIZE
	.comm	_TEMP_HEAP_SIZE,8,3             ## @TEMP_HEAP_SIZE
L_.str.3:                               ## @.str.3
	.asciz	"Initializing BIOS drive 0x%x.\n"

L_.str.4:                               ## @.str.4
	.asciz	"BytesPerSector: %d.\n"

L_.str.5:                               ## @.str.5
	.asciz	"BlockSize: %d.\n"

L_.str.6:                               ## @.str.6
	.asciz	"CacheSizeLimit: %d.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CacheInitializeDrive           ; -- Begin function CacheInitializeDrive
	.p2align	2
_CacheInitializeDrive:                  ; @CacheInitializeDrive
	.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
	mov	x20, x0
Lloh0:
	adrp	x23, _CacheManagerInitialized@GOTPAGE
Lloh1:
	ldr	x23, [x23, _CacheManagerInitialized@GOTPAGEOFF]
	ldr	x8, [x23]
Lloh2:
	adrp	x19, _CacheManagerDrive@GOTPAGE
Lloh3:
	ldr	x19, [x19, _CacheManagerDrive@GOTPAGEOFF]
	cbz	x8, LBB0_4
; %bb.1:
Lloh4:
	adrp	x8, _CacheManagerDataInvalid@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CacheManagerDataInvalid@GOTPAGEOFF]
	cmp	w20, #128
	b.lt	LBB0_5
; %bb.2:
	ldr	w9, [x19]
	ldr	x10, [x8]
	cmp	w9, w20
	ccmp	x10, #0, #0, eq
	b.ne	LBB0_5
; %bb.3:
Lloh6:
	adrp	x21, _TRUE@GOTPAGE
Lloh7:
	ldr	x21, [x21, _TRUE@GOTPAGEOFF]
	b	LBB0_11
LBB0_4:
Lloh8:
	adrp	x8, _FALSE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _CacheManagerDataInvalid@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CacheManagerDataInvalid@GOTPAGEOFF]
Lloh13:
	str	x8, [x9]
	b	LBB0_8
LBB0_5:
Lloh14:
	adrp	x9, _FALSE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _FALSE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	str	x9, [x8]
	str	x9, [x23]
Lloh17:
	adrp	x8, _CacheBlockCount@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CacheBlockCount@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
Lloh22:
	adrp	x8, _CacheSizeLimit@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CacheSizeLimit@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x0, l_.str.1@PAGE
Lloh26:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
Lloh27:
	adrp	x8, _CacheSizeCurrent@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CacheSizeCurrent@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x0, l_.str.2@PAGE
Lloh31:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TRACE
	add	x21, x19, #12
	mov	x0, x21
	bl	_IsListEmpty
	cbnz	w0, LBB0_8
; %bb.6:
Lloh32:
	adrp	x24, _CACHE_BLOCK@GOTPAGE
Lloh33:
	ldr	x24, [x24, _CACHE_BLOCK@GOTPAGEOFF]
Lloh34:
	adrp	x25, _ListEntry@GOTPAGE
Lloh35:
	ldr	x25, [x25, _ListEntry@GOTPAGEOFF]
Lloh36:
	adrp	x26, _TAG_CACHE_DATA@GOTPAGE
Lloh37:
	ldr	x26, [x26, _TAG_CACHE_DATA@GOTPAGEOFF]
Lloh38:
	adrp	x27, _TAG_CACHE_BLOCK@GOTPAGE
Lloh39:
	ldr	x27, [x27, _TAG_CACHE_BLOCK@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_RemoveHeadList
	ldr	w1, [x24]
	ldr	w2, [x25]
	bl	_CONTAINING_RECORD
	mov	x22, x0
	ldr	x0, [x0]
	ldr	w1, [x26]
	bl	_FrLdrTempFree
	ldr	w1, [x27]
	mov	x0, x22
	bl	_FrLdrTempFree
	mov	x0, x21
	bl	_IsListEmpty
	cbz	w0, LBB0_7
LBB0_8:
	mov	x0, x19
	mov	w1, #4
	bl	_RtlZeroMemory
	add	x0, x19, #12
	bl	_InitializeListHead
	str	w20, [x19]
	add	x1, sp, #8
	mov	x0, x20
	bl	_MachDiskGetDriveGeometry
	cbz	w0, LBB0_10
; %bb.9:
Lloh40:
	adrp	x21, _TRUE@GOTPAGE
Lloh41:
	ldr	x21, [x21, _TRUE@GOTPAGEOFF]
	ldr	w8, [sp, #8]
	str	w8, [x19, #4]
	mov	x0, x20
	bl	_MachDiskGetCacheableBlockCount
	str	w0, [x19, #8]
Lloh42:
	adrp	x8, _CacheBlockCount@GOTPAGE
Lloh43:
	ldr	x8, [x8, _CacheBlockCount@GOTPAGEOFF]
Lloh44:
	str	wzr, [x8]
Lloh45:
	adrp	x8, _CacheSizeCurrent@GOTPAGE
Lloh46:
	ldr	x8, [x8, _CacheSizeCurrent@GOTPAGEOFF]
Lloh47:
	str	wzr, [x8]
Lloh48:
	adrp	x8, _TotalPagesInLookupTable@GOTPAGE
Lloh49:
	ldr	x8, [x8, _TotalPagesInLookupTable@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #3
Lloh51:
	adrp	x9, _MM_PAGE_SIZE@GOTPAGE
Lloh52:
	ldr	x9, [x9, _MM_PAGE_SIZE@GOTPAGEOFF]
Lloh53:
	ldr	w9, [x9]
Lloh54:
	adrp	x22, _CacheSizeLimit@GOTPAGE
Lloh55:
	ldr	x22, [x22, _CacheSizeLimit@GOTPAGEOFF]
	mul	w0, w8, w9
	str	w0, [x22]
Lloh56:
	adrp	x8, _TEMP_HEAP_SIZE@GOTPAGE
Lloh57:
	ldr	x8, [x8, _TEMP_HEAP_SIZE@GOTPAGEOFF]
Lloh58:
	ldr	x8, [x8]
	sub	x1, x8, #32, lsl #12            ; =131072
	bl	_min
	str	w0, [x22]
	ldr	x8, [x21]
	str	x8, [x23]
Lloh59:
	adrp	x0, l_.str.3@PAGE
Lloh60:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x20
	bl	_TRACE
	ldr	w1, [x19, #4]
Lloh61:
	adrp	x0, l_.str.4@PAGE
Lloh62:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_TRACE
	ldr	w1, [x19, #8]
Lloh63:
	adrp	x0, l_.str.5@PAGE
Lloh64:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_TRACE
	ldr	w1, [x22]
Lloh65:
	adrp	x0, l_.str.6@PAGE
Lloh66:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_TRACE
	b	LBB0_11
LBB0_10:
Lloh67:
	adrp	x21, _FALSE@GOTPAGE
Lloh68:
	ldr	x21, [x21, _FALSE@GOTPAGEOFF]
LBB0_11:
	ldr	x0, [x21]
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh65, Lloh66
	.loh AdrpAdd	Lloh63, Lloh64
	.loh AdrpAdd	Lloh61, Lloh62
	.loh AdrpAdd	Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGot	Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotStr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotStr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh67, Lloh68
	.cfi_endproc
                                        ; -- End function
	.comm	_CacheManagerInitialized,8,3    ; @CacheManagerInitialized
	.comm	_CacheManagerDrive,16,2         ; @CacheManagerDrive
	.comm	_CacheManagerDataInvalid,8,3    ; @CacheManagerDataInvalid
	.comm	_TRUE,8,3                       ; @TRUE
	.comm	_FALSE,8,3                      ; @FALSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CacheBlockCount: %d\n"

	.comm	_CacheBlockCount,4,2            ; @CacheBlockCount
l_.str.1:                               ; @.str.1
	.asciz	"CacheSizeLimit: %d\n"

	.comm	_CacheSizeLimit,4,2             ; @CacheSizeLimit
l_.str.2:                               ; @.str.2
	.asciz	"CacheSizeCurrent: %d\n"

	.comm	_CacheSizeCurrent,4,2           ; @CacheSizeCurrent
	.comm	_CACHE_BLOCK,4,2                ; @CACHE_BLOCK
	.comm	_ListEntry,4,2                  ; @ListEntry
	.comm	_TAG_CACHE_DATA,4,2             ; @TAG_CACHE_DATA
	.comm	_TAG_CACHE_BLOCK,4,2            ; @TAG_CACHE_BLOCK
	.comm	_TotalPagesInLookupTable,4,2    ; @TotalPagesInLookupTable
	.comm	_MM_PAGE_SIZE,4,2               ; @MM_PAGE_SIZE
	.comm	_TEMP_HEAP_SIZE,8,3             ; @TEMP_HEAP_SIZE
l_.str.3:                               ; @.str.3
	.asciz	"Initializing BIOS drive 0x%x.\n"

l_.str.4:                               ; @.str.4
	.asciz	"BytesPerSector: %d.\n"

l_.str.5:                               ; @.str.5
	.asciz	"BlockSize: %d.\n"

l_.str.6:                               ; @.str.6
	.asciz	"CacheSizeLimit: %d.\n"

.subsections_via_symbols
