	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Vdp2DrawScrollBitmap           ## -- Begin function Vdp2DrawScrollBitmap
	.p2align	4, 0x90
_Vdp2DrawScrollBitmap:                  ## @Vdp2DrawScrollBitmap
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	leaq	-64(%rbp), %rsi
	callq	_HandleClipping
	movl	(%r15), %eax
	cmpq	$4, %rax
	ja	LBB0_33
## %bb.1:
	leaq	L_str.2(%rip), %rdi
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_2:
	movl	4(%r15), %esi
	addl	-64(%rbp), %esi
	movl	%esi, 4(%r15)
	movl	-60(%rbp), %r14d
	movl	-56(%rbp), %ecx
	cmpl	%ecx, %r14d
	jge	LBB0_33
## %bb.3:
	movl	-48(%rbp), %eax
	movq	_Vdp2Ram@GOTPCREL(%rip), %r12
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	-56(%rbp), %ecx
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	addl	-44(%rbp), %esi
	movl	%esi, 4(%r15)
	incl	%r14d
	cmpl	%ecx, %r14d
	jge	LBB0_33
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movl	-52(%rbp), %ebx
	cmpl	%eax, %ebx
	jl	LBB0_5
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=2
	orl	12(%r15), %eax
	addl	8(%r15), %eax
	movl	%eax, %edi
	callq	_Vdp2ColorRamGetColor
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	*16(%r15)
	movl	%eax, %edx
	orl	$32768, %edx                    ## imm = 0x8000
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=2
	movl	24(%r15), %ecx
	movl	%ebx, %edi
	movl	%r14d, %esi
	callq	_vdp2putpixel
	incl	%ebx
	movl	-48(%rbp), %eax
	movl	4(%r15), %esi
	cmpl	%eax, %ebx
	jge	LBB0_9
LBB0_5:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r12), %edi
	callq	_T1ReadByte
	incl	4(%r15)
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	xorl	%edx, %edx
	cmpl	$0, 28(%r15)
	jne	LBB0_8
	jmp	LBB0_7
LBB0_31:
	leaq	L_str(%rip), %rdi
LBB0_32:
	callq	_puts
	jmp	LBB0_33
LBB0_11:
	movl	-64(%rbp), %esi
	movl	-44(%rbp), %eax
	addl	%esi, %esi
	movl	%esi, -64(%rbp)
	addl	%eax, %eax
	movl	%eax, -44(%rbp)
	addl	4(%r15), %esi
	movl	%esi, 4(%r15)
	movslq	-60(%rbp), %rbx
	movl	-56(%rbp), %edx
	cmpl	%edx, %ebx
	jge	LBB0_33
## %bb.12:
	movl	-48(%rbp), %ecx
	movq	_vdp2_prio@GOTPCREL(%rip), %r14
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	-56(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	4(%r15), %esi
LBB0_20:                                ##   in Loop: Header=BB0_13 Depth=1
	addl	%eax, %esi
	movl	%esi, 4(%r15)
	incq	%rbx
	movslq	%edx, %rdi
	cmpq	%rdi, %rbx
	jge	LBB0_33
LBB0_13:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_14 Depth 2
	movslq	-52(%rbp), %r12
	cmpl	%ecx, %r12d
	jge	LBB0_20
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_13 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_Vdp2Ram@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_T1ReadWord
	movl	%eax, %edi
	addl	$2, 4(%r15)
	testl	$32768, %eax                    ## imm = 0x8000
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=2
	xorl	%eax, %eax
	cmpl	$0, 28(%r15)
	jne	LBB0_17
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=2
	movq	16(%r15), %r13
	callq	_SAT2YAB1
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	*%r13
	orl	$32768, %eax                    ## imm = 0x8000
LBB0_17:                                ##   in Loop: Header=BB0_14 Depth=2
	movq	_vdp2_fb@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_vdp2width@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	imulq	%rbx, %rdx
	addq	%r12, %rdx
	movl	%eax, (%rcx,%rdx,4)
	movl	24(%r15), %eax
	movq	(%r14), %rcx
	movq	(%rcx,%rbx,8), %rcx
	movl	%eax, (%rcx,%r12,4)
	incq	%r12
	movslq	-48(%rbp), %rcx
	cmpq	%rcx, %r12
	jge	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_14 Depth=2
	movl	4(%r15), %esi
	jmp	LBB0_14
LBB0_21:
	movl	-64(%rbp), %esi
	movl	-44(%rbp), %eax
	shll	$2, %esi
	movl	%esi, -64(%rbp)
	shll	$2, %eax
	movl	%eax, -44(%rbp)
	addl	4(%r15), %esi
	movl	%esi, 4(%r15)
	movl	-60(%rbp), %r14d
	movl	-56(%rbp), %ecx
	cmpl	%ecx, %r14d
	jge	LBB0_33
## %bb.22:
	movl	-48(%rbp), %edx
	movq	_Vdp2Ram@GOTPCREL(%rip), %r12
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_29:                                ##   in Loop: Header=BB0_23 Depth=1
	movl	-56(%rbp), %ecx
	movl	-44(%rbp), %eax
	movl	4(%r15), %esi
LBB0_30:                                ##   in Loop: Header=BB0_23 Depth=1
	addl	%eax, %esi
	movl	%esi, 4(%r15)
	incl	%r14d
	cmpl	%ecx, %r14d
	jge	LBB0_33
LBB0_23:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_24 Depth 2
	movl	-52(%rbp), %ebx
	cmpl	%edx, %ebx
	jge	LBB0_30
	.p2align	4, 0x90
LBB0_24:                                ##   Parent Loop BB0_23 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r12), %edi
	callq	_T1ReadLong
                                        ## kill: def $eax killed $eax def $rax
	addl	$4, 4(%r15)
	testl	%eax, %eax
	js	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=2
	xorl	%edx, %edx
	cmpl	$0, 28(%r15)
	jne	LBB0_27
LBB0_26:                                ##   in Loop: Header=BB0_24 Depth=2
	movl	%eax, %ecx
	shrl	$19, %ecx
	andl	$31, %ecx
	movl	%eax, %edx
	shrl	$6, %edx
	andl	$992, %edx                      ## imm = 0x3E0
	orl	%ecx, %edx
	shll	$7, %eax
	andl	$31744, %eax                    ## imm = 0x7C00
	leal	(%rax,%rdx), %esi
	addl	$32768, %esi                    ## imm = 0x8000
	movq	%r15, %rdi
	callq	*16(%r15)
	movl	%eax, %edx
LBB0_27:                                ##   in Loop: Header=BB0_24 Depth=2
	movl	24(%r15), %ecx
	movl	%ebx, %edi
	movl	%r14d, %esi
	callq	_vdp2putpixel
	incl	%ebx
	movl	-48(%rbp), %edx
	cmpl	%edx, %ebx
	jge	LBB0_29
## %bb.28:                              ##   in Loop: Header=BB0_24 Depth=2
	movl	4(%r15), %esi
	jmp	LBB0_24
LBB0_33:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_32, LBB0_32-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_31, LBB0_31-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_21, LBB0_21-LJTI0_0
LJTI0_0:
	.long	L0_0_set_32
	.long	L0_0_set_2
	.long	L0_0_set_31
	.long	L0_0_set_11
	.long	L0_0_set_21
	.end_data_region
                                        ## -- End function
	.comm	_Vdp2Ram,4,2                    ## @Vdp2Ram
	.comm	_vdp2_fb,8,3                    ## @vdp2_fb
	.comm	_vdp2width,4,2                  ## @vdp2width
	.comm	_vdp2_prio,8,3                  ## @vdp2_prio
	.section	__TEXT,__cstring,cstring_literals
L_str:                                  ## @str
	.asciz	"vdp2 bitmap 16bpp palette draw"

L_str.2:                                ## @str.2
	.asciz	"vdp2 bitmap 4 bpp draw"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Vdp2DrawScrollBitmap           ; -- Begin function Vdp2DrawScrollBitmap
	.p2align	2
_Vdp2DrawScrollBitmap:                  ; @Vdp2DrawScrollBitmap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	add	x1, sp, #8
	bl	_HandleClipping
	ldr	w8, [x19]
	cmp	w8, #4
	b.hi	LBB0_36
; %bb.1:
Lloh0:
	adrp	x0, l_str.2@PAGE
Lloh1:
	add	x0, x0, l_str.2@PAGEOFF
Lloh2:
	adrp	x9, lJTI0_0@PAGE
Lloh3:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	ldr	w8, [x19, #4]
	ldp	w9, w20, [sp, #8]
	add	w1, w8, w9
	str	w1, [x19, #4]
	ldr	w9, [sp, #16]
	cmp	w20, w9
	b.ge	LBB0_36
; %bb.3:
	ldr	w8, [sp, #24]
Lloh4:
	adrp	x22, _Vdp2Ram@GOTPAGE
Lloh5:
	ldr	x22, [x22, _Vdp2Ram@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w9, [sp, #16]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w10, [sp, #28]
	add	w1, w1, w10
	str	w1, [x19, #4]
	add	w20, w20, #1
	cmp	w20, w9
	b.ge	LBB0_36
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	ldr	w21, [sp, #20]
	cmp	w21, w8
	b.lt	LBB0_9
	b	LBB0_5
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=2
	ldp	w8, w9, [x19, #8]
	orr	w9, w9, w0
	add	w0, w9, w8
	bl	_Vdp2ColorRamGetColor
	mov	x1, x0
	ldr	x8, [x19, #16]
	mov	x0, x19
	blr	x8
	orr	w2, w0, #0x8000
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	ldr	w3, [x19, #24]
	mov	x0, x21
	mov	x1, x20
	bl	_vdp2putpixel
	add	w21, w21, #1
	ldr	w8, [sp, #24]
	ldr	w1, [x19, #4]
	cmp	w21, w8
	b.ge	LBB0_4
LBB0_9:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x22]
	bl	_T1ReadByte
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
	cbnz	w0, LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	w8, [x19, #28]
	cbz	w8, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=2
	mov	w2, #0
	b	LBB0_8
LBB0_12:
Lloh6:
	adrp	x0, l_str@PAGE
Lloh7:
	add	x0, x0, l_str@PAGEOFF
LBB0_13:
	bl	_puts
	b	LBB0_36
LBB0_14:
	ldp	w8, w20, [sp, #8]
                                        ; kill: def $w20 killed $w20 def $x20
	sxtw	x20, w20
	lsl	w9, w8, #1
	ldr	w8, [sp, #28]
	ldr	w10, [sp, #16]
	lsl	w8, w8, #1
	str	w9, [sp, #8]
	str	w8, [sp, #28]
	ldr	w11, [x19, #4]
	add	w1, w11, w9
	str	w1, [x19, #4]
	cmp	w20, w10
	b.ge	LBB0_36
; %bb.15:
	ldr	w9, [sp, #24]
Lloh8:
	adrp	x21, _Vdp2Ram@GOTPAGE
Lloh9:
	ldr	x21, [x21, _Vdp2Ram@GOTPAGEOFF]
Lloh10:
	adrp	x22, _vdp2_fb@GOTPAGE
Lloh11:
	ldr	x22, [x22, _vdp2_fb@GOTPAGEOFF]
Lloh12:
	adrp	x23, _vdp2width@GOTPAGE
Lloh13:
	ldr	x23, [x23, _vdp2width@GOTPAGEOFF]
Lloh14:
	adrp	x24, _vdp2_prio@GOTPAGE
Lloh15:
	ldr	x24, [x24, _vdp2_prio@GOTPAGEOFF]
	b	LBB0_18
LBB0_16:                                ;   in Loop: Header=BB0_18 Depth=1
	ldr	w1, [x19, #4]
	ldr	w8, [sp, #28]
	ldr	w10, [sp, #16]
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	add	w1, w1, w8
	str	w1, [x19, #4]
	add	x20, x20, #1
	cmp	x20, w10, sxtw
	b.ge	LBB0_36
LBB0_18:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_19 Depth 2
	ldrsw	x25, [sp, #20]
	cmp	w25, w9
	b.ge	LBB0_17
LBB0_19:                                ;   Parent Loop BB0_18 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x21]
	bl	_T1ReadWord
	ldr	w8, [x19, #4]
	add	w8, w8, #2
	str	w8, [x19, #4]
	tbnz	w0, #15, LBB0_22
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=2
	ldr	w8, [x19, #28]
	cbz	w8, LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_19 Depth=2
	mov	w8, #0
	b	LBB0_23
LBB0_22:                                ;   in Loop: Header=BB0_19 Depth=2
	ldr	x26, [x19, #16]
	bl	_SAT2YAB1
	mov	x1, x0
	mov	x0, x19
	blr	x26
	orr	w8, w0, #0x8000
LBB0_23:                                ;   in Loop: Header=BB0_19 Depth=2
	ldr	x9, [x22]
	ldrsw	x10, [x23]
	madd	x10, x20, x10, x25
	str	w8, [x9, x10, lsl #2]
	ldr	x8, [x24]
	ldr	x8, [x8, x20, lsl #3]
	ldr	w9, [x19, #24]
	str	w9, [x8, x25, lsl #2]
	add	x25, x25, #1
	ldrsw	x9, [sp, #24]
	cmp	x25, x9
	b.ge	LBB0_16
; %bb.24:                               ;   in Loop: Header=BB0_19 Depth=2
	ldr	w1, [x19, #4]
	b	LBB0_19
LBB0_25:
	ldp	w8, w20, [sp, #8]
	lsl	w9, w8, #2
	ldr	w8, [sp, #28]
	ldr	w10, [sp, #16]
	lsl	w8, w8, #2
	str	w9, [sp, #8]
	str	w8, [sp, #28]
	ldr	w11, [x19, #4]
	add	w1, w11, w9
	str	w1, [x19, #4]
	cmp	w20, w10
	b.ge	LBB0_36
; %bb.26:
	ldr	w9, [sp, #24]
Lloh16:
	adrp	x22, _Vdp2Ram@GOTPAGE
Lloh17:
	ldr	x22, [x22, _Vdp2Ram@GOTPAGEOFF]
	b	LBB0_29
LBB0_27:                                ;   in Loop: Header=BB0_29 Depth=1
	ldr	w1, [x19, #4]
	ldr	w8, [sp, #28]
	ldr	w10, [sp, #16]
LBB0_28:                                ;   in Loop: Header=BB0_29 Depth=1
	add	w1, w1, w8
	str	w1, [x19, #4]
	add	w20, w20, #1
	cmp	w20, w10
	b.ge	LBB0_36
LBB0_29:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_30 Depth 2
	ldr	w21, [sp, #20]
	cmp	w21, w9
	b.ge	LBB0_28
LBB0_30:                                ;   Parent Loop BB0_29 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x22]
	bl	_T1ReadLong
	ldr	w8, [x19, #4]
	add	w8, w8, #4
	str	w8, [x19, #4]
	tbnz	w0, #31, LBB0_33
; %bb.31:                               ;   in Loop: Header=BB0_30 Depth=2
	ldr	w8, [x19, #28]
	cbz	w8, LBB0_33
; %bb.32:                               ;   in Loop: Header=BB0_30 Depth=2
	mov	w2, #0
	b	LBB0_34
LBB0_33:                                ;   in Loop: Header=BB0_30 Depth=2
	lsr	w8, w0, #3
	lsr	w9, w0, #6
	and	w9, w9, #0x3e0
	bfxil	w9, w0, #19, #5
	bfi	w9, w8, #10, #5
	orr	w1, w9, #0x8000
	ldr	x8, [x19, #16]
	mov	x0, x19
	blr	x8
	mov	x2, x0
LBB0_34:                                ;   in Loop: Header=BB0_30 Depth=2
	ldr	w3, [x19, #24]
	mov	x0, x21
	mov	x1, x20
	bl	_vdp2putpixel
	add	w21, w21, #1
	ldr	w9, [sp, #24]
	cmp	w21, w9
	b.ge	LBB0_27
; %bb.35:                               ;   in Loop: Header=BB0_30 Depth=2
	ldr	w1, [x19, #4]
	b	LBB0_30
LBB0_36:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_13-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_12-LBB0_2)>>2
	.byte	(LBB0_14-LBB0_2)>>2
	.byte	(LBB0_25-LBB0_2)>>2
                                        ; -- End function
	.comm	_Vdp2Ram,4,2                    ; @Vdp2Ram
	.comm	_vdp2_fb,8,3                    ; @vdp2_fb
	.comm	_vdp2width,4,2                  ; @vdp2width
	.comm	_vdp2_prio,8,3                  ; @vdp2_prio
	.section	__TEXT,__cstring,cstring_literals
l_str:                                  ; @str
	.asciz	"vdp2 bitmap 16bpp palette draw"

l_str.2:                                ; @str.2
	.asciz	"vdp2 bitmap 4 bpp draw"

.subsections_via_symbols
