	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_saa7134_irq_video_signalchange ## -- Begin function saa7134_irq_video_signalchange
	.p2align	4, 0x90
_saa7134_irq_video_signalchange:        ## @saa7134_irq_video_signalchange
	.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	%rdi, %r14
	movq	_SAA7134_STATUS_VIDEO1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_saa_readb
	movl	%eax, %r13d
	movq	_SAA7134_STATUS_VIDEO2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_saa_readb
	movl	%eax, %r15d
	movl	%r13d, %r12d
	andl	$64, %r12d
	leaq	L_.str.6(%rip), %rax
	leaq	L_.str.5(%rip), %rsi
	cmoveq	%rax, %rsi
	movl	%r15d, %ebx
	andl	$64, %ebx
	leaq	L_.str.8(%rip), %rax
	leaq	L_.str.7(%rip), %rdx
	cmoveq	%rax, %rdx
	andl	$3, %r13d
	leaq	_reltable.saa7134_irq_video_signalchange(%rip), %rax
	movslq	(%rax,%r13,4), %rcx
	addq	%rax, %rcx
	leaq	L_.str.4(%rip), %rdi
	callq	_video_dbg
	orl	%r12d, %ebx
	jne	LBB0_1
## %bb.2:
	movl	%r15d, %eax
	notl	%eax
	andl	$1, %eax
	movl	%eax, (%r14)
	testb	$1, %r15b
	je	LBB0_3
## %bb.6:
	movq	%r14, %rdi
	callq	_saa7134_tvaudio_do_scan
	testb	$-128, %r15b
	jne	LBB0_8
	jmp	LBB0_11
LBB0_1:
	movl	$1, (%r14)
LBB0_3:
	cmpq	$0, 16(%r14)
	je	LBB0_5
## %bb.4:
	movl	$1, 4(%r14)
LBB0_5:
	movq	%r14, %rdi
	callq	_saa7134_tvaudio_setmute
	testb	$-128, %r15b
	je	LBB0_11
LBB0_8:
	movq	_noninterlaced@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_11
## %bb.9:
	cmpl	$0, (%r14)
	je	LBB0_10
LBB0_11:
	movq	_SAA7134_SYNC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$32, %esi
	callq	_saa_setb
	jmp	LBB0_12
LBB0_10:
	movq	_SAA7134_SYNC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$32, %esi
	callq	_saa_clearb
LBB0_12:
	movq	8(%r14), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.15:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	2                               ## @reltable.saa7134_irq_video_signalchange
_reltable.saa7134_irq_video_signalchange:
	.long	L_.str-_reltable.saa7134_irq_video_signalchange
	.long	L_.str.1-_reltable.saa7134_irq_video_signalchange
	.long	L_.str.2-_reltable.saa7134_irq_video_signalchange
	.long	L_.str.3-_reltable.saa7134_irq_video_signalchange

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(no signal)"

L_.str.1:                               ## @.str.1
	.asciz	"NTSC"

L_.str.2:                               ## @.str.2
	.asciz	"PAL"

L_.str.3:                               ## @.str.3
	.asciz	"SECAM"

	.comm	_SAA7134_STATUS_VIDEO1,4,2      ## @SAA7134_STATUS_VIDEO1
	.comm	_SAA7134_STATUS_VIDEO2,4,2      ## @SAA7134_STATUS_VIDEO2
L_.str.4:                               ## @.str.4
	.asciz	"DCSDT: pll: %s, sync: %s, norm: %s\n"

L_.str.5:                               ## @.str.5
	.asciz	"not locked"

L_.str.6:                               ## @.str.6
	.asciz	"locked"

L_.str.7:                               ## @.str.7
	.asciz	"no"

L_.str.8:                               ## @.str.8
	.asciz	"yes"

	.comm	_noninterlaced,4,2              ## @noninterlaced
	.comm	_SAA7134_SYNC_CTRL,4,2          ## @SAA7134_SYNC_CTRL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_saa7134_irq_video_signalchange ; -- Begin function saa7134_irq_video_signalchange
	.p2align	2
_saa7134_irq_video_signalchange:        ; @saa7134_irq_video_signalchange
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _SAA7134_STATUS_VIDEO1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SAA7134_STATUS_VIDEO1@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_saa_readb
	mov	x21, x0
Lloh3:
	adrp	x8, _SAA7134_STATUS_VIDEO2@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SAA7134_STATUS_VIDEO2@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_saa_readb
	mov	x20, x0
Lloh6:
	adrp	x8, l_.str.5@PAGE
Lloh7:
	add	x8, x8, l_.str.5@PAGEOFF
Lloh8:
	adrp	x9, l_.str.6@PAGE
Lloh9:
	add	x9, x9, l_.str.6@PAGEOFF
	ands	w10, w21, #0x40
	csel	x1, x9, x8, eq
	ands	w8, w0, #0x40
	orr	w22, w10, w8
Lloh10:
	adrp	x8, l_.str.7@PAGE
Lloh11:
	add	x8, x8, l_.str.7@PAGEOFF
Lloh12:
	adrp	x9, l_.str.8@PAGE
Lloh13:
	add	x9, x9, l_.str.8@PAGEOFF
	csel	x2, x9, x8, eq
	and	w8, w21, #0x3
Lloh14:
	adrp	x9, _saa7134_irq_video_signalchange.st@PAGE
Lloh15:
	add	x9, x9, _saa7134_irq_video_signalchange.st@PAGEOFF
	ldr	x3, [x9, w8, uxtw #3]
Lloh16:
	adrp	x0, l_.str.4@PAGE
Lloh17:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_video_dbg
	cbnz	w22, LBB0_3
; %bb.1:
	mvn	w8, w20
	and	w8, w8, #0x1
	str	w8, [x19]
	tbz	w20, #0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_saa7134_tvaudio_do_scan
	tbnz	w20, #7, LBB0_7
	b	LBB0_9
LBB0_3:
	mov	w8, #1
	str	w8, [x19]
LBB0_4:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_6
; %bb.5:
	mov	w8, #1
	str	w8, [x19, #4]
LBB0_6:
	mov	x0, x19
	bl	_saa7134_tvaudio_setmute
	tbz	w20, #7, LBB0_9
LBB0_7:
Lloh18:
	adrp	x8, _noninterlaced@GOTPAGE
Lloh19:
	ldr	x8, [x8, _noninterlaced@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cbnz	w8, LBB0_9
; %bb.8:
	ldr	w8, [x19]
	cbz	w8, LBB0_12
LBB0_9:
Lloh21:
	adrp	x8, _SAA7134_SYNC_CTRL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SAA7134_SYNC_CTRL@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	mov	w1, #32
	bl	_saa_setb
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_13
LBB0_10:
	ldr	x1, [x8]
	cbz	x1, LBB0_13
; %bb.11:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	br	x1
LBB0_12:
Lloh24:
	adrp	x8, _SAA7134_SYNC_CTRL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SAA7134_SYNC_CTRL@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	mov	w1, #32
	bl	_saa_clearb
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_10
LBB0_13:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__const
	.p2align	3                               ; @saa7134_irq_video_signalchange.st
_saa7134_irq_video_signalchange.st:
	.quad	l_.str
	.quad	l_.str.1
	.quad	l_.str.2
	.quad	l_.str.3

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(no signal)"

l_.str.1:                               ; @.str.1
	.asciz	"NTSC"

l_.str.2:                               ; @.str.2
	.asciz	"PAL"

l_.str.3:                               ; @.str.3
	.asciz	"SECAM"

	.comm	_SAA7134_STATUS_VIDEO1,4,2      ; @SAA7134_STATUS_VIDEO1
	.comm	_SAA7134_STATUS_VIDEO2,4,2      ; @SAA7134_STATUS_VIDEO2
l_.str.4:                               ; @.str.4
	.asciz	"DCSDT: pll: %s, sync: %s, norm: %s\n"

l_.str.5:                               ; @.str.5
	.asciz	"not locked"

l_.str.6:                               ; @.str.6
	.asciz	"locked"

l_.str.7:                               ; @.str.7
	.asciz	"no"

l_.str.8:                               ; @.str.8
	.asciz	"yes"

	.comm	_noninterlaced,4,2              ; @noninterlaced
	.comm	_SAA7134_SYNC_CTRL,4,2          ; @SAA7134_SYNC_CTRL
.subsections_via_symbols
