	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_render_bg_m2                   ## -- Begin function render_bg_m2
	.p2align	4, 0x90
_render_bg_m2:                          ## @render_bg_m2
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
                                        ## kill: def $edi killed $edi def $rdi
	movq	_linebuf@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rdx
	movq	_vram@GOTPCREL(%rip), %rax
	movq	(%rax), %r11
	movq	_reg@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r8
	movl	8(%r8), %eax
	movl	12(%r8), %ecx
	andl	$15, %eax
	shlq	$10, %rax
	movl	%edi, %esi
	andl	$248, %esi
	leaq	(%rax,%rsi,4), %r9
	shll	$6, %ecx
	xorl	$-16321, %ecx                   ## imm = 0xC03F
	movl	16(%r8), %esi
	shll	$11, %esi
	movq	_system_hw@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_SYSTEM_SMS@GOTPCREL(%rip), %r8
	movl	%ecx, %r10d
	orl	$8128, %r10d                    ## imm = 0x1FC0
	movl	%esi, %ebx
	orl	$6144, %ebx                     ## imm = 0x1800
	cmpq	(%r8), %rax
	cmovlel	%ecx, %r10d
	cmovlel	%esi, %ebx
	leaq	(%r11,%r9,4), %r8
	movl	%edi, %eax
	shll	$5, %eax
	andl	$6144, %eax                     ## imm = 0x1800
	orl	$8192, %eax                     ## imm = 0x2000
	movl	%r10d, %ecx
	andl	%eax, %ecx
	andl	$7, %edi
	orl	%edi, %ecx
	leaq	(%r11,%rcx,4), %r9
	andl	%ebx, %eax
	orl	%edi, %eax
	leaq	(%r11,%rax,4), %r11
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r8,%rsi), %eax
	shll	$3, %eax
	movslq	%eax, %rcx
	andl	%r10d, %eax
	cltq
	movl	(%r9,%rax,4), %edi
	movl	(%r11,%rcx,4), %eax
	movl	%eax, %ecx
	shrb	$5, %cl
	andb	$4, %cl
	movl	%edi, %ebx
	sarl	%cl, %ebx
	andl	$15, %ebx
	orl	$16, %ebx
	movl	%ebx, 128(%rdx,%rsi,8)
	movl	%eax, %ecx
	shrb	$4, %cl
	andb	$4, %cl
	movl	%edi, %ebx
	sarl	%cl, %ebx
	andl	$15, %ebx
	orl	$16, %ebx
	movl	%ebx, 132(%rdx,%rsi,8)
	movl	%eax, %ecx
	shrb	$3, %cl
	andb	$4, %cl
	movl	%edi, %ebx
	sarl	%cl, %ebx
	andl	$15, %ebx
	orl	$16, %ebx
	movl	%ebx, 136(%rdx,%rsi,8)
	movl	%eax, %ecx
	shrb	$2, %cl
	andb	$4, %cl
	movl	%edi, %ebx
	sarl	%cl, %ebx
	andl	$15, %ebx
	orl	$16, %ebx
	movl	%ebx, 140(%rdx,%rsi,8)
	movl	%eax, %ecx
	shrb	%cl
	andb	$4, %cl
	movl	%edi, %ebx
	sarl	%cl, %ebx
	andl	$15, %ebx
	orl	$16, %ebx
	movl	%ebx, 144(%rdx,%rsi,8)
	movl	%eax, %ecx
	andb	$4, %cl
	movl	%edi, %ebx
	sarl	%cl, %ebx
	andl	$15, %ebx
	orl	$16, %ebx
	movl	%ebx, 148(%rdx,%rsi,8)
	leal	(%rax,%rax), %ecx
	andb	$4, %cl
	movl	%edi, %ebx
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %ebx
	andl	$15, %ebx
	orl	$16, %ebx
	movl	%ebx, 152(%rdx,%rsi,8)
	shll	$2, %eax
	andb	$4, %al
	movl	%eax, %ecx
	sarl	%cl, %edi
	andl	$15, %edi
	orl	$16, %edi
	movl	%edi, 156(%rdx,%rsi,8)
	addq	$4, %rsi
	cmpl	$128, %esi
	jne	LBB0_1
## %bb.2:
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_linebuf,8,3                    ## @linebuf
	.comm	_vram,8,3                       ## @vram
	.comm	_reg,8,3                        ## @reg
	.comm	_system_hw,8,3                  ## @system_hw
	.comm	_SYSTEM_SMS,8,3                 ## @SYSTEM_SMS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function render_bg_m2
lCPI0_0:
	.long	4294967291                      ; 0xfffffffb
	.long	4294967292                      ; 0xfffffffc
	.long	4294967293                      ; 0xfffffffd
	.long	4294967294                      ; 0xfffffffe
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3
lCPI0_1:
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_render_bg_m2
	.p2align	2
_render_bg_m2:                          ; @render_bg_m2
	.cfi_startproc
; %bb.0:
	mov	x8, #0
	lsr	w12, w0, #6
Lloh0:
	adrp	x9, _linebuf@GOTPAGE
Lloh1:
	ldr	x9, [x9, _linebuf@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _vram@GOTPAGE
Lloh4:
	ldr	x10, [x10, _vram@GOTPAGEOFF]
	add	x9, x9, #128
Lloh5:
	ldr	x13, [x10]
Lloh6:
	adrp	x10, _reg@GOTPAGE
Lloh7:
	ldr	x10, [x10, _reg@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x10]
	ldp	w10, w14, [x11, #8]
	lsl	w10, w10, #10
	and	x10, x10, #0x3c00
	lsl	w15, w0, #2
	and	x15, x15, #0x3e0
	orr	x10, x10, x15
	add	x10, x13, x10, lsl #2
	lsl	w14, w14, #6
	eor	w14, w14, #0xffffc03f
	ldr	w11, [x11, #16]
Lloh9:
	adrp	x15, _system_hw@GOTPAGE
Lloh10:
	ldr	x15, [x15, _system_hw@GOTPAGEOFF]
	lsl	w16, w11, #11
Lloh11:
	ldr	x11, [x15]
Lloh12:
	adrp	x15, _SYSTEM_SMS@GOTPAGE
Lloh13:
	ldr	x15, [x15, _SYSTEM_SMS@GOTPAGEOFF]
Lloh14:
	ldr	x15, [x15]
	orr	w17, w14, #0x1fc0
	cmp	x11, x15
	orr	w15, w16, #0x1800
	csel	w11, w17, w14, gt
	csel	w14, w15, w16, gt
	mov	w15, #8192
	bfi	w15, w12, #11, #2
	and	w12, w11, w15
	bfxil	w12, w0, #0, #3
	add	x12, x13, w12, uxtw #2
	and	w14, w14, w15
	bfxil	w14, w0, #0, #3
	add	x13, x13, w14, uxtw #2
Lloh15:
	adrp	x14, lCPI0_0@PAGE
Lloh16:
	ldr	q0, [x14, lCPI0_0@PAGEOFF]
	movi.4s	v1, #4
	movi.4s	v2, #15
Lloh17:
	adrp	x14, lCPI0_1@PAGE
Lloh18:
	ldr	d3, [x14, lCPI0_1@PAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w14, [x10, x8]
	lsl	w14, w14, #3
	ldr	w15, [x13, w14, sxtw #2]
	lsr	w16, w15, #1
	fmov	s4, w16
	and	w14, w14, w11
	add	x14, x12, w14, sxtw #2
	dup.4s	v5, w15
	ushl.4s	v5, v5, v0
	dup.2s	v6, w15
	ushl.2s	v6, v6, v3
	mov.s	v4[1], w15
	and.16b	v5, v5, v1
	mov.d	v4[1], v6[0]
	ld1r.4s	{ v6 }, [x14]
	neg.4s	v5, v5
	sshl.4s	v5, v6, v5
	and.16b	v5, v5, v2
	and.16b	v4, v4, v1
	neg.4s	v4, v4
	sshl.4s	v4, v6, v4
	and.16b	v4, v4, v2
	orr.4s	v5, #16
	orr.4s	v4, #16
	stp	q5, q4, [x9], #32
	add	x8, x8, #4
	cmp	w8, #128
	b.ne	LBB0_1
; %bb.2:
	ret
	.loh AdrpLdr	Lloh17, Lloh18
	.loh AdrpAdrp	Lloh15, Lloh17
	.loh AdrpLdr	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_linebuf,8,3                    ; @linebuf
	.comm	_vram,8,3                       ; @vram
	.comm	_reg,8,3                        ; @reg
	.comm	_system_hw,8,3                  ; @system_hw
	.comm	_SYSTEM_SMS,8,3                 ; @SYSTEM_SMS
.subsections_via_symbols
