	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function saa7134_g_tuner
_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rdx)
	jne	LBB0_1
## %bb.2:
	movq	%rdx, %r14
	movq	(%rsi), %r15
	xorl	%ebx, %ebx
	movq	%rdx, %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movq	_SAA7134_INPUT_MAX@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_7
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_card_in
	testq	%rdx, %rdx
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	jl	LBB0_4
LBB0_7:
	cmpl	%eax, %ebx
	jne	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	je	LBB0_1
LBB0_8:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_card_in
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movl	32(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_strcpy
	movq	_V4L2_TUNER_ANALOG_TV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r14)
	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)
	movl	$-1, 12(%r14)
	movq	%r15, %rdi
	callq	_saa7134_tvaudio_getstereo
	movl	%eax, 20(%r14)
	movl	%eax, %edi
	callq	_saa7134_tvaudio_rx2mode
	movl	%eax, 24(%r14)
LBB0_10:
	movq	_SAA7134_STATUS_VIDEO1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_saa_readb
	movl	%eax, %ecx
	xorl	%eax, %eax
	testb	$3, %cl
	je	LBB0_12
## %bb.11:
	movl	$65535, 16(%r14)                ## imm = 0xFFFF
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SAA7134_INPUT_MAX,4,2          ## @SAA7134_INPUT_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Television"

	.comm	_V4L2_TUNER_ANALOG_TV,4,2       ## @V4L2_TUNER_ANALOG_TV
	.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
	.no_dead_strip	_saa7134_g_tuner
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function saa7134_g_tuner
_saa7134_g_tuner:                       ; @saa7134_g_tuner
	.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
	ldr	x8, [x2]
	cbnz	x8, LBB0_7
; %bb.1:
	mov	x19, x2
	ldr	x20, [x1]
	mov	x0, x2
	mov	w1, #0
	mov	w2, #40
	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_5
; %bb.2:
	mov	w21, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_card_in
	cbnz	x1, LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w21, w21, #1
	ldr	w8, [x22]
	cmp	w21, w8
	b.lt	LBB0_3
	b	LBB0_6
LBB0_5:
	mov	w21, #0
LBB0_6:
	cmp	w21, w8
	b.ne	LBB0_10
LBB0_7:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
LBB0_9:
	ldr	w8, [x22]
	cmp	w21, w8
	b.eq	LBB0_7
LBB0_10:
	mov	x0, x20
	mov	x1, x21
	bl	_card_in
	cbz	x0, LBB0_12
; %bb.11:
	ldr	w0, [x19, #32]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcpy
Lloh7:
	adrp	x8, _V4L2_TUNER_ANALOG_TV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _V4L2_TUNER_ANALOG_TV@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [x19, #28]
Lloh10:
	adrp	x8, _V4L2_TUNER_CAP_NORM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _V4L2_TUNER_CAP_NORM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _V4L2_TUNER_CAP_STEREO@GOTPAGE
Lloh14:
	ldr	x9, [x9, _V4L2_TUNER_CAP_STEREO@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh16:
	adrp	x9, _V4L2_TUNER_CAP_LANG1@GOTPAGE
Lloh17:
	ldr	x9, [x9, _V4L2_TUNER_CAP_LANG1@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x10, _V4L2_TUNER_CAP_LANG2@GOTPAGE
Lloh20:
	ldr	x10, [x10, _V4L2_TUNER_CAP_LANG2@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh21:
	ldr	w9, [x10]
	orr	w8, w8, w9
	mov	w9, #-1
	stp	w8, w9, [x19, #8]
	mov	x0, x20
	bl	_saa7134_tvaudio_getstereo
	str	w0, [x19, #20]
	bl	_saa7134_tvaudio_rx2mode
	str	w0, [x19, #24]
LBB0_12:
Lloh22:
	adrp	x8, _SAA7134_STATUS_VIDEO1@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SAA7134_STATUS_VIDEO1@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	bl	_saa_readb
	tst	w0, #0x3
	b.eq	LBB0_14
; %bb.13:
	mov	w0, #0
	mov	w8, #65535
	str	w8, [x19, #16]
	b	LBB0_8
LBB0_14:
	mov	w0, #0
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SAA7134_INPUT_MAX,4,2          ; @SAA7134_INPUT_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Television"

	.comm	_V4L2_TUNER_ANALOG_TV,4,2       ; @V4L2_TUNER_ANALOG_TV
	.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
	.no_dead_strip	_saa7134_g_tuner
.subsections_via_symbols
