	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _dpu_encoder_calculate_linetime
__dpu_encoder_calculate_linetime:       ## @_dpu_encoder_calculate_linetime
	.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	(%rdi), %rax
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	cmpl	$0, (%rax)
	je	LBB0_2
## %bb.3:
	movq	%rsi, %rbx
	movq	(%rsi), %r15
	testq	%r15, %r15
	je	LBB0_4
## %bb.5:
	movq	%rdi, %r12
	movl	$1000000000, %edi               ## imm = 0x3B9ACA00
	movq	%r15, %rsi
	callq	_DIV_ROUND_UP_ULL
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movl	8(%rbx), %ecx
	imull	%eax, %ecx
	leal	999(%rcx), %edx
	cmpl	$1998, %edx                     ## imm = 0x7CE
	ja	LBB0_9
## %bb.8:
	leaq	L_.str.3(%rip), %rdi
	callq	_DPU_ERROR
	jmp	LBB0_10
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_DPU_ERROR
	jmp	LBB0_10
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	callq	_DPU_ERROR
	jmp	LBB0_10
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	callq	_DPU_ERROR
	jmp	LBB0_10
LBB0_9:
	movslq	%ecx, %rcx
	imulq	$274877907, %rcx, %r14          ## imm = 0x10624DD3
	movq	%r14, %rcx
	shrq	$63, %rcx
	sarq	$38, %r14
	addl	%ecx, %r14d
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdi
	movq	%r15, %rdx
	movl	%eax, %ecx
	movl	%r14d, %r8d
	callq	_DPU_DEBUG_ENC
LBB0_10:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"get_line_count function not defined\n"

L_.str.1:                               ## @.str.1
	.asciz	"pclk is 0, cannot calculate line time\n"

L_.str.2:                               ## @.str.2
	.asciz	"pclk period is 0\n"

L_.str.3:                               ## @.str.3
	.asciz	"line time calculation is 0\n"

L_.str.4:                               ## @.str.4
	.asciz	"clk_rate=%lldkHz, clk_period=%d, linetime=%dns\n"

	.no_dead_strip	__dpu_encoder_calculate_linetime
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _dpu_encoder_calculate_linetime
__dpu_encoder_calculate_linetime:       ; @_dpu_encoder_calculate_linetime
	.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
	ldr	x8, [x0]
	cbz	x8, LBB0_10
; %bb.1:
	ldr	w8, [x8]
	cbz	w8, LBB0_6
; %bb.2:
	mov	x21, x1
	ldr	x20, [x1]
	cbz	x20, LBB0_7
; %bb.3:
	mov	x19, x0
	mov	w0, #51712
	movk	w0, #15258, lsl #16
	mov	x1, x20
	bl	_DIV_ROUND_UP_ULL
	cbz	w0, LBB0_8
; %bb.4:
	mov	x3, x0
	ldr	w8, [x21, #8]
	mul	w8, w8, w0
	add	w9, w8, #999
	cmp	w9, #1998
	b.hi	LBB0_12
; %bb.5:
Lloh0:
	adrp	x0, l_.str.3@PAGE
Lloh1:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_9
LBB0_6:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_9
LBB0_7:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_9:
	bl	_DPU_ERROR
LBB0_10:
	mov	w21, #0
LBB0_11:
	mov	x0, x21
	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
LBB0_12:
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w21, w8, w9
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	mov	x4, x21
	bl	_DPU_DEBUG_ENC
	b	LBB0_11
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"get_line_count function not defined\n"

l_.str.1:                               ; @.str.1
	.asciz	"pclk is 0, cannot calculate line time\n"

l_.str.2:                               ; @.str.2
	.asciz	"pclk period is 0\n"

l_.str.3:                               ; @.str.3
	.asciz	"line time calculation is 0\n"

l_.str.4:                               ; @.str.4
	.asciz	"clk_rate=%lldkHz, clk_period=%d, linetime=%dns\n"

	.no_dead_strip	__dpu_encoder_calculate_linetime
.subsections_via_symbols
