	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ads7846_read_state
_ads7846_read_state:                    ## @ads7846_read_state
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	48(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	-44(%rbp), %r14
	xorl	%r15d, %r15d
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movslq	%r15d, %r13
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	(%r12), %r15d
	jge	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=2
	xorl	%eax, %eax
	callq	*40(%r12)
	leaq	(,%r13,4), %rbx
	addq	32(%r12), %rbx
	movq	24(%r12), %rdi
	movq	%rbx, %rsi
	callq	_spi_sync
	testl	%eax, %eax
	jne	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=2
	movl	(%r12), %eax
	decl	%eax
	cmpl	%eax, %r15d
	jge	LBB0_13
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=2
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_ads7846_get_value
	movl	%eax, -44(%rbp)
	movl	16(%r12), %edi
	movl	%r15d, %esi
	movq	%r14, %rdx
	callq	*8(%r12)
	cmpl	$128, %eax
	je	LBB0_2
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=2
	cmpl	$129, %eax
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=2
	cmpl	$130, %eax
	je	LBB0_10
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=2
	xorl	%eax, %eax
	callq	_BUG
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	incl	%r15d
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	-44(%rbp), %esi
	movq	%rbx, %rdi
	callq	_ads7846_update_value
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	incl	%r15d
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	movl	(%r12), %r15d
	decl	%r15d
	jmp	LBB0_1
LBB0_4:
	movq	24(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
LBB0_5:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"spi_sync --> %d\n"

	.no_dead_strip	_ads7846_read_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ads7846_read_state
_ads7846_read_state:                    ; @ads7846_read_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	w8, #0
	ldr	x22, [x0, #48]
	mov	w23, #1
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
	sxtw	x20, w8
LBB0_2:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x19]
	cmp	w20, w8
	b.ge	LBB0_13
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=2
	ldr	x8, [x19, #40]
	blr	x8
	ldp	x0, x8, [x19, #24]
	add	x21, x8, x20, lsl #2
	mov	x1, x21
	bl	_spi_sync
	cbnz	w0, LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=2
	ldr	w8, [x19]
	sub	w8, w8, #1
	cmp	w20, w8
	b.ge	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=2
	mov	x0, x19
	mov	x1, x21
	bl	_ads7846_get_value
	str	w0, [sp, #12]
	ldr	x8, [x19, #8]
	ldr	w0, [x19, #16]
	add	x2, sp, #12
	mov	x1, x20
	blr	x8
	cmp	w0, #128
	b.eq	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=2
	cmp	w0, #129
	b.eq	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=2
	cmp	w0, #130
	b.eq	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=2
	bl	_BUG
	b	LBB0_2
LBB0_9:                                 ;   in Loop: Header=BB0_1 Depth=1
	add	w8, w20, #1
	b	LBB0_1
LBB0_10:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w1, [sp, #12]
	mov	x0, x21
	bl	_ads7846_update_value
	str	wzr, [x22]
	add	w8, w20, #1
	b	LBB0_1
LBB0_11:                                ;   in Loop: Header=BB0_1 Depth=1
	str	w23, [x22]
	ldr	w8, [x19]
	sub	w8, w8, #1
	b	LBB0_1
LBB0_12:
	mov	x2, x0
	ldr	x0, [x19, #24]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	w8, #1
	str	w8, [x22]
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"spi_sync --> %d\n"

	.no_dead_strip	_ads7846_read_state
.subsections_via_symbols
