	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atxp1_storevcore
_atxp1_storevcore:                      ## @atxp1_storevcore
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %rbx
	movq	%rdi, %r13
	callq	_to_i2c_client
	movq	%rax, %r12
	movq	%r13, %rdi
	callq	_atxp1_update_device
	movq	%rax, %r15
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$10, %edx
	callq	_simple_strtoul
	movl	%eax, %eax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	shrq	$35, %rax
	leal	(%rax,%rax,4), %eax
	leal	(%rax,%rax,4), %edi
	movl	16(%r15), %esi
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	callq	_vid_to_reg
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	%eax, %ebx
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	8(%r15), %r14d
	movq	%r15, %rax
	movq	_ATXP1_VIDENA@GOTPCREL(%rip), %r15
	testl	%r14d, (%r15)
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.3:
	movq	_ATXP1_VIDMASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r14d
	cmpl	%r14d, %ebx
	jne	LBB0_6
	jmp	LBB0_12
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_err
	movl	$-1, %eax
	jmp	LBB0_13
LBB0_4:
	movl	12(%rax), %r14d
	cmpl	%r14d, %ebx
	je	LBB0_12
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%ebx, %ecx
	callq	_dev_dbg
	cmpl	%ebx, %r14d
	jle	LBB0_7
## %bb.9:
	movq	_ATXP1_VID@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movl	(%r15), %edx
	orl	%r14d, %edx
	movq	%r12, %rdi
	callq	_i2c_smbus_write_byte_data
	leal	-1(%r14), %eax
	cmpl	%ebx, %r14d
	movl	%eax, %r14d
	jg	LBB0_10
	jmp	LBB0_11
LBB0_7:
	incl	%ebx
	movq	_ATXP1_VID@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movl	(%r15), %edx
	orl	%r14d, %edx
	movq	%r12, %rdi
	callq	_i2c_smbus_write_byte_data
	incl	%r14d
	cmpl	%r14d, %ebx
	jne	LBB0_8
LBB0_11:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
LBB0_12:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
LBB0_13:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VID calculation failed.\n"

	.comm	_ATXP1_VIDENA,4,2               ## @ATXP1_VIDENA
	.comm	_ATXP1_VIDMASK,4,2              ## @ATXP1_VIDMASK
L_.str.1:                               ## @.str.1
	.asciz	"Setting VCore to %d mV (0x%02x)\n"

	.comm	_ATXP1_VID,4,2                  ## @ATXP1_VID
	.no_dead_strip	_atxp1_storevcore
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atxp1_storevcore
_atxp1_storevcore:                      ; @atxp1_storevcore
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x23, x2
	mov	x22, x0
	bl	_to_i2c_client
	mov	x20, x0
	mov	x0, x22
	bl	_atxp1_update_device
	mov	x21, x0
	mov	x0, x23
	mov	x1, #0
	mov	w2, #10
	bl	_simple_strtoul
	mov	w8, #34079
	movk	w8, #20971, lsl #16
	umull	x8, w0, w8
	lsr	x8, x8, #35
	mov	w9, #25
	mul	w24, w8, w9
	ldr	w1, [x21, #16]
	mov	x0, x24
	bl	_vid_to_reg
	tbnz	w0, #31, LBB0_3
; %bb.1:
	mov	x23, x0
	ldr	w8, [x21, #8]
Lloh0:
	adrp	x25, _ATXP1_VIDENA@GOTPAGE
Lloh1:
	ldr	x25, [x25, _ATXP1_VIDENA@GOTPAGEOFF]
	ldr	w9, [x25]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
Lloh2:
	adrp	x9, _ATXP1_VIDMASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ATXP1_VIDMASK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	and	w26, w9, w8
	cmp	w23, w26
	b.ne	LBB0_5
	b	LBB0_11
LBB0_3:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_dev_err
	mov	w19, #-1
	b	LBB0_11
LBB0_4:
	ldr	w26, [x21, #12]
	cmp	w23, w26
	b.eq	LBB0_11
LBB0_5:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x24
	mov	x3, x23
	bl	_dev_dbg
	cmp	w26, w23
	b.le	LBB0_8
; %bb.6:
Lloh9:
	adrp	x22, _ATXP1_VID@GOTPAGE
Lloh10:
	ldr	x22, [x22, _ATXP1_VID@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	ldr	w8, [x25]
	orr	w2, w8, w26
	mov	x0, x20
	bl	_i2c_smbus_write_byte_data
	sub	w8, w26, #1
	cmp	w26, w23
	mov	x26, x8
	b.gt	LBB0_7
	b	LBB0_10
LBB0_8:
	add	w22, w23, #1
Lloh11:
	adrp	x23, _ATXP1_VID@GOTPAGE
Lloh12:
	ldr	x23, [x23, _ATXP1_VID@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	ldr	w8, [x25]
	orr	w2, w8, w26
	mov	x0, x20
	bl	_i2c_smbus_write_byte_data
	add	w26, w26, #1
	cmp	w22, w26
	b.ne	LBB0_9
LBB0_10:
	str	xzr, [x21]
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VID calculation failed.\n"

	.comm	_ATXP1_VIDENA,4,2               ; @ATXP1_VIDENA
	.comm	_ATXP1_VIDMASK,4,2              ; @ATXP1_VIDMASK
l_.str.1:                               ; @.str.1
	.asciz	"Setting VCore to %d mV (0x%02x)\n"

	.comm	_ATXP1_VID,4,2                  ; @ATXP1_VID
	.no_dead_strip	_atxp1_storevcore
.subsections_via_symbols
