	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function task_save_handler
LCPI0_0:
	.long	0x42c80000                      ## float 100
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_task_save_handler:                     ## @task_save_handler
	.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
	movl	$8208, %eax                     ## imm = 0x2010
	callq	____chkstk_darwin
	subq	%rax, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	(%rdi), %rbx
	cmpq	$0, 40(%rbx)
	jne	LBB0_2
## %bb.1:
	movq	(%rbx), %rdi
	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
	callq	_intfstream_open_file
	movq	%rax, 40(%rbx)
	testq	%rax, %rax
	je	LBB0_25
LBB0_2:
	cmpq	$0, 32(%rbx)
	jne	LBB0_4
## %bb.3:
	movq	(%rbx), %rdi
	movl	8(%rbx), %esi
	callq	_get_serialized_data
	movq	%rax, 32(%rbx)
LBB0_4:
	movl	8(%rbx), %edi
	subl	12(%rbx), %edi
	movq	_SAVE_STATE_CHUNK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MIN
	movl	%eax, %r15d
	movq	32(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	40(%rbx), %rdi
	movslq	12(%rbx), %rcx
	leaq	(%rax,%rcx,4), %rsi
	movl	%r15d, %edx
	callq	_intfstream_write
	movq	%rax, %r12
	jmp	LBB0_7
LBB0_5:
	xorl	%r12d, %r12d
LBB0_7:
	movl	12(%rbx), %eax
	addl	%r12d, %eax
	cvtsi2ss	%eax, %xmm0
	movl	%eax, 12(%rbx)
	cvtsi2ssl	8(%rbx), %xmm1
	divss	%xmm1, %xmm0
	mulss	LCPI0_0(%rip), %xmm0
	movq	%r14, %rdi
	callq	_task_set_progress
	movq	%r14, %rdi
	callq	_task_get_cancelled
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	cmpl	%r15d, %r12d
	jne	LBB0_9
## %bb.13:
	movl	12(%rbx), %eax
	cmpl	8(%rbx), %eax
	jne	LBB0_25
## %bb.14:
	movq	%r14, %rdi
	callq	_task_free_title
	cmpq	$0, 24(%rbx)
	je	LBB0_17
## %bb.15:
	movq	_MSG_RESTORED_OLD_SAVE_STATE@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	movq	%rax, %rdi
	jmp	LBB0_20
LBB0_9:
	movb	$0, -8240(%rbp)
	cmpq	$0, 24(%rbx)
	je	LBB0_11
## %bb.10:
	movq	_MSG_FAILED_TO_UNDO_SAVE_STATE@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_msg_hash_to_str
	movq	_undo_save_buf@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	callq	_RARCH_ERR
	movl	(%r15), %edi
	callq	_msg_hash_to_str
	leaq	L_.str.1(%rip), %rdx
	leaq	L_.str.2(%rip), %r8
	jmp	LBB0_12
LBB0_11:
	movq	_MSG_FAILED_TO_SAVE_STATE_TO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	movq	(%rbx), %r8
	leaq	L_.str.3(%rip), %rdx
LBB0_12:
	leaq	-8240(%rbp), %rdi
	movl	$8192, %esi                     ## imm = 0x2000
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_snprintf
	leaq	-8240(%rbp), %rdi
	callq	_strdup
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_task_set_error
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_task_save_handler_finished
	jmp	LBB0_25
LBB0_17:
	cmpq	$0, 16(%rbx)
	js	LBB0_18
## %bb.19:
	movb	$0, -8240(%rbp)
	movq	_MSG_SAVED_STATE_TO_SLOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	movq	16(%rbx), %rcx
	leaq	-8240(%rbp), %r15
	movq	%r15, %rdi
	movl	$128, %esi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_snprintf
	movq	%r15, %rdi
LBB0_20:
	callq	_strdup
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_task_get_mute
	testl	%eax, %eax
	jne	LBB0_23
## %bb.21:
	testq	%r15, %r15
	je	LBB0_23
## %bb.22:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_task_set_title
	xorl	%r15d, %r15d
LBB0_23:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_task_save_handler_finished
	movq	%r15, %rdi
	callq	_string_is_empty
	testl	%eax, %eax
	jne	LBB0_25
## %bb.24:
	movq	%r15, %rdi
	callq	_free
LBB0_25:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_27
## %bb.26:
	addq	$8208, %rsp                     ## imm = 0x2010
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	_MSG_SAVED_STATE_TO_SLOT_AUTO@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_27:
	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
	.comm	_SAVE_STATE_CHUNK,4,2           ## @SAVE_STATE_CHUNK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s \"%s\".\n"

	.comm	_MSG_FAILED_TO_UNDO_SAVE_STATE,4,2 ## @MSG_FAILED_TO_UNDO_SAVE_STATE
	.comm	_undo_save_buf,4,2              ## @undo_save_buf
L_.str.1:                               ## @.str.1
	.asciz	"%s \"%s\"."

L_.str.2:                               ## @.str.2
	.asciz	"RAM"

L_.str.3:                               ## @.str.3
	.asciz	"%s %s"

	.comm	_MSG_FAILED_TO_SAVE_STATE_TO,4,2 ## @MSG_FAILED_TO_SAVE_STATE_TO
	.comm	_MSG_RESTORED_OLD_SAVE_STATE,4,2 ## @MSG_RESTORED_OLD_SAVE_STATE
	.comm	_MSG_SAVED_STATE_TO_SLOT_AUTO,4,2 ## @MSG_SAVED_STATE_TO_SLOT_AUTO
	.comm	_MSG_SAVED_STATE_TO_SLOT,4,2    ## @MSG_SAVED_STATE_TO_SLOT
	.no_dead_strip	_task_save_handler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function task_save_handler
_task_save_handler:                     ; @task_save_handler
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -56
	.cfi_offset w28, -64
	mov	w9, #8208
Lloh0:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh1:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	sub	sp, sp, #2, lsl #12             ; =8192
	sub	sp, sp, #16
	mov	x19, x0
Lloh2:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh3:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	x20, [x0]
	ldr	x8, [x20, #40]
	cbnz	x8, LBB0_2
; %bb.1:
	ldr	x0, [x20]
Lloh5:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_WRITE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_WRITE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	bl	_intfstream_open_file
	str	x0, [x20, #40]
	cbz	x0, LBB0_24
LBB0_2:
	ldr	x8, [x20, #32]
	cbnz	x8, LBB0_4
; %bb.3:
	ldr	x0, [x20]
	ldr	w1, [x20, #8]
	bl	_get_serialized_data
	str	x0, [x20, #32]
LBB0_4:
	ldp	w8, w9, [x20, #8]
	sub	w0, w8, w9
Lloh11:
	adrp	x8, _SAVE_STATE_CHUNK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SAVE_STATE_CHUNK@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_MIN
	mov	x21, x0
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	x0, [x20, #40]
	ldrsw	x9, [x20, #12]
	add	x1, x8, x9, lsl #2
	mov	x2, x21
	bl	_intfstream_write
	mov	x22, x0
	b	LBB0_7
LBB0_6:
	mov	w22, #0
LBB0_7:
	ldr	w8, [x20, #12]
	add	w8, w8, w22
	str	w8, [x20, #12]
	scvtf	s0, w8
	ldr	s1, [x20, #8]
	scvtf	s1, s1
	fdiv	s0, s0, s1
	mov	w8, #1120403456
	fmov	s1, w8
	fmul	s0, s0, s1
	mov	x0, x19
	bl	_task_set_progress
	mov	x0, x19
	bl	_task_get_cancelled
	cbnz	x0, LBB0_13
; %bb.8:
	cmp	w22, w21
	b.ne	LBB0_13
; %bb.9:
	ldp	w9, w8, [x20, #8]
	cmp	w8, w9
	b.ne	LBB0_24
; %bb.10:
	mov	x0, x19
	bl	_task_free_title
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_17
; %bb.11:
Lloh14:
	adrp	x8, _MSG_RESTORED_OLD_SAVE_STATE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MSG_RESTORED_OLD_SAVE_STATE@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	b	LBB0_19
LBB0_13:
	strb	wzr, [sp, #8]
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_15
; %bb.14:
Lloh16:
	adrp	x21, _MSG_FAILED_TO_UNDO_SAVE_STATE@GOTPAGE
Lloh17:
	ldr	x21, [x21, _MSG_FAILED_TO_UNDO_SAVE_STATE@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_msg_hash_to_str
	mov	x1, x0
Lloh18:
	adrp	x8, _undo_save_buf@GOTPAGE
Lloh19:
	ldr	x8, [x8, _undo_save_buf@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_ERR
	ldr	w0, [x21]
	bl	_msg_hash_to_str
	mov	x3, x0
Lloh23:
	adrp	x8, l_.str.2@PAGE
Lloh24:
	add	x8, x8, l_.str.2@PAGEOFF
	str	x8, [sp]
Lloh25:
	adrp	x2, l_.str.1@PAGE
Lloh26:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_16
LBB0_15:
Lloh27:
	adrp	x8, _MSG_FAILED_TO_SAVE_STATE_TO@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MSG_FAILED_TO_SAVE_STATE_TO@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	mov	x3, x0
	ldr	x8, [x20]
	str	x8, [sp]
Lloh30:
	adrp	x2, l_.str.3@PAGE
Lloh31:
	add	x2, x2, l_.str.3@PAGEOFF
LBB0_16:
	add	x0, sp, #8
	mov	w1, #8192
	bl	_snprintf
	add	x0, sp, #8
	bl	_strdup
	mov	x1, x0
	mov	x0, x19
	bl	_task_set_error
	mov	x0, x19
	mov	x1, x20
	bl	_task_save_handler_finished
	b	LBB0_24
LBB0_17:
	ldr	x8, [x20, #16]
	tbnz	x8, #63, LBB0_26
; %bb.18:
	strb	wzr, [sp, #8]
Lloh32:
	adrp	x8, _MSG_SAVED_STATE_TO_SLOT@GOTPAGE
Lloh33:
	ldr	x8, [x8, _MSG_SAVED_STATE_TO_SLOT@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	mov	x2, x0
	ldr	x3, [x20, #16]
	add	x0, sp, #8
	mov	w1, #128
	bl	_snprintf
	add	x0, sp, #8
LBB0_19:
	bl	_strdup
	mov	x21, x0
	mov	x0, x19
	bl	_task_get_mute
	cbnz	w0, LBB0_22
; %bb.20:
	cbz	x21, LBB0_22
; %bb.21:
	mov	x0, x19
	mov	x1, x21
	bl	_task_set_title
	mov	x21, #0
LBB0_22:
	mov	x0, x19
	mov	x1, x20
	bl	_task_save_handler_finished
	mov	x0, x21
	bl	_string_is_empty
	cbnz	w0, LBB0_24
; %bb.23:
	mov	x0, x21
	bl	_free
LBB0_24:
	ldur	x8, [x29, #-56]
Lloh35:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh36:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.25:
	add	sp, sp, #2, lsl #12             ; =8192
	add	sp, sp, #16
	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
	ldp	x28, x27, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_26:
Lloh38:
	adrp	x8, _MSG_SAVED_STATE_TO_SLOT_AUTO@GOTPAGE
Lloh39:
	ldr	x8, [x8, _MSG_SAVED_STATE_TO_SLOT_AUTO@GOTPAGEOFF]
	b	LBB0_12
LBB0_27:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.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
	.comm	_SAVE_STATE_CHUNK,4,2           ; @SAVE_STATE_CHUNK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s \"%s\".\n"

	.comm	_MSG_FAILED_TO_UNDO_SAVE_STATE,4,2 ; @MSG_FAILED_TO_UNDO_SAVE_STATE
	.comm	_undo_save_buf,4,2              ; @undo_save_buf
l_.str.1:                               ; @.str.1
	.asciz	"%s \"%s\"."

l_.str.2:                               ; @.str.2
	.asciz	"RAM"

l_.str.3:                               ; @.str.3
	.asciz	"%s %s"

	.comm	_MSG_FAILED_TO_SAVE_STATE_TO,4,2 ; @MSG_FAILED_TO_SAVE_STATE_TO
	.comm	_MSG_RESTORED_OLD_SAVE_STATE,4,2 ; @MSG_RESTORED_OLD_SAVE_STATE
	.comm	_MSG_SAVED_STATE_TO_SLOT_AUTO,4,2 ; @MSG_SAVED_STATE_TO_SLOT_AUTO
	.comm	_MSG_SAVED_STATE_TO_SLOT,4,2    ; @MSG_SAVED_STATE_TO_SLOT
	.no_dead_strip	_task_save_handler
.subsections_via_symbols
