	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function main
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_main
	.p2align	4, 0x90
_main:                                  ## @main
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_nes_ntsc_composite@GOTPCREL(%rip), %rax
	movups	(%rax), %xmm0
	movups	16(%rax), %xmm1
	movq	_setup@GOTPCREL(%rip), %rbx
	movups	%xmm1, 16(%rbx)
	movups	%xmm0, (%rbx)
	xorl	%eax, %eax
	callq	_init
	movq	_out_width@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_out_height@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edx
	callq	_sdl_init
	xorl	%eax, %eax
	callq	_sdl_run
	testq	%rax, %rax
	je	LBB0_17
## %bb.1:
	movl	$1, %r12d
	movq	_key_pressed@GOTPCREL(%rip), %r15
	leaq	LJTI0_0(%rip), %r14
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_display
	movl	(%r15), %eax
	leal	-128(%rax), %ecx
	cmpl	$5, %ecx
	ja	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	(%r14,%rcx,4), %rax
	addq	%r14, %rax
	jmpq	*%rax
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_nes_ntsc_svideo@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_mouse_moved@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_16
	jmp	LBB0_13
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_nes_ntsc_rgb@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_nes_ntsc_monochrome@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	testl	%r13d, %r13d
	sete	%al
	movl	%eax, %r13d
	jmp	LBB0_13
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_nes_ntsc_composite@GOTPCREL(%rip), %rax
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movups	(%rax), %xmm0
	movups	%xmm0, (%rbx)
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_mouse_x@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	decl	%eax
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movq	_mouse_y@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	-1(%rax,%rax), %eax
	xorps	%xmm1, %xmm1
	cvtsi2ss	%eax, %xmm1
	movss	%xmm0, (%rbx)
	movss	%xmm1, 4(%rbx)
	movl	%r12d, 8(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rbx)
	testl	%r13d, %r13d
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	leaq	_main.matrix(%rip), %rax
	movq	%rax, 16(%rbx)
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_ntsc@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_nes_ntsc_init
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_sdl_run
	testq	%rax, %rax
	jne	LBB0_2
	jmp	LBB0_17
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	testl	%r12d, %r12d
	sete	%al
	movl	%eax, %r12d
	jmp	LBB0_13
LBB0_17:
	movq	_ntsc@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_free
	xorl	%eax, %eax
	callq	_write_palette
	xorl	%eax, %eax
	addq	$8, %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_7, LBB0_7-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
LJTI0_0:
	.long	L0_0_set_7
	.long	L0_0_set_8
	.long	L0_0_set_9
	.long	L0_0_set_10
	.long	L0_0_set_5
	.long	L0_0_set_4
	.end_data_region
                                        ## -- End function
	.comm	_setup,32,3                     ## @setup
	.comm	_nes_ntsc_composite,32,3        ## @nes_ntsc_composite
	.comm	_out_width,4,2                  ## @out_width
	.comm	_out_height,4,2                 ## @out_height
	.comm	_key_pressed,4,2                ## @key_pressed
	.comm	_nes_ntsc_svideo,32,3           ## @nes_ntsc_svideo
	.comm	_nes_ntsc_rgb,32,3              ## @nes_ntsc_rgb
	.comm	_nes_ntsc_monochrome,32,3       ## @nes_ntsc_monochrome
	.comm	_mouse_moved,8,3                ## @mouse_moved
	.comm	_mouse_x,4,2                    ## @mouse_x
	.comm	_mouse_y,4,2                    ## @mouse_y
	.section	__DATA,__data
	.p2align	4                               ## @main.matrix
_main.matrix:
	.long	0x3fc4fdf4                      ## float 1.53900003
	.long	0xbf1f3b64                      ## float -0.621999979
	.long	0xbf122d0e                      ## float -0.57099998
	.long	0xbe3d70a4                      ## float -0.185000002
	.long	0x00000000                      ## float 0
	.long	0x40000000                      ## float 2

	.comm	_ntsc,4,2                       ## @ntsc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x20, _nes_ntsc_composite@GOTPAGE
Lloh1:
	ldr	x20, [x20, _nes_ntsc_composite@GOTPAGEOFF]
Lloh2:
	adrp	x19, _setup@GOTPAGE
Lloh3:
	ldr	x19, [x19, _setup@GOTPAGEOFF]
	ldp	q0, q1, [x20]
	stp	q0, q1, [x19]
	bl	_init
Lloh4:
	adrp	x8, _out_width@GOTPAGE
Lloh5:
	ldr	x8, [x8, _out_width@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x8, _out_height@GOTPAGE
Lloh8:
	ldr	x8, [x8, _out_height@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w2, #16
	bl	_sdl_init
	bl	_sdl_run
Lloh10:
	adrp	x21, _ntsc@GOTPAGE
Lloh11:
	ldr	x21, [x21, _ntsc@GOTPAGEOFF]
	cbz	x0, LBB0_16
; %bb.1:
	mov	w22, #0
Lloh12:
	adrp	x23, _key_pressed@GOTPAGE
Lloh13:
	ldr	x23, [x23, _key_pressed@GOTPAGEOFF]
	mov	w25, #1
Lloh14:
	adrp	x26, _mouse_x@GOTPAGE
Lloh15:
	ldr	x26, [x26, _mouse_x@GOTPAGEOFF]
Lloh16:
	adrp	x27, _mouse_y@GOTPAGE
Lloh17:
	ldr	x27, [x27, _mouse_y@GOTPAGEOFF]
Lloh18:
	adrp	x28, _main.matrix@PAGE
Lloh19:
	add	x28, x28, _main.matrix@PAGEOFF
Lloh20:
	adrp	x24, lJTI0_0@PAGE
Lloh21:
	add	x24, x24, lJTI0_0@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	_display
	ldr	w8, [x23]
	sub	w9, w8, #128
	cmp	w9, #5
	b.hi	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	adr	x8, LBB0_4
	ldrb	w10, [x24, x9]
	add	x8, x8, x10, lsl #2
	br	x8
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
Lloh22:
	adrp	x8, _nes_ntsc_svideo@GOTPAGE
Lloh23:
	ldr	x8, [x8, _nes_ntsc_svideo@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
Lloh24:
	adrp	x9, _mouse_moved@GOTPAGE
Lloh25:
	ldr	x9, [x9, _mouse_moved@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	w8, #0
	ccmp	x9, #0, #0, eq
	b.ne	LBB0_13
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	_sdl_run
	cbnz	x0, LBB0_2
	b	LBB0_16
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
Lloh27:
	adrp	x8, _nes_ntsc_rgb@GOTPAGE
Lloh28:
	ldr	x8, [x8, _nes_ntsc_rgb@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
Lloh29:
	adrp	x8, _nes_ntsc_monochrome@GOTPAGE
Lloh30:
	ldr	x8, [x8, _nes_ntsc_monochrome@GOTPAGEOFF]
LBB0_9:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	q0, [x8]
	str	q0, [x19]
	b	LBB0_13
LBB0_10:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w22, #0
	cset	w22, eq
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	q0, [x20]
	str	q0, [x19]
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w25, #0
	cset	w25, eq
LBB0_13:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	s0, [x26]
	ld1.s	{ v0 }[1], [x27]
	shl.2s	v0, v0, #1
	movi.2d	v1, #0xffffffffffffffff
	add.2s	v0, v0, v1
	scvtf.2s	v0, v0
	str	d0, [x19]
	str	w25, [x19, #8]
	stp	xzr, xzr, [x19, #16]
	cbz	w22, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_2 Depth=1
	str	x28, [x19, #16]
LBB0_15:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x21]
	mov	x1, x19
	bl	_nes_ntsc_init
	bl	_sdl_run
	cbnz	x0, LBB0_2
LBB0_16:
	ldr	w0, [x21]
	bl	_free
	bl	_write_palette
	mov	w0, #0
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_7-LBB0_4)>>2
	.byte	(LBB0_8-LBB0_4)>>2
	.byte	(LBB0_10-LBB0_4)>>2
	.byte	(LBB0_11-LBB0_4)>>2
	.byte	(LBB0_12-LBB0_4)>>2
                                        ; -- End function
	.comm	_setup,32,3                     ; @setup
	.comm	_nes_ntsc_composite,32,3        ; @nes_ntsc_composite
	.comm	_out_width,4,2                  ; @out_width
	.comm	_out_height,4,2                 ; @out_height
	.comm	_key_pressed,4,2                ; @key_pressed
	.comm	_nes_ntsc_svideo,32,3           ; @nes_ntsc_svideo
	.comm	_nes_ntsc_rgb,32,3              ; @nes_ntsc_rgb
	.comm	_nes_ntsc_monochrome,32,3       ; @nes_ntsc_monochrome
	.comm	_mouse_moved,8,3                ; @mouse_moved
	.comm	_mouse_x,4,2                    ; @mouse_x
	.comm	_mouse_y,4,2                    ; @mouse_y
	.section	__DATA,__data
	.p2align	2                               ; @main.matrix
_main.matrix:
	.long	0x3fc4fdf4                      ; float 1.53900003
	.long	0xbf1f3b64                      ; float -0.621999979
	.long	0xbf122d0e                      ; float -0.57099998
	.long	0xbe3d70a4                      ; float -0.185000002
	.long	0x00000000                      ; float 0
	.long	0x40000000                      ; float 2

	.comm	_ntsc,4,2                       ; @ntsc
.subsections_via_symbols
