	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function draw_savestate_menu
_draw_savestate_menu:                   ## @draw_savestate_menu
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movl	%edi, %r15d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_state_slot_flags@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	btl	%edi, %eax
	jae	LBB0_2
## %bb.1:
	movl	%r15d, %edi
	callq	_draw_savestate_bg
LBB0_2:
	movq	_me_mfont_w@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rax,%rax,4), %eax
	leal	(%rax,%rax,2), %ecx
	movq	_STATE_SLOT_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	$4, %eax
	movq	_me_mfont_h@GOTPCREL(%rip), %r13
	imull	(%r13), %eax
	movq	_g_menuscreen_w@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, %r14d
	shrl	$31, %r14d
	addl	%edx, %r14d
	sarl	%r14d
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	subl	%edx, %r14d
	xorl	%ecx, %ecx
	testl	%r14d, %r14d
	cmovlel	%ecx, %r14d
	movq	_g_menuscreen_h@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, %r12d
	shrl	$31, %r12d
	addl	%edx, %r12d
	sarl	%r12d
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	subl	%edx, %r12d
	testl	%r12d, %r12d
	cmovlel	%ecx, %r12d
	movl	$1, %edi
	movl	$1, %esi
	callq	_menu_draw_begin
	testl	%ebx, %ebx
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str(%rip), %rdx
	cmoveq	%rax, %rdx
	movl	%r14d, %edi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_text_out16
	movl	(%r13), %eax
	leal	(%rax,%rax,2), %ebx
	addl	%r12d, %ebx
	movq	_me_mfont_w@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%r14d, %edi
	subl	%ecx, %edi
	subl	%ecx, %edi
	imull	%eax, %r15d
	addl	%ebx, %r15d
	leal	(%rcx,%rcx,4), %eax
	leal	(%rax,%rax,4), %edx
	addl	$4, %edx
	movl	%r15d, %esi
	callq	_menu_draw_selection
	movq	_STATE_SLOT_COUNT@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_9
## %bb.3:
	leaq	-80(%rbp), %r12
	leaq	L_.str.5(%rip), %r13
	xorl	%r15d, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	leaq	L_.str.2(%rip), %rsi
	callq	_strcpy
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%r14d, %edi
	movl	%ebx, %esi
	movq	%r13, %rdx
	movl	%r15d, %ecx
	movq	%r12, %r8
	xorl	%eax, %eax
	callq	_text_out16
	incq	%r15
	movq	_me_mfont_h@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	movq	_STATE_SLOT_COUNT@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r15
	jge	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_state_slot_flags@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r12, %rdi
	btl	%r15d, %eax
	jae	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	L_.str.3(%rip), %rsi
	callq	_strcpy
	movq	_state_slot_times@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r15,8), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, -88(%rbp)
	leaq	-88(%rbp), %rdi
	callq	_localtime
	movq	%r12, %rdi
	movl	$32, %esi
	leaq	L_.str.4(%rip), %rdx
	movq	%rax, %rcx
	callq	_strftime
	jmp	LBB0_8
LBB0_9:
	leaq	L_.str.6(%rip), %rdx
	movl	%r14d, %edi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_text_out16
	xorl	%eax, %eax
	callq	_menu_draw_end
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_state_slot_flags,4,2           ## @state_slot_flags
	.comm	_me_mfont_w,4,2                 ## @me_mfont_w
	.comm	_STATE_SLOT_COUNT,4,2           ## @STATE_SLOT_COUNT
	.comm	_me_mfont_h,4,2                 ## @me_mfont_h
	.comm	_g_menuscreen_w,4,2             ## @g_menuscreen_w
	.comm	_g_menuscreen_h,4,2             ## @g_menuscreen_h
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Load state"

L_.str.1:                               ## @.str.1
	.asciz	"Save state"

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

L_.str.3:                               ## @.str.3
	.asciz	"USED"

	.comm	_state_slot_times,8,3           ## @state_slot_times
L_.str.4:                               ## @.str.4
	.asciz	"%x %R"

L_.str.5:                               ## @.str.5
	.asciz	"SLOT %i (%s)"

L_.str.6:                               ## @.str.6
	.asciz	"back"

	.no_dead_strip	_draw_savestate_menu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function draw_savestate_menu
_draw_savestate_menu:                   ; @draw_savestate_menu
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
Lloh3:
	adrp	x25, _state_slot_flags@GOTPAGE
Lloh4:
	ldr	x25, [x25, _state_slot_flags@GOTPAGEOFF]
	ldr	w8, [x25]
	lsr	w8, w8, w0
	tbz	w8, #0, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_draw_savestate_bg
LBB0_2:
Lloh5:
	adrp	x23, _me_mfont_w@GOTPAGE
Lloh6:
	ldr	x23, [x23, _me_mfont_w@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	w9, w8, #4
	sub	w8, w9, w8
Lloh7:
	adrp	x26, _STATE_SLOT_COUNT@GOTPAGE
Lloh8:
	ldr	x26, [x26, _STATE_SLOT_COUNT@GOTPAGEOFF]
	ldr	w9, [x26]
	add	w9, w9, #4
Lloh9:
	adrp	x27, _me_mfont_h@GOTPAGE
Lloh10:
	ldr	x27, [x27, _me_mfont_h@GOTPAGEOFF]
	ldr	w10, [x27]
	mul	w9, w9, w10
Lloh11:
	adrp	x10, _g_menuscreen_w@GOTPAGE
Lloh12:
	ldr	x10, [x10, _g_menuscreen_w@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	cmp	w10, #0
	cinc	w10, w10, lt
	asr	w10, w10, #1
	cmp	w8, #0
	cinc	w8, w8, lt
	sub	w8, w10, w8, asr #1
	cmp	w8, #0
	csel	w19, w8, wzr, gt
Lloh14:
	adrp	x8, _g_menuscreen_h@GOTPAGE
Lloh15:
	ldr	x8, [x8, _g_menuscreen_h@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	cmp	w9, #0
	cinc	w9, w9, lt
	sub	w8, w8, w9, asr #1
	cmp	w8, #0
	csel	w22, w8, wzr, gt
	mov	w0, #1
	mov	w1, #1
	bl	_menu_draw_begin
Lloh17:
	adrp	x8, l_.str@PAGE
Lloh18:
	add	x8, x8, l_.str@PAGEOFF
Lloh19:
	adrp	x9, l_.str.1@PAGE
Lloh20:
	add	x9, x9, l_.str.1@PAGEOFF
	cmp	w20, #0
	csel	x2, x9, x8, eq
	mov	x0, x19
	mov	x1, x22
	bl	_text_out16
	ldr	w8, [x27]
	add	w9, w8, w8, lsl #1
	add	w20, w9, w22
	ldr	w9, [x23]
	sub	w0, w19, w9, lsl #1
	madd	w1, w8, w21, w20
	mov	w8, #25
	orr	w10, wzr, #0x4
	madd	w2, w9, w8, w10
	bl	_menu_draw_selection
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.3:
	mov	x28, #0
	add	x21, sp, #24
Lloh21:
	adrp	x22, l_.str.5@PAGE
Lloh22:
	add	x22, x22, l_.str.5@PAGEOFF
Lloh23:
	adrp	x23, l_.str.3@PAGE
Lloh24:
	add	x23, x23, l_.str.3@PAGEOFF
Lloh25:
	adrp	x24, _state_slot_times@GOTPAGE
Lloh26:
	ldr	x24, [x24, _state_slot_times@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_strcpy
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	stp	x28, x21, [sp]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_text_out16
	add	x28, x28, #1
	ldr	w8, [x27]
	add	w20, w8, w20
	ldrsw	x8, [x26]
	cmp	x28, x8
	b.ge	LBB0_9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	add	x0, sp, #24
	lsr	w8, w8, w28
	tbz	w8, #0, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x1, x23
	bl	_strcpy
	ldr	x8, [x24]
	ldr	x8, [x8, x28, lsl #3]
	cbz	x8, LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	str	x8, [sp, #16]
	add	x0, sp, #16
	bl	_localtime
	mov	x3, x0
	add	x0, sp, #24
	mov	w1, #32
Lloh29:
	adrp	x2, l_.str.4@PAGE
Lloh30:
	add	x2, x2, l_.str.4@PAGEOFF
	bl	_strftime
	b	LBB0_5
LBB0_9:
Lloh31:
	adrp	x2, l_.str.6@PAGE
Lloh32:
	add	x2, x2, l_.str.6@PAGEOFF
	mov	x0, x19
	mov	x1, x20
	bl	_text_out16
	bl	_menu_draw_end
	ldr	x8, [sp, #56]
Lloh33:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh34:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_state_slot_flags,4,2           ; @state_slot_flags
	.comm	_me_mfont_w,4,2                 ; @me_mfont_w
	.comm	_STATE_SLOT_COUNT,4,2           ; @STATE_SLOT_COUNT
	.comm	_me_mfont_h,4,2                 ; @me_mfont_h
	.comm	_g_menuscreen_w,4,2             ; @g_menuscreen_w
	.comm	_g_menuscreen_h,4,2             ; @g_menuscreen_h
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Load state"

l_.str.1:                               ; @.str.1
	.asciz	"Save state"

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

l_.str.3:                               ; @.str.3
	.asciz	"USED"

	.comm	_state_slot_times,8,3           ; @state_slot_times
l_.str.4:                               ; @.str.4
	.asciz	"%x %R"

l_.str.5:                               ; @.str.5
	.asciz	"SLOT %i (%s)"

l_.str.6:                               ; @.str.6
	.asciz	"back"

	.no_dead_strip	_draw_savestate_menu
.subsections_via_symbols
