	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function si2165_set_frontend
_si2165_set_frontend:                   ## @si2165_set_frontend
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	16(%rdi), %r14
	movl	8(%rdi), %ebx
	movq	%r14, %rdi
	callq	_si2165_set_if_freq_shift
	testl	%eax, %eax
	js	LBB0_17
## %bb.1:
	cmpl	$129, %ebx
	je	LBB0_4
## %bb.2:
	cmpl	$128, %ebx
	jne	LBB0_19
## %bb.3:
	movq	%r15, %rdi
	callq	_si2165_set_frontend_dvbt
	testl	%eax, %eax
	jns	LBB0_6
	jmp	LBB0_17
LBB0_4:
	movq	%r15, %rdi
	callq	_si2165_set_frontend_dvbc
	testl	%eax, %eax
	js	LBB0_17
LBB0_6:
	movq	_REG_ADDR_JUMP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$-201326592, %edx               ## imm = 0xF4000000
	callq	_si2165_writereg32
	testl	%eax, %eax
	js	LBB0_17
## %bb.7:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	callq	*%rax
LBB0_9:
	movq	%r14, %rdi
	callq	_si2165_set_if_freq_shift
	testl	%eax, %eax
	js	LBB0_17
## %bb.10:
	movq	_REG_WDOG_AND_BOOT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_si2165_readreg8
	testl	%eax, %eax
	js	LBB0_17
## %bb.11:
	movl	(%r15), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_si2165_writereg8
	testl	%eax, %eax
	js	LBB0_17
## %bb.12:
	movq	_REG_RST_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_si2165_writereg8
	testl	%eax, %eax
	js	LBB0_17
## %bb.13:
	movq	_REG_GP_REG0_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_si2165_writereg32
	testl	%eax, %eax
	js	LBB0_17
## %bb.14:
	movq	_adc_rewrite@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %edi
	callq	_ARRAY_SIZE
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_si2165_write_reg_list
	testl	%eax, %eax
	js	LBB0_17
## %bb.15:
	movq	_REG_START_SYNCHRO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_si2165_writereg8
	testl	%eax, %eax
	js	LBB0_17
## %bb.16:
	movl	(%r15), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_si2165_readreg8
	movl	%eax, %ecx
	sarl	$31, %eax
	andl	%ecx, %eax
	jmp	LBB0_17
LBB0_19:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_17:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_20
## %bb.18:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_REG_ADDR_JUMP,4,2              ## @REG_ADDR_JUMP
	.comm	_REG_WDOG_AND_BOOT,4,2          ## @REG_WDOG_AND_BOOT
	.comm	_REG_RST_ALL,4,2                ## @REG_RST_ALL
	.comm	_REG_GP_REG0_LSB,4,2            ## @REG_GP_REG0_LSB
	.comm	_adc_rewrite,4,2                ## @adc_rewrite
	.comm	_REG_START_SYNCHRO,4,2          ## @REG_START_SYNCHRO
	.no_dead_strip	_si2165_set_frontend
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function si2165_set_frontend
_si2165_set_frontend:                   ; @si2165_set_frontend
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x19, [x0, #16]
	ldr	w21, [x0, #8]
	mov	x0, x19
	bl	_si2165_set_if_freq_shift
	tbnz	w0, #31, LBB0_17
; %bb.1:
	cmp	w21, #129
	b.eq	LBB0_4
; %bb.2:
	cmp	w21, #128
	b.ne	LBB0_16
; %bb.3:
	mov	x0, x20
	bl	_si2165_set_frontend_dvbt
	tbz	w0, #31, LBB0_5
	b	LBB0_17
LBB0_4:
	mov	x0, x20
	bl	_si2165_set_frontend_dvbc
	tbnz	w0, #31, LBB0_17
LBB0_5:
Lloh3:
	adrp	x8, _REG_ADDR_JUMP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_ADDR_JUMP@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-201326592
	bl	_si2165_writereg32
	tbnz	w0, #31, LBB0_17
; %bb.6:
	ldr	x8, [x20]
	cbz	x8, LBB0_8
; %bb.7:
	mov	x0, x20
	blr	x8
LBB0_8:
	mov	x0, x19
	bl	_si2165_set_if_freq_shift
	tbnz	w0, #31, LBB0_17
; %bb.9:
Lloh6:
	adrp	x21, _REG_WDOG_AND_BOOT@GOTPAGE
Lloh7:
	ldr	x21, [x21, _REG_WDOG_AND_BOOT@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_si2165_readreg8
	tbnz	w0, #31, LBB0_17
; %bb.10:
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	bl	_si2165_writereg8
	tbnz	w0, #31, LBB0_17
; %bb.11:
Lloh8:
	adrp	x8, _REG_RST_ALL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _REG_RST_ALL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_si2165_writereg8
	tbnz	w0, #31, LBB0_17
; %bb.12:
Lloh11:
	adrp	x8, _REG_GP_REG0_LSB@GOTPAGE
Lloh12:
	ldr	x8, [x8, _REG_GP_REG0_LSB@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_si2165_writereg32
	tbnz	w0, #31, LBB0_17
; %bb.13:
Lloh14:
	adrp	x8, _adc_rewrite@GOTPAGE
Lloh15:
	ldr	x8, [x8, _adc_rewrite@GOTPAGEOFF]
Lloh16:
	ldr	w20, [x8]
	mov	x0, x20
	bl	_ARRAY_SIZE
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_si2165_write_reg_list
	tbnz	w0, #31, LBB0_17
; %bb.14:
Lloh17:
	adrp	x8, _REG_START_SYNCHRO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _REG_START_SYNCHRO@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_si2165_writereg8
	tbnz	w0, #31, LBB0_17
; %bb.15:
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_si2165_readreg8
	cmp	w0, #0
	csel	w0, w0, wzr, lt
	b	LBB0_17
LBB0_16:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	ldr	x8, [sp, #24]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.18:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_REG_ADDR_JUMP,4,2              ; @REG_ADDR_JUMP
	.comm	_REG_WDOG_AND_BOOT,4,2          ; @REG_WDOG_AND_BOOT
	.comm	_REG_RST_ALL,4,2                ; @REG_RST_ALL
	.comm	_REG_GP_REG0_LSB,4,2            ; @REG_GP_REG0_LSB
	.comm	_adc_rewrite,4,2                ; @adc_rewrite
	.comm	_REG_START_SYNCHRO,4,2          ; @REG_START_SYNCHRO
	.no_dead_strip	_si2165_set_frontend
.subsections_via_symbols
