	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_atom_get_voltage_table  ## -- Begin function radeon_atom_get_voltage_table
	.p2align	4, 0x90
_radeon_atom_get_voltage_table:         ## @radeon_atom_get_voltage_table
	.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	%rcx, %r15
	movl	%edx, %ebx
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_VoltageObjectInfo@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_GetIndexIntoMasterTable
	movq	(%r12), %rdi
	leaq	-96(%rbp), %rdx
	leaq	-52(%rbp), %rcx
	leaq	-44(%rbp), %r8
	leaq	-88(%rbp), %r9
	movl	%eax, %esi
	callq	_atom_parse_data_header
	testq	%rax, %rax
	je	LBB0_24
## %bb.1:
	movq	(%r12), %rax
	movq	-88(%rbp), %rdi
	addq	(%rax), %rdi
	movl	-52(%rbp), %esi
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jae	LBB0_2
## %bb.10:
	movl	-44(%rbp), %eax
	cmpl	$2, %eax
	je	LBB0_13
## %bb.11:
	cmpl	$1, %eax
	jne	LBB0_22
## %bb.12:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$1, %edx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_2:
	cmpl	$3, %esi
	jne	LBB0_22
## %bb.3:
	cmpl	$1, -44(%rbp)
	jne	LBB0_22
## %bb.4:
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_atom_lookup_voltage_object_v3
	testq	%rax, %rax
	je	LBB0_24
## %bb.5:
	movq	%rax, %r14
	movl	(%rax), %eax
	movq	_MAX_VOLTAGE_ENTRIES@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jg	LBB0_24
## %bb.6:
	testl	%eax, %eax
	jle	LBB0_9
## %bb.7:
	movq	16(%r14), %r12
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r12,%rbx,2), %edi
	callq	_le16_to_cpu
	movq	16(%r15), %rcx
	movq	%rax, 8(%rcx,%rbx)
	movl	(%r12,%rbx,2), %edi
	callq	_le32_to_cpu
	movq	16(%r15), %rcx
	movq	%rax, (%rcx,%rbx)
	incq	%r13
	movslq	(%r14), %rax
	addq	$16, %rbx
	cmpq	%rax, %r13
	jl	LBB0_8
LBB0_9:
	movl	8(%r14), %edi
	callq	_le32_to_cpu
	movq	%rax, 8(%r15)
	movl	(%r14), %eax
	movl	%eax, (%r15)
	movl	4(%r14), %eax
	movl	%eax, 4(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_26
LBB0_22:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_13:
	movl	%r14d, %esi
	callq	_atom_lookup_voltage_object_v2
	testq	%rax, %rax
	je	LBB0_24
## %bb.14:
	movl	(%rax), %edx
	movq	_MAX_VOLTAGE_ENTRIES@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edx
	jle	LBB0_15
LBB0_24:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_25:
	subl	(%rax), %ebx
LBB0_26:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	testl	%edx, %edx
	jle	LBB0_21
## %bb.16:
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movq	8(%rax), %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	leaq	8(%r15), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	%rax, %r15
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%r13), %edi
	callq	_le16_to_cpu
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	16(%rcx), %rcx
	movq	%rax, 8(%rcx,%r13)
	addq	%r13, %rcx
	movq	%r12, %rdi
	movq	%rax, %rsi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	callq	_radeon_atom_get_voltage_gpio_settings
	testl	%eax, %eax
	jne	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	incq	%r14
	movq	%r15, %rax
	movslq	(%r15), %rdx
	addq	$16, %r13
	cmpq	%rdx, %r14
	jl	LBB0_17
## %bb.20:
	movq	-64(%rbp), %r15                 ## 8-byte Reload
LBB0_21:
	movl	%edx, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_26
LBB0_18:
	movl	%eax, %ebx
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_DATA,4,2                       ## @DATA
	.comm	_VoltageObjectInfo,4,2          ## @VoltageObjectInfo
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"old table version %d, %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MAX_VOLTAGE_ENTRIES,4,2        ## @MAX_VOLTAGE_ENTRIES
L_.str.1:                               ## @.str.1
	.asciz	"unknown voltage object table\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_atom_get_voltage_table  ; -- Begin function radeon_atom_get_voltage_table
	.p2align	2
_radeon_atom_get_voltage_table:         ; @radeon_atom_get_voltage_table
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x19, x3
	mov	x22, 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]
	add	x2, sp, #24
	add	x3, sp, #44
	add	x4, sp, #40
	add	x5, sp, #32
	bl	_atom_parse_data_header
	cbz	x0, LBB0_15
; %bb.1:
	ldr	x8, [x21]
	ldr	x8, [x8]
	ldr	x9, [sp, #32]
	add	x0, x9, x8
	ldr	w8, [sp, #44]
	sub	w9, w8, #1
	cmp	w9, #2
	b.hs	LBB0_5
; %bb.2:
	ldr	w9, [sp, #40]
	cmp	w9, #2
	b.eq	LBB0_17
; %bb.3:
	cmp	w9, #1
	b.ne	LBB0_13
; %bb.4:
	mov	w9, #1
	stp	x8, x9, [sp]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_14
LBB0_5:
	cmp	w8, #3
	b.ne	LBB0_13
; %bb.6:
	ldr	w8, [sp, #40]
	cmp	w8, #1
	b.ne	LBB0_13
; %bb.7:
	mov	x1, x20
	mov	x2, x22
	bl	_atom_lookup_voltage_object_v3
	cbz	x0, LBB0_15
; %bb.8:
	mov	x20, x0
	ldr	w8, [x0]
Lloh8:
	adrp	x9, _MAX_VOLTAGE_ENTRIES@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MAX_VOLTAGE_ENTRIES@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w8, w9
	b.gt	LBB0_15
; %bb.9:
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.10:
	mov	x21, #0
	mov	x22, #0
	ldr	x8, [x20, #16]
	add	x23, x8, #4
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	bl	_le16_to_cpu
	ldr	x8, [x19, #16]
	add	x8, x8, x21
	str	x0, [x8, #8]
	ldur	w0, [x23, #-4]
	bl	_le32_to_cpu
	ldr	x8, [x19, #16]
	str	x0, [x8, x21]
	add	x22, x22, #1
	ldrsw	x8, [x20]
	add	x21, x21, #16
	add	x23, x23, #32
	cmp	x22, x8
	b.lt	LBB0_11
LBB0_12:
	ldr	w0, [x20, #8]
	bl	_le32_to_cpu
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19, #8]
	ldr	d0, [x20]
	str	d0, [x19]
	b	LBB0_16
LBB0_13:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_14:
	bl	_DRM_ERROR
LBB0_15:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_17:
	mov	x1, x20
	bl	_atom_lookup_voltage_object_v2
	cbz	x0, LBB0_15
; %bb.18:
	mov	x22, x0
	ldr	w8, [x0]
Lloh16:
	adrp	x9, _MAX_VOLTAGE_ENTRIES@GOTPAGE
Lloh17:
	ldr	x9, [x9, _MAX_VOLTAGE_ENTRIES@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	cmp	w8, w9
	b.gt	LBB0_15
; %bb.19:
	cmp	w8, #1
	b.lt	LBB0_23
; %bb.20:
	mov	x24, #0
	mov	x25, #0
	ldr	x26, [x22, #8]
	add	x23, x19, #8
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x26, x24]
	bl	_le16_to_cpu
	mov	x1, x0
	ldr	x8, [x19, #16]
	add	x3, x8, x24
	str	x0, [x3, #8]
	mov	x0, x21
	mov	x2, x20
	mov	x4, x23
	bl	_radeon_atom_get_voltage_gpio_settings
	cbnz	w0, LBB0_16
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	add	x25, x25, #1
	ldrsw	x8, [x22]
	add	x24, x24, #16
	cmp	x25, x8
	b.lt	LBB0_21
LBB0_23:
	mov	w0, #0
	str	w8, [x19]
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_DATA,4,2                       ; @DATA
	.comm	_VoltageObjectInfo,4,2          ; @VoltageObjectInfo
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"old table version %d, %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MAX_VOLTAGE_ENTRIES,4,2        ; @MAX_VOLTAGE_ENTRIES
l_.str.1:                               ; @.str.1
	.asciz	"unknown voltage object table\n"

.subsections_via_symbols
