	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tda1002x_cu1216_tuner_set
_tda1002x_cu1216_tuner_set:             ## @tda1002x_cu1216_tuner_set
	.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
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %rax
	movq	(%rax), %r14
	movl	$96, -112(%rbp)
	leaq	-80(%rbp), %rax
	movq	%rax, -104(%rbp)
	movl	$24, -96(%rbp)
	movq	$0, -88(%rbp)
	movl	16(%rdi), %eax
	leal	36156250(%rax), %ecx
	movslq	%ecx, %rcx
	imulq	$1125899907, %rcx, %rcx         ## imm = 0x431BDE83
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$46, %rcx
	addl	%edx, %ecx
	movzbl	%cl, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	shrl	$8, %ecx
	andl	$127, %ecx
	movl	%ecx, -80(%rbp)
	movl	%edx, -76(%rbp)
	movl	$206, -72(%rbp)
	xorl	%ecx, %ecx
	cmpl	$445000000, %eax                ## imm = 0x1A862940
	setge	%cl
	cmpl	$150000000, %eax                ## imm = 0x8F0D180
	leal	2(%rcx,%rcx), %eax
	movl	$1, %ecx
	cmovgel	%eax, %ecx
	movl	%ecx, -68(%rbp)
	movabsq	$137438953694, %rax             ## imm = 0x20000000DE
	movq	%rax, -64(%rbp)
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	*%rax
LBB0_2:
	leaq	-112(%rbp), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_i2c_transfer
	cmpl	$1, %eax
	jne	LBB0_12
## %bb.3:
	leaq	-72(%rbp), %r12
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -88(%rbp)
	movl	$1, -96(%rbp)
	movl	$20, %ebx
	leaq	-112(%rbp), %r15
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$10, %edi
	callq	_msleep
	decl	%ebx
	je	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	callq	*%rax
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	cmpl	$1, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	testb	$64, -80(%rbp)
	je	LBB0_8
LBB0_9:
	movq	$0, -88(%rbp)
	andb	$-65, -72(%rbp)
	movl	$2, -96(%rbp)
	movq	%r12, -104(%rbp)
	movq	(%r13), %rax
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	*%rax
LBB0_11:
	leaq	-112(%rbp), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_i2c_transfer
	movl	%eax, %ecx
	xorl	%eax, %eax
	cmpl	$1, %ecx
	je	LBB0_13
LBB0_12:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_15
## %bb.14:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_I2C_M_RD,8,3                   ## @I2C_M_RD
	.comm	_CU1216_IF,4,2                  ## @CU1216_IF
	.comm	_TUNER_MUL,4,2                  ## @TUNER_MUL
	.no_dead_strip	_tda1002x_cu1216_tuner_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function tda1002x_cu1216_tuner_set
lCPI0_0:
	.long	222                             ; 0xde
	.long	32                              ; 0x20
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_tda1002x_cu1216_tuner_set:             ; @tda1002x_cu1216_tuner_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	ldp	x8, x9, [x0]
	ldr	x20, [x9]
	mov	w9, #96
	str	w9, [sp]
	add	x21, sp, #32
	str	x21, [sp, #8]
	mov	w9, #24
	str	w9, [sp, #16]
	str	xzr, [sp, #24]
	ldr	w9, [x0, #16]
	mov	w10, #10560
	movk	w10, #6790, lsl #16
	mov	w11, #4
	mov	w12, #2
	cmp	w9, w10
	csel	w10, w12, w11, lt
	mov	w11, #53632
	movk	w11, #2288, lsl #16
	cmp	w9, w11
	mov	w11, #45914
	movk	w11, #551, lsl #16
	add	w9, w9, w11
	mov	w11, #56963
	movk	w11, #17179, lsl #16
	smull	x9, w9, w11
	lsr	x11, x9, #63
	asr	x9, x9, #46
	add	w9, w9, w11
	ubfx	w11, w9, #8, #7
	and	w9, w9, #0xff
	stp	w11, w9, [sp, #32]
	mov	w9, #206
	csinc	w10, w10, wzr, ge
	stp	w9, w10, [sp, #40]
Lloh3:
	adrp	x9, lCPI0_0@PAGE
Lloh4:
	ldr	d0, [x9, lCPI0_0@PAGEOFF]
	str	d0, [sp, #48]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #1
	blr	x8
LBB0_2:
	mov	w22, #1
	mov	x1, sp
	mov	x0, x20
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_13
; %bb.3:
	add	x21, x21, #8
Lloh5:
	adrp	x8, _I2C_M_RD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _I2C_M_RD@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	str	w22, [sp, #16]
	mov	w22, #20
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #10
	bl	_msleep
	subs	w22, w22, #1
	b.eq	LBB0_9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	cbz	x8, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	mov	w1, #1
	blr	x8
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, sp
	mov	x0, x20
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldrb	w8, [sp, #32]
	tbz	w8, #6, LBB0_4
LBB0_9:
	str	xzr, [sp, #24]
	mov	w8, #2
	str	w8, [sp, #16]
	str	x21, [sp, #8]
	ldr	w8, [sp, #40]
	and	w8, w8, #0xffffffbf
	str	w8, [sp, #40]
	ldr	x8, [x19]
	cbz	x8, LBB0_11
; %bb.10:
	mov	x0, x19
	mov	w1, #1
	blr	x8
LBB0_11:
	mov	x1, sp
	mov	x0, x20
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_13
; %bb.12:
	mov	w0, #0
	b	LBB0_14
LBB0_13:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldur	x8, [x29, #-40]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.15:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_I2C_M_RD,8,3                   ; @I2C_M_RD
	.comm	_CU1216_IF,4,2                  ; @CU1216_IF
	.comm	_TUNER_MUL,4,2                  ; @TUNER_MUL
	.no_dead_strip	_tda1002x_cu1216_tuner_set
.subsections_via_symbols
