	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function at91_adc_configure_touch
_at91_adc_configure_touch:              ## @at91_adc_configure_touch
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	movslq	(%r14), %rax
	imulq	$274877907, %rax, %r12          ## imm = 0x10624DD3
	movq	%r12, %rax
	shrq	$63, %rax
	sarq	$38, %r12
	addl	%eax, %r12d
	movq	_AT91_SAMA5D2_TOUCH_PEN_DETECT_DEBOUNCE_US@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%r12d, %eax
	cltq
	imulq	$274877907, %rax, %rdi          ## imm = 0x10624DD3
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$38, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$1, %esi
	callq	_round_up
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %ecx
	leal	1(%rcx), %ebx
	movl	%eax, %edx
                                        ## kill: def $cl killed $cl killed $rcx
	sarl	%cl, %edx
	testl	%edx, %edx
	jne	LBB0_3
## %bb.4:
	movq	_AT91_SAMA5D2_TSMR_TSMODE_4WIRE_PRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	$2, %edi
	callq	_AT91_SAMA5D2_TSMR_TSAV
	movq	_AT91_SAMA5D2_TSMR_TSAV_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	orl	%eax, %r15d
	movl	%ebx, %edi
	callq	_AT91_SAMA5D2_TSMR_PENDBC
	movq	_AT91_SAMA5D2_TSMR_PENDBC_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	orl	%eax, %r15d
	movq	_AT91_SAMA5D2_TSMR_NOTSDMA@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_AT91_SAMA5D2_TSMR_PENDET_ENA@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movl	$2, %edi
	callq	_AT91_SAMA5D2_TSMR_TSFREQ
	movq	_AT91_SAMA5D2_TSMR_TSFREQ_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	orl	%eax, %r15d
	movq	_AT91_SAMA5D2_TSMR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_at91_adc_writel
	movq	_AT91_SAMA5D2_ACR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_at91_adc_readl
	movq	_AT91_SAMA5D2_ACR_PENDETSENS_MASK@GOTPCREL(%rip), %rcx
	movl	%eax, %edx
	xorl	$2, %edx
	andl	(%rcx), %edx
	xorl	%eax, %edx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_at91_adc_writel
	movq	_AT91_SAMA5D2_TOUCH_SAMPLE_PERIOD_US@GOTPCREL(%rip), %rax
	imull	(%rax), %r12d
	movslq	%r12d, %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	sarq	$38, %rcx
	shrq	$63, %rax
	leal	(%rcx,%rax), %edi
	decl	%edi
	movl	$1, %esi
	callq	_round_up
	movq	%rax, 8(%r14)
	movq	_AT91_SAMA5D2_IER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AT91_SAMA5D2_IER_PEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	jmp	LBB0_5
LBB0_1:
	movq	_AT91_SAMA5D2_IDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AT91_SAMA5D2_IER_PEN@GOTPCREL(%rip), %rax
	movq	_AT91_SAMA5D2_IER_NOPEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_at91_adc_writel
	movq	_AT91_SAMA5D2_TSMR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
LBB0_5:
	callq	_at91_adc_writel
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AT91_SAMA5D2_IDR,4,2           ## @AT91_SAMA5D2_IDR
	.comm	_AT91_SAMA5D2_IER_PEN,4,2       ## @AT91_SAMA5D2_IER_PEN
	.comm	_AT91_SAMA5D2_IER_NOPEN,4,2     ## @AT91_SAMA5D2_IER_NOPEN
	.comm	_AT91_SAMA5D2_TSMR,4,2          ## @AT91_SAMA5D2_TSMR
	.comm	_AT91_SAMA5D2_TOUCH_PEN_DETECT_DEBOUNCE_US,4,2 ## @AT91_SAMA5D2_TOUCH_PEN_DETECT_DEBOUNCE_US
	.comm	_AT91_SAMA5D2_TSMR_TSMODE_4WIRE_PRESS,4,2 ## @AT91_SAMA5D2_TSMR_TSMODE_4WIRE_PRESS
	.comm	_AT91_SAMA5D2_TSMR_TSAV_MASK,4,2 ## @AT91_SAMA5D2_TSMR_TSAV_MASK
	.comm	_AT91_SAMA5D2_TSMR_PENDBC_MASK,4,2 ## @AT91_SAMA5D2_TSMR_PENDBC_MASK
	.comm	_AT91_SAMA5D2_TSMR_NOTSDMA,4,2  ## @AT91_SAMA5D2_TSMR_NOTSDMA
	.comm	_AT91_SAMA5D2_TSMR_PENDET_ENA,4,2 ## @AT91_SAMA5D2_TSMR_PENDET_ENA
	.comm	_AT91_SAMA5D2_TSMR_TSFREQ_MASK,4,2 ## @AT91_SAMA5D2_TSMR_TSFREQ_MASK
	.comm	_AT91_SAMA5D2_ACR,4,2           ## @AT91_SAMA5D2_ACR
	.comm	_AT91_SAMA5D2_ACR_PENDETSENS_MASK,4,2 ## @AT91_SAMA5D2_ACR_PENDETSENS_MASK
	.comm	_AT91_SAMA5D2_TOUCH_SAMPLE_PERIOD_US,4,2 ## @AT91_SAMA5D2_TOUCH_SAMPLE_PERIOD_US
	.comm	_AT91_SAMA5D2_IER,4,2           ## @AT91_SAMA5D2_IER
	.no_dead_strip	_at91_adc_configure_touch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function at91_adc_configure_touch
_at91_adc_configure_touch:              ; @at91_adc_configure_touch
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	cbz	w1, LBB0_2
; %bb.1:
	ldrsw	x8, [x19]
	mov	w21, #19923
	movk	w21, #4194, lsl #16
	mul	x8, x8, x21
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w22, w8, w9
Lloh0:
	adrp	x8, _AT91_SAMA5D2_TOUCH_PEN_DETECT_DEBOUNCE_US@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AT91_SAMA5D2_TOUCH_PEN_DETECT_DEBOUNCE_US@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mul	w8, w8, w22
	smull	x8, w8, w21
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w0, w8, w9
	mov	w1, #1
	bl	_round_up
	clz	w8, w0
	mov	w9, #33
	sub	w20, w9, w8
Lloh3:
	adrp	x8, _AT91_SAMA5D2_TSMR_TSMODE_4WIRE_PRESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AT91_SAMA5D2_TSMR_TSMODE_4WIRE_PRESS@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
	mov	w0, #2
	bl	_AT91_SAMA5D2_TSMR_TSAV
Lloh6:
	adrp	x8, _AT91_SAMA5D2_TSMR_TSAV_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AT91_SAMA5D2_TSMR_TSAV_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	and	w8, w8, w0
	orr	w23, w8, w23
	mov	x0, x20
	bl	_AT91_SAMA5D2_TSMR_PENDBC
Lloh9:
	adrp	x8, _AT91_SAMA5D2_TSMR_PENDBC_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AT91_SAMA5D2_TSMR_PENDBC_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w8, w8, w0
	orr	w8, w23, w8
Lloh12:
	adrp	x9, _AT91_SAMA5D2_TSMR_NOTSDMA@GOTPAGE
Lloh13:
	ldr	x9, [x9, _AT91_SAMA5D2_TSMR_NOTSDMA@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh15:
	adrp	x9, _AT91_SAMA5D2_TSMR_PENDET_ENA@GOTPAGE
Lloh16:
	ldr	x9, [x9, _AT91_SAMA5D2_TSMR_PENDET_ENA@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w20, w8, w9
	mov	w0, #2
	bl	_AT91_SAMA5D2_TSMR_TSFREQ
Lloh18:
	adrp	x8, _AT91_SAMA5D2_TSMR_TSFREQ_MASK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AT91_SAMA5D2_TSMR_TSFREQ_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	and	w8, w8, w0
	orr	w2, w20, w8
Lloh21:
	adrp	x8, _AT91_SAMA5D2_TSMR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AT91_SAMA5D2_TSMR@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_at91_adc_writel
Lloh24:
	adrp	x20, _AT91_SAMA5D2_ACR@GOTPAGE
Lloh25:
	ldr	x20, [x20, _AT91_SAMA5D2_ACR@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_at91_adc_readl
Lloh26:
	adrp	x8, _AT91_SAMA5D2_ACR_PENDETSENS_MASK@GOTPAGE
Lloh27:
	ldr	x8, [x8, _AT91_SAMA5D2_ACR_PENDETSENS_MASK@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	bic	w9, w0, w8
	and	w8, w8, #0x2
	orr	w2, w9, w8
	ldr	w1, [x20]
	mov	x0, x19
	bl	_at91_adc_writel
Lloh29:
	adrp	x8, _AT91_SAMA5D2_TOUCH_SAMPLE_PERIOD_US@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AT91_SAMA5D2_TOUCH_SAMPLE_PERIOD_US@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	mul	w8, w8, w22
	smull	x8, w8, w21
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	sub	w0, w8, #1
	mov	w1, #1
	bl	_round_up
	str	x0, [x19, #8]
Lloh32:
	adrp	x8, _AT91_SAMA5D2_IER@GOTPAGE
Lloh33:
	ldr	x8, [x8, _AT91_SAMA5D2_IER@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
Lloh35:
	adrp	x8, _AT91_SAMA5D2_IER_PEN@GOTPAGE
Lloh36:
	ldr	x8, [x8, _AT91_SAMA5D2_IER_PEN@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	mov	x0, x19
	b	LBB0_3
LBB0_2:
Lloh38:
	adrp	x8, _AT91_SAMA5D2_IDR@GOTPAGE
Lloh39:
	ldr	x8, [x8, _AT91_SAMA5D2_IDR@GOTPAGEOFF]
Lloh40:
	adrp	x9, _AT91_SAMA5D2_IER_PEN@GOTPAGE
Lloh41:
	ldr	x9, [x9, _AT91_SAMA5D2_IER_PEN@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
Lloh43:
	ldr	w8, [x9]
Lloh44:
	adrp	x9, _AT91_SAMA5D2_IER_NOPEN@GOTPAGE
Lloh45:
	ldr	x9, [x9, _AT91_SAMA5D2_IER_NOPEN@GOTPAGEOFF]
Lloh46:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_at91_adc_writel
Lloh47:
	adrp	x8, _AT91_SAMA5D2_TSMR@GOTPAGE
Lloh48:
	ldr	x8, [x8, _AT91_SAMA5D2_TSMR@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
LBB0_3:
	bl	_at91_adc_writel
	mov	w0, #0
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_AT91_SAMA5D2_IDR,4,2           ; @AT91_SAMA5D2_IDR
	.comm	_AT91_SAMA5D2_IER_PEN,4,2       ; @AT91_SAMA5D2_IER_PEN
	.comm	_AT91_SAMA5D2_IER_NOPEN,4,2     ; @AT91_SAMA5D2_IER_NOPEN
	.comm	_AT91_SAMA5D2_TSMR,4,2          ; @AT91_SAMA5D2_TSMR
	.comm	_AT91_SAMA5D2_TOUCH_PEN_DETECT_DEBOUNCE_US,4,2 ; @AT91_SAMA5D2_TOUCH_PEN_DETECT_DEBOUNCE_US
	.comm	_AT91_SAMA5D2_TSMR_TSMODE_4WIRE_PRESS,4,2 ; @AT91_SAMA5D2_TSMR_TSMODE_4WIRE_PRESS
	.comm	_AT91_SAMA5D2_TSMR_TSAV_MASK,4,2 ; @AT91_SAMA5D2_TSMR_TSAV_MASK
	.comm	_AT91_SAMA5D2_TSMR_PENDBC_MASK,4,2 ; @AT91_SAMA5D2_TSMR_PENDBC_MASK
	.comm	_AT91_SAMA5D2_TSMR_NOTSDMA,4,2  ; @AT91_SAMA5D2_TSMR_NOTSDMA
	.comm	_AT91_SAMA5D2_TSMR_PENDET_ENA,4,2 ; @AT91_SAMA5D2_TSMR_PENDET_ENA
	.comm	_AT91_SAMA5D2_TSMR_TSFREQ_MASK,4,2 ; @AT91_SAMA5D2_TSMR_TSFREQ_MASK
	.comm	_AT91_SAMA5D2_ACR,4,2           ; @AT91_SAMA5D2_ACR
	.comm	_AT91_SAMA5D2_ACR_PENDETSENS_MASK,4,2 ; @AT91_SAMA5D2_ACR_PENDETSENS_MASK
	.comm	_AT91_SAMA5D2_TOUCH_SAMPLE_PERIOD_US,4,2 ; @AT91_SAMA5D2_TOUCH_SAMPLE_PERIOD_US
	.comm	_AT91_SAMA5D2_IER,4,2           ; @AT91_SAMA5D2_IER
	.no_dead_strip	_at91_adc_configure_touch
.subsections_via_symbols
