	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ctr_set_bottom_screen_enable
_ctr_set_bottom_screen_enable:          ## @ctr_set_bottom_screen_enable
	.cfi_startproc
## %bb.0:
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.1:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	testl	%esi, %esi
	je	LBB0_3
## %bb.2:
	movq	_currentConsole@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
LBB0_3:
	movq	(%rdi), %rax
	movq	_gfxBottomFramebuffers@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, (%rcx)
	leaq	-32(%rbp), %rdi
	callq	_CFGU_GetModelNintendo2DS
	cmpq	$0, -32(%rbp)
	je	LBB0_6
## %bb.4:
	leaq	L_.str(%rip), %rsi
	leaq	-20(%rbp), %rdi
	callq	_srvGetServiceHandle
	testq	%rax, %rax
	js	LBB0_6
## %bb.5:
	xorl	%ebx, %ebx
	testl	%r14d, %r14d
	sete	%bl
	xorl	%eax, %eax
	callq	_getThreadCommandBuffer
	shll	$16, %ebx
	addl	$1114176, %ebx                  ## imm = 0x110040
	movl	%ebx, (%rax)
	movl	$2, 4(%rax)
	movl	-20(%rbp), %edi
	callq	_svcSendSyncRequest
	movl	-20(%rbp), %edi
	callq	_svcCloseHandle
LBB0_6:
	movq	_ctr_bottom_screen_enabled@GOTPCREL(%rip), %rax
	movl	%r14d, (%rax)
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
LBB0_7:
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_gfxBottomFramebuffers,8,3      ## @gfxBottomFramebuffers
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gsp::Lcd"

	.comm	_ctr_bottom_screen_enabled,4,2  ## @ctr_bottom_screen_enabled
	.no_dead_strip	_ctr_set_bottom_screen_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ctr_set_bottom_screen_enable
_ctr_set_bottom_screen_enable:          ; @ctr_set_bottom_screen_enable
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_5
; %bb.1:
	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	x19, x1
Lloh0:
	adrp	x8, _currentConsole@GOTPAGE
Lloh1:
	ldr	x8, [x8, _currentConsole@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	w1, #0
	csel	x8, x0, x8, eq
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _gfxBottomFramebuffers@GOTPAGE
Lloh4:
	ldr	x9, [x9, _gfxBottomFramebuffers@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	str	x8, [x9]
	mov	x0, sp
	bl	_CFGU_GetModelNintendo2DS
	ldr	x8, [sp]
	cbz	x8, LBB0_4
; %bb.2:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #12
	bl	_srvGetServiceHandle
	tbnz	x0, #63, LBB0_4
; %bb.3:
	bl	_getThreadCommandBuffer
	mov	w8, #64
	movk	w8, #17, lsl #16
	add	w9, w8, #16, lsl #12            ; =65536
	cmp	w19, #0
	csel	w8, w9, w8, eq
	mov	w9, #2
	stp	w8, w9, [x0]
	ldr	w0, [sp, #12]
	bl	_svcSendSyncRequest
	ldr	w0, [sp, #12]
	bl	_svcCloseHandle
LBB0_4:
Lloh8:
	adrp	x8, _ctr_bottom_screen_enabled@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ctr_bottom_screen_enabled@GOTPAGEOFF]
Lloh10:
	str	w19, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
LBB0_5:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_gfxBottomFramebuffers,8,3      ; @gfxBottomFramebuffers
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gsp::Lcd"

	.comm	_ctr_bottom_screen_enabled,4,2  ; @ctr_bottom_screen_enabled
	.no_dead_strip	_ctr_set_bottom_screen_enable
.subsections_via_symbols
