	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function libretrodb_find_index
_libretrodb_find_index:                 ## @libretrodb_find_index
	.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, %r15
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_filestream_get_size
	movq	%rax, %r12
	movl	(%rbx), %edi
	movq	8(%rbx), %rsi
	movq	_RETRO_VFS_SEEK_POSITION_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_filestream_seek
	movl	$-1, %ecx
	cmpq	%r12, %rax
	jge	LBB0_5
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edi
	movq	%r15, %rsi
	callq	_libretrodb_read_index_header
	movl	8(%r15), %r13d
	movl	%r13d, %edi
	callq	_strlen
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%rbx), %edi
	movq	(%r15), %rsi
	movq	_RETRO_VFS_SEEK_POSITION_CURRENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_filestream_seek
	movl	(%rbx), %edi
	callq	_filestream_tell
	cmpq	%r12, %rax
	jl	LBB0_1
## %bb.4:
	movl	$-1, %ecx
	jmp	LBB0_5
LBB0_2:
	xorl	%ecx, %ecx
LBB0_5:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RETRO_VFS_SEEK_POSITION_START,4,2 ## @RETRO_VFS_SEEK_POSITION_START
	.comm	_RETRO_VFS_SEEK_POSITION_CURRENT,4,2 ## @RETRO_VFS_SEEK_POSITION_CURRENT
	.no_dead_strip	_libretrodb_find_index
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function libretrodb_find_index
_libretrodb_find_index:                 ; @libretrodb_find_index
	.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
	ldr	w0, [x0]
	bl	_filestream_get_size
	mov	x22, x0
	ldr	w0, [x21]
	ldr	x1, [x21, #8]
Lloh0:
	adrp	x8, _RETRO_VFS_SEEK_POSITION_START@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RETRO_VFS_SEEK_POSITION_START@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	bl	_filestream_seek
	cmp	x0, x22
	b.ge	LBB0_4
; %bb.1:
Lloh3:
	adrp	x24, _RETRO_VFS_SEEK_POSITION_CURRENT@GOTPAGE
Lloh4:
	ldr	x24, [x24, _RETRO_VFS_SEEK_POSITION_CURRENT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	mov	x1, x19
	bl	_libretrodb_read_index_header
	ldr	w23, [x19, #8]
	mov	x0, x23
	bl	_strlen
	mov	x2, x0
	mov	x0, x20
	mov	x1, x23
	bl	_strncmp
	cbz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x21]
	ldr	x1, [x19]
	ldr	w2, [x24]
	bl	_filestream_seek
	ldr	w0, [x21]
	bl	_filestream_tell
	cmp	x0, x22
	b.lt	LBB0_2
LBB0_4:
	mov	w0, #-1
LBB0_5:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_RETRO_VFS_SEEK_POSITION_START,4,2 ; @RETRO_VFS_SEEK_POSITION_START
	.comm	_RETRO_VFS_SEEK_POSITION_CURRENT,4,2 ; @RETRO_VFS_SEEK_POSITION_CURRENT
	.no_dead_strip	_libretrodb_find_index
.subsections_via_symbols
