	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_IN_StartupJoystick             ## -- Begin function IN_StartupJoystick
	.p2align	4, 0x90
_IN_StartupJoystick:                    ## @IN_StartupJoystick
	.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	$152, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_joy_fd@GOTPCREL(%rip), %r15
	movl	$-1, (%r15)
	movq	_in_joystick@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	$0, (%rax)
	je	LBB0_8
## %bb.1:
	movq	%rsp, %r14
	movq	_PATH_MAX@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movl	(%r12), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_snprintf
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movq	_O_NONBLOCK@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	orl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_open
	movl	%eax, (%r15)
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.10:
	movq	%r14, %rsp
	movq	%rsp, %r14
	movl	(%r12), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movl	(%r12), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_snprintf
	movl	(%r13), %esi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_open
	movl	%eax, (%r15)
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.11:
	movq	%r14, %rsp
	movq	%rsp, %r14
	movl	(%r12), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movl	(%r12), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	_snprintf
	movl	(%r13), %esi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_open
	movl	%eax, (%r15)
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.12:
	movq	%r14, %rsp
	movq	%rsp, %r14
	movl	(%r12), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movl	(%r12), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	movl	$3, %ecx
	callq	_snprintf
	movl	(%r13), %esi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_open
	movl	%eax, (%r15)
	cmpl	$-1, %eax
	je	LBB0_13
LBB0_2:
	movb	$0, -178(%rbp)
	movb	$0, -177(%rbp)
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_Com_Printf
	leaq	-184(%rbp), %r12
	movq	_JS_EVENT_INIT@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_read
	cmpl	$-1, %eax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rbx), %eax
	testl	%eax, -184(%rbp)
	jne	LBB0_3
LBB0_5:
	movl	(%r15), %edi
	movq	_JSIOCGAXES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-178(%rbp), %rdx
	callq	_ioctl
	movl	(%r15), %edi
	movq	_JSIOCGBUTTONS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-177(%rbp), %rdx
	callq	_ioctl
	movl	(%r15), %ebx
	movl	$128, %edi
	callq	_JSIOCGNAME
	leaq	-176(%rbp), %rdx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ioctl
	testq	%rax, %rax
	jns	LBB0_7
## %bb.6:
	leaq	L_.str.3(%rip), %rsi
	leaq	-176(%rbp), %rdi
	movl	$128, %edx
	callq	_strncpy
LBB0_7:
	leaq	L_.str.4(%rip), %rdi
	leaq	-176(%rbp), %rsi
	xorl	%eax, %eax
	callq	_Com_Printf
	movsbl	-178(%rbp), %esi
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_Com_Printf
	movsbl	-177(%rbp), %esi
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_Com_Printf
	movq	%r14, %rsp
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.9:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_Com_Printf                     ## TAILCALL
LBB0_13:
	movq	%r14, %rsp
	cmpl	$-1, (%r15)
	jne	LBB0_15
## %bb.14:
	leaq	L_.str.7(%rip), %rdi
	xorl	%eax, %eax
	callq	_Com_Printf
	jmp	LBB0_15
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_joy_fd,4,2                     ## @joy_fd
	.comm	_in_joystick,8,3                ## @in_joystick
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Joystick is not active.\n"

	.comm	_PATH_MAX,4,2                   ## @PATH_MAX
L_.str.1:                               ## @.str.1
	.asciz	"/dev/js%d"

	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
L_.str.2:                               ## @.str.2
	.asciz	"Joystick %s found\n"

	.comm	_JS_EVENT_INIT,4,2              ## @JS_EVENT_INIT
	.comm	_JSIOCGAXES,4,2                 ## @JSIOCGAXES
	.comm	_JSIOCGBUTTONS,4,2              ## @JSIOCGBUTTONS
L_.str.3:                               ## @.str.3
	.asciz	"Unknown"

L_.str.4:                               ## @.str.4
	.asciz	"Name:    %s\n"

L_.str.5:                               ## @.str.5
	.asciz	"Axes:    %d\n"

L_.str.6:                               ## @.str.6
	.asciz	"Buttons: %d\n"

L_.str.7:                               ## @.str.7
	.asciz	"No joystick found.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_IN_StartupJoystick             ; -- Begin function IN_StartupJoystick
	.p2align	2
_IN_StartupJoystick:                    ; @IN_StartupJoystick
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #160
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x21, _joy_fd@GOTPAGE
Lloh4:
	ldr	x21, [x21, _joy_fd@GOTPAGEOFF]
	mov	w8, #-1
	str	w8, [x21]
Lloh5:
	adrp	x8, _in_joystick@GOTPAGE
Lloh6:
	ldr	x8, [x8, _in_joystick@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldr	w8, [x8]
	cbz	w8, LBB0_13
; %bb.1:
	mov	x20, sp
Lloh8:
	adrp	x22, _PATH_MAX@GOTPAGE
Lloh9:
	ldr	x22, [x22, _PATH_MAX@GOTPAGEOFF]
	ldr	w8, [x22]
	mov	x9, x8
Lloh10:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh11:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x19, x9, x8
	mov	sp, x19
	ldr	w1, [x22]
Lloh12:
	adrp	x2, l_.str.1@PAGE
Lloh13:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w3, #0
	bl	_snprintf
Lloh14:
	adrp	x23, _O_RDONLY@GOTPAGE
Lloh15:
	ldr	x23, [x23, _O_RDONLY@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh16:
	adrp	x24, _O_NONBLOCK@GOTPAGE
Lloh17:
	ldr	x24, [x24, _O_NONBLOCK@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_open
	str	w0, [x21]
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.2:
	mov	sp, x20
	mov	x20, sp
	ldr	w8, [x22]
	mov	x9, x8
Lloh18:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh19:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x19, x9, x8
	mov	sp, x19
	ldr	w1, [x22]
Lloh20:
	adrp	x2, l_.str.1@PAGE
Lloh21:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w3, #1
	bl	_snprintf
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_open
	str	w0, [x21]
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.3:
	mov	sp, x20
	mov	x20, sp
	ldr	w8, [x22]
	mov	x9, x8
Lloh22:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh23:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x19, x9, x8
	mov	sp, x19
	ldr	w1, [x22]
Lloh24:
	adrp	x2, l_.str.1@PAGE
Lloh25:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w3, #2
	bl	_snprintf
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_open
	str	w0, [x21]
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.4:
	mov	sp, x20
	mov	x20, sp
	ldr	w8, [x22]
	mov	x9, x8
Lloh26:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh27:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x19, x9, x8
	mov	sp, x19
	ldr	w1, [x22]
Lloh28:
	adrp	x2, l_.str.1@PAGE
Lloh29:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w3, #3
	bl	_snprintf
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_open
	str	w0, [x21]
	cmn	w0, #1
	b.eq	LBB0_15
LBB0_5:
	sturh	wzr, [x29, #-194]
	str	x19, [sp, #-16]!
Lloh30:
	adrp	x0, l_.str.2@PAGE
Lloh31:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_Com_Printf
	add	sp, sp, #16
Lloh32:
	adrp	x19, _JS_EVENT_INIT@GOTPAGE
Lloh33:
	ldr	x19, [x19, _JS_EVENT_INIT@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	sub	x1, x29, #192
	mov	w2, #4
	bl	_read
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldur	w8, [x29, #-192]
	ldr	w9, [x19]
	tst	w9, w8
	b.ne	LBB0_6
LBB0_8:
	ldr	w0, [x21]
Lloh34:
	adrp	x8, _JSIOCGAXES@GOTPAGE
Lloh35:
	ldr	x8, [x8, _JSIOCGAXES@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	sub	x2, x29, #193
	bl	_ioctl
	ldr	w0, [x21]
Lloh37:
	adrp	x8, _JSIOCGBUTTONS@GOTPAGE
Lloh38:
	ldr	x8, [x8, _JSIOCGBUTTONS@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	sub	x2, x29, #194
	bl	_ioctl
	ldr	w19, [x21]
	mov	w0, #128
	bl	_JSIOCGNAME
	mov	x1, x0
	sub	x21, x29, #184
	sub	x2, x29, #184
	mov	x0, x19
	bl	_ioctl
	tbz	x0, #63, LBB0_10
; %bb.9:
Lloh40:
	adrp	x1, l_.str.3@PAGE
Lloh41:
	add	x1, x1, l_.str.3@PAGEOFF
	sub	x0, x29, #184
	mov	w2, #128
	bl	_strncpy
LBB0_10:
	str	x21, [sp, #-16]!
Lloh42:
	adrp	x0, l_.str.4@PAGE
Lloh43:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_Com_Printf
	add	sp, sp, #16
	ldursb	x8, [x29, #-193]
	str	x8, [sp, #-16]!
Lloh44:
	adrp	x0, l_.str.5@PAGE
Lloh45:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_Com_Printf
	add	sp, sp, #16
	ldursb	x8, [x29, #-194]
	str	x8, [sp, #-16]!
Lloh46:
	adrp	x0, l_.str.6@PAGE
Lloh47:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_Com_Printf
	add	sp, sp, #16
	mov	sp, x20
LBB0_11:
	ldur	x8, [x29, #-56]
Lloh48:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh49:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh50:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.12:
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_13:
	ldur	x8, [x29, #-56]
Lloh51:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh52:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh53:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.14:
Lloh54:
	adrp	x0, l_.str@PAGE
Lloh55:
	add	x0, x0, l_.str@PAGEOFF
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_Com_Printf
LBB0_15:
	mov	sp, x20
	ldr	w8, [x21]
	cmn	w8, #1
	b.ne	LBB0_11
; %bb.16:
Lloh56:
	adrp	x0, l_.str.7@PAGE
Lloh57:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_Com_Printf
	b	LBB0_11
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpAdd	Lloh56, Lloh57
	.cfi_endproc
                                        ; -- End function
	.comm	_joy_fd,4,2                     ; @joy_fd
	.comm	_in_joystick,8,3                ; @in_joystick
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Joystick is not active.\n"

	.comm	_PATH_MAX,4,2                   ; @PATH_MAX
l_.str.1:                               ; @.str.1
	.asciz	"/dev/js%d"

	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
l_.str.2:                               ; @.str.2
	.asciz	"Joystick %s found\n"

	.comm	_JS_EVENT_INIT,4,2              ; @JS_EVENT_INIT
	.comm	_JSIOCGAXES,4,2                 ; @JSIOCGAXES
	.comm	_JSIOCGBUTTONS,4,2              ; @JSIOCGBUTTONS
l_.str.3:                               ; @.str.3
	.asciz	"Unknown"

l_.str.4:                               ; @.str.4
	.asciz	"Name:    %s\n"

l_.str.5:                               ; @.str.5
	.asciz	"Axes:    %d\n"

l_.str.6:                               ; @.str.6
	.asciz	"Buttons: %d\n"

l_.str.7:                               ; @.str.7
	.asciz	"No joystick found.\n"

.subsections_via_symbols
