	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function openJoystickDevice
_openJoystickDevice:                    ## @openJoystickDevice
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$280, %rsp                      ## imm = 0x118
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -96(%rbp)
	movaps	%xmm0, -112(%rbp)
	movaps	%xmm0, -128(%rbp)
	movaps	%xmm0, -144(%rbp)
	movaps	%xmm0, -160(%rbp)
	movaps	%xmm0, -176(%rbp)
	movaps	%xmm0, -192(%rbp)
	movaps	%xmm0, -208(%rbp)
	movaps	%xmm0, -224(%rbp)
	movaps	%xmm0, -240(%rbp)
	movaps	%xmm0, -256(%rbp)
	movaps	%xmm0, -272(%rbp)
	movaps	%xmm0, -288(%rbp)
	movaps	%xmm0, -304(%rbp)
	movq	_GLFW_JOYSTICK_1@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_GLFW_JOYSTICK_LAST@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	cmpl	%eax, %r13d
	jg	LBB0_8
## %bb.1:
	movslq	%r13d, %r13
	imulq	$56, %r13, %rbx
	decq	%r13
	addq	$48, %rbx
	movq	__glfw@GOTPCREL(%rip), %r15
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %eax
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movslq	%eax, %rcx
	incq	%r13
	addq	$56, %rbx
	cmpq	%rcx, %r13
	jge	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rcx
	cmpl	$0, (%rcx,%rbx)
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-16(%rcx,%rbx), %rdi
	movq	%r14, %rsi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	_GLFW_FALSE@GOTPCREL(%rip), %r12
	jmp	LBB0_18
LBB0_7:
	movq	_GLFW_JOYSTICK_1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
LBB0_8:
	movq	_GLFW_FALSE@GOTPCREL(%rip), %r12
	cmpl	%eax, %r13d
	jg	LBB0_18
## %bb.9:
	movq	__glfw@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	%r13d, %rbx
	incl	%eax
	imulq	$56, %rbx, %rdx
	shlq	$32, %rbx
	addq	%rdx, %rcx
	addq	$48, %rcx
	movabsq	$4294967296, %rdx               ## imm = 0x100000000
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%rcx)
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	addq	%rdx, %rbx
	incl	%r13d
	addq	$56, %rcx
	cmpl	%r13d, %eax
	jne	LBB0_10
	jmp	LBB0_18
LBB0_12:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%r14, %rdi
	callq	_open
	cmpl	$-1, %eax
	je	LBB0_18
## %bb.13:
	movl	%eax, %r15d
	movq	_JSIOCGVERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-312(%rbp), %rdx
	movl	%r15d, %edi
	xorl	%eax, %eax
	callq	_ioctl
	cmpl	$65535, -312(%rbp)              ## imm = 0xFFFF
	jg	LBB0_15
## %bb.14:
	movl	%r15d, %edi
	callq	_close
	jmp	LBB0_18
LBB0_15:
	movl	$256, %edi                      ## imm = 0x100
	callq	_JSIOCGNAME
	leaq	-304(%rbp), %rdx
	movl	%r15d, %edi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_ioctl
	testq	%rax, %rax
	jns	LBB0_17
## %bb.16:
	leaq	L_.str(%rip), %rsi
	leaq	-304(%rbp), %rdi
	movl	$256, %edx                      ## imm = 0x100
	callq	_strncpy
LBB0_17:
	movq	__glfw@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rcx, -320(%rbp)                ## 8-byte Spill
	sarq	$32, %rbx
	movq	_GLFW_TRUE@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	imulq	$56, %rbx, %rbx
	movl	%eax, 48(%rcx,%rbx)
	leaq	-304(%rbp), %rdi
	callq	_strdup
	movq	-320(%rbp), %rcx                ## 8-byte Reload
	movq	%rax, 40(%rcx,%rbx)
	movq	%r14, %rdi
	callq	_strdup
	movq	-320(%rbp), %r14                ## 8-byte Reload
	movq	%rax, 32(%r14,%rbx)
	movl	%r15d, (%r14,%rbx)
	movq	_JSIOCGAXES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-306(%rbp), %rdx
	movl	%r15d, %edi
	xorl	%eax, %eax
	callq	_ioctl
	movsbl	-306(%rbp), %edi
	movl	%edi, 4(%r14,%rbx)
	movl	$4, %esi
	callq	_calloc
	movq	%rax, 24(%r14,%rbx)
	movq	_JSIOCGBUTTONS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-305(%rbp), %rdx
	movl	%r15d, %edi
	xorl	%eax, %eax
	callq	_ioctl
	movsbl	-305(%rbp), %edi
	movl	%edi, 8(%r14,%rbx)
	movl	$1, %esi
	callq	_calloc
	movq	%rax, 16(%r14,%rbx)
	movq	_GLFW_CONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	__glfwInputJoystickChange
LBB0_18:
	movl	(%r12), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_20
## %bb.19:
	addq	$280, %rsp                      ## imm = 0x118
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_GLFW_JOYSTICK_1,4,2            ## @GLFW_JOYSTICK_1
	.comm	_GLFW_JOYSTICK_LAST,4,2         ## @GLFW_JOYSTICK_LAST
	.comm	__glfw,8,3                      ## @_glfw
	.comm	_GLFW_FALSE,4,2                 ## @GLFW_FALSE
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_JSIOCGVERSION,4,2              ## @JSIOCGVERSION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unknown"

	.comm	_GLFW_TRUE,4,2                  ## @GLFW_TRUE
	.comm	_JSIOCGAXES,4,2                 ## @JSIOCGAXES
	.comm	_JSIOCGBUTTONS,4,2              ## @JSIOCGBUTTONS
	.comm	_GLFW_CONNECTED,4,2             ## @GLFW_CONNECTED
	.no_dead_strip	_openJoystickDevice
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function openJoystickDevice
_openJoystickDevice:                    ; @openJoystickDevice
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #368
	.cfi_def_cfa_offset 368
	stp	x26, x25, [sp, #288]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #304]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #320]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #336]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #352]            ; 16-byte Folded Spill
	add	x29, sp, #352
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	add	x8, sp, #16
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x8, #224]
	stp	q0, q0, [x8, #192]
	stp	q0, q0, [x8, #160]
	stp	q0, q0, [x8, #128]
	stp	q0, q0, [sp, #112]
	stp	q0, q0, [sp, #80]
	stp	q0, q0, [sp, #48]
Lloh3:
	adrp	x21, _GLFW_JOYSTICK_1@GOTPAGE
Lloh4:
	ldr	x21, [x21, _GLFW_JOYSTICK_1@GOTPAGEOFF]
	stp	q0, q0, [sp, #16]
	ldr	w20, [x21]
Lloh5:
	adrp	x23, _GLFW_JOYSTICK_LAST@GOTPAGE
Lloh6:
	ldr	x23, [x23, _GLFW_JOYSTICK_LAST@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w20, w8
	b.gt	LBB0_7
; %bb.1:
	sxtw	x9, w20
	sub	x20, x9, #1
	mov	w10, #56
	mul	x24, x9, x10
Lloh7:
	adrp	x25, __glfw@GOTPAGE
Lloh8:
	ldr	x25, [x25, __glfw@GOTPAGEOFF]
Lloh9:
	adrp	x22, _GLFW_FALSE@GOTPAGE
Lloh10:
	ldr	x22, [x22, _GLFW_FALSE@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x23]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x20, x20, #1
	add	x24, x24, #56
	cmp	x20, w8, sxtw
	b.ge	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x25]
	add	x9, x9, x24
	ldr	w10, [x9, #48]
	cbz	w10, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x9, #32]
	mov	x1, x19
	bl	_strcmp
	cbnz	x0, LBB0_2
	b	LBB0_18
LBB0_6:
	ldr	w20, [x21]
LBB0_7:
	cmp	w20, w8
	b.le	LBB0_9
LBB0_8:
Lloh11:
	adrp	x22, _GLFW_FALSE@GOTPAGE
Lloh12:
	ldr	x22, [x22, _GLFW_FALSE@GOTPAGEOFF]
	b	LBB0_18
LBB0_9:
Lloh13:
	adrp	x23, __glfw@GOTPAGE
Lloh14:
	ldr	x23, [x23, __glfw@GOTPAGEOFF]
	ldr	x9, [x23]
	add	w8, w8, #1
	mov	x10, x20
	sbfiz	x24, x10, #32, #32
	mov	w10, #56
	smaddl	x9, w20, w10, x9
	add	x9, x9, #48
	mov	x10, #4294967296
Lloh15:
	adrp	x22, _GLFW_FALSE@GOTPAGE
Lloh16:
	ldr	x22, [x22, _GLFW_FALSE@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9]
	cbz	w11, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x24, x24, x10
	add	w20, w20, #1
	add	x9, x9, #56
	cmp	w8, w20
	b.ne	LBB0_10
	b	LBB0_18
LBB0_12:
Lloh17:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh21:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_open
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.13:
	mov	x21, x0
Lloh23:
	adrp	x8, _JSIOCGVERSION@GOTPAGE
Lloh24:
	ldr	x8, [x8, _JSIOCGVERSION@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	add	x8, sp, #8
	str	x8, [sp]
	bl	_ioctl
	ldr	w8, [sp, #8]
	cmp	w8, #16, lsl #12                ; =65536
	b.ge	LBB0_15
; %bb.14:
	mov	x0, x21
	bl	_close
	b	LBB0_8
LBB0_15:
	mov	w0, #256
	bl	_JSIOCGNAME
	mov	x1, x0
	add	x8, sp, #16
	str	x8, [sp]
	mov	x0, x21
	bl	_ioctl
	tbz	x0, #63, LBB0_17
; %bb.16:
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #16
	mov	w2, #256
	bl	_strncpy
LBB0_17:
	ldr	x8, [x23]
	asr	x9, x24, #32
Lloh28:
	adrp	x22, _GLFW_TRUE@GOTPAGE
Lloh29:
	ldr	x22, [x22, _GLFW_TRUE@GOTPAGEOFF]
	ldr	w10, [x22]
	mov	w11, #56
	madd	x23, x9, x11, x8
	str	w10, [x23, #48]
	add	x0, sp, #16
	bl	_strdup
	str	x0, [x23, #40]
	mov	x0, x19
	bl	_strdup
	str	x0, [x23, #32]
	str	w21, [x23]
Lloh30:
	adrp	x8, _JSIOCGAXES@GOTPAGE
Lloh31:
	ldr	x8, [x8, _JSIOCGAXES@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	add	x8, sp, #15
	str	x8, [sp]
	mov	x0, x21
	bl	_ioctl
	ldrsb	w0, [sp, #15]
	str	w0, [x23, #4]
	mov	w1, #4
	bl	_calloc
	str	x0, [x23, #24]
Lloh33:
	adrp	x8, _JSIOCGBUTTONS@GOTPAGE
Lloh34:
	ldr	x8, [x8, _JSIOCGBUTTONS@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	add	x8, sp, #14
	str	x8, [sp]
	mov	x0, x21
	bl	_ioctl
	ldrsb	w0, [sp, #14]
	str	w0, [x23, #8]
	mov	w1, #1
	bl	_calloc
	str	x0, [x23, #16]
Lloh36:
	adrp	x8, _GLFW_CONNECTED@GOTPAGE
Lloh37:
	ldr	x8, [x8, _GLFW_CONNECTED@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x0, x20
	bl	__glfwInputJoystickChange
LBB0_18:
	ldr	w0, [x22]
	ldur	x8, [x29, #-72]
Lloh39:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh40:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_20
; %bb.19:
	ldp	x29, x30, [sp, #352]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #336]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #320]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #304]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #288]            ; 16-byte Folded Reload
	add	sp, sp, #368
	ret
LBB0_20:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_GLFW_JOYSTICK_1,4,2            ; @GLFW_JOYSTICK_1
	.comm	_GLFW_JOYSTICK_LAST,4,2         ; @GLFW_JOYSTICK_LAST
	.comm	__glfw,8,3                      ; @_glfw
	.comm	_GLFW_FALSE,4,2                 ; @GLFW_FALSE
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_JSIOCGVERSION,4,2              ; @JSIOCGVERSION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown"

	.comm	_GLFW_TRUE,4,2                  ; @GLFW_TRUE
	.comm	_JSIOCGAXES,4,2                 ; @JSIOCGAXES
	.comm	_JSIOCGBUTTONS,4,2              ; @JSIOCGBUTTONS
	.comm	_GLFW_CONNECTED,4,2             ; @GLFW_CONNECTED
	.no_dead_strip	_openJoystickDevice
.subsections_via_symbols
