	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function Vdp2DrawNBG2
_Vdp2DrawNBG2:                          ## @Vdp2DrawNBG2
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$128, %rsp
	movq	_Vdp2Regs@GOTPCREL(%rip), %rax
	movq	(%rax), %r10
	movl	(%r10), %eax
	movl	%eax, %ecx
	andl	$4, %ecx
	movl	%ecx, -120(%rbp)
	movq	_Vdp2External@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_1
## %bb.2:
	xorl	%ecx, %ecx
	testl	$1024, %eax                     ## imm = 0x400
	sete	%cl
	movl	%ecx, -116(%rbp)
	movl	4(%r10), %eax
	shrl	$4, %eax
	andl	$3, %eax
	movl	%eax, -112(%rbp)
	movl	8(%r10), %edi
	movl	%edi, %eax
	shrl	%eax
	andl	$1, %eax
	movl	%eax, -108(%rbp)
	movl	$2, -104(%rbp)
	movl	12(%r10), %eax
	shrl	$4, %eax
	andl	$3, %eax
	movabsq	$4294967297, %r8                ## imm = 0x100000001
	cmpl	$3, %eax
	je	LBB0_6
## %bb.3:
	cmpl	$1, %eax
	je	LBB0_5
## %bb.4:
	testl	%eax, %eax
	movq	%r8, -100(%rbp)
	movw	$512, %r9w                      ## imm = 0x200
	movw	$512, %cx                       ## imm = 0x200
	jmp	LBB0_7
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_21
LBB0_6:
	movabsq	$8589934594, %rax               ## imm = 0x200000002
	movq	%rax, -100(%rbp)
	movw	$1024, %r9w                     ## imm = 0x400
	movw	$1024, %cx                      ## imm = 0x400
	jmp	LBB0_7
LBB0_5:
	movabsq	$4294967298, %rax               ## imm = 0x100000002
	movq	%rax, -100(%rbp)
	movw	$1024, %cx                      ## imm = 0x400
	movw	$512, %r9w                      ## imm = 0x200
LBB0_7:
	movzwl	16(%r10), %eax
	andl	$2047, %eax                     ## imm = 0x7FF
	xorl	%esi, %esi
                                        ## kill: def $ax killed $ax killed $eax
	xorl	%edx, %edx
	divw	%cx
	movzwl	%dx, %eax
	negl	%eax
	movl	%eax, -92(%rbp)
	movzwl	20(%r10), %eax
	andl	$2047, %eax                     ## imm = 0x7FF
                                        ## kill: def $ax killed $ax killed $eax
	xorl	%edx, %edx
	divw	%r9w
	movzwl	%dx, %eax
	negl	%eax
	movl	%eax, -88(%rbp)
	movl	24(%r10), %ecx
	movl	%ecx, %eax
	andl	$32768, %eax                    ## imm = 0x8000
	cmpl	$1, %eax
	adcl	$1, %esi
	movl	%esi, -84(%rbp)
	andl	$1, %edi
	incl	%edi
	movl	%edi, -80(%rbp)
	movb	$64, %al
	movzbl	%al, %eax
	divb	%dil
	movzbl	%al, %eax
	movl	%eax, -76(%rbp)
	movabsq	$34359738376, %rax              ## imm = 0x800000008
	movq	%rax, -72(%rbp)
	movl	%ecx, %eax
	andl	$1023, %eax                     ## imm = 0x3FF
	movl	%eax, -64(%rbp)
	shrl	$14, %ecx
	andl	$1, %ecx
	movl	%ecx, -60(%rbp)
	movl	28(%r10), %eax
	testb	$4, %al
	jne	LBB0_10
## %bb.8:
	movl	$255, -56(%rbp)
	movl	$1792, %ecx                     ## imm = 0x700
	andl	36(%r10), %ecx
	movl	%ecx, -52(%rbp)
	testb	$4, 40(%r10)
	jne	LBB0_12
## %bb.9:
	movq	_DoNothing@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_10:
	movl	32(%r10), %ecx
	shll	$3, %ecx
	notl	%ecx
	movzbl	%cl, %ecx
	movl	%ecx, -56(%rbp)
	movl	$1792, %ecx                     ## imm = 0x700
	andl	36(%r10), %ecx
	movl	%ecx, -52(%rbp)
	testb	$4, 40(%r10)
	jne	LBB0_12
## %bb.11:
	movq	_DoColorCalc@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_12:
	testb	$4, 44(%r10)
	jne	LBB0_13
## %bb.14:
	movl	60(%r10), %ecx
	movzbl	%cl, %edx
	shll	$23, %ecx
	sarl	$31, %ecx
	andl	$-256, %ecx
	orl	%edx, %ecx
	movl	%ecx, -48(%rbp)
	movl	64(%r10), %ecx
	movzbl	%cl, %edx
	shll	$23, %ecx
	sarl	$31, %ecx
	andl	$-256, %ecx
	orl	%edx, %ecx
	movl	%ecx, -44(%rbp)
	movl	68(%r10), %ecx
	jmp	LBB0_15
LBB0_13:
	movl	48(%r10), %ecx
	movzbl	%cl, %edx
	shll	$23, %ecx
	sarl	$31, %ecx
	andl	$-256, %ecx
	orl	%edx, %ecx
	movl	%ecx, -48(%rbp)
	movl	52(%r10), %ecx
	movzbl	%cl, %edx
	shll	$23, %ecx
	sarl	$31, %ecx
	andl	$-256, %ecx
	orl	%edx, %ecx
	movl	%ecx, -44(%rbp)
	movl	56(%r10), %ecx
LBB0_15:
	movzbl	%cl, %edx
	movl	%edx, -40(%rbp)
	testl	$256, %ecx                      ## imm = 0x100
	je	LBB0_17
## %bb.16:
	orl	$-256, %ecx
	movl	%ecx, -40(%rbp)
LBB0_17:
	testb	$4, %al
	jne	LBB0_18
## %bb.19:
	movq	_DoColorOffset@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_18:
	movq	_DoColorCalcWithColorOffset@GOTPCREL(%rip), %rax
LBB0_20:
	movq	%rax, -8(%rbp)
	movq	%r8, -36(%rbp)
	movq	_nbg2priority@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -16(%rbp)
	movq	_Vdp2NBG2PlaneAddr@GOTPCREL(%rip), %rax
	movq	%rax, -24(%rbp)
	leaq	-120(%rbp), %rdi
	callq	_Vdp2DrawMap
	movl	$1, %eax
LBB0_21:
	addq	$128, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_Vdp2Regs,8,3                   ## @Vdp2Regs
	.comm	_Vdp2External,4,2               ## @Vdp2External
	.comm	_DoColorCalcWithColorOffset,4,2 ## @DoColorCalcWithColorOffset
	.comm	_DoColorOffset,4,2              ## @DoColorOffset
	.comm	_DoColorCalc,4,2                ## @DoColorCalc
	.comm	_DoNothing,4,2                  ## @DoNothing
	.comm	_nbg2priority,4,2               ## @nbg2priority
	.comm	_Vdp2NBG2PlaneAddr,4,2          ## @Vdp2NBG2PlaneAddr
	.no_dead_strip	_Vdp2DrawNBG2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function Vdp2DrawNBG2
lCPI0_0:
	.long	4294967292                      ; 0xfffffffc
	.long	4294967295                      ; 0xffffffff
lCPI0_1:
	.long	3                               ; 0x3
	.long	1                               ; 0x1
lCPI0_2:
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_Vdp2DrawNBG2:                          ; @Vdp2DrawNBG2
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x8, _Vdp2Regs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Vdp2Regs@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w9, [x8]
	and	w10, w9, #0x4
	str	w10, [sp, #8]
Lloh3:
	adrp	x11, _Vdp2External@GOTPAGE
Lloh4:
	ldr	x11, [x11, _Vdp2External@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	tst	w11, w10
	b.eq	LBB0_4
; %bb.1:
	mov	w10, #1
	bic	w9, w10, w9, lsr #10
	str	w9, [sp, #12]
	ldur	d0, [x8, #4]
Lloh6:
	adrp	x9, lCPI0_0@PAGE
Lloh7:
	ldr	d1, [x9, lCPI0_0@PAGEOFF]
	ushl.2s	v1, v0, v1
Lloh8:
	adrp	x9, lCPI0_1@PAGE
Lloh9:
	ldr	d2, [x9, lCPI0_1@PAGEOFF]
	and.8b	v1, v1, v2
	str	d1, [sp, #16]
	mov	w9, #2
	str	w9, [sp, #24]
	ldr	w9, [x8, #12]
	ubfx	w9, w9, #4, #2
	cmp	w9, #3
	b.eq	LBB0_5
; %bb.2:
	cmp	w9, #1
	b.ne	LBB0_6
; %bb.3:
Lloh10:
	adrp	x9, lCPI0_2@PAGE
Lloh11:
	ldr	d1, [x9, lCPI0_2@PAGEOFF]
	mov	w10, #1024
	mov	w9, #512
	b	LBB0_7
LBB0_4:
	mov	w0, #0
	b	LBB0_19
LBB0_5:
	mov	w9, #1024
	movi.2s	v1, #2
	mov	w10, #1024
	b	LBB0_7
LBB0_6:
	mov	w9, #512
	movi.2s	v1, #1
	mov	w10, #512
LBB0_7:
	stur	d1, [sp, #28]
	ldrh	w11, [x8, #16]
	and	w11, w11, #0x7ff
	udiv	w12, w11, w10
	neg	w11, w11
	madd	w10, w12, w10, w11
	str	w10, [sp, #36]
	ldrh	w10, [x8, #20]
	and	w10, w10, #0x7ff
	udiv	w11, w10, w9
	neg	w10, w10
	madd	w9, w11, w9, w10
	str	w9, [sp, #40]
	ldr	w9, [x8, #24]
	tst	w9, #0x8000
	mov	w10, #1
	cinc	w11, w10, eq
	mov.s	w12, v0[1]
	tst	w12, #0x1
	cinc	w10, w10, ne
	stp	w11, w10, [sp, #44]
	mov	w11, #64
	udiv	w10, w11, w10
	str	w10, [sp, #52]
	movi.2s	v0, #8
	str	d0, [sp, #56]
	and	w10, w9, #0x3ff
	ubfx	w9, w9, #14, #1
	stp	w10, w9, [sp, #64]
	ldr	w9, [x8, #28]
	tbnz	w9, #2, LBB0_10
; %bb.8:
	mov	w10, #255
	str	w10, [sp, #72]
	ldr	w10, [x8, #36]
	and	w10, w10, #0x700
	str	w10, [sp, #76]
	ldrb	w10, [x8, #40]
	tbnz	w10, #2, LBB0_12
; %bb.9:
Lloh12:
	adrp	x8, _DoNothing@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DoNothing@GOTPAGEOFF]
	b	LBB0_18
LBB0_10:
	ldr	w10, [x8, #32]
	ubfiz	w10, w10, #3, #5
	eor	w10, w10, #0xff
	str	w10, [sp, #72]
	ldr	w10, [x8, #36]
	and	w10, w10, #0x700
	str	w10, [sp, #76]
	ldrb	w10, [x8, #40]
	tbnz	w10, #2, LBB0_12
; %bb.11:
Lloh14:
	adrp	x8, _DoColorCalc@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DoColorCalc@GOTPAGEOFF]
	b	LBB0_18
LBB0_12:
	ldrb	w10, [x8, #44]
	tbnz	w10, #2, LBB0_14
; %bb.13:
	ldur	d0, [x8, #60]
	movi	d1, #0x0000ff000000ff
	and.8b	v1, v0, v1
	movi.2s	v2, #1, lsl #8
	cmtst.2s	v0, v0, v2
	bic.2s	v0, #255
	orr.8b	v0, v1, v0
	str	d0, [sp, #80]
	ldr	w8, [x8, #68]
	b	LBB0_15
LBB0_14:
	ldr	d0, [x8, #48]
	movi	d1, #0x0000ff000000ff
	and.8b	v1, v0, v1
	movi.2s	v2, #1, lsl #8
	cmtst.2s	v0, v0, v2
	bic.2s	v0, #255
	orr.8b	v0, v1, v0
	str	d0, [sp, #80]
	ldr	w8, [x8, #56]
LBB0_15:
	and	w10, w8, #0xff
	str	w10, [sp, #88]
	tbz	w8, #8, LBB0_17
; %bb.16:
	orr	w8, w8, #0xffffff00
	str	w8, [sp, #88]
LBB0_17:
Lloh16:
	adrp	x8, _DoColorCalcWithColorOffset@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DoColorCalcWithColorOffset@GOTPAGEOFF]
Lloh18:
	adrp	x10, _DoColorOffset@GOTPAGE
Lloh19:
	ldr	x10, [x10, _DoColorOffset@GOTPAGEOFF]
	tst	w9, #0x4
	csel	x8, x10, x8, eq
LBB0_18:
	str	x8, [sp, #120]
	movi.2s	v0, #1
Lloh20:
	adrp	x8, _nbg2priority@GOTPAGE
Lloh21:
	ldr	x8, [x8, _nbg2priority@GOTPAGEOFF]
	stur	d0, [sp, #92]
Lloh22:
	ldr	w8, [x8]
	str	w8, [sp, #112]
Lloh23:
	adrp	x8, _Vdp2NBG2PlaneAddr@GOTPAGE
Lloh24:
	ldr	x8, [x8, _Vdp2NBG2PlaneAddr@GOTPAGEOFF]
	str	x8, [sp, #104]
	add	x0, sp, #8
	bl	_Vdp2DrawMap
	mov	w0, #1
LBB0_19:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdr	Lloh8, Lloh9
	.loh AdrpAdrp	Lloh6, Lloh8
	.loh AdrpLdr	Lloh6, Lloh7
	.loh AdrpLdr	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_Vdp2Regs,8,3                   ; @Vdp2Regs
	.comm	_Vdp2External,4,2               ; @Vdp2External
	.comm	_DoColorCalcWithColorOffset,4,2 ; @DoColorCalcWithColorOffset
	.comm	_DoColorOffset,4,2              ; @DoColorOffset
	.comm	_DoColorCalc,4,2                ; @DoColorCalc
	.comm	_DoNothing,4,2                  ; @DoNothing
	.comm	_nbg2priority,4,2               ; @nbg2priority
	.comm	_Vdp2NBG2PlaneAddr,4,2          ; @Vdp2NBG2PlaneAddr
	.no_dead_strip	_Vdp2DrawNBG2
.subsections_via_symbols
