	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function create_db
_create_db:                             ## @create_db
	.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
	movq	%rdi, %r15
	movl	$-2, %esi
	callq	_luaL_checkstring
	movq	%rax, %r14
	movq	%r15, %rdi
	movl	$-1, %esi
	callq	_lua_isfunction
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_lua_pushstring
	movq	%r15, %rdi
	callq	_lua_error
LBB0_2:
	movq	_LUA_REGISTRYINDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	callq	_lua_setfield
	movq	_RETRO_VFS_FILE_ACCESS_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_filestream_open
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_lua_pushstring
	movq	%r15, %rdi
	callq	_lua_error
LBB0_4:
	movq	_value_provider@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_libretrodb_create
	movq	%rbx, %rdi
	callq	_filestream_close
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"second argument must be a function"

	.comm	_LUA_REGISTRYINDEX,4,2          ## @LUA_REGISTRYINDEX
L_.str.1:                               ## @.str.1
	.asciz	"testlib_get_value"

	.comm	_RETRO_VFS_FILE_ACCESS_WRITE,4,2 ## @RETRO_VFS_FILE_ACCESS_WRITE
	.comm	_RETRO_VFS_FILE_ACCESS_HINT_NONE,4,2 ## @RETRO_VFS_FILE_ACCESS_HINT_NONE
L_.str.2:                               ## @.str.2
	.asciz	"Could not open destination file"

	.comm	_value_provider,4,2             ## @value_provider
	.no_dead_strip	_create_db
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function create_db
_create_db:                             ; @create_db
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	mov	w1, #-2
	bl	_luaL_checkstring
	mov	x20, x0
	mov	x0, x19
	mov	w1, #-1
	bl	_lua_isfunction
	cbnz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_lua_pushstring
	mov	x0, x19
	bl	_lua_error
LBB0_2:
Lloh2:
	adrp	x8, _LUA_REGISTRYINDEX@GOTPAGE
Lloh3:
	ldr	x8, [x8, _LUA_REGISTRYINDEX@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x2, l_.str.1@PAGE
Lloh6:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_lua_setfield
Lloh7:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_WRITE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_WRITE@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_filestream_open
	mov	x20, x0
	cbnz	x0, LBB0_4
; %bb.3:
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_lua_pushstring
	mov	x0, x19
	bl	_lua_error
LBB0_4:
Lloh15:
	adrp	x1, _value_provider@GOTPAGE
Lloh16:
	ldr	x1, [x1, _value_provider@GOTPAGEOFF]
	mov	x0, x20
	mov	x2, x19
	bl	_libretrodb_create
	mov	x0, x20
	bl	_filestream_close
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"second argument must be a function"

	.comm	_LUA_REGISTRYINDEX,4,2          ; @LUA_REGISTRYINDEX
l_.str.1:                               ; @.str.1
	.asciz	"testlib_get_value"

	.comm	_RETRO_VFS_FILE_ACCESS_WRITE,4,2 ; @RETRO_VFS_FILE_ACCESS_WRITE
	.comm	_RETRO_VFS_FILE_ACCESS_HINT_NONE,4,2 ; @RETRO_VFS_FILE_ACCESS_HINT_NONE
l_.str.2:                               ; @.str.2
	.asciz	"Could not open destination file"

	.comm	_value_provider,4,2             ; @value_provider
	.no_dead_strip	_create_db
.subsections_via_symbols
