	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function at91_ts_sample
_at91_ts_sample:                        ## @at91_ts_sample
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_iio_priv_to_dev
	movq	%rax, %r12
	movb	(%r14), %cl
	movl	$-1, %ebx
	shll	%cl, %ebx
	notl	%ebx
	movq	_AT91_ADC_TSXPOSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_at91_adc_readl
	movl	%eax, %r13d
	shrl	$16, %r13d
	andl	%ebx, %r13d
	je	LBB0_1
## %bb.3:
	movl	%eax, %r15d
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	andl	%ebx, %r15d
	movq	_MAX_POS_BITS@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r15d, %eax
	shll	%cl, %eax
	subl	%r15d, %eax
	xorl	%edx, %edx
	divl	%r13d
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_AT91_ADC_TSYPOSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_at91_adc_readl
	movq	%r14, %rdi
	movl	%eax, %r14d
	shrl	$16, %r14d
	andl	%ebx, %r14d
	je	LBB0_4
## %bb.5:
	movl	%eax, %r12d
	andl	%ebx, %r12d
	movq	_MAX_POS_BITS@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r12d, %eax
	shll	%cl, %eax
	subl	%r12d, %eax
	xorl	%edx, %edx
	divl	%r14d
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	_AT91_ADC_TSPRESSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_at91_adc_readl
	movl	%eax, %r10d
	movl	%eax, %r11d
	shrl	$16, %r11d
	andl	%ebx, %r11d
	andl	%ebx, %r10d
	je	LBB0_7
## %bb.6:
	imull	$1000, -44(%rbp), %ecx          ## 4-byte Folded Reload
                                        ## imm = 0x3E8
	shrl	$10, %ecx
	imull	$1000, %r11d, %eax              ## imm = 0x3E8
	xorl	%edx, %edx
	divl	%r10d
                                        ## kill: def $eax killed $eax def $rax
	addl	$-1000, %eax                    ## imm = 0xFC18
	imull	%ecx, %eax
	imulq	$274877907, %rax, %rbx          ## imm = 0x10624DD3
	shrq	$38, %rbx
	jmp	LBB0_8
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
LBB0_2:
	callq	_dev_err
	movl	$-1, %ebx
	jmp	LBB0_11
LBB0_7:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %ebx
LBB0_8:
	subq	$8, %rsp
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	movl	%r13d, %ecx
	movl	%r12d, %r8d
	movl	%r14d, %r9d
	xorl	%eax, %eax
	pushq	%rbx
	pushq	%r11
	pushq	%r10
	callq	_dev_dbg
	addq	$32, %rsp
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	cmpl	4(%r14), %ebx
	jae	LBB0_10
## %bb.9:
	movl	%ebx, %eax
	imulq	$274877907, %rax, %r8           ## imm = 0x10624DD3
	shrq	$38, %r8
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %r13
	xorl	%ebx, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edx
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %ecx
                                        ## kill: def $r8d killed $r8d killed $r8
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	8(%r14), %edi
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edx
	callq	_input_report_abs
	movl	8(%r14), %edi
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edx
	callq	_input_report_abs
	movl	8(%r14), %edi
	movq	_ABS_PRESSURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edx
	callq	_input_report_abs
	movl	8(%r14), %edi
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_input_report_key
	movl	8(%r14), %edi
	callq	_input_sync
	jmp	LBB0_11
LBB0_10:
	leaq	L_.str.4(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_dbg
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AT91_ADC_TSXPOSR,4,2           ## @AT91_ADC_TSXPOSR
	.comm	_MAX_POS_BITS,4,2               ## @MAX_POS_BITS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error: xscale == 0!\n"

	.comm	_AT91_ADC_TSYPOSR,4,2           ## @AT91_ADC_TSYPOSR
L_.str.1:                               ## @.str.1
	.asciz	"Error: yscale == 0!\n"

	.comm	_AT91_ADC_TSPRESSR,4,2          ## @AT91_ADC_TSPRESSR
L_.str.2:                               ## @.str.2
	.asciz	"xpos = %d, xscale = %d, ypos = %d, yscale = %d, z1 = %d, z2 = %d, press = %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"x = %d, y = %d, pressure = %d\n"

	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_ABS_Y,4,2                      ## @ABS_Y
	.comm	_ABS_PRESSURE,4,2               ## @ABS_PRESSURE
	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
L_.str.4:                               ## @.str.4
	.asciz	"pressure too low: not reporting\n"

	.no_dead_strip	_at91_ts_sample
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function at91_ts_sample
_at91_ts_sample:                        ; @at91_ts_sample
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_iio_priv_to_dev
	mov	x20, x0
	ldr	w8, [x19]
	mov	w9, #-1
	lsl	w25, w9, w8
	mvn	w22, w25
Lloh0:
	adrp	x8, _AT91_ADC_TSXPOSR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AT91_ADC_TSXPOSR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_at91_adc_readl
	ands	w24, w22, w0, lsr #16
	b.eq	LBB0_4
; %bb.1:
	mov	x21, x0
Lloh3:
	adrp	x26, _MAX_POS_BITS@GOTPAGE
Lloh4:
	ldr	x26, [x26, _MAX_POS_BITS@GOTPAGEOFF]
	ldr	w28, [x26]
Lloh5:
	adrp	x8, _AT91_ADC_TSYPOSR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AT91_ADC_TSYPOSR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_at91_adc_readl
	ands	w23, w22, w0, lsr #16
	b.eq	LBB0_5
; %bb.2:
	bic	w27, w21, w25
	lsl	w8, w27, w28
	sub	w8, w8, w27
	and	w25, w0, w22
	ldr	w26, [x26]
Lloh8:
	adrp	x9, _AT91_ADC_TSPRESSR@GOTPAGE
Lloh9:
	ldr	x9, [x9, _AT91_ADC_TSPRESSR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x9]
	udiv	w21, w8, w24
	mov	x0, x19
	bl	_at91_adc_readl
	and	w9, w22, w0, lsr #16
	ands	w8, w0, w22
	b.eq	LBB0_7
; %bb.3:
	mov	w10, #1000
	mul	w11, w21, w10
	lsr	w11, w11, #10
	mul	w10, w9, w10
	udiv	w10, w10, w8
	sub	w10, w10, #1000
	mul	w10, w10, w11
	mov	w11, #19923
	movk	w11, #4194, lsl #16
	umull	x10, w10, w11
	lsr	x22, x10, #38
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	b	LBB0_8
LBB0_4:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	x0, x20
	bl	_dev_err
	mov	w0, #-1
	b	LBB0_12
LBB0_7:
	ldr	w22, [x19, #4]
LBB0_8:
	stp	x9, x22, [sp, #40]
	stp	x23, x8, [sp, #24]
	stp	x24, x25, [sp, #8]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	str	x27, [sp]
	mov	x0, x20
	bl	_dev_dbg
	ldr	w8, [x19, #4]
	cmp	w22, w8
	b.hs	LBB0_10
; %bb.9:
	lsl	w8, w25, w26
	sub	w8, w8, w25
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	umull	x9, w22, w9
	lsr	x9, x9, #38
	udiv	w23, w8, w23
	stp	x21, x23, [sp]
	str	x9, [sp, #16]
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	ldr	w0, [x19, #8]
Lloh19:
	adrp	x8, _ABS_X@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ABS_X@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x2, x21
	bl	_input_report_abs
	ldr	w0, [x19, #8]
Lloh22:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x2, x23
	bl	_input_report_abs
	ldr	w0, [x19, #8]
Lloh25:
	adrp	x8, _ABS_PRESSURE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ABS_PRESSURE@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x2, x22
	bl	_input_report_abs
	ldr	w0, [x19, #8]
Lloh28:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh29:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_input_report_key
	ldr	w0, [x19, #8]
	bl	_input_sync
	b	LBB0_11
LBB0_10:
Lloh31:
	adrp	x1, l_.str.4@PAGE
Lloh32:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
LBB0_11:
	mov	w0, #0
LBB0_12:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_AT91_ADC_TSXPOSR,4,2           ; @AT91_ADC_TSXPOSR
	.comm	_MAX_POS_BITS,4,2               ; @MAX_POS_BITS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error: xscale == 0!\n"

	.comm	_AT91_ADC_TSYPOSR,4,2           ; @AT91_ADC_TSYPOSR
l_.str.1:                               ; @.str.1
	.asciz	"Error: yscale == 0!\n"

	.comm	_AT91_ADC_TSPRESSR,4,2          ; @AT91_ADC_TSPRESSR
l_.str.2:                               ; @.str.2
	.asciz	"xpos = %d, xscale = %d, ypos = %d, yscale = %d, z1 = %d, z2 = %d, press = %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"x = %d, y = %d, pressure = %d\n"

	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_ABS_Y,4,2                      ; @ABS_Y
	.comm	_ABS_PRESSURE,4,2               ; @ABS_PRESSURE
	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
l_.str.4:                               ; @.str.4
	.asciz	"pressure too low: not reporting\n"

	.no_dead_strip	_at91_ts_sample
.subsections_via_symbols
