	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_atom_get_max_voltage    ## -- Begin function radeon_atom_get_max_voltage
	.p2align	4, 0x90
_radeon_atom_get_max_voltage:           ## @radeon_atom_get_max_voltage
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_VoltageObjectInfo@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_GetIndexIntoMasterTable
	movq	(%rbx), %rdi
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	leaq	-40(%rbp), %r8
	leaq	-36(%rbp), %r9
	movl	%eax, %esi
	callq	_atom_parse_data_header
	testq	%rax, %rax
	je	LBB0_13
## %bb.1:
	movq	(%rbx), %rax
	movslq	(%rax), %rax
	movslq	-36(%rbp), %rdi
	addq	%rax, %rdi
	movl	-40(%rbp), %eax
	cmpl	$2, %eax
	je	LBB0_9
## %bb.2:
	cmpl	$1, %eax
	jne	LBB0_12
## %bb.3:
	movl	%r15d, %esi
	callq	_atom_lookup_voltage_object_v1
	testq	%rax, %rax
	je	LBB0_13
## %bb.4:
	movq	%rax, %rbx
	movb	(%rax), %r12b
	movl	12(%rax), %edi
	callq	_le16_to_cpu
	movl	%eax, %r15d
	movl	4(%rbx), %eax
	testb	$1, %r12b
	jne	LBB0_5
## %bb.6:
	decl	%eax
	movl	%eax, %r12d
	jmp	LBB0_7
LBB0_9:
	movl	%r15d, %esi
	callq	_atom_lookup_voltage_object_v2
	testq	%rax, %rax
	je	LBB0_13
## %bb.10:
	movslq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_13
## %bb.11:
	movq	8(%rax), %rax
	shlq	$4, %rcx
	movl	-16(%rcx,%rax), %edi
	callq	_le16_to_cpu
	jmp	LBB0_8
LBB0_12:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_14
LBB0_5:
	movl	%eax, %r12d
	shrl	$31, %r12d
	addl	%eax, %r12d
	sarl	%r12d
LBB0_7:
	movl	8(%rbx), %edi
	callq	_le16_to_cpu
	imull	%r12d, %eax
	addl	%r15d, %eax
LBB0_8:
	movl	%eax, (%r14)
	xorl	%eax, %eax
LBB0_14:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DATA,4,2                       ## @DATA
	.comm	_VoltageObjectInfo,4,2          ## @VoltageObjectInfo
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown voltage object table\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_atom_get_max_voltage    ; -- Begin function radeon_atom_get_max_voltage
	.p2align	2
_radeon_atom_get_max_voltage:           ; @radeon_atom_get_max_voltage
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DATA@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _VoltageObjectInfo@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VoltageObjectInfo@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_GetIndexIntoMasterTable
	mov	x1, x0
	ldr	x0, [x21]
	mov	x2, sp
	add	x3, sp, #12
	add	x4, sp, #8
	add	x5, sp, #4
	bl	_atom_parse_data_header
	cbz	x0, LBB0_9
; %bb.1:
	ldr	x8, [x21]
	ldrsw	x8, [x8]
	ldrsw	x9, [sp, #4]
	add	x0, x9, x8
	ldr	w8, [sp, #8]
	cmp	w8, #2
	b.eq	LBB0_5
; %bb.2:
	cmp	w8, #1
	b.ne	LBB0_8
; %bb.3:
	mov	x1, x20
	bl	_atom_lookup_voltage_object_v1
	cbz	x0, LBB0_9
; %bb.4:
	mov	x20, x0
	ldr	w22, [x0]
	ldr	w0, [x0, #12]
	bl	_le16_to_cpu
	mov	x21, x0
	ldp	w8, w0, [x20, #4]
	sub	w9, w8, #1
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	tst	w22, #0x1
	csel	w20, w9, w8, eq
	bl	_le16_to_cpu
	mov	x8, x0
	mov	w0, #0
	madd	w8, w8, w20, w21
	str	w8, [x19]
	b	LBB0_10
LBB0_5:
	mov	x1, x20
	bl	_atom_lookup_voltage_object_v2
	cbz	x0, LBB0_9
; %bb.6:
	ldr	w8, [x0]
	cbz	w8, LBB0_9
; %bb.7:
	ldr	x9, [x0, #8]
	sub	w8, w8, #1
	sbfiz	x8, x8, #4, #32
	ldr	w0, [x9, x8]
	bl	_le16_to_cpu
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19]
	b	LBB0_10
LBB0_8:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_9:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_DATA,4,2                       ; @DATA
	.comm	_VoltageObjectInfo,4,2          ; @VoltageObjectInfo
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown voltage object table\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
