	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_bit_error_rate_s2
_get_bit_error_rate_s2:                 ## @get_bit_error_rate_s2
	.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	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_RSTV0910_P2_ERRCNT12@GOTPCREL(%rip), %rax
	movq	16(%rdi), %rsi
	addq	(%rax), %rsi
	leaq	-44(%rbp), %rdx
	movl	$3, %ecx
	callq	_read_regs
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_2:
	testb	$-128, -44(%rbp)
	jne	LBB0_8
## %bb.3:
	movl	24(%rbx), %esi
	movl	32(%rbx), %edi
	callq	_dvbs2_nbch
	movl	4(%rbx), %edx
	leal	(%rdx,%rdx), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movl	%eax, (%rbx)
	movl	-44(%rbp), %ecx
	movl	-40(%rbp), %eax
	andl	$127, %ecx
	shll	$16, %ecx
	shll	$8, %eax
	orl	%ecx, %eax
	orl	-36(%rbp), %eax
	movl	%eax, 8(%rbx)
	cmpl	$255, %eax
	jg	LBB0_5
## %bb.4:
	movl	$1, %eax
	cmpl	$6, %edx
	jl	LBB0_7
	jmp	LBB0_8
LBB0_5:
	cmpl	$1025, %eax                     ## imm = 0x401
	jb	LBB0_8
## %bb.6:
	movl	$-1, %eax
	cmpl	$3, %edx
	jl	LBB0_8
LBB0_7:
	addl	%eax, %edx
	movl	%edx, 4(%rbx)
	movq	_RSTV0910_P2_ERRCTRL1@GOTPCREL(%rip), %rax
	movq	16(%rbx), %rsi
	addq	(%rax), %rsi
	orl	$32, %edx
	movq	%rbx, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_write_reg
LBB0_8:
	movl	8(%rbx), %eax
	movl	%eax, (%r15)
	movl	(%rbx), %eax
	movl	%eax, (%r14)
	xorl	%eax, %eax
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_11
## %bb.10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RSTV0910_P2_ERRCNT12,8,3       ## @RSTV0910_P2_ERRCNT12
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RSTV0910_P2_ERRCTRL1,8,3       ## @RSTV0910_P2_ERRCTRL1
	.no_dead_strip	_get_bit_error_rate_s2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_bit_error_rate_s2
_get_bit_error_rate_s2:                 ; @get_bit_error_rate_s2
	.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	x19, x2
	mov	x21, x1
	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]
Lloh3:
	adrp	x8, _RSTV0910_P2_ERRCNT12@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RSTV0910_P2_ERRCNT12@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x9, [x0, #16]
	add	x1, x9, x8
	add	x2, sp, #12
	mov	w3, #3
	bl	_read_regs
	cbz	w0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_2:
	ldrb	w8, [sp, #12]
	tbnz	w8, #7, LBB0_9
; %bb.3:
	ldr	w0, [x20, #32]
	ldr	w1, [x20, #24]
	bl	_dvbs2_nbch
	ldr	w8, [x20, #4]
	lsl	w9, w8, #1
	lsl	w9, w0, w9
	str	w9, [x20]
	ldp	w9, w10, [sp, #12]
	ubfiz	w9, w9, #16, #7
	orr	w9, w9, w10, lsl #8
	ldr	w10, [sp, #20]
	orr	w9, w9, w10
	str	w9, [x20, #8]
	cmp	w9, #255
	b.gt	LBB0_6
; %bb.4:
	cmp	w8, #6
	b.ge	LBB0_9
; %bb.5:
	mov	w9, #1
	b	LBB0_8
LBB0_6:
	cmp	w9, #1025
	ccmp	w8, #3, #8, hs
	b.lt	LBB0_9
; %bb.7:
	mov	w9, #-1
LBB0_8:
	add	w8, w8, w9
	str	w8, [x20, #4]
Lloh9:
	adrp	x9, _RSTV0910_P2_ERRCTRL1@GOTPAGE
Lloh10:
	ldr	x9, [x9, _RSTV0910_P2_ERRCTRL1@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	ldr	x10, [x20, #16]
	add	x1, x10, x9
	orr	w2, w8, #0x20
	mov	x0, x20
	bl	_write_reg
LBB0_9:
	mov	w0, #0
	ldr	w8, [x20, #8]
	str	w8, [x21]
	ldr	w8, [x20]
	str	w8, [x19]
LBB0_10:
	ldr	x8, [sp, #24]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	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_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_RSTV0910_P2_ERRCNT12,8,3       ; @RSTV0910_P2_ERRCNT12
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RSTV0910_P2_ERRCTRL1,8,3       ; @RSTV0910_P2_ERRCTRL1
	.no_dead_strip	_get_bit_error_rate_s2
.subsections_via_symbols
