	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function panfrost_devfreq_get_dev_status
_panfrost_devfreq_get_dev_status:       ## @panfrost_devfreq_get_dev_status
	.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	%rsi, %r14
	callq	_to_platform_device
	movl	%eax, %edi
	callq	_platform_get_drvdata
	movq	%rax, %r15
	movq	_NUM_JOB_SLOTS@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_panfrost_devfreq_update_utilization
	incl	%ebx
	cmpl	(%r12), %ebx
	jl	LBB0_2
LBB0_3:
	movl	16(%r15), %edi
	callq	_clk_get_rate
	movl	%eax, (%r14)
	movq	8(%r15), %rax
	movl	(%rax), %edi
	movl	4(%rax), %esi
	callq	_ktime_add
	movl	%eax, %edi
	callq	_ktime_to_ns
	movl	%eax, 4(%r14)
	movl	$0, 8(%r14)
	cmpl	$0, (%r12)
	jle	LBB0_6
## %bb.4:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movl	(%rax,%rbx,8), %edi
	callq	_ktime_to_ns
	addl	%eax, 8(%r14)
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_5
LBB0_6:
	movq	%r15, %rdi
	callq	_panfrost_devfreq_reset
	movl	(%r15), %edi
	movl	8(%r14), %ebx
	movslq	4(%r14), %rcx
	imulq	$1374389535, %rcx, %rsi         ## imm = 0x51EB851F
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$37, %rsi
	addl	%eax, %esi
	movl	%ebx, %eax
	cltd
	idivl	%esi
	movslq	(%r14), %rdx
	imulq	$1125899907, %rdx, %r9          ## imm = 0x431BDE83
	movq	%r9, %rdx
	shrq	$63, %rdx
	sarq	$50, %r9
	addl	%edx, %r9d
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	%eax, %r8d
                                        ## kill: def $r9d killed $r9d killed $r9
	callq	_dev_dbg
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NUM_JOB_SLOTS,4,2              ## @NUM_JOB_SLOTS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"busy %lu total %lu %lu %% freq %lu MHz\n"

	.no_dead_strip	_panfrost_devfreq_get_dev_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function panfrost_devfreq_get_dev_status
_panfrost_devfreq_get_dev_status:       ; @panfrost_devfreq_get_dev_status
	.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, x1
	bl	_to_platform_device
	bl	_platform_get_drvdata
	mov	x20, x0
Lloh0:
	adrp	x22, _NUM_JOB_SLOTS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _NUM_JOB_SLOTS@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	w21, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_panfrost_devfreq_update_utilization
	add	w21, w21, #1
	ldr	w8, [x22]
	cmp	w21, w8
	b.lt	LBB0_2
LBB0_3:
	ldr	w0, [x20, #16]
	bl	_clk_get_rate
	str	w0, [x19]
	ldr	x8, [x20, #8]
	ldp	w0, w1, [x8]
	bl	_ktime_add
	bl	_ktime_to_ns
	stp	w0, wzr, [x19, #4]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.4:
	mov	x21, #0
	mov	x23, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	w0, [x8, x21]
	bl	_ktime_to_ns
	ldr	w8, [x19, #8]
	add	w8, w8, w0
	str	w8, [x19, #8]
	add	x23, x23, #1
	ldrsw	x8, [x22]
	add	x21, x21, #8
	cmp	x23, x8
	b.lt	LBB0_5
LBB0_6:
	mov	x0, x20
	bl	_panfrost_devfreq_reset
	ldr	w0, [x20]
	ldp	w3, w2, [x19, #4]
                                        ; kill: def $w3 killed $w3 def $x3
	sxtw	x3, w3
	mov	w8, #34079
	movk	w8, #20971, lsl #16
	ldrsw	x9, [x19]
	mul	x8, x3, x8
	lsr	x10, x8, #63
	asr	x8, x8, #37
	add	w8, w8, w10
	sdiv	w4, w2, w8
	mov	w8, #56963
	movk	w8, #17179, lsl #16
	mul	x8, x9, x8
	lsr	x9, x8, #63
	asr	x8, x8, #50
	add	w5, w8, w9
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_dev_dbg
	mov	w0, #0
	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
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_NUM_JOB_SLOTS,4,2              ; @NUM_JOB_SLOTS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"busy %lu total %lu %lu %% freq %lu MHz\n"

	.no_dead_strip	_panfrost_devfreq_get_dev_status
.subsections_via_symbols
