	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function display
LCPI0_0:
	.short	2081                            ## 0x821
	.short	2081                            ## 0x821
	.short	2081                            ## 0x821
	.short	2081                            ## 0x821
	.short	2081                            ## 0x821
	.short	2081                            ## 0x821
	.short	2081                            ## 0x821
	.short	2081                            ## 0x821
LCPI0_1:
	.long	6371                            ## 0x18e3
	.long	6371                            ## 0x18e3
	.long	6371                            ## 0x18e3
	.long	6371                            ## 0x18e3
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_display:                               ## @display
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_sdl_lock_pixels
	movq	_burst_phase@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	$1, %ecx
	movq	_setup@GOTPCREL(%rip), %rdx
	cmpq	$0, (%rdx)
	cmovnel	%ebx, %ecx
	movl	%ecx, (%rax)
	movq	_ntsc@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_nes_pixels@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_nes_width@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_nes_height@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_sdl_pixels@GOTPCREL(%rip), %rbx
	movq	_sdl_pitch@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	addl	%eax, %eax
	movl	%edx, %r8d
	pushq	%rax
	pushq	(%rbx)
	callq	_nes_ntsc_blit
	addq	$16, %rsp
	movq	_out_height@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	cmpl	$3, %eax
	jl	LBB0_17
## %bb.1:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	decl	%eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rcx
	movslq	(%r14), %rdx
	movq	_out_width@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rdx, %rsi
	negq	%rsi
	movq	%rsi, -136(%rbp)                ## 8-byte Spill
	leaq	(%rcx,%rdx), %r15
	leaq	(%rdx,%rdx), %rsi
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	leaq	(%rcx,%rdx,2), %r10
	leal	-1(%rax), %esi
	movq	%rsi, -144(%rbp)                ## 8-byte Spill
	leaq	1(%rsi), %rbx
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	andq	$-8, %rbx
	leaq	(%rbx,%rbx), %rsi
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
                                        ## kill: def $eax killed $eax killed $rax
	subl	%ebx, %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	$2, %eax
	subq	%rdx, %rax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	pxor	%xmm0, %xmm0
	movdqa	LCPI0_0(%rip), %xmm1            ## xmm1 = [2081,2081,2081,2081,2081,2081,2081,2081]
	movdqa	LCPI0_1(%rip), %xmm2            ## xmm2 = [6371,6371,6371,6371]
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	leaq	2(%rdx), %rax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movl	$1, %r9d
	xorl	%r12d, %r12d
	movq	%rcx, -152(%rbp)                ## 8-byte Spill
	movq	%r10, -104(%rbp)                ## 8-byte Spill
	movq	%r15, -112(%rbp)                ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	addq	$2, %r9
	incq	%r12
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	addq	%rax, %r15
	addq	%rax, %r10
	addq	%rax, %rcx
	cmpq	-56(%rbp), %r9                  ## 8-byte Folded Reload
	jae	LBB0_17
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
                                        ##     Child Loop BB0_15 Depth 2
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_16
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r9, %r14
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	imulq	%rax, %r14
	addq	-152(%rbp), %r14                ## 8-byte Folded Reload
	cmpl	$7, -144(%rbp)                  ## 4-byte Folded Reload
	jb	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$16, %eax
	jb	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	imulq	%r12, %rax
	movq	-112(%rbp), %rdx                ## 8-byte Reload
	addq	%rax, %rdx
	addq	-104(%rbp), %rax                ## 8-byte Folded Reload
	subq	%rax, %rdx
	cmpq	$16, %rdx
	jb	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	-88(%rbp), %r14                 ## 8-byte Folded Reload
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	(%rcx,%rax,2), %xmm3
	pmovzxwd	%xmm3, %xmm4                    ## xmm4 = xmm3[0],zero,xmm3[1],zero,xmm3[2],zero,xmm3[3],zero
	movdqu	(%r10,%rax,2), %xmm5
	pmovzxwd	%xmm5, %xmm6                    ## xmm6 = xmm5[0],zero,xmm5[1],zero,xmm5[2],zero,xmm5[3],zero
	movdqa	%xmm5, %xmm7
	pxor	%xmm3, %xmm5
	punpckhwd	%xmm0, %xmm3            ## xmm3 = xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
	paddd	%xmm4, %xmm6
	punpckhwd	%xmm0, %xmm7            ## xmm7 = xmm7[4],xmm0[4],xmm7[5],xmm0[5],xmm7[6],xmm0[6],xmm7[7],xmm0[7]
	paddd	%xmm3, %xmm7
	pand	%xmm1, %xmm5
	pmovzxwd	%xmm5, %xmm3                    ## xmm3 = xmm5[0],zero,xmm5[1],zero,xmm5[2],zero,xmm5[3],zero
	punpckhwd	%xmm0, %xmm5            ## xmm5 = xmm5[4],xmm0[4],xmm5[5],xmm0[5],xmm5[6],xmm0[6],xmm5[7],xmm0[7]
	paddd	%xmm7, %xmm5
	paddd	%xmm6, %xmm3
	movdqa	%xmm5, %xmm4
	psrld	$1, %xmm4
	movdqa	%xmm3, %xmm6
	psrld	$1, %xmm6
	psrld	$4, %xmm3
	psrld	$4, %xmm5
	pand	%xmm2, %xmm5
	psubd	%xmm5, %xmm4
	pand	%xmm2, %xmm3
	psubd	%xmm3, %xmm6
	pblendw	$170, %xmm0, %xmm4              ## xmm4 = xmm4[0],xmm0[1],xmm4[2],xmm0[3],xmm4[4],xmm0[5],xmm4[6],xmm0[7]
	pblendw	$170, %xmm0, %xmm6              ## xmm6 = xmm6[0],xmm0[1],xmm6[2],xmm0[3],xmm6[4],xmm0[5],xmm6[6],xmm0[7]
	packusdw	%xmm4, %xmm6
	movdqu	%xmm6, (%r15,%rax,2)
	addq	$8, %rax
	cmpq	%rax, %rbx
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-60(%rbp), %eax                 ## 4-byte Reload
                                        ## kill: def $eax killed $eax def $rax
	cmpq	%rbx, -96(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_16
	.p2align	4, 0x90
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	testb	$1, %al
	jne	LBB0_12
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %edx
	cmpl	$1, %eax
	je	LBB0_16
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
                                        ## kill: def $eax killed $eax killed $rax def $rax
	testb	$1, %al
	je	LBB0_11
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-136(%rbp), %rdx                ## 8-byte Reload
	movzwl	(%r14,%rdx), %edx
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movzwl	(%r14,%rsi), %esi
	leal	(%rsi,%rdx), %edi
	xorl	%edx, %esi
	andl	$2081, %esi                     ## imm = 0x821
	addl	%edi, %esi
	movl	%esi, %edx
	shrl	%edx
	shrl	$4, %esi
	andl	$6371, %esi                     ## imm = 0x18E3
	subl	%esi, %edx
	movw	%dx, (%r14)
	addq	$2, %r14
	leal	-1(%rax), %edx
	cmpl	$1, %eax
	je	LBB0_16
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-128(%rbp), %rax                ## 8-byte Reload
	leaq	(%r14,%rax), %r13
	movq	-120(%rbp), %rax                ## 8-byte Reload
	leaq	(%r14,%rax), %r11
	movl	%edx, %r8d
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movzwl	-2(%r13,%rax,2), %edx
	movzwl	-2(%r11,%rax,2), %esi
	leal	(%rsi,%rdx), %edi
	xorl	%edx, %esi
	andl	$2081, %esi                     ## imm = 0x821
	addl	%edi, %esi
	movl	%esi, %edx
	shrl	%edx
	shrl	$4, %esi
	andl	$6371, %esi                     ## imm = 0x18E3
	subl	%esi, %edx
	movw	%dx, (%r14,%rax,2)
	movzwl	(%r13,%rax,2), %edx
	movzwl	(%r11,%rax,2), %esi
	leal	(%rsi,%rdx), %edi
	xorl	%edx, %esi
	andl	$2081, %esi                     ## imm = 0x821
	addl	%edi, %esi
	movl	%esi, %edx
	shrl	%edx
	shrl	$4, %esi
	andl	$6371, %esi                     ## imm = 0x18E3
	subl	%esi, %edx
	movw	%dx, 2(%r14,%rax,2)
	addq	$2, %rax
	cmpl	%eax, %r8d
	jne	LBB0_15
	jmp	LBB0_16
LBB0_17:
	xorl	%eax, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sdl_display                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_burst_phase,4,2                ## @burst_phase
	.comm	_setup,8,3                      ## @setup
	.comm	_ntsc,4,2                       ## @ntsc
	.comm	_nes_pixels,4,2                 ## @nes_pixels
	.comm	_nes_width,4,2                  ## @nes_width
	.comm	_nes_height,4,2                 ## @nes_height
	.comm	_sdl_pixels,8,3                 ## @sdl_pixels
	.comm	_sdl_pitch,4,2                  ## @sdl_pitch
	.comm	_out_height,4,2                 ## @out_height
	.comm	_out_width,4,2                  ## @out_width
	.no_dead_strip	_display
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function display
_display:                               ; @display
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	bl	_sdl_lock_pixels
Lloh0:
	adrp	x8, _burst_phase@GOTPAGE
Lloh1:
	ldr	x8, [x8, _burst_phase@GOTPAGEOFF]
	ldr	w9, [x8]
Lloh2:
	adrp	x10, _setup@GOTPAGE
Lloh3:
	ldr	x10, [x10, _setup@GOTPAGEOFF]
	eor	w9, w9, #0x1
Lloh4:
	ldr	x10, [x10]
	cmp	x10, #0
	csel	w3, w9, wzr, eq
Lloh5:
	adrp	x9, _ntsc@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ntsc@GOTPAGEOFF]
	str	w3, [x8]
Lloh7:
	ldr	w0, [x9]
Lloh8:
	adrp	x8, _nes_pixels@GOTPAGE
Lloh9:
	ldr	x8, [x8, _nes_pixels@GOTPAGEOFF]
Lloh10:
	adrp	x9, _nes_width@GOTPAGE
Lloh11:
	ldr	x9, [x9, _nes_width@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	ldr	w2, [x9]
Lloh14:
	adrp	x8, _nes_height@GOTPAGE
Lloh15:
	ldr	x8, [x8, _nes_height@GOTPAGEOFF]
Lloh16:
	adrp	x19, _sdl_pixels@GOTPAGE
Lloh17:
	ldr	x19, [x19, _sdl_pixels@GOTPAGEOFF]
Lloh18:
	ldr	w5, [x8]
	ldr	x6, [x19]
Lloh19:
	adrp	x20, _sdl_pitch@GOTPAGE
Lloh20:
	ldr	x20, [x20, _sdl_pitch@GOTPAGEOFF]
	ldr	w8, [x20]
	lsl	w7, w8, #1
	mov	x4, x2
	bl	_nes_ntsc_blit
Lloh21:
	adrp	x8, _out_height@GOTPAGE
Lloh22:
	ldr	x8, [x8, _out_height@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x8]
	cmp	w9, #3
	b.lt	LBB0_13
; %bb.1:
	mov	x8, #0
	sub	w9, w9, #1
	ldr	x10, [x19]
	ldrsw	x11, [x20]
Lloh24:
	adrp	x12, _out_width@GOTPAGE
Lloh25:
	ldr	x12, [x12, _out_width@GOTPAGEOFF]
Lloh26:
	ldr	w12, [x12]
	neg	x13, x11
	add	x14, x10, x11
	lsl	x15, x11, #1
	add	x16, x15, x10
	sub	w17, w12, #1
	add	x0, x17, #1
	and	x1, x0, #0x1fffffff8
	lsl	x2, x1, #1
	sub	w3, w12, w1
	mov	w4, #1
	mov	w5, #2081
	mov	w6, #6371
	dup.8h	v0, w5
	dup.4s	v1, w6
	mov	x7, x10
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x4, x4, #2
	add	x8, x8, #1
	add	x7, x7, x15
	cmp	x4, x9
	b.hs	LBB0_13
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
                                        ;     Child Loop BB0_12 Depth 2
	cbz	w12, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	madd	x19, x4, x11, x10
	cmp	w17, #7
	b.hs	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x20, x12
	b	LBB0_12
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w11, #16
	b.lo	LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	mul	x20, x15, x8
	add	x21, x14, x20
	add	x20, x16, x20
	sub	x21, x21, x20
	mov	x20, x12
	cmp	x21, #16
	b.lo	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x19, x19, x2
	mov	x20, x1
	mov	x21, x7
LBB0_9:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	q2, [x21]
	ldr	q3, [x21, x15]
	uaddl2.4s	v4, v3, v2
	uaddl.4s	v5, v3, v2
	eor.16b	v2, v3, v2
	and.16b	v2, v2, v0
	ushll2.4s	v3, v2, #0
	ushll.4s	v6, v2, #0
	uaddw.4s	v7, v5, v2
	uaddw2.4s	v2, v4, v2
	uhadd.4s	v5, v5, v6
	uhadd.4s	v3, v4, v3
	ushr.4s	v2, v2, #4
	ushr.4s	v4, v7, #4
	and.16b	v4, v4, v1
	and.16b	v2, v2, v1
	sub.4s	v2, v3, v2
	sub.4s	v3, v5, v4
	uzp1.8h	v2, v3, v2
	str	q2, [x21, x11]
	add	x21, x21, #16
	subs	x20, x20, #8
	b.ne	LBB0_9
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x20, x3
	cmp	x0, x1
	b.ne	LBB0_12
	b	LBB0_2
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x20, x12
LBB0_12:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldrh	w21, [x19, x13]
	ldrh	w22, [x19, x11]
	eor	w23, w22, w21
	and	w23, w23, w5
	add	w21, w22, w21
	add	w21, w21, w23
	lsr	w22, w21, #1
	and	w21, w6, w21, lsr #4
	sub	w21, w22, w21
	strh	w21, [x19], #2
	subs	w20, w20, #1
	b.ne	LBB0_12
	b	LBB0_2
LBB0_13:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_sdl_display
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh18
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_burst_phase,4,2                ; @burst_phase
	.comm	_setup,8,3                      ; @setup
	.comm	_ntsc,4,2                       ; @ntsc
	.comm	_nes_pixels,4,2                 ; @nes_pixels
	.comm	_nes_width,4,2                  ; @nes_width
	.comm	_nes_height,4,2                 ; @nes_height
	.comm	_sdl_pixels,8,3                 ; @sdl_pixels
	.comm	_sdl_pitch,4,2                  ; @sdl_pitch
	.comm	_out_height,4,2                 ; @out_height
	.comm	_out_width,4,2                  ; @out_width
	.no_dead_strip	_display
.subsections_via_symbols
