	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dvbt2_calc_ssi
_dvbt2_calc_ssi:                        ## @dvbt2_calc_ssi
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rdx, %r15
	testq	%rdx, %rdx
	je	LBB0_2
## %bb.3:
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_CXD2880_DVBT2_PLP_DATA@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-40(%rbp), %rdx
	callq	_cxd2880_tnrdmd_dvbt2_mon_qam
	testl	%eax, %eax
	jne	LBB0_15
## %bb.4:
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_cxd2880_tnrdmd_dvbt2_mon_code_rate
	testl	%eax, %eax
	jne	LBB0_15
## %bb.5:
	movl	-36(%rbp), %eax
	movq	_CXD2880_DVBT2_R2_5@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	ja	LBB0_2
## %bb.6:
	movl	-40(%rbp), %ecx
	movq	_CXD2880_DVBT2_QAM256@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jbe	LBB0_7
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_ref_dbm_1000@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	(%rdx,%rcx,8), %rcx
	subl	(%rcx,%rax,4), %r14d
	xorl	%eax, %eax
	movl	$0, %ecx
	cmpl	$-15000, %r14d                  ## imm = 0xC568
	jl	LBB0_14
## %bb.8:
	testl	%r14d, %r14d
	js	LBB0_9
## %bb.10:
	cmpl	$19999, %r14d                   ## imm = 0x4E1F
	ja	LBB0_12
## %bb.11:
	leal	500(,%r14,4), %ecx
	imulq	$274877907, %rcx, %rcx          ## imm = 0x10624DD3
	shrq	$38, %rcx
	addl	$10, %ecx
	jmp	LBB0_14
LBB0_9:
	leal	(%r14,%r14), %ecx
	addl	$31500, %ecx                    ## imm = 0x7B0C
	movzwl	%cx, %ecx
	shrl	$3, %ecx
	imull	$5593, %ecx, %ecx               ## imm = 0x15D9
	shrl	$21, %ecx
	jmp	LBB0_14
LBB0_12:
	movl	$100, %ecx
	cmpl	$34999, %r14d                   ## imm = 0x88B7
	ja	LBB0_14
## %bb.13:
	leal	(%r14,%r14), %ecx
	addl	$27036, %ecx                    ## imm = 0x699C
	movzwl	%cx, %ecx
	shrl	$3, %ecx
	imull	$5593, %ecx, %ecx               ## imm = 0x15D9
	shrl	$21, %ecx
	addl	$90, %ecx
LBB0_14:
	movl	%ecx, (%r15)
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CXD2880_DVBT2_PLP_DATA,4,2     ## @CXD2880_DVBT2_PLP_DATA
	.comm	_CXD2880_DVBT2_R2_5,4,2         ## @CXD2880_DVBT2_R2_5
	.comm	_CXD2880_DVBT2_QAM256,4,2       ## @CXD2880_DVBT2_QAM256
	.comm	_ref_dbm_1000,8,3               ## @ref_dbm_1000
	.no_dead_strip	_dvbt2_calc_ssi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dvbt2_calc_ssi
_dvbt2_calc_ssi:                        ; @dvbt2_calc_ssi
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x2
	cbz	x2, LBB0_6
; %bb.2:
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x22, _CXD2880_DVBT2_PLP_DATA@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CXD2880_DVBT2_PLP_DATA@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	bl	_cxd2880_tnrdmd_dvbt2_mon_qam
	cbnz	w0, LBB0_7
; %bb.3:
	ldr	w1, [x22]
	add	x2, sp, #8
	mov	x0, x21
	bl	_cxd2880_tnrdmd_dvbt2_mon_code_rate
	cbnz	w0, LBB0_7
; %bb.4:
	ldr	w8, [sp, #8]
Lloh2:
	adrp	x9, _CXD2880_DVBT2_R2_5@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CXD2880_DVBT2_R2_5@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w9
	b.hi	LBB0_6
; %bb.5:
	ldr	w9, [sp, #12]
Lloh5:
	adrp	x10, _CXD2880_DVBT2_QAM256@GOTPAGE
Lloh6:
	ldr	x10, [x10, _CXD2880_DVBT2_QAM256@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ls	LBB0_8
LBB0_6:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_8:
Lloh11:
	adrp	x10, _ref_dbm_1000@GOTPAGE
Lloh12:
	ldr	x10, [x10, _ref_dbm_1000@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
	ldr	x9, [x10, x9, lsl #3]
	ldr	w8, [x9, x8, lsl #2]
	mov	w9, #-15000
	sub	w8, w20, w8
	cmp	w8, w9
	b.ge	LBB0_10
; %bb.9:
	mov	w8, #0
	b	LBB0_17
LBB0_10:
	tbnz	w8, #31, LBB0_13
; %bb.11:
	lsr	w9, w8, #5
	cmp	w9, #624
	b.hi	LBB0_14
; %bb.12:
	lsl	w8, w8, #2
	add	w8, w8, #500
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	umull	x8, w8, w9
	lsr	x8, x8, #38
	add	w8, w8, #10
	b	LBB0_17
LBB0_13:
	mov	w9, #31500
	add	w8, w9, w8, lsl #1
	ubfx	w8, w8, #3, #13
	mov	w9, #5593
	mul	w8, w8, w9
	lsr	w8, w8, #21
	b	LBB0_17
LBB0_14:
	mov	w9, #34999
	cmp	w8, w9
	b.hi	LBB0_16
; %bb.15:
	mov	w9, #27036
	add	w8, w9, w8, lsl #1
	ubfx	w8, w8, #3, #13
	mov	w9, #5593
	mul	w8, w8, w9
	lsr	w8, w8, #21
	add	w8, w8, #90
	b	LBB0_17
LBB0_16:
	mov	w8, #100
LBB0_17:
	mov	w0, #0
	str	w8, [x19]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CXD2880_DVBT2_PLP_DATA,4,2     ; @CXD2880_DVBT2_PLP_DATA
	.comm	_CXD2880_DVBT2_R2_5,4,2         ; @CXD2880_DVBT2_R2_5
	.comm	_CXD2880_DVBT2_QAM256,4,2       ; @CXD2880_DVBT2_QAM256
	.comm	_ref_dbm_1000,8,3               ; @ref_dbm_1000
	.no_dead_strip	_dvbt2_calc_ssi
.subsections_via_symbols
