	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv0367ter_read_ber
_stv0367ter_read_ber:                   ## @stv0367ter_read_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	(%rdi), %rbx
	movq	(%rbx), %r14
	movq	_F367TER_SFERRC_OLDVALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stv0367_readbits
	testl	%eax, %eax
	jne	LBB0_27
## %bb.1:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	_F367TER_SFEC_ERR_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stv0367_readbits
	movl	%eax, %r15d
	shll	$16, %r15d
	movq	_F367TER_SFEC_ERR_CNT_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stv0367_readbits
	movl	%eax, %r12d
	shll	$8, %r12d
	addl	%r15d, %r12d
	movq	_F367TER_SFEC_ERR_CNT_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stv0367_readbits
	movl	%eax, %r15d
	movq	_F367TER_SFEC_ERR_SOURCE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stv0367_readbits
	movl	%eax, %r13d
	movq	_F367TER_SFEC_NUM_EVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stv0367_readbits
                                        ## kill: def $eax killed $eax def $rax
	xorl	%edx, %edx
	addl	%r12d, %r15d
	je	LBB0_26
## %bb.2:
	cmpl	$7, %r13d
	jne	LBB0_26
## %bb.3:
	cmpl	$4, %r15d
	jg	LBB0_5
## %bb.4:
	imull	$1000000000, %r15d, %edx        ## imm = 0x3B9ACA00
	leal	131071(%rdx), %ecx
	testl	%edx, %edx
	cmovnsl	%edx, %ecx
	sarl	$17, %ecx
	jmp	LBB0_17
LBB0_5:
	cmpl	$42, %r15d
	ja	LBB0_7
## %bb.6:
	imull	$100000000, %r15d, %ecx         ## imm = 0x5F5E100
	leal	131071(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$17, %edx
	addl	%edx, %edx
	leal	(%rdx,%rdx,4), %ecx
	jmp	LBB0_17
LBB0_7:
	cmpl	$429, %r15d                     ## imm = 0x1AD
	ja	LBB0_9
## %bb.8:
	imull	$10000000, %r15d, %ecx          ## imm = 0x989680
	leal	131071(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$17, %edx
	imull	$100, %edx, %ecx
	jmp	LBB0_17
LBB0_9:
	cmpl	$4294, %r15d                    ## imm = 0x10C6
	ja	LBB0_11
## %bb.10:
	imull	$1000000, %r15d, %ecx           ## imm = 0xF4240
	leal	131071(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$17, %edx
	imull	$1000, %edx, %ecx               ## imm = 0x3E8
	jmp	LBB0_17
LBB0_11:
	cmpl	$42949, %r15d                   ## imm = 0xA7C5
	ja	LBB0_13
## %bb.12:
	imull	$100000, %r15d, %ecx            ## imm = 0x186A0
	leal	131071(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$17, %edx
	imull	$10000, %edx, %ecx              ## imm = 0x2710
	jmp	LBB0_17
LBB0_13:
	cmpl	$429496, %r15d                  ## imm = 0x68DB8
	ja	LBB0_15
## %bb.14:
	imull	$10000, %r15d, %ecx             ## imm = 0x2710
	jmp	LBB0_16
LBB0_15:
	imull	$1000, %r15d, %ecx              ## imm = 0x3E8
LBB0_16:
	leal	131071(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$17, %edx
	imull	$100000, %edx, %ecx             ## imm = 0x186A0
LBB0_17:
	addl	$-2, %eax
	cmpl	$4, %eax
	ja	LBB0_20
## %bb.18:
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rax,4), %rax
	addq	%rdx, %rax
	jmpq	*%rax
LBB0_19:
	leal	3(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$2, %eax
	jmp	LBB0_24
LBB0_20:
	xorl	%ecx, %ecx
	jmp	LBB0_25
LBB0_21:
	leal	15(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$4, %eax
	jmp	LBB0_24
LBB0_22:
	leal	63(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$6, %eax
	jmp	LBB0_24
LBB0_23:
	leal	255(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$8, %eax
LBB0_24:
	movl	%eax, %ecx
LBB0_25:
	addl	$-429497, %r15d                 ## imm = 0xFFF97247
	leal	(%rcx,%rcx), %eax
	cmpl	$3865470, %r15d                 ## imm = 0x3AFB7E
	leal	(%rax,%rax,4), %edx
	cmovael	%ecx, %edx
LBB0_26:
	movl	%edx, (%r14)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%edx, (%rax)
LBB0_27:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_25, LBB0_25-LJTI0_0
.set L0_0_set_19, LBB0_19-LJTI0_0
.set L0_0_set_21, LBB0_21-LJTI0_0
.set L0_0_set_22, LBB0_22-LJTI0_0
.set L0_0_set_23, LBB0_23-LJTI0_0
LJTI0_0:
	.long	L0_0_set_25
	.long	L0_0_set_19
	.long	L0_0_set_21
	.long	L0_0_set_22
	.long	L0_0_set_23
	.end_data_region
                                        ## -- End function
	.comm	_F367TER_SFERRC_OLDVALUE,4,2    ## @F367TER_SFERRC_OLDVALUE
	.comm	_F367TER_SFEC_ERR_CNT,4,2       ## @F367TER_SFEC_ERR_CNT
	.comm	_F367TER_SFEC_ERR_CNT_HI,4,2    ## @F367TER_SFEC_ERR_CNT_HI
	.comm	_F367TER_SFEC_ERR_CNT_LO,4,2    ## @F367TER_SFEC_ERR_CNT_LO
	.comm	_F367TER_SFEC_ERR_SOURCE,4,2    ## @F367TER_SFEC_ERR_SOURCE
	.comm	_F367TER_SFEC_NUM_EVENT,4,2     ## @F367TER_SFEC_NUM_EVENT
	.no_dead_strip	_stv0367ter_read_ber
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv0367ter_read_ber
_stv0367ter_read_ber:                   ; @stv0367ter_read_ber
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	ldr	x20, [x0]
	ldr	x22, [x20]
Lloh0:
	adrp	x8, _F367TER_SFERRC_OLDVALUE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _F367TER_SFERRC_OLDVALUE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stv0367_readbits
	cbnz	w0, LBB0_21
; %bb.1:
Lloh3:
	adrp	x8, _F367TER_SFEC_ERR_CNT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _F367TER_SFEC_ERR_CNT@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stv0367_readbits
	mov	x21, x0
Lloh6:
	adrp	x8, _F367TER_SFEC_ERR_CNT_HI@GOTPAGE
Lloh7:
	ldr	x8, [x8, _F367TER_SFEC_ERR_CNT_HI@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stv0367_readbits
	lsl	w8, w0, #8
	add	w21, w8, w21, lsl #16
Lloh9:
	adrp	x8, _F367TER_SFEC_ERR_CNT_LO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _F367TER_SFEC_ERR_CNT_LO@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stv0367_readbits
	add	w23, w21, w0
Lloh12:
	adrp	x8, _F367TER_SFEC_ERR_SOURCE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _F367TER_SFEC_ERR_SOURCE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stv0367_readbits
	mov	x21, x0
Lloh15:
	adrp	x8, _F367TER_SFEC_NUM_EVENT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _F367TER_SFEC_NUM_EVENT@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stv0367_readbits
	cmp	w23, #0
	ccmp	w21, #7, #0, ne
	b.eq	LBB0_3
; %bb.2:
	mov	w8, #0
	b	LBB0_20
LBB0_3:
	cmp	w23, #4
	b.gt	LBB0_5
; %bb.4:
	mov	w8, #51712
	movk	w8, #15258, lsl #16
	mul	w8, w23, w8
	mov	w9, #131071
	add	w9, w8, w9
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #17
	b	LBB0_12
LBB0_5:
	cmp	w23, #42
	b.hi	LBB0_7
; %bb.6:
	mov	w8, #57600
	movk	w8, #1525, lsl #16
	mul	w8, w23, w8
	mov	w9, #131071
	add	w9, w8, w9
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #17
	add	w8, w8, w8, lsl #2
	lsl	w8, w8, #1
	b	LBB0_12
LBB0_7:
	cmp	w23, #429
	b.hi	LBB0_9
; %bb.8:
	mov	w8, #38528
	movk	w8, #152, lsl #16
	mul	w8, w23, w8
	mov	w9, #131071
	add	w9, w8, w9
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #17
	mov	w9, #100
	mul	w8, w8, w9
	b	LBB0_12
LBB0_9:
	mov	w8, #4294
	cmp	w23, w8
	b.hi	LBB0_11
; %bb.10:
	mov	w8, #16960
	movk	w8, #15, lsl #16
	mul	w8, w23, w8
	mov	w9, #131071
	add	w9, w8, w9
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #17
	mov	w9, #1000
	mul	w8, w8, w9
	b	LBB0_12
LBB0_11:
	mov	w8, #34464
	movk	w8, #1, lsl #16
	mov	w9, #42949
	mov	w10, #36280
	movk	w10, #6, lsl #16
	mov	w11, #1000
	mul	w11, w23, w11
	mov	w12, #131071
	add	w13, w11, w12
	cmp	w11, #0
	csel	w11, w13, w11, lt
	asr	w11, w11, #17
	mul	w11, w11, w8
	mov	w13, #10000
	mul	w14, w23, w13
	add	w15, w14, w12
	cmp	w14, #0
	csel	w14, w15, w14, lt
	asr	w14, w14, #17
	mul	w14, w14, w8
	cmp	w23, w10
	csel	w10, w11, w14, hi
	mul	w8, w23, w8
	add	w11, w8, w12
	cmp	w8, #0
	csel	w8, w11, w8, lt
	asr	w8, w8, #17
	mul	w8, w8, w13
	cmp	w23, w9
	csel	w8, w10, w8, hi
LBB0_12:
	sub	w9, w0, #2
	cmp	w9, #4
	b.hi	LBB0_15
; %bb.13:
Lloh18:
	adrp	x10, lJTI0_0@PAGE
Lloh19:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_14
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_14:
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #2
	b	LBB0_19
LBB0_15:
	mov	w8, #0
	b	LBB0_19
LBB0_16:
	add	w9, w8, #15
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #4
	b	LBB0_19
LBB0_17:
	add	w9, w8, #63
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #6
	b	LBB0_19
LBB0_18:
	add	w9, w8, #255
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #8
LBB0_19:
	sub	w9, w23, #104, lsl #12          ; =425984
	sub	w9, w9, #3513
	add	w10, w8, w8, lsl #2
	lsl	w10, w10, #1
	mov	w11, #64382
	movk	w11, #58, lsl #16
	cmp	w9, w11
	csel	w8, w10, w8, lo
LBB0_20:
	str	w8, [x22]
	str	w8, [x19]
LBB0_21:
	mov	w0, #0
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_19-LBB0_14)>>2
	.byte	(LBB0_14-LBB0_14)>>2
	.byte	(LBB0_16-LBB0_14)>>2
	.byte	(LBB0_17-LBB0_14)>>2
	.byte	(LBB0_18-LBB0_14)>>2
                                        ; -- End function
	.comm	_F367TER_SFERRC_OLDVALUE,4,2    ; @F367TER_SFERRC_OLDVALUE
	.comm	_F367TER_SFEC_ERR_CNT,4,2       ; @F367TER_SFEC_ERR_CNT
	.comm	_F367TER_SFEC_ERR_CNT_HI,4,2    ; @F367TER_SFEC_ERR_CNT_HI
	.comm	_F367TER_SFEC_ERR_CNT_LO,4,2    ; @F367TER_SFEC_ERR_CNT_LO
	.comm	_F367TER_SFEC_ERR_SOURCE,4,2    ; @F367TER_SFEC_ERR_SOURCE
	.comm	_F367TER_SFEC_NUM_EVENT,4,2     ; @F367TER_SFEC_NUM_EVENT
	.no_dead_strip	_stv0367ter_read_ber
.subsections_via_symbols
