	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intfstream_file_get_serial
_intfstream_file_get_serial:            ## @intfstream_file_get_serial
	.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	%rcx, %rbx
	movq	%rdx, %r15
	movq	%rsi, %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	_intfstream_open_file
	testq	%rax, %rax
	je	LBB0_12
## %bb.1:
	movq	%rax, %r14
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_intfstream_seek
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.2:
	movq	%r14, %rdi
	callq	_intfstream_tell
	movq	%rax, %r13
	movq	_SEEK_SET@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_intfstream_seek
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.3:
	testq	%r13, %r13
	js	LBB0_10
## %bb.4:
	testq	%r12, %r12
	jne	LBB0_7
## %bb.5:
	cmpq	%r15, %r13
	jg	LBB0_7
## %bb.6:
	xorl	%r12d, %r12d
LBB0_15:
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_intfstream_get_serial
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_intfstream_close
	movq	%r14, %rdi
	callq	_free
	movq	%r12, %rdi
	callq	_free
	movl	%ebx, %eax
	jmp	LBB0_16
LBB0_7:
	movl	(%rbx), %edx
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_intfstream_seek
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.8:
	movq	%r15, %rdi
	callq	_malloc
	movq	%rax, %r12
	movq	%r14, %rdi
	movq	%rax, %rsi
	movq	%r15, %rdx
	callq	_intfstream_read
	cmpq	%r15, %rax
	jne	LBB0_9
## %bb.13:
	movq	%r14, %rdi
	callq	_intfstream_close
	movq	%r14, %rdi
	callq	_free
	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
	movq	%r12, %rdi
	movq	%r15, %rcx
	callq	_intfstream_open_memory
	testq	%rax, %rax
	je	LBB0_17
## %bb.14:
	movq	%rax, %r14
	jmp	LBB0_15
LBB0_9:
	movq	%r12, %rdi
	callq	_free
LBB0_10:
	movq	%r14, %rdi
	callq	_intfstream_close
	movq	%r14, %rdi
LBB0_11:
	callq	_free
LBB0_12:
	xorl	%eax, %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	%r12, %rdi
	jmp	LBB0_11
	.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	_SEEK_END,4,2                   ## @SEEK_END
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.no_dead_strip	_intfstream_file_get_serial
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intfstream_file_get_serial
_intfstream_file_get_serial:            ; @intfstream_file_get_serial
	.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, x3
	mov	x21, x2
	mov	x22, x1
Lloh0:
	adrp	x24, _RETRO_VFS_FILE_ACCESS_READ@GOTPAGE
Lloh1:
	ldr	x24, [x24, _RETRO_VFS_FILE_ACCESS_READ@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh2:
	adrp	x25, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGE
Lloh3:
	ldr	x25, [x25, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGEOFF]
	ldr	w2, [x25]
	bl	_intfstream_open_file
	cbz	x0, LBB0_15
; %bb.1:
	mov	x20, x0
Lloh4:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	mov	x1, #0
	bl	_intfstream_seek
	cmn	w0, #1
	b.eq	LBB0_13
; %bb.2:
	mov	x0, x20
	bl	_intfstream_tell
	mov	x23, x0
Lloh7:
	adrp	x26, _SEEK_SET@GOTPAGE
Lloh8:
	ldr	x26, [x26, _SEEK_SET@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	x0, x20
	mov	x1, #0
	bl	_intfstream_seek
	cmn	w0, #1
	b.eq	LBB0_13
; %bb.3:
	tbnz	x23, #63, LBB0_13
; %bb.4:
	cbnz	x22, LBB0_8
; %bb.5:
	cmp	x23, x21
	b.gt	LBB0_8
; %bb.6:
	mov	x22, #0
LBB0_7:
	mov	x0, x20
	mov	x1, x19
	bl	_intfstream_get_serial
	mov	x19, x0
	mov	x0, x20
	bl	_intfstream_close
	mov	x0, x20
	bl	_free
	mov	x0, x22
	bl	_free
	mov	x0, x19
	b	LBB0_16
LBB0_8:
	ldr	w2, [x26]
	mov	x0, x20
	mov	x1, x22
	bl	_intfstream_seek
	cmn	w0, #1
	b.eq	LBB0_13
; %bb.9:
	mov	x0, x21
	bl	_malloc
	mov	x22, x0
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	bl	_intfstream_read
	cmp	x0, x21
	b.ne	LBB0_12
; %bb.10:
	mov	x0, x20
	bl	_intfstream_close
	mov	x0, x20
	bl	_free
	ldr	w1, [x24]
	ldr	w2, [x25]
	mov	x0, x22
	mov	x3, x21
	bl	_intfstream_open_memory
	cbz	x0, LBB0_17
; %bb.11:
	mov	x20, x0
	b	LBB0_7
LBB0_12:
	mov	x0, x22
	bl	_free
LBB0_13:
	mov	x0, x20
	bl	_intfstream_close
	mov	x0, x20
LBB0_14:
	bl	_free
LBB0_15:
	mov	w0, #0
LBB0_16:
	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
LBB0_17:
	mov	x0, x22
	b	LBB0_14
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.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	_SEEK_END,4,2                   ; @SEEK_END
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.no_dead_strip	_intfstream_file_get_serial
.subsections_via_symbols
