	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libretrodb_cursor_open         ## -- Begin function libretrodb_cursor_open
	.p2align	4, 0x90
_libretrodb_cursor_open:                ## @libretrodb_cursor_open
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_string_is_empty
	testq	%rax, %rax
	je	LBB0_3
LBB0_2:
	movq	_errno@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	(%rbx), %edi
	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_2
## %bb.4:
	movq	%rax, 24(%r15)
	movq	%rbx, 16(%r15)
	movl	$1, (%r15)
	movq	%r15, %rdi
	callq	_libretrodb_cursor_reset
	movq	%r14, 8(%r15)
	xorl	%ebx, %ebx
	testq	%r14, %r14
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	callq	_libretrodb_query_inc_ref
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,4,2                      ## @errno
	.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
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libretrodb_cursor_open         ; -- Begin function libretrodb_cursor_open
	.p2align	2
_libretrodb_cursor_open:                ; @libretrodb_cursor_open
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	x0, LBB0_2
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	w0, [x0]
	bl	_string_is_empty
	cbz	x0, LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
	ldr	w0, [x21]
Lloh3:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_READ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_READ@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_filestream_open
	cbz	x0, LBB0_2
; %bb.5:
	stp	x21, x0, [x20, #16]
	mov	w8, #1
	str	w8, [x20]
	mov	x0, x20
	bl	_libretrodb_cursor_reset
	str	x19, [x20, #8]
	cbz	x19, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_libretrodb_query_inc_ref
LBB0_7:
	mov	w0, #0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,4,2                      ; @errno
	.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
.subsections_via_symbols
