	.file	"extr_kpad_driver.c_kpad_poll.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	kpad_poll, @function
kpad_poll:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 24
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR WIIU_WIIMOTE_CHANNELS[rip]
	test	eax, eax
	je	.L1
	xor	ebx, ebx
	lea	rbp, 4[rsp]
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	add	rax, QWORD PTR poll_failures[rip]
	mov	ecx, DWORD PTR [rax]
	lea	edx, 1[rcx]
	mov	DWORD PTR [rax], edx
	cmp	edx, 5
	jg	.L12
.L4:
	add	ebx, 1
	cmp	DWORD PTR WIIU_WIIMOTE_CHANNELS[rip], ebx
	jbe	.L1
.L2:
	mov	edx, 4
	xor	esi, esi
	mov	rdi, rbp
	call	memset@PLT
	mov	edx, 1
	mov	rsi, rbp
	mov	edi, ebx
	call	KPADRead@PLT
	mov	edx, ebx
	mov	r8, rax
	lea	rax, 0[0+rdx*4]
	test	r8, r8
	je	.L13
	mov	rax, QWORD PTR poll_failures[rip]
	mov	edi, ebx
	mov	rsi, rbp
	add	ebx, 1
	mov	DWORD PTR [rax+rdx*4], 0
	call	kpad_poll_one_channel@PLT
	cmp	DWORD PTR WIIU_WIIMOTE_CHANNELS[rip], ebx
	ja	.L2
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L14
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	edi, ebx
	call	kpad_deregister@PLT
	jmp	.L4
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	kpad_poll, .-kpad_poll
	.comm	poll_failures,8,8
	.comm	WIIU_WIIMOTE_CHANNELS,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_kpad_driver.c_kpad_poll.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	kpad_poll, %function
kpad_poll:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L14
	ldr	r6, .L14+4
	sub	sp, sp, #12
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	ldr	r3, [r6]
	cmp	r3, #0
	beq	.L1
	mov	r4, #0
	ldr	r7, .L14+8
	mov	r5, r4
	b	.L2
.L12:
	ldr	r2, [r7]
	ldr	r3, [r2, r4, lsl #2]
	add	r3, r3, #1
	cmp	r3, #5
	str	r3, [r2, r4, lsl #2]
	bgt	.L11
.L4:
	ldr	r3, [r6]
	add	r4, r4, #1
	cmp	r3, r4
	bls	.L1
.L2:
	mov	r2, #1
	mov	r1, sp
	mov	r0, r4
	str	r5, [sp]
	bl	KPADRead
	cmp	r0, #0
	beq	.L12
	ldr	r3, [r7]
	mov	r0, r4
	str	r5, [r3, r4, lsl #2]
	mov	r1, sp
	bl	kpad_poll_one_channel
	ldr	r3, [r6]
	add	r4, r4, #1
	cmp	r3, r4
	bhi	.L2
.L1:
	ldr	r3, .L14
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L13
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L11:
	mov	r0, r4
	bl	kpad_deregister
	b	.L4
.L13:
	bl	__stack_chk_fail
.L15:
	.align	2
.L14:
	.word	.LC0
	.word	WIIU_WIIMOTE_CHANNELS
	.word	poll_failures
	.size	kpad_poll, .-kpad_poll
	.comm	poll_failures,4,4
	.comm	WIIU_WIIMOTE_CHANNELS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
