	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nexusca_stv0297_tuner_set_params
_nexusca_stv0297_tuner_set_params:      ## @nexusca_stv0297_tuner_set_params
	.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
	subq	$80, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	8(%rdi), %rax
	movq	(%rax), %r14
	movl	$99, -112(%rbp)
	leaq	-64(%rbp), %rax
	movq	%rax, -104(%rbp)
	movq	$16, -96(%rbp)
	movl	$99, -88(%rbp)
	movq	%rax, -80(%rbp)
	movl	$1, -72(%rbp)
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
	movl	16(%rdi), %eax
	leal	36181250(%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, -64(%rbp)
	movl	%edx, -60(%rbp)
	movl	$206, -56(%rbp)
	cmpl	$44999999, %eax                 ## imm = 0x2AEA53F
	jg	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_3:
	movq	%rdi, %r12
	movl	$1, %ecx
	cmpl	$137000000, %eax                ## imm = 0x82A7440
	jb	LBB0_6
## %bb.4:
	movl	$2, %ecx
	cmpl	$403000000, %eax                ## imm = 0x18054AC0
	jb	LBB0_6
## %bb.5:
	movl	$4, %ecx
	cmpl	$860000000, %eax                ## imm = 0x33428F00
	jae	LBB0_1
LBB0_6:
	movl	%ecx, -52(%rbp)
	movq	(%r12), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	*%rax
LBB0_8:
	leaq	-112(%rbp), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_i2c_transfer
	cmpl	$1, %eax
	jne	LBB0_18
## %bb.9:
	movl	$20, %ebx
	leaq	-88(%rbp), %r15
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	$10, %edi
	callq	_msleep
	decl	%ebx
	je	LBB0_15
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%r12, %rdi
	movl	$1, %esi
	callq	*%rax
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	cmpl	$1, %eax
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	testb	$64, -64(%rbp)
	je	LBB0_14
LBB0_15:
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_18:
	leaq	L_.str(%rip), %rdi
	callq	_printk
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-40(%rbp), %rcx
	jne	LBB0_19
## %bb.17:
	addq	$80, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"nexusca: pll transfer failed!\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_nexusca_stv0297_tuner_set_params
.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 nexusca_stv0297_tuner_set_params
lCPI0_0:
	.long	16                              ; 0x10
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_nexusca_stv0297_tuner_set_params:      ; @nexusca_stv0297_tuner_set_params
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	ldr	x8, [x0, #8]
	ldr	x20, [x8]
	mov	w8, #99
	str	w8, [sp, #32]
	add	x9, sp, #56
	str	x9, [sp, #40]
Lloh3:
	adrp	x10, lCPI0_0@PAGE
Lloh4:
	ldr	d0, [x10, lCPI0_0@PAGEOFF]
	str	d0, [sp, #48]
	str	w8, [sp, #8]
	str	x9, [sp, #16]
	mov	w8, #1
Lloh5:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh6:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #24]
	ldr	w8, [x0, #16]
	mov	w9, #5378
	movk	w9, #552, lsl #16
	add	w9, w8, w9
	mov	w10, #56963
	movk	w10, #17179, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	asr	x9, x9, #46
	add	w9, w9, w10
	ubfx	w10, w9, #8, #7
	and	w9, w9, #0xff
	stp	w10, w9, [sp, #56]
	mov	w9, #206
	str	w9, [sp, #64]
	mov	w9, #42303
	movk	w9, #686, lsl #16
	cmp	w8, w9
	b.gt	LBB0_2
LBB0_1:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_19
LBB0_2:
	mov	x19, x0
	mov	w9, #29760
	movk	w9, #2090, lsl #16
	cmp	w8, w9
	b.hs	LBB0_4
; %bb.3:
	mov	w8, #1
	b	LBB0_8
LBB0_4:
	mov	w9, #19136
	movk	w9, #6149, lsl #16
	cmp	w8, w9
	b.hs	LBB0_6
; %bb.5:
	mov	w8, #2
	b	LBB0_8
LBB0_6:
	mov	w9, #36608
	movk	w9, #13122, lsl #16
	cmp	w8, w9
	b.hs	LBB0_1
; %bb.7:
	mov	w8, #4
LBB0_8:
	str	w8, [sp, #68]
	ldr	x8, [x19]
	cbz	x8, LBB0_10
; %bb.9:
	mov	x0, x19
	mov	w1, #1
	blr	x8
LBB0_10:
	add	x1, sp, #32
	mov	x0, x20
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_18
; %bb.11:
	mov	w21, #20
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	w0, #10
	bl	_msleep
	subs	w21, w21, #1
	b.eq	LBB0_17
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	cbz	x8, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x19
	mov	w1, #1
	blr	x8
LBB0_15:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x1, sp, #8
	mov	x0, x20
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_12
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
	ldrb	w8, [sp, #56]
	tbz	w8, #6, LBB0_12
LBB0_17:
	mov	w0, #0
	b	LBB0_20
LBB0_18:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_20:
	ldur	x8, [x29, #-40]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.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
	add	sp, sp, #128
	ret
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"nexusca: pll transfer failed!\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_nexusca_stv0297_tuner_set_params
.subsections_via_symbols
