	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function a540_lm_setup
_a540_lm_setup:                         ## @a540_lm_setup
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_to_adreno_gpu
	movl	(%rax), %r14d
	movq	_AGC_LM_CONFIG_GPU_VERSION_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r14d
	movq	_AGC_LM_CONFIG_BCL_DISABLED@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	movq	_AGC_LM_CONFIG_THROTTLE_DISABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	movq	_REG_A5XX_GPMU_GPMU_VOLTAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-2147483648, %edx              ## imm = 0x80000000
	callq	_gpu_write
	movq	_REG_A5XX_GPMU_GPMU_PWR_THRESHOLD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-2147477648, %edx              ## imm = 0x80001770
	callq	_gpu_write
	movq	_AGC_MSG_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-2147483647, %edx              ## imm = 0x80000001
	callq	_gpu_write
	movq	_AGC_MSG_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AGC_POWER_CONFIG_PRODUCTION_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_gpu_write
	xorl	%edi, %edi
	callq	_AGC_MSG_PAYLOAD
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	$5448, %edx                     ## imm = 0x1548
	callq	_gpu_write
	movl	$1, %edi
	callq	_AGC_MSG_PAYLOAD
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	$1, %edx
	callq	_gpu_write
	movl	$2, %edi
	callq	_AGC_MSG_PAYLOAD
	movl	%eax, %r15d
	movl	(%rbx), %esi
	movq	%rbx, %rdi
	callq	__get_mvolts
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_gpu_write
	movl	$3, %edi
	callq	_AGC_MSG_PAYLOAD
	movslq	(%rbx), %rcx
	imulq	$1125899907, %rcx, %rdx         ## imm = 0x431BDE83
	movq	%rdx, %rcx
	shrq	$63, %rcx
	sarq	$50, %rdx
	addl	%ecx, %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_gpu_write
	movq	_AGC_LM_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AGC_MSG_PAYLOAD
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	%r14d, %edx
	callq	_gpu_write
	movq	_AGC_LEVEL_CONFIG@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_AGC_MSG_PAYLOAD
	movq	_LEVEL_CONFIG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_gpu_write
	movq	_AGC_MSG_PAYLOAD_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	(%r15), %edi
	incl	%edi
	callq	_PAYLOAD_SIZE
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_gpu_write
	movq	_AGC_INIT_MSG_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AGC_INIT_MSG_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gpu_write                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AGC_LM_CONFIG_BCL_DISABLED,4,2 ## @AGC_LM_CONFIG_BCL_DISABLED
	.comm	_AGC_LM_CONFIG_GPU_VERSION_SHIFT,4,2 ## @AGC_LM_CONFIG_GPU_VERSION_SHIFT
	.comm	_AGC_LM_CONFIG_THROTTLE_DISABLE,4,2 ## @AGC_LM_CONFIG_THROTTLE_DISABLE
	.comm	_REG_A5XX_GPMU_GPMU_VOLTAGE,4,2 ## @REG_A5XX_GPMU_GPMU_VOLTAGE
	.comm	_REG_A5XX_GPMU_GPMU_PWR_THRESHOLD,4,2 ## @REG_A5XX_GPMU_GPMU_PWR_THRESHOLD
	.comm	_AGC_MSG_STATE,4,2              ## @AGC_MSG_STATE
	.comm	_AGC_MSG_COMMAND,4,2            ## @AGC_MSG_COMMAND
	.comm	_AGC_POWER_CONFIG_PRODUCTION_ID,4,2 ## @AGC_POWER_CONFIG_PRODUCTION_ID
	.comm	_AGC_LM_CONFIG,4,2              ## @AGC_LM_CONFIG
	.comm	_AGC_LEVEL_CONFIG,4,2           ## @AGC_LEVEL_CONFIG
	.comm	_LEVEL_CONFIG,4,2               ## @LEVEL_CONFIG
	.comm	_AGC_MSG_PAYLOAD_SIZE,4,2       ## @AGC_MSG_PAYLOAD_SIZE
	.comm	_AGC_INIT_MSG_MAGIC,4,2         ## @AGC_INIT_MSG_MAGIC
	.comm	_AGC_INIT_MSG_VALUE,4,2         ## @AGC_INIT_MSG_VALUE
	.no_dead_strip	_a540_lm_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a540_lm_setup
_a540_lm_setup:                         ; @a540_lm_setup
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
	bl	_to_adreno_gpu
Lloh0:
	adrp	x8, _AGC_LM_CONFIG_BCL_DISABLED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AGC_LM_CONFIG_BCL_DISABLED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x0]
Lloh3:
	adrp	x10, _AGC_LM_CONFIG_GPU_VERSION_SHIFT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _AGC_LM_CONFIG_GPU_VERSION_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	lsl	w9, w9, w10
Lloh6:
	adrp	x10, _AGC_LM_CONFIG_THROTTLE_DISABLE@GOTPAGE
Lloh7:
	ldr	x10, [x10, _AGC_LM_CONFIG_THROTTLE_DISABLE@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh8:
	ldr	w9, [x10]
	orr	w20, w8, w9
Lloh9:
	adrp	x8, _REG_A5XX_GPMU_GPMU_VOLTAGE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _REG_A5XX_GPMU_GPMU_VOLTAGE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-2147483648
	bl	_gpu_write
Lloh12:
	adrp	x8, _REG_A5XX_GPMU_GPMU_PWR_THRESHOLD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _REG_A5XX_GPMU_GPMU_PWR_THRESHOLD@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #6000
	movk	w2, #32768, lsl #16
	bl	_gpu_write
Lloh15:
	adrp	x8, _AGC_MSG_STATE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AGC_MSG_STATE@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-2147483647
	bl	_gpu_write
Lloh18:
	adrp	x8, _AGC_MSG_COMMAND@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AGC_MSG_COMMAND@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _AGC_POWER_CONFIG_PRODUCTION_ID@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AGC_POWER_CONFIG_PRODUCTION_ID@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_gpu_write
	mov	w0, #0
	bl	_AGC_MSG_PAYLOAD
	mov	x1, x0
	mov	x0, x19
	mov	w2, #5448
	bl	_gpu_write
	mov	w0, #1
	bl	_AGC_MSG_PAYLOAD
	mov	x1, x0
	mov	x0, x19
	mov	w2, #1
	bl	_gpu_write
	mov	w0, #2
	bl	_AGC_MSG_PAYLOAD
	mov	x21, x0
	ldr	w1, [x19]
	mov	x0, x19
	bl	__get_mvolts
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_gpu_write
	mov	w0, #3
	bl	_AGC_MSG_PAYLOAD
	mov	x1, x0
	ldrsw	x8, [x19]
	mov	w9, #56963
	movk	w9, #17179, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #50
	add	w2, w8, w9
	mov	x0, x19
	bl	_gpu_write
Lloh24:
	adrp	x8, _AGC_LM_CONFIG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AGC_LM_CONFIG@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	bl	_AGC_MSG_PAYLOAD
	mov	x1, x0
	mov	x0, x19
	mov	x2, x20
	bl	_gpu_write
Lloh27:
	adrp	x21, _AGC_LEVEL_CONFIG@GOTPAGE
Lloh28:
	ldr	x21, [x21, _AGC_LEVEL_CONFIG@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_AGC_MSG_PAYLOAD
	mov	x1, x0
Lloh29:
	adrp	x8, _LEVEL_CONFIG@GOTPAGE
Lloh30:
	ldr	x8, [x8, _LEVEL_CONFIG@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_gpu_write
Lloh32:
	adrp	x8, _AGC_MSG_PAYLOAD_SIZE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _AGC_MSG_PAYLOAD_SIZE@GOTPAGEOFF]
Lloh34:
	ldr	w20, [x8]
	ldr	w8, [x21]
	add	w0, w8, #1
	bl	_PAYLOAD_SIZE
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_gpu_write
Lloh35:
	adrp	x8, _AGC_INIT_MSG_MAGIC@GOTPAGE
Lloh36:
	ldr	x8, [x8, _AGC_INIT_MSG_MAGIC@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
Lloh38:
	adrp	x8, _AGC_INIT_MSG_VALUE@GOTPAGE
Lloh39:
	ldr	x8, [x8, _AGC_INIT_MSG_VALUE@GOTPAGEOFF]
Lloh40:
	ldr	w2, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_gpu_write
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AGC_LM_CONFIG_BCL_DISABLED,4,2 ; @AGC_LM_CONFIG_BCL_DISABLED
	.comm	_AGC_LM_CONFIG_GPU_VERSION_SHIFT,4,2 ; @AGC_LM_CONFIG_GPU_VERSION_SHIFT
	.comm	_AGC_LM_CONFIG_THROTTLE_DISABLE,4,2 ; @AGC_LM_CONFIG_THROTTLE_DISABLE
	.comm	_REG_A5XX_GPMU_GPMU_VOLTAGE,4,2 ; @REG_A5XX_GPMU_GPMU_VOLTAGE
	.comm	_REG_A5XX_GPMU_GPMU_PWR_THRESHOLD,4,2 ; @REG_A5XX_GPMU_GPMU_PWR_THRESHOLD
	.comm	_AGC_MSG_STATE,4,2              ; @AGC_MSG_STATE
	.comm	_AGC_MSG_COMMAND,4,2            ; @AGC_MSG_COMMAND
	.comm	_AGC_POWER_CONFIG_PRODUCTION_ID,4,2 ; @AGC_POWER_CONFIG_PRODUCTION_ID
	.comm	_AGC_LM_CONFIG,4,2              ; @AGC_LM_CONFIG
	.comm	_AGC_LEVEL_CONFIG,4,2           ; @AGC_LEVEL_CONFIG
	.comm	_LEVEL_CONFIG,4,2               ; @LEVEL_CONFIG
	.comm	_AGC_MSG_PAYLOAD_SIZE,4,2       ; @AGC_MSG_PAYLOAD_SIZE
	.comm	_AGC_INIT_MSG_MAGIC,4,2         ; @AGC_INIT_MSG_MAGIC
	.comm	_AGC_INIT_MSG_VALUE,4,2         ; @AGC_INIT_MSG_VALUE
	.no_dead_strip	_a540_lm_setup
.subsections_via_symbols
