	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxd2880_tnrdmd_dvbt_mon_sampling_offset ## -- Begin function cxd2880_tnrdmd_dvbt_mon_sampling_offset
	.p2align	4, 0x90
_cxd2880_tnrdmd_dvbt_mon_sampling_offset: ## @cxd2880_tnrdmd_dvbt_mon_sampling_offset
	.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	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rsi, %r14
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.4:
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movq	_CXD2880_TNRDMD_STATE_ACTIVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.5:
	movq	8(%r15), %rax
	movq	_CXD2880_DTV_SYS_DVBT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.6:
	movq	%r15, %rdi
	callq	_slvt_freeze_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.7:
	movq	%r15, %rdi
	callq	_is_tps_locked
	testl	%eax, %eax
	jne	LBB0_8
## %bb.9:
	movq	16(%r15), %rdi
	movq	_CXD2880_IO_TGT_DMD@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	xorl	%edx, %edx
	movl	$13, %ecx
	callq	*(%rdi)
	testl	%eax, %eax
	jne	LBB0_8
## %bb.10:
	movq	16(%r15), %rdi
	movl	(%r12), %esi
	leaq	-64(%rbp), %rcx
	movl	$33, %edx
	movl	$20, %r8d
	callq	*8(%rdi)
	testl	%eax, %eax
	jne	LBB0_8
## %bb.11:
	movq	16(%r15), %rdi
	movl	(%r12), %esi
	xorl	%edx, %edx
	movl	$4, %ecx
	callq	*(%rdi)
	testl	%eax, %eax
	je	LBB0_12
LBB0_8:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_slvt_unfreeze_reg
	jmp	LBB0_20
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_20:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_23
## %bb.21:
	movl	%ebx, %eax
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	16(%r15), %rdi
	movl	(%r12), %esi
	leaq	-96(%rbp), %rcx
	movl	$96, %edx
	movl	$20, %r8d
	callq	*8(%rdi)
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_slvt_unfreeze_reg
	testl	%ebx, %ebx
	jne	LBB0_20
## %bb.13:
	movl	-64(%rbp), %edi
	andl	$127, %edi
	movl	-96(%rbp), %r10d
	andl	$127, %r10d
	subl	%r10d, %edi
	leal	-2(%rdi), %ecx
	cmpl	$-4, %ecx
	ja	LBB0_15
## %bb.14:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_15:
	movl	-60(%rbp), %ecx
	movl	-56(%rbp), %edx
	shll	$24, %ecx
	shll	$16, %edx
	orl	%ecx, %edx
	movl	-52(%rbp), %esi
	shll	$8, %esi
	orl	%edx, %esi
	orl	-48(%rbp), %esi
	movl	-92(%rbp), %r9d
	movl	-88(%rbp), %eax
	movl	%r9d, %edx
	shll	$24, %edx
	movl	%eax, %ecx
	shll	$16, %ecx
	orl	%edx, %ecx
	movl	-84(%rbp), %r8d
	movl	%r8d, %ebx
	shll	$8, %ebx
	orl	%ecx, %ebx
	orl	-80(%rbp), %ebx
	sarl	%esi
	sarl	%ebx
	cmpl	$-1, %edi
	je	LBB0_22
## %bb.16:
	cmpl	$1, %edi
	jne	LBB0_18
## %bb.17:
	addl	$-2147483648, %esi              ## imm = 0x80000000
LBB0_18:
	subl	%ebx, %esi
	jmp	LBB0_19
LBB0_22:
	xorl	$2147483647, %ebx               ## imm = 0x7FFFFFFF
	addl	%ebx, %esi
	incl	%esi
LBB0_19:
	shll	$24, %r10d
	shll	$16, %r9d
	shll	$8, %eax
	orl	%r9d, %eax
	orl	%r10d, %eax
	orl	%r8d, %eax
	addl	$195312, %eax                   ## imm = 0x2FAF0
	cltq
	imulq	$1441151881, %rax, %rcx         ## imm = 0x55E63B89
	movq	%rcx, %rax
	shrq	$63, %rax
	sarq	$49, %rcx
	addl	%eax, %ecx
	sarl	%ecx
	xorl	%edi, %edi
	testl	%esi, %esi
	setns	%dil
	movl	%ecx, %eax
	cwtd
	leal	-2(,%rdi,4), %edi
	idivw	%di
	cwtl
	addl	%esi, %eax
	cltd
	idivl	%ecx
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_20
LBB0_23:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CXD2880_TNRDMD_STATE_ACTIVE,8,3 ## @CXD2880_TNRDMD_STATE_ACTIVE
	.comm	_CXD2880_DTV_SYS_DVBT,8,3       ## @CXD2880_DTV_SYS_DVBT
	.comm	_CXD2880_IO_TGT_DMD,4,2         ## @CXD2880_IO_TGT_DMD
	.comm	_EAGAIN,4,2                     ## @EAGAIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxd2880_tnrdmd_dvbt_mon_sampling_offset ; -- Begin function cxd2880_tnrdmd_dvbt_mon_sampling_offset
	.p2align	2
_cxd2880_tnrdmd_dvbt_mon_sampling_offset: ; @cxd2880_tnrdmd_dvbt_mon_sampling_offset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	cbz	x0, LBB0_10
; %bb.1:
	mov	x19, x1
	cbz	x1, LBB0_10
; %bb.2:
	mov	x21, x0
	ldr	x8, [x0]
Lloh3:
	adrp	x9, _CXD2880_TNRDMD_STATE_ACTIVE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CXD2880_TNRDMD_STATE_ACTIVE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.3:
	ldr	x8, [x21, #8]
Lloh6:
	adrp	x9, _CXD2880_DTV_SYS_DVBT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CXD2880_DTV_SYS_DVBT@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.4:
	mov	x0, x21
	bl	_slvt_freeze_reg
	mov	x20, x0
	cbnz	w0, LBB0_12
; %bb.5:
	mov	x0, x21
	bl	_is_tps_locked
	cbnz	w0, LBB0_9
; %bb.6:
	ldr	x0, [x21, #16]
	ldr	x8, [x0]
Lloh9:
	adrp	x22, _CXD2880_IO_TGT_DMD@GOTPAGE
Lloh10:
	ldr	x22, [x22, _CXD2880_IO_TGT_DMD@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	w2, #0
	mov	w3, #13
	blr	x8
	cbnz	w0, LBB0_9
; %bb.7:
	ldr	x0, [x21, #16]
	ldr	x8, [x0, #8]
	ldr	w1, [x22]
	add	x3, sp, #20
	mov	w2, #33
	mov	w4, #20
	blr	x8
	cbnz	w0, LBB0_9
; %bb.8:
	ldr	x0, [x21, #16]
	ldr	x8, [x0]
	ldr	w1, [x22]
	mov	w2, #0
	mov	w3, #4
	blr	x8
	cbz	w0, LBB0_14
LBB0_9:
	mov	x20, x0
	mov	x0, x21
	bl	_slvt_unfreeze_reg
	b	LBB0_12
LBB0_10:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_12:
	ldr	x8, [sp, #40]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.13:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_14:
	ldr	x0, [x21, #16]
	ldr	x8, [x0, #8]
	ldr	w1, [x22]
	mov	x3, sp
	mov	w2, #96
	mov	w4, #20
	blr	x8
	mov	x20, x0
	mov	x0, x21
	bl	_slvt_unfreeze_reg
	cbnz	w20, LBB0_12
; %bb.15:
	ldr	w8, [sp, #20]
	and	w9, w8, #0x7f
	ldr	w8, [sp]
	and	w10, w8, #0x7f
	sub	w9, w9, w10
	sub	w10, w9, #2
	cmn	w10, #4
	b.hi	LBB0_17
; %bb.16:
Lloh16:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_11
LBB0_17:
	mov	w20, #0
	ldp	w10, w11, [sp, #24]
	lsl	w11, w11, #16
	orr	w10, w11, w10, lsl #24
	ldp	w11, w12, [sp, #32]
	orr	w10, w10, w11, lsl #8
	orr	w10, w10, w12
	ldp	w11, w12, [sp, #4]
	lsl	w13, w12, #16
	orr	w13, w13, w11, lsl #24
	ldp	w14, w15, [sp, #12]
	orr	w13, w13, w14, lsl #8
	orr	w13, w13, w15
	asr	w10, w10, #1
	asr	w13, w13, #1
	eor	w15, w13, #0x7fffffff
	add	w15, w10, w15
	sub	w16, w10, w13
	eor	w10, w10, #0x80000000
	sub	w10, w10, w13
	cmp	w9, #1
	csel	w10, w16, w10, ne
	cmn	w9, #1
	csinc	w9, w10, w15, ne
	ubfiz	w8, w8, #24, #7
	orr	w8, w8, w11, lsl #16
	orr	w8, w8, w12, lsl #8
	orr	w8, w8, w14
	add	w8, w8, #47, lsl #12            ; =192512
	add	w8, w8, #2800
	mov	w10, #15241
	movk	w10, #21990, lsl #16
	smull	x8, w8, w10
	lsr	x10, x8, #63
	asr	x8, x8, #49
	add	w8, w8, w10
	asr	w8, w8, #1
	cmp	w9, #0
	mov	w10, #2
	cneg	w10, w10, lt
	sdiv	w10, w8, w10
	add	w9, w9, w10, sxth
	sdiv	w8, w9, w8
	str	w8, [x19]
	b	LBB0_12
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CXD2880_TNRDMD_STATE_ACTIVE,8,3 ; @CXD2880_TNRDMD_STATE_ACTIVE
	.comm	_CXD2880_DTV_SYS_DVBT,8,3       ; @CXD2880_DTV_SYS_DVBT
	.comm	_CXD2880_IO_TGT_DMD,4,2         ; @CXD2880_IO_TGT_DMD
	.comm	_EAGAIN,4,2                     ; @EAGAIN
.subsections_via_symbols
