	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ironlake_handle_rps_change
_ironlake_handle_rps_change:            ## @ironlake_handle_rps_change
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r14
	movq	_mchdev_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movq	_MEMINTRSTS@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movl	%ebx, %edi
	callq	_I915_READ
	movl	%ebx, %edi
	movq	%rax, %rsi
	callq	_I915_WRITE16
	movq	(%r14), %r12
	movl	(%r15), %edi
	movq	_MEMINT_EVAL_CHG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_I915_WRITE16
	movq	_RCPREVBSYTUPAVG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_I915_READ
	movq	%rax, %r13
	movq	_RCPREVBSYTDNAVG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_I915_READ
	movq	%rax, %r15
	movq	_RCBMAXAVG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_I915_READ
	movq	%rax, %rbx
	movq	_RCBMINAVG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_I915_READ
	cmpq	%rbx, %r13
	jle	LBB0_2
## %bb.1:
	movq	(%r14), %rax
	movq	8(%r14), %rcx
	leaq	-1(%rax), %rdx
	cmpq	%rcx, %rax
	cmoveq	%r12, %rdx
	cmpq	%rcx, %rdx
	cmovleq	%rcx, %rdx
	jmp	LBB0_4
LBB0_2:
	cmpq	%rax, %r15
	jge	LBB0_5
## %bb.3:
	movq	(%r14), %rax
	movq	16(%r14), %rcx
	leaq	1(%rax), %rdx
	cmpq	%rcx, %rax
	cmoveq	%r12, %rdx
	cmpq	%rcx, %rdx
	cmovgeq	%rcx, %rdx
LBB0_4:
	movq	%rdx, %r12
LBB0_5:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_ironlake_set_drps
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r12, (%r14)
LBB0_7:
	movq	_mchdev_lock@GOTPCREL(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_mchdev_lock,4,2                ## @mchdev_lock
	.comm	_MEMINTRSTS,4,2                 ## @MEMINTRSTS
	.comm	_MEMINT_EVAL_CHG,8,3            ## @MEMINT_EVAL_CHG
	.comm	_RCPREVBSYTUPAVG,4,2            ## @RCPREVBSYTUPAVG
	.comm	_RCPREVBSYTDNAVG,4,2            ## @RCPREVBSYTDNAVG
	.comm	_RCBMAXAVG,4,2                  ## @RCBMAXAVG
	.comm	_RCBMINAVG,4,2                  ## @RCBMINAVG
	.no_dead_strip	_ironlake_handle_rps_change
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ironlake_handle_rps_change
_ironlake_handle_rps_change:            ; @ironlake_handle_rps_change
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x24, [x0]
Lloh0:
	adrp	x0, _mchdev_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _mchdev_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
Lloh2:
	adrp	x21, _MEMINTRSTS@GOTPAGE
Lloh3:
	ldr	x21, [x21, _MEMINTRSTS@GOTPAGEOFF]
	ldr	w20, [x21]
	mov	x0, x20
	bl	_I915_READ
	mov	x1, x0
	mov	x0, x20
	bl	_I915_WRITE16
	ldr	x20, [x24]
	ldr	w0, [x21]
Lloh4:
	adrp	x8, _MEMINT_EVAL_CHG@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MEMINT_EVAL_CHG@GOTPAGEOFF]
Lloh6:
	ldr	x1, [x8]
	bl	_I915_WRITE16
Lloh7:
	adrp	x8, _RCPREVBSYTUPAVG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RCPREVBSYTUPAVG@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_I915_READ
	mov	x22, x0
Lloh10:
	adrp	x8, _RCPREVBSYTDNAVG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _RCPREVBSYTDNAVG@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_I915_READ
	mov	x21, x0
Lloh13:
	adrp	x8, _RCBMAXAVG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _RCBMAXAVG@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_I915_READ
	mov	x23, x0
Lloh16:
	adrp	x8, _RCBMINAVG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _RCBMINAVG@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_I915_READ
	cmp	x22, x23
	b.le	LBB0_2
; %bb.1:
	ldp	x8, x9, [x24]
	sub	x10, x8, #1
	cmp	x8, x9
	csel	x8, x20, x10, eq
	cmp	x8, x9
	csel	x20, x8, x9, gt
	b	LBB0_4
LBB0_2:
	cmp	x21, x0
	b.ge	LBB0_4
; %bb.3:
	ldr	x8, [x24]
	ldr	x9, [x24, #16]
	cmp	x8, x9
	csinc	x8, x20, x8, eq
	cmp	x8, x9
	csel	x20, x8, x9, lt
LBB0_4:
	mov	x0, x19
	mov	x1, x20
	bl	_ironlake_set_drps
	cbz	x0, LBB0_6
; %bb.5:
	str	x20, [x24]
LBB0_6:
Lloh19:
	adrp	x0, _mchdev_lock@GOTPAGE
Lloh20:
	ldr	x0, [x0, _mchdev_lock@GOTPAGEOFF]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_mchdev_lock,4,2                ; @mchdev_lock
	.comm	_MEMINTRSTS,4,2                 ; @MEMINTRSTS
	.comm	_MEMINT_EVAL_CHG,8,3            ; @MEMINT_EVAL_CHG
	.comm	_RCPREVBSYTUPAVG,4,2            ; @RCPREVBSYTUPAVG
	.comm	_RCPREVBSYTDNAVG,4,2            ; @RCPREVBSYTDNAVG
	.comm	_RCBMAXAVG,4,2                  ; @RCBMAXAVG
	.comm	_RCBMINAVG,4,2                  ; @RCBMINAVG
	.no_dead_strip	_ironlake_handle_rps_change
.subsections_via_symbols
