	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_soc_pcmcia_regulator_set       ## -- Begin function soc_pcmcia_regulator_set
	.p2align	4, 0x90
_soc_pcmcia_regulator_set:              ## @soc_pcmcia_regulator_set
	.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	%rdi, %r15
	movl	4(%rsi), %edi
	xorl	%eax, %eax
	testl	%edi, %edi
	je	LBB0_9
## %bb.1:
	movl	%edx, %r14d
	movq	%rsi, %rbx
	xorl	%r12d, %r12d
	testl	%edx, %edx
	setne	%r12b
	cmpl	%r12d, (%rsi)
	je	LBB0_9
## %bb.2:
	testl	%r14d, %r14d
	je	LBB0_6
## %bb.3:
	imull	$100000, %r14d, %edx            ## imm = 0x186A0
	movl	%edx, %esi
	callq	_regulator_set_voltage
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	4(%rbx), %edi
	callq	_regulator_get_voltage
	movslq	%eax, %r8
	imulq	$351843721, %r8, %r10           ## imm = 0x14F8B589
	movq	%r10, %rcx
	shrq	$63, %rcx
	sarq	$45, %r10
	addl	%ecx, %r10d
	leaq	8(%r15), %rdi
	cmpq	%rbx, %r15
	leaq	L_.str.1(%rip), %rcx
	leaq	L_.str.2(%rip), %rdx
	cmoveq	%rcx, %rdx
	movslq	%r14d, %rcx
	imulq	$1717986919, %rcx, %rcx         ## imm = 0x66666667
	movq	%rcx, %rsi
	shrq	$63, %rsi
	sarq	$34, %rcx
	addl	%esi, %ecx
	leal	(%rcx,%rcx), %esi
	leal	(%rsi,%rsi,4), %esi
	subl	%esi, %r14d
	imulq	$1125899907, %r8, %r9           ## imm = 0x431BDE83
	movq	%r9, %rsi
	shrq	$63, %rsi
	sarq	$50, %r9
	addl	%esi, %r9d
	movswl	%r10w, %esi
	imull	$26215, %esi, %esi              ## imm = 0x6667
	movl	%esi, %eax
	shrl	$31, %eax
	sarl	$18, %esi
	addl	%eax, %esi
	addl	%esi, %esi
	leal	(%rsi,%rsi,4), %eax
	subl	%eax, %r10d
	movswl	%r10w, %eax
	movl	%eax, (%rsp)
	leaq	L_.str(%rip), %rsi
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	%r14d, %r8d
                                        ## kill: def $r9d killed $r9d killed $r9
	callq	_dev_warn
LBB0_5:
	movl	4(%rbx), %edi
	callq	_regulator_enable
	testl	%eax, %eax
	jne	LBB0_9
LBB0_8:
	movl	%r12d, (%rbx)
	xorl	%eax, %eax
LBB0_9:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	callq	_regulator_disable
	testl	%eax, %eax
	jne	LBB0_9
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CS requested %s=%u.%uV, applying %u.%uV\n"

L_.str.1:                               ## @.str.1
	.asciz	"Vcc"

L_.str.2:                               ## @.str.2
	.asciz	"Vpp"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_soc_pcmcia_regulator_set       ; -- Begin function soc_pcmcia_regulator_set
	.p2align	2
_soc_pcmcia_regulator_set:              ; @soc_pcmcia_regulator_set
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x0
	ldr	w0, [x1, #4]
	cbz	w0, LBB0_8
; %bb.1:
	mov	x20, x2
	mov	x19, x1
	cmp	w2, #0
	cset	w22, ne
	ldr	w8, [x1]
	cmp	w8, w22
	b.ne	LBB0_3
; %bb.2:
	mov	w0, #0
	b	LBB0_8
LBB0_3:
	cbz	w20, LBB0_9
; %bb.4:
	mov	w23, #34464
	movk	w23, #1, lsl #16
	mul	w1, w20, w23
	mov	x2, x1
	bl	_regulator_set_voltage
	cbz	w0, LBB0_6
; %bb.5:
	ldr	w0, [x19, #4]
	bl	_regulator_get_voltage
	sdiv	w9, w0, w23
Lloh0:
	adrp	x10, l_.str.2@PAGE
Lloh1:
	add	x10, x10, l_.str.2@PAGEOFF
	add	x8, x21, #8
Lloh2:
	adrp	x11, l_.str.1@PAGE
Lloh3:
	add	x11, x11, l_.str.1@PAGEOFF
	cmp	x21, x19
	csel	x2, x11, x10, eq
	mov	w10, #26215
	movk	w10, #26214, lsl #16
	smull	x10, w20, w10
	lsr	x11, x10, #63
	asr	x10, x10, #34
	add	w3, w10, w11
	mov	w10, #10
	msub	w4, w3, w10, w20
	mov	w11, #56963
	movk	w11, #17179, lsl #16
	smull	x11, w0, w11
	lsr	x12, x11, #63
	asr	x11, x11, #50
	add	w5, w11, w12
	sxth	w11, w9
	mov	w12, #26215
	mul	w11, w11, w12
	asr	w12, w11, #18
	add	w11, w12, w11, lsr #31
	msub	w9, w11, w10, w9
	sxth	w6, w9
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x8
	bl	_dev_warn
LBB0_6:
	ldr	w0, [x19, #4]
	bl	_regulator_enable
	cbnz	w0, LBB0_8
LBB0_7:
	str	w22, [x19]
LBB0_8:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
	bl	_regulator_disable
	cbnz	w0, LBB0_8
	b	LBB0_7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CS requested %s=%u.%uV, applying %u.%uV\n"

l_.str.1:                               ; @.str.1
	.asciz	"Vcc"

l_.str.2:                               ; @.str.2
	.asciz	"Vpp"

.subsections_via_symbols
