	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FS_ReadFile                    ## -- Begin function FS_ReadFile
	.p2align	4, 0x90
_FS_ReadFile:                           ## @FS_ReadFile
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	_fs_searchpaths@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_1
## %bb.2:
	testq	%r12, %r12
	jne	LBB0_3
	jmp	LBB0_4
LBB0_1:
	movq	_ERR_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_Com_Error
	testq	%r12, %r12
	je	LBB0_4
LBB0_3:
	cmpb	$0, (%r12)
	jne	LBB0_5
LBB0_4:
	movq	_ERR_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_Com_Error
LBB0_5:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_19
## %bb.6:
	movq	_qtrue@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	_com_journal@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_20
## %bb.7:
	cmpl	$2, (%rax)
	jne	LBB0_20
## %bb.8:
	leaq	L_.str.3(%rip), %rdi
	movq	%r12, %rsi
	callq	_Com_DPrintf
	movq	_com_journalDataFile@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	leaq	-44(%rbp), %rdi
	movl	$4, %esi
	callq	_FS_Read
	cmpl	$4, %eax
	jne	LBB0_9
## %bb.11:
	movl	-44(%rbp), %r15d
	testl	%r15d, %r15d
	je	LBB0_12
## %bb.15:
	testq	%r14, %r14
	je	LBB0_38
## %bb.16:
	incl	%r15d
	movl	%r15d, %edi
	callq	_Hunk_AllocateTempMemory
	movq	%rax, %r15
	movq	%rax, (%r14)
	movl	-44(%rbp), %esi
	movq	(%rbx), %rdx
	movq	%rax, %rdi
	callq	_FS_Read
	cmpl	-44(%rbp), %eax
	je	LBB0_18
## %bb.17:
	movq	_ERR_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_Com_Error
	movl	-44(%rbp), %eax
LBB0_18:
	movq	_fs_loadCount@GOTPCREL(%rip), %rcx
	incl	(%rcx)
	movq	_fs_loadStack@GOTPCREL(%rip), %rcx
	incl	(%rcx)
	cltq
	movl	$0, (%r15,%rax,4)
	jmp	LBB0_37
LBB0_19:
	movq	_qfalse@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
LBB0_20:
	movq	_qfalse@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	callq	_FS_FOpenFileRead
	movl	%eax, -44(%rbp)
	movq	-56(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_21
## %bb.27:
	testq	%r14, %r14
	je	LBB0_28
## %bb.33:
	movl	%eax, %ebx
	movq	_fs_loadCount@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	_fs_loadStack@GOTPCREL(%rip), %rax
	incl	(%rax)
	leal	1(%rbx), %edi
	callq	_Hunk_AllocateTempMemory
	movq	%rax, %r15
	movq	%rax, (%r14)
	movq	-56(%rbp), %rdx
	movq	%rax, %rdi
	movl	%ebx, %esi
	callq	_FS_Read
	movslq	%ebx, %rax
	movl	$0, (%r15,%rax,4)
	movq	-56(%rbp), %rdi
	callq	_FS_FCloseFile
	testq	%r13, %r13
	je	LBB0_37
## %bb.34:
	movq	_com_journal@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_37
## %bb.35:
	cmpl	$1, (%rax)
	jne	LBB0_37
## %bb.36:
	leaq	L_.str.7(%rip), %rdi
	movq	%r12, %rsi
	callq	_Com_DPrintf
	movq	_com_journalDataFile@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	leaq	-44(%rbp), %rdi
	movl	$4, %esi
	callq	_FS_Write
	movl	-44(%rbp), %esi
	movq	(%rbx), %rdx
	movq	%r15, %rdi
	callq	_FS_Write
	movq	(%rbx), %rdi
	callq	_FS_Flush
	jmp	LBB0_37
LBB0_21:
	testq	%r14, %r14
	je	LBB0_23
## %bb.22:
	movq	$0, (%r14)
LBB0_23:
	movl	$-1, %r15d
	testq	%r13, %r13
	je	LBB0_38
## %bb.24:
	movq	_com_journal@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_38
## %bb.25:
	cmpl	$1, (%rax)
	jne	LBB0_38
## %bb.26:
	leaq	L_.str.5(%rip), %rdi
	movq	%r12, %rsi
	callq	_Com_DPrintf
	movl	$0, -44(%rbp)
	movq	_com_journalDataFile@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	leaq	-44(%rbp), %rdi
	movl	$4, %esi
	callq	_FS_Write
	movq	(%rbx), %rdi
	callq	_FS_Flush
	jmp	LBB0_38
LBB0_28:
	testq	%r13, %r13
	je	LBB0_32
## %bb.29:
	movq	_com_journal@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_32
## %bb.30:
	cmpl	$1, (%rax)
	jne	LBB0_32
## %bb.31:
	leaq	L_.str.6(%rip), %rdi
	movq	%r12, %rsi
	callq	_Com_DPrintf
	movq	_com_journalDataFile@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdx
	leaq	-44(%rbp), %rdi
	movl	$4, %esi
	callq	_FS_Write
	movq	(%rbx), %rdi
	callq	_FS_Flush
	movq	-56(%rbp), %rdi
LBB0_32:
	callq	_FS_FCloseFile
LBB0_37:
	movl	-44(%rbp), %r15d
LBB0_38:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	$-1, %r15d
	testq	%r14, %r14
	je	LBB0_38
## %bb.10:
	movq	$0, (%r14)
	jmp	LBB0_38
LBB0_12:
	testq	%r14, %r14
	je	LBB0_13
## %bb.14:
	movq	$0, (%r14)
	movl	$-1, %r15d
	jmp	LBB0_38
LBB0_13:
	movl	$1, %r15d
	jmp	LBB0_38
	.cfi_endproc
                                        ## -- End function
	.comm	_fs_searchpaths,4,2             ## @fs_searchpaths
	.comm	_ERR_FATAL,4,2                  ## @ERR_FATAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Filesystem call made without initialization\n"

L_.str.1:                               ## @.str.1
	.asciz	"FS_ReadFile with empty name\n"

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

	.comm	_qtrue,8,3                      ## @qtrue
	.comm	_com_journal,8,3                ## @com_journal
L_.str.3:                               ## @.str.3
	.asciz	"Loading %s from journal file.\n"

	.comm	_com_journalDataFile,8,3        ## @com_journalDataFile
L_.str.4:                               ## @.str.4
	.asciz	"Read from journalDataFile failed"

	.comm	_fs_loadCount,4,2               ## @fs_loadCount
	.comm	_fs_loadStack,4,2               ## @fs_loadStack
	.comm	_qfalse,8,3                     ## @qfalse
L_.str.5:                               ## @.str.5
	.asciz	"Writing zero for %s to journal file.\n"

L_.str.6:                               ## @.str.6
	.asciz	"Writing len for %s to journal file.\n"

L_.str.7:                               ## @.str.7
	.asciz	"Writing %s to journal file.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FS_ReadFile                    ; -- Begin function FS_ReadFile
	.p2align	2
_FS_ReadFile:                           ; @FS_ReadFile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _fs_searchpaths@GOTPAGE
Lloh1:
	ldr	x8, [x8, _fs_searchpaths@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_2
; %bb.1:
	cbnz	x19, LBB0_3
	b	LBB0_4
LBB0_2:
Lloh3:
	adrp	x8, _ERR_FATAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERR_FATAL@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_Com_Error
	cbz	x19, LBB0_4
LBB0_3:
	ldrb	w8, [x19]
	cbnz	w8, LBB0_5
LBB0_4:
Lloh8:
	adrp	x8, _ERR_FATAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ERR_FATAL@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_Com_Error
LBB0_5:
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_strstr
Lloh15:
	adrp	x8, _qfalse@GOTPAGE
Lloh16:
	ldr	x8, [x8, _qfalse@GOTPAGEOFF]
	cbz	x0, LBB0_14
; %bb.6:
Lloh17:
	adrp	x9, _qtrue@GOTPAGE
Lloh18:
	ldr	x9, [x9, _qtrue@GOTPAGEOFF]
Lloh19:
	ldr	x23, [x9]
Lloh20:
	adrp	x9, _com_journal@GOTPAGE
Lloh21:
	ldr	x9, [x9, _com_journal@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cbz	x9, LBB0_15
; %bb.7:
	ldr	w9, [x9]
	cmp	w9, #2
	b.ne	LBB0_15
; %bb.8:
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_Com_DPrintf
Lloh25:
	adrp	x21, _com_journalDataFile@GOTPAGE
Lloh26:
	ldr	x21, [x21, _com_journalDataFile@GOTPAGEOFF]
	ldr	x2, [x21]
	add	x0, sp, #4
	mov	w1, #4
	bl	_FS_Read
	cmp	w0, #4
	b.ne	LBB0_34
; %bb.9:
	ldr	w0, [sp, #4]
	cbz	w0, LBB0_36
; %bb.10:
	cbz	x20, LBB0_33
; %bb.11:
	add	w0, w0, #1
	bl	_Hunk_AllocateTempMemory
	mov	x19, x0
	str	x0, [x20]
	ldr	w1, [sp, #4]
	ldr	x2, [x21]
	bl	_FS_Read
	ldr	w8, [sp, #4]
	cmp	w0, w8
	b.eq	LBB0_13
; %bb.12:
Lloh27:
	adrp	x8, _ERR_FATAL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ERR_FATAL@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
Lloh30:
	adrp	x1, l_.str.4@PAGE
Lloh31:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_Com_Error
	ldr	w0, [sp, #4]
LBB0_13:
Lloh32:
	adrp	x8, _fs_loadCount@GOTPAGE
Lloh33:
	ldr	x8, [x8, _fs_loadCount@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh34:
	adrp	x8, _fs_loadStack@GOTPAGE
Lloh35:
	ldr	x8, [x8, _fs_loadStack@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	str	wzr, [x19, w0, sxtw #2]
	b	LBB0_32
LBB0_14:
	ldr	x23, [x8]
LBB0_15:
	ldr	x2, [x8]
	add	x1, sp, #8
	mov	x0, x19
	bl	_FS_FOpenFileRead
	mov	x22, x0
	str	w0, [sp, #4]
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_21
; %bb.16:
	cbz	x20, LBB0_27
; %bb.17:
Lloh36:
	adrp	x8, _fs_loadCount@GOTPAGE
Lloh37:
	ldr	x8, [x8, _fs_loadCount@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh38:
	adrp	x8, _fs_loadStack@GOTPAGE
Lloh39:
	ldr	x8, [x8, _fs_loadStack@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	add	w0, w22, #1
	bl	_Hunk_AllocateTempMemory
	mov	x21, x0
	str	x0, [x20]
	ldr	x2, [sp, #8]
	mov	x1, x22
	bl	_FS_Read
	str	wzr, [x21, w22, sxtw #2]
	ldr	x0, [sp, #8]
	bl	_FS_FCloseFile
	cbz	x23, LBB0_32
; %bb.18:
Lloh40:
	adrp	x8, _com_journal@GOTPAGE
Lloh41:
	ldr	x8, [x8, _com_journal@GOTPAGEOFF]
Lloh42:
	ldr	x8, [x8]
	cbz	x8, LBB0_32
; %bb.19:
	ldr	w8, [x8]
	cmp	w8, #1
	b.ne	LBB0_32
; %bb.20:
Lloh43:
	adrp	x0, l_.str.7@PAGE
Lloh44:
	add	x0, x0, l_.str.7@PAGEOFF
	mov	x1, x19
	bl	_Com_DPrintf
Lloh45:
	adrp	x19, _com_journalDataFile@GOTPAGE
Lloh46:
	ldr	x19, [x19, _com_journalDataFile@GOTPAGEOFF]
	ldr	x2, [x19]
	add	x0, sp, #4
	mov	w1, #4
	bl	_FS_Write
	ldr	w1, [sp, #4]
	ldr	x2, [x19]
	mov	x0, x21
	bl	_FS_Write
	ldr	x0, [x19]
	bl	_FS_Flush
	b	LBB0_32
LBB0_21:
	cbz	x20, LBB0_23
; %bb.22:
	str	xzr, [x20]
LBB0_23:
	mov	w0, #-1
	cbz	x23, LBB0_33
; %bb.24:
Lloh47:
	adrp	x8, _com_journal@GOTPAGE
Lloh48:
	ldr	x8, [x8, _com_journal@GOTPAGEOFF]
Lloh49:
	ldr	x8, [x8]
	cbz	x8, LBB0_33
; %bb.25:
	ldr	w8, [x8]
	cmp	w8, #1
	b.ne	LBB0_35
; %bb.26:
Lloh50:
	adrp	x0, l_.str.5@PAGE
Lloh51:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x19
	bl	_Com_DPrintf
	str	wzr, [sp, #4]
Lloh52:
	adrp	x19, _com_journalDataFile@GOTPAGE
Lloh53:
	ldr	x19, [x19, _com_journalDataFile@GOTPAGEOFF]
	ldr	x2, [x19]
	add	x0, sp, #4
	mov	w1, #4
	bl	_FS_Write
	ldr	x0, [x19]
	bl	_FS_Flush
	mov	w0, #-1
	b	LBB0_33
LBB0_27:
	cbz	x23, LBB0_31
; %bb.28:
Lloh54:
	adrp	x8, _com_journal@GOTPAGE
Lloh55:
	ldr	x8, [x8, _com_journal@GOTPAGEOFF]
Lloh56:
	ldr	x8, [x8]
	cbz	x8, LBB0_31
; %bb.29:
	ldr	w8, [x8]
	cmp	w8, #1
	b.ne	LBB0_31
; %bb.30:
Lloh57:
	adrp	x0, l_.str.6@PAGE
Lloh58:
	add	x0, x0, l_.str.6@PAGEOFF
	mov	x1, x19
	bl	_Com_DPrintf
Lloh59:
	adrp	x19, _com_journalDataFile@GOTPAGE
Lloh60:
	ldr	x19, [x19, _com_journalDataFile@GOTPAGEOFF]
	ldr	x2, [x19]
	add	x0, sp, #4
	mov	w1, #4
	bl	_FS_Write
	ldr	x0, [x19]
	bl	_FS_Flush
	ldr	x0, [sp, #8]
LBB0_31:
	bl	_FS_FCloseFile
LBB0_32:
	ldr	w0, [sp, #4]
LBB0_33:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_34:
	cbnz	x20, LBB0_37
LBB0_35:
	mov	w0, #-1
	b	LBB0_33
LBB0_36:
	cbz	x20, LBB0_38
LBB0_37:
	str	xzr, [x20]
	mov	w0, #-1
	b	LBB0_33
LBB0_38:
	mov	w0, #1
	b	LBB0_33
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh52, Lloh53
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGot	Lloh59, Lloh60
	.loh AdrpAdd	Lloh57, Lloh58
	.cfi_endproc
                                        ; -- End function
	.comm	_fs_searchpaths,4,2             ; @fs_searchpaths
	.comm	_ERR_FATAL,4,2                  ; @ERR_FATAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Filesystem call made without initialization\n"

l_.str.1:                               ; @.str.1
	.asciz	"FS_ReadFile with empty name\n"

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

	.comm	_qtrue,8,3                      ; @qtrue
	.comm	_com_journal,8,3                ; @com_journal
l_.str.3:                               ; @.str.3
	.asciz	"Loading %s from journal file.\n"

	.comm	_com_journalDataFile,8,3        ; @com_journalDataFile
l_.str.4:                               ; @.str.4
	.asciz	"Read from journalDataFile failed"

	.comm	_fs_loadCount,4,2               ; @fs_loadCount
	.comm	_fs_loadStack,4,2               ; @fs_loadStack
	.comm	_qfalse,8,3                     ; @qfalse
l_.str.5:                               ; @.str.5
	.asciz	"Writing zero for %s to journal file.\n"

l_.str.6:                               ; @.str.6
	.asciz	"Writing len for %s to journal file.\n"

l_.str.7:                               ; @.str.7
	.asciz	"Writing %s to journal file.\n"

.subsections_via_symbols
