	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rv515_crtc_bandwidth_compute
_rv515_crtc_bandwidth_compute:          ## @rv515_crtc_bandwidth_compute
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	cmpl	$0, 20(%rsi)
	je	LBB0_1
## %bb.2:
	movq	%rsi, %r14
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	32(%rsi), %rbx
	movl	$2, %edi
	callq	_dfixed_const
	xorl	%edi, %edi
	cmpq	%rax, %rbx
	setg	%dil
	incl	%edi
	callq	_dfixed_const
	movq	%rax, 40(%r15)
	movl	8(%r14), %edi
	callq	_dfixed_const
	movq	%rax, %rbx
	movl	$256, %edi                      ## imm = 0x100
	callq	_dfixed_const
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%rax, %rbx
	movq	40(%r15), %rsi
	movq	%rax, %rdi
	callq	_dfixed_mul
	movq	%rax, %rdi
	callq	_dfixed_ceil
	movq	%rax, %r13
	movl	$4, %r12d
	movl	$4, %edi
	callq	_dfixed_const
	cmpq	%rbx, %rax
	jg	LBB0_4
## %bb.3:
	movq	%r13, %rdi
	callq	_dfixed_trunc
	movl	%eax, %r12d
LBB0_4:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movl	%r12d, (%r15)
	movl	12(%r14), %edi
	callq	_dfixed_const
	movq	%rax, %r12
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_dfixed_const
	movq	%rax, %rbx
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%rax, %r12
	movq	(%r14), %rax
	movq	_RMX_OFF@GOTPCREL(%rip), %rcx
	movq	%r12, %rbx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.5:
	movl	$2, %edi
	callq	_dfixed_const
	movq	24(%r14), %rsi
	movq	32(%r14), %rdi
	cmpq	%rax, %rdi
	cmovleq	%rax, %rdi
	callq	_dfixed_mul
	movq	%rax, %rbx
	movl	$2, %edi
	callq	_dfixed_const
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%rax, %rbx
LBB0_6:
	movl	$1, %edi
	callq	_dfixed_const
	movq	%rax, %rdi
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
	callq	_dfixed_div
	movq	%rax, 56(%r15)
	movl	16(%r14), %edi
	callq	_dfixed_const
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_dfixed_mul
	movq	%rax, %r12
	movl	16(%r14), %edi
	callq	_dfixed_const
	movq	%rax, %rbx
	movl	8(%r14), %edi
	callq	_dfixed_const
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_dfixed_mul
	movq	%rax, 48(%r15)
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_dfixed_div
	movq	%rax, 48(%r15)
	movl	$600000, %edi                   ## imm = 0x927C0
	callq	_dfixed_const
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rsi
	movq	%rax, %rdi
	callq	_dfixed_div
	movq	%rax, %rbx
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_dfixed_const
	movq	%rax, %r13
	movq	40(%r15), %rdi
	callq	_dfixed_trunc
	movl	%eax, %ecx
	movq	%rbx, %rax
	cmpl	$2, %ecx
	jl	LBB0_8
## %bb.7:
	movl	$3, %edi
	callq	_dfixed_const
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_dfixed_mul
LBB0_8:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	addq	%rax, %r13
	movq	%r13, 24(%r15)
	movl	(%r15), %ebx
	addl	$2, %ebx
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_dfixed_trunc
	cmpl	%eax, %ebx
	jge	LBB0_10
## %bb.9:
	movl	(%r15), %edi
	addl	$-2, %edi
	callq	_dfixed_const
	subq	%rax, %r13
	movq	%r13, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_dfixed_mul
	subq	%rax, %r12
LBB0_10:
	movl	$32, %edi
	callq	_dfixed_const
	movq	%rax, 32(%r15)
	movl	$16, %edi
	callq	_dfixed_const
	movq	%rax, %rbx
	movl	8(%r14), %edi
	callq	_dfixed_const
	movq	%rax, 16(%r15)
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_dfixed_div
	movq	%rax, 16(%r15)
	movq	%rax, %rdi
	callq	_dfixed_ceil
	movq	%rax, 16(%r15)
	subq	24(%r15), %r12
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_dfixed_div
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_dfixed_trunc
	cmpl	8(%r14), %eax
	jle	LBB0_12
## %bb.11:
	movq	16(%r15), %rax
	movq	%rax, 8(%r15)
	jmp	LBB0_13
LBB0_1:
	movl	$4, (%r15)
	jmp	LBB0_13
LBB0_12:
	movl	$16, %edi
	callq	_dfixed_const
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%rax, 8(%r15)
	movq	%rax, %rdi
	callq	_dfixed_ceil
	movq	16(%r15), %rcx
	subq	%rax, %rcx
	movq	%rcx, 8(%r15)
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RMX_OFF,8,3                    ## @RMX_OFF
	.no_dead_strip	_rv515_crtc_bandwidth_compute
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rv515_crtc_bandwidth_compute
_rv515_crtc_bandwidth_compute:          ; @rv515_crtc_bandwidth_compute
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x2
	ldr	w8, [x1, #20]
	cbz	w8, LBB0_11
; %bb.1:
	mov	x20, x1
	mov	x22, x0
	ldr	x21, [x1, #32]
	mov	w0, #2
	bl	_dfixed_const
	cmp	x21, x0
	mov	w8, #1
	cinc	w0, w8, gt
	bl	_dfixed_const
	str	x0, [x19, #40]
	ldr	w0, [x20, #8]
	bl	_dfixed_const
	mov	x21, x0
	mov	w0, #256
	bl	_dfixed_const
	mov	x1, x0
	mov	x0, x21
	bl	_dfixed_div
	mov	x24, x0
	ldr	x1, [x19, #40]
	bl	_dfixed_mul
	bl	_dfixed_ceil
	mov	x21, x0
	mov	w23, #4
	mov	w0, #4
	bl	_dfixed_const
	cmp	x0, x24
	b.gt	LBB0_3
; %bb.2:
	mov	x0, x21
	bl	_dfixed_trunc
	mov	x23, x0
LBB0_3:
	str	w23, [x19]
	ldr	w0, [x20, #12]
	bl	_dfixed_const
	mov	x23, x0
	mov	w0, #1000
	bl	_dfixed_const
	mov	x24, x0
	mov	x0, x23
	mov	x1, x24
	bl	_dfixed_div
	mov	x1, x0
	mov	x0, x24
	bl	_dfixed_div
	mov	x24, x0
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _RMX_OFF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RMX_OFF@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	mov	x23, x0
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.4:
	mov	w0, #2
	bl	_dfixed_const
	ldp	x1, x8, [x20, #24]
	cmp	x8, x0
	csel	x0, x8, x0, gt
	bl	_dfixed_mul
	mov	x23, x0
	mov	w0, #2
	bl	_dfixed_const
	mov	x1, x0
	mov	x0, x23
	bl	_dfixed_div
	mov	x1, x0
	mov	x0, x24
	bl	_dfixed_div
	mov	x23, x0
LBB0_5:
	mov	w0, #1
	bl	_dfixed_const
	mov	x1, x23
	bl	_dfixed_div
	str	x0, [x19, #56]
	ldr	w0, [x20, #16]
	bl	_dfixed_const
	mov	x1, x24
	bl	_dfixed_mul
	mov	x24, x0
	ldr	w0, [x20, #16]
	bl	_dfixed_const
	mov	x25, x0
	ldr	w0, [x20, #8]
	bl	_dfixed_const
	mov	x1, x0
	mov	x0, x24
	bl	_dfixed_mul
	str	x0, [x19, #48]
	mov	x1, x25
	bl	_dfixed_div
	str	x0, [x19, #48]
	mov	w0, #10176
	movk	w0, #9, lsl #16
	bl	_dfixed_const
	ldr	x1, [x22]
	bl	_dfixed_div
	mov	x22, x0
	mov	w0, #1000
	bl	_dfixed_const
	mov	x25, x0
	ldr	x0, [x19, #40]
	bl	_dfixed_trunc
	mov	x8, x0
	mov	x0, x22
	cmp	w8, #2
	b.lt	LBB0_7
; %bb.6:
	mov	w0, #3
	bl	_dfixed_const
	mov	x1, x22
	bl	_dfixed_mul
LBB0_7:
	add	x8, x25, x0
	str	x8, [x19, #24]
	ldr	w8, [x19]
	add	w25, w8, #2
	mov	x0, x21
	bl	_dfixed_trunc
	cmp	w25, w0
	b.ge	LBB0_9
; %bb.8:
	ldr	w8, [x19]
	sub	w0, w8, #2
	bl	_dfixed_const
	sub	x0, x21, x0
	mov	x1, x22
	bl	_dfixed_mul
	sub	x24, x24, x0
LBB0_9:
	mov	w0, #32
	bl	_dfixed_const
	str	x0, [x19, #32]
	mov	w0, #16
	bl	_dfixed_const
	mov	x21, x0
	ldr	w0, [x20, #8]
	bl	_dfixed_const
	str	x0, [x19, #16]
	mov	x1, x21
	bl	_dfixed_div
	str	x0, [x19, #16]
	bl	_dfixed_ceil
	str	x0, [x19, #16]
	ldr	x8, [x19, #24]
	sub	x0, x24, x8
	mov	x1, x23
	bl	_dfixed_div
	mov	x21, x0
	bl	_dfixed_trunc
	ldr	w8, [x20, #8]
	cmp	w0, w8
	b.le	LBB0_12
; %bb.10:
	ldr	x8, [x19, #16]
	b	LBB0_13
LBB0_11:
	mov	w8, #4
	str	w8, [x19]
	b	LBB0_14
LBB0_12:
	mov	w0, #16
	bl	_dfixed_const
	mov	x1, x0
	mov	x0, x21
	bl	_dfixed_div
	str	x0, [x19, #8]
	bl	_dfixed_ceil
	ldr	x8, [x19, #16]
	sub	x8, x8, x0
LBB0_13:
	str	x8, [x19, #8]
LBB0_14:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_RMX_OFF,8,3                    ; @RMX_OFF
	.no_dead_strip	_rv515_crtc_bandwidth_compute
.subsections_via_symbols
