	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_update_bg_pattern_cache_m4     ## -- Begin function update_bg_pattern_cache_m4
	.p2align	4, 0x90
_update_bg_pattern_cache_m4:            ## @update_bg_pattern_cache_m4
	.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), %r15
	movq	%r12, %rsi
	shlq	$5, %rsi
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	_bp_lut@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	addq	%rcx, %rdx
	addq	$28, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=2
	incq	%r9
	addq	$8, %r8
	addq	$4, %rcx
	cmpq	$8, %r9
	je	LBB0_6
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r13,%r12,4), %edi
	btl	%r9d, %edi
	jae	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	orq	%rcx, %rdi
	movq	(%r15,%rdi,4), %rbx
	shlq	$2, %rdi
	orq	$8, %rdi
	movq	(%r15,%rdi), %rdi
	movl	(%rsi,%rbx,4), %r10d
	sarl	$2, %r10d
	orl	(%rsi,%rdi,4), %r10d
	movl	%r8d, %r11d
	xorl	$56, %r11d
	movl	%r10d, %edi
	andl	$15, %edi
	leaq	(,%r8,4), %r14
	movl	%edi, -28(%rdx,%r8,4)
	movq	%r14, %rbx
	orq	$131100, %rbx                   ## imm = 0x2001C
	movl	%edi, (%rax,%rbx)
	movl	%r11d, %ebx
	orl	$65536, %ebx                    ## imm = 0x10000
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	movl	%r11d, %ebx
	orl	$98311, %ebx                    ## imm = 0x18007
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	movl	%r10d, %edi
	shrl	$4, %edi
	andl	$15, %edi
	movl	%edi, -24(%rdx,%r8,4)
	movq	%r14, %rbx
	orq	$131096, %rbx                   ## imm = 0x20018
	movl	%edi, (%rax,%rbx)
	movl	%r11d, %ebx
	orl	$65537, %ebx                    ## imm = 0x10001
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	movl	%r11d, %ebx
	orl	$98310, %ebx                    ## imm = 0x18006
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	movl	%r10d, %edi
	shrl	$8, %edi
	andl	$15, %edi
	movl	%edi, -20(%rdx,%r8,4)
	movq	%r14, %rbx
	orq	$131092, %rbx                   ## imm = 0x20014
	movl	%edi, (%rax,%rbx)
	movl	%r11d, %ebx
	orl	$65538, %ebx                    ## imm = 0x10002
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	movl	%r11d, %ebx
	orl	$98309, %ebx                    ## imm = 0x18005
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	movl	%r10d, %edi
	shrl	$12, %edi
	andl	$15, %edi
	movl	%edi, -16(%rdx,%r8,4)
	movq	%r14, %rbx
	orq	$131088, %rbx                   ## imm = 0x20010
	movl	%edi, (%rax,%rbx)
	movl	%r11d, %ebx
	orl	$65539, %ebx                    ## imm = 0x10003
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	movl	%r11d, %ebx
	orl	$98308, %ebx                    ## imm = 0x18004
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	movl	%r10d, %edi
	shrl	$16, %edi
	andl	$15, %edi
	movl	%edi, -12(%rdx,%r8,4)
	movq	%r14, %rbx
	orq	$131084, %rbx                   ## imm = 0x2000C
	movl	%edi, (%rax,%rbx)
	movl	%r11d, %ebx
	orl	$65540, %ebx                    ## imm = 0x10004
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	movl	%r11d, %ebx
	orl	$98307, %ebx                    ## imm = 0x18003
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	movl	%r10d, %edi
	shrl	$20, %edi
	andl	$15, %edi
	movl	%edi, -8(%rdx,%r8,4)
	movq	%r14, %rbx
	orq	$131080, %rbx                   ## imm = 0x20008
	movl	%edi, (%rax,%rbx)
	movl	%r11d, %ebx
	orl	$65541, %ebx                    ## imm = 0x10005
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	movl	%r11d, %ebx
	orl	$98306, %ebx                    ## imm = 0x18002
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	movl	%r10d, %edi
	shrl	$24, %edi
	andl	$15, %edi
	movl	%edi, -4(%rdx,%r8,4)
	movq	%r14, %rbx
	orq	$131076, %rbx                   ## imm = 0x20004
	movl	%edi, (%rax,%rbx)
	movl	%r11d, %ebx
	orl	$65542, %ebx                    ## imm = 0x10006
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	movl	%r11d, %ebx
	orl	$98305, %ebx                    ## imm = 0x18001
	movslq	%ebx, %rbx
	movl	%edi, (%rax,%rbx,4)
	shrl	$28, %r10d
	movl	%r10d, (%rdx,%r8,4)
	orq	$131072, %r14                   ## imm = 0x20000
	movl	%r10d, (%rax,%r14)
	movl	%r11d, %edi
	orl	$65543, %edi                    ## imm = 0x10007
	movslq	%edi, %rdi
	movl	%r10d, (%rax,%rdi,4)
	orl	$98304, %r11d                   ## imm = 0x18000
	movslq	%r11d, %rdi
	movl	%r10d, (%rax,%rdi,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
	.comm	_bp_lut,8,3                     ## @bp_lut
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_update_bg_pattern_cache_m4     ; -- Begin function update_bg_pattern_cache_m4
	.p2align	2
_update_bg_pattern_cache_m4:            ; @update_bg_pattern_cache_m4
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	.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
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x8, #0
	mov	w9, #32770
	movk	w9, #1, lsl #16
	mov	w10, #65537
Lloh0:
	adrp	x11, _bg_name_list@GOTPAGE
Lloh1:
	ldr	x11, [x11, _bg_name_list@GOTPAGEOFF]
Lloh2:
	ldr	x11, [x11]
Lloh3:
	adrp	x1, _bg_name_dirty@GOTPAGE
Lloh4:
	ldr	x1, [x1, _bg_name_dirty@GOTPAGEOFF]
	mov	w12, w0
Lloh5:
	adrp	x15, _bp_lut@GOTPAGE
Lloh6:
	ldr	x15, [x15, _bp_lut@GOTPAGEOFF]
	mov	w16, #28
	movk	w16, #2, lsl #16
	mov	w17, #24
	movk	w17, #2, lsl #16
	mov	w0, #20
	movk	w0, #2, lsl #16
Lloh7:
	ldr	x1, [x1]
	mov	w2, #16
	movk	w2, #2, lsl #16
	mov	w3, #12
	movk	w3, #2, lsl #16
	mov	w4, #8
	movk	w4, #2, lsl #16
	mov	w5, #4
	movk	w5, #2, lsl #16
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	str	wzr, [x1, x6, lsl #2]
	add	x8, x8, #1
	cmp	x8, x12
	b.eq	LBB0_7
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	mov	x7, #0
	mov	w19, #0
	mov	x20, #0
	ldr	x6, [x11, x8, lsl #3]
Lloh8:
	adrp	x13, _bg_pattern_cache@GOTPAGE
Lloh9:
	ldr	x13, [x13, _bg_pattern_cache@GOTPAGEOFF]
Lloh10:
	ldr	x21, [x13]
	add	x21, x21, x6, lsl #8
Lloh11:
	adrp	x13, _vram@GOTPAGE
Lloh12:
	ldr	x13, [x13, _vram@GOTPAGEOFF]
Lloh13:
	ldr	x22, [x13]
	lsl	x23, x6, #5
	ldr	x24, [x15]
	add	x25, x21, #16
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=2
	add	x20, x20, #8
	add	w19, w19, #1
	add	x7, x7, #4
	add	x25, x25, #32
	cmp	x20, #64
	b.eq	LBB0_2
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w26, [x1, x6, lsl #2]
	lsr	w26, w26, w19
	tbz	w26, #0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	orr	x26, x23, x7
	lsl	x26, x26, #2
	ldr	x27, [x22, x26]
	orr	x26, x26, #0x8
	ldr	x26, [x22, x26]
	ldr	w27, [x24, x27, lsl #2]
	ldr	w26, [x24, x26, lsl #2]
	orr	w27, w26, w27, asr #2
	sxtw	x26, w20
	eor	x26, x26, #0x38
	and	w13, w27, #0xf
	stur	w13, [x25, #-16]
	lsl	x30, x20, #2
	orr	x28, x30, x16
	str	w13, [x21, x28]
	lsl	x28, x26, #2
	orr	x14, x28, #0x40000
	str	w13, [x21, x14]
	add	w14, w9, #5
	orr	w14, w26, w14
	str	w13, [x21, w14, sxtw #2]
	ubfx	w13, w27, #4, #4
	stur	w13, [x25, #-12]
	orr	x14, x30, x17
	str	w13, [x21, x14]
	orr	w14, w26, w10
	str	w13, [x21, w14, sxtw #2]
	add	w14, w9, #4
	orr	w14, w26, w14
	str	w13, [x21, w14, sxtw #2]
	ubfx	w13, w27, #8, #4
	stur	w13, [x25, #-8]
	orr	x14, x30, x0
	str	w13, [x21, x14]
	add	w14, w10, #1
	orr	w14, w26, w14
	str	w13, [x21, w14, sxtw #2]
	add	w14, w9, #3
	orr	w14, w26, w14
	str	w13, [x21, w14, sxtw #2]
	ubfx	w13, w27, #12, #4
	stur	w13, [x25, #-4]
	orr	x14, x30, x2
	str	w13, [x21, x14]
	add	w14, w10, #2
	orr	w14, w26, w14
	str	w13, [x21, w14, sxtw #2]
	add	w14, w9, #2
	orr	w14, w26, w14
	str	w13, [x21, w14, sxtw #2]
	ubfx	w13, w27, #16, #4
	str	w13, [x25]
	orr	x14, x30, x3
	str	w13, [x21, x14]
	add	w14, w10, #3
	orr	w14, w26, w14
	str	w13, [x21, w14, sxtw #2]
	add	w14, w9, #1
	orr	w14, w26, w14
	str	w13, [x21, w14, sxtw #2]
	ubfx	w13, w27, #20, #4
	str	w13, [x25, #4]
	orr	x14, x30, x4
	str	w13, [x21, x14]
	add	w14, w10, #4
	orr	w14, w26, w14
	str	w13, [x21, w14, sxtw #2]
	orr	w14, w26, w9
	str	w13, [x21, w14, sxtw #2]
	ubfx	w13, w27, #24, #4
	str	w13, [x25, #8]
	orr	x14, x30, x5
	str	w13, [x21, x14]
	add	w14, w10, #5
	orr	w14, w26, w14
	str	w13, [x21, w14, sxtw #2]
	add	w14, w10, #8, lsl #12           ; =32768
	orr	w14, w26, w14
	str	w13, [x21, w14, sxtw #2]
	lsr	w13, w27, #28
	str	w13, [x25, #12]
	orr	x14, x30, #0x20000
	str	w13, [x21, x14]
	add	w14, w10, #6
	orr	w14, w26, w14
	str	w13, [x21, w14, sxtw #2]
	orr	x14, x28, #0x60000
	str	w13, [x21, x14]
	b	LBB0_4
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.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
	.comm	_bp_lut,8,3                     ; @bp_lut
.subsections_via_symbols
