	.file	"extr_..taskstask_save.c_task_save_handler.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%s \"%s\".\n"
.LC2:
	.string	"RAM"
.LC3:
	.string	"%s \"%s\"."
.LC4:
	.string	"%s %s"
	.text
	.p2align 4
	.type	task_save_handler, @function
task_save_handler:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 4096
	.cfi_def_cfa_offset 4144
	or	QWORD PTR [rsp], 0
	sub	rsp, 4096
	.cfi_def_cfa_offset 8240
	or	QWORD PTR [rsp], 0
	sub	rsp, 16
	.cfi_def_cfa_offset 8256
	mov	rbp, QWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8200[rsp], rax
	xor	eax, eax
	cmp	QWORD PTR 40[rbp], 0
	mov	r12, rdi
	je	.L2
	cmp	QWORD PTR 32[rbp], 0
	mov	edi, DWORD PTR 8[rbp]
	je	.L27
.L4:
	mov	esi, DWORD PTR SAVE_STATE_CHUNK[rip]
	sub	edi, DWORD PTR 12[rbp]
	xor	r13d, r13d
	call	MIN@PLT
	mov	ebx, eax
	mov	rax, QWORD PTR 32[rbp]
	test	rax, rax
	jne	.L28
.L7:
	mov	eax, DWORD PTR 12[rbp]
	pxor	xmm0, xmm0
	pxor	xmm1, xmm1
	mov	rdi, r12
	cvtsi2ss	xmm1, DWORD PTR 8[rbp]
	add	eax, r13d
	cvtsi2ss	xmm0, eax
	mov	DWORD PTR 12[rbp], eax
	divss	xmm0, xmm1
	mulss	xmm0, DWORD PTR .LC0[rip]
	call	task_set_progress@PLT
	mov	rdi, r12
	call	task_get_cancelled@PLT
	cmp	r13d, ebx
	jne	.L19
	test	rax, rax
	je	.L8
.L19:
	mov	BYTE PTR [rsp], 0
	cmp	QWORD PTR 24[rbp], 0
	jne	.L29
	mov	edi, DWORD PTR MSG_FAILED_TO_SAVE_STATE_TO[rip]
	mov	rbx, QWORD PTR 0[rbp]
	mov	r13, rsp
	call	msg_hash_to_str@PLT
	mov	r8, rbx
	mov	esi, 8192
	mov	rdi, r13
	mov	rcx, rax
	lea	rdx, .LC4[rip]
	xor	eax, eax
	call	snprintf@PLT
.L11:
	mov	rdi, r13
	call	strdup@PLT
	mov	rdi, r12
	mov	rsi, rax
	call	task_set_error@PLT
	mov	rsi, rbp
	mov	rdi, r12
	call	task_save_handler_finished@PLT
.L1:
	mov	rax, QWORD PTR 8200[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L30
	add	rsp, 8208
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	mov	edi, DWORD PTR MSG_FAILED_TO_UNDO_SAVE_STATE[rip]
	mov	r13d, DWORD PTR undo_save_buf[rip]
	call	msg_hash_to_str@PLT
	mov	edx, r13d
	lea	rdi, .LC1[rip]
	mov	r13, rsp
	mov	rsi, rax
	call	RARCH_ERR@PLT
	mov	edi, DWORD PTR MSG_FAILED_TO_UNDO_SAVE_STATE[rip]
	call	msg_hash_to_str@PLT
	lea	r8, .LC2[rip]
	mov	esi, 8192
	mov	rdi, r13
	mov	rcx, rax
	lea	rdx, .LC3[rip]
	xor	eax, eax
	call	snprintf@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L8:
	mov	eax, DWORD PTR 8[rbp]
	cmp	DWORD PTR 12[rbp], eax
	jne	.L1
	mov	rdi, r12
	call	task_free_title@PLT
	cmp	QWORD PTR 24[rbp], 0
	jne	.L31
	mov	r13, QWORD PTR 16[rbp]
	test	r13, r13
	js	.L32
	mov	edi, DWORD PTR MSG_SAVED_STATE_TO_SLOT[rip]
	mov	r14, rsp
	mov	BYTE PTR [rsp], 0
	call	msg_hash_to_str@PLT
	mov	rcx, r13
	mov	esi, 128
	mov	rdi, r14
	mov	rdx, rax
	xor	eax, eax
	call	snprintf@PLT
	mov	rdi, r14
	call	strdup@PLT
	mov	r13, rax
.L14:
	mov	rdi, r12
	call	task_get_mute@PLT
	test	eax, eax
	jne	.L16
	test	r13, r13
	je	.L16
	mov	rsi, r13
	mov	rdi, r12
	xor	r13d, r13d
	call	task_set_title@PLT
.L16:
	mov	rdi, r12
	mov	rsi, rbp
	call	task_save_handler_finished@PLT
	mov	rdi, r13
	call	string_is_empty@PLT
	test	eax, eax
	jne	.L1
	mov	rdi, r13
	call	free@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L2:
	mov	edx, DWORD PTR RETRO_VFS_FILE_ACCESS_HINT_NONE[rip]
	mov	esi, DWORD PTR RETRO_VFS_FILE_ACCESS_WRITE[rip]
	mov	rdi, QWORD PTR 0[rbp]
	call	intfstream_open_file@PLT
	mov	QWORD PTR 40[rbp], rax
	test	rax, rax
	je	.L1
	cmp	QWORD PTR 32[rbp], 0
	mov	edi, DWORD PTR 8[rbp]
	jne	.L4
.L27:
	mov	esi, edi
	mov	rdi, QWORD PTR 0[rbp]
	call	get_serialized_data@PLT
	mov	edi, DWORD PTR 8[rbp]
	mov	QWORD PTR 32[rbp], rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L28:
	movsx	rdx, DWORD PTR 12[rbp]
	mov	rdi, QWORD PTR 40[rbp]
	lea	rsi, [rax+rdx*4]
	mov	edx, ebx
	call	intfstream_write@PLT
	mov	r13d, eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L31:
	mov	edi, DWORD PTR MSG_RESTORED_OLD_SAVE_STATE[rip]
	call	msg_hash_to_str@PLT
	mov	rdi, rax
	call	strdup@PLT
	mov	r13, rax
	jmp	.L14
.L32:
	mov	edi, DWORD PTR MSG_SAVED_STATE_TO_SLOT_AUTO[rip]
	call	msg_hash_to_str@PLT
	mov	rdi, rax
	call	strdup@PLT
	mov	r13, rax
	jmp	.L14
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	task_save_handler, .-task_save_handler
	.comm	undo_save_buf,4,4
	.comm	SAVE_STATE_CHUNK,4,4
	.comm	RETRO_VFS_FILE_ACCESS_WRITE,4,4
	.comm	RETRO_VFS_FILE_ACCESS_HINT_NONE,4,4
	.comm	MSG_SAVED_STATE_TO_SLOT_AUTO,4,4
	.comm	MSG_SAVED_STATE_TO_SLOT,4,4
	.comm	MSG_RESTORED_OLD_SAVE_STATE,4,4
	.comm	MSG_FAILED_TO_UNDO_SAVE_STATE,4,4
	.comm	MSG_FAILED_TO_SAVE_STATE_TO,4,4
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC0:
	.long	1120403456
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_..taskstask_save.c_task_save_handler.c"
	.text
	.global	__aeabi_i2f
	.global	__aeabi_fdiv
	.global	__aeabi_fmul
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%s \"%s\".\012\000"
	.align	2
.LC1:
	.ascii	"%s \"%s\".\000"
	.align	2
.LC2:
	.ascii	"RAM\000"
	.align	2
.LC3:
	.ascii	"%s %s\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	task_save_handler, %function
task_save_handler:
	@ args = 0, pretend = 0, frame = 8200
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	sub	sp, sp, #8192
	sub	sp, sp, #16
	add	r3, sp, #8192
	ldr	r4, [r0]
	ldr	r2, .L32
	add	r3, r3, #12
	ldr	r2, [r2]
	str	r2, [r3]
	mov	r2,#0
	ldr	r3, [r4, #24]
	mov	r5, r0
	cmp	r3, #0
	beq	.L2
	ldr	r2, [r4, #20]
	ldr	r3, [r4, #4]
	cmp	r2, #0
	beq	.L26
.L4:
	ldr	r2, .L32+4
	ldr	r0, [r4, #8]
	ldr	r1, [r2]
	sub	r0, r3, r0
	bl	MIN
	ldr	r6, [r4, #20]
	mov	r7, r0
	cmp	r6, #0
	bne	.L27
.L7:
	ldr	r3, [r4, #8]
	add	r0, r6, r3
	str	r0, [r4, #8]
	bl	__aeabi_i2f
	mov	r8, r0
	ldr	r0, [r4, #4]
	bl	__aeabi_i2f
	mov	r1, r0
	mov	r0, r8
	bl	__aeabi_fdiv
	ldr	r1, .L32+8
	bl	__aeabi_fmul
	mov	r1, r0
	mov	r0, r5
	bl	task_set_progress
	mov	r0, r5
	bl	task_get_cancelled
	cmp	r0, #0
	cmpeq	r6, r7
	beq	.L8
	mov	r3, #0
	strb	r3, [sp, #12]
	ldr	r3, [r4, #16]
	cmp	r3, #0
	bne	.L28
	ldr	r3, .L32+12
	add	r6, sp, #12
	ldr	r0, [r3]
	bl	msg_hash_to_str
	ldr	r2, [r4]
	mov	r3, r0
	str	r2, [sp]
	mov	r0, r6
	mov	r1, #8192
	ldr	r2, .L32+16
	bl	snprintf
.L10:
	mov	r0, r6
	bl	strdup
	mov	r1, r0
	mov	r0, r5
	bl	task_set_error
	mov	r1, r4
	mov	r0, r5
	bl	task_save_handler_finished
.L1:
	add	r3, sp, #8192
	ldr	r2, .L32
	add	r3, r3, #12
	ldr	r1, [r2]
	ldr	r2, [r3]
	eors	r1, r2, r1
	mov	r2, #0
	bne	.L29
	add	sp, sp, #8192
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L28:
	ldr	r7, .L32+20
	add	r6, sp, #12
	ldr	r0, [r7]
	bl	msg_hash_to_str
	ldr	r3, .L32+24
	mov	r1, r0
	ldr	r2, [r3]
	ldr	r0, .L32+28
	bl	RARCH_ERR
	ldr	r0, [r7]
	bl	msg_hash_to_str
	ldr	r2, .L32+32
	mov	r3, r0
	str	r2, [sp]
	mov	r0, r6
	mov	r1, #8192
	ldr	r2, .L32+36
	bl	snprintf
	b	.L10
.L2:
	ldr	r3, .L32+40
	ldr	r2, .L32+44
	ldr	r1, [r3]
	ldr	r2, [r2]
	ldr	r0, [r4]
	bl	intfstream_open_file
	cmp	r0, #0
	str	r0, [r4, #24]
	beq	.L1
	ldr	r2, [r4, #20]
	ldr	r3, [r4, #4]
	cmp	r2, #0
	bne	.L4
.L26:
	mov	r1, r3
	ldr	r0, [r4]
	bl	get_serialized_data
	ldr	r3, [r4, #4]
	str	r0, [r4, #20]
	b	.L4
.L8:
	ldr	r2, [r4, #8]
	ldr	r3, [r4, #4]
	cmp	r2, r3
	bne	.L1
	mov	r0, r5
	bl	task_free_title
	ldr	r3, [r4, #16]
	cmp	r3, #0
	bne	.L30
	ldr	r2, [r4, #12]
	cmp	r2, #0
	blt	.L31
	ldr	r2, .L32+48
	add	r6, sp, #16
	ldr	r0, [r2]
	strb	r3, [r6, #-4]!
	bl	msg_hash_to_str
	mov	r1, #128
	mov	r2, r0
	ldr	r3, [r4, #12]
	mov	r0, r6
	bl	snprintf
	mov	r0, r6
	bl	strdup
	mov	r6, r0
.L13:
	mov	r0, r5
	bl	task_get_mute
	subs	r3, r0, #0
	bne	.L15
	cmp	r6, #0
	beq	.L15
	mov	r1, r6
	mov	r0, r5
	mov	r6, r3
	bl	task_set_title
.L15:
	mov	r1, r4
	mov	r0, r5
	bl	task_save_handler_finished
	mov	r0, r6
	bl	string_is_empty
	cmp	r0, #0
	bne	.L1
	mov	r0, r6
	bl	free
	b	.L1
.L27:
	ldr	r1, [r4, #8]
	mov	r2, r0
	add	r1, r6, r1, lsl #2
	ldr	r0, [r4, #24]
	bl	intfstream_write
	mov	r6, r0
	b	.L7
.L30:
	ldr	r3, .L32+52
	ldr	r0, [r3]
	bl	msg_hash_to_str
	bl	strdup
	mov	r6, r0
	b	.L13
.L31:
	ldr	r3, .L32+56
	ldr	r0, [r3]
	bl	msg_hash_to_str
	bl	strdup
	mov	r6, r0
	b	.L13
.L29:
	bl	__stack_chk_fail
.L33:
	.align	2
.L32:
	.word	.LC4
	.word	SAVE_STATE_CHUNK
	.word	1120403456
	.word	MSG_FAILED_TO_SAVE_STATE_TO
	.word	.LC3
	.word	MSG_FAILED_TO_UNDO_SAVE_STATE
	.word	undo_save_buf
	.word	.LC0
	.word	.LC2
	.word	.LC1
	.word	RETRO_VFS_FILE_ACCESS_WRITE
	.word	RETRO_VFS_FILE_ACCESS_HINT_NONE
	.word	MSG_SAVED_STATE_TO_SLOT
	.word	MSG_RESTORED_OLD_SAVE_STATE
	.word	MSG_SAVED_STATE_TO_SLOT_AUTO
	.size	task_save_handler, .-task_save_handler
	.comm	undo_save_buf,4,4
	.comm	SAVE_STATE_CHUNK,4,4
	.comm	RETRO_VFS_FILE_ACCESS_WRITE,4,4
	.comm	RETRO_VFS_FILE_ACCESS_HINT_NONE,4,4
	.comm	MSG_SAVED_STATE_TO_SLOT_AUTO,4,4
	.comm	MSG_SAVED_STATE_TO_SLOT,4,4
	.comm	MSG_RESTORED_OLD_SAVE_STATE,4,4
	.comm	MSG_FAILED_TO_UNDO_SAVE_STATE,4,4
	.comm	MSG_FAILED_TO_SAVE_STATE_TO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
