	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sc27xx_fgu_calibration
_sc27xx_fgu_calibration:                ## @sc27xx_fgu_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
	movq	%rdi, %r15
	movl	8(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	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
	movl	$511, %eax                      ## imm = 0x1FF
	andl	-28(%rbp), %eax
	leal	(%rax,%rax,4), %eax
	leal	(%rax,%rax), %edi
	addl	$26110, %edi                    ## imm = 0x65FE
	movl	$42, %esi
	callq	_DIV_ROUND_CLOSEST
	movl	%eax, (%r15)
	shll	$2, %eax
	movl	%eax, 4(%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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fgu_calib"

	.no_dead_strip	_sc27xx_fgu_calibration
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sc27xx_fgu_calibration
_sc27xx_fgu_calibration:                ; @sc27xx_fgu_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, x0
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	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	w8, [sp, #12]
	and	w8, w8, #0x1ff
	mov	w9, #10
	mov	w10, #26110
	madd	w0, w8, w9, w10
	mov	w1, #42
	bl	_DIV_ROUND_CLOSEST
	lsl	w8, w0, #2
	stp	w0, w8, [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	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fgu_calib"

	.no_dead_strip	_sc27xx_fgu_calibration
.subsections_via_symbols
