	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function at91_adc_touch_pressure
_at91_adc_touch_pressure:               ## @at91_adc_touch_pressure
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_AT91_SAMA5D2_PRESSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_at91_adc_readl
	movq	_AT91_SAMA5D2_XYZ_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%edx, %ecx
	andl	%eax, %ecx
	je	LBB0_1
## %bb.2:
	sarl	$16, %eax
	andl	%edx, %eax
	imull	$1000, (%rbx), %edx             ## imm = 0x3E8
	leal	1023(%rdx), %esi
	testl	%edx, %edx
	cmovnsl	%edx, %esi
	sarl	$10, %esi
	imull	$1000, %eax, %eax               ## imm = 0x3E8
	cltd
	idivl	%ecx
	addl	$-1000, %eax                    ## imm = 0xFC18
	imull	%esi, %eax
	cltq
	imulq	$-274877907, %rax, %rax         ## imm = 0xEF9DB22D
	movq	%rax, %rcx
	sarq	$38, %rcx
	shrq	$63, %rax
	addl	%ecx, %eax
	addl	$65535, %eax                    ## imm = 0xFFFF
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AT91_SAMA5D2_PRESSR,4,2        ## @AT91_SAMA5D2_PRESSR
	.comm	_AT91_SAMA5D2_XYZ_MASK,4,2      ## @AT91_SAMA5D2_XYZ_MASK
	.no_dead_strip	_at91_adc_touch_pressure
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function at91_adc_touch_pressure
_at91_adc_touch_pressure:               ; @at91_adc_touch_pressure
	.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	x19, x0
Lloh0:
	adrp	x8, _AT91_SAMA5D2_PRESSR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AT91_SAMA5D2_PRESSR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_at91_adc_readl
Lloh3:
	adrp	x8, _AT91_SAMA5D2_XYZ_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AT91_SAMA5D2_XYZ_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x8]
	ands	w8, w9, w0
	b.eq	LBB0_2
; %bb.1:
	and	w9, w9, w0, asr #16
	ldr	w10, [x19]
	mov	w11, #1000
	mul	w10, w10, w11
	add	w12, w10, #1023
	cmp	w10, #0
	csel	w10, w12, w10, lt
	asr	w10, w10, #10
	mul	w9, w9, w11
	sdiv	w8, w9, w8
	sub	w8, w8, #1000
	mul	w8, w10, w8
	mov	w9, #45613
	movk	w9, #61341, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	mov	w10, #65535
	add	w8, w8, w9
	add	w0, w8, w10
	b	LBB0_3
LBB0_2:
	mov	w0, #0
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AT91_SAMA5D2_PRESSR,4,2        ; @AT91_SAMA5D2_PRESSR
	.comm	_AT91_SAMA5D2_XYZ_MASK,4,2      ; @AT91_SAMA5D2_XYZ_MASK
	.no_dead_strip	_at91_adc_touch_pressure
.subsections_via_symbols
