	.file	"extr_..libretro-commonstreamsfile_stream.c_filestream_read_file.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Failed to open %s: %s\n"
.LC1:
	.string	"Failed to read %s: %s\n"
	.text
	.p2align 4
	.globl	filestream_read_file
	.type	filestream_read_file, @function
filestream_read_file:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rsi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdx
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	edx, DWORD PTR RETRO_VFS_FILE_ACCESS_HINT_NONE[rip]
	mov	esi, DWORD PTR RETRO_VFS_FILE_ACCESS_READ[rip]
	call	filestream_open@PLT
	test	rax, rax
	je	.L16
	mov	rdi, rax
	mov	rbp, rax
	call	filestream_get_size@PLT
	mov	r13, rax
	test	rax, rax
	js	.L5
	lea	rdi, 1[rax]
	call	malloc@PLT
	mov	r15, rax
	test	rax, rax
	je	.L5
	mov	rdx, r13
	mov	rsi, rax
	mov	rdi, rbp
	call	filestream_read@PLT
	mov	r13, rax
	test	rax, rax
	js	.L17
	mov	rdi, rbp
	call	filestream_close@PLT
	mov	QWORD PTR [r14], r15
	mov	eax, 1
	mov	BYTE PTR [r15+r13], 0
	test	rbx, rbx
	je	.L1
	mov	QWORD PTR [rbx], r13
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	rdi, rbp
	call	filestream_close@PLT
.L3:
	test	rbx, rbx
	je	.L8
	mov	QWORD PTR [rbx], -1
.L8:
	mov	QWORD PTR [r14], 0
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	mov	edi, DWORD PTR errno[rip]
	call	strerror@PLT
	mov	edi, DWORD PTR stderr[rip]
	mov	rdx, r12
	lea	rsi, .LC1[rip]
	mov	rcx, rax
	call	fprintf@PLT
	mov	rdi, rbp
	call	filestream_close@PLT
	mov	rdi, r15
	call	free@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L16:
	mov	edi, DWORD PTR errno[rip]
	call	strerror@PLT
	mov	edi, DWORD PTR stderr[rip]
	mov	rdx, r12
	lea	rsi, .LC0[rip]
	mov	rcx, rax
	call	fprintf@PLT
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	filestream_read_file, .-filestream_read_file
	.comm	stderr,4,4
	.comm	errno,4,4
	.comm	RETRO_VFS_FILE_ACCESS_READ,4,4
	.comm	RETRO_VFS_FILE_ACCESS_HINT_NONE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_..libretro-commonstreamsfile_stream.c_filestream_read_file.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Failed to open %s: %s\012\000"
	.align	2
.LC1:
	.ascii	"Failed to read %s: %s\012\000"
	.text
	.align	2
	.global	filestream_read_file
	.syntax unified
	.arm
	.fpu softvfp
	.type	filestream_read_file, %function
filestream_read_file:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, .L17
	mov	r7, r2
	ldr	r2, .L17+4
	mov	r8, r1
	ldr	r2, [r2]
	ldr	r1, [r3]
	mov	r9, r0
	bl	filestream_open
	subs	r6, r0, #0
	beq	.L15
	bl	filestream_get_size
	subs	r4, r0, #0
	blt	.L5
	add	r0, r4, #1
	bl	malloc
	subs	r5, r0, #0
	beq	.L5
	mov	r2, r4
	mov	r1, r5
	mov	r0, r6
	bl	filestream_read
	subs	r4, r0, #0
	blt	.L16
	mov	r0, r6
	bl	filestream_close
	mov	r3, #0
	cmp	r7, r3
	str	r5, [r8]
	strb	r3, [r5, r4]
	beq	.L9
	mov	r0, #1
	str	r4, [r7]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L5:
	mov	r0, r6
	bl	filestream_close
.L3:
	cmp	r7, #0
	mvnne	r3, #0
	mov	r0, #0
	strne	r3, [r7]
	str	r0, [r8]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L16:
	ldr	r3, .L17+8
	ldr	r2, .L17+12
	ldr	r0, [r3]
	ldr	r4, [r2]
	bl	strerror
	mov	r2, r9
	mov	r3, r0
	ldr	r1, .L17+16
	mov	r0, r4
	bl	fprintf
	mov	r0, r6
	bl	filestream_close
	mov	r0, r5
	bl	free
	b	.L3
.L15:
	ldr	r3, .L17+8
	ldr	r2, .L17+12
	ldr	r0, [r3]
	ldr	r4, [r2]
	bl	strerror
	mov	r2, r9
	mov	r3, r0
	ldr	r1, .L17+20
	mov	r0, r4
	bl	fprintf
	b	.L3
.L9:
	mov	r0, #1
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L18:
	.align	2
.L17:
	.word	RETRO_VFS_FILE_ACCESS_READ
	.word	RETRO_VFS_FILE_ACCESS_HINT_NONE
	.word	errno
	.word	stderr
	.word	.LC1
	.word	.LC0
	.size	filestream_read_file, .-filestream_read_file
	.comm	stderr,4,4
	.comm	errno,4,4
	.comm	RETRO_VFS_FILE_ACCESS_READ,4,4
	.comm	RETRO_VFS_FILE_ACCESS_HINT_NONE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
