	.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	8(%rdi), %rax
	movq	(%rax), %rbx
	movl	$97, -56(%rbp)
	leaq	-32(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	$16, -40(%rbp)
	movl	16(%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_4
## %bb.1:
	movl	$64, %ecx
	cmpl	$390000000, %edx                ## imm = 0x173EED80
	jb	LBB0_4
## %bb.2:
	movl	$128, %ecx
	cmpl	$470000000, %edx                ## imm = 0x1C03A180
	jb	LBB0_4
## %bb.3:
	xorl	%ecx, %ecx
	cmpl	$750000000, %edx                ## imm = 0x2CB41780
	setae	%cl
	shll	$7, %ecx
	orl	$64, %ecx
LBB0_4:
	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	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movl	$1, %esi
	callq	*%rax
LBB0_6:
	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_8
## %bb.7:
	addq	$56, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_8:
	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
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function grundig_29504_401_tuner_set_params
lCPI0_0:
	.long	16                              ; 0x10
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_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]
	mov	w8, #41344
	movk	w8, #7171, lsl #16
	mov	w10, #97
	add	x11, sp, #24
	ldr	w12, [x0, #16]
	mov	w9, #14664
	movk	w9, #551, lsl #16
	add	w9, w12, w9
	mov	w13, #15621
	movk	w13, #3221, lsl #16
	smull	x13, w9, w13
	ldp	x9, x14, [x0]
	ldr	x19, [x14]
	str	w10, [sp]
	str	x11, [sp, #8]
Lloh3:
	adrp	x10, lCPI0_0@PAGE
Lloh4:
	ldr	d0, [x10, lCPI0_0@PAGEOFF]
	str	d0, [sp, #16]
	lsr	x10, x13, #63
	asr	x11, x13, #45
	add	w10, w11, w10
	mov	w11, #128
	mov	w13, #18880
	movk	w13, #2670, lsl #16
	mov	w14, #64
	mov	w15, #128
	mov	w16, #6016
	movk	w16, #11444, lsl #16
	mov	w17, #192
	cmp	w12, w16
	csel	w16, w14, w17, lo
	cmp	w12, w8
	csel	w15, w15, w16, lo
	mov	w16, #60800
	movk	w16, #5950, lsl #16
	cmp	w12, w16
	csel	w14, w14, w15, lo
	cmp	w12, w13
	csel	w11, w11, w14, lt
	mov	w14, #3
	mov	w15, #5
	cmp	w12, w8
	csel	w8, w15, w14, lt
	mov	w14, #14
	cmp	w12, w13
	csel	w8, w14, w8, lt
	ubfx	w12, w10, #8, #7
	and	w13, w10, #0xff
	stp	w12, w13, [sp, #24]
	lsr	w10, w10, #10
	and	w10, w10, #0x60
	mov	w12, #136
	orr	w10, w10, w12
	orr	w8, w11, w8
	stp	w10, w8, [sp, #32]
	cbz	x9, LBB0_2
; %bb.1:
	mov	w1, #1
	blr	x9
LBB0_2:
	mov	x1, sp
	mov	x0, x19
	mov	w2, #1
	bl	_i2c_transfer
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w0, #1
	csneg	w0, wzr, w8, eq
	ldur	x8, [x29, #-24]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.3:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_4:
	bl	___stack_chk_fail
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_grundig_29504_401_tuner_set_params
.subsections_via_symbols
