	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_update_bg_pattern_cache_m5     ## -- Begin function update_bg_pattern_cache_m5
	.p2align	4, 0x90
_update_bg_pattern_cache_m5:            ## @update_bg_pattern_cache_m5
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%edi, %edi
	jle	LBB0_7
## %bb.1:
	movq	_bg_name_list@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_bg_name_dirty@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movl	%edi, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%ecx, %ecx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$0, (%r13,%r12,4)
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	incq	%rcx
	cmpq	-48(%rbp), %rcx                 ## 8-byte Folded Reload
	je	LBB0_7
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	(%rax,%rcx,8), %r12
	movq	_bg_pattern_cache@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%r12, %rdx
	shlq	$8, %rdx
	leaq	(%rcx,%rdx), %rax
	movq	_vram@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, %r11
	shlq	$5, %r11
	leaq	(%rcx,%rdx), %r15
	addq	$28, %r15
	xorl	%edx, %edx
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=2
	incq	%rcx
	addq	$8, %rbx
	addq	$4, %rdx
	cmpq	$8, %rcx
	je	LBB0_6
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r13,%r12,4), %edi
	btl	%ecx, %edi
	jae	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	%r11, %rdi
	orq	%rdx, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	(%rsi,%rdi,4), %r8d
	movl	%ebx, %r9d
	xorl	$56, %r9d
	movl	%r8d, %edi
	andl	$15, %edi
	leaq	(,%rbx,4), %r14
	movl	%edi, (%r15,%rbx,4)
	movq	%r14, %r10
	orq	$524288, %r10                   ## imm = 0x80000
	movl	%edi, (%rax,%r10)
	movl	%r9d, %esi
	orl	$262151, %esi                   ## imm = 0x40007
	movslq	%esi, %rsi
	movl	%edi, (%rax,%rsi,4)
	movl	%r9d, %esi
	orl	$393216, %esi                   ## imm = 0x60000
	movslq	%esi, %rsi
	movl	%edi, (%rax,%rsi,4)
	movl	%r8d, %esi
	shrl	$4, %esi
	andl	$15, %esi
	movl	%esi, -4(%r15,%rbx,4)
	movq	%r14, %rdi
	orq	$524292, %rdi                   ## imm = 0x80004
	movl	%esi, (%rax,%rdi)
	movl	%r9d, %edi
	orl	$262150, %edi                   ## imm = 0x40006
	movslq	%edi, %rdi
	movl	%esi, (%rax,%rdi,4)
	movl	%r9d, %edi
	orl	$393217, %edi                   ## imm = 0x60001
	movslq	%edi, %rdi
	movl	%esi, (%rax,%rdi,4)
	movl	%r8d, %esi
	shrl	$8, %esi
	andl	$15, %esi
	movl	%esi, -8(%r15,%rbx,4)
	movq	%r14, %rdi
	orq	$524296, %rdi                   ## imm = 0x80008
	movl	%esi, (%rax,%rdi)
	movl	%r9d, %edi
	orl	$262149, %edi                   ## imm = 0x40005
	movslq	%edi, %rdi
	movl	%esi, (%rax,%rdi,4)
	movl	%r9d, %edi
	orl	$393218, %edi                   ## imm = 0x60002
	movslq	%edi, %rdi
	movl	%esi, (%rax,%rdi,4)
	movl	%r8d, %esi
	shrl	$12, %esi
	andl	$15, %esi
	movl	%esi, -12(%r15,%rbx,4)
	movq	%r14, %rdi
	orq	$524300, %rdi                   ## imm = 0x8000C
	movl	%esi, (%rax,%rdi)
	movl	%r9d, %edi
	orl	$262148, %edi                   ## imm = 0x40004
	movslq	%edi, %rdi
	movl	%esi, (%rax,%rdi,4)
	movl	%r9d, %edi
	orl	$393219, %edi                   ## imm = 0x60003
	movslq	%edi, %rdi
	movl	%esi, (%rax,%rdi,4)
	movl	%r8d, %esi
	shrl	$16, %esi
	andl	$15, %esi
	movl	%esi, -16(%r15,%rbx,4)
	movq	%r14, %rdi
	orq	$524304, %rdi                   ## imm = 0x80010
	movl	%esi, (%rax,%rdi)
	movl	%r9d, %edi
	orl	$262147, %edi                   ## imm = 0x40003
	movslq	%edi, %rdi
	movl	%esi, (%rax,%rdi,4)
	movl	%r9d, %edi
	orl	$393220, %edi                   ## imm = 0x60004
	movslq	%edi, %rdi
	movl	%esi, (%rax,%rdi,4)
	movl	%r8d, %esi
	shrl	$20, %esi
	andl	$15, %esi
	movl	%esi, -20(%r15,%rbx,4)
	movq	%r14, %rdi
	orq	$524308, %rdi                   ## imm = 0x80014
	movl	%esi, (%rax,%rdi)
	movl	%r9d, %edi
	orl	$262146, %edi                   ## imm = 0x40002
	movslq	%edi, %rdi
	movl	%esi, (%rax,%rdi,4)
	movl	%r9d, %edi
	orl	$393221, %edi                   ## imm = 0x60005
	movslq	%edi, %rdi
	movl	%esi, (%rax,%rdi,4)
	movl	%r8d, %esi
	shrl	$24, %esi
	andl	$15, %esi
	movl	%esi, -24(%r15,%rbx,4)
	movq	%r14, %rdi
	orq	$524312, %rdi                   ## imm = 0x80018
	movl	%esi, (%rax,%rdi)
	movl	%r9d, %edi
	orl	$262145, %edi                   ## imm = 0x40001
	movslq	%edi, %rdi
	movl	%esi, (%rax,%rdi,4)
	movl	%r9d, %edi
	orl	$393222, %edi                   ## imm = 0x60006
	movslq	%edi, %rdi
	movl	%esi, (%rax,%rdi,4)
	shrl	$28, %r8d
	movl	%r8d, -28(%r15,%rbx,4)
	orq	$524316, %r14                   ## imm = 0x8001C
	movl	%r8d, (%rax,%r14)
	movl	%r9d, %esi
	orl	$262144, %esi                   ## imm = 0x40000
	movslq	%esi, %rsi
	movl	%r8d, (%rax,%rsi,4)
	orl	$393223, %r9d                   ## imm = 0x60007
	movslq	%r9d, %rsi
	movl	%r8d, (%rax,%rsi,4)
	jmp	LBB0_5
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bg_name_list,8,3               ## @bg_name_list
	.comm	_bg_name_dirty,8,3              ## @bg_name_dirty
	.comm	_bg_pattern_cache,8,3           ## @bg_pattern_cache
	.comm	_vram,8,3                       ## @vram
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_update_bg_pattern_cache_m5     ; -- Begin function update_bg_pattern_cache_m5
	.p2align	2
_update_bg_pattern_cache_m5:            ; @update_bg_pattern_cache_m5
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	.cfi_offset w19, -8
	.cfi_offset w20, -16
	.cfi_offset w21, -24
	.cfi_offset w22, -32
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x8, #0
	mov	w9, #1
	movk	w9, #2, lsl #16
	mov	w10, #2
	movk	w10, #6, lsl #16
	mov	w11, #1
	movk	w11, #4, lsl #16
Lloh0:
	adrp	x12, _bg_name_list@GOTPAGE
Lloh1:
	ldr	x12, [x12, _bg_name_list@GOTPAGEOFF]
Lloh2:
	ldr	x12, [x12]
Lloh3:
	adrp	x13, _bg_name_dirty@GOTPAGE
Lloh4:
	ldr	x13, [x13, _bg_name_dirty@GOTPAGEOFF]
Lloh5:
	ldr	x13, [x13]
	mov	w14, w0
Lloh6:
	adrp	x15, _bg_pattern_cache@GOTPAGE
Lloh7:
	ldr	x15, [x15, _bg_pattern_cache@GOTPAGEOFF]
Lloh8:
	adrp	x16, _vram@GOTPAGE
Lloh9:
	ldr	x16, [x16, _vram@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	str	wzr, [x13, x17, lsl #2]
	add	x8, x8, #1
	cmp	x8, x14
	b.eq	LBB0_7
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	mov	x0, #0
	mov	w1, #0
	mov	x2, #0
	ldr	x17, [x12, x8, lsl #3]
	ldr	x3, [x15]
	add	x3, x3, x17, lsl #8
	ldr	x4, [x16]
	lsl	x5, x17, #5
	add	x6, x3, #16
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=2
	add	x2, x2, #8
	add	w1, w1, #1
	add	x0, x0, #4
	add	x6, x6, #32
	cmp	x2, #64
	b.eq	LBB0_2
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w7, [x13, x17, lsl #2]
	lsr	w7, w7, w1
	tbz	w7, #0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	orr	x7, x5, x0
	ldr	w19, [x4, x7, lsl #2]
	sxtw	x7, w2
	eor	x7, x7, #0x38
	and	w21, w19, #0xf
	str	w21, [x6, #12]
	lsl	x20, x2, #2
	orr	x20, x20, #0x80000
	str	w21, [x3, x20]
	add	w20, w11, #6
	orr	w20, w7, w20
	str	w21, [x3, w20, sxtw #2]
	lsl	x20, x7, #2
	orr	x22, x20, #0x180000
	str	w21, [x3, x22]
	ubfx	w21, w19, #4, #4
	str	w21, [x6, #8]
	orr	x22, x2, x9
	str	w21, [x3, x22, lsl #2]
	add	w22, w11, #5
	orr	w22, w7, w22
	str	w21, [x3, w22, sxtw #2]
	add	w22, w11, #32, lsl #12          ; =131072
	orr	w22, w7, w22
	str	w21, [x3, w22, sxtw #2]
	ubfx	w21, w19, #8, #4
	str	w21, [x6, #4]
	add	x22, x9, #1
	orr	x22, x2, x22
	str	w21, [x3, x22, lsl #2]
	add	w22, w11, #4
	orr	w22, w7, w22
	str	w21, [x3, w22, sxtw #2]
	orr	w22, w7, w10
	str	w21, [x3, w22, sxtw #2]
	ubfx	w21, w19, #12, #4
	str	w21, [x6]
	add	x22, x9, #2
	orr	x22, x2, x22
	str	w21, [x3, x22, lsl #2]
	add	w22, w11, #3
	orr	w22, w7, w22
	str	w21, [x3, w22, sxtw #2]
	add	w22, w10, #1
	orr	w22, w7, w22
	str	w21, [x3, w22, sxtw #2]
	ubfx	w21, w19, #16, #4
	stur	w21, [x6, #-4]
	add	x22, x9, #3
	orr	x22, x2, x22
	str	w21, [x3, x22, lsl #2]
	add	w22, w11, #2
	orr	w22, w7, w22
	str	w21, [x3, w22, sxtw #2]
	add	w22, w10, #2
	orr	w22, w7, w22
	str	w21, [x3, w22, sxtw #2]
	ubfx	w21, w19, #20, #4
	stur	w21, [x6, #-8]
	add	x22, x9, #4
	orr	x22, x2, x22
	str	w21, [x3, x22, lsl #2]
	add	w22, w11, #1
	orr	w22, w7, w22
	str	w21, [x3, w22, sxtw #2]
	add	w22, w10, #3
	orr	w22, w7, w22
	str	w21, [x3, w22, sxtw #2]
	ubfx	w21, w19, #24, #4
	stur	w21, [x6, #-12]
	add	x22, x9, #5
	orr	x22, x2, x22
	str	w21, [x3, x22, lsl #2]
	orr	w22, w7, w11
	str	w21, [x3, w22, sxtw #2]
	add	w22, w10, #4
	orr	w22, w7, w22
	str	w21, [x3, w22, sxtw #2]
	lsr	w19, w19, #28
	stur	w19, [x6, #-16]
	add	x21, x9, #6
	orr	x21, x2, x21
	str	w19, [x3, x21, lsl #2]
	orr	x20, x20, #0x100000
	str	w19, [x3, x20]
	add	w20, w10, #5
	orr	w7, w7, w20
	str	w19, [x3, w7, sxtw #2]
	b	LBB0_4
LBB0_7:
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_bg_name_list,8,3               ; @bg_name_list
	.comm	_bg_name_dirty,8,3              ; @bg_name_dirty
	.comm	_bg_pattern_cache,8,3           ; @bg_pattern_cache
	.comm	_vram,8,3                       ; @vram
.subsections_via_symbols
