	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function initialize_saa7121
_initialize_saa7121:                    ## @initialize_saa7121
	.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, %rbx
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	testl	%esi, %esi
	jne	LBB0_1
## %bb.2:
	movq	_init7121ntsc@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_init7121pal@GOTPCREL(%rip), %rax
LBB0_3:
	movq	(%rax), %r13
	movq	_SAA7146_PSR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_saaread
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_INIT7121LEN@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_23
## %bb.4:
	xorl	%ecx, %ecx
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	setne	%cl
	movl	$245, %eax
	movl	$9, %edx
	cmovel	%eax, %edx
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	shll	$5, %ecx
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	xorl	%r15d, %r15d
	movq	_NewCard@GOTPCREL(%rip), %r14
	andl	$8, -48(%rbp)                   ## 4-byte Folded Spill
	leaq	LJTI0_0(%rip), %r12
	jmp	LBB0_5
LBB0_21:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%r13,%r15,8), %ecx
	movq	%rbx, %rdi
	movl	$136, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	$2, %r8d
	callq	_I2CWrite
	incq	%r15
	movq	_INIT7121LEN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r15
	jge	LBB0_23
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%r14)
	movl	(%r13,%r15,8), %edx
	je	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	leal	-107(%rdx), %eax
	cmpl	$16, %eax
	ja	LBB0_7
## %bb.24:                              ##   in Loop: Header=BB0_5 Depth=1
	movslq	(%r12,%rax,4), %rax
	addq	%r12, %rax
	jmpq	*%rax
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	movl	$136, %esi
	movl	$107, %edx
	movl	$32, %ecx
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$107, %edx
	jne	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%r13,%r15,8), %ecx
	xorl	$9, %ecx
	movq	%rbx, %rdi
	movl	$136, %esi
	movl	$107, %edx
	jmp	LBB0_22
LBB0_18:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$123, %edx
	je	LBB0_12
## %bb.19:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$122, %edx
	jne	LBB0_21
LBB0_20:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_PALFirstActive@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	movq	_NTSCFirstActive@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	$-4, %ecx
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	cmovnel	%eax, %ecx
	movq	%rbx, %rdi
	movl	$136, %esi
	movl	$122, %edx
	jmp	LBB0_22
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_PALLastActive@GOTPCREL(%rip), %rax
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_NTSCLastActive@GOTPCREL(%rip), %rax
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	$136, %esi
	movl	$123, %edx
	jmp	LBB0_22
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$58, %edx
	jne	LBB0_21
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	movl	$136, %esi
	movl	$58, %edx
	movl	$19, %ecx
	jmp	LBB0_22
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	movl	$136, %esi
	movl	$108, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	jmp	LBB0_22
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	movl	$136, %esi
	movl	$109, %edx
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	jmp	LBB0_22
LBB0_23:
	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_9, LBB0_9-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_21, LBB0_21-LJTI0_0
.set L0_0_set_20, LBB0_20-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
LJTI0_0:
	.long	L0_0_set_9
	.long	L0_0_set_10
	.long	L0_0_set_11
	.long	L0_0_set_21
	.long	L0_0_set_21
	.long	L0_0_set_21
	.long	L0_0_set_21
	.long	L0_0_set_21
	.long	L0_0_set_21
	.long	L0_0_set_21
	.long	L0_0_set_21
	.long	L0_0_set_21
	.long	L0_0_set_21
	.long	L0_0_set_21
	.long	L0_0_set_21
	.long	L0_0_set_20
	.long	L0_0_set_12
	.end_data_region
                                        ## -- End function
	.comm	_init7121pal,8,3                ## @init7121pal
	.comm	_init7121ntsc,8,3               ## @init7121ntsc
	.comm	_SAA7146_PSR,4,2                ## @SAA7146_PSR
	.comm	_INIT7121LEN,4,2                ## @INIT7121LEN
	.comm	_NewCard,8,3                    ## @NewCard
	.comm	_PALFirstActive,4,2             ## @PALFirstActive
	.comm	_NTSCFirstActive,4,2            ## @NTSCFirstActive
	.comm	_PALLastActive,4,2              ## @PALLastActive
	.comm	_NTSCLastActive,4,2             ## @NTSCLastActive
	.no_dead_strip	_initialize_saa7121
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function initialize_saa7121
_initialize_saa7121:                    ; @initialize_saa7121
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _init7121ntsc@GOTPAGE
Lloh1:
	ldr	x8, [x8, _init7121ntsc@GOTPAGEOFF]
Lloh2:
	adrp	x9, _init7121pal@GOTPAGE
Lloh3:
	ldr	x9, [x9, _init7121pal@GOTPAGEOFF]
	cmp	w1, #0
	csel	x8, x8, x9, eq
	ldr	x25, [x8]
Lloh4:
	adrp	x8, _SAA7146_PSR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SAA7146_PSR@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	bl	_saaread
Lloh7:
	adrp	x23, _INIT7121LEN@GOTPAGE
Lloh8:
	ldr	x23, [x23, _INIT7121LEN@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.1:
	mov	x24, #0
	mov	w9, #9
	mov	w8, #245
	cmp	w19, #0
	csel	w21, w8, w9, eq
	cset	w8, ne
	lsl	w22, w8, #5
Lloh9:
	adrp	x26, _NewCard@GOTPAGE
Lloh10:
	ldr	x26, [x26, _NewCard@GOTPAGEOFF]
	add	x27, x25, #4
	and	w28, w0, #0x8
Lloh11:
	adrp	x25, lJTI0_0@PAGE
Lloh12:
	add	x25, x25, lJTI0_0@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x27]
	mov	w9, #9
	eor	w3, w8, w9
	mov	x0, x20
	mov	w1, #136
	mov	w2, #107
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w4, #2
	bl	_I2CWrite
	add	x24, x24, #1
	ldrsw	x8, [x23]
	add	x27, x27, #8
	cmp	x24, x8
	b.ge	LBB0_21
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26]
	ldur	w2, [x27, #-4]
	cbz	x8, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	w8, w2, #107
	cmp	w8, #16
	b.hi	LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	adr	x9, LBB0_7
	ldrb	w10, [x25, x8]
	add	x9, x9, x10, lsl #2
	br	x9
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	mov	w1, #136
	mov	w2, #107
	mov	w3, #32
	b	LBB0_3
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	w2, #107
	ccmp	w28, #0, #4, eq
	b.ne	LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w2, #123
	b.eq	LBB0_19
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	cmp	w2, #122
	b.ne	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
Lloh13:
	adrp	x8, _PALFirstActive@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PALFirstActive@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	sub	w8, w8, #1
Lloh16:
	adrp	x9, _NTSCFirstActive@GOTPAGE
Lloh17:
	ldr	x9, [x9, _NTSCFirstActive@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	sub	w9, w9, #4
	cmp	w19, #0
	csel	w3, w9, w8, eq
	b	LBB0_20
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w2, #58
	b.ne	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	mov	w1, #136
	mov	w3, #19
	b	LBB0_3
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w3, [x27]
	b	LBB0_20
LBB0_15:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	mov	w1, #136
	mov	w2, #108
	mov	x3, x21
	b	LBB0_3
LBB0_16:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	mov	w1, #136
	mov	w2, #109
	mov	x3, x22
	b	LBB0_3
LBB0_17:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh19:
	adrp	x8, _PALFirstActive@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PALFirstActive@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	sub	w8, w8, #1
Lloh22:
	adrp	x9, _NTSCFirstActive@GOTPAGE
Lloh23:
	ldr	x9, [x9, _NTSCFirstActive@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	sub	w9, w9, #4
	cmp	w19, #0
	csel	w3, w9, w8, eq
	mov	x0, x20
	mov	w1, #136
	mov	w2, #122
	b	LBB0_3
LBB0_18:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w19, #0
Lloh25:
	adrp	x8, _PALLastActive@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PALLastActive@GOTPAGEOFF]
Lloh27:
	adrp	x9, _NTSCLastActive@GOTPAGE
Lloh28:
	ldr	x9, [x9, _NTSCLastActive@GOTPAGEOFF]
	csel	x8, x9, x8, eq
	ldr	w3, [x8]
	mov	x0, x20
	mov	w1, #136
	mov	w2, #123
	b	LBB0_3
LBB0_19:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w19, #0
Lloh29:
	adrp	x8, _PALLastActive@GOTPAGE
Lloh30:
	ldr	x8, [x8, _PALLastActive@GOTPAGEOFF]
Lloh31:
	adrp	x9, _NTSCLastActive@GOTPAGE
Lloh32:
	ldr	x9, [x9, _NTSCLastActive@GOTPAGEOFF]
	csel	x8, x9, x8, eq
	ldr	w3, [x8]
LBB0_20:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	mov	w1, #136
	b	LBB0_3
LBB0_21:
	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	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_7-LBB0_7)>>2
	.byte	(LBB0_15-LBB0_7)>>2
	.byte	(LBB0_16-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_14-LBB0_7)>>2
	.byte	(LBB0_17-LBB0_7)>>2
	.byte	(LBB0_18-LBB0_7)>>2
                                        ; -- End function
	.comm	_init7121pal,8,3                ; @init7121pal
	.comm	_init7121ntsc,8,3               ; @init7121ntsc
	.comm	_SAA7146_PSR,4,2                ; @SAA7146_PSR
	.comm	_INIT7121LEN,4,2                ; @INIT7121LEN
	.comm	_NewCard,8,3                    ; @NewCard
	.comm	_PALFirstActive,4,2             ; @PALFirstActive
	.comm	_NTSCFirstActive,4,2            ; @NTSCFirstActive
	.comm	_PALLastActive,4,2              ; @PALLastActive
	.comm	_NTSCLastActive,4,2             ; @NTSCLastActive
	.no_dead_strip	_initialize_saa7121
.subsections_via_symbols
