	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smb347_set_voltage_limits
_smb347_set_voltage_limits:             ## @smb347_set_voltage_limits
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	testl	%edi, %edi
	je	LBB0_3
## %bb.1:
	movl	$2400000, %esi                  ## imm = 0x249F00
	movl	$3000000, %edx                  ## imm = 0x2DC6C0
	callq	_clamp_val
	addl	$-2400000, %eax                 ## imm = 0xFFDB6100
	cltq
	imulq	$351843721, %rax, %rax          ## imm = 0x14F8B589
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$46, %rax
	addl	%ecx, %eax
	movl	(%rbx), %edi
	movq	_CFG_FLOAT_VOLTAGE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_CFG_FLOAT_VOLTAGE_THRESHOLD_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_CFG_FLOAT_VOLTAGE_THRESHOLD_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movl	%eax, %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	js	LBB0_6
## %bb.2:
	movq	8(%rbx), %rax
LBB0_3:
	movl	4(%rax), %edi
	testl	%edi, %edi
	je	LBB0_5
## %bb.4:
	movl	$3500000, %esi                  ## imm = 0x3567E0
	movl	$4500000, %edx                  ## imm = 0x44AA20
	callq	_clamp_val
	addl	$-3500000, %eax                 ## imm = 0xFFCA9820
	cltq
	imulq	$1759218605, %rax, %rcx         ## imm = 0x68DB8BAD
	movq	%rcx, %rax
	shrq	$63, %rax
	sarq	$45, %rcx
	addl	%eax, %ecx
	movl	(%rbx), %edi
	movq	_CFG_FLOAT_VOLTAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CFG_FLOAT_VOLTAGE_FLOAT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_regmap_update_bits
	testl	%eax, %eax
	js	LBB0_6
LBB0_5:
	xorl	%eax, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CFG_FLOAT_VOLTAGE,4,2          ## @CFG_FLOAT_VOLTAGE
	.comm	_CFG_FLOAT_VOLTAGE_THRESHOLD_MASK,4,2 ## @CFG_FLOAT_VOLTAGE_THRESHOLD_MASK
	.comm	_CFG_FLOAT_VOLTAGE_THRESHOLD_SHIFT,4,2 ## @CFG_FLOAT_VOLTAGE_THRESHOLD_SHIFT
	.comm	_CFG_FLOAT_VOLTAGE_FLOAT_MASK,4,2 ## @CFG_FLOAT_VOLTAGE_FLOAT_MASK
	.no_dead_strip	_smb347_set_voltage_limits
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smb347_set_voltage_limits
_smb347_set_voltage_limits:             ; @smb347_set_voltage_limits
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
Lloh0:
	adrp	x20, _CFG_FLOAT_VOLTAGE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _CFG_FLOAT_VOLTAGE@GOTPAGEOFF]
	cbz	w0, LBB0_3
; %bb.1:
	mov	w1, #40704
	movk	w1, #36, lsl #16
	mov	w2, #50880
	movk	w2, #45, lsl #16
	bl	_clamp_val
	sub	w8, w0, #585, lsl #12           ; =2396160
	sub	w8, w8, #3840
	mov	w9, #46473
	movk	w9, #5368, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #46
	add	w8, w8, w9
	ldr	w0, [x19]
Lloh2:
	adrp	x9, _CFG_FLOAT_VOLTAGE_THRESHOLD_MASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CFG_FLOAT_VOLTAGE_THRESHOLD_MASK@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh4:
	ldr	w2, [x9]
Lloh5:
	adrp	x9, _CFG_FLOAT_VOLTAGE_THRESHOLD_SHIFT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CFG_FLOAT_VOLTAGE_THRESHOLD_SHIFT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	lsl	w3, w8, w9
	bl	_regmap_update_bits
	tbnz	w0, #31, LBB0_6
; %bb.2:
	ldr	x8, [x19, #8]
LBB0_3:
	ldr	w0, [x8, #4]
	cbz	w0, LBB0_5
; %bb.4:
	mov	w1, #26592
	movk	w1, #53, lsl #16
	mov	w2, #43552
	movk	w2, #68, lsl #16
	bl	_clamp_val
	sub	w8, w0, #854, lsl #12           ; =3497984
	sub	w8, w8, #2016
	mov	w9, #35757
	movk	w9, #26843, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #45
	add	w3, w8, w9
	ldr	w0, [x19]
	ldr	w1, [x20]
Lloh8:
	adrp	x8, _CFG_FLOAT_VOLTAGE_FLOAT_MASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CFG_FLOAT_VOLTAGE_FLOAT_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	bl	_regmap_update_bits
	tbnz	w0, #31, LBB0_6
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_CFG_FLOAT_VOLTAGE,4,2          ; @CFG_FLOAT_VOLTAGE
	.comm	_CFG_FLOAT_VOLTAGE_THRESHOLD_MASK,4,2 ; @CFG_FLOAT_VOLTAGE_THRESHOLD_MASK
	.comm	_CFG_FLOAT_VOLTAGE_THRESHOLD_SHIFT,4,2 ; @CFG_FLOAT_VOLTAGE_THRESHOLD_SHIFT
	.comm	_CFG_FLOAT_VOLTAGE_FLOAT_MASK,4,2 ; @CFG_FLOAT_VOLTAGE_FLOAT_MASK
	.no_dead_strip	_smb347_set_voltage_limits
.subsections_via_symbols
