	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad5761_get_vref
_ad5761_get_vref:                       ## @ad5761_get_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	16(%rdi), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_devm_regulator_get_optional
	movq	%rax, 8(%rbx)
	movq	%rax, %rdi
	callq	_PTR_ERR
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_3
## %bb.1:
	movl	(%r14), %eax
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	movl	$1, (%rbx)
	movl	%eax, 4(%rbx)
LBB0_14:
	xorl	%r14d, %r14d
	jmp	LBB0_15
LBB0_3:
	movq	8(%rbx), %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	16(%rbx), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	8(%rbx), %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_5:
	movq	16(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_15
LBB0_6:
	movq	8(%rbx), %rdi
	callq	_regulator_enable
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r14d
	movq	16(%rbx), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_15
LBB0_8:
	movq	8(%rbx), %rdi
	callq	_regulator_get_voltage
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_11
## %bb.9:
	leal	-3000001(%r14), %eax
	cmpl	$-1000002, %eax                 ## imm = 0xFFF0BDBE
	ja	LBB0_13
## %bb.10:
	movq	16(%rbx), %rdi
	leaq	L_.str.5(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_warn
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_12
LBB0_11:
	movq	16(%rbx), %rdi
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_err
LBB0_12:
	movq	8(%rbx), %rdi
	callq	_regulator_disable
	movq	$0, 8(%rbx)
LBB0_15:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_13:
	movl	%r14d, %eax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	shrq	$38, %rax
	movl	%eax, 4(%rbx)
	movl	$0, (%rbx)
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vref"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"Voltage reference not found\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"Error getting voltage reference regulator\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to enable voltage reference\n"

L_.str.4:                               ## @.str.4
	.asciz	"Failed to get voltage reference value\n"

L_.str.5:                               ## @.str.5
	.asciz	"Invalid external voltage ref. value %d uV\n"

	.no_dead_strip	_ad5761_get_vref
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad5761_get_vref
_ad5761_get_vref:                       ; @ad5761_get_vref
	.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	x20, x1
	mov	x19, x0
	ldr	x0, [x0, #16]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_devm_regulator_get_optional
	str	x0, [x19, #8]
	bl	_PTR_ERR
Lloh2:
	adrp	x8, _ENODEV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x20]
	cbz	w8, LBB0_5
; %bb.2:
	mov	w20, #0
	mov	w9, #1
	stp	w9, w8, [x19]
	b	LBB0_14
LBB0_3:
	ldr	x0, [x19, #8]
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.4:
	ldr	x0, [x19, #16]
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	ldr	x0, [x19, #8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_5:
	ldr	x0, [x19, #16]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_14
LBB0_6:
	ldr	x0, [x19, #8]
	bl	_regulator_enable
	cbz	w0, LBB0_8
; %bb.7:
	mov	x20, x0
	ldr	x0, [x19, #16]
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	b	LBB0_14
LBB0_8:
	ldr	x0, [x19, #8]
	bl	_regulator_get_voltage
	mov	x20, x0
	tbnz	w0, #31, LBB0_11
; %bb.9:
	sub	w8, w20, #732, lsl #12          ; =2998272
	sub	w8, w8, #1729
	mov	w9, #48574
	movk	w9, #65520, lsl #16
	cmp	w8, w9
	b.hi	LBB0_13
; %bb.10:
	ldr	x0, [x19, #16]
Lloh14:
	adrp	x1, l_.str.5@PAGE
Lloh15:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x2, x20
	bl	_dev_warn
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_12
LBB0_11:
	ldr	x0, [x19, #16]
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
LBB0_12:
	ldr	x0, [x19, #8]
	bl	_regulator_disable
	str	xzr, [x19, #8]
	b	LBB0_14
LBB0_13:
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	umull	x8, w20, w8
	lsr	x8, x8, #38
	stp	wzr, w8, [x19]
	mov	w20, #0
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vref"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"Voltage reference not found\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"Error getting voltage reference regulator\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to enable voltage reference\n"

l_.str.4:                               ; @.str.4
	.asciz	"Failed to get voltage reference value\n"

l_.str.5:                               ; @.str.5
	.asciz	"Invalid external voltage ref. value %d uV\n"

	.no_dead_strip	_ad5761_get_vref
.subsections_via_symbols
