	.file	"extr_sdl-joystick.c_KillJoysticks.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	KillJoysticks
	.type	KillJoysticks, @function
KillJoysticks:
.LFB0:
	.cfi_startproc
	endbr64
	mov	eax, DWORD PTR jinited[rip]
	test	eax, eax
	je	.L16
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	xor	ebx, ebx
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	eax, DWORD PTR MAX_JOYSTICKS[rip]
	mov	rdx, QWORD PTR Joysticks[rip]
	test	eax, eax
	jg	.L5
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L4:
	add	rbx, 1
	cmp	DWORD PTR MAX_JOYSTICKS[rip], ebx
	mov	QWORD PTR [rax], 0
	jle	.L6
.L5:
	lea	rbp, 0[0+rbx*8]
	lea	rax, [rdx+rbp]
	mov	rdi, QWORD PTR [rax]
	test	rdi, rdi
	je	.L4
	call	SDL_JoystickClose@PLT
	mov	rdx, QWORD PTR Joysticks[rip]
	lea	rax, [rdx+rbp]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	mov	edi, DWORD PTR SDL_INIT_JOYSTICK[rip]
	call	SDL_QuitSubSystem@PLT
	add	rsp, 8
	.cfi_def_cfa_offset 24
	mov	eax, 1
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE0:
	.size	KillJoysticks, .-KillJoysticks
	.comm	jinited,4,4
	.comm	SDL_INIT_JOYSTICK,4,4
	.comm	MAX_JOYSTICKS,4,4
	.comm	Joysticks,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_sdl-joystick.c_KillJoysticks.c"
	.text
	.align	2
	.global	KillJoysticks
	.syntax unified
	.arm
	.fpu softvfp
	.type	KillJoysticks, %function
KillJoysticks:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L19
	ldr	r0, [r3]
	cmp	r0, #0
	bxeq	lr
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r6, .L19+4
	ldr	r3, [r6]
	cmp	r3, #0
	ble	.L6
	mov	r4, #0
	ldr	r7, .L19+8
	mov	r8, r4
	ldr	r3, [r7]
	b	.L5
.L4:
	ldr	r1, [r6]
	str	r8, [r2]
	cmp	r1, r4
	ble	.L6
.L5:
	ldr	r0, [r3, r4, lsl #2]
	lsl	r5, r4, #2
	cmp	r0, #0
	add	r2, r3, r4, lsl #2
	add	r4, r4, #1
	beq	.L4
	bl	SDL_JoystickClose
	ldr	r3, [r7]
	ldr	r1, [r6]
	add	r2, r3, r5
	cmp	r1, r4
	str	r8, [r2]
	bgt	.L5
.L6:
	ldr	r3, .L19+12
	ldr	r0, [r3]
	bl	SDL_QuitSubSystem
	mov	r0, #1
	pop	{r4, r5, r6, r7, r8, pc}
.L20:
	.align	2
.L19:
	.word	jinited
	.word	MAX_JOYSTICKS
	.word	Joysticks
	.word	SDL_INIT_JOYSTICK
	.size	KillJoysticks, .-KillJoysticks
	.comm	jinited,4,4
	.comm	SDL_INIT_JOYSTICK,4,4
	.comm	MAX_JOYSTICKS,4,4
	.comm	Joysticks,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
