	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stb0899_read_ber
_stb0899_read_ber:                      ## @stb0899_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	(%rdi), %rbx
	movl	$0, (%rsi)
	movl	(%rbx), %eax
	leal	-129(%rax), %ecx
	cmpl	$2, %ecx
	jae	LBB0_1
## %bb.4:
	xorl	%r14d, %r14d
	cmpl	$0, 12(%rbx)
	je	LBB0_8
## %bb.5:
	movq	_STB0899_ECNT1L@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stb0899_read_reg
	movl	%eax, %r12d
	movq	_STB0899_ECNT1M@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stb0899_read_reg
	movl	%eax, %edi
	movl	%r12d, %esi
	callq	_MAKEWORD16
	movl	%eax, (%r15)
	movq	_VSTATUS_PRFVIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	16(%rbx), %esi
	callq	_STB0899_GETFIELD
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	imull	$9766, (%r15), %eax             ## imm = 0x2626
	movl	%eax, (%r15)
	movq	_NOE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%rbx), %esi
	callq	_STB0899_GETFIELD
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax), %ecx
	movl	$-1, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	notl	%esi
	movl	(%r15), %eax
	cltd
	idivl	%esi
                                        ## kill: def $eax killed $eax def $rax
	leal	7(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$3, %ecx
	movl	%ecx, (%r15)
	jmp	LBB0_8
LBB0_1:
	cmpl	$128, %eax
	jne	LBB0_7
## %bb.2:
	xorl	%r14d, %r14d
	cmpl	$0, 12(%rbx)
	je	LBB0_8
## %bb.3:
	movq	_STB0899_ECNT1L@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stb0899_read_reg
	movl	%eax, %r12d
	movq	_STB0899_ECNT1M@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stb0899_read_reg
	movl	%eax, %edi
	movl	%r12d, %esi
	callq	_MAKEWORD16
	imull	$10000000, %eax, %eax           ## imm = 0x989680
	movl	%eax, (%r15)
	movq	_NOE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%rbx), %esi
	callq	_STB0899_GETFIELD
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax), %ecx
	addb	$4, %cl
	movl	$-1, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	notl	%esi
	movl	(%r15), %eax
	cltd
	idivl	%esi
	movl	%eax, (%r15)
	jmp	LBB0_8
LBB0_7:
	movl	4(%rbx), %edi
	movq	_FE_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movl	$1, %edx
	callq	_dprintk
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STB0899_ECNT1L,4,2             ## @STB0899_ECNT1L
	.comm	_STB0899_ECNT1M,4,2             ## @STB0899_ECNT1M
	.comm	_VSTATUS_PRFVIT,4,2             ## @VSTATUS_PRFVIT
	.comm	_NOE,4,2                        ## @NOE
	.comm	_FE_DEBUG,4,2                   ## @FE_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported delivery system"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_stb0899_read_ber
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stb0899_read_ber
_stb0899_read_ber:                      ; @stb0899_read_ber
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x1
	ldr	x20, [x0]
	str	wzr, [x1]
	ldr	w8, [x20]
	sub	w9, w8, #129
	cmp	w9, #2
	b.hs	LBB0_4
; %bb.1:
	ldr	w8, [x20, #12]
	cbz	w8, LBB0_7
; %bb.2:
Lloh0:
	adrp	x8, _STB0899_ECNT1L@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STB0899_ECNT1L@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stb0899_read_reg
	mov	x21, x0
Lloh3:
	adrp	x8, _STB0899_ECNT1M@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STB0899_ECNT1M@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stb0899_read_reg
	mov	x1, x21
	bl	_MAKEWORD16
	str	w0, [x19]
Lloh6:
	adrp	x8, _VSTATUS_PRFVIT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VSTATUS_PRFVIT@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ldr	w1, [x20, #16]
	bl	_STB0899_GETFIELD
	cbz	w0, LBB0_9
; %bb.3:
	ldr	w8, [x19]
	mov	w9, #9766
	mul	w8, w8, w9
	str	w8, [x19]
Lloh9:
	adrp	x8, _NOE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NOE@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldr	w1, [x20, #8]
	bl	_STB0899_GETFIELD
	mov	x8, x0
	mov	w0, #0
	lsl	w8, w8, #1
	mov	w9, #-1
	lsl	w8, w9, w8
	mvn	w8, w8
	ldr	w9, [x19]
	sdiv	w8, w9, w8
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #3
	str	w8, [x19]
	b	LBB0_9
LBB0_4:
	cmp	w8, #128
	b.ne	LBB0_8
; %bb.5:
	ldr	w8, [x20, #12]
	cbz	w8, LBB0_7
; %bb.6:
Lloh12:
	adrp	x8, _STB0899_ECNT1L@GOTPAGE
Lloh13:
	ldr	x8, [x8, _STB0899_ECNT1L@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stb0899_read_reg
	mov	x21, x0
Lloh15:
	adrp	x8, _STB0899_ECNT1M@GOTPAGE
Lloh16:
	ldr	x8, [x8, _STB0899_ECNT1M@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stb0899_read_reg
	mov	x1, x21
	bl	_MAKEWORD16
	mov	w8, #38528
	movk	w8, #152, lsl #16
	mul	w8, w0, w8
	str	w8, [x19]
Lloh18:
	adrp	x8, _NOE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _NOE@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldr	w1, [x20, #8]
	bl	_STB0899_GETFIELD
	mov	x8, x0
	mov	w0, #0
	lsl	w8, w8, #1
	add	w8, w8, #4
	mov	w9, #-1
	lsl	w8, w9, w8
	mvn	w8, w8
	ldr	w9, [x19]
	sdiv	w8, w9, w8
	str	w8, [x19]
	b	LBB0_9
LBB0_7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
	ldr	w0, [x20, #4]
Lloh21:
	adrp	x8, _FE_DEBUG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _FE_DEBUG@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x3, l_.str@PAGE
Lloh25:
	add	x3, x3, l_.str@PAGEOFF
	mov	w2, #1
	bl	_dprintk
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_STB0899_ECNT1L,4,2             ; @STB0899_ECNT1L
	.comm	_STB0899_ECNT1M,4,2             ; @STB0899_ECNT1M
	.comm	_VSTATUS_PRFVIT,4,2             ; @VSTATUS_PRFVIT
	.comm	_NOE,4,2                        ; @NOE
	.comm	_FE_DEBUG,4,2                   ; @FE_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported delivery system"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_stb0899_read_ber
.subsections_via_symbols
