	.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_load_handler
LCPI0_0:
	.long	0x42c80000                      ## float 100
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_task_load_handler:                     ## @task_load_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %r13
	cmpq	$0, 40(%r13)
	je	LBB0_2
## %bb.1:
	movl	8(%r13), %ebx
LBB0_6:
	subl	24(%r13), %ebx
	movq	_SAVE_STATE_CHUNK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_MIN
	movq	%rax, %r15
	movq	40(%r13), %rdi
	movslq	24(%r13), %rsi
	shlq	$2, %rsi
	addq	16(%r13), %rsi
	movq	%rax, %rdx
	callq	_intfstream_read
	movq	%rax, %r12
	movl	24(%r13), %eax
	addl	%r12d, %eax
	movl	%eax, 24(%r13)
	movl	8(%r13), %ecx
	testl	%ecx, %ecx
	jle	LBB0_8
## %bb.7:
	cvtsi2ss	%eax, %xmm0
	cvtsi2ss	%ecx, %xmm1
	divss	%xmm1, %xmm0
	mulss	LCPI0_0(%rip), %xmm0
	movq	%r14, %rdi
	callq	_task_set_progress
LBB0_8:
	movq	%r14, %rdi
	callq	_task_get_cancelled
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	cmpq	%r15, %r12
	jne	LBB0_10
## %bb.14:
	movl	24(%r13), %eax
	cmpl	8(%r13), %eax
	jne	LBB0_24
## %bb.15:
	movl	$8192, %edi                     ## imm = 0x2000
	callq	_malloc
	movq	%rax, %r15
	movb	$0, (%rax)
	movq	%r14, %rdi
	callq	_task_free_title
	cmpq	$0, 32(%r13)
	je	LBB0_17
## %bb.16:
	movq	_MSG_AUTOLOADING_SAVESTATE_FROM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	movq	%rax, %rbx
	movq	(%r13), %r12
	movq	_MSG_SUCCEEDED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	leaq	L_.str(%rip), %rdx
	movl	$8192, %esi                     ## imm = 0x2000
	movq	%r15, %rdi
	movq	%rbx, %rcx
	movq	%r12, %r8
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	_snprintf
	jmp	LBB0_20
LBB0_2:
	movq	(%r13), %rdi
	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	_intfstream_open_file
	movq	%rax, 40(%r13)
	testq	%rax, %rax
	je	LBB0_23
## %bb.3:
	movq	_SEEK_END@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_intfstream_seek
	testq	%rax, %rax
	jne	LBB0_23
## %bb.4:
	movq	40(%r13), %rdi
	callq	_intfstream_tell
	movl	%eax, 8(%r13)
	testl	%eax, %eax
	js	LBB0_23
## %bb.5:
	movq	40(%r13), %rdi
	callq	_intfstream_rewind
	movslq	8(%r13), %rbx
	movq	%rbx, %rdi
	incq	%rdi
	callq	_malloc
	movq	%rax, 16(%r13)
	testq	%rax, %rax
	jne	LBB0_6
	jmp	LBB0_23
LBB0_10:
	cmpq	$0, 32(%r13)
	je	LBB0_12
## %bb.11:
	movl	$8192, %edi                     ## imm = 0x2000
	callq	_malloc
	movq	%rax, %r15
	movb	$0, (%rax)
	movq	_MSG_AUTOLOADING_SAVESTATE_FROM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	movq	%rax, %rbx
	movq	(%r13), %r12
	movq	_MSG_FAILED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	leaq	L_.str(%rip), %rdx
	movl	$8192, %esi                     ## imm = 0x2000
	movq	%r15, %rdi
	movq	%rbx, %rcx
	movq	%r12, %r8
	movq	%rax, %r9
	xorl	%eax, %eax
	callq	_snprintf
	movq	%r15, %rdi
	callq	_strdup
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_task_set_error
	movq	%r15, %rdi
	callq	_free
	jmp	LBB0_13
LBB0_24:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_MSG_FAILED_TO_LOAD_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	movq	%rax, %rdi
	callq	_strdup
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_task_set_error
LBB0_13:
	movq	16(%r13), %rdi
	callq	_free
	movq	$0, 16(%r13)
	jmp	LBB0_23
LBB0_17:
	cmpl	$0, 28(%r13)
	js	LBB0_18
## %bb.19:
	movq	_MSG_LOADED_STATE_FROM_SLOT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	movslq	28(%r13), %rcx
	movl	$8192, %esi                     ## imm = 0x2000
	movq	%r15, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_snprintf
	jmp	LBB0_20
LBB0_18:
	movq	_MSG_LOADED_STATE_FROM_SLOT_AUTO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	movl	$8192, %edx                     ## imm = 0x2000
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_strlcpy
LBB0_20:
	movq	%r14, %rdi
	callq	_task_get_mute
	testl	%eax, %eax
	jne	LBB0_22
## %bb.21:
	movq	%r15, %rdi
	callq	_strdup
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_task_set_title
LBB0_22:
	movq	%r15, %rdi
	callq	_free
LBB0_23:
	movq	%r14, %rdi
	movq	%r13, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_task_load_handler_finished     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.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
	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.comm	_SAVE_STATE_CHUNK,4,2           ## @SAVE_STATE_CHUNK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s \"%s\" %s."

	.comm	_MSG_AUTOLOADING_SAVESTATE_FROM,4,2 ## @MSG_AUTOLOADING_SAVESTATE_FROM
	.comm	_MSG_FAILED,4,2                 ## @MSG_FAILED
	.comm	_MSG_FAILED_TO_LOAD_STATE,4,2   ## @MSG_FAILED_TO_LOAD_STATE
	.comm	_MSG_SUCCEEDED,4,2              ## @MSG_SUCCEEDED
	.comm	_MSG_LOADED_STATE_FROM_SLOT_AUTO,4,2 ## @MSG_LOADED_STATE_FROM_SLOT_AUTO
	.comm	_MSG_LOADED_STATE_FROM_SLOT,4,2 ## @MSG_LOADED_STATE_FROM_SLOT
	.no_dead_strip	_task_load_handler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function task_load_handler
_task_load_handler:                     ; @task_load_handler
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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 w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	ldr	x19, [x0]
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_9
; %bb.1:
	ldr	w21, [x19, #8]
LBB0_2:
	ldr	w8, [x19, #24]
	sub	w0, w21, w8
Lloh0:
	adrp	x8, _SAVE_STATE_CHUNK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SAVE_STATE_CHUNK@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_MIN
	mov	x21, x0
	ldr	x0, [x19, #40]
	ldr	x8, [x19, #16]
	ldrsw	x9, [x19, #24]
	add	x1, x8, x9, lsl #2
	mov	x2, x21
	bl	_intfstream_read
	mov	x22, x0
	ldr	w8, [x19, #24]
	add	w8, w8, w22
	str	w8, [x19, #24]
	ldr	w9, [x19, #8]
	cmp	w9, #1
	b.lt	LBB0_4
; %bb.3:
	scvtf	s0, w8
	scvtf	s1, w9
	fdiv	s0, s0, s1
	mov	w8, #1120403456
	fmov	s1, w8
	fmul	s0, s0, s1
	mov	x0, x20
	bl	_task_set_progress
LBB0_4:
	mov	x0, x20
	bl	_task_get_cancelled
	cbnz	x0, LBB0_13
; %bb.5:
	cmp	x22, x21
	b.ne	LBB0_13
; %bb.6:
	ldr	w8, [x19, #24]
	ldr	w9, [x19, #8]
	cmp	w8, w9
	b.ne	LBB0_15
; %bb.7:
	mov	w0, #8192
	bl	_malloc
	mov	x21, x0
	strb	wzr, [x0]
	mov	x0, x20
	bl	_task_free_title
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_18
; %bb.8:
Lloh3:
	adrp	x8, _MSG_AUTOLOADING_SAVESTATE_FROM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MSG_AUTOLOADING_SAVESTATE_FROM@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	mov	x22, x0
	ldr	x23, [x19]
Lloh6:
	adrp	x8, _MSG_SUCCEEDED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MSG_SUCCEEDED@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	stp	x23, x0, [sp]
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	mov	w1, #8192
	mov	x3, x22
	b	LBB0_20
LBB0_9:
	ldr	x0, [x19]
Lloh11:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_READ@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_READ@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RETRO_VFS_FILE_ACCESS_HINT_NONE@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	bl	_intfstream_open_file
	str	x0, [x19, #40]
	cbz	x0, LBB0_24
; %bb.10:
Lloh17:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_intfstream_seek
	cbnz	x0, LBB0_24
; %bb.11:
	ldr	x0, [x19, #40]
	bl	_intfstream_tell
	str	w0, [x19, #8]
	tbnz	w0, #31, LBB0_24
; %bb.12:
	ldr	x0, [x19, #40]
	bl	_intfstream_rewind
	ldrsw	x21, [x19, #8]
	add	x0, x21, #1
	bl	_malloc
	str	x0, [x19, #16]
	cbnz	x0, LBB0_2
	b	LBB0_24
LBB0_13:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_16
; %bb.14:
	mov	w0, #8192
	bl	_malloc
	mov	x21, x0
	strb	wzr, [x0]
Lloh20:
	adrp	x8, _MSG_AUTOLOADING_SAVESTATE_FROM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MSG_AUTOLOADING_SAVESTATE_FROM@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	mov	x22, x0
	ldr	x23, [x19]
Lloh23:
	adrp	x8, _MSG_FAILED@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MSG_FAILED@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	stp	x23, x0, [sp]
Lloh26:
	adrp	x2, l_.str@PAGE
Lloh27:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	mov	w1, #8192
	mov	x3, x22
	bl	_snprintf
	mov	x0, x21
	bl	_strdup
	mov	x1, x0
	mov	x0, x20
	bl	_task_set_error
	mov	x0, x21
	bl	_free
	b	LBB0_17
LBB0_15:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_16:
Lloh28:
	adrp	x8, _MSG_FAILED_TO_LOAD_STATE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _MSG_FAILED_TO_LOAD_STATE@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	bl	_strdup
	mov	x1, x0
	mov	x0, x20
	bl	_task_set_error
LBB0_17:
	ldr	x0, [x19, #16]
	bl	_free
	str	xzr, [x19, #16]
	b	LBB0_24
LBB0_18:
	ldr	w8, [x19, #28]
	tbnz	w8, #31, LBB0_25
; %bb.19:
Lloh31:
	adrp	x8, _MSG_LOADED_STATE_FROM_SLOT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _MSG_LOADED_STATE_FROM_SLOT@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	mov	x2, x0
	ldrsw	x3, [x19, #28]
	mov	x0, x21
	mov	w1, #8192
LBB0_20:
	bl	_snprintf
LBB0_21:
	mov	x0, x20
	bl	_task_get_mute
	cbnz	w0, LBB0_23
; %bb.22:
	mov	x0, x21
	bl	_strdup
	mov	x1, x0
	mov	x0, x20
	bl	_task_set_title
LBB0_23:
	mov	x0, x21
	bl	_free
LBB0_24:
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_task_load_handler_finished
LBB0_25:
Lloh34:
	adrp	x8, _MSG_LOADED_STATE_FROM_SLOT_AUTO@GOTPAGE
Lloh35:
	ldr	x8, [x8, _MSG_LOADED_STATE_FROM_SLOT_AUTO@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	mov	x1, x0
	mov	x0, x21
	mov	w2, #8192
	bl	_strlcpy
	b	LBB0_21
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.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
	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.comm	_SAVE_STATE_CHUNK,4,2           ; @SAVE_STATE_CHUNK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s \"%s\" %s."

	.comm	_MSG_AUTOLOADING_SAVESTATE_FROM,4,2 ; @MSG_AUTOLOADING_SAVESTATE_FROM
	.comm	_MSG_FAILED,4,2                 ; @MSG_FAILED
	.comm	_MSG_FAILED_TO_LOAD_STATE,4,2   ; @MSG_FAILED_TO_LOAD_STATE
	.comm	_MSG_SUCCEEDED,4,2              ; @MSG_SUCCEEDED
	.comm	_MSG_LOADED_STATE_FROM_SLOT_AUTO,4,2 ; @MSG_LOADED_STATE_FROM_SLOT_AUTO
	.comm	_MSG_LOADED_STATE_FROM_SLOT,4,2 ; @MSG_LOADED_STATE_FROM_SLOT
	.no_dead_strip	_task_load_handler
.subsections_via_symbols
