	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function a6xx_gmu_rpmh_arc_votes_init
_a6xx_gmu_rpmh_arc_votes_init:          ## @a6xx_gmu_rpmh_arc_votes_init
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %r12
	leaq	-48(%rbp), %rsi
	movq	%r8, %rdi
	callq	_cmd_db_read_aux_data
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
LBB0_6:
	callq	_PTR_ERR
	jmp	LBB0_7
LBB0_2:
	movq	-48(%rbp), %rax
	movq	%rax, %rcx
	shrq	%rcx
	movq	%rcx, -48(%rbp)
	cmpq	$1, %rax
	ja	LBB0_4
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rdi
	leaq	-56(%rbp), %rsi
	callq	_cmd_db_read_aux_data
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	movq	%r13, %rdi
	jmp	LBB0_6
LBB0_8:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rax
	movq	%rax, %rcx
	shrq	%rcx
	movq	%rcx, -56(%rbp)
	cmpq	$2, %rax
	jb	LBB0_3
## %bb.9:
	testl	%r14d, %r14d
	jle	LBB0_31
## %bb.10:
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movl	%r14d, %eax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	leaq	L_.str.3(%rip), %r15
	xorl	%ecx, %ecx
                                        ## implicit-def: $eax
                                        ## kill: killed $eax
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_11:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_13 Depth 2
                                        ##     Child Loop BB0_24 Depth 2
                                        ##     Child Loop BB0_20 Depth 2
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	(%r13,%rcx,8), %rsi
	movq	%r12, %rdi
	callq	_a6xx_gmu_get_arc_level
	movq	-48(%rbp), %r14
	testq	%r14, %r14
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_11 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	%eax, (%rbx,%rcx,4)
	jae	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=2
	incq	%rcx
	cmpq	%rcx, %r14
	jne	LBB0_13
LBB0_15:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	%r14d, %r10d
	xorl	%r8d, %r8d
	jmp	LBB0_17
LBB0_16:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	%ecx, %r10d
	movq	%r10, %r8
LBB0_17:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	cmpq	%r10, %r14
	jne	LBB0_22
## %bb.18:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r10, -104(%rbp)                ## 8-byte Spill
	movq	%r12, %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
	movq	%r12, %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
	cmpq	$0, -48(%rbp)
	je	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_11 Depth=1
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_20:                                ##   Parent Loop BB0_11 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rbx,%r13,4), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
	incq	%r13
	cmpq	%r13, -48(%rbp)
	ja	LBB0_20
LBB0_21:                                ##   in Loop: Header=BB0_11 Depth=1
	xorl	%ecx, %ecx
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ecx
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	-104(%rbp), %r10                ## 8-byte Reload
	jmp	LBB0_29
LBB0_22:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	-56(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_26
## %bb.23:                              ##   in Loop: Header=BB0_11 Depth=1
	xorl	%edi, %edi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_24:                                ##   Parent Loop BB0_11 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r9,%rdi,4), %ecx
	cmpl	%eax, %ecx
	jae	LBB0_27
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=2
	testl	%ecx, %ecx
	cmovneq	%rdi, %rdx
	incq	%rdi
	cmpq	%rdi, %rsi
	jne	LBB0_24
	jmp	LBB0_28
LBB0_26:                                ##   in Loop: Header=BB0_11 Depth=1
	xorl	%edx, %edx
	jmp	LBB0_28
LBB0_27:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	%edi, %edx
LBB0_28:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	(%rbx,%r8,4), %eax
	shll	$16, %eax
	shll	$8, %edx
	orl	%edx, %r8d
	orl	%eax, %r8d
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	%r8d, (%rax,%rcx,4)
LBB0_29:                                ##   in Loop: Header=BB0_11 Depth=1
	cmpq	%r10, %r14
	je	LBB0_32
## %bb.30:                              ##   in Loop: Header=BB0_11 Depth=1
	incq	%rcx
	xorl	%eax, %eax
	cmpq	-112(%rbp), %rcx                ## 8-byte Folded Reload
	jne	LBB0_11
	jmp	LBB0_7
LBB0_31:
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_32:
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mx.lvl"

L_.str.1:                               ## @.str.1
	.asciz	"Level %u not found in in the RPMh list\n"

L_.str.2:                               ## @.str.2
	.asciz	"Available levels:\n"

L_.str.3:                               ## @.str.3
	.asciz	"  %u\n"

	.no_dead_strip	_a6xx_gmu_rpmh_arc_votes_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a6xx_gmu_rpmh_arc_votes_init
_a6xx_gmu_rpmh_arc_votes_init:          ; @a6xx_gmu_rpmh_arc_votes_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x24, x3
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	add	x1, sp, #40
	mov	x0, x4
	bl	_cmd_db_read_aux_data
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x22
LBB0_2:
	bl	_PTR_ERR
	b	LBB0_5
LBB0_3:
	ldr	x8, [sp, #40]
	lsr	x9, x8, #1
	str	x9, [sp, #40]
	cmp	x8, #1
	b.hi	LBB0_6
LBB0_4:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_6:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	add	x1, sp, #32
	bl	_cmd_db_read_aux_data
	mov	x23, x0
	bl	_IS_ERR
	cbz	x0, LBB0_8
; %bb.7:
	mov	x0, x23
	b	LBB0_2
LBB0_8:
	ldr	x8, [sp, #32]
	lsr	x9, x8, #1
	str	x9, [sp, #32]
	cmp	x8, #2
	b.lo	LBB0_4
; %bb.9:
	cmp	w24, #1
	b.lt	LBB0_30
; %bb.10:
	mov	x27, #0
	mov	w28, w24
                                        ; implicit-def: $w8
                                        ; kill: killed $w8
Lloh5:
	adrp	x26, l_.str.3@PAGE
Lloh6:
	add	x26, x26, l_.str.3@PAGEOFF
	str	x20, [sp, #24]                  ; 8-byte Folded Spill
LBB0_11:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
                                        ;     Child Loop BB0_23 Depth 2
                                        ;     Child Loop BB0_18 Depth 2
	ldr	x1, [x19, x27, lsl #3]
	mov	x0, x21
	bl	_a6xx_gmu_get_arc_level
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	x24, [sp, #40]
	cbz	x24, LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x8, #0
LBB0_13:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w9, [x22, x8, lsl #2]
	cmp	w9, w0
	b.hs	LBB0_20
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=2
	add	x8, x8, #1
	cmp	x24, x8
	b.ne	LBB0_13
LBB0_15:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	x8, #0
	and	x25, x24, #0xffffffff
	cmp	x24, x25
	b.ne	LBB0_21
LBB0_16:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	x20, x28
	str	x0, [sp]
	mov	x0, x21
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_DRM_DEV_ERROR
	mov	x0, x21
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_DRM_DEV_ERROR
	ldr	x8, [sp, #40]
	cbz	x8, LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x28, #0
LBB0_18:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x22, x28, lsl #2]
	str	x8, [sp]
	mov	x0, x21
	mov	x1, x26
	bl	_DRM_DEV_ERROR
	add	x28, x28, #1
	ldr	x8, [sp, #40]
	cmp	x8, x28
	b.hi	LBB0_18
LBB0_19:                                ;   in Loop: Header=BB0_11 Depth=1
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	mov	x28, x20
	ldr	x20, [sp, #24]                  ; 8-byte Folded Reload
	b	LBB0_28
LBB0_20:                                ;   in Loop: Header=BB0_11 Depth=1
	and	x25, x8, #0xffffffff
	mov	x8, x25
	cmp	x24, x25
	b.eq	LBB0_16
LBB0_21:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	x10, [sp, #32]
	cbz	x10, LBB0_25
; %bb.22:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x11, #0
	mov	x9, #0
LBB0_23:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w12, [x23, x11, lsl #2]
	cmp	w12, w0
	b.hs	LBB0_26
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=2
	cmp	w12, #0
	csel	x9, x9, x11, eq
	add	x11, x11, #1
	cmp	x10, x11
	b.ne	LBB0_23
	b	LBB0_27
LBB0_25:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	x9, #0
	b	LBB0_27
LBB0_26:                                ;   in Loop: Header=BB0_11 Depth=1
	and	x9, x11, #0xffffffff
LBB0_27:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	w10, [x22, x8, lsl #2]
	orr	w8, w8, w9, lsl #8
	orr	w8, w8, w10, lsl #16
	str	w8, [x20, x27, lsl #2]
LBB0_28:                                ;   in Loop: Header=BB0_11 Depth=1
	cmp	x24, x25
	b.eq	LBB0_31
; %bb.29:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	w0, #0
	add	x27, x27, #1
	cmp	x27, x28
	b.ne	LBB0_11
	b	LBB0_5
LBB0_30:
	mov	w0, #0
	b	LBB0_5
LBB0_31:
	ldr	w0, [sp, #20]                   ; 4-byte Folded Reload
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mx.lvl"

l_.str.1:                               ; @.str.1
	.asciz	"Level %u not found in in the RPMh list\n"

l_.str.2:                               ; @.str.2
	.asciz	"Available levels:\n"

l_.str.3:                               ; @.str.3
	.asciz	"  %u\n"

	.no_dead_strip	_a6xx_gmu_rpmh_arc_votes_init
.subsections_via_symbols
