	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function switch_frame
_switch_frame:                          ## @switch_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -56(%rbp)                 ## 4-byte Spill
	movl	%edx, %r8d
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	$0, -72(%rbp)
	movl	$1280, %esi                     ## imm = 0x500
	xorl	%r13d, %r13d
	movl	$1280, %eax                     ## imm = 0x500
	xorl	%edx, %edx
	divl	%r8d
	movl	%eax, %r14d
	movl	$720, %ebx                      ## imm = 0x2D0
	movl	$720, %eax                      ## imm = 0x2D0
	xorl	%edx, %edx
	divl	%ecx
	cmpl	%r14d, %eax
	cmovbl	%eax, %r14d
	movl	%r14d, %r15d
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	imull	%r8d, %r15d
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	imull	%ecx, %r14d
	subl	%r15d, %esi
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	subl	%r14d, %ebx
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r12
	leaq	L_.memset_pattern(%rip), %rbx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r12,%r13), %rdi
	movl	$5120, %edx                     ## imm = 0x1400
	movq	%rbx, %rsi
	callq	_memset_pattern16
	addq	$5120, %r13                     ## imm = 0x1400
	cmpq	$3686400, %r13                  ## imm = 0x384000
	jne	LBB0_1
## %bb.2:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movl	-60(%rbp), %r13d                ## 4-byte Reload
	je	LBB0_13
## %bb.3:
	testl	%r13d, %r13d
	je	LBB0_13
## %bb.4:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, 8(%rbx)
	jne	LBB0_6
## %bb.5:
	cmpl	%r13d, 12(%rbx)
	je	LBB0_12
LBB0_6:
	leaq	96(%rbx), %r12
	movq	%r12, %rdi
	callq	_scaler_ctx_gen_reset
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 96(%rbx)
	movl	%r13d, 100(%rbx)
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 104(%rbx)
	cmpq	$0, 136(%rbx)
	jne	LBB0_7
## %bb.8:
	movq	_SCALER_FMT_RGB565@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_SCALER_FMT_ARGB8888@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movl	%eax, 128(%rbx)
	movl	%r15d, 108(%rbx)
	movl	%r14d, 112(%rbx)
	movl	$5120, 116(%rbx)                ## imm = 0x1400
	movq	_SCALER_FMT_ABGR8888@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 124(%rbx)
	movq	_SCALER_TYPE_POINT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 120(%rbx)
	movq	%r12, %rdi
	callq	_scaler_ctx_gen_filter
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%rbx)
	movl	%r13d, 12(%rbx)
LBB0_12:
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%edx, %ecx
	sarl	%ecx
	leaq	96(%rbx), %rdi
	shll	$8, %ecx
	leal	(%rcx,%rcx,4), %ecx
	movslq	%ecx, %rcx
	shlq	$2, %rcx
	addq	(%rbx), %rcx
	cltq
	leaq	(%rcx,%rax,4), %rsi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	callq	_scaler_ctx_scale
LBB0_13:
	movq	16(%rbp), %r14
	testq	%r14, %r14
	je	LBB0_16
## %bb.14:
	movq	%r14, %rdi
	callq	_strlen
	testq	%rax, %rax
	jle	LBB0_16
## %bb.15:
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	callq	_RARCH_LOG
LBB0_16:
	leaq	16(%rbx), %r15
	leaq	-72(%rbp), %rsi
	movq	%r15, %rdi
	callq	_surface_dequeue_buffer
	movq	_RESULT_OK@GOTPCREL(%rip), %r12
	movl	$1, %r14d
	cmpq	(%r12), %rax
	jne	LBB0_20
## %bb.17:
	movq	%r15, %rdi
	callq	_surface_wait_buffer
	cmpq	(%r12), %rax
	jne	LBB0_20
## %bb.18:
	movq	-72(%rbp), %rdi
	movq	(%rbx), %rsi
	xorl	%r14d, %r14d
	movl	$1280, %edx                     ## imm = 0x500
	movl	$720, %ecx                      ## imm = 0x2D0
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_gfx_slow_swizzling_blit
	movq	%r15, %rdi
	callq	_surface_queue_buffer
	cmpq	(%r12), %rax
	jne	LBB0_20
## %bb.19:
	xorl	%eax, %eax
	callq	_svcGetSystemTick
	movl	$1, %r14d
	jmp	LBB0_20
LBB0_10:
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_ERR
	xorl	%r14d, %r14d
LBB0_20:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to generate scaler for main image\n"

L_.str.1:                               ## @.str.1
	.asciz	"message: %s\n"

	.comm	_RESULT_OK,8,3                  ## @RESULT_OK
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## @.memset_pattern
L_.memset_pattern:
	.long	4278190080                      ## 0xff000000
	.long	4278190080                      ## 0xff000000
	.long	4278190080                      ## 0xff000000
	.long	4278190080                      ## 0xff000000

	.no_dead_strip	_switch_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function switch_frame
_switch_frame:                          ; @switch_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	stp	x6, xzr, [sp, #16]              ; 8-byte Folded Spill
	mov	x22, x3
	mov	x23, x2
	str	x1, [sp]                        ; 8-byte Folded Spill
	mov	x19, x0
	mov	x21, #0
	mov	w8, #1280
	udiv	w9, w8, w2
	mov	w10, #720
	udiv	w11, w10, w3
	cmp	w11, w9
	csel	w9, w11, w9, lo
	mul	w11, w9, w2
	mul	w27, w9, w3
	stp	w11, w5, [sp, #8]               ; 8-byte Folded Spill
	sub	w28, w8, w11
	sub	w24, w10, w27
	ldr	x20, [x0]
Lloh0:
	adrp	x25, l_.memset_pattern@PAGE
Lloh1:
	add	x25, x25, l_.memset_pattern@PAGEOFF
	mov	w26, #5120
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x20, x21
	mov	x1, x25
	mov	w2, #5120
	bl	_memset_pattern16
	add	x21, x21, x26
	cmp	x21, #900, lsl #12              ; =3686400
	b.ne	LBB0_1
; %bb.2:
	cmp	w28, #0
	cinc	w28, w28, lt
	cmp	w24, #0
	cinc	w21, w24, lt
	cbz	w23, LBB0_9
; %bb.3:
	cbz	w22, LBB0_9
; %bb.4:
	ldr	w8, [x19, #8]
	cmp	w8, w23
	b.ne	LBB0_6
; %bb.5:
	ldr	w8, [x19, #12]
	cmp	w8, w22
	b.eq	LBB0_8
LBB0_6:
	add	x25, x19, #96
	mov	x0, x25
	bl	_scaler_ctx_gen_reset
	stp	w23, w22, [x19, #96]
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	str	w8, [x19, #104]
	ldr	x8, [x19, #136]
Lloh2:
	adrp	x9, _SCALER_FMT_ARGB8888@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SCALER_FMT_ARGB8888@GOTPAGEOFF]
Lloh4:
	adrp	x10, _SCALER_FMT_RGB565@GOTPAGE
Lloh5:
	ldr	x10, [x10, _SCALER_FMT_RGB565@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	w8, [x8]
	ldr	w9, [sp, #8]                    ; 4-byte Folded Reload
	stp	w9, w27, [x19, #108]
	mov	w9, #5120
Lloh6:
	adrp	x10, _SCALER_FMT_ABGR8888@GOTPAGE
Lloh7:
	ldr	x10, [x10, _SCALER_FMT_ABGR8888@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	stp	w10, w8, [x19, #124]
Lloh9:
	adrp	x8, _SCALER_TYPE_POINT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SCALER_TYPE_POINT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	stp	w9, w8, [x19, #116]
	mov	x0, x25
	bl	_scaler_ctx_gen_filter
	cbz	w0, LBB0_18
; %bb.7:
	stp	w23, w22, [x19, #8]
LBB0_8:
	asr	w8, w28, #1
	asr	w9, w21, #1
	mov	x0, x19
	ldr	x10, [x0], #96
	add	w9, w9, w9, lsl #2
	lsl	w9, w9, #8
	add	x9, x10, w9, sxtw #2
	add	x1, x9, w8, sxtw #2
	ldr	x2, [sp]                        ; 8-byte Folded Reload
	bl	_scaler_ctx_scale
LBB0_9:
	ldr	x20, [sp, #16]                  ; 8-byte Folded Reload
	cbz	x20, LBB0_12
; %bb.10:
	mov	x0, x20
	bl	_strlen
	cmp	x0, #1
	b.lt	LBB0_12
; %bb.11:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_RARCH_LOG
LBB0_12:
	add	x20, x19, #16
	add	x1, sp, #24
	mov	x0, x20
	bl	_surface_dequeue_buffer
Lloh14:
	adrp	x21, _RESULT_OK@GOTPAGE
Lloh15:
	ldr	x21, [x21, _RESULT_OK@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_16
; %bb.13:
	mov	x0, x20
	bl	_surface_wait_buffer
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_16
; %bb.14:
	ldr	x0, [sp, #24]
	ldr	x1, [x19]
	mov	w2, #1280
	mov	w3, #720
	mov	w4, #0
	mov	w5, #0
	bl	_gfx_slow_swizzling_blit
	mov	x0, x20
	bl	_surface_queue_buffer
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.15:
	bl	_svcGetSystemTick
LBB0_16:
	mov	w0, #1
LBB0_17:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_18:
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_ERR
	mov	w0, #0
	b	LBB0_17
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.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
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to generate scaler for main image\n"

l_.str.1:                               ; @.str.1
	.asciz	"message: %s\n"

	.comm	_RESULT_OK,8,3                  ; @RESULT_OK
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; @.memset_pattern
l_.memset_pattern:
	.long	4278190080                      ; 0xff000000
	.long	4278190080                      ; 0xff000000
	.long	4278190080                      ; 0xff000000
	.long	4278190080                      ; 0xff000000

	.no_dead_strip	_switch_frame
.subsections_via_symbols
