	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rgui_toggle
_rgui_toggle:                           ## @rgui_toggle
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_config_get_ptr
	testq	%rbx, %rbx
	je	LBB0_10
## %bb.1:
	testq	%rax, %rax
	je	LBB0_10
## %bb.2:
	movq	(%rax), %rax
	movq	_RGUI_ASPECT_RATIO_LOCK_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.3:
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.11:
	leaq	4(%rbx), %rdi
	callq	_rgui_get_video_config
	movq	%rbx, %rdi
	callq	_rgui_update_menu_viewport
	leaq	8(%rbx), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rgui_set_video_config          ## TAILCALL
LBB0_4:
	movl	$0, -32(%rbp)
	leaq	-32(%rbp), %r15
	movq	%r15, %rdi
	callq	_rgui_get_video_config
	leaq	8(%rbx), %rsi
	movq	%r15, %rdi
	callq	_rgui_is_video_config_equal
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	4(%rbx), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_rgui_set_video_config
LBB0_6:
	movl	$0, (%rbx)
LBB0_7:
	testl	%r14d, %r14d
	jne	LBB0_10
## %bb.8:
	movq	_rgui_upscale_buf@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.9:
	callq	_free
	movq	$0, (%rbx)
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RGUI_ASPECT_RATIO_LOCK_NONE,8,3 ## @RGUI_ASPECT_RATIO_LOCK_NONE
	.comm	_rgui_upscale_buf,8,3           ## @rgui_upscale_buf
	.no_dead_strip	_rgui_toggle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rgui_toggle
_rgui_toggle:                           ; @rgui_toggle
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	bl	_config_get_ptr
	cbz	x19, LBB0_11
; %bb.1:
	cbz	x0, LBB0_11
; %bb.2:
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _RGUI_ASPECT_RATIO_LOCK_NONE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RGUI_ASPECT_RATIO_LOCK_NONE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.3:
	cbz	w20, LBB0_5
; %bb.4:
	add	x0, x19, #4
	bl	_rgui_get_video_config
	mov	x0, x19
	bl	_rgui_update_menu_viewport
	add	x1, x19, #8
	mov	x0, x19
	mov	w2, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_rgui_set_video_config
LBB0_5:
	str	wzr, [sp, #8]
	add	x0, sp, #8
	bl	_rgui_get_video_config
	add	x1, x19, #8
	add	x0, sp, #8
	bl	_rgui_is_video_config_equal
	cbz	x0, LBB0_7
; %bb.6:
	add	x1, x19, #4
	mov	x0, x19
	mov	w2, #0
	bl	_rgui_set_video_config
LBB0_7:
	str	wzr, [x19]
LBB0_8:
	cbnz	w20, LBB0_11
; %bb.9:
Lloh3:
	adrp	x19, _rgui_upscale_buf@GOTPAGE
Lloh4:
	ldr	x19, [x19, _rgui_upscale_buf@GOTPAGEOFF]
	ldr	x0, [x19]
	cbz	x0, LBB0_11
; %bb.10:
	bl	_free
	str	xzr, [x19]
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_RGUI_ASPECT_RATIO_LOCK_NONE,8,3 ; @RGUI_ASPECT_RATIO_LOCK_NONE
	.comm	_rgui_upscale_buf,8,3           ; @rgui_upscale_buf
	.no_dead_strip	_rgui_toggle
.subsections_via_symbols
