	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LoadFileToMem                  ## -- Begin function LoadFileToMem
	.p2align	4, 0x90
_LoadFileToMem:                         ## @LoadFileToMem
	.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	%rdx, %rbx
	movq	%rsi, %r15
	movq	$0, (%rsi)
	testq	%rdx, %rdx
	je	LBB0_2
## %bb.1:
	movq	$0, (%rbx)
LBB0_2:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_open
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	%eax, %r12d
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %edi
	xorl	%esi, %esi
	callq	_lseek
	movq	%rax, %r14
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %edi
	xorl	%esi, %esi
	callq	_lseek
	movq	%r14, %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	movq	%rax, %r13
	testq	%r14, %r14
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_6
## %bb.7:
	movl	$16384, %ebx                    ## imm = 0x4000
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rax
	leaq	(%r15,%rbx), %rcx
	movq	%r14, %rbx
	subq	%r15, %rbx
	cmpq	%r14, %rcx
	cmovleq	%rax, %rbx
	leaq	(,%r15,4), %rsi
	addq	%r13, %rsi
	movl	%r12d, %edi
	movq	%rbx, %rdx
	callq	_read
	testl	%eax, %eax
	jle	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_10 Depth=1
	movl	%eax, %eax
	addq	%rax, %r15
	cmpq	%r15, %r14
	jg	LBB0_10
	jmp	LBB0_11
LBB0_3:
	movl	$-1, %r14d
	jmp	LBB0_15
LBB0_8:
	movl	%r12d, %edi
	callq	_close
	movl	$-2, %r14d
	jmp	LBB0_15
LBB0_6:
	xorl	%r15d, %r15d
LBB0_11:
	movl	%r12d, %edi
	callq	_close
	cmpq	%r15, %r14
	jne	LBB0_12
## %bb.13:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r13, (%rax)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movq	%r14, (%rax)
	jmp	LBB0_15
LBB0_12:
	movq	%r13, %rdi
	callq	_free
	movl	$-3, %r14d
LBB0_15:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LoadFileToMem                  ; -- Begin function LoadFileToMem
	.p2align	2
_LoadFileToMem:                         ; @LoadFileToMem
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x2
	mov	x20, x1
	str	xzr, [x1]
	cbz	x2, LBB0_2
; %bb.1:
	str	xzr, [x19]
LBB0_2:
Lloh0:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_open
	tbnz	w0, #31, LBB0_8
; %bb.3:
	mov	x22, x0
Lloh3:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_lseek
	mov	x21, x0
Lloh6:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #0
	bl	_lseek
	mov	x0, x21
	bl	_malloc
	cbz	x0, LBB0_9
; %bb.4:
	mov	x23, x0
	cmp	x21, #1
	b.lt	LBB0_10
; %bb.5:
	mov	x25, #0
	mov	w24, #16384
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	sub	x8, x21, x25
	add	x9, x25, x24
	cmp	x9, x21
	csel	x24, x8, x24, gt
	add	x1, x23, x25, lsl #2
	mov	x0, x22
	mov	x2, x24
	bl	_read
	cmp	w0, #0
	b.le	LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x25, x25, w0, uxtw
	cmp	x21, x25
	b.gt	LBB0_6
	b	LBB0_11
LBB0_8:
	mov	w21, #-1
	b	LBB0_15
LBB0_9:
	mov	x0, x22
	bl	_close
	mov	w21, #-2
	b	LBB0_15
LBB0_10:
	mov	x25, #0
LBB0_11:
	mov	x0, x22
	bl	_close
	cmp	x21, x25
	b.ne	LBB0_14
; %bb.12:
	str	x23, [x20]
	cbz	x19, LBB0_15
; %bb.13:
	str	x21, [x19]
	b	LBB0_15
LBB0_14:
	mov	x0, x23
	bl	_free
	mov	w21, #-3
LBB0_15:
	mov	x0, x21
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
.subsections_via_symbols
