	.file	"extr_hid-wiimote-core.c_wiimote_init_check.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"state left: !EXT && MP\n"
.LC1:
	.string	"state left: EXT && !MP\n"
.LC2:
	.string	"state left: !EXT && !MP\n"
.LC3:
	.string	"state left: EXT && MP\n"
	.text
	.p2align 4
	.type	wiimote_init_check, @function
wiimote_init_check:
.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
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	lea	r12, 32[rdi]
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	mov	rdi, r12
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	call	spin_lock_irq@PLT
	mov	rdi, r12
	mov	ebx, DWORD PTR 8[rbp]
	call	spin_unlock_irq@PLT
	mov	rdi, rbp
	call	wiimote_cmd_acquire_noint@PLT
	mov	rax, QWORD PTR WIIMOTE_EXT_NONE[rip]
	cmp	QWORD PTR 16[rbp], rax
	je	.L39
	mov	r13d, ebx
	and	r13d, DWORD PTR WIIPROTO_FLAG_MP_USED[rip]
	je	.L18
	cmp	QWORD PTR 24[rbp], 0
	jg	.L19
.L37:
	xor	r13d, r13d
.L6:
	mov	rdi, rbp
	call	wiimote_cmd_release@PLT
.L1:
	mov	rax, QWORD PTR 56[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L40
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	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
.L39:
	.cfi_restore_state
	mov	eax, DWORD PTR WIIPROTO_FLAG_MP_USED[rip]
	and	eax, ebx
	cmp	QWORD PTR 24[rbp], 0
	jle	.L3
	test	eax, eax
	je	.L4
	mov	rdi, rbp
	call	wiimote_cmd_read_mp_mapped@PLT
	mov	r13, QWORD PTR WIIMOTE_MP_SINGLE[rip]
	mov	rdi, r12
	mov	rbx, rax
	call	spin_lock_irq@PLT
	cmp	r13, rbx
	je	.L41
.L5:
	mov	rdi, r12
	xor	r13d, r13d
	call	spin_unlock_irq@PLT
	mov	edi, DWORD PTR 0[rbp]
	lea	rsi, .LC0[rip]
	call	hid_dbg@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L19:
	mov	rdi, rbp
	call	wiimote_cmd_read_mp_mapped@PLT
	cmp	QWORD PTR WIIMOTE_MP_NONE[rip], rax
	je	.L12
	cmp	QWORD PTR WIIMOTE_MP_UNKNOWN[rip], rax
	je	.L12
	cmp	QWORD PTR WIIMOTE_MP_SINGLE[rip], rax
	je	.L12
	mov	rdi, r12
	call	spin_lock_irq@PLT
	mov	eax, DWORD PTR 8[rbp]
	test	DWORD PTR WIIPROTO_FLAG_EXT_PLUGGED[rip], eax
	je	.L14
	test	DWORD PTR WIIPROTO_FLAG_EXT_ACTIVE[rip], eax
	je	.L14
	test	DWORD PTR WIIPROTO_FLAG_MP_ACTIVE[rip], eax
	je	.L14
.L15:
	mov	rdi, r12
	mov	r13d, 1
	call	spin_unlock_irq@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rdi, rbp
	mov	rsi, rsp
	call	wiimote_cmd_read_ext@PLT
	mov	r15, QWORD PTR 16[rbp]
	mov	rdi, r12
	mov	r14, rax
	call	spin_lock_irq@PLT
	cmp	r15, r14
	je	.L42
.L7:
	mov	rdi, r12
	call	spin_unlock_irq@PLT
	mov	edi, DWORD PTR 0[rbp]
	lea	rsi, .LC1[rip]
	call	hid_dbg@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	test	eax, eax
	jne	.L37
.L4:
	mov	rsi, rsp
	mov	rdi, rbp
	call	wiimote_cmd_read_ext@PLT
	mov	r14, QWORD PTR 16[rbp]
	mov	rdi, r12
	mov	r13, rax
	call	spin_lock_irq@PLT
	mov	rdi, r12
	cmp	r14, r13
	je	.L43
.L10:
	call	spin_unlock_irq@PLT
	mov	edi, DWORD PTR 0[rbp]
	lea	rsi, .LC2[rip]
	xor	r13d, r13d
	call	hid_dbg@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L42:
	mov	eax, DWORD PTR 8[rbp]
	test	DWORD PTR WIIPROTO_FLAG_MP_ACTIVE[rip], eax
	jne	.L7
	test	DWORD PTR WIIPROTO_FLAG_EXT_ACTIVE[rip], eax
	je	.L7
	mov	rdi, r12
	call	spin_unlock_irq@PLT
.L9:
	mov	rdi, rbp
	mov	r13d, 1
	call	wiimote_cmd_release@PLT
	mov	eax, DWORD PTR WIIPROTO_FLAG_BUILTIN_MP[rip]
	or	eax, DWORD PTR WIIPROTO_FLAG_NO_MP[rip]
	test	eax, ebx
	jne	.L1
	mov	rdi, rbp
	mov	r13d, 1
	call	wiimote_init_poll_mp@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rdi, r12
	call	spin_lock_irq@PLT
.L14:
	mov	rdi, r12
	xor	r13d, r13d
	call	spin_unlock_irq@PLT
	mov	edi, DWORD PTR 0[rbp]
	lea	rsi, .LC3[rip]
	call	hid_dbg@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L43:
	mov	eax, DWORD PTR WIIPROTO_FLAG_EXT_ACTIVE[rip]
	or	eax, DWORD PTR WIIPROTO_FLAG_MP_ACTIVE[rip]
	or	eax, DWORD PTR WIIPROTO_FLAG_EXT_PLUGGED[rip]
	test	DWORD PTR 8[rbp], eax
	jne	.L10
	call	spin_unlock_irq@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L41:
	mov	edx, DWORD PTR 8[rbp]
	mov	eax, DWORD PTR WIIPROTO_FLAG_EXT_ACTIVE[rip]
	or	eax, DWORD PTR WIIPROTO_FLAG_MP_PLUGGED[rip]
	test	eax, edx
	jne	.L5
	test	DWORD PTR WIIPROTO_FLAG_MP_ACTIVE[rip], edx
	je	.L5
	jmp	.L15
.L40:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	wiimote_init_check, .-wiimote_init_check
	.comm	WIIPROTO_FLAG_NO_MP,4,4
	.comm	WIIPROTO_FLAG_MP_USED,4,4
	.comm	WIIPROTO_FLAG_MP_PLUGGED,4,4
	.comm	WIIPROTO_FLAG_MP_ACTIVE,4,4
	.comm	WIIPROTO_FLAG_EXT_PLUGGED,4,4
	.comm	WIIPROTO_FLAG_EXT_ACTIVE,4,4
	.comm	WIIPROTO_FLAG_BUILTIN_MP,4,4
	.comm	WIIMOTE_MP_UNKNOWN,8,8
	.comm	WIIMOTE_MP_SINGLE,8,8
	.comm	WIIMOTE_MP_NONE,8,8
	.comm	WIIMOTE_EXT_NONE,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_hid-wiimote-core.c_wiimote_init_check.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"state left: !EXT && MP\012\000"
	.align	2
.LC1:
	.ascii	"state left: EXT && !MP\012\000"
	.align	2
.LC2:
	.ascii	"state left: !EXT && !MP\012\000"
	.align	2
.LC3:
	.ascii	"state left: EXT && MP\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	wiimote_init_check, %function
wiimote_init_check:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r4, r0
	ldr	r3, .L44
	add	r7, r0, #16
	sub	sp, sp, #36
	mov	r0, r7
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	spin_lock_irq
	mov	r0, r7
	ldr	r6, [r4, #4]
	bl	spin_unlock_irq
	mov	r0, r4
	bl	wiimote_cmd_acquire_noint
	ldr	r3, .L44+4
	ldr	r2, [r4, #8]
	ldr	r3, [r3]
	cmp	r2, r3
	ldr	r3, .L44+8
	beq	.L39
	ldr	r5, [r3]
	ands	r5, r6, r5
	beq	.L18
	ldr	r3, [r4, #12]
	cmp	r3, #0
	bgt	.L19
.L37:
	mov	r5, #0
.L6:
	mov	r0, r4
	bl	wiimote_cmd_release
.L1:
	ldr	r3, .L44
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L40
	mov	r0, r5
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L39:
	ldr	r2, [r4, #12]
	ldr	r3, [r3]
	cmp	r2, #0
	and	r3, r3, r6
	ble	.L3
	cmp	r3, #0
	beq	.L4
	mov	r0, r4
	bl	wiimote_cmd_read_mp_mapped
	mov	r5, r0
	ldr	r3, .L44+12
	mov	r0, r7
	ldr	r6, [r3]
	bl	spin_lock_irq
	cmp	r6, r5
	beq	.L41
.L5:
	mov	r0, r7
	bl	spin_unlock_irq
	ldr	r1, .L44+16
	ldr	r0, [r4]
	bl	hid_dbg
	mov	r5, #0
	b	.L6
.L19:
	mov	r0, r4
	bl	wiimote_cmd_read_mp_mapped
	ldr	r3, .L44+20
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L12
	ldr	r3, .L44+24
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L12
	ldr	r3, .L44+12
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L12
	mov	r0, r7
	bl	spin_lock_irq
	ldr	r2, .L44+28
	ldr	r3, [r4, #4]
	ldr	r2, [r2]
	tst	r3, r2
	beq	.L14
	ldr	r2, .L44+32
	ldr	r2, [r2]
	tst	r3, r2
	beq	.L14
	ldr	r2, .L44+36
	ldr	r2, [r2]
	tst	r3, r2
	beq	.L14
.L15:
	mov	r0, r7
	bl	spin_unlock_irq
	mov	r5, #1
	b	.L6
.L18:
	add	r1, sp, #4
	mov	r0, r4
	bl	wiimote_cmd_read_ext
	mov	r8, r0
	ldr	r9, [r4, #8]
	mov	r0, r7
	bl	spin_lock_irq
	cmp	r9, r8
	beq	.L42
.L7:
	mov	r0, r7
	bl	spin_unlock_irq
	ldr	r1, .L44+40
	ldr	r0, [r4]
	bl	hid_dbg
	b	.L6
.L3:
	cmp	r3, #0
	bne	.L37
.L4:
	add	r1, sp, #4
	mov	r0, r4
	bl	wiimote_cmd_read_ext
	mov	r5, r0
	ldr	r8, [r4, #8]
	mov	r0, r7
	bl	spin_lock_irq
	cmp	r8, r5
	mov	r0, r7
	beq	.L43
.L10:
	bl	spin_unlock_irq
	ldr	r1, .L44+44
	ldr	r0, [r4]
	bl	hid_dbg
	mov	r5, #0
	b	.L6
.L42:
	ldr	r2, .L44+36
	ldr	r3, [r4, #4]
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L7
	ldr	r2, .L44+32
	ldr	r2, [r2]
	tst	r3, r2
	beq	.L7
	mov	r0, r7
	bl	spin_unlock_irq
.L9:
	mov	r0, r4
	bl	wiimote_cmd_release
	ldr	r3, .L44+48
	ldr	r2, .L44+52
	ldr	r3, [r3]
	ldr	r2, [r2]
	orr	r3, r3, r2
	tst	r3, r6
	movne	r5, #1
	bne	.L1
	mov	r0, r4
	bl	wiimote_init_poll_mp
	mov	r5, #1
	b	.L1
.L12:
	mov	r0, r7
	bl	spin_lock_irq
.L14:
	mov	r0, r7
	bl	spin_unlock_irq
	ldr	r1, .L44+56
	ldr	r0, [r4]
	bl	hid_dbg
	mov	r5, #0
	b	.L6
.L43:
	ldr	r3, .L44+32
	ldr	r2, .L44+36
	ldr	r1, .L44+28
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r1, [r1]
	orr	r3, r3, r2
	ldr	r2, [r4, #4]
	orr	r3, r3, r1
	tst	r3, r2
	bne	.L10
	bl	spin_unlock_irq
	b	.L9
.L41:
	ldr	r2, .L44+60
	ldr	r3, .L44+32
	ldr	r1, [r2]
	ldr	r3, [r3]
	ldr	r2, [r4, #4]
	orr	r3, r3, r1
	tst	r3, r2
	bne	.L5
	ldr	r3, .L44+36
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L5
	b	.L15
.L40:
	bl	__stack_chk_fail
.L45:
	.align	2
.L44:
	.word	.LC4
	.word	WIIMOTE_EXT_NONE
	.word	WIIPROTO_FLAG_MP_USED
	.word	WIIMOTE_MP_SINGLE
	.word	.LC0
	.word	WIIMOTE_MP_NONE
	.word	WIIMOTE_MP_UNKNOWN
	.word	WIIPROTO_FLAG_EXT_PLUGGED
	.word	WIIPROTO_FLAG_EXT_ACTIVE
	.word	WIIPROTO_FLAG_MP_ACTIVE
	.word	.LC1
	.word	.LC2
	.word	WIIPROTO_FLAG_BUILTIN_MP
	.word	WIIPROTO_FLAG_NO_MP
	.word	.LC3
	.word	WIIPROTO_FLAG_MP_PLUGGED
	.size	wiimote_init_check, .-wiimote_init_check
	.comm	WIIPROTO_FLAG_NO_MP,4,4
	.comm	WIIPROTO_FLAG_MP_USED,4,4
	.comm	WIIPROTO_FLAG_MP_PLUGGED,4,4
	.comm	WIIPROTO_FLAG_MP_ACTIVE,4,4
	.comm	WIIPROTO_FLAG_EXT_PLUGGED,4,4
	.comm	WIIPROTO_FLAG_EXT_ACTIVE,4,4
	.comm	WIIPROTO_FLAG_BUILTIN_MP,4,4
	.comm	WIIMOTE_MP_UNKNOWN,4,4
	.comm	WIIMOTE_MP_SINGLE,4,4
	.comm	WIIMOTE_MP_NONE,4,4
	.comm	WIIMOTE_EXT_NONE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
