	.file	"extr_gamecon.c_gc_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Not using parport%d.\n"
.LC1:
	.string	"gamecon"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"parport busy already - lp.o loaded?\n"
	.section	.rodata.str1.1
.LC3:
	.string	"Not enough memory\n"
.LC4:
	.string	"No valid devices specified\n"
	.text
	.p2align 4
	.type	gc_attach, @function
gc_attach:
.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
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	edi, DWORD PTR GC_MAX_PORTS[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	test	edi, edi
	jle	.L24
	mov	rax, QWORD PTR gc_cfg[rip]
	lea	esi, -1[rdi]
	xor	ebx, ebx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L25:
	mov	rbx, rdx
.L5:
	mov	ebp, DWORD PTR [rax]
	mov	edx, ebx
	mov	r12d, ebx
	test	ebp, ebp
	je	.L3
	mov	r13, QWORD PTR 8[rax]
	mov	rcx, QWORD PTR 0[r13]
	test	rcx, rcx
	js	.L3
	cmp	rcx, QWORD PTR [r15]
	je	.L4
.L3:
	lea	r12d, 1[rdx]
	add	rax, 16
	lea	rdx, 1[rbx]
	cmp	rbx, rsi
	jne	.L25
.L2:
	cmp	edi, r12d
	je	.L6
	movsx	rbx, r12d
	mov	rax, rbx
	sal	rax, 4
	add	rax, QWORD PTR gc_cfg[rip]
	mov	r13, QWORD PTR 8[rax]
	mov	ebp, DWORD PTR [rax]
.L4:
	lea	r14, 20[rsp]
	mov	edx, 4
	xor	esi, esi
	mov	rdi, r14
	call	memset@PLT
	mov	ecx, r12d
	mov	rdx, r14
	mov	rdi, r15
	mov	eax, DWORD PTR PARPORT_FLAG_EXCL[rip]
	lea	rsi, .LC1[rip]
	mov	DWORD PTR 20[rsp], eax
	call	parport_register_dev_model@PLT
	mov	QWORD PTR 8[rsp], rax
	test	rax, rax
	je	.L41
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	mov	edi, 40
	call	kzalloc@PLT
	mov	r14, rax
	test	rax, rax
	je	.L42
	lea	rdi, 32[rax]
	call	mutex_init@PLT
	mov	rax, QWORD PTR 8[rsp]
	xor	edx, edx
	lea	rdi, 16[r14]
	mov	esi, DWORD PTR gc_timer[rip]
	mov	QWORD PTR 24[r14], rax
	mov	rax, QWORD PTR [r15]
	mov	QWORD PTR [r14], rax
	call	timer_setup@PLT
	cmp	ebp, 1
	jle	.L11
	lea	eax, -2[rbp]
	xor	r12d, r12d
	xor	ebp, ebp
	mov	QWORD PTR [rsp], rax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L18:
	mov	edx, DWORD PTR 8[r13+rbp*4]
	test	edx, edx
	je	.L14
	mov	esi, ebp
	mov	rdi, r14
	call	gc_setup_pad@PLT
	test	rax, rax
	jne	.L43
	add	r12d, 1
.L14:
	lea	rax, 1[rbp]
	cmp	QWORD PTR [rsp], rbp
	je	.L17
	mov	rbp, rax
.L12:
	cmp	DWORD PTR GC_MAX_DEVICES[rip], ebp
	mov	r15d, ebp
	jg	.L18
.L17:
	test	r12d, r12d
	je	.L11
	mov	rax, QWORD PTR gc_base[rip]
	mov	QWORD PTR [rax+rbx*8], r14
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L44
	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
.L6:
	.cfi_restore_state
	mov	rsi, QWORD PTR [r15]
	lea	rdi, .LC0[rip]
	call	pr_debug@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L41:
	lea	rdi, .LC2[rip]
	call	pr_err@PLT
	jmp	.L1
.L42:
	lea	rdi, .LC3[rip]
	call	pr_err@PLT
.L10:
	mov	rdi, QWORD PTR 8[rsp]
	call	parport_unregister_device@PLT
	jmp	.L1
.L43:
	lea	eax, -1[r15]
	test	r15d, r15d
	je	.L13
	cdqe
	movsx	rcx, r15d
	lea	rbx, 0[0+rax*8]
	lea	eax, -1[rbp]
	sub	rcx, rax
	lea	rbp, -16[0+rcx*8]
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L19:
	sub	rbx, 8
	cmp	rbp, rbx
	je	.L13
.L20:
	mov	rax, QWORD PTR 8[r14]
	mov	rdi, QWORD PTR [rax+rbx]
	test	rdi, rdi
	je	.L19
	call	input_unregister_device@PLT
	jmp	.L19
.L11:
	lea	rdi, .LC4[rip]
	call	pr_err@PLT
.L13:
	mov	rdi, r14
	call	kfree@PLT
	jmp	.L10
.L24:
	xor	r12d, r12d
	jmp	.L2
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	gc_attach, .-gc_attach
	.comm	gc_timer,4,4
	.comm	gc_cfg,8,8
	.comm	gc_base,8,8
	.comm	PARPORT_FLAG_EXCL,4,4
	.comm	GFP_KERNEL,4,4
	.comm	GC_MAX_PORTS,4,4
	.comm	GC_MAX_DEVICES,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_gamecon.c_gc_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Not using parport%d.\012\000"
	.align	2
.LC1:
	.ascii	"gamecon\000"
	.align	2
.LC2:
	.ascii	"parport busy already - lp.o loaded?\012\000"
	.align	2
.LC3:
	.ascii	"Not enough memory\012\000"
	.align	2
.LC4:
	.ascii	"No valid devices specified\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	gc_attach, %function
gc_attach:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L46
	sub	sp, sp, #12
	ldr	ip, [r3]
	ldr	r3, .L46+4
	cmp	ip, #0
	mov	r9, r0
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	ble	.L2
	mov	r3, #0
	ldr	r2, .L46+8
	ldr	r1, [r0]
	ldr	r0, [r2]
	add	lr, r0, #4
.L5:
	ldr	r4, [r0, r3, lsl #3]
	mov	r6, r3
	cmp	r4, #0
	beq	.L3
	ldr	r5, [lr, r3, lsl #3]
	ldr	r2, [r5]
	cmp	r2, #0
	blt	.L3
	cmp	r2, r1
	beq	.L4
.L3:
	add	r3, r3, #1
	cmp	r3, ip
	bne	.L5
.L6:
	ldr	r0, .L46+12
	bl	pr_debug
.L1:
	ldr	r3, .L46+4
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L42
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldreq	r1, [r0]
	beq	.L6
	mov	r6, #0
	mov	r3, r6
	ldr	r2, .L46+8
	ldr	r2, [r2]
	ldm	r2, {r4, r5}
.L4:
	ldr	r2, .L46+16
	mov	r0, r9
	ldr	ip, [r2]
	ldr	r1, .L46+20
	mov	r2, sp
	str	ip, [sp]
	bl	parport_register_dev_model
	subs	r7, r0, #0
	beq	.L43
	ldr	r3, .L46+24
	mov	r0, #20
	ldr	r1, [r3]
	bl	kzalloc
	subs	r8, r0, #0
	beq	.L44
	add	r0, r8, #16
	bl	mutex_init
	mov	r0, r8
	ldr	r2, [r9]
	ldr	r3, .L46+28
	str	r7, [r8, #12]
	ldr	r1, [r3]
	str	r2, [r0], #8
	mov	r2, #0
	bl	timer_setup
	cmp	r4, #1
	ble	.L11
	mov	r10, #0
	mov	r9, r5
	ldr	fp, .L46+32
	mov	r5, r10
	sub	r4, r4, #1
	b	.L12
.L18:
	ldr	r2, [r9, #4]!
	cmp	r2, #0
	beq	.L14
	mov	r1, r5
	mov	r0, r8
	bl	gc_setup_pad
	cmp	r0, #0
	bne	.L45
	add	r10, r10, #1
.L14:
	add	r5, r5, #1
	cmp	r4, r5
	beq	.L17
.L12:
	ldr	r3, [fp]
	cmp	r3, r5
	bgt	.L18
.L17:
	cmp	r10, #0
	beq	.L11
	ldr	r3, .L46+36
	ldr	r3, [r3]
	str	r8, [r3, r6, lsl #2]
	b	.L1
.L43:
	ldr	r0, .L46+40
	bl	pr_err
	b	.L1
.L44:
	ldr	r0, .L46+44
	bl	pr_err
.L10:
	mov	r0, r7
	bl	parport_unregister_device
	b	.L1
.L45:
	cmp	r5, #0
	sub	r4, r5, #1
	lslne	r4, r4, #2
	bne	.L20
	b	.L13
.L19:
	sub	r4, r4, #4
	cmn	r4, #4
	beq	.L13
.L20:
	ldr	r3, [r8, #4]
	ldr	r0, [r3, r4]
	cmp	r0, #0
	beq	.L19
	bl	input_unregister_device
	b	.L19
.L11:
	ldr	r0, .L46+48
	bl	pr_err
.L13:
	mov	r0, r8
	bl	kfree
	b	.L10
.L42:
	bl	__stack_chk_fail
.L47:
	.align	2
.L46:
	.word	GC_MAX_PORTS
	.word	.LC5
	.word	gc_cfg
	.word	.LC0
	.word	PARPORT_FLAG_EXCL
	.word	.LC1
	.word	GFP_KERNEL
	.word	gc_timer
	.word	GC_MAX_DEVICES
	.word	gc_base
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	gc_attach, .-gc_attach
	.comm	gc_timer,4,4
	.comm	gc_cfg,4,4
	.comm	gc_base,4,4
	.comm	PARPORT_FLAG_EXCL,4,4
	.comm	GFP_KERNEL,4,4
	.comm	GC_MAX_PORTS,4,4
	.comm	GC_MAX_DEVICES,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
