	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad7124_init_channel_vref
_ad7124_init_channel_vref:              ## @ad7124_init_channel_vref
	.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, %r14
	movq	8(%rdi), %rax
	movl	%esi, %r15d
	movl	(%rax,%r15,8), %ebx
	leal	-128(%rbx), %ecx
	cmpl	$2, %ecx
	jb	LBB0_3
## %bb.1:
	cmpl	$130, %ebx
	je	LBB0_5
## %bb.2:
	cmpl	$131, %ebx
	jne	LBB0_6
LBB0_3:
	movq	16(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_IS_ERR
	testl	%eax, %eax
	je	LBB0_4
## %bb.8:
	movq	(%r14), %rdi
	movq	_ad7124_ref_names@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%rbx,4), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	16(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_4:
	movq	16(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_regulator_get_voltage
	movq	8(%r14), %rcx
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$38, %rax
	addl	%edx, %eax
	movl	%eax, 4(%rcx,%r15,8)
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_5:
	movl	$2500, 4(%rax,%r15,8)           ## imm = 0x9C4
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_6:
	movq	(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error, trying to use external voltage reference without a %s regulator.\n"

	.comm	_ad7124_ref_names,8,3           ## @ad7124_ref_names
L_.str.1:                               ## @.str.1
	.asciz	"Invalid reference %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ad7124_init_channel_vref
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad7124_init_channel_vref
_ad7124_init_channel_vref:              ; @ad7124_init_channel_vref
	.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
	ldr	x8, [x0, #8]
	mov	w21, w1
	lsl	x9, x21, #3
	ldr	w20, [x8, x9]
	sub	w9, w20, #128
	cmp	w9, #2
	b.lo	LBB0_3
; %bb.1:
	cmp	w20, #130
	b.eq	LBB0_6
; %bb.2:
	cmp	w20, #131
	b.ne	LBB0_7
LBB0_3:
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x20, lsl #2]
	bl	_IS_ERR
	cbz	w0, LBB0_5
; %bb.4:
	ldr	x0, [x19]
Lloh0:
	adrp	x8, _ad7124_ref_names@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ad7124_ref_names@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	lsl	x20, x20, #2
	ldr	w2, [x8, x20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x20]
	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	_PTR_ERR
LBB0_5:
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x20, lsl #2]
	bl	_regulator_get_voltage
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [x19, #8]
	add	x9, x9, x21, lsl #3
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	smull	x8, w8, w10
	lsr	x10, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w10
	str	w8, [x9, #4]
	b	LBB0_8
LBB0_6:
	mov	w0, #0
	add	x8, x8, x21, lsl #3
	mov	w9, #2500
	str	w9, [x8, #4]
	b	LBB0_8
LBB0_7:
	ldr	x0, [x19]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_err
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error, trying to use external voltage reference without a %s regulator.\n"

	.comm	_ad7124_ref_names,8,3           ; @ad7124_ref_names
l_.str.1:                               ; @.str.1
	.asciz	"Invalid reference %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ad7124_init_channel_vref
.subsections_via_symbols
