	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function database_cursor_open
_database_cursor_open:                  ## @database_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	$0, -40(%rbp)
	movq	%rdx, %rdi
	movq	%r15, %rsi
	callq	_libretrodb_open
	movl	$-1, %ebx
	testq	%rax, %rax
	jne	LBB0_9
## %bb.1:
	testq	%r12, %r12
	je	LBB0_10
## %bb.2:
	movq	%r12, %rdi
	callq	_strlen
	leaq	-40(%rbp), %rcx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_libretrodb_query_compile
	movq	%rax, %r12
	cmpq	$0, -40(%rbp)
	jne	LBB0_6
## %bb.3:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_libretrodb_cursor_open
	testq	%rax, %rax
	je	LBB0_4
LBB0_6:
	testq	%r12, %r12
	je	LBB0_8
## %bb.7:
	movq	%r12, %rdi
	callq	_libretrodb_query_free
	jmp	LBB0_8
LBB0_10:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_libretrodb_cursor_open
	testq	%rax, %rax
	je	LBB0_9
LBB0_8:
	movq	%r15, %rdi
	callq	_libretrodb_close
	movl	$-1, %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	xorl	%ebx, %ebx
	testq	%r12, %r12
	je	LBB0_9
## %bb.5:
	movq	%r12, %rdi
	callq	_libretrodb_query_free
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_database_cursor_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function database_cursor_open
_database_cursor_open:                  ; @database_cursor_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x3
	mov	x20, x1
	mov	x19, x0
	str	xzr, [sp, #8]
	mov	x0, x2
	mov	x1, x19
	bl	_libretrodb_open
	cbnz	x0, LBB0_8
; %bb.1:
	cbz	x21, LBB0_6
; %bb.2:
	mov	x0, x21
	bl	_strlen
	mov	x2, x0
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x21
	bl	_libretrodb_query_compile
	mov	x21, x0
	ldr	x8, [sp, #8]
	cbnz	x8, LBB0_4
; %bb.3:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_libretrodb_cursor_open
	cbz	x0, LBB0_10
LBB0_4:
	cbz	x21, LBB0_7
; %bb.5:
	mov	x0, x21
	bl	_libretrodb_query_free
	b	LBB0_7
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	bl	_libretrodb_cursor_open
	cbz	x0, LBB0_9
LBB0_7:
	mov	x0, x19
	bl	_libretrodb_close
LBB0_8:
	mov	w0, #-1
LBB0_9:
	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
	add	sp, sp, #64
	ret
LBB0_10:
	cbz	x21, LBB0_12
; %bb.11:
	mov	x0, x21
	bl	_libretrodb_query_free
LBB0_12:
	mov	w0, #0
	b	LBB0_9
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_database_cursor_open
.subsections_via_symbols
