	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function FinalizeLine8bit
_FinalizeLine8bit:                      ## @FinalizeLine8bit
	.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
	movl	%edi, %r15d
	movq	_DrawLineDest@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	_rendstatus@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	movq	_Pico@GOTPCREL(%rip), %r12
	testl	%edi, %edi
	jne	LBB0_6
## %bb.1:
	cmpl	$1, 16(%r12)
	jne	LBB0_6
## %bb.2:
	movq	_PDRAW_SONIC_MODE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	movl	_FinalizeLine8bit.dirty_count(%rip), %esi
	incl	%esi
	testl	%eax, %ebx
	movl	$1, %edx
	cmovnel	%esi, %edx
	movl	%edx, _FinalizeLine8bit.dirty_count(%rip)
	orl	%eax, %ebx
	movl	%ebx, (%rcx)
	cmpl	$11, %edx
	je	LBB0_7
## %bb.3:
	cmpl	$3, %edx
	jne	LBB0_9
## %bb.4:
	movq	_HighPal@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	jmp	LBB0_8
LBB0_6:
	movl	%eax, %ebx
	jmp	LBB0_9
LBB0_7:
	movq	_HighPal@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	$64, %rdi
LBB0_8:
	movq	8(%r12), %rsi
	movl	$128, %edx
	callq	_blockcpy
LBB0_9:
	movq	(%r12), %rax
	movl	$320, %edx                      ## imm = 0x140
	testb	$1, 48(%rax)
	jne	LBB0_11
## %bb.10:
	movq	_PicoOpt@GOTPCREL(%rip), %rax
	movq	_POPT_DIS_32C_BORDER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%edx, %edx
	testl	%ecx, (%rax)
	sete	%dl
	shlq	$5, %rdx
	addq	%rdx, %r14
	movl	$256, %edx                      ## imm = 0x100
LBB0_11:
	testl	%r15d, %r15d
	je	LBB0_13
LBB0_12:
	movq	_HighCol@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$8, %rsi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_blockcpy                       ## TAILCALL
LBB0_13:
	movq	_PDRAW_SONIC_MODE@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_12
## %bb.14:
	movq	_HighCol@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$8, %rsi
	cmpl	$11, _FinalizeLine8bit.dirty_count(%rip)
	jl	LBB0_16
## %bb.15:
	movq	%r14, %rdi
	movl	$128, %ecx
	jmp	LBB0_17
LBB0_16:
	movq	%r14, %rdi
	movl	$64, %ecx
LBB0_17:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_blockcpy_or                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DrawLineDest,8,3               ## @DrawLineDest
	.comm	_rendstatus,4,2                 ## @rendstatus
.zerofill __DATA,__bss,_FinalizeLine8bit.dirty_count,4,2 ## @FinalizeLine8bit.dirty_count
	.comm	_Pico,24,3                      ## @Pico
	.comm	_PDRAW_SONIC_MODE,4,2           ## @PDRAW_SONIC_MODE
	.comm	_HighPal,8,3                    ## @HighPal
	.comm	_PicoOpt,4,2                    ## @PicoOpt
	.comm	_POPT_DIS_32C_BORDER,4,2        ## @POPT_DIS_32C_BORDER
	.comm	_HighCol,8,3                    ## @HighCol
	.no_dead_strip	_FinalizeLine8bit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function FinalizeLine8bit
_FinalizeLine8bit:                      ; @FinalizeLine8bit
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, _DrawLineDest@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DrawLineDest@GOTPAGEOFF]
Lloh2:
	ldr	x19, [x8]
Lloh3:
	adrp	x8, _rendstatus@GOTPAGE
Lloh4:
	ldr	x8, [x8, _rendstatus@GOTPAGEOFF]
	ldr	w21, [x8]
Lloh5:
	adrp	x22, _Pico@GOTPAGE
Lloh6:
	ldr	x22, [x22, _Pico@GOTPAGEOFF]
	cbnz	w0, LBB0_7
; %bb.1:
	ldr	w9, [x22, #16]
	cmp	w9, #1
	b.ne	LBB0_7
; %bb.2:
Lloh7:
	adrp	x9, _PDRAW_SONIC_MODE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PDRAW_SONIC_MODE@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x9]
	adrp	x11, _FinalizeLine8bit.dirty_count@PAGE
	ldr	w9, [x11, _FinalizeLine8bit.dirty_count@PAGEOFF]
	tst	w10, w21
	mov	w12, #1
	csinc	w9, w12, w9, eq
	str	w9, [x11, _FinalizeLine8bit.dirty_count@PAGEOFF]
	orr	w21, w10, w21
	str	w21, [x8]
	cmp	w9, #11
	b.eq	LBB0_5
; %bb.3:
	cmp	w9, #3
	b.ne	LBB0_7
; %bb.4:
Lloh10:
	adrp	x8, _HighPal@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HighPal@GOTPAGEOFF]
Lloh12:
	ldr	x0, [x8]
	b	LBB0_6
LBB0_5:
Lloh13:
	adrp	x8, _HighPal@GOTPAGE
Lloh14:
	ldr	x8, [x8, _HighPal@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	add	x0, x8, #64
LBB0_6:
	ldr	x1, [x22, #8]
	mov	w2, #128
	bl	_blockcpy
LBB0_7:
	ldr	x8, [x22]
	ldrb	w8, [x8, #48]
	tbnz	w8, #0, LBB0_9
; %bb.8:
Lloh16:
	adrp	x8, _PicoOpt@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PicoOpt@GOTPAGEOFF]
Lloh18:
	adrp	x9, _POPT_DIS_32C_BORDER@GOTPAGE
Lloh19:
	ldr	x9, [x9, _POPT_DIS_32C_BORDER@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w8, eq
	add	x19, x19, x8, lsl #5
	mov	w2, #256
	cbnz	w20, LBB0_13
	b	LBB0_10
LBB0_9:
	mov	w2, #320
	cbnz	w20, LBB0_13
LBB0_10:
Lloh22:
	adrp	x8, _PDRAW_SONIC_MODE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PDRAW_SONIC_MODE@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_13
; %bb.11:
Lloh25:
	adrp	x8, _FinalizeLine8bit.dirty_count@PAGE
Lloh26:
	ldr	w8, [x8, _FinalizeLine8bit.dirty_count@PAGEOFF]
Lloh27:
	adrp	x9, _HighCol@GOTPAGE
Lloh28:
	ldr	x9, [x9, _HighCol@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	add	x1, x9, #8
	mov	x0, x19
	cmp	w8, #11
	b.lt	LBB0_14
; %bb.12:
	mov	w3, #128
	b	LBB0_15
LBB0_13:
Lloh30:
	adrp	x8, _HighCol@GOTPAGE
Lloh31:
	ldr	x8, [x8, _HighCol@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	add	x1, x8, #8
	mov	x0, x19
	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
	b	_blockcpy
LBB0_14:
	mov	w3, #64
LBB0_15:
	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
	b	_blockcpy_or
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh20
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdr	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_DrawLineDest,8,3               ; @DrawLineDest
	.comm	_rendstatus,4,2                 ; @rendstatus
.zerofill __DATA,__bss,_FinalizeLine8bit.dirty_count,4,2 ; @FinalizeLine8bit.dirty_count
	.comm	_Pico,24,3                      ; @Pico
	.comm	_PDRAW_SONIC_MODE,4,2           ; @PDRAW_SONIC_MODE
	.comm	_HighPal,8,3                    ; @HighPal
	.comm	_PicoOpt,4,2                    ; @PicoOpt
	.comm	_POPT_DIS_32C_BORDER,4,2        ; @POPT_DIS_32C_BORDER
	.comm	_HighCol,8,3                    ; @HighCol
	.no_dead_strip	_FinalizeLine8bit
.subsections_via_symbols
