	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sc27xx_adc_scale_calibration
_sc27xx_adc_scale_calibration:          ## @sc27xx_adc_scale_calibration
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movl	$0, -28(%rbp)
	testl	%esi, %esi
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str(%rip), %rsi
	cmoveq	%rax, %rsi
	movl	(%rdi), %edi
	callq	_nvmem_cell_get
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.5:
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	leaq	-40(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_nvmem_cell_read
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_nvmem_cell_put
	movq	%r14, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	callq	_PTR_ERR
	jmp	LBB0_4
LBB0_3:
	movq	-40(%rbp), %rdi
	movl	$4, %esi
	callq	_min
	leaq	-28(%rbp), %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_memcpy
	movq	_small_scale_graph_calib@GOTPCREL(%rip), %rax
	leaq	8(%rax), %rcx
	movq	_big_scale_graph_calib@GOTPCREL(%rip), %rbx
	leaq	8(%rbx), %rdx
	testl	%r15d, %r15d
	cmoveq	%rcx, %rdx
	movq	_big_scale_graph@GOTPCREL(%rip), %r15
	cmoveq	_small_scale_graph@GOTPCREL(%rip), %r15
	movl	-28(%rbp), %edi
	movq	(%rdx), %rsi
	cmoveq	%rax, %rbx
	callq	_sc27xx_adc_get_calib_data
	movq	%rax, 8(%r15)
	movl	-28(%rbp), %edi
	sarl	$8, %edi
	movq	(%rbx), %rsi
	callq	_sc27xx_adc_get_calib_data
	movq	%rax, (%r15)
	movq	%r14, %rdi
	callq	_kfree
	xorl	%eax, %eax
LBB0_4:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_big_scale_graph_calib,16,3     ## @big_scale_graph_calib
	.comm	_big_scale_graph,16,3           ## @big_scale_graph
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"big_scale_calib"

	.comm	_small_scale_graph_calib,16,3   ## @small_scale_graph_calib
	.comm	_small_scale_graph,16,3         ## @small_scale_graph
L_.str.1:                               ## @.str.1
	.asciz	"small_scale_calib"

	.no_dead_strip	_sc27xx_adc_scale_calibration
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sc27xx_adc_scale_calibration
_sc27xx_adc_scale_calibration:          ; @sc27xx_adc_scale_calibration
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
	str	wzr, [sp, #12]
Lloh2:
	adrp	x9, l_.str.1@PAGE
Lloh3:
	add	x9, x9, l_.str.1@PAGEOFF
	cmp	w1, #0
	csel	x1, x9, x8, eq
	ldr	w0, [x0]
	bl	_nvmem_cell_get
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x21
	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
	add	sp, sp, #64
	b	_PTR_ERR
LBB0_2:
	mov	x1, sp
	mov	x0, x21
	bl	_nvmem_cell_read
	mov	x20, x0
	mov	x0, x21
	bl	_nvmem_cell_put
	mov	x0, x20
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_PTR_ERR
	b	LBB0_5
LBB0_4:
	ldr	x0, [sp]
	mov	w1, #4
	bl	_min
	mov	x2, x0
	add	x0, sp, #12
	mov	x1, x20
	bl	_memcpy
	ldr	w0, [sp, #12]
Lloh4:
	adrp	x8, _small_scale_graph_calib@GOTPAGE
Lloh5:
	ldr	x8, [x8, _small_scale_graph_calib@GOTPAGEOFF]
	add	x9, x8, #8
Lloh6:
	adrp	x10, _big_scale_graph_calib@GOTPAGE
Lloh7:
	ldr	x10, [x10, _big_scale_graph_calib@GOTPAGEOFF]
	add	x11, x10, #8
	cmp	w19, #0
	csel	x9, x9, x11, eq
	ldr	x1, [x9]
Lloh8:
	adrp	x9, _big_scale_graph@GOTPAGE
Lloh9:
	ldr	x9, [x9, _big_scale_graph@GOTPAGEOFF]
Lloh10:
	adrp	x11, _small_scale_graph@GOTPAGE
Lloh11:
	ldr	x11, [x11, _small_scale_graph@GOTPAGEOFF]
	csel	x19, x11, x9, eq
	csel	x21, x8, x10, eq
	bl	_sc27xx_adc_get_calib_data
	str	x0, [x19, #8]
	ldr	w8, [sp, #12]
	asr	w0, w8, #8
	ldr	x1, [x21]
	bl	_sc27xx_adc_get_calib_data
	str	x0, [x19]
	mov	x0, x20
	bl	_kfree
	mov	w0, #0
LBB0_5:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_big_scale_graph_calib,16,3     ; @big_scale_graph_calib
	.comm	_big_scale_graph,16,3           ; @big_scale_graph
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"big_scale_calib"

	.comm	_small_scale_graph_calib,16,3   ; @small_scale_graph_calib
	.comm	_small_scale_graph,16,3         ; @small_scale_graph
l_.str.1:                               ; @.str.1
	.asciz	"small_scale_calib"

	.no_dead_strip	_sc27xx_adc_scale_calibration
.subsections_via_symbols
