	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rs690_crtc_bandwidth_compute
_rs690_crtc_bandwidth_compute:          ## @rs690_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	$56, %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, %r12
	movq	(%rdi), %rax
	movq	_CHIP_RS780@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	je	LBB0_4
## %bb.3:
	movq	_CHIP_RS880@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_7
LBB0_4:
	movq	8(%r12), %rax
	movq	_PM_METHOD_DPM@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_7
## %bb.5:
	cmpq	$0, 64(%r12)
	je	LBB0_7
## %bb.6:
	movq	%r12, %rdi
	movl	%ecx, %esi
	callq	_radeon_dpm_get_sclk
	movl	%eax, %r13d
	jmp	LBB0_8
LBB0_7:
	movl	16(%r12), %r13d
LBB0_8:
	movl	$100, %edi
	callq	_dfixed_const
	movq	%rax, %rbx
	movl	%r13d, %edi
	callq	_dfixed_const
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_dfixed_div
	movl	$16, %edi
	callq	_dfixed_const
	movq	56(%r12), %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	32(%r14), %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, -56(%rbp)                 ## 8-byte Spill
	movl	$4, %r13d
	movl	$4, %edi
	callq	_dfixed_const
	cmpq	%rbx, %rax
	jg	LBB0_10
## %bb.9:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dfixed_trunc
	movl	%eax, %r13d
LBB0_10:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movl	%r13d, (%r15)
	movl	12(%r14), %edi
	callq	_dfixed_const
	movq	%rax, %r13
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_dfixed_const
	movq	%rax, %rbx
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%rax, %rbx
	movq	(%r14), %rax
	movq	_RMX_OFF@GOTPCREL(%rip), %rcx
	movq	%rbx, %r13
	cmpq	(%rcx), %rax
	je	LBB0_12
## %bb.11:
	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, %r13
	movl	$2, %edi
	callq	_dfixed_const
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%rax, %r13
LBB0_12:
	movl	$1, %edi
	callq	_dfixed_const
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	_dfixed_div
	movq	%rax, 56(%r15)
	movl	16(%r14), %edi
	callq	_dfixed_const
	movq	%rax, %rdi
	movq	%rbx, %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, -72(%rbp)                 ## 8-byte Spill
	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)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	cmpq	$0, 72(%rbx)
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_14
## %bb.13:
	movq	48(%rbx), %rax
	testq	%rax, %rax
	movq	%rax, %r12
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	cmoveq	%rcx, %r12
	cmpq	%rcx, %rax
	cmovgeq	%rcx, %r12
	movl	$296000, %edi                   ## imm = 0x48440
	callq	_dfixed_const
	movq	%rax, %r13
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_dfixed_const
	movq	%rax, %r14
	movq	40(%rbx), %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_dfixed_mul
	jmp	LBB0_15
LBB0_1:
	movl	$4, (%r15)
	jmp	LBB0_20
LBB0_14:
	movq	32(%rbx), %rax
	testq	%rax, %rax
	movq	%rax, %rcx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	cmoveq	%rdx, %rcx
	cmpq	%rdx, %rax
	cmovgeq	%rdx, %rcx
	movq	24(%rbx), %rax
	cmpq	%rax, %rcx
	movq	%rax, %r12
	cmovleq	%rcx, %r12
	testq	%rax, %rax
	cmoveq	%rcx, %r12
	movl	$5000, %edi                     ## imm = 0x1388
	callq	_dfixed_const
LBB0_15:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movl	$16, %edi
	callq	_dfixed_const
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_dfixed_mul
	movq	%rax, %rbx
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_dfixed_const
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_dfixed_div
	movq	%rax, %rbx
	movl	$3328, %edi                     ## imm = 0xD00
	callq	_dfixed_const
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_dfixed_mul
	movq	%rax, %rbx
	movl	$10, %edi
	callq	_dfixed_const
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_dfixed_div
	movq	%rax, %r14
	movq	40(%r15), %rdi
	callq	_dfixed_trunc
	xorl	%edi, %edi
	cmpl	$2, %eax
	setl	%dil
	xorl	$3, %edi
	callq	_dfixed_const
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_dfixed_mul
	addq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	movq	%rax, 24(%r15)
	movl	(%r15), %ebx
	addl	$2, %ebx
	movq	%r13, %rdi
	callq	_dfixed_trunc
	cmpl	%eax, %ebx
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jge	LBB0_17
## %bb.16:
	movl	(%r15), %edi
	addl	$-2, %edi
	callq	_dfixed_const
	subq	%rax, %r13
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_dfixed_mul
	subq	%rax, %rbx
LBB0_17:
	movl	$32, %edi
	callq	_dfixed_const
	movq	%rax, 32(%r15)
	movl	$16, %edi
	callq	_dfixed_const
	movq	%rax, %r12
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movl	8(%r14), %edi
	callq	_dfixed_const
	movq	%rax, 16(%r15)
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_dfixed_div
	movq	%rax, 16(%r15)
	movq	%rax, %rdi
	callq	_dfixed_ceil
	movq	%rax, 16(%r15)
	subq	24(%r15), %rbx
	movq	%rbx, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	callq	_dfixed_div
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_dfixed_trunc
	cmpl	8(%r14), %eax
	jle	LBB0_19
## %bb.18:
	movl	$10, %edi
	callq	_dfixed_const
	movq	%rax, 8(%r15)
	jmp	LBB0_20
LBB0_19:
	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_20:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CHIP_RS780,8,3                 ## @CHIP_RS780
	.comm	_CHIP_RS880,8,3                 ## @CHIP_RS880
	.comm	_PM_METHOD_DPM,8,3              ## @PM_METHOD_DPM
	.comm	_RMX_OFF,8,3                    ## @RMX_OFF
	.no_dead_strip	_rs690_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 rs690_crtc_bandwidth_compute
_rs690_crtc_bandwidth_compute:          ; @rs690_crtc_bandwidth_compute
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	ldr	w8, [x1, #20]
	cbz	w8, LBB0_12
; %bb.1:
	mov	x20, x1
	mov	x22, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _CHIP_RS780@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHIP_RS780@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _CHIP_RS880@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CHIP_RS880@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_5
; %bb.2:
	ldr	x8, [x22, #8]
Lloh6:
	adrp	x9, _PM_METHOD_DPM@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PM_METHOD_DPM@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	ldr	x8, [x22, #64]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x22
	mov	x1, x3
	bl	_radeon_dpm_get_sclk
	mov	x21, x0
	b	LBB0_6
LBB0_5:
	ldr	w21, [x22, #16]
LBB0_6:
	mov	w0, #100
	bl	_dfixed_const
	mov	x23, x0
	mov	x0, x21
	bl	_dfixed_const
	mov	x1, x23
	bl	_dfixed_div
	mov	w0, #16
	bl	_dfixed_const
	mov	x1, x0
	ldr	x0, [x22, #56]
	bl	_dfixed_div
	mov	x25, x0
	ldr	x21, [x20, #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_8
; %bb.7:
	mov	x0, x21
	bl	_dfixed_trunc
	mov	x23, x0
LBB0_8:
	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]
Lloh9:
	adrp	x9, _RMX_OFF@GOTPAGE
Lloh10:
	ldr	x9, [x9, _RMX_OFF@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	mov	x23, x0
	cmp	x8, x9
	b.eq	LBB0_10
; %bb.9:
	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_10:
	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	x26, x0
	ldr	w0, [x20, #8]
	bl	_dfixed_const
	mov	x1, x0
	mov	x0, x24
	bl	_dfixed_mul
	str	x0, [x19, #48]
	mov	x1, x26
	bl	_dfixed_div
	str	x0, [x19, #48]
	ldr	x8, [x22, #72]
	cbz	x8, LBB0_13
; %bb.11:
	ldr	x8, [x22, #48]
	cmp	x8, #0
	ccmp	x8, x25, #0, ne
	csel	x25, x25, x8, ge
	mov	w0, #33856
	movk	w0, #4, lsl #16
	bl	_dfixed_const
	mov	x26, x0
	mov	w0, #1000
	bl	_dfixed_const
	mov	x27, x0
	ldr	x0, [x22, #40]
	mov	x1, x27
	bl	_dfixed_div
	mov	x1, x0
	mov	x0, x26
	bl	_dfixed_div
	mov	x1, x27
	bl	_dfixed_mul
	b	LBB0_14
LBB0_12:
	mov	w8, #4
	str	w8, [x19]
	b	LBB0_19
LBB0_13:
	ldp	x9, x8, [x22, #24]
	cmp	x8, #0
	ccmp	x8, x25, #0, ne
	csel	x8, x25, x8, ge
	cmp	x8, x9
	ccmp	x9, #0, #4, gt
	csel	x25, x8, x9, eq
	mov	w0, #5000
	bl	_dfixed_const
LBB0_14:
	mov	x22, x0
	mov	w0, #16
	bl	_dfixed_const
	mov	x1, x0
	mov	x0, x25
	bl	_dfixed_mul
	mov	x25, x0
	mov	w0, #1000
	bl	_dfixed_const
	mov	x1, x25
	bl	_dfixed_div
	mov	x25, x0
	mov	w0, #3328
	bl	_dfixed_const
	mov	x1, x0
	mov	x0, x25
	bl	_dfixed_mul
	mov	x25, x0
	mov	w0, #10
	bl	_dfixed_const
	mov	x1, x0
	mov	x0, x25
	bl	_dfixed_div
	mov	x25, x0
	ldr	x0, [x19, #40]
	bl	_dfixed_trunc
	cmp	w0, #2
	mov	w8, #2
	cinc	w0, w8, ge
	bl	_dfixed_const
	mov	x1, x25
	bl	_dfixed_mul
	add	x8, x22, x0
	str	x8, [x19, #24]
	ldr	w8, [x19]
	add	w22, w8, #2
	mov	x0, x21
	bl	_dfixed_trunc
	cmp	w22, w0
	b.ge	LBB0_16
; %bb.15:
	ldr	w8, [x19]
	sub	w0, w8, #2
	bl	_dfixed_const
	sub	x0, x21, x0
	mov	x1, x25
	bl	_dfixed_mul
	sub	x24, x24, x0
LBB0_16:
	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_18
; %bb.17:
	mov	w0, #10
	bl	_dfixed_const
	str	x0, [x19, #8]
	b	LBB0_19
LBB0_18:
	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
	str	x8, [x19, #8]
LBB0_19:
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_CHIP_RS780,8,3                 ; @CHIP_RS780
	.comm	_CHIP_RS880,8,3                 ; @CHIP_RS880
	.comm	_PM_METHOD_DPM,8,3              ; @PM_METHOD_DPM
	.comm	_RMX_OFF,8,3                    ; @RMX_OFF
	.no_dead_strip	_rs690_crtc_bandwidth_compute
.subsections_via_symbols
