	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nes_ntsc_blit                  ## -- Begin function nes_ntsc_blit
	.p2align	4, 0x90
_nes_ntsc_blit:                         ## @nes_ntsc_blit
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r9d killed $r9d def $r9
	movl	%ecx, %r12d
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	16(%rbp), %r13d
	leal	-1(%r9), %eax
	movq	_nes_ntsc_in_chunk@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	testl	%r13d, %r13d
	je	LBB0_7
## %bb.1:
	movq	%rsi, %rbx
	movq	24(%rbp), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_nes_ntsc_black@GOTPCREL(%rip), %r14
	movq	_OutputDepth@GOTPCREL(%rip), %r15
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_nes_ntsc_black@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	xorl	%edi, %edi
	callq	_NES_NTSC_COLOR_IN
	movl	(%r14), %esi
	movl	(%r15), %edx
	xorl	%edi, %edi
	callq	_NES_NTSC_RGB_OUT
	movl	4(%r14), %esi
	movl	(%r15), %edx
	movl	$1, %edi
	callq	_NES_NTSC_RGB_OUT
	movl	(%rbx), %esi
	movl	$1, %edi
	callq	_NES_NTSC_COLOR_IN
	movl	8(%r14), %esi
	movl	(%r15), %edx
	movl	$2, %edi
	callq	_NES_NTSC_RGB_OUT
	movl	12(%r14), %esi
	movl	(%r15), %edx
	movl	$3, %edi
	callq	_NES_NTSC_RGB_OUT
	movl	(%rbx), %esi
	movl	$2, %edi
	callq	_NES_NTSC_COLOR_IN
	movl	16(%r14), %esi
	movl	(%r15), %edx
	movl	$4, %edi
	callq	_NES_NTSC_RGB_OUT
	movl	20(%r14), %esi
	movl	(%r15), %edx
	movl	$5, %edi
	callq	_NES_NTSC_RGB_OUT
	movl	24(%r14), %esi
	movq	%rbx, %r14
	movl	(%r15), %edx
	movl	$6, %edi
	callq	_NES_NTSC_RGB_OUT
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	32(%rbp), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	cltd
	movq	_nes_ntsc_burst_count@GOTPCREL(%rip), %rcx
	idivl	(%rcx)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	leaq	(%rbx,%rax,4), %rbx
	movl	%edx, %r12d
	movl	-60(%rbp), %r13d                ## 4-byte Reload
	decl	%r13d
	je	LBB0_7
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movl	(%r14), %r14d
	movl	(%rbx), %edi
	callq	_NES_NTSC_ADJ_IN
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	movl	%r14d, %edx
	movl	%r14d, %ecx
	movl	%eax, %r8d
	callq	_NES_NTSC_BEGIN_ROW
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	movl	%r12d, -56(%rbp)                ## 4-byte Spill
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	$4, %rbx
	movl	%eax, %r13d
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	_rescale_out@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rbx), %edi
	callq	_NES_NTSC_ADJ_IN
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_NES_NTSC_COLOR_IN
	movl	(%r14), %esi
	movl	(%r15), %edx
	xorl	%edi, %edi
	callq	_NES_NTSC_RGB_OUT
	movl	4(%r14), %esi
	movl	(%r15), %edx
	movl	$1, %edi
	callq	_NES_NTSC_RGB_OUT
	movl	4(%rbx), %edi
	callq	_NES_NTSC_ADJ_IN
	movl	$1, %edi
	movl	%eax, %esi
	callq	_NES_NTSC_COLOR_IN
	movl	8(%r14), %esi
	movl	(%r15), %edx
	movl	$2, %edi
	callq	_NES_NTSC_RGB_OUT
	movl	12(%r14), %esi
	movl	(%r15), %edx
	movl	$3, %edi
	callq	_NES_NTSC_RGB_OUT
	movl	8(%rbx), %edi
	callq	_NES_NTSC_ADJ_IN
	movl	$2, %edi
	movl	%eax, %esi
	callq	_NES_NTSC_COLOR_IN
	movl	16(%r14), %esi
	movl	(%r15), %edx
	movl	$4, %edi
	callq	_NES_NTSC_RGB_OUT
	movl	20(%r14), %esi
	movl	(%r15), %edx
	movl	$5, %edi
	callq	_NES_NTSC_RGB_OUT
	movl	24(%r14), %esi
	movl	(%r15), %edx
	movl	$6, %edi
	callq	_NES_NTSC_RGB_OUT
	movslq	(%r12), %rax
	leaq	(%r14,%rax,4), %r14
	addq	$12, %rbx
	decl	%r13d
	jne	LBB0_5
	jmp	LBB0_6
LBB0_7:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_nes_ntsc_in_chunk,4,2          ## @nes_ntsc_in_chunk
	.comm	_nes_ntsc_black,4,2             ## @nes_ntsc_black
	.comm	_OutputDepth,4,2                ## @OutputDepth
	.comm	_rescale_out,4,2                ## @rescale_out
	.comm	_nes_ntsc_burst_count,4,2       ## @nes_ntsc_burst_count
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nes_ntsc_blit                  ; -- Begin function nes_ntsc_blit
	.p2align	2
_nes_ntsc_blit:                         ; @nes_ntsc_blit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
	cbz	w6, LBB0_7
; %bb.1:
	mov	x19, x7
	mov	x20, x6
	mov	x23, x3
	mov	x21, x1
	ldr	x8, [x29, #16]
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
Lloh0:
	adrp	x8, _nes_ntsc_in_chunk@GOTPAGE
Lloh1:
	ldr	x8, [x8, _nes_ntsc_in_chunk@GOTPAGEOFF]
	sub	w9, w5, #1
Lloh2:
	ldr	w8, [x8]
	sdiv	w26, w9, w8
	lsl	x8, x2, #2
	str	x8, [sp]                        ; 8-byte Folded Spill
Lloh3:
	adrp	x27, _nes_ntsc_black@GOTPAGE
Lloh4:
	ldr	x27, [x27, _nes_ntsc_black@GOTPAGEOFF]
Lloh5:
	adrp	x25, _OutputDepth@GOTPAGE
Lloh6:
	ldr	x25, [x25, _OutputDepth@GOTPAGEOFF]
Lloh7:
	adrp	x22, _rescale_out@GOTPAGE
Lloh8:
	ldr	x22, [x22, _rescale_out@GOTPAGEOFF]
	str	w26, [sp, #12]                  ; 4-byte Folded Spill
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x24, x19
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
Lloh9:
	adrp	x27, _nes_ntsc_black@GOTPAGE
Lloh10:
	ldr	x27, [x27, _nes_ntsc_black@GOTPAGEOFF]
	ldr	w1, [x27]
	mov	w0, #0
	bl	_NES_NTSC_COLOR_IN
	ldr	w1, [x24]
	ldr	w2, [x25]
	mov	w0, #0
	bl	_NES_NTSC_RGB_OUT
	ldr	w1, [x24, #4]
	ldr	w2, [x25]
	mov	w0, #1
	bl	_NES_NTSC_RGB_OUT
	ldr	w1, [x27]
	mov	w0, #1
	bl	_NES_NTSC_COLOR_IN
	ldr	w1, [x24, #8]
	ldr	w2, [x25]
	mov	w0, #2
	bl	_NES_NTSC_RGB_OUT
	ldr	w1, [x24, #12]
	ldr	w2, [x25]
	mov	w0, #3
	bl	_NES_NTSC_RGB_OUT
	ldr	w1, [x27]
	mov	w0, #2
	bl	_NES_NTSC_COLOR_IN
	ldr	w1, [x24, #16]
	ldr	w2, [x25]
	mov	w0, #4
	bl	_NES_NTSC_RGB_OUT
	ldr	w1, [x24, #20]
	ldr	w2, [x25]
	mov	w0, #5
	bl	_NES_NTSC_RGB_OUT
	ldr	w1, [x24, #24]
	ldr	w2, [x25]
	mov	w0, #6
	bl	_NES_NTSC_RGB_OUT
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	add	x19, x19, x8
	add	w8, w23, #1
Lloh11:
	adrp	x9, _nes_ntsc_burst_count@GOTPAGE
Lloh12:
	ldr	x9, [x9, _nes_ntsc_burst_count@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	sdiv	w10, w8, w9
	msub	w23, w10, w9, w8
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	add	x21, x21, x8
	subs	w20, w20, #1
	ldr	w26, [sp, #12]                  ; 4-byte Folded Reload
	b.eq	LBB0_7
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	ldr	w24, [x27]
	ldr	w0, [x21]
	bl	_NES_NTSC_ADJ_IN
	mov	x4, x0
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	mov	x1, x23
	mov	x2, x24
	mov	x3, x24
	bl	_NES_NTSC_BEGIN_ROW
	cbz	w26, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w27, #4
	mov	x24, x19
LBB0_6:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x28, x21, x27
	ldr	w0, [x28]
	bl	_NES_NTSC_ADJ_IN
	mov	x1, x0
	mov	w0, #0
	bl	_NES_NTSC_COLOR_IN
	ldr	w1, [x24]
	ldr	w2, [x25]
	mov	w0, #0
	bl	_NES_NTSC_RGB_OUT
	ldr	w1, [x24, #4]
	ldr	w2, [x25]
	mov	w0, #1
	bl	_NES_NTSC_RGB_OUT
	ldr	w0, [x28, #4]
	bl	_NES_NTSC_ADJ_IN
	mov	x1, x0
	mov	w0, #1
	bl	_NES_NTSC_COLOR_IN
	ldr	w1, [x24, #8]
	ldr	w2, [x25]
	mov	w0, #2
	bl	_NES_NTSC_RGB_OUT
	ldr	w1, [x24, #12]
	ldr	w2, [x25]
	mov	w0, #3
	bl	_NES_NTSC_RGB_OUT
	ldr	w0, [x28, #8]
	bl	_NES_NTSC_ADJ_IN
	mov	x1, x0
	mov	w0, #2
	bl	_NES_NTSC_COLOR_IN
	ldr	w1, [x24, #16]
	ldr	w2, [x25]
	mov	w0, #4
	bl	_NES_NTSC_RGB_OUT
	ldr	w1, [x24, #20]
	ldr	w2, [x25]
	mov	w0, #5
	bl	_NES_NTSC_RGB_OUT
	ldr	w1, [x24, #24]
	ldr	w2, [x25]
	mov	w0, #6
	bl	_NES_NTSC_RGB_OUT
	ldrsw	x8, [x22]
	add	x24, x24, x8, lsl #2
	add	x27, x27, #12
	subs	w26, w26, #1
	b.ne	LBB0_6
	b	LBB0_3
LBB0_7:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_nes_ntsc_in_chunk,4,2          ; @nes_ntsc_in_chunk
	.comm	_nes_ntsc_black,4,2             ; @nes_ntsc_black
	.comm	_OutputDepth,4,2                ; @OutputDepth
	.comm	_rescale_out,4,2                ; @rescale_out
	.comm	_nes_ntsc_burst_count,4,2       ; @nes_ntsc_burst_count
.subsections_via_symbols
