	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libretrodb_find_entry          ## -- Begin function libretrodb_find_entry
	.p2align	4, 0x90
_libretrodb_find_entry:                 ## @libretrodb_find_entry
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rdi, %r12
	leaq	-72(%rbp), %rdx
	callq	_libretrodb_find_index
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	movq	-72(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	%rax, %r13
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	jle	LBB0_10
## %bb.4:
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(,%r14,8), %rsi
	addq	%r13, %rsi
	movl	(%r12), %edi
	movq	%rbx, %rdx
	subq	%r14, %rdx
	callq	_filestream_read
	testl	%eax, %eax
	jle	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	cltq
	addq	%rax, %r14
	cmpq	%r14, %rbx
	jg	LBB0_5
LBB0_10:
	movl	4(%r12), %edx
	movq	-64(%rbp), %rcx
	leaq	-56(%rbp), %r8
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_binsearch
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_free
	testl	%ebx, %ebx
	jne	LBB0_12
## %bb.11:
	movl	(%r12), %edi
	movq	-56(%rbp), %rsi
	movq	_RETRO_VFS_SEEK_POSITION_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_filestream_seek
LBB0_12:
	movl	(%r12), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_rmsgpack_dom_read
	jmp	LBB0_13
LBB0_1:
	movl	$-1, %eax
	jmp	LBB0_13
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_8
LBB0_6:
	movq	%r13, %rdi
	callq	_free
	movq	_errno@GOTPCREL(%rip), %rcx
LBB0_8:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_errno,4,2                      ## @errno
	.comm	_RETRO_VFS_SEEK_POSITION_START,4,2 ## @RETRO_VFS_SEEK_POSITION_START
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libretrodb_find_entry          ; -- Begin function libretrodb_find_entry
	.p2align	2
_libretrodb_find_entry:                 ; @libretrodb_find_entry
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x3
	mov	x21, x2
	mov	x20, x0
	add	x2, sp, #16
	bl	_libretrodb_find_index
	tbnz	x0, #63, LBB0_9
; %bb.1:
	ldr	x23, [sp, #16]
	mov	x0, x23
	bl	_malloc
	cbz	x0, LBB0_10
; %bb.2:
	mov	x22, x0
	cmp	x23, #1
	b.lt	LBB0_6
; %bb.3:
	mov	x24, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, x22, x24, lsl #3
	ldr	w0, [x20]
	sub	x2, x23, x24
	bl	_filestream_read
	cmp	w0, #0
	b.le	LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, w0, sxtw
	cmp	x23, x24
	b.gt	LBB0_4
LBB0_6:
	ldr	w2, [x20, #4]
	ldr	x3, [sp, #24]
	add	x4, sp, #8
	mov	x0, x22
	mov	x1, x21
	bl	_binsearch
	mov	x21, x0
	mov	x0, x22
	bl	_free
	cbnz	w21, LBB0_8
; %bb.7:
	ldr	w0, [x20]
	ldr	x1, [sp, #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
LBB0_8:
	ldr	w0, [x20]
	mov	x1, x19
	bl	_rmsgpack_dom_read
	b	LBB0_13
LBB0_9:
	mov	w0, #-1
	b	LBB0_13
LBB0_10:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
	mov	x0, x22
	bl	_free
Lloh5:
	adrp	x8, _errno@GOTPAGE
Lloh6:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_errno,4,2                      ; @errno
	.comm	_RETRO_VFS_SEEK_POSITION_START,4,2 ; @RETRO_VFS_SEEK_POSITION_START
.subsections_via_symbols
