	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function palmas_gpadc_get_calibrated_code
_palmas_gpadc_get_calibrated_code:      ## @palmas_gpadc_get_calibrated_code
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	(%rdi), %rcx
	movslq	%esi, %rsi
	shlq	$4, %rsi
	cmpl	$0, 12(%rcx,%rsi)
	je	LBB0_4
## %bb.1:
	testl	%edx, %edx
	js	LBB0_5
LBB0_2:
	imull	8(%rcx,%rsi), %edx
	movslq	%edx, %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
LBB0_4:
	imull	$1000, %edx, %eax               ## imm = 0x3E8
	subl	(%rcx,%rsi), %eax
	cltd
	idivl	4(%rcx,%rsi)
	movl	%eax, %edx
	testl	%edx, %edx
	jns	LBB0_2
LBB0_5:
	movl	8(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	xorl	%eax, %eax
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Mismatch with calibration\n"

	.no_dead_strip	_palmas_gpadc_get_calibrated_code
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function palmas_gpadc_get_calibrated_code
_palmas_gpadc_get_calibrated_code:      ; @palmas_gpadc_get_calibrated_code
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
                                        ; kill: def $w1 killed $w1 def $x1
	ldr	x8, [x0]
	sxtw	x9, w1
	add	x10, x8, w1, sxtw #4
	ldr	w10, [x10, #12]
	cbz	w10, LBB0_3
; %bb.1:
	tbnz	w2, #31, LBB0_4
LBB0_2:
	add	x8, x8, x9, lsl #4
	ldr	w8, [x8, #8]
	mul	w8, w8, w2
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w0, w8, w9
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	w10, #1000
	mul	w10, w2, w10
	add	x11, x8, x9, lsl #4
	ldp	w12, w11, [x11]
	sub	w10, w10, w12
	sdiv	w2, w10, w11
	tbz	w2, #31, LBB0_2
LBB0_4:
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	w0, #0
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Mismatch with calibration\n"

	.no_dead_strip	_palmas_gpadc_get_calibrated_code
.subsections_via_symbols
