	.file	"extr_corgi_ts.c_sync_receive_data_send_cmd.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sync_receive_data_send_cmd, @function
sync_receive_data_send_cmd:
.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
	mov	r13d, ecx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, r8
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, edx
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	test	r8, r8
	setne	dl
	test	ebx, ebx
	setne	al
	and	dl, al
	mov	r15d, edx
	jne	.L20
	test	esi, esi
	jne	.L6
	test	ebx, ebx
	jne	.L13
	xor	r12d, r12d
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	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
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	xor	eax, eax
	call	corgi_ssp_ads7846_get@PLT
	mov	r12d, eax
	test	ebx, ebx
	je	.L1
	mov	ecx, DWORD PTR ADSCTRL_ADR_SH[rip]
	mov	eax, DWORD PTR ADSCTRL_PD0[rip]
	or	eax, DWORD PTR ADSCTRL_PD1[rip]
	or	eax, DWORD PTR ADSCTRL_STS[rip]
	sal	r13d, cl
	or	r13d, eax
	mov	edi, r13d
	call	corgi_ssp_ads7846_put@PLT
	xor	eax, eax
	call	corgi_ssp_ads7846_get@PLT
	test	r15b, r15b
	jne	.L12
.L8:
	mov	edi, r13d
	call	corgi_ssp_ads7846_put@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	xor	edi, edi
	call	PMNC_GET@PLT
	mov	edi, 1
	call	PMNC_SET@PLT
	mov	rdx, QWORD PTR [r14]
	xor	eax, eax
	call	[QWORD PTR [rdx]]
	xor	edi, edi
	call	CCNT@PLT
	test	r12d, r12d
	jne	.L6
	mov	ecx, DWORD PTR ADSCTRL_ADR_SH[rip]
	mov	eax, DWORD PTR ADSCTRL_PD1[rip]
	xor	r12d, r12d
	or	eax, DWORD PTR ADSCTRL_PD0[rip]
	or	eax, DWORD PTR ADSCTRL_STS[rip]
	sal	r13d, cl
	or	r13d, eax
	mov	edi, r13d
	call	corgi_ssp_ads7846_put@PLT
	xor	eax, eax
	call	corgi_ssp_ads7846_get@PLT
.L12:
	xor	edi, edi
	mov	QWORD PTR 8[rsp], rdi
	call	CCNT@PLT
	mov	rdi, QWORD PTR 8[rsp]
	cmp	rbp, rdi
	jnb	.L9
	mov	rdx, QWORD PTR [r14]
	xor	eax, eax
	call	[QWORD PTR [rdx]]
	xor	edi, edi
	call	CCNT@PLT
	xor	edi, edi
	call	CCNT@PLT
.L9:
	test	rbp, rbp
	je	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	xor	edi, edi
	call	CCNT@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	mov	edi, r13d
	call	corgi_ssp_ads7846_put@PLT
	xor	edi, edi
	call	PMNC_SET@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	ecx, DWORD PTR ADSCTRL_ADR_SH[rip]
	mov	eax, DWORD PTR ADSCTRL_PD0[rip]
	xor	r12d, r12d
	or	eax, DWORD PTR ADSCTRL_PD1[rip]
	or	eax, DWORD PTR ADSCTRL_STS[rip]
	sal	r13d, cl
	or	r13d, eax
	mov	edi, r13d
	call	corgi_ssp_ads7846_put@PLT
	xor	eax, eax
	call	corgi_ssp_ads7846_get@PLT
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	sync_receive_data_send_cmd, .-sync_receive_data_send_cmd
	.comm	ADSCTRL_STS,4,4
	.comm	ADSCTRL_PD1,4,4
	.comm	ADSCTRL_PD0,4,4
	.comm	ADSCTRL_ADR_SH,4,4
	.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_corgi_ts.c_sync_receive_data_send_cmd.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sync_receive_data_send_cmd, %function
sync_receive_data_send_cmd:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r9, [sp, #32]
	subs	r6, r2, #0
	movne	r6, #1
	cmp	r9, #0
	moveq	r6, #0
	cmp	r6, #0
	mov	r7, r0
	mov	r5, r1
	mov	r8, r3
	mov	r4, r2
	bne	.L20
	cmp	r1, #0
	bne	.L6
	cmp	r2, #0
	bne	.L13
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L6:
	bl	corgi_ssp_ads7846_get
	cmp	r4, #0
	mov	r4, r0
	beq	.L1
	ldr	r3, .L22
	ldr	r2, .L22+4
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, .L22+8
	orr	r3, r3, r2
	ldr	r2, .L22+12
	ldr	r1, [r1]
	ldr	r2, [r2]
	orr	r3, r3, r1
	orr	r8, r3, r8, lsl r2
	mov	r0, r8
	bl	corgi_ssp_ads7846_put
	bl	corgi_ssp_ads7846_get
	cmp	r6, #0
	bne	.L12
.L8:
	mov	r0, r8
	bl	corgi_ssp_ads7846_put
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L20:
	mov	r0, #0
	bl	PMNC_GET
	mov	r0, #1
	bl	PMNC_SET
	ldr	r3, [r7]
	ldr	r3, [r3]
	blx	r3
	mov	r0, #0
	bl	CCNT
	cmp	r5, #0
	bne	.L6
	ldr	r3, .L22+4
	ldr	r2, .L22
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, .L22+8
	orr	r3, r3, r2
	ldr	r2, .L22+12
	ldr	r1, [r1]
	ldr	r2, [r2]
	orr	r3, r3, r1
	orr	r8, r3, r8, lsl r2
	mov	r0, r8
	mov	r4, r5
	bl	corgi_ssp_ads7846_put
	bl	corgi_ssp_ads7846_get
.L12:
	mov	r5, #0
	mov	r0, r5
	bl	CCNT
	cmp	r9, r5
	bcc	.L21
.L9:
	cmp	r9, #0
	beq	.L10
.L11:
	mov	r0, #0
	bl	CCNT
	b	.L11
.L21:
	ldr	r3, [r7]
	ldr	r3, [r3]
	blx	r3
	mov	r0, r5
	bl	CCNT
	mov	r0, r5
	bl	CCNT
	b	.L9
.L10:
	mov	r0, r8
	bl	corgi_ssp_ads7846_put
	mov	r0, #0
	bl	PMNC_SET
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	ldr	r2, .L22+4
	ldr	r3, .L22
	ldr	r1, .L22+8
	ldr	r0, [r2]
	ldr	r3, [r3]
	ldr	r2, .L22+12
	ldr	r1, [r1]
	ldr	r2, [r2]
	orr	r3, r3, r0
	orr	r3, r3, r1
	orr	r8, r3, r8, lsl r2
	mov	r0, r8
	mov	r4, r5
	bl	corgi_ssp_ads7846_put
	bl	corgi_ssp_ads7846_get
	b	.L8
.L23:
	.align	2
.L22:
	.word	ADSCTRL_PD0
	.word	ADSCTRL_PD1
	.word	ADSCTRL_STS
	.word	ADSCTRL_ADR_SH
	.size	sync_receive_data_send_cmd, .-sync_receive_data_send_cmd
	.comm	ADSCTRL_STS,4,4
	.comm	ADSCTRL_PD1,4,4
	.comm	ADSCTRL_PD0,4,4
	.comm	ADSCTRL_ADR_SH,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
