	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_calculate_wm
_intel_calculate_wm:                    ## @intel_calculate_wm
	.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
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %rax
	shrq	$3, %rax
	movabsq	$2361183241434822607, %rsi      ## imm = 0x20C49BA5E353F7CF
	mulq	%rsi
	shrq	$4, %rdx
	movslq	%ecx, %rax
	imulq	%r8, %rax
	imulq	%rdx, %rax
	shrq	$3, %rax
	mulq	%rsi
	movq	%rdx, %rdi
	shrq	$4, %rdi
	movl	24(%r15), %esi
	callq	_DIV_ROUND_UP
	movq	%rax, %r12
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	callq	_DRM_DEBUG_KMS
	movslq	%r14d, %rbx
	addq	(%r15), %r12
	subq	%r12, %rbx
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	callq	_DRM_DEBUG_KMS
	movq	8(%r15), %rax
	cmpq	%rax, %rbx
	cmovgeq	%rax, %rbx
	testq	%rbx, %rbx
	jg	LBB0_2
## %bb.1:
	movq	16(%r15), %rbx
LBB0_2:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FIFO entries required for mode: %ld\n"

L_.str.1:                               ## @.str.1
	.asciz	"FIFO watermark level: %ld\n"

	.no_dead_strip	_intel_calculate_wm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_calculate_wm
_intel_calculate_wm:                    ; @intel_calculate_wm
	.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
                                        ; kill: def $w3 killed $w3 def $x3
	mov	x20, x2
	mov	x19, x1
	lsr	x8, x0, #3
	mov	x9, #63439
	movk	x9, #58195, lsl #16
	movk	x9, #39845, lsl #32
	movk	x9, #8388, lsl #48
	umulh	x8, x8, x9
	lsr	x8, x8, #4
	sxtw	x10, w3
	mul	x8, x8, x10
	mul	x8, x8, x4
	lsr	x8, x8, #3
	umulh	x8, x8, x9
	lsr	x0, x8, #4
	ldr	w1, [x1, #24]
	bl	_DIV_ROUND_UP
	mov	x21, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_DRM_DEBUG_KMS
	sxtw	x8, w20
	ldr	x9, [x19]
	add	x9, x21, x9
	sub	x20, x8, x9
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_DRM_DEBUG_KMS
	ldr	x8, [x19, #8]
	cmp	x20, x8
	csel	x0, x20, x8, lt
	cmp	x0, #0
	b.gt	LBB0_2
; %bb.1:
	ldr	x0, [x19, #16]
LBB0_2:
	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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FIFO entries required for mode: %ld\n"

l_.str.1:                               ; @.str.1
	.asciz	"FIFO watermark level: %ld\n"

	.no_dead_strip	_intel_calculate_wm
.subsections_via_symbols
