	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grundig_29504_401_tuner_set_params
_grundig_29504_401_tuner_set_params:    ## @grundig_29504_401_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	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	(%rdi), %rax
	movq	16(%rdi), %rcx
	movq	(%rcx), %rbx
	leaq	-32(%rbp), %rcx
	movq	%rcx, -56(%rbp)
	movl	$16, -48(%rbp)
	movl	$0, -40(%rbp)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%rax), %eax
	jmp	LBB0_3
LBB0_1:
	movl	$97, %eax
LBB0_3:
	movl	%eax, -44(%rbp)
	movl	24(%rdi), %edx
	leal	36125000(%rdx), %eax
	cltq
	imulq	$211107077, %rax, %rax          ## imm = 0xC953D05
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$45, %rax
	addl	%ecx, %eax
	movl	$128, %ecx
	cmpl	$175000000, %edx                ## imm = 0xA6E49C0
	jl	LBB0_7
## %bb.4:
	movl	$64, %ecx
	cmpl	$390000000, %edx                ## imm = 0x173EED80
	jb	LBB0_7
## %bb.5:
	movl	$128, %ecx
	cmpl	$470000000, %edx                ## imm = 0x1C03A180
	jb	LBB0_7
## %bb.6:
	xorl	%ecx, %ecx
	cmpl	$750000000, %edx                ## imm = 0x2CB41780
	setae	%cl
	shll	$7, %ecx
	orl	$64, %ecx
LBB0_7:
	xorl	%esi, %esi
	cmpl	$470000000, %edx                ## imm = 0x1C03A180
	setl	%sil
	cmpl	$175000000, %edx                ## imm = 0xA6E49C0
	leal	3(%rsi,%rsi), %edx
	movl	$14, %esi
	cmovgel	%edx, %esi
	movl	%eax, %edx
	shrl	$8, %edx
	andl	$127, %edx
	movl	%edx, -32(%rbp)
	movzbl	%al, %edx
	movl	%edx, -28(%rbp)
	shrl	$10, %eax
	andl	$96, %eax
	orl	$136, %eax
	movl	%eax, -24(%rbp)
	orl	%ecx, %esi
	movl	%esi, -20(%rbp)
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movl	$1, %esi
	callq	*%rax
LBB0_9:
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_i2c_transfer
	movl	%eax, %ecx
	movq	_EIO@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	subl	(%rdx), %eax
	xorl	%edx, %edx
	cmpl	$1, %ecx
	cmovel	%edx, %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-16(%rbp), %rcx
	jne	LBB0_11
## %bb.10:
	addq	$56, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_grundig_29504_401_tuner_set_params
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grundig_29504_401_tuner_set_params
_grundig_29504_401_tuner_set_params:    ; @grundig_29504_401_tuner_set_params
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	ldr	x8, [x0, #16]
	ldr	x19, [x8]
	ldr	x8, [x0]
	add	x9, sp, #24
	str	x9, [sp]
	mov	w9, #16
	str	w9, [sp, #8]
	str	wzr, [sp, #16]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w8, [x8]
	b	LBB0_3
LBB0_2:
	mov	w8, #97
LBB0_3:
	mov	w9, #41344
	movk	w9, #7171, lsl #16
	str	w8, [sp, #12]
	ldr	w8, [x0, #24]
	mov	w10, #14664
	movk	w10, #551, lsl #16
	add	w10, w8, w10
	mov	w11, #15621
	movk	w11, #3221, lsl #16
	smull	x10, w10, w11
	lsr	x11, x10, #63
	asr	x10, x10, #45
	add	w10, w10, w11
	mov	w11, #128
	mov	w12, #18880
	movk	w12, #2670, lsl #16
	mov	w13, #64
	mov	w14, #60800
	movk	w14, #5950, lsl #16
	mov	w15, #128
	mov	w16, #6016
	movk	w16, #11444, lsl #16
	mov	w17, #192
	cmp	w8, w16
	csel	w16, w13, w17, lo
	cmp	w8, w9
	csel	w15, w15, w16, lo
	cmp	w8, w14
	csel	w13, w13, w15, lo
	cmp	w8, w12
	csel	w11, w11, w13, lt
	mov	w13, #3
	mov	w14, #5
	cmp	w8, w9
	csel	w9, w14, w13, lt
	mov	w13, #14
	cmp	w8, w12
	csel	w8, w13, w9, lt
	ubfx	w9, w10, #8, #7
	and	w12, w10, #0xff
	stp	w9, w12, [sp, #24]
	lsr	w9, w10, #10
	and	w9, w9, #0x60
	mov	w10, #136
	orr	w9, w9, w10
	orr	w8, w11, w8
	stp	w9, w8, [sp, #32]
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_5
; %bb.4:
	mov	w1, #1
	blr	x8
LBB0_5:
	mov	x1, sp
	mov	x0, x19
	mov	w2, #1
	bl	_i2c_transfer
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w0, #1
	csneg	w0, wzr, w8, eq
	ldur	x8, [x29, #-24]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_grundig_29504_401_tuner_set_params
.subsections_via_symbols
