	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_saa7134_g_tuner                ## -- Begin function saa7134_g_tuner
	.p2align	4, 0x90
_saa7134_g_tuner:                       ## @saa7134_g_tuner
	.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	%rdx, %r14
	callq	_video_drvdata
	cmpq	$0, (%r14)
	jne	LBB0_1
## %bb.2:
	movq	%rax, %r15
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	_SAA7134_INPUT_MAX@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_8
## %bb.3:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	_SAA7134_INPUT_TV@GOTPCREL(%rip), %r13
	movq	_SAA7134_INPUT_TV_MONO@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_card_in
	cmpq	(%r13), %rax
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_card_in
	cmpq	(%r14), %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
	cmpl	(%r12), %ebx
	jl	LBB0_4
LBB0_7:
	movl	(%r12), %eax
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_8:
	cmpl	%eax, %ebx
	jne	LBB0_9
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_card_in
	movq	_SAA7134_NO_INPUT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.10:
	movl	28(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	$4, %edx
	callq	_strscpy
	movq	_V4L2_TUNER_ANALOG_TV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r14)
	movq	_tuner@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_g_tuner@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%r14, %rcx
	callq	_saa_call_all
	movq	_V4L2_TUNER_CAP_NORM@GOTPCREL(%rip), %rax
	movq	_V4L2_TUNER_CAP_STEREO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_V4L2_TUNER_CAP_LANG1@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_V4L2_TUNER_CAP_LANG2@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 8(%r14)
	movq	%r15, %rdi
	callq	_saa7134_tvaudio_getstereo
	movl	%eax, 16(%r14)
	movl	%eax, %edi
	callq	_saa7134_tvaudio_rx2mode
	movl	%eax, 20(%r14)
LBB0_11:
	movq	_SAA7134_STATUS_VIDEO1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_saa_readb
	movl	%eax, %ecx
	xorl	%eax, %eax
	testb	$3, %cl
	je	LBB0_13
## %bb.12:
	movl	$65535, 12(%r14)                ## imm = 0xFFFF
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SAA7134_INPUT_MAX,4,2          ## @SAA7134_INPUT_MAX
	.comm	_SAA7134_INPUT_TV,8,3           ## @SAA7134_INPUT_TV
	.comm	_SAA7134_INPUT_TV_MONO,8,3      ## @SAA7134_INPUT_TV_MONO
	.comm	_SAA7134_NO_INPUT,8,3           ## @SAA7134_NO_INPUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Television"

	.comm	_V4L2_TUNER_ANALOG_TV,4,2       ## @V4L2_TUNER_ANALOG_TV
	.comm	_tuner,4,2                      ## @tuner
	.comm	_g_tuner,4,2                    ## @g_tuner
	.comm	_V4L2_TUNER_CAP_NORM,4,2        ## @V4L2_TUNER_CAP_NORM
	.comm	_V4L2_TUNER_CAP_STEREO,4,2      ## @V4L2_TUNER_CAP_STEREO
	.comm	_V4L2_TUNER_CAP_LANG1,4,2       ## @V4L2_TUNER_CAP_LANG1
	.comm	_V4L2_TUNER_CAP_LANG2,4,2       ## @V4L2_TUNER_CAP_LANG2
	.comm	_SAA7134_STATUS_VIDEO1,4,2      ## @SAA7134_STATUS_VIDEO1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_saa7134_g_tuner                ; -- Begin function saa7134_g_tuner
	.p2align	2
_saa7134_g_tuner:                       ; @saa7134_g_tuner
	.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
	mov	x19, x2
	bl	_video_drvdata
	ldr	x8, [x19]
	cbnz	x8, LBB0_7
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	mov	w1, #0
	mov	w2, #32
	bl	_memset
Lloh0:
	adrp	x22, _SAA7134_INPUT_MAX@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SAA7134_INPUT_MAX@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.2:
	mov	w21, #0
Lloh2:
	adrp	x23, _SAA7134_INPUT_TV@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SAA7134_INPUT_TV@GOTPAGEOFF]
Lloh4:
	adrp	x24, _SAA7134_INPUT_TV_MONO@GOTPAGE
Lloh5:
	ldr	x24, [x24, _SAA7134_INPUT_TV_MONO@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_card_in
	ldr	x8, [x23]
	cmp	x0, x8
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_card_in
	ldr	x8, [x24]
	cmp	x0, x8
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w21, w21, #1
	ldr	w8, [x22]
	cmp	w21, w8
	b.lt	LBB0_3
LBB0_6:
	ldr	w8, [x22]
	cmp	w21, w8
	b.ne	LBB0_10
LBB0_7:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	ret
LBB0_9:
	mov	w21, #0
	cmp	w21, w8
	b.eq	LBB0_7
LBB0_10:
	mov	x0, x20
	mov	x1, x21
	bl	_card_in
Lloh9:
	adrp	x8, _SAA7134_NO_INPUT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SAA7134_NO_INPUT@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_12
; %bb.11:
	ldr	w0, [x19, #28]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #4
	bl	_strscpy
Lloh14:
	adrp	x8, _V4L2_TUNER_ANALOG_TV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _V4L2_TUNER_ANALOG_TV@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x19, #24]
Lloh17:
	adrp	x8, _tuner@GOTPAGE
Lloh18:
	ldr	x8, [x8, _tuner@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _g_tuner@GOTPAGE
Lloh21:
	ldr	x8, [x8, _g_tuner@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x3, x19
	bl	_saa_call_all
Lloh23:
	adrp	x8, _V4L2_TUNER_CAP_NORM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _V4L2_TUNER_CAP_NORM@GOTPAGEOFF]
Lloh25:
	adrp	x9, _V4L2_TUNER_CAP_STEREO@GOTPAGE
Lloh26:
	ldr	x9, [x9, _V4L2_TUNER_CAP_STEREO@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
Lloh28:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh29:
	adrp	x9, _V4L2_TUNER_CAP_LANG1@GOTPAGE
Lloh30:
	ldr	x9, [x9, _V4L2_TUNER_CAP_LANG1@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh32:
	adrp	x9, _V4L2_TUNER_CAP_LANG2@GOTPAGE
Lloh33:
	ldr	x9, [x9, _V4L2_TUNER_CAP_LANG2@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19, #8]
	mov	x0, x20
	bl	_saa7134_tvaudio_getstereo
	str	w0, [x19, #16]
	bl	_saa7134_tvaudio_rx2mode
	str	w0, [x19, #20]
LBB0_12:
Lloh35:
	adrp	x8, _SAA7134_STATUS_VIDEO1@GOTPAGE
Lloh36:
	ldr	x8, [x8, _SAA7134_STATUS_VIDEO1@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
	bl	_saa_readb
	tst	w0, #0x3
	b.eq	LBB0_14
; %bb.13:
	mov	w0, #0
	mov	w8, #65535
	str	w8, [x19, #12]
	b	LBB0_8
LBB0_14:
	mov	w0, #0
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh27
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SAA7134_INPUT_MAX,4,2          ; @SAA7134_INPUT_MAX
	.comm	_SAA7134_INPUT_TV,8,3           ; @SAA7134_INPUT_TV
	.comm	_SAA7134_INPUT_TV_MONO,8,3      ; @SAA7134_INPUT_TV_MONO
	.comm	_SAA7134_NO_INPUT,8,3           ; @SAA7134_NO_INPUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Television"

	.comm	_V4L2_TUNER_ANALOG_TV,4,2       ; @V4L2_TUNER_ANALOG_TV
	.comm	_tuner,4,2                      ; @tuner
	.comm	_g_tuner,4,2                    ; @g_tuner
	.comm	_V4L2_TUNER_CAP_NORM,4,2        ; @V4L2_TUNER_CAP_NORM
	.comm	_V4L2_TUNER_CAP_STEREO,4,2      ; @V4L2_TUNER_CAP_STEREO
	.comm	_V4L2_TUNER_CAP_LANG1,4,2       ; @V4L2_TUNER_CAP_LANG1
	.comm	_V4L2_TUNER_CAP_LANG2,4,2       ; @V4L2_TUNER_CAP_LANG2
	.comm	_SAA7134_STATUS_VIDEO1,4,2      ; @SAA7134_STATUS_VIDEO1
.subsections_via_symbols
