	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vidioc_g_tuner
_vidioc_g_tuner:                        ## @vidioc_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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rdx)
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_14
LBB0_2:
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	(%rsi), %rbx
	leaq	4(%rbx), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	_TUNER_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TLG_MODE_ANALOG_TV@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-80(%rbp), %rcx
	leaq	-44(%rbp), %r8
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	$24, %r9d
	callq	_send_get_req
	movl	%eax, %ebx
	cmpq	$0, -64(%rbp)
	movq	%r14, -104(%rbp)                ## 8-byte Spill
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	je	LBB0_7
## %bb.3:
	movl	$-5, %r15d
	movq	_HZ@GOTPCREL(%rip), %r12
	leaq	-80(%rbp), %r14
	leaq	-44(%rbp), %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	testl	%ebx, %ebx
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_set_current_state
	movl	(%r12), %edi
	callq	_schedule_timeout
	movq	_TUNER_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TLG_MODE_ANALOG_TV@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rcx
	movq	%r13, %r8
	movl	$24, %r9d
	callq	_send_get_req
	movl	%eax, %ebx
	incl	%r15d
	cmpq	$0, -64(%rbp)
	jne	LBB0_4
LBB0_7:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	_debug_mode@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movq	-96(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_9
## %bb.8:
	movq	-72(%rbp), %rsi
	movl	-80(%rbp), %edx
	leaq	L_.str(%rip), %rdi
	callq	_log
LBB0_9:
	xorl	%r13d, %r13d
	orl	-44(%rbp), %ebx
	movl	$0, %eax
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	jne	LBB0_13
## %bb.10:
	cmpq	$0, -72(%rbp)
	movl	-80(%rbp), %ecx
	je	LBB0_12
## %bb.11:
	movl	$65535, %eax                    ## imm = 0xFFFF
	testl	%ecx, %ecx
	je	LBB0_13
LBB0_12:
	movl	%ecx, %eax
	shll	$8, %eax
	subl	%ecx, %eax
	cltq
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$34, %rax
	addl	%ecx, %eax
	shll	$8, %eax
LBB0_13:
	movl	%eax, 8(%r14)
	movl	44(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_strcpy
	movq	_V4L2_TUNER_ANALOG_TV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r14)
	movq	_TUNER_FREQ_MIN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$1125899907, %rax, %rax         ## imm = 0x431BDE83
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$32, %rax
	sarl	$14, %eax
	addl	%ecx, %eax
	movl	%eax, 12(%r14)
	movq	_TUNER_FREQ_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$1125899907, %rax, %rax         ## imm = 0x431BDE83
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$32, %rax
	sarl	$14, %eax
	addl	%ecx, %eax
	movl	%eax, 16(%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, 20(%r14)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movslq	(%rax), %rax
	movq	_pd_audio_modes@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	4(%rcx,%rax,8), %edx
	movl	%edx, 36(%r14)
	movl	(%rcx,%rax,8), %eax
	movl	%eax, 32(%r14)
	movq	$0, 24(%r14)
	movq	%rbx, %rdi
	callq	_logs
LBB0_14:
	movl	%r13d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TUNER_STATUS,4,2               ## @TUNER_STATUS
	.comm	_TLG_MODE_ANALOG_TV,4,2         ## @TLG_MODE_ANALOG_TV
	.comm	_TASK_INTERRUPTIBLE,4,2         ## @TASK_INTERRUPTIBLE
	.comm	_HZ,4,2                         ## @HZ
	.comm	_debug_mode,8,3                 ## @debug_mode
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"P:%d,S:%d"

L_.str.1:                               ## @.str.1
	.asciz	"Telegent Systems"

	.comm	_V4L2_TUNER_ANALOG_TV,4,2       ## @V4L2_TUNER_ANALOG_TV
	.comm	_TUNER_FREQ_MIN,4,2             ## @TUNER_FREQ_MIN
	.comm	_TUNER_FREQ_MAX,4,2             ## @TUNER_FREQ_MAX
	.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	_pd_audio_modes,8,3             ## @pd_audio_modes
	.no_dead_strip	_vidioc_g_tuner
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vidioc_g_tuner
_vidioc_g_tuner:                        ; @vidioc_g_tuner
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	ldr	x8, [x2]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_21
LBB0_2:
	mov	x20, x2
	mov	x19, x1
	ldr	x21, [x1]
	add	x22, x21, #4
	mov	x0, x22
	bl	_mutex_lock
Lloh3:
	adrp	x24, _TUNER_STATUS@GOTPAGE
Lloh4:
	ldr	x24, [x24, _TUNER_STATUS@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh5:
	adrp	x25, _TLG_MODE_ANALOG_TV@GOTPAGE
Lloh6:
	ldr	x25, [x25, _TLG_MODE_ANALOG_TV@GOTPAGEOFF]
	ldr	w2, [x25]
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x0, x21
	mov	w5, #24
	bl	_send_get_req
	mov	x23, x0
	ldr	x8, [sp, #24]
	cmp	x8, #0
	ccmp	w0, #0, #0, ne
	b.ne	LBB0_12
; %bb.3:
Lloh7:
	adrp	x26, _TASK_INTERRUPTIBLE@GOTPAGE
Lloh8:
	ldr	x26, [x26, _TASK_INTERRUPTIBLE@GOTPAGEOFF]
	ldr	w0, [x26]
	bl	_set_current_state
Lloh9:
	adrp	x27, _HZ@GOTPAGE
Lloh10:
	ldr	x27, [x27, _HZ@GOTPAGEOFF]
	ldr	w0, [x27]
	bl	_schedule_timeout
	ldr	w1, [x24]
	ldr	w2, [x25]
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x0, x21
	mov	w5, #24
	bl	_send_get_req
	mov	x23, x0
	ldr	x8, [sp, #24]
	cbz	x8, LBB0_12
; %bb.4:
	cbnz	w23, LBB0_12
; %bb.5:
	ldr	w0, [x26]
	bl	_set_current_state
	ldr	w0, [x27]
	bl	_schedule_timeout
	ldr	w1, [x24]
	ldr	w2, [x25]
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x0, x21
	mov	w5, #24
	bl	_send_get_req
	mov	x23, x0
	ldr	x8, [sp, #24]
	cbz	x8, LBB0_12
; %bb.6:
	cbnz	w23, LBB0_12
; %bb.7:
	ldr	w0, [x26]
	bl	_set_current_state
	ldr	w0, [x27]
	bl	_schedule_timeout
	ldr	w1, [x24]
	ldr	w2, [x25]
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x0, x21
	mov	w5, #24
	bl	_send_get_req
	mov	x23, x0
	ldr	x8, [sp, #24]
	cbz	x8, LBB0_12
; %bb.8:
	cbnz	w23, LBB0_12
; %bb.9:
	ldr	w0, [x26]
	bl	_set_current_state
	ldr	w0, [x27]
	bl	_schedule_timeout
	ldr	w1, [x24]
	ldr	w2, [x25]
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x0, x21
	mov	w5, #24
	bl	_send_get_req
	mov	x23, x0
	ldr	x8, [sp, #24]
	cbz	x8, LBB0_12
; %bb.10:
	cbnz	w23, LBB0_12
; %bb.11:
	ldr	w0, [x26]
	bl	_set_current_state
	ldr	w0, [x27]
	bl	_schedule_timeout
	ldr	w1, [x24]
	ldr	w2, [x25]
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x0, x21
	mov	w5, #24
	bl	_send_get_req
	mov	x23, x0
LBB0_12:
	mov	x0, x22
	bl	_mutex_unlock
Lloh11:
	adrp	x8, _debug_mode@GOTPAGE
Lloh12:
	ldr	x8, [x8, _debug_mode@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cbz	x8, LBB0_14
; %bb.13:
	ldr	x1, [sp, #16]
	ldr	w2, [sp, #8]
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_log
LBB0_14:
	ldr	w8, [sp, #4]
	orr	w8, w23, w8
	cbz	w8, LBB0_16
; %bb.15:
	mov	w8, #0
	b	LBB0_20
LBB0_16:
	ldr	x9, [sp, #16]
	ldr	w8, [sp, #8]
	cbz	x9, LBB0_19
; %bb.17:
	cbnz	w8, LBB0_19
; %bb.18:
	mov	w8, #65535
	b	LBB0_20
LBB0_19:
	lsl	w9, w8, #8
	sub	w8, w9, w8
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	lsr	x8, x8, #34
	add	w8, w8, w9
	lsl	w8, w8, #8
LBB0_20:
	str	w8, [x20, #8]
	ldr	w0, [x20, #44]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_strcpy
Lloh18:
	adrp	x8, _V4L2_TUNER_ANALOG_TV@GOTPAGE
Lloh19:
	ldr	x8, [x8, _V4L2_TUNER_ANALOG_TV@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x20, #40]
Lloh21:
	adrp	x8, _TUNER_FREQ_MIN@GOTPAGE
Lloh22:
	ldr	x8, [x8, _TUNER_FREQ_MIN@GOTPAGEOFF]
Lloh23:
	ldrsw	x8, [x8]
	mov	w9, #56963
	movk	w9, #17179, lsl #16
	mul	x8, x8, x9
	lsr	x10, x8, #32
	lsr	x8, x8, #63
	add	w8, w8, w10, asr #14
Lloh24:
	adrp	x10, _TUNER_FREQ_MAX@GOTPAGE
Lloh25:
	ldr	x10, [x10, _TUNER_FREQ_MAX@GOTPAGEOFF]
Lloh26:
	ldrsw	x10, [x10]
	mul	x9, x10, x9
	lsr	x10, x9, #32
	lsr	x9, x9, #63
	add	w9, w9, w10, asr #14
	stp	w8, w9, [x20, #12]
Lloh27:
	adrp	x8, _V4L2_TUNER_CAP_NORM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _V4L2_TUNER_CAP_NORM@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
Lloh30:
	adrp	x9, _V4L2_TUNER_CAP_STEREO@GOTPAGE
Lloh31:
	ldr	x9, [x9, _V4L2_TUNER_CAP_STEREO@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh33:
	adrp	x9, _V4L2_TUNER_CAP_LANG1@GOTPAGE
Lloh34:
	ldr	x9, [x9, _V4L2_TUNER_CAP_LANG1@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
Lloh36:
	adrp	x10, _V4L2_TUNER_CAP_LANG2@GOTPAGE
Lloh37:
	ldr	x10, [x10, _V4L2_TUNER_CAP_LANG2@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh38:
	ldr	w9, [x10]
	orr	w8, w8, w9
	str	w8, [x20, #20]
Lloh39:
	adrp	x8, _pd_audio_modes@GOTPAGE
Lloh40:
	ldr	x8, [x8, _pd_audio_modes@GOTPAGEOFF]
	ldrsw	x9, [x21]
Lloh41:
	ldr	x8, [x8]
	ldr	d0, [x8, x9, lsl #3]
	str	d0, [x20, #32]
	str	xzr, [x20, #24]
	mov	x0, x19
	bl	_logs
	mov	w0, #0
LBB0_21:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TUNER_STATUS,4,2               ; @TUNER_STATUS
	.comm	_TLG_MODE_ANALOG_TV,4,2         ; @TLG_MODE_ANALOG_TV
	.comm	_TASK_INTERRUPTIBLE,4,2         ; @TASK_INTERRUPTIBLE
	.comm	_HZ,4,2                         ; @HZ
	.comm	_debug_mode,8,3                 ; @debug_mode
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"P:%d,S:%d"

l_.str.1:                               ; @.str.1
	.asciz	"Telegent Systems"

	.comm	_V4L2_TUNER_ANALOG_TV,4,2       ; @V4L2_TUNER_ANALOG_TV
	.comm	_TUNER_FREQ_MIN,4,2             ; @TUNER_FREQ_MIN
	.comm	_TUNER_FREQ_MAX,4,2             ; @TUNER_FREQ_MAX
	.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	_pd_audio_modes,8,3             ; @pd_audio_modes
	.no_dead_strip	_vidioc_g_tuner
.subsections_via_symbols
