	.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_aspect_ratio
LCPI0_0:
	.long	0x43a00000                      ## float 320
LCPI0_2:
	.long	0x3f000000                      ## float 0.5
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3
LCPI0_1:
	.quad	0x3fe0000000000000              ## double 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_rgui_set_aspect_ratio:                 ## @rgui_set_aspect_ratio
	.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	%esi, %r15d
	movq	%rdi, %r13
	xorl	%eax, %eax
	callq	_config_get_ptr
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_rgui_framebuffer_free
	xorl	%eax, %eax
	callq	_rgui_background_free
	movq	_fs_thumbnail@GOTPCREL(%rip), %rdi
	callq	_rgui_thumbnail_free
	movq	_mini_thumbnail@GOTPCREL(%rip), %rdi
	callq	_rgui_thumbnail_free
	movq	_mini_left_thumbnail@GOTPCREL(%rip), %rdi
	callq	_rgui_thumbnail_free
	movl	8(%rbx), %eax
	movl	%eax, 20(%r13)
	movq	_rgui_frame_buf@GOTPCREL(%rip), %r14
	movl	$240, (%r14)
	addl	$-128, %eax
	cmpl	$3, %eax
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	ja	LBB0_1
## %bb.2:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movslq	%eax, %rcx
	leaq	L_switch.table.rgui_set_aspect_ratio(%rip), %rax
	movl	(%rax,%rcx,4), %eax
	leaq	L_switch.table.rgui_set_aspect_ratio.1(%rip), %rdx
	movl	(%rdx,%rcx,4), %edi
	leaq	L_switch.table.rgui_set_aspect_ratio.2(%rip), %rdx
	movl	(%rdx,%rcx,4), %r12d
	jmp	LBB0_3
LBB0_1:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$76800, %edi                    ## imm = 0x12C00
	movl	$320, %eax                      ## imm = 0x140
	movl	$320, %r12d                     ## imm = 0x140
LBB0_3:
	movl	%eax, 4(%r14)
	movl	$4, %esi
	callq	_calloc
	movq	%rax, 8(%r14)
	testq	%rax, %rax
	je	LBB0_10
## %bb.4:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movl	4(%r14), %edi
	callq	_menu_display_set_width
	movl	(%r14), %edi
	callq	_menu_display_set_height
	movl	4(%r14), %edi
	shll	$2, %edi
	callq	_menu_display_set_framebuffer_pitch
	movq	_FONT_HEIGHT_STRIDE@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leal	-32(%r12), %eax
	movq	_FONT_WIDTH_STRIDE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	xorl	%edx, %edx
	divl	%r8d
	movl	%eax, %ecx
	movq	_rgui_term_layout@GOTPCREL(%rip), %r15
	movl	%eax, 8(%r15)
	leal	(%rsi,%rsi), %eax
	movl	(%r14), %ebx
	movl	4(%r14), %edi
	negl	%eax
	addl	%ebx, %eax
	addl	$-30, %eax
	xorl	%edx, %edx
	divl	%esi
	movq	_RGUI_ENTRY_VALUE_MAXLEN@GOTPCREL(%rip), %rdx
	cvtsi2ssq	(%rdx), %xmm0
	movl	%r12d, %edx
	cvtsi2ss	%rdx, %xmm1
	mulss	%xmm0, %xmm1
	divss	LCPI0_0(%rip), %xmm1
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm0
	addsd	LCPI0_1(%rip), %xmm0
	movl	%eax, 12(%r15)
	cvttsd2si	%xmm0, %rdx
	movl	%edx, 16(%r15)
	imull	%r8d, %ecx
	movl	%edi, %edx
	subl	%ecx, %edx
	shrl	%edx
	movl	%edx, (%r15)
	imull	%esi, %eax
	movq	_rgui_background_buf@GOTPCREL(%rip), %r12
	movl	%edi, (%r12)
	movl	%ebx, 4(%r12)
	imull	%ebx, %edi
	movl	%ebx, %ecx
	subl	%eax, %ecx
	shrl	%ecx
	movl	%ecx, 4(%r15)
	movl	$4, %esi
	callq	_calloc
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:
	movl	(%r14), %edi
	movl	4(%r14), %eax
	movq	_fs_thumbnail@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	movl	%edi, 4(%rbx)
	imull	%eax, %edi
	movl	$4, %esi
	callq	_calloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_10
## %bb.6:
	movl	8(%r15), %eax
	addl	$-4, %eax
	cmpl	$19, %eax
	movl	$19, %ecx
	cmovbl	%eax, %ecx
	movq	_FONT_WIDTH_STRIDE@GOTPCREL(%rip), %rax
	imull	(%rax), %ecx
	movl	(%r13), %eax
	imull	12(%r15), %eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movq	_mini_thumbnail_max_width@GOTPCREL(%rip), %r14
	movq	%rcx, (%r14)
	mulss	LCPI0_2(%rip), %xmm0
	cvttss2si	%xmm0, %rdi
	addl	$-2, %edi
	movq	_mini_thumbnail_max_height@GOTPCREL(%rip), %r15
	movq	%rdi, (%r15)
	movq	_mini_thumbnail@GOTPCREL(%rip), %rbx
	movl	%ecx, (%rbx)
	movl	%edi, 4(%rbx)
	imull	%ecx, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$4, %esi
	callq	_calloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:
	movl	(%r14), %eax
	movq	_mini_left_thumbnail@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	movl	(%r15), %edi
	movl	%edi, 4(%rbx)
	imull	%eax, %edi
	movl	$4, %esi
	callq	_calloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_10
## %bb.8:
	movq	(%rbx), %rax
	movb	$0, (%rax)
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 8(%rbx)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_RGUI_ASPECT_RATIO_LOCK_NONE@GOTPCREL(%rip), %rcx
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	cmpq	(%rcx), %rax
	je	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	callq	_rgui_update_menu_viewport
	leaq	16(%rbx), %rsi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_rgui_set_video_config
LBB0_10:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fs_thumbnail,16,3              ## @fs_thumbnail
	.comm	_mini_thumbnail,16,3            ## @mini_thumbnail
	.comm	_mini_left_thumbnail,16,3       ## @mini_left_thumbnail
	.comm	_rgui_frame_buf,16,3            ## @rgui_frame_buf
	.comm	_rgui_term_layout,20,2          ## @rgui_term_layout
	.comm	_FONT_HEIGHT_STRIDE,4,2         ## @FONT_HEIGHT_STRIDE
	.comm	_FONT_WIDTH_STRIDE,4,2          ## @FONT_WIDTH_STRIDE
	.comm	_RGUI_ENTRY_VALUE_MAXLEN,8,3    ## @RGUI_ENTRY_VALUE_MAXLEN
	.comm	_rgui_background_buf,16,3       ## @rgui_background_buf
	.comm	_mini_thumbnail_max_width,8,3   ## @mini_thumbnail_max_width
	.comm	_mini_thumbnail_max_height,8,3  ## @mini_thumbnail_max_height
	.comm	_RGUI_ASPECT_RATIO_LOCK_NONE,8,3 ## @RGUI_ASPECT_RATIO_LOCK_NONE
	.no_dead_strip	_rgui_set_aspect_ratio
	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ## @switch.table.rgui_set_aspect_ratio
L_switch.table.rgui_set_aspect_ratio:
	.long	426                             ## 0x1aa
	.long	426                             ## 0x1aa
	.long	384                             ## 0x180
	.long	384                             ## 0x180

	.p2align	2                               ## @switch.table.rgui_set_aspect_ratio.1
L_switch.table.rgui_set_aspect_ratio.1:
	.long	102240                          ## 0x18f60
	.long	102240                          ## 0x18f60
	.long	92160                           ## 0x16800
	.long	92160                           ## 0x16800

	.p2align	2                               ## @switch.table.rgui_set_aspect_ratio.2
L_switch.table.rgui_set_aspect_ratio.2:
	.long	320                             ## 0x140
	.long	426                             ## 0x1aa
	.long	320                             ## 0x140
	.long	384                             ## 0x180

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rgui_set_aspect_ratio
_rgui_set_aspect_ratio:                 ; @rgui_set_aspect_ratio
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x1
	mov	x20, x0
	bl	_config_get_ptr
	mov	x21, x0
	bl	_rgui_framebuffer_free
	bl	_rgui_background_free
Lloh0:
	adrp	x24, _fs_thumbnail@GOTPAGE
Lloh1:
	ldr	x24, [x24, _fs_thumbnail@GOTPAGEOFF]
	mov	x0, x24
	bl	_rgui_thumbnail_free
Lloh2:
	adrp	x23, _mini_thumbnail@GOTPAGE
Lloh3:
	ldr	x23, [x23, _mini_thumbnail@GOTPAGEOFF]
	mov	x0, x23
	bl	_rgui_thumbnail_free
Lloh4:
	adrp	x22, _mini_left_thumbnail@GOTPAGE
Lloh5:
	ldr	x22, [x22, _mini_left_thumbnail@GOTPAGEOFF]
	mov	x0, x22
	bl	_rgui_thumbnail_free
	ldr	w8, [x21, #8]
	str	w8, [x20, #20]
Lloh6:
	adrp	x25, _rgui_frame_buf@GOTPAGE
Lloh7:
	ldr	x25, [x25, _rgui_frame_buf@GOTPAGEOFF]
	mov	w9, #240
	str	w9, [x25]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hi	LBB0_2
; %bb.1:
	sbfiz	x9, x8, #2, #32
Lloh8:
	adrp	x8, l_switch.table.rgui_set_aspect_ratio@PAGE
Lloh9:
	add	x8, x8, l_switch.table.rgui_set_aspect_ratio@PAGEOFF
	ldr	w8, [x8, x9]
Lloh10:
	adrp	x10, l_switch.table.rgui_set_aspect_ratio.1@PAGE
Lloh11:
	add	x10, x10, l_switch.table.rgui_set_aspect_ratio.1@PAGEOFF
	ldr	w0, [x10, x9]
Lloh12:
	adrp	x10, l_switch.table.rgui_set_aspect_ratio.2@PAGE
Lloh13:
	add	x10, x10, l_switch.table.rgui_set_aspect_ratio.2@PAGEOFF
	ldr	w28, [x10, x9]
	b	LBB0_3
LBB0_2:
	mov	w0, #11264
	movk	w0, #1, lsl #16
	mov	w8, #320
	mov	w28, #320
LBB0_3:
	str	w8, [x25, #4]
	mov	w1, #4
	bl	_calloc
	str	x0, [x25, #8]
	cbz	x0, LBB0_11
; %bb.4:
	str	w19, [sp, #12]                  ; 4-byte Folded Spill
	ldr	w0, [x25, #4]
	bl	_menu_display_set_width
	ldr	w0, [x25]
	bl	_menu_display_set_height
	ldr	w8, [x25, #4]
	lsl	w0, w8, #2
	bl	_menu_display_set_framebuffer_pitch
Lloh14:
	adrp	x26, _FONT_HEIGHT_STRIDE@GOTPAGE
Lloh15:
	ldr	x26, [x26, _FONT_HEIGHT_STRIDE@GOTPAGEOFF]
	ldr	w8, [x26]
	sub	w9, w28, #32
Lloh16:
	adrp	x27, _FONT_WIDTH_STRIDE@GOTPAGE
Lloh17:
	ldr	x27, [x27, _FONT_WIDTH_STRIDE@GOTPAGEOFF]
	ldr	w10, [x27]
Lloh18:
	adrp	x19, _rgui_term_layout@GOTPAGE
Lloh19:
	ldr	x19, [x19, _rgui_term_layout@GOTPAGEOFF]
	udiv	w9, w9, w10
Lloh20:
	adrp	x11, _RGUI_ENTRY_VALUE_MAXLEN@GOTPAGE
Lloh21:
	ldr	x11, [x11, _RGUI_ENTRY_VALUE_MAXLEN@GOTPAGEOFF]
Lloh22:
	ldr	x11, [x11]
	scvtf	s0, x11
	ldp	w11, w12, [x25]
	sub	w13, w11, w8, lsl #1
	sub	w13, w13, #30
	udiv	w13, w13, w8
	stp	w9, w13, [x19, #8]
	ucvtf	s1, w28
	fmul	s0, s1, s0
	mov	w14, #1134559232
	fmov	s1, w14
	fdiv	s0, s0, s1
	fcvt	d0, s0
	fmov	d1, #0.50000000
	fadd	d0, d0, d1
	fcvtzu	w14, d0
	str	w14, [x19, #16]
	msub	w9, w9, w10, w12
	lsr	w9, w9, #1
	msub	w8, w13, w8, w11
	lsr	w8, w8, #1
	stp	w9, w8, [x19]
Lloh23:
	adrp	x28, _rgui_background_buf@GOTPAGE
Lloh24:
	ldr	x28, [x28, _rgui_background_buf@GOTPAGEOFF]
	stp	w12, w11, [x28]
	mul	w0, w12, w11
	mov	w1, #4
	bl	_calloc
	str	x0, [x28, #8]
	cbz	x0, LBB0_11
; %bb.5:
	ldp	w9, w8, [x25]
	stp	w8, w9, [x24]
	mul	w0, w9, w8
	mov	w1, #4
	bl	_calloc
	str	x0, [x24, #8]
	cbz	x0, LBB0_11
; %bb.6:
	ldp	w8, w9, [x19, #8]
	sub	w8, w8, #4
	mov	w10, #19
	cmp	w8, #19
	csel	w8, w8, w10, lo
	ldr	w10, [x27]
	mul	w8, w8, w10
Lloh25:
	adrp	x19, _mini_thumbnail_max_width@GOTPAGE
Lloh26:
	ldr	x19, [x19, _mini_thumbnail_max_width@GOTPAGEOFF]
	ldr	w10, [x26]
	mul	w9, w10, w9
	scvtf	s0, w9
	str	x8, [x19]
	fmov	s1, #0.50000000
	fmul	s0, s0, s1
	fcvtzu	w9, s0
	sub	w9, w9, #2
Lloh27:
	adrp	x24, _mini_thumbnail_max_height@GOTPAGE
Lloh28:
	ldr	x24, [x24, _mini_thumbnail_max_height@GOTPAGEOFF]
	str	x9, [x24]
	stp	w8, w9, [x23]
	mul	w0, w9, w8
	mov	w1, #4
	bl	_calloc
	str	x0, [x23, #8]
	cbz	x0, LBB0_11
; %bb.7:
	ldr	w8, [x19]
	ldr	w9, [x24]
	stp	w8, w9, [x22]
	mul	w0, w9, w8
	mov	w1, #4
	bl	_calloc
	str	x0, [x22, #8]
	cbz	x0, LBB0_11
; %bb.8:
	ldr	x8, [x20]
	strb	wzr, [x8]
	movi.2s	v0, #1
	str	d0, [x20, #8]
	ldr	x8, [x21]
Lloh29:
	adrp	x9, _RGUI_ASPECT_RATIO_LOCK_NONE@GOTPAGE
Lloh30:
	ldr	x9, [x9, _RGUI_ASPECT_RATIO_LOCK_NONE@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x20
	bl	_rgui_update_menu_viewport
	add	x1, x20, #16
	mov	x0, x20
	ldr	w2, [sp, #12]                   ; 4-byte Folded Reload
	bl	_rgui_set_video_config
LBB0_10:
	mov	w0, #1
LBB0_11:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_fs_thumbnail,16,3              ; @fs_thumbnail
	.comm	_mini_thumbnail,16,3            ; @mini_thumbnail
	.comm	_mini_left_thumbnail,16,3       ; @mini_left_thumbnail
	.comm	_rgui_frame_buf,16,3            ; @rgui_frame_buf
	.comm	_rgui_term_layout,20,2          ; @rgui_term_layout
	.comm	_FONT_HEIGHT_STRIDE,4,2         ; @FONT_HEIGHT_STRIDE
	.comm	_FONT_WIDTH_STRIDE,4,2          ; @FONT_WIDTH_STRIDE
	.comm	_RGUI_ENTRY_VALUE_MAXLEN,8,3    ; @RGUI_ENTRY_VALUE_MAXLEN
	.comm	_rgui_background_buf,16,3       ; @rgui_background_buf
	.comm	_mini_thumbnail_max_width,8,3   ; @mini_thumbnail_max_width
	.comm	_mini_thumbnail_max_height,8,3  ; @mini_thumbnail_max_height
	.comm	_RGUI_ASPECT_RATIO_LOCK_NONE,8,3 ; @RGUI_ASPECT_RATIO_LOCK_NONE
	.no_dead_strip	_rgui_set_aspect_ratio
	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ; @switch.table.rgui_set_aspect_ratio
l_switch.table.rgui_set_aspect_ratio:
	.long	426                             ; 0x1aa
	.long	426                             ; 0x1aa
	.long	384                             ; 0x180
	.long	384                             ; 0x180

	.p2align	2                               ; @switch.table.rgui_set_aspect_ratio.1
l_switch.table.rgui_set_aspect_ratio.1:
	.long	102240                          ; 0x18f60
	.long	102240                          ; 0x18f60
	.long	92160                           ; 0x16800
	.long	92160                           ; 0x16800

	.p2align	2                               ; @switch.table.rgui_set_aspect_ratio.2
l_switch.table.rgui_set_aspect_ratio.2:
	.long	320                             ; 0x140
	.long	426                             ; 0x1aa
	.long	320                             ; 0x140
	.long	384                             ; 0x180

.subsections_via_symbols
