	.file	"extr_ads7846.c_ads7846_setup_spi_msg.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ads7846_setup_spi_msg, @function
ads7846_setup_spi_msg:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	cmp	DWORD PTR [rdi], 7873
	mov	r12, QWORD PTR 24[rdi]
	mov	r13, QWORD PTR 16[rdi]
	mov	rbx, QWORD PTR 8[rdi]
	mov	QWORD PTR 16[rsp], rsi
	je	.L2
	mov	eax, DWORD PTR [rsi]
	mov	DWORD PTR 8[rsp], eax
.L3:
	mov	DWORD PTR 4[r14], 1
	mov	rdi, r12
	lea	rbp, 32[r13]
	call	spi_message_init@PLT
	cmp	DWORD PTR [r14], 7845
	mov	QWORD PTR [r12], r14
	je	.L26
	mov	edi, DWORD PTR 8[rsp]
	lea	r15, 64[r13]
	call	READ_Y@PLT
	mov	rsi, r12
	mov	rdi, r13
	mov	QWORD PTR 96[rbx], rax
	lea	rax, 96[rbx]
	mov	QWORD PTR 16[r13], rax
	mov	DWORD PTR 0[r13], 1
	call	spi_message_add_tail@PLT
	lea	rax, 48[rbx]
	mov	rsi, r12
	mov	rdi, rbp
	mov	QWORD PTR 40[r13], rax
	mov	DWORD PTR 32[r13], 2
	call	spi_message_add_tail@PLT
	mov	rax, QWORD PTR 16[rsp]
	mov	rax, QWORD PTR 8[rax]
	test	rax, rax
	jne	.L27
.L6:
	add	DWORD PTR 4[r14], 1
	lea	r13, 8[r12]
	mov	rdi, r13
	call	spi_message_init@PLT
	cmp	DWORD PTR [r14], 7845
	mov	QWORD PTR 8[r12], r14
	je	.L28
	mov	edi, DWORD PTR 8[rsp]
	call	READ_X@PLT
	mov	rdi, r15
	mov	rsi, r13
	lea	r15, 64[rbp]
	mov	QWORD PTR 80[rbx], rax
	lea	rax, 80[rbx]
	mov	QWORD PTR 48[rbp], rax
	mov	DWORD PTR 32[rbp], 1
	call	spi_message_add_tail@PLT
	lea	rax, 32[rbx]
	mov	rsi, r13
	mov	rdi, r15
	mov	QWORD PTR 72[rbp], rax
	mov	DWORD PTR 64[rbp], 2
	call	spi_message_add_tail@PLT
.L8:
	mov	rax, QWORD PTR 16[rsp]
	lea	r8, 32[r15]
	mov	rax, QWORD PTR 8[rax]
	test	rax, rax
	jne	.L29
	mov	eax, DWORD PTR 4[r14]
	add	eax, 1
	cmp	DWORD PTR [r14], 7846
	je	.L30
.L10:
	mov	DWORD PTR 4[r14], eax
	lea	rbp, 8[r13]
	mov	rdi, rbp
	mov	QWORD PTR 8[rsp], r8
	call	spi_message_init@PLT
	cmp	DWORD PTR [r14], 7845
	mov	QWORD PTR 8[r13], r14
	mov	r8, QWORD PTR 8[rsp]
	jne	.L13
	mov	rax, QWORD PTR 16[rbx]
	mov	rdx, QWORD PTR PWRDOWN[rip]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR 16[rbx]
	mov	QWORD PTR 8[rax], 0
	mov	rax, QWORD PTR 16[rbx]
	mov	QWORD PTR 16[rax], 0
	mov	rax, QWORD PTR 16[rbx]
	mov	DWORD PTR 32[r15], 3
	mov	QWORD PTR 48[r15], rax
.L14:
	push	QWORD PTR 24[r8]
	.cfi_def_cfa_offset 120
	push	QWORD PTR 16[r8]
	.cfi_def_cfa_offset 128
	push	QWORD PTR 8[r8]
	.cfi_def_cfa_offset 136
	push	QWORD PTR [r8]
	.cfi_def_cfa_offset 144
	mov	QWORD PTR 40[rsp], r8
	call	CS_CHANGE@PLT
	mov	r8, QWORD PTR 40[rsp]
	add	rsp, 88
	.cfi_def_cfa_offset 56
	mov	rsi, rbp
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	mov	rdi, r8
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	spi_message_add_tail@PLT
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_def_cfa_offset 112
	mov	rax, QWORD PTR PWRDOWN[rip]
	mov	rdi, r8
	mov	rsi, rbp
	mov	QWORD PTR 8[rbx], rax
	lea	rax, 8[rbx]
	mov	QWORD PTR 48[r15], rax
	mov	DWORD PTR 32[r15], 1
	call	spi_message_add_tail@PLT
	mov	QWORD PTR 72[r15], rbx
	lea	r8, 64[r15]
	mov	DWORD PTR 64[r15], 2
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L28:
	mov	rcx, QWORD PTR 88[rbx]
	mov	edi, DWORD PTR 8[rsp]
	mov	QWORD PTR 24[rsp], rcx
	call	READ_X@PLT
	mov	rcx, QWORD PTR 24[rsp]
	mov	rsi, r13
	mov	rdi, r15
	mov	QWORD PTR [rcx], rax
	mov	rax, QWORD PTR 88[rbx]
	mov	QWORD PTR 8[rax], 0
	mov	rax, QWORD PTR 88[rbx]
	mov	QWORD PTR 16[rax], 0
	mov	rax, QWORD PTR 88[rbx]
	mov	QWORD PTR 48[rbp], rax
	mov	rax, QWORD PTR 40[rbx]
	mov	DWORD PTR 32[rbp], 3
	mov	QWORD PTR 40[rbp], rax
	call	spi_message_add_tail@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L26:
	mov	edi, DWORD PTR 8[rsp]
	mov	r15, QWORD PTR 104[rbx]
	call	READ_Y@PLT
	mov	rsi, r12
	mov	rdi, r13
	mov	QWORD PTR [r15], rax
	mov	rax, QWORD PTR 104[rbx]
	mov	r15, rbp
	mov	rbp, r13
	mov	QWORD PTR 8[rax], 0
	mov	rax, QWORD PTR 104[rbx]
	mov	QWORD PTR 16[rax], 0
	mov	rax, QWORD PTR 104[rbx]
	mov	QWORD PTR 16[r13], rax
	mov	rax, QWORD PTR 56[rbx]
	mov	DWORD PTR 0[r13], 3
	mov	QWORD PTR 8[r13], rax
	call	spi_message_add_tail@PLT
	mov	rax, QWORD PTR 16[rsp]
	mov	rax, QWORD PTR 8[rax]
	test	rax, rax
	je	.L6
.L27:
	mov	QWORD PTR 24[rbp], rax
	lea	rax, 96[rbx]
	mov	rdi, r15
	mov	rsi, r12
	mov	QWORD PTR 48[rbp], rax
	lea	r13, 64[rbp]
	lea	r15, 96[rbp]
	mov	DWORD PTR 32[rbp], 1
	call	spi_message_add_tail@PLT
	lea	rax, 48[rbx]
	mov	rsi, r12
	mov	rdi, r13
	mov	QWORD PTR 72[rbp], rax
	mov	DWORD PTR 64[rbp], 2
	mov	rbp, r13
	call	spi_message_add_tail@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	mov	DWORD PTR [rdi], 7846
	mov	DWORD PTR 8[rsp], 0
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L29:
	mov	QWORD PTR 24[r15], rax
	lea	rax, 80[rbx]
	mov	rdi, r8
	mov	rsi, r13
	mov	QWORD PTR 48[r15], rax
	lea	rbp, 64[r15]
	mov	DWORD PTR 32[r15], 1
	call	spi_message_add_tail@PLT
	lea	rax, 32[rbx]
	mov	rsi, r13
	mov	rdi, rbp
	mov	QWORD PTR 72[r15], rax
	mov	DWORD PTR 64[r15], 2
	call	spi_message_add_tail@PLT
	mov	eax, DWORD PTR 4[r14]
	lea	r8, 96[r15]
	mov	r15, rbp
	add	eax, 1
	cmp	DWORD PTR [r14], 7846
	jne	.L10
.L30:
	mov	DWORD PTR 4[r14], eax
	lea	r13, 16[r12]
	lea	rbp, 64[r15]
	mov	rdi, r13
	mov	QWORD PTR 24[rsp], r8
	call	spi_message_init@PLT
	mov	QWORD PTR 16[r12], r14
	mov	edi, DWORD PTR 8[rsp]
	call	READ_Z1@PLT
	lea	rcx, 72[rbx]
	mov	r8, QWORD PTR 24[rsp]
	mov	rsi, r13
	mov	QWORD PTR 72[rbx], rax
	mov	QWORD PTR 48[r15], rcx
	mov	rdi, r8
	mov	DWORD PTR 32[r15], 1
	mov	QWORD PTR 32[rsp], rcx
	call	spi_message_add_tail@PLT
	lea	rax, 28[rbx]
	mov	rsi, r13
	mov	rdi, rbp
	mov	QWORD PTR 72[r15], rax
	mov	DWORD PTR 64[r15], 2
	mov	QWORD PTR 40[rsp], rax
	call	spi_message_add_tail@PLT
	mov	rax, QWORD PTR 16[rsp]
	mov	rcx, QWORD PTR 32[rsp]
	lea	rdx, 128[r15]
	mov	QWORD PTR 24[rsp], rdx
	mov	rax, QWORD PTR 8[rax]
	test	rax, rax
	jne	.L31
.L11:
	add	DWORD PTR 4[r14], 1
	lea	r13, 24[r12]
	lea	r15, 64[rbx]
	mov	rdi, r13
	call	spi_message_init@PLT
	mov	QWORD PTR 24[r12], r14
	mov	edi, DWORD PTR 8[rsp]
	lea	r12, 24[rbx]
	call	READ_Z2@PLT
	lea	rdi, 32[rbp]
	mov	rsi, r13
	mov	QWORD PTR 64[rbx], rax
	mov	QWORD PTR 48[rbp], r15
	mov	DWORD PTR 32[rbp], 1
	call	spi_message_add_tail@PLT
	mov	QWORD PTR 72[rbp], r12
	mov	rdi, QWORD PTR 24[rsp]
	mov	rsi, r13
	mov	DWORD PTR 64[rbp], 2
	call	spi_message_add_tail@PLT
	mov	rax, QWORD PTR 16[rsp]
	mov	rax, QWORD PTR 8[rax]
	test	rax, rax
	jne	.L12
	mov	eax, DWORD PTR 4[r14]
	mov	r15, QWORD PTR 24[rsp]
	add	eax, 1
	lea	r8, 32[r15]
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	mov	QWORD PTR 112[rbp], r15
	lea	rdi, 96[rbp]
	mov	rsi, r13
	lea	r15, 128[rbp]
	mov	QWORD PTR 88[rbp], rax
	mov	DWORD PTR 96[rbp], 1
	call	spi_message_add_tail@PLT
	mov	QWORD PTR 136[rbp], r12
	mov	rsi, r13
	mov	rdi, r15
	mov	DWORD PTR 128[rbp], 2
	call	spi_message_add_tail@PLT
	mov	eax, DWORD PTR 4[r14]
	lea	r8, 160[rbp]
	add	eax, 1
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L31:
	mov	QWORD PTR 112[r15], rcx
	lea	rdi, 96[r15]
	mov	rsi, r13
	lea	rbp, 128[r15]
	mov	QWORD PTR 88[r15], rax
	mov	DWORD PTR 96[r15], 1
	call	spi_message_add_tail@PLT
	mov	rax, QWORD PTR 40[rsp]
	mov	rsi, r13
	mov	rdi, rbp
	mov	DWORD PTR 128[r15], 2
	mov	QWORD PTR 136[r15], rax
	call	spi_message_add_tail@PLT
	lea	rax, 192[r15]
	mov	QWORD PTR 24[rsp], rax
	jmp	.L11
	.cfi_endproc
.LFE0:
	.size	ads7846_setup_spi_msg, .-ads7846_setup_spi_msg
	.comm	PWRDOWN,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_ads7846.c_ads7846_setup_spi_msg.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ads7846_setup_spi_msg, %function
ads7846_setup_spi_msg:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	mov	r5, #1
	ldr	r2, [r0]
	ldr	r3, .L32
	ldr	r7, [r0, #16]
	cmp	r2, r3
	moveq	fp, #0
	ldreq	r3, .L32+4
	ldr	r9, [r0, #12]
	streq	r3, [r0]
	ldrne	fp, [r1]
	ldr	r6, [r0, #8]
	sub	sp, sp, #12
	mov	r0, r7
	str	r5, [r4, #4]
	mov	r10, r1
	bl	spi_message_init
	ldr	r2, [r4]
	ldr	r3, .L32+8
	mov	r0, fp
	cmp	r2, r3
	str	r4, [r7]
	add	r8, r9, #16
	beq	.L26
	bl	READ_Y
	mov	r3, r6
	str	r0, [r3, #52]!
	mov	r1, r7
	str	r3, [r9, #8]
	str	r5, [r9]
	mov	r0, r9
	bl	spi_message_add_tail
	mov	r2, #2
	add	r3, r6, #28
	str	r3, [r9, #20]
	mov	r1, r7
	mov	r0, r8
	str	r2, [r9, #16]
	bl	spi_message_add_tail
	ldr	r3, [r10, #4]
	add	r5, r9, #32
	cmp	r3, #0
	bne	.L27
.L6:
	ldr	r3, [r4, #4]
	add	r9, r7, #4
	add	r3, r3, #1
	str	r3, [r4, #4]
	mov	r0, r9
	bl	spi_message_init
	ldr	r2, [r4]
	ldr	r3, .L32+8
	mov	r0, fp
	cmp	r2, r3
	str	r4, [r7, #4]
	beq	.L28
	bl	READ_X
	mov	r3, r6
	mov	r2, #1
	str	r0, [r3, #44]!
	str	r3, [r8, #24]
	str	r2, [r8, #16]
	mov	r0, r5
	mov	r1, r9
	bl	spi_message_add_tail
	mov	r2, #2
	add	r3, r6, #20
	add	r5, r8, #32
	str	r3, [r8, #36]
	str	r2, [r8, #32]
	mov	r0, r5
	mov	r1, r9
	bl	spi_message_add_tail
	ldr	r3, [r10, #4]
	add	r8, r5, #16
	cmp	r3, #0
	bne	.L29
.L9:
	ldm	r4, {r1, r2}
	ldr	r3, .L32+4
	add	r2, r2, #1
	cmp	r1, r3
	beq	.L30
.L10:
	add	r7, r9, #4
	str	r2, [r4, #4]
	mov	r0, r7
	bl	spi_message_init
	ldr	r2, [r4]
	ldr	r3, .L32+8
	str	r4, [r9, #4]
	cmp	r2, r3
	bne	.L13
	mov	r3, #0
	mov	r2, #3
	ldr	r0, .L32+12
	ldr	r1, [r6, #8]
	ldr	r0, [r0]
	str	r0, [r1]
	ldr	r1, [r6, #8]
	str	r3, [r1, #4]
	ldr	r1, [r6, #8]
	str	r3, [r1, #8]
	ldr	r3, [r6, #8]
	str	r2, [r5, #16]
	str	r3, [r5, #24]
.L14:
	ldm	r8, {r0, r1, r2, r3}
	bl	CS_CHANGE
	mov	r1, r7
	mov	r0, r8
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	spi_message_add_tail
.L13:
	mov	r3, r6
	mov	r2, #1
	ldr	r1, .L32+12
	mov	r0, r8
	ldr	r1, [r1]
	add	r8, r5, #32
	str	r1, [r3, #4]!
	str	r3, [r5, #24]
	mov	r1, r7
	str	r2, [r5, #16]
	bl	spi_message_add_tail
	mov	r3, #2
	str	r6, [r5, #36]
	str	r3, [r5, #32]
	b	.L14
.L28:
	ldr	r1, [r6, #48]
	str	r1, [sp]
	bl	READ_X
	mov	r3, #0
	mov	r2, #3
	ldr	r1, [sp]
	str	r0, [r1]
	ldr	r1, [r6, #48]
	mov	r0, r5
	str	r3, [r1, #4]
	ldr	r1, [r6, #48]
	str	r3, [r1, #8]
	ldr	r1, [r6, #48]
	ldr	r3, [r6, #24]
	str	r1, [r8, #24]
	str	r3, [r8, #20]
	str	r2, [r8, #16]
	mov	r1, r9
	bl	spi_message_add_tail
	ldr	r3, [r10, #4]
	add	r8, r5, #16
	cmp	r3, #0
	beq	.L9
.L29:
	mov	r1, #1
	add	r2, r6, #44
	str	r3, [r5, #12]
	str	r1, [r5, #16]
	str	r2, [r5, #24]
	mov	r0, r8
	mov	r1, r9
	bl	spi_message_add_tail
	mov	r1, #2
	add	r3, r5, #32
	add	r2, r6, #20
	str	r1, [r5, #32]
	mov	r0, r3
	str	r2, [r5, #36]
	mov	r1, r9
	str	r3, [sp]
	bl	spi_message_add_tail
	ldr	r3, [sp]
	add	r8, r5, #48
	mov	r5, r3
	b	.L9
.L26:
	ldr	r5, [r6, #56]
	bl	READ_Y
	mov	r3, #0
	mov	r2, #3
	str	r0, [r5]
	ldr	r1, [r6, #56]
	mov	r0, r9
	str	r3, [r1, #4]
	ldr	r1, [r6, #56]
	mov	r5, r8
	str	r3, [r1, #8]
	ldr	r1, [r6, #56]
	ldr	r3, [r6, #32]
	str	r1, [r9, #8]
	stm	r9, {r2, r3}
	mov	r1, r7
	bl	spi_message_add_tail
	ldr	r3, [r10, #4]
	mov	r8, r9
	cmp	r3, #0
	beq	.L6
.L27:
	mov	r1, #1
	add	r2, r6, #52
	str	r3, [r8, #12]
	str	r1, [r8, #16]
	str	r2, [r8, #24]
	mov	r0, r5
	mov	r1, r7
	bl	spi_message_add_tail
	mov	r2, #2
	add	r9, r8, #32
	add	r3, r6, #28
	str	r2, [r8, #32]
	str	r3, [r8, #36]
	mov	r0, r9
	mov	r1, r7
	add	r5, r8, #48
	bl	spi_message_add_tail
	mov	r8, r9
	b	.L6
.L30:
	add	r9, r7, #8
	str	r2, [r4, #4]
	mov	r0, r9
	bl	spi_message_init
	mov	r0, fp
	str	r4, [r7, #8]
	bl	READ_Z1
	mov	r3, r6
	mov	r2, #1
	str	r0, [r3, #40]!
	mov	r1, r9
	mov	r0, r8
	str	r3, [r5, #24]
	str	r3, [sp, #4]
	str	r2, [r5, #16]
	add	r3, r6, #16
	str	r3, [sp]
	bl	spi_message_add_tail
	mov	r2, #2
	add	r3, r6, #16
	add	r8, r5, #32
	str	r2, [r5, #32]
	str	r3, [r5, #36]
	mov	r1, r9
	mov	r0, r8
	bl	spi_message_add_tail
	ldr	ip, [r10, #4]
	add	r3, r5, #64
	cmp	ip, #0
	str	r3, [sp]
	mov	r2, #1
	ldr	r3, [sp, #4]
	bne	.L31
.L11:
	ldr	r2, [r4, #4]
	add	r9, r7, #12
	add	r2, r2, #1
	str	r2, [r4, #4]
	mov	r0, r9
	bl	spi_message_init
	mov	r0, fp
	str	r4, [r7, #12]
	bl	READ_Z2
	mov	r5, r6
	mov	r2, r8
	mov	fp, #1
	mov	r7, #2
	str	r0, [r5, #36]!
	str	r5, [r8, #24]
	str	fp, [r2, #16]!
	mov	r0, r2
	add	r3, r6, #12
	mov	r1, r9
	str	r3, [sp, #4]
	bl	spi_message_add_tail
	add	r3, r6, #12
	mov	r1, r9
	ldr	r0, [sp]
	str	r7, [r8, #32]
	str	r3, [r8, #36]
	bl	spi_message_add_tail
	ldr	r2, [r10, #4]
	cmp	r2, #0
	bne	.L12
	ldr	r2, [r4, #4]
	ldr	r5, [sp]
	add	r2, r2, fp
	add	r8, r5, #16
	b	.L10
.L12:
	mov	r0, r8
	str	r2, [r8, #44]
	str	r5, [r8, #56]
	mov	r1, r9
	str	fp, [r0, #48]!
	bl	spi_message_add_tail
	add	r5, r8, #64
	add	r3, r6, #12
	str	r3, [r8, #68]
	str	r7, [r8, #64]
	mov	r0, r5
	mov	r1, r9
	bl	spi_message_add_tail
	ldr	r2, [r4, #4]
	add	r8, r8, #80
	add	r2, r2, #1
	b	.L10
.L31:
	mov	r0, r5
	str	ip, [r5, #44]
	str	r3, [r5, #56]
	mov	r1, r9
	str	r2, [r0, #48]!
	bl	spi_message_add_tail
	add	r3, r6, #16
	str	r3, [r5, #68]
	mov	r3, #2
	add	r8, r5, #64
	str	r3, [r5, #64]
	mov	r1, r9
	mov	r0, r8
	bl	spi_message_add_tail
	add	r3, r5, #96
	str	r3, [sp]
	b	.L11
.L33:
	.align	2
.L32:
	.word	7873
	.word	7846
	.word	7845
	.word	PWRDOWN
	.size	ads7846_setup_spi_msg, .-ads7846_setup_spi_msg
	.comm	PWRDOWN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
