	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ads7846_setup_spi_msg
_ads7846_setup_spi_msg:                 ## @ads7846_setup_spi_msg
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	24(%rdi), %r14
	cmpl	$7873, (%rdi)                   ## imm = 0x1EC1
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	jne	LBB0_1
## %bb.2:
	movl	$7846, (%rdi)                   ## imm = 0x1EA6
	movq	%rdi, %rbx
	xorl	%r13d, %r13d
	jmp	LBB0_3
LBB0_1:
	movq	%rdi, %rbx
	movl	(%rsi), %r13d
LBB0_3:
	movq	16(%rbx), %r12
	movq	8(%rbx), %r15
	movl	$1, 4(%rbx)
	movq	%r14, %rdi
	callq	_spi_message_init
	movq	%rbx, (%r14)
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %ebx
	movl	%r13d, -64(%rbp)                ## 4-byte Spill
	movl	%r13d, %edi
	callq	_READ_Y
	cmpl	$7845, %ebx                     ## imm = 0x1EA5
	jne	LBB0_5
## %bb.4:
	movq	104(%r15), %rcx
	movq	%rax, (%rcx)
	movq	104(%r15), %rax
	movq	$0, 8(%rax)
	movq	104(%r15), %rax
	movq	$0, 16(%rax)
	movq	104(%r15), %rax
	movq	%rax, 16(%r12)
	movq	56(%r15), %rax
	movq	%rax, 8(%r12)
	movl	$3, (%r12)
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_spi_message_add_tail
	jmp	LBB0_6
LBB0_5:
	leaq	96(%r15), %rcx
	movq	%rax, 96(%r15)
	movq	%rcx, 16(%r12)
	movl	$1, (%r12)
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_spi_message_add_tail
	leaq	32(%r12), %rbx
	leaq	48(%r15), %rax
	movq	%rax, 40(%r12)
	movl	$2, 32(%r12)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_spi_message_add_tail
	movq	%rbx, %r12
LBB0_6:
	movq	%r14, %rbx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	testq	%rax, %rax
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_8
## %bb.7:
	movq	%rax, 24(%r12)
	leaq	32(%r12), %rdi
	leaq	96(%r15), %rax
	movq	%rax, 48(%r12)
	movl	$1, 32(%r12)
	movq	%rbx, %rsi
	callq	_spi_message_add_tail
	leaq	64(%r12), %r14
	leaq	48(%r15), %rax
	movq	%rax, 72(%r12)
	movl	$2, 64(%r12)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_spi_message_add_tail
	movq	%r14, %r12
LBB0_8:
	incl	4(%r13)
	leaq	8(%rbx), %r15
	movq	%r15, %rdi
	callq	_spi_message_init
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, 8(%rbx)
	movl	(%r13), %ebx
	leaq	32(%r12), %r14
	movl	-64(%rbp), %edi                 ## 4-byte Reload
	callq	_READ_X
	cmpl	$7845, %ebx                     ## imm = 0x1EA5
	jne	LBB0_10
## %bb.9:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	88(%rdx), %rcx
	movq	%rax, (%rcx)
	movq	88(%rdx), %rax
	movq	$0, 8(%rax)
	movq	88(%rdx), %rax
	movq	$0, 16(%rax)
	movq	88(%rdx), %rax
	movq	%rax, 48(%r12)
	movq	40(%rdx), %rax
	movl	$3, %ecx
	movl	$1, %edx
	jmp	LBB0_11
LBB0_10:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	leaq	80(%rbx), %rcx
	movq	%rax, 80(%rbx)
	movq	%rcx, 48(%r12)
	movl	$1, 32(%r12)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_spi_message_add_tail
	leaq	64(%r12), %r14
	leaq	32(%rbx), %rax
	movl	$2, %ecx
	movl	$2, %edx
LBB0_11:
	shlq	$5, %rdx
	movq	%rax, 8(%r12,%rdx)
	movl	%ecx, (%r14)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_spi_message_add_tail
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	%rax, 24(%r14)
	leaq	32(%r14), %rdi
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	leaq	80(%r12), %rax
	movq	%rax, 48(%r14)
	movl	$1, 32(%r14)
	movq	%r15, %rsi
	callq	_spi_message_add_tail
	leaq	64(%r14), %rbx
	leaq	32(%r12), %rax
	movq	%rax, 72(%r14)
	movl	$2, 64(%r14)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_spi_message_add_tail
	movq	%rbx, %r14
LBB0_13:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	$1, %r12d
	cmpl	$7846, (%r13)                   ## imm = 0x1EA6
	jne	LBB0_19
## %bb.14:
	incl	4(%r13)
	leaq	16(%rbx), %r12
	movq	%r12, %rdi
	callq	_spi_message_init
	movq	%r13, 16(%rbx)
	leaq	32(%r14), %r15
	movl	-64(%rbp), %edi                 ## 4-byte Reload
	callq	_READ_Z1
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	leaq	72(%rbx), %rcx
	movq	%rax, 72(%rbx)
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%rcx, 48(%r14)
	movl	$1, 32(%r14)
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_spi_message_add_tail
	leaq	64(%r14), %r15
	addq	$28, %rbx
	movq	%rbx, 72(%r14)
	movl	$2, 64(%r14)
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_spi_message_add_tail
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	%rax, 88(%r14)
	leaq	96(%r14), %rdi
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 112(%r14)
	movl	$1, 96(%r14)
	movq	%r12, %rsi
	callq	_spi_message_add_tail
	leaq	128(%r14), %r15
	movq	%rbx, 136(%r14)
	movl	$2, 128(%r14)
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_spi_message_add_tail
LBB0_16:
	incl	4(%r13)
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	leaq	24(%rbx), %r12
	movq	%r12, %rdi
	callq	_spi_message_init
	movq	%r13, 24(%rbx)
	leaq	32(%r15), %r14
	movl	-64(%rbp), %edi                 ## 4-byte Reload
	callq	_READ_Z2
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	leaq	64(%rbx), %rcx
	movq	%rax, 64(%rbx)
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, 48(%r15)
	movl	$1, 32(%r15)
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_spi_message_add_tail
	leaq	64(%r15), %r14
	leaq	24(%rbx), %rax
	movq	%r12, %rbx
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, 72(%r15)
	movl	$2, 64(%r15)
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_spi_message_add_tail
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	$3, %r12d
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	movq	%rax, 88(%r15)
	leaq	96(%r15), %rdi
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 112(%r15)
	movl	$1, 96(%r15)
	movq	%rbx, %rsi
	callq	_spi_message_add_tail
	leaq	128(%r15), %r14
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 136(%r15)
	movl	$2, 128(%r15)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_spi_message_add_tail
LBB0_18:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_19:
	incl	4(%r13)
	leaq	(%rbx,%r12,8), %r15
	addq	$8, %r15
	movq	%r15, %rdi
	callq	_spi_message_init
	movq	%r13, 8(%rbx,%r12,8)
	leaq	32(%r14), %rbx
	cmpl	$7845, (%r13)                   ## imm = 0x1EA5
	movq	_PWRDOWN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jne	LBB0_21
## %bb.20:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	16(%rdx), %rcx
	movq	%rax, (%rcx)
	movq	16(%rdx), %rax
	movq	$0, 8(%rax)
	movq	16(%rdx), %rax
	movq	$0, 16(%rax)
	movq	16(%rdx), %rax
	movq	%rax, 48(%r14)
	movl	$3, %eax
	jmp	LBB0_22
LBB0_21:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	leaq	8(%r12), %rcx
	movq	%rax, 8(%r12)
	movq	%rcx, 48(%r14)
	movl	$1, 32(%r14)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_spi_message_add_tail
	movq	%r12, 72(%r14)
	addq	$64, %r14
	movl	$2, %eax
	movq	%r14, %rbx
LBB0_22:
	movl	%eax, (%rbx)
	movups	(%rbx), %xmm0
	movups	16(%rbx), %xmm1
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	_CS_CHANGE
	movq	%rbx, %rdi
	movq	%r15, %rsi
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spi_message_add_tail           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PWRDOWN,8,3                    ## @PWRDOWN
	.no_dead_strip	_ads7846_setup_spi_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ads7846_setup_spi_msg
_ads7846_setup_spi_msg:                 ; @ads7846_setup_spi_msg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x21, x1
	mov	x19, x0
	ldp	x24, x20, [x0, #16]
	ldr	x26, [x0, #8]
	ldr	w8, [x0]
	mov	w9, #7873
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	mov	w22, #0
	mov	w8, #7846
	str	w8, [x19]
	b	LBB0_3
LBB0_2:
	ldr	w22, [x21]
LBB0_3:
	mov	w23, #1
	str	w23, [x19, #4]
	mov	x0, x20
	bl	_spi_message_init
	str	x19, [x20]
	ldr	w25, [x19]
	mov	x0, x22
	bl	_READ_Y
	mov	w8, #7845
	cmp	w25, w8
	b.ne	LBB0_5
; %bb.4:
	ldr	x8, [x26, #104]
	str	x0, [x8]
	ldr	x8, [x26, #104]
	str	xzr, [x8, #8]
	ldr	x8, [x26, #104]
	str	xzr, [x8, #16]
	ldr	x8, [x26, #104]
	str	x8, [x24, #16]
	ldr	x8, [x26, #56]
	str	x8, [x24, #8]
	mov	w8, #3
	str	w8, [x24]
	b	LBB0_6
LBB0_5:
	mov	x25, x26
	str	x0, [x25, #96]!
	str	x25, [x24, #16]
	str	w23, [x24]
	mov	x0, x24
	mov	x1, x20
	bl	_spi_message_add_tail
	mov	w8, #2
	str	w8, [x24, #32]!
	sub	x8, x25, #48
	str	x8, [x24, #8]
LBB0_6:
	mov	x0, x24
	mov	x1, x20
	bl	_spi_message_add_tail
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_8
; %bb.7:
	str	x8, [x24, #24]
	add	x8, x26, #96
	str	x8, [x24, #48]
	mov	w8, #1
	mov	x0, x24
	str	w8, [x0, #32]!
	mov	x1, x20
	bl	_spi_message_add_tail
	mov	w8, #2
	str	w8, [x24, #64]!
	add	x8, x26, #48
	str	x8, [x24, #8]
	mov	x0, x24
	mov	x1, x20
	bl	_spi_message_add_tail
LBB0_8:
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
	add	x25, x20, #8
	mov	x0, x25
	bl	_spi_message_init
	str	x19, [x20, #8]
	ldr	w27, [x19]
	add	x23, x24, #32
	mov	x0, x22
	bl	_READ_X
	mov	w8, #7845
	cmp	w27, w8
	b.ne	LBB0_10
; %bb.9:
	ldr	x8, [x26, #88]
	str	x0, [x8]
	ldr	x8, [x26, #88]
	str	xzr, [x8, #8]
	ldr	x8, [x26, #88]
	str	xzr, [x8, #16]
	ldr	x8, [x26, #88]
	str	x8, [x24, #48]
	ldr	x8, [x26, #40]
	mov	w10, #3
	mov	w9, #1
	b	LBB0_11
LBB0_10:
	mov	x27, x26
	str	x0, [x27, #80]!
	str	x27, [x24, #48]
	mov	w8, #1
	str	w8, [x24, #32]
	mov	x0, x23
	mov	x1, x25
	bl	_spi_message_add_tail
	add	x23, x24, #64
	sub	x8, x27, #48
	mov	w9, #2
	mov	w10, #2
LBB0_11:
	add	x9, x24, x9, lsl #5
	str	x8, [x9, #8]
	str	w10, [x23]
	mov	x0, x23
	mov	x1, x25
	bl	_spi_message_add_tail
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_13
; %bb.12:
	str	x8, [x23, #24]
	add	x8, x26, #80
	str	x8, [x23, #48]
	mov	w8, #1
	mov	x0, x23
	str	w8, [x0, #32]!
	mov	x1, x25
	bl	_spi_message_add_tail
	mov	w8, #2
	str	w8, [x23, #64]!
	add	x8, x26, #32
	str	x8, [x23, #8]
	mov	x0, x23
	mov	x1, x25
	bl	_spi_message_add_tail
LBB0_13:
	ldr	w8, [x19]
	mov	w27, #1
	mov	w9, #7846
	cmp	w8, w9
	b.ne	LBB0_20
; %bb.14:
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
	add	x25, x20, #16
	mov	x0, x25
	bl	_spi_message_init
	str	x19, [x20, #16]
	str	w22, [sp, #12]                  ; 4-byte Folded Spill
	mov	x0, x22
	bl	_READ_Z1
	mov	x28, x26
	str	x0, [x28, #72]!
	str	x28, [x23, #48]
	mov	x0, x23
	str	w27, [x0, #32]!
	mov	x1, x25
	bl	_spi_message_add_tail
	mov	w22, #2
	mov	x24, x23
	str	w22, [x24, #64]!
	sub	x27, x28, #44
	str	x27, [x24, #8]
	mov	x0, x24
	mov	x1, x25
	bl	_spi_message_add_tail
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_16
; %bb.15:
	str	x8, [x23, #88]
	str	x28, [x23, #112]
	mov	w8, #1
	mov	x0, x23
	str	w8, [x0, #96]!
	mov	x1, x25
	bl	_spi_message_add_tail
	str	w22, [x23, #128]!
	str	x27, [x23, #8]
	mov	x0, x23
	mov	x1, x25
	bl	_spi_message_add_tail
	mov	x24, x23
	b	LBB0_17
LBB0_16:
	mov	x23, x24
LBB0_17:
	mov	w28, #2
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
	add	x25, x20, #24
	mov	x0, x25
	bl	_spi_message_init
	str	x19, [x20, #24]
	ldr	w0, [sp, #12]                   ; 4-byte Folded Reload
	bl	_READ_Z2
	mov	x22, x26
	str	x0, [x22, #64]!
	str	x22, [x24, #48]
	mov	w27, #1
	mov	x0, x24
	str	w27, [x0, #32]!
	mov	x1, x25
	bl	_spi_message_add_tail
	str	w28, [x23, #64]!
	sub	x28, x22, #40
	str	x28, [x23, #8]
	mov	x0, x23
	mov	x1, x25
	bl	_spi_message_add_tail
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_19
; %bb.18:
	str	x8, [x24, #88]
	str	x22, [x24, #112]
	mov	x0, x24
	str	w27, [x0, #96]!
	mov	x1, x25
	bl	_spi_message_add_tail
	mov	w8, #2
	str	w8, [x24, #128]!
	str	x28, [x24, #8]
	mov	x0, x24
	mov	x1, x25
	bl	_spi_message_add_tail
	mov	w27, #3
	mov	x23, x24
	b	LBB0_20
LBB0_19:
	mov	w27, #3
LBB0_20:
	add	x21, x20, x27, lsl #3
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
	add	x20, x21, #8
	mov	x0, x20
	bl	_spi_message_init
	str	x19, [x21, #8]
	ldr	w9, [x19]
	add	x19, x23, #32
Lloh0:
	adrp	x8, _PWRDOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PWRDOWN@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	mov	w10, #7845
	cmp	w9, w10
	b.ne	LBB0_22
; %bb.21:
	ldr	x9, [x26, #16]
	str	x8, [x9]
	ldr	x8, [x26, #16]
	str	xzr, [x8, #8]
	ldr	x8, [x26, #16]
	str	xzr, [x8, #16]
	ldr	x8, [x26, #16]
	str	x8, [x23, #48]
	mov	w8, #3
	b	LBB0_23
LBB0_22:
	mov	x9, x26
	str	x8, [x9, #8]!
	str	x9, [x23, #48]
	mov	w8, #1
	str	w8, [x23, #32]
	mov	x0, x19
	mov	x1, x20
	bl	_spi_message_add_tail
	add	x19, x23, #64
	str	x26, [x23, #72]
	mov	w8, #2
LBB0_23:
	str	w8, [x19]
	ldp	q0, q1, [x19]
	stp	q0, q1, [sp, #16]
	add	x0, sp, #16
	bl	_CS_CHANGE
	mov	x0, x19
	mov	x1, x20
	bl	_spi_message_add_tail
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PWRDOWN,8,3                    ; @PWRDOWN
	.no_dead_strip	_ads7846_setup_spi_msg
.subsections_via_symbols
