	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_vs_bpost_viterbi_ber
_get_vs_bpost_viterbi_ber:              ## @get_vs_bpost_viterbi_ber
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r14
	movl	$0, -28(%rbp)
	movq	_FEC_RS_NR_BIT_ERRORS__A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	xorl	%ecx, %ecx
	callq	_drxj_dap_read_reg16
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_8
LBB0_2:
	movq	_FEC_RS_MEASUREMENT_PERIOD@GOTPCREL(%rip), %rdi
	movq	_FEC_RS_MEASUREMENT_PRESCALE@GOTPCREL(%rip), %rsi
	movl	-28(%rbp), %eax
	movq	_FEC_RS_NR_BIT_ERRORS_FIXED_MANT__M@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	andl	%eax, %ebx
	movq	_FEC_RS_NR_BIT_ERRORS_EXP__M@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_FEC_RS_NR_BIT_ERRORS_EXP__B@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movl	(%rsi), %esi
	imull	(%rdi), %esi
	cmpl	$3, %eax
	movl	$1, %ecx
	movl	$8, %edi
	cmovgel	%ecx, %edi
	imull	%esi, %edi
	imull	$207, %edi, %edi
	movl	%edi, (%r15)
	movl	%ebx, %edx
	movl	%eax, %ecx
	shll	%cl, %edx
	cmpl	$549608, %edx                   ## imm = 0x862E8
	jl	LBB0_4
## %bb.3:
	imull	$26570, %edi, %ebx              ## imm = 0x67CA
	jmp	LBB0_7
LBB0_4:
	testl	%esi, %esi
	je	LBB0_5
## %bb.6:
	leal	-3(%rax), %ecx
	cmpl	$3, %eax
	movzbl	%cl, %ecx
	cmovll	%eax, %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
LBB0_7:
	movl	%ebx, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_err
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FEC_RS_NR_BIT_ERRORS__A,4,2    ## @FEC_RS_NR_BIT_ERRORS__A
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error %d\n"

	.comm	_FEC_RS_MEASUREMENT_PERIOD,4,2  ## @FEC_RS_MEASUREMENT_PERIOD
	.comm	_FEC_RS_MEASUREMENT_PRESCALE,4,2 ## @FEC_RS_MEASUREMENT_PRESCALE
	.comm	_FEC_RS_NR_BIT_ERRORS_FIXED_MANT__M,4,2 ## @FEC_RS_NR_BIT_ERRORS_FIXED_MANT__M
	.comm	_FEC_RS_NR_BIT_ERRORS_EXP__M,4,2 ## @FEC_RS_NR_BIT_ERRORS_EXP__M
	.comm	_FEC_RS_NR_BIT_ERRORS_EXP__B,4,2 ## @FEC_RS_NR_BIT_ERRORS_EXP__B
L_.str.1:                               ## @.str.1
	.asciz	"error: period and/or prescale is zero!\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_get_vs_bpost_viterbi_ber
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_vs_bpost_viterbi_ber
_get_vs_bpost_viterbi_ber:              ; @get_vs_bpost_viterbi_ber
	.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
	mov	x20, x2
	mov	x19, x1
	str	wzr, [sp, #12]
Lloh0:
	adrp	x8, _FEC_RS_NR_BIT_ERRORS__A@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FEC_RS_NR_BIT_ERRORS__A@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	w3, #0
	bl	_drxj_dap_read_reg16
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
	str	x21, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_8
LBB0_2:
Lloh5:
	adrp	x8, _FEC_RS_MEASUREMENT_PERIOD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FEC_RS_MEASUREMENT_PERIOD@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x8]
Lloh8:
	adrp	x8, _FEC_RS_MEASUREMENT_PRESCALE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FEC_RS_MEASUREMENT_PRESCALE@GOTPAGEOFF]
Lloh10:
	ldr	w11, [x8]
	ldr	w9, [sp, #12]
Lloh11:
	adrp	x8, _FEC_RS_NR_BIT_ERRORS_FIXED_MANT__M@GOTPAGE
Lloh12:
	ldr	x8, [x8, _FEC_RS_NR_BIT_ERRORS_FIXED_MANT__M@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x12, _FEC_RS_NR_BIT_ERRORS_EXP__M@GOTPAGE
Lloh15:
	ldr	x12, [x12, _FEC_RS_NR_BIT_ERRORS_EXP__M@GOTPAGEOFF]
	and	w8, w8, w9
Lloh16:
	ldr	w12, [x12]
	and	w9, w12, w9
Lloh17:
	adrp	x12, _FEC_RS_NR_BIT_ERRORS_EXP__B@GOTPAGE
Lloh18:
	ldr	x12, [x12, _FEC_RS_NR_BIT_ERRORS_EXP__B@GOTPAGEOFF]
Lloh19:
	ldr	w12, [x12]
	asr	w9, w9, w12
	mul	w10, w11, w10
	cmp	w9, #2
	mov	w11, #8
	csinc	w11, w11, wzr, le
	mul	w11, w10, w11
	mov	w12, #207
	mul	w11, w11, w12
	str	w11, [x20]
	lsl	w12, w8, w9
	mov	w13, #25320
	movk	w13, #8, lsl #16
	cmp	w12, w13
	b.lt	LBB0_4
; %bb.3:
	mov	w8, #26570
	mul	w8, w11, w8
	b	LBB0_6
LBB0_4:
	cbz	w10, LBB0_7
; %bb.5:
	sub	w10, w9, #3
	cmp	w9, #2
	csel	w9, w10, w9, gt
	lsl	w8, w8, w9
LBB0_6:
	mov	w21, #0
	str	w8, [x19]
	b	LBB0_8
LBB0_7:
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
Lloh22:
	adrp	x8, _EIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_FEC_RS_NR_BIT_ERRORS__A,4,2    ; @FEC_RS_NR_BIT_ERRORS__A
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error %d\n"

	.comm	_FEC_RS_MEASUREMENT_PERIOD,4,2  ; @FEC_RS_MEASUREMENT_PERIOD
	.comm	_FEC_RS_MEASUREMENT_PRESCALE,4,2 ; @FEC_RS_MEASUREMENT_PRESCALE
	.comm	_FEC_RS_NR_BIT_ERRORS_FIXED_MANT__M,4,2 ; @FEC_RS_NR_BIT_ERRORS_FIXED_MANT__M
	.comm	_FEC_RS_NR_BIT_ERRORS_EXP__M,4,2 ; @FEC_RS_NR_BIT_ERRORS_EXP__M
	.comm	_FEC_RS_NR_BIT_ERRORS_EXP__B,4,2 ; @FEC_RS_NR_BIT_ERRORS_EXP__B
l_.str.1:                               ; @.str.1
	.asciz	"error: period and/or prescale is zero!\n"

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