	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function menu_prepare_bg
_menu_prepare_bg:                       ## @menu_prepare_bg
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%edi, %edi
	je	LBB0_4
## %bb.1:
	movq	_giz_screen@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	jne	LBB0_3
## %bb.2:
	movl	$1, %edi
	callq	_fb_lock
	movq	%rax, (%r14)
LBB0_3:
	movq	_bg_buffer@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	xorl	%esi, %esi
	movl	$5136, %edx                     ## imm = 0x1410
	callq	_memset
	movl	$5136, %esi                     ## imm = 0x1410
	movq	(%rbx), %rdi
	addq	%rsi, %rdi
	addq	(%r14), %rsi
	movl	$71904, %edx                    ## imm = 0x118E0
	movl	$1, %ecx
	callq	_menu_darken_bg
	movl	$148944, %edi                   ## imm = 0x245D0
	addq	(%rbx), %rdi
	xorl	%esi, %esi
	movl	$5136, %edx                     ## imm = 0x1410
	callq	_memset
	xorl	%eax, %eax
	callq	_fb_unlock
	movq	$0, (%r14)
	jmp	LBB0_6
LBB0_4:
	movq	_bg_buffer@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	movq	_READPNG_BG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	callq	_readpng
	movl	$240, %r15d
	movl	$152960, %r12d                  ## imm = 0x25580
	movl	$153438, %ebx                   ## imm = 0x2575E
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rsi
	leaq	(%rbx,%rsi), %rdi
	addq	%r12, %rsi
	movl	$640, %edx                      ## imm = 0x280
	callq	_memmove
	decq	%r15
	addq	$-640, %r12                     ## imm = 0xFD80
	addq	$-642, %rbx                     ## imm = 0xFD7E
	cmpq	$1, %r15
	ja	LBB0_5
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_giz_screen,8,3                 ## @giz_screen
	.comm	_bg_buffer,8,3                  ## @bg_buffer
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"skin/background.png"

	.comm	_READPNG_BG,4,2                 ## @READPNG_BG
	.no_dead_strip	_menu_prepare_bg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function menu_prepare_bg
_menu_prepare_bg:                       ; @menu_prepare_bg
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	cbz	w0, LBB0_4
; %bb.1:
Lloh0:
	adrp	x19, _giz_screen@GOTPAGE
Lloh1:
	ldr	x19, [x19, _giz_screen@GOTPAGEOFF]
	ldr	x8, [x19]
	cbnz	x8, LBB0_3
; %bb.2:
	mov	w0, #1
	bl	_fb_lock
	str	x0, [x19]
LBB0_3:
Lloh2:
	adrp	x20, _bg_buffer@GOTPAGE
Lloh3:
	ldr	x20, [x20, _bg_buffer@GOTPAGEOFF]
	ldr	x0, [x20]
	mov	w21, #5136
	mov	w1, #0
	mov	w2, #5136
	bl	_memset
	ldr	x8, [x20]
	add	x0, x8, x21
	ldr	x8, [x19]
	add	x1, x8, x21
	mov	w2, #6368
	movk	w2, #1, lsl #16
	mov	w3, #1
	bl	_menu_darken_bg
	ldr	x8, [x20]
	add	x8, x8, #36, lsl #12            ; =147456
	add	x0, x8, #1488
	mov	w1, #0
	mov	w2, #5136
	bl	_memset
	bl	_fb_unlock
	str	xzr, [x19]
	b	LBB0_6
LBB0_4:
Lloh4:
	adrp	x19, _bg_buffer@GOTPAGE
Lloh5:
	ldr	x19, [x19, _bg_buffer@GOTPAGEOFF]
	ldr	x0, [x19]
Lloh6:
	adrp	x8, _READPNG_BG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _READPNG_BG@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_readpng
	mov	w8, #17872
	movk	w8, #2, lsl #16
	add	x20, x8, #4016
	mov	w21, #240
	mov	w22, #22366
	movk	w22, #2, lsl #16
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	add	x0, x22, x8
	add	x1, x20, x8
	mov	w2, #640
	bl	_memmove
	sub	x21, x21, #1
	sub	x20, x20, #640
	sub	x22, x22, #642
	cmp	x21, #1
	b.hi	LBB0_5
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_giz_screen,8,3                 ; @giz_screen
	.comm	_bg_buffer,8,3                  ; @bg_buffer
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"skin/background.png"

	.comm	_READPNG_BG,4,2                 ; @READPNG_BG
	.no_dead_strip	_menu_prepare_bg
.subsections_via_symbols
