	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function rgui_set_texture
LCPI0_0:
	.long	0x3f800000                      ## float 1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_rgui_set_texture:                      ## @rgui_set_texture
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	_config_get_ptr
	movq	%rax, %r15
	xorl	%eax, %eax
	callq	_menu_display_get_framebuffer_dirty_flag
	testl	%eax, %eax
	je	LBB0_30
## %bb.1:
	leaq	-44(%rbp), %rdi
	leaq	-48(%rbp), %rsi
	leaq	-80(%rbp), %rdx
	callq	_menu_display_get_fb_size
	xorl	%eax, %eax
	callq	_menu_display_unset_framebuffer_dirty_flag
	movl	(%r15), %eax
	movq	_RGUI_UPSCALE_NONE@GOTPCREL(%rip), %r13
	cmpl	(%r13), %eax
	jne	LBB0_3
LBB0_2:
	movq	_rgui_frame_buf@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	-44(%rbp), %edx
	movl	-48(%rbp), %ecx
	movss	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	xorl	%esi, %esi
	jmp	LBB0_29
LBB0_3:
	leaq	-56(%rbp), %rdi
	callq	_video_driver_get_viewport_info
	movl	-56(%rbp), %eax
	movl	-44(%rbp), %r8d
	cmpl	%r8d, %eax
	ja	LBB0_6
## %bb.4:
	movl	-48(%rbp), %ecx
	cmpl	%ecx, -52(%rbp)
	jbe	LBB0_5
LBB0_6:
	movl	(%r15), %r12d
	movq	_RGUI_UPSCALE_AUTO@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r12d
	jne	LBB0_8
## %bb.7:
	xorl	%edx, %edx
	divl	%r8d
	movl	%eax, %r12d
	incl	%r12d
	movl	-52(%rbp), %eax
	movl	-48(%rbp), %r9d
	xorl	%edx, %edx
	divl	%r9d
	movl	%eax, %r14d
	incl	%r14d
	imull	%r9d, %r14d
	jmp	LBB0_9
LBB0_8:
	movl	-48(%rbp), %r9d
	movl	%r9d, %r14d
	imull	%r12d, %r14d
LBB0_9:
	imull	%r8d, %r12d
	movq	_rgui_upscale_buf@GOTPCREL(%rip), %rbx
	cmpl	%r12d, (%rbx)
	jne	LBB0_12
## %bb.10:
	movq	8(%rbx), %rdi
	cmpl	%r14d, 4(%rbx)
	jne	LBB0_13
## %bb.11:
	testq	%rdi, %rdi
	jne	LBB0_17
	jmp	LBB0_13
LBB0_12:
	movq	8(%rbx), %rdi
LBB0_13:
	movl	%r12d, (%rbx)
	movl	%r14d, 4(%rbx)
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:
	callq	_free
	movq	$0, 8(%rbx)
LBB0_15:
	movl	%r12d, %edi
	imull	%r14d, %edi
	movl	$4, %esi
	callq	_calloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_31
## %bb.16:
	movq	%rax, %rdi
	movl	-44(%rbp), %r8d
	movl	-48(%rbp), %r9d
LBB0_17:
	shll	$16, %r8d
	xorl	%r10d, %r10d
	movl	%r8d, %eax
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, %r15d
	shll	$16, %r9d
	movl	%r9d, %eax
	xorl	%edx, %edx
	divl	%r14d
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	testl	%r14d, %r14d
	je	LBB0_28
## %bb.18:
	movq	_rgui_frame_buf@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r13
	movl	%r12d, %r11d
	movq	%r11, -72(%rbp)                 ## 8-byte Spill
                                        ## kill: def $r11d killed $r11d killed $r11 def $r11
	andl	$-2, %r11d
	movl	$1, %r9d
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_19 Depth=1
	incl	%r10d
	addl	%r12d, %r9d
	cmpl	%r14d, %r10d
	je	LBB0_27
LBB0_19:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_23 Depth 2
	testl	%r12d, %r12d
	je	LBB0_26
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	%r10d, %esi
	imull	-60(%rbp), %esi                 ## 4-byte Folded Reload
	shrl	$16, %esi
	cmpl	$1, %r12d
	jne	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=1
	xorl	%ebx, %ebx
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_19 Depth=1
	movl	%r9d, %ecx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_23:                                ##   Parent Loop BB0_19 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r15d, %edx
	imull	%ebx, %edx
	shrl	$16, %edx
	movl	-44(%rbp), %r8d
	imull	%esi, %r8d
	addl	%edx, %r8d
	movl	(%r13,%r8,4), %edx
	leal	-1(%rcx), %eax
	movl	%edx, (%rdi,%rax,4)
	movl	%ebx, %eax
	orl	$1, %eax
	imull	%r15d, %eax
	shrl	$16, %eax
	movl	-44(%rbp), %edx
	imull	%esi, %edx
	addl	%eax, %edx
	movl	(%r13,%rdx,4), %eax
	movl	%ecx, %edx
	movl	%eax, (%rdi,%rdx,4)
	addq	$2, %rbx
	addl	$2, %ecx
	cmpq	%rbx, %r11
	jne	LBB0_23
LBB0_24:                                ##   in Loop: Header=BB0_19 Depth=1
	testb	$1, -72(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	%r10d, %eax
	imull	%r12d, %eax
	movl	%r15d, %ecx
	imull	%ebx, %ecx
	shrl	$16, %ecx
	imull	-44(%rbp), %esi
	addl	%ecx, %esi
	movl	(%r13,%rsi,4), %ecx
	addl	%ebx, %eax
	movl	%ecx, (%rdi,%rax,4)
	jmp	LBB0_26
LBB0_27:
	movq	_rgui_upscale_buf@GOTPCREL(%rip), %rax
	movq	8(%rax), %rdi
LBB0_28:
	movss	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	xorl	%esi, %esi
	movl	%r12d, %edx
	movl	%r14d, %ecx
	jmp	LBB0_29
LBB0_5:
	movq	_rgui_frame_buf@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movss	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	xorl	%esi, %esi
	movl	%r8d, %edx
LBB0_29:
	callq	_video_driver_set_texture_frame
LBB0_30:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_31:
	movl	(%r13), %eax
	movl	%eax, (%r15)
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_RGUI_UPSCALE_NONE,4,2          ## @RGUI_UPSCALE_NONE
	.comm	_rgui_frame_buf,8,3             ## @rgui_frame_buf
	.comm	_RGUI_UPSCALE_AUTO,4,2          ## @RGUI_UPSCALE_AUTO
	.comm	_rgui_upscale_buf,16,3          ## @rgui_upscale_buf
	.no_dead_strip	_rgui_set_texture
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rgui_set_texture
_rgui_set_texture:                      ; @rgui_set_texture
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	bl	_config_get_ptr
	mov	x21, x0
	bl	_menu_display_get_framebuffer_dirty_flag
	cbz	w0, LBB0_26
; %bb.1:
	add	x0, sp, #20
	add	x1, sp, #16
	add	x2, sp, #24
	bl	_menu_display_get_fb_size
	bl	_menu_display_unset_framebuffer_dirty_flag
	ldr	w8, [x21]
Lloh0:
	adrp	x23, _RGUI_UPSCALE_NONE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _RGUI_UPSCALE_NONE@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_4
LBB0_2:
Lloh2:
	adrp	x8, _rgui_frame_buf@GOTPAGE
Lloh3:
	ldr	x8, [x8, _rgui_frame_buf@GOTPAGEOFF]
Lloh4:
	ldr	x0, [x8]
	ldp	w3, w2, [sp, #16]
LBB0_3:
	fmov	s0, #1.00000000
	mov	w1, #0
	b	LBB0_25
LBB0_4:
	add	x0, sp, #8
	bl	_video_driver_get_viewport_info
	ldr	w9, [sp, #8]
	ldr	w2, [sp, #20]
	cmp	w9, w2
	b.hi	LBB0_6
; %bb.5:
	ldp	w8, w3, [sp, #12]
	cmp	w8, w3
	b.ls	LBB0_27
LBB0_6:
	ldr	w8, [x21]
Lloh5:
	adrp	x10, _RGUI_UPSCALE_AUTO@GOTPAGE
Lloh6:
	ldr	x10, [x10, _RGUI_UPSCALE_AUTO@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	cmp	w8, w10
	b.ne	LBB0_8
; %bb.7:
	udiv	w8, w9, w2
	add	w8, w8, #1
	ldp	w9, w11, [sp, #12]
	udiv	w9, w9, w11
	madd	w19, w11, w9, w11
	b	LBB0_9
LBB0_8:
	ldr	w11, [sp, #16]
	mul	w19, w11, w8
LBB0_9:
	mul	w20, w8, w2
Lloh8:
	adrp	x22, _rgui_upscale_buf@GOTPAGE
Lloh9:
	ldr	x22, [x22, _rgui_upscale_buf@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, w20
	b.ne	LBB0_12
; %bb.10:
	ldr	w8, [x22, #4]
	ldr	x0, [x22, #8]
	cmp	w8, w19
	b.ne	LBB0_13
; %bb.11:
	cbnz	x0, LBB0_17
	b	LBB0_13
LBB0_12:
	ldr	x0, [x22, #8]
LBB0_13:
	stp	w20, w19, [x22]
	cbz	x0, LBB0_15
; %bb.14:
	bl	_free
	str	xzr, [x22, #8]
LBB0_15:
	mul	w0, w20, w19
	mov	w1, #4
	bl	_calloc
	str	x0, [x22, #8]
	cbz	x0, LBB0_28
; %bb.16:
	ldp	w11, w2, [sp, #16]
LBB0_17:
	cbz	w19, LBB0_24
; %bb.18:
	mov	w8, #0
	mov	w9, #0
	lsl	w10, w2, #16
	udiv	w10, w10, w20
	lsl	w12, w11, #16
Lloh10:
	adrp	x11, _rgui_frame_buf@GOTPAGE
Lloh11:
	ldr	x11, [x11, _rgui_frame_buf@GOTPAGEOFF]
Lloh12:
	ldr	x11, [x11]
	udiv	w12, w12, w19
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_20 Depth=1
	add	w9, w9, #1
	add	w8, w8, w20
	cmp	w9, w19
	b.eq	LBB0_23
LBB0_20:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_22 Depth 2
	cbz	w20, LBB0_19
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	mov	x13, #0
	mul	w14, w9, w12
	lsr	w14, w14, #16
	mov	x15, x20
	mov	x16, x8
LBB0_22:                                ;   Parent Loop BB0_20 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mul	w17, w10, w13
	ldr	w1, [sp, #20]
	mul	w1, w1, w14
	add	w17, w1, w17, lsr #16
	ldr	w17, [x11, w17, uxtw #2]
	str	w17, [x0, w16, uxtw #2]
	add	x13, x13, #1
	add	w16, w16, #1
	subs	x15, x15, #1
	b.ne	LBB0_22
	b	LBB0_19
LBB0_23:
	ldr	x0, [x22, #8]
LBB0_24:
	fmov	s0, #1.00000000
	mov	w1, #0
	mov	x2, x20
	mov	x3, x19
LBB0_25:
	bl	_video_driver_set_texture_frame
LBB0_26:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_27:
Lloh13:
	adrp	x8, _rgui_frame_buf@GOTPAGE
Lloh14:
	ldr	x8, [x8, _rgui_frame_buf@GOTPAGEOFF]
Lloh15:
	ldr	x0, [x8]
	b	LBB0_3
LBB0_28:
	ldr	w8, [x23]
	str	w8, [x21]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_RGUI_UPSCALE_NONE,4,2          ; @RGUI_UPSCALE_NONE
	.comm	_rgui_frame_buf,8,3             ; @rgui_frame_buf
	.comm	_RGUI_UPSCALE_AUTO,4,2          ; @RGUI_UPSCALE_AUTO
	.comm	_rgui_upscale_buf,16,3          ; @rgui_upscale_buf
	.no_dead_strip	_rgui_set_texture
.subsections_via_symbols
