	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bsv_movie_init_record
_bsv_movie_init_record:                 ## @bsv_movie_init_record
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -48(%rbp)
	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	%rbx, %rdi
	callq	_intfstream_open_file
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, 16(%r15)
	xorl	%eax, %eax
	callq	_content_get_crc
	movl	%eax, %ebx
	movq	_BSV_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_swap_if_little32
	movq	_MAGIC_INDEX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, -48(%rbp,%rcx,4)
	movl	%ebx, %edi
	callq	_swap_if_big32
	movq	_CRC_INDEX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, -48(%rbp,%rcx,4)
	leaq	-56(%rbp), %rdi
	callq	_core_serialize_size
	movl	-56(%rbp), %ebx
	movl	%ebx, %edi
	callq	_swap_if_big32
	movq	_STATE_SIZE_INDEX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, -48(%rbp,%rcx,4)
	movq	16(%r15), %rdi
	leaq	-48(%rbp), %rsi
	movl	$16, %edx
	callq	_intfstream_write
	leal	16(%rbx), %eax
	movl	%eax, (%r15)
	movl	%ebx, 4(%r15)
	movl	$1, %r14d
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.3:
	movl	%ebx, %edi
	callq	_malloc
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%rax, -72(%rbp)
	movl	%ebx, -64(%rbp)
	leaq	-72(%rbp), %rdi
	callq	_core_serialize
	movq	8(%r15), %rsi
	movq	16(%r15), %rdi
	movl	%ebx, %edx
	callq	_intfstream_write
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_RARCH_ERR
	jmp	LBB0_6
LBB0_5:
	xorl	%r14d, %r14d
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not open BSV file for recording, path : \"%s\".\n"

	.comm	_BSV_MAGIC,4,2                  ## @BSV_MAGIC
	.comm	_MAGIC_INDEX,8,3                ## @MAGIC_INDEX
	.comm	_CRC_INDEX,8,3                  ## @CRC_INDEX
	.comm	_STATE_SIZE_INDEX,8,3           ## @STATE_SIZE_INDEX
	.no_dead_strip	_bsv_movie_init_record
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bsv_movie_init_record
_bsv_movie_init_record:                 ; @bsv_movie_init_record
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	stp	xzr, xzr, [sp, #40]
Lloh3:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_WRITE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_WRITE@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]
	mov	x0, x20
	bl	_intfstream_open_file
	cbz	x0, LBB0_5
; %bb.1:
	str	x0, [x19, #16]
	bl	_content_get_crc
	mov	x20, x0
Lloh9:
	adrp	x8, _BSV_MAGIC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BSV_MAGIC@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_swap_if_little32
Lloh12:
	adrp	x8, _MAGIC_INDEX@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MAGIC_INDEX@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	add	x21, sp, #40
	str	w0, [x21, x8, lsl #2]
	mov	x0, x20
	bl	_swap_if_big32
Lloh15:
	adrp	x8, _CRC_INDEX@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CRC_INDEX@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	str	w0, [x21, x8, lsl #2]
	add	x0, sp, #32
	bl	_core_serialize_size
	ldr	w20, [sp, #32]
	mov	x0, x20
	bl	_swap_if_big32
Lloh18:
	adrp	x8, _STATE_SIZE_INDEX@GOTPAGE
Lloh19:
	ldr	x8, [x8, _STATE_SIZE_INDEX@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	str	w0, [x21, x8, lsl #2]
	ldr	x0, [x19, #16]
	add	x1, sp, #40
	mov	w2, #16
	bl	_intfstream_write
	add	w8, w20, #16
	stp	w8, w20, [x19]
	cbz	w20, LBB0_4
; %bb.2:
	mov	x0, x20
	bl	_malloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_6
; %bb.3:
	str	x0, [sp, #16]
	str	w20, [sp, #24]
	add	x0, sp, #16
	bl	_core_serialize
	ldp	x1, x0, [x19, #8]
	mov	x2, x20
	bl	_intfstream_write
LBB0_4:
	mov	w0, #1
	b	LBB0_6
LBB0_5:
	str	x20, [sp]
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_ERR
	mov	w0, #0
LBB0_6:
	ldur	x8, [x29, #-40]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.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
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not open BSV file for recording, path : \"%s\".\n"

	.comm	_BSV_MAGIC,4,2                  ; @BSV_MAGIC
	.comm	_MAGIC_INDEX,8,3                ; @MAGIC_INDEX
	.comm	_CRC_INDEX,8,3                  ; @CRC_INDEX
	.comm	_STATE_SIZE_INDEX,8,3           ; @STATE_SIZE_INDEX
	.no_dead_strip	_bsv_movie_init_record
.subsections_via_symbols
