	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function menu_thumbnail_handle_upload
_menu_thumbnail_handle_upload:          ## @menu_thumbnail_handle_upload
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %rbx
	movq	%rsi, %r14
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.1:
	movq	(%rbx), %rax
	movq	_menu_thumbnail_list_id@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.2:
	movq	16(%rbx), %rdx
	movq	(%rdx), %rax
	movq	_MENU_THUMBNAIL_STATUS_PENDING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.3:
	cmpq	$0, 24(%rdx)
	je	LBB0_5
## %bb.4:
	movq	%rdx, %rdi
	callq	_menu_thumbnail_reset
	movq	16(%rbx), %rdx
LBB0_5:
	movq	_MENU_THUMBNAIL_STATUS_MISSING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	testq	%r14, %r14
	je	LBB0_13
## %bb.6:
	cmpl	$0, 8(%r14)
	jle	LBB0_11
## %bb.7:
	cmpl	$0, 12(%r14)
	jle	LBB0_11
## %bb.8:
	movq	_TEXTURE_FILTER_MIPMAP_LINEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addq	$24, %rdx
	movq	%r14, %rdi
	callq	_video_driver_texture_load
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	movl	8(%r14), %eax
	movq	16(%rbx), %rcx
	movl	%eax, 8(%rcx)
	movl	12(%r14), %eax
	movl	%eax, 12(%rcx)
	movq	_MENU_THUMBNAIL_STATUS_AVAILABLE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movl	$0, 16(%rcx)
	addq	$16, %rcx
	movq	_EASING_OUT_QUAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -20(%rbp)
	movq	%rcx, -64(%rbp)
	movq	_menu_thumbnail_fade_duration@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	movl	$1065353216, -56(%rbp)          ## imm = 0x3F800000
	movq	%rcx, -48(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -40(%rbp)
	leaq	-64(%rbp), %rdi
	callq	_menu_animation_push
	jmp	LBB0_11
LBB0_10:
	testq	%r14, %r14
	je	LBB0_12
LBB0_11:
	movq	%r14, %rdi
	callq	_image_texture_free
	movq	%r14, %rdi
	callq	_free
LBB0_12:
	testq	%rbx, %rbx
	je	LBB0_14
LBB0_13:
	movq	%rbx, %rdi
	callq	_free
LBB0_14:
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_menu_thumbnail_list_id,8,3     ## @menu_thumbnail_list_id
	.comm	_MENU_THUMBNAIL_STATUS_PENDING,8,3 ## @MENU_THUMBNAIL_STATUS_PENDING
	.comm	_MENU_THUMBNAIL_STATUS_MISSING,8,3 ## @MENU_THUMBNAIL_STATUS_MISSING
	.comm	_TEXTURE_FILTER_MIPMAP_LINEAR,4,2 ## @TEXTURE_FILTER_MIPMAP_LINEAR
	.comm	_MENU_THUMBNAIL_STATUS_AVAILABLE,8,3 ## @MENU_THUMBNAIL_STATUS_AVAILABLE
	.comm	_EASING_OUT_QUAD,4,2            ## @EASING_OUT_QUAD
	.comm	_menu_thumbnail_fade_duration,4,2 ## @menu_thumbnail_fade_duration
	.no_dead_strip	_menu_thumbnail_handle_upload
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function menu_thumbnail_handle_upload
_menu_thumbnail_handle_upload:          ; @menu_thumbnail_handle_upload
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x2
	mov	x20, x1
	cbz	x2, LBB0_10
; %bb.1:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _menu_thumbnail_list_id@GOTPAGE
Lloh1:
	ldr	x9, [x9, _menu_thumbnail_list_id@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.2:
	ldr	x0, [x19, #16]
	ldr	x8, [x0]
Lloh3:
	adrp	x9, _MENU_THUMBNAIL_STATUS_PENDING@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MENU_THUMBNAIL_STATUS_PENDING@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.3:
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_5
; %bb.4:
	bl	_menu_thumbnail_reset
	ldr	x0, [x19, #16]
LBB0_5:
Lloh6:
	adrp	x8, _MENU_THUMBNAIL_STATUS_MISSING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MENU_THUMBNAIL_STATUS_MISSING@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	x8, [x0]
	cbz	x20, LBB0_13
; %bb.6:
	ldr	w8, [x20, #8]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.7:
	ldr	w8, [x20, #12]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.8:
Lloh9:
	adrp	x8, _TEXTURE_FILTER_MIPMAP_LINEAR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TEXTURE_FILTER_MIPMAP_LINEAR@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x2, x0, #24
	mov	x0, x20
	bl	_video_driver_texture_load
	cbz	w0, LBB0_11
; %bb.9:
	ldr	x8, [x19, #16]
	ldr	d0, [x20, #8]
	str	d0, [x8, #8]
Lloh12:
	adrp	x9, _MENU_THUMBNAIL_STATUS_AVAILABLE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MENU_THUMBNAIL_STATUS_AVAILABLE@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	str	x9, [x8]
	str	wzr, [x8, #16]!
Lloh15:
	adrp	x9, _EASING_OUT_QUAD@GOTPAGE
Lloh16:
	ldr	x9, [x9, _EASING_OUT_QUAD@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	str	x8, [sp]
Lloh18:
	adrp	x10, _menu_thumbnail_fade_duration@GOTPAGE
Lloh19:
	ldr	x10, [x10, _menu_thumbnail_fade_duration@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	stp	w10, w9, [sp, #40]
	mov	w9, #1065353216
	str	w9, [sp, #8]
	stp	xzr, xzr, [sp, #24]
	str	x8, [sp, #16]
	mov	x0, sp
	bl	_menu_animation_push
	b	LBB0_11
LBB0_10:
	cbz	x20, LBB0_12
LBB0_11:
	mov	x0, x20
	bl	_image_texture_free
	mov	x0, x20
	bl	_free
LBB0_12:
	cbz	x19, LBB0_14
LBB0_13:
	mov	x0, x19
	bl	_free
LBB0_14:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_menu_thumbnail_list_id,8,3     ; @menu_thumbnail_list_id
	.comm	_MENU_THUMBNAIL_STATUS_PENDING,8,3 ; @MENU_THUMBNAIL_STATUS_PENDING
	.comm	_MENU_THUMBNAIL_STATUS_MISSING,8,3 ; @MENU_THUMBNAIL_STATUS_MISSING
	.comm	_TEXTURE_FILTER_MIPMAP_LINEAR,4,2 ; @TEXTURE_FILTER_MIPMAP_LINEAR
	.comm	_MENU_THUMBNAIL_STATUS_AVAILABLE,8,3 ; @MENU_THUMBNAIL_STATUS_AVAILABLE
	.comm	_EASING_OUT_QUAD,4,2            ; @EASING_OUT_QUAD
	.comm	_menu_thumbnail_fade_duration,4,2 ; @menu_thumbnail_fade_duration
	.no_dead_strip	_menu_thumbnail_handle_upload
.subsections_via_symbols
