	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function switch_set_texture_frame
_switch_set_texture_frame:              ## @switch_set_texture_frame
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r12d
	movl	%ecx, %r13d
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	16(%rdi), %rdi
	testq	%rdi, %rdi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_5
## %bb.1:
	cmpl	%r13d, (%rbx)
	jne	LBB0_4
## %bb.2:
	cmpl	%r12d, 4(%rbx)
	jne	LBB0_4
## %bb.3:
	imull	%r13d, %r12d
	movl	%r12d, %r15d
	jmp	LBB0_13
LBB0_4:
	callq	_free
LBB0_5:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	testl	%r15d, %r15d
	setne	%al
	leal	(%rax,%rax), %r14d
	addl	$2, %r14d
	movl	%r12d, %r15d
	imull	%r13d, %r15d
	movl	%r15d, %edi
	imull	%r14d, %edi
	callq	_malloc
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_6
## %bb.8:
	movl	$1280, %eax                     ## imm = 0x500
	xorl	%edx, %edx
	divl	%r13d
	movl	%eax, %ecx
	movl	$720, %eax                      ## imm = 0x2D0
	xorl	%edx, %edx
	divl	%r12d
	cmpl	%ecx, %eax
	cmovbl	%eax, %ecx
	movl	%r13d, (%rbx)
	movl	%r12d, 4(%rbx)
	movl	%ecx, %eax
	imull	%r13d, %eax
	movl	%eax, 8(%rbx)
	imull	%r12d, %ecx
	movl	%ecx, 12(%rbx)
	leaq	24(%rbx), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_scaler_ctx_gen_reset
	imull	%r13d, %r14d
	movl	%r13d, 24(%rbx)
	movl	%r12d, 28(%rbx)
	movl	%r14d, 32(%rbx)
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_9
## %bb.10:
	movq	_SCALER_FMT_RGB565@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_6:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_7
LBB0_9:
	movq	_SCALER_FMT_ARGB8888@GOTPCREL(%rip), %rax
LBB0_11:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, 56(%rbx)
	movq	8(%rbx), %rax
	movq	%rax, 36(%rbx)
	movl	$5120, 44(%rbx)                 ## imm = 0x1400
	movq	_SCALER_FMT_ABGR8888@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%rbx)
	movq	_SCALER_TYPE_POINT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_scaler_ctx_gen_filter
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:
	movq	16(%rbx), %rdi
LBB0_13:
	xorl	%eax, %eax
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	setne	%al
	leal	(%rax,%rax), %edx
	addl	$2, %edx
	imull	%r15d, %edx
	movq	%r14, %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memcpy                         ## TAILCALL
LBB0_14:
	leaq	L_.str.1(%rip), %rdi
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_RARCH_ERR                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate buffer for menu texture\n"

	.comm	_SCALER_FMT_ARGB8888,4,2        ## @SCALER_FMT_ARGB8888
	.comm	_SCALER_FMT_RGB565,4,2          ## @SCALER_FMT_RGB565
	.comm	_SCALER_FMT_ABGR8888,4,2        ## @SCALER_FMT_ABGR8888
	.comm	_SCALER_TYPE_POINT,4,2          ## @SCALER_TYPE_POINT
L_.str.1:                               ## @.str.1
	.asciz	"failed to generate scaler for menu texture\n"

	.no_dead_strip	_switch_set_texture_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function switch_set_texture_frame
_switch_set_texture_frame:              ; @switch_set_texture_frame
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x23, x4
	mov	x22, x3
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	ldr	x0, [x0, #16]
	cbz	x0, LBB0_5
; %bb.1:
	ldr	w8, [x21]
	cmp	w8, w22
	b.ne	LBB0_4
; %bb.2:
	ldr	w8, [x21, #4]
	cmp	w8, w23
	b.ne	LBB0_4
; %bb.3:
	mul	w25, w23, w22
	b	LBB0_8
LBB0_4:
	bl	_free
LBB0_5:
	mov	w8, #4
	mov	w9, #2
	cmp	w20, #0
	csel	w26, w9, w8, eq
	mul	w25, w23, w22
	mul	w0, w25, w26
	bl	_malloc
	str	x0, [x21, #16]
	cbz	x0, LBB0_9
; %bb.6:
	mov	w8, #1280
	udiv	w8, w8, w22
	mov	w9, #720
	udiv	w9, w9, w23
	cmp	w9, w8
	csel	w8, w9, w8, lo
	stp	w22, w23, [x21]
	mul	w9, w8, w22
	mul	w8, w8, w23
	stp	w9, w8, [x21, #8]
	add	x24, x21, #24
	mov	x0, x24
	bl	_scaler_ctx_gen_reset
	stp	w22, w23, [x21, #24]
	mul	w8, w26, w22
	str	w8, [x21, #32]
Lloh0:
	adrp	x8, _SCALER_FMT_ARGB8888@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SCALER_FMT_ARGB8888@GOTPAGEOFF]
Lloh2:
	adrp	x9, _SCALER_FMT_RGB565@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SCALER_FMT_RGB565@GOTPAGEOFF]
	cmp	w20, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	ldr	d0, [x21, #8]
	stur	d0, [x21, #36]
	mov	w9, #5120
Lloh4:
	adrp	x10, _SCALER_FMT_ABGR8888@GOTPAGE
Lloh5:
	ldr	x10, [x10, _SCALER_FMT_ABGR8888@GOTPAGEOFF]
Lloh6:
	ldr	w10, [x10]
	stp	w10, w8, [x21, #52]
Lloh7:
	adrp	x8, _SCALER_TYPE_POINT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SCALER_TYPE_POINT@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	stp	w9, w8, [x21, #44]
	mov	x0, x24
	bl	_scaler_ctx_gen_filter
	cbz	w0, LBB0_10
; %bb.7:
	ldr	x0, [x21, #16]
LBB0_8:
	mov	w8, #4
	mov	w9, #2
	cmp	w20, #0
	csel	w8, w9, w8, eq
	mul	w2, w25, w8
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_memcpy
LBB0_9:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_11:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_RARCH_ERR
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate buffer for menu texture\n"

	.comm	_SCALER_FMT_ARGB8888,4,2        ; @SCALER_FMT_ARGB8888
	.comm	_SCALER_FMT_RGB565,4,2          ; @SCALER_FMT_RGB565
	.comm	_SCALER_FMT_ABGR8888,4,2        ; @SCALER_FMT_ABGR8888
	.comm	_SCALER_TYPE_POINT,4,2          ; @SCALER_TYPE_POINT
l_.str.1:                               ; @.str.1
	.asciz	"failed to generate scaler for menu texture\n"

	.no_dead_strip	_switch_set_texture_frame
.subsections_via_symbols
