	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_filestream_read_file           ## -- Begin function filestream_read_file
	.p2align	4, 0x90
_filestream_read_file:                  ## @filestream_read_file
	.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	%rdx, %rbx
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	_RETRO_VFS_FILE_ACCESS_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_filestream_open
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r15
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rbx
	movq	%rax, %rdi
	callq	_filestream_get_size
	testq	%rax, %rax
	js	LBB0_7
## %bb.2:
	movq	%rax, %r14
	leaq	1(%rax), %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	%rax, %r13
	movq	%r15, %rdi
	movq	%rax, %rsi
	movq	%r14, %rdx
	callq	_filestream_read
	testq	%rax, %rax
	js	LBB0_8
## %bb.4:
	movq	%rax, %r14
	movq	%r15, %rdi
	callq	_filestream_close
	movq	%r13, (%rbx)
	movb	$0, (%r13,%r14)
	movl	$1, %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_13
## %bb.5:
	movq	%r14, (%rcx)
	jmp	LBB0_13
LBB0_7:
	movq	%r15, %rdi
	callq	_filestream_close
	jmp	LBB0_9
LBB0_6:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movq	%r12, %rdx
	movq	%rax, %rcx
	callq	_fprintf
	testq	%rbx, %rbx
	jne	LBB0_11
	jmp	LBB0_12
LBB0_8:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edi
	movq	%r12, %rdx
	movq	%rax, %rcx
	callq	_fprintf
	movq	%r15, %rdi
	callq	_filestream_close
	movq	%r13, %rdi
	callq	_free
LBB0_9:
	movq	%rbx, %r13
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_12
LBB0_11:
	movq	$-1, (%rbx)
LBB0_12:
	movq	$0, (%r13)
	xorl	%eax, %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RETRO_VFS_FILE_ACCESS_READ,4,2 ## @RETRO_VFS_FILE_ACCESS_READ
	.comm	_RETRO_VFS_FILE_ACCESS_HINT_NONE,4,2 ## @RETRO_VFS_FILE_ACCESS_HINT_NONE
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to open %s: %s\n"

	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"Failed to read %s: %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_filestream_read_file           ; -- Begin function filestream_read_file
	.p2align	2
_filestream_read_file:                  ; @filestream_read_file
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_READ@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_filestream_open
	cbz	x0, LBB0_7
; %bb.1:
	mov	x22, x0
	bl	_filestream_get_size
	tbnz	x0, #63, LBB0_6
; %bb.2:
	mov	x24, x0
	add	x0, x0, #1
	bl	_malloc
	cbz	x0, LBB0_6
; %bb.3:
	mov	x23, x0
	mov	x0, x22
	mov	x1, x23
	mov	x2, x24
	bl	_filestream_read
	tbnz	x0, #63, LBB0_11
; %bb.4:
	mov	x24, x0
	mov	x0, x22
	bl	_filestream_close
	str	x23, [x20]
	strb	wzr, [x23, x24]
	cbz	x19, LBB0_12
; %bb.5:
	str	x24, [x19]
	mov	w0, #1
	b	LBB0_10
LBB0_6:
	mov	x0, x22
	bl	_filestream_close
	cbnz	x19, LBB0_8
	b	LBB0_9
LBB0_7:
Lloh6:
	adrp	x8, _stderr@GOTPAGE
Lloh7:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh8:
	ldr	w22, [x8]
Lloh9:
	adrp	x8, _errno@GOTPAGE
Lloh10:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_strerror
	mov	x3, x0
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x21
	bl	_fprintf
	cbz	x19, LBB0_9
LBB0_8:
	mov	x8, #-1
	str	x8, [x19]
LBB0_9:
	mov	x0, #0
	str	xzr, [x20]
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
Lloh14:
	adrp	x8, _stderr@GOTPAGE
Lloh15:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh16:
	ldr	w24, [x8]
Lloh17:
	adrp	x8, _errno@GOTPAGE
Lloh18:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_strerror
	mov	x3, x0
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x24
	mov	x2, x21
	bl	_fprintf
	mov	x0, x22
	bl	_filestream_close
	mov	x0, x23
	bl	_free
	cbnz	x19, LBB0_8
	b	LBB0_9
LBB0_12:
	mov	w0, #1
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_RETRO_VFS_FILE_ACCESS_READ,4,2 ; @RETRO_VFS_FILE_ACCESS_READ
	.comm	_RETRO_VFS_FILE_ACCESS_HINT_NONE,4,2 ; @RETRO_VFS_FILE_ACCESS_HINT_NONE
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to open %s: %s\n"

	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"Failed to read %s: %s\n"

.subsections_via_symbols
