	.file	"extr_grip_mp.c_register_slot.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	register_slot, @function
register_slot:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movsx	rdx, edi
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rax, QWORD PTR 8[rsi]
	mov	rbp, QWORD PTR [rax+rdx*8]
	xor	eax, eax
	call	input_allocate_device@PLT
	mov	r14d, DWORD PTR ENOMEM[rip]
	mov	QWORD PTR 24[rbp], rax
	neg	r14d
	test	rax, rax
	je	.L1
	mov	rbx, rax
	mov	rdx, QWORD PTR grip_name[rip]
	mov	rax, QWORD PTR 0[rbp]
	mov	rsi, r12
	mov	rdi, rbx
	mov	edx, DWORD PTR [rdx+rax*4]
	add	eax, 256
	mov	DWORD PTR 36[rbx], 256
	mov	DWORD PTR 32[rbx], eax
	mov	rax, QWORD PTR [r12]
	mov	DWORD PTR 48[rbx], edx
	mov	edx, DWORD PTR BUS_GAMEPORT[rip]
	mov	QWORD PTR 24[rbx], rax
	mov	DWORD PTR 44[rbx], edx
	mov	edx, DWORD PTR GAMEPORT_ID_VENDOR_GRAVIS[rip]
	mov	DWORD PTR 40[rbx], edx
	call	input_set_drvdata@PLT
	mov	eax, DWORD PTR grip_open[rip]
	mov	edi, DWORD PTR EV_KEY[rip]
	mov	DWORD PTR 16[rbx], eax
	mov	eax, DWORD PTR grip_close[rip]
	mov	DWORD PTR 12[rbx], eax
	call	BIT_MASK@PLT
	mov	edi, DWORD PTR EV_ABS[rip]
	mov	r14d, eax
	call	BIT_MASK@PLT
	mov	rdx, QWORD PTR [rbx]
	or	r14d, eax
	mov	rax, QWORD PTR 0[rbp]
	mov	DWORD PTR [rdx], r14d
	mov	rdx, QWORD PTR grip_abs[rip]
	lea	rdi, 0[0+rax*8]
	mov	rdx, QWORD PTR [rdx+rax*8]
	mov	esi, DWORD PTR [rdx]
	test	esi, esi
	js	.L4
	mov	r14d, 4
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edx, -1
	mov	rdi, rbx
	xor	r9d, r9d
	xor	r8d, r8d
	mov	ecx, 1
	call	input_set_abs_params@PLT
	mov	rax, QWORD PTR 0[rbp]
	mov	rdx, QWORD PTR grip_abs[rip]
	mov	rdx, QWORD PTR [rdx+rax*8]
	lea	rdi, 0[0+rax*8]
	mov	esi, DWORD PTR [rdx+r14]
	add	r14, 4
	test	esi, esi
	jns	.L5
.L4:
	mov	rcx, QWORD PTR grip_btn[rip]
	mov	r14d, 4
	mov	rdx, QWORD PTR [rcx+rdi]
	mov	edi, DWORD PTR [rdx]
	test	edi, edi
	jns	.L6
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rdx, QWORD PTR [rcx+rax*8]
	mov	edi, DWORD PTR [rdx+r14]
	add	r14, 4
	test	edi, edi
	js	.L10
.L6:
	test	edi, edi
	je	.L9
	mov	esi, DWORD PTR 8[rbx]
	call	set_bit@PLT
	mov	rax, QWORD PTR 0[rbp]
	mov	rcx, QWORD PTR grip_btn[rip]
	mov	rdx, QWORD PTR [rcx+rax*8]
	mov	edi, DWORD PTR [rdx+r14]
	add	r14, 4
	test	edi, edi
	jns	.L6
.L10:
	mov	rdi, QWORD PTR 24[rbp]
	call	input_register_device@PLT
	mov	r14d, eax
	test	eax, eax
	jne	.L21
	cmp	QWORD PTR 16[rbp], 0
	mov	DWORD PTR 8[rbp], 1
	jne	.L22
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r14d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	mov	esi, r13d
	mov	rdi, r12
	call	report_slot@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r14d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	mov	rdi, QWORD PTR 24[rbp]
	call	input_free_device@PLT
	pop	rbx
	.cfi_def_cfa_offset 40
	mov	eax, r14d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	register_slot, .-register_slot
	.comm	grip_open,4,4
	.comm	grip_name,8,8
	.comm	grip_close,4,4
	.comm	grip_btn,8,8
	.comm	grip_abs,8,8
	.comm	GAMEPORT_ID_VENDOR_GRAVIS,4,4
	.comm	EV_KEY,4,4
	.comm	EV_ABS,4,4
	.comm	ENOMEM,4,4
	.comm	BUS_GAMEPORT,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_grip_mp.c_register_slot.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	register_slot, %function
register_slot:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, [r1, #4]
	sub	sp, sp, #8
	ldr	r6, [r3, r0, lsl #2]
	mov	r8, r1
	mov	r9, r0
	bl	input_allocate_device
	cmp	r0, #0
	str	r0, [r6, #12]
	beq	.L23
	mov	r2, #256
	mov	r4, r0
	ldr	r1, .L26
	ldr	r3, [r6]
	ldr	lr, [r1]
	ldr	ip, .L26+4
	ldr	r1, .L26+8
	ldr	lr, [lr, r3, lsl #2]
	add	r3, r3, r2
	ldr	ip, [ip]
	ldr	r1, [r1]
	str	r3, [r0, #20]
	ldr	r3, [r8]
	str	lr, [r0, #36]
	str	ip, [r0, #32]
	str	r1, [r0, #28]
	str	r2, [r0, #24]
	mov	r1, r8
	str	r3, [r0, #16]
	bl	input_set_drvdata
	ldr	r2, .L26+12
	ldr	r3, .L26+16
	ldr	r1, [r2]
	ldr	r2, [r3]
	ldr	r3, .L26+20
	str	r1, [r4, #12]
	str	r2, [r4, #8]
	ldr	r0, [r3]
	bl	BIT_MASK
	ldr	r3, .L26+24
	mov	r5, r0
	ldr	r0, [r3]
	bl	BIT_MASK
	ldr	r10, .L26+28
	ldr	r3, [r6]
	ldr	r2, [r10]
	ldr	r1, [r4]
	ldr	r2, [r2, r3, lsl #2]
	orr	r5, r5, r0
	str	r5, [r1]
	ldr	r1, [r2]
	lsl	r0, r3, #2
	cmp	r1, #0
	blt	.L4
	mov	r5, #4
	mov	r7, #0
.L5:
	mov	r3, #1
	mvn	r2, #0
	mov	r0, r4
	str	r7, [sp, #4]
	str	r7, [sp]
	bl	input_set_abs_params
	ldr	r3, [r6]
	ldr	r2, [r10]
	lsl	r0, r3, #2
	ldr	r2, [r2, r3, lsl #2]
	ldr	r1, [r2, r5]
	add	r5, r5, #4
	cmp	r1, #0
	bge	.L5
.L4:
	ldr	r7, .L26+32
	ldr	r2, [r7]
	ldr	r2, [r2, r0]
	ldr	r0, [r2]
	cmp	r0, #0
	movge	r5, #4
	bge	.L6
	b	.L10
.L9:
	ldr	r2, [r7]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r0, [r2, r5]
	add	r5, r5, #4
	cmp	r0, #0
	blt	.L10
.L6:
	cmp	r0, #0
	beq	.L9
	ldr	r1, [r4, #4]
	bl	set_bit
	ldr	r3, [r6]
	b	.L9
.L10:
	ldr	r0, [r6, #12]
	bl	input_register_device
	subs	r4, r0, #0
	bne	.L24
	mov	r3, #1
	ldr	r0, [r6, #8]
	str	r3, [r6, #4]
	cmp	r0, #0
	bne	.L25
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L23:
	ldr	r3, .L26+36
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L25:
	mov	r1, r9
	mov	r0, r8
	bl	report_slot
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L24:
	ldr	r0, [r6, #12]
	bl	input_free_device
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L27:
	.align	2
.L26:
	.word	grip_name
	.word	BUS_GAMEPORT
	.word	GAMEPORT_ID_VENDOR_GRAVIS
	.word	grip_open
	.word	grip_close
	.word	EV_KEY
	.word	EV_ABS
	.word	grip_abs
	.word	grip_btn
	.word	ENOMEM
	.size	register_slot, .-register_slot
	.comm	grip_open,4,4
	.comm	grip_name,4,4
	.comm	grip_close,4,4
	.comm	grip_btn,4,4
	.comm	grip_abs,4,4
	.comm	GAMEPORT_ID_VENDOR_GRAVIS,4,4
	.comm	EV_KEY,4,4
	.comm	EV_ABS,4,4
	.comm	ENOMEM,4,4
	.comm	BUS_GAMEPORT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
