	.file	"extr_cyapa.c_cyapa_poll_thread.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"cyapw"
.LC1:
	.string	"cyapa: power idle\n"
.LC2:
	.string	"cyapa: power full\n"
	.text
	.p2align 4
	.type	cyapa_poll_thread, @function
cyapa_poll_thread:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	mov	ebp, 129
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	edi, DWORD PTR 20[rdi]
	mov	ebx, DWORD PTR cyapa_norm_freq[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR ticks[rip]
	mov	DWORD PTR 12[rsp], eax
	call	device_get_parent@PLT
	mov	rdi, r15
	mov	r12d, eax
	call	cyapa_lock@PLT
	mov	r13d, DWORD PTR 24[r15]
	lea	rax, 20[rsp]
	mov	DWORD PTR [r15], 1
	mov	QWORD PTR [rsp], rax
	test	r13d, r13d
	je	.L2
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L24:
	mov	ebx, DWORD PTR cyapa_idle_freq[rip]
	mov	r14d, 129
.L9:
	cmp	r14d, ebp
	je	.L11
	mov	esi, r14d
	mov	rdi, r15
	mov	ebp, r14d
	call	cyapa_set_power_mode@PLT
	cmp	QWORD PTR cyapa_debug[rip], 0
	je	.L11
	cmp	r14d, 130
	je	.L12
	lea	rdi, .LC1[rip]
	mov	ebp, 129
	call	printf@PLT
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rdi, r15
	call	cyapa_lock@PLT
	mov	eax, DWORD PTR 24[r15]
	test	eax, eax
	jne	.L13
.L2:
	mov	rdi, r15
	call	cyapa_unlock@PLT
	mov	esi, DWORD PTR 20[r15]
	mov	edx, DWORD PTR IIC_WAIT[rip]
	mov	edi, r12d
	call	iicbus_request_bus@PLT
	test	eax, eax
	je	.L23
.L3:
	mov	eax, DWORD PTR hz[rip]
	lea	rdi, .LC0[rip]
	cdq
	idiv	ebx
	mov	esi, eax
	call	pause@PLT
	add	DWORD PTR 16[r15], 1
	cmp	QWORD PTR 8[r15], 0
	je	.L24
	test	r13d, r13d
	je	.L10
	mov	ebx, DWORD PTR cyapa_slow_freq[rip]
	mov	r14d, 129
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L23:
	mov	edi, DWORD PTR 20[r15]
	mov	rdx, QWORD PTR [rsp]
	mov	ecx, 4
	mov	esi, DWORD PTR CMD_DEV_STATUS[rip]
	call	cyapa_read_bytes@PLT
	test	eax, eax
	je	.L25
.L4:
	cmp	QWORD PTR cyapa_reset[rip], 0
	jne	.L26
	mov	eax, DWORD PTR 20[rsp]
	test	DWORD PTR CYAPA_STAT_RUNNING[rip], eax
	jne	.L7
	mov	eax, DWORD PTR ticks[rip]
	mov	edx, eax
	sub	edx, DWORD PTR 12[rsp]
	cmp	edx, DWORD PTR TIME_TO_RESET[rip]
	jbe	.L7
	mov	DWORD PTR 12[rsp], eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L26:
	mov	eax, DWORD PTR ticks[rip]
	mov	DWORD PTR 12[rsp], eax
.L6:
	mov	edi, DWORD PTR 20[r15]
	mov	edx, 2
	xor	esi, esi
	mov	QWORD PTR cyapa_reset[rip], 0
	call	init_device@PLT
.L7:
	mov	esi, DWORD PTR 20[r15]
	mov	edi, r12d
	call	iicbus_release_bus@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L10:
	mov	ebx, DWORD PTR cyapa_norm_freq[rip]
	mov	r14d, 130
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L13:
	mov	DWORD PTR [r15], 0
	mov	rdi, r15
	call	cyapa_unlock@PLT
	xor	eax, eax
	call	kthread_exit@PLT
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L27
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L25:
	.cfi_restore_state
	mov	rsi, QWORD PTR [rsp]
	mov	edx, ebx
	mov	rdi, r15
	call	cyapa_raw_input@PLT
	mov	r13d, eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	lea	rdi, .LC2[rip]
	call	printf@PLT
	jmp	.L11
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	cyapa_poll_thread, .-cyapa_poll_thread
	.comm	ticks,4,4
	.comm	hz,4,4
	.comm	cyapa_slow_freq,4,4
	.comm	cyapa_reset,8,8
	.comm	cyapa_norm_freq,4,4
	.comm	cyapa_idle_freq,4,4
	.comm	cyapa_debug,8,8
	.comm	TIME_TO_RESET,4,4
	.comm	IIC_WAIT,4,4
	.comm	CYAPA_STAT_RUNNING,4,4
	.comm	CMD_DEV_STATUS,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_cyapa.c_cyapa_poll_thread.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"cyapw\000"
	.align	2
.LC1:
	.ascii	"cyapa: power idle\012\000"
	.align	2
.LC2:
	.ascii	"cyapa: power full\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cyapa_poll_thread, %function
cyapa_poll_thread:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L27
	sub	sp, sp, #28
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	ldr	r3, .L27+4
	mov	r4, r0
	ldr	r5, [r3]
	ldr	r3, .L27+8
	ldr	r0, [r0, #12]
	ldr	r3, [r3]
	str	r3, [sp, #12]
	bl	device_get_parent
	mov	r6, r0
	mov	r0, r4
	bl	cyapa_lock
	mov	r3, #1
	ldr	r2, [r4, #16]
	str	r3, [r4]
	cmp	r2, #0
	str	r2, [sp, #8]
	bne	.L13
	mov	r7, #129
	ldr	r10, .L27+12
	ldr	r9, .L27+16
	ldr	fp, .L27+20
	ldr	r8, .L27+24
	b	.L2
.L23:
	mov	r1, #129
	ldr	r3, .L27+28
	ldr	r5, [r3]
.L9:
	cmp	r1, r7
	beq	.L11
	mov	r0, r4
	str	r1, [sp, #4]
	bl	cyapa_set_power_mode
	ldr	r3, .L27+32
	ldr	r1, [sp, #4]
	ldr	r3, [r3]
	cmp	r3, #0
	moveq	r7, r1
	beq	.L11
	cmp	r1, #130
	beq	.L12
	ldr	r0, .L27+36
	bl	printf
	mov	r7, #129
.L11:
	mov	r0, r4
	bl	cyapa_lock
	ldr	r3, [r4, #16]
	cmp	r3, #0
	bne	.L13
.L2:
	mov	r0, r4
	bl	cyapa_unlock
	mov	r0, r6
	ldr	r2, [r10]
	ldr	r1, [r4, #12]
	bl	iicbus_request_bus
	cmp	r0, #0
	beq	.L22
.L3:
	mov	r1, r5
	ldr	r0, [r9]
	bl	__aeabi_idiv
	mov	r1, r0
	mov	r0, r8
	bl	pause
	ldmib	r4, {r2, r3}
	add	r3, r3, #1
	cmp	r2, #0
	str	r3, [r4, #8]
	beq	.L23
	ldr	r3, [sp, #8]
	cmp	r3, #0
	ldrne	r3, .L27+40
	ldreq	r3, .L27+4
	movne	r1, #129
	moveq	r1, #130
	ldrne	r5, [r3]
	ldreq	r5, [r3]
	b	.L9
.L22:
	ldr	r1, .L27+44
	mov	r3, #4
	ldr	r1, [r1]
	ldr	r0, [r4, #12]
	add	r2, sp, #16
	bl	cyapa_read_bytes
	cmp	r0, #0
	beq	.L24
.L4:
	ldr	r3, [fp]
	cmp	r3, #0
	bne	.L25
	ldr	r3, .L27+48
	ldr	r2, [sp, #16]
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L7
	ldr	r3, .L27+8
	ldr	r2, .L27+52
	ldr	r3, [r3]
	ldr	r1, [sp, #12]
	ldr	r2, [r2]
	sub	r1, r3, r1
	cmp	r1, r2
	bls	.L7
	str	r3, [sp, #12]
	b	.L6
.L25:
	ldr	r3, .L27+8
	ldr	r3, [r3]
	str	r3, [sp, #12]
.L6:
	mov	r1, #0
	mov	r2, #2
	ldr	r0, [r4, #12]
	str	r1, [fp]
	bl	init_device
.L7:
	mov	r0, r6
	ldr	r1, [r4, #12]
	bl	iicbus_release_bus
	b	.L3
.L13:
	mov	r3, #0
	mov	r0, r4
	str	r3, [r4]
	bl	cyapa_unlock
	bl	kthread_exit
	ldr	r3, .L27
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L26
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L24:
	mov	r2, r5
	mov	r0, r4
	add	r1, sp, #16
	bl	cyapa_raw_input
	str	r0, [sp, #8]
	b	.L4
.L12:
	ldr	r0, .L27+56
	mov	r7, r1
	bl	printf
	b	.L11
.L26:
	bl	__stack_chk_fail
.L28:
	.align	2
.L27:
	.word	.LC3
	.word	cyapa_norm_freq
	.word	ticks
	.word	IIC_WAIT
	.word	hz
	.word	cyapa_reset
	.word	.LC0
	.word	cyapa_idle_freq
	.word	cyapa_debug
	.word	.LC1
	.word	cyapa_slow_freq
	.word	CMD_DEV_STATUS
	.word	CYAPA_STAT_RUNNING
	.word	TIME_TO_RESET
	.word	.LC2
	.size	cyapa_poll_thread, .-cyapa_poll_thread
	.comm	ticks,4,4
	.comm	hz,4,4
	.comm	cyapa_slow_freq,4,4
	.comm	cyapa_reset,4,4
	.comm	cyapa_norm_freq,4,4
	.comm	cyapa_idle_freq,4,4
	.comm	cyapa_debug,4,4
	.comm	TIME_TO_RESET,4,4
	.comm	IIC_WAIT,4,4
	.comm	CYAPA_STAT_RUNNING,4,4
	.comm	CMD_DEV_STATUS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
