	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function linuxraw_joypad_init
_linuxraw_joypad_init:                  ## @linuxraw_joypad_init
	.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	$40, %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)
	movl	$32, %edi
	callq	_epoll_create
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	_linuxraw_epoll@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_MAX_USERS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_7
## %bb.3:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %rsp                 ## 8-byte Reload
	incq	%rbx
	movq	_MAX_USERS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$4, %r15
	cmpq	%rax, %rbx
	jae	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	movq	_PATH_MAX_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r13, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	_linuxraw_pads@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	leaq	(%r12,%r15), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movb	$0, (%r14)
	movl	$-1, (%r12,%r15)
	movq	_input_device_names@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r15), %eax
	movl	%eax, 4(%r12,%r15)
	movq	%r14, %rdi
	movl	%r13d, %esi
	leaq	L_.str(%rip), %rdx
	movl	%ebx, %ecx
	callq	_snprintf
	movl	4(%r12,%r15), %edi
	xorl	%esi, %esi
	leaq	L_.str.1(%rip), %rdx
	movl	%ebx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_input_autoconfigure_connect
	movq	%r14, %rdi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_linuxraw_joypad_init_pad
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	callq	_linuxraw_poll_pad
	jmp	LBB0_6
LBB0_7:
	xorl	%eax, %eax
	callq	_inotify_init
	movq	_linuxraw_inotify@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	testq	%rax, %rax
	js	LBB0_10
## %bb.8:
	movq	%rax, %rbx
	movq	_F_SETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_F_GETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_fcntl
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fcntl
	movq	_IN_DELETE@GOTPCREL(%rip), %rax
	movq	_IN_CREATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	(%r15), %rdi
	movq	_IN_ATTRIB@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	leaq	L_.str.2(%rip), %rsi
	callq	_inotify_add_watch
	movq	_EPOLLIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movq	$0, -80(%rbp)
	movq	_linuxraw_epoll@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_EPOLL_CTL_ADD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r15), %rdx
	leaq	-80(%rbp), %rcx
	callq	_epoll_ctl
	testq	%rax, %rax
	jns	LBB0_10
## %bb.9:
	movq	(%r15), %rbx
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.3(%rip), %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_RARCH_ERR
LBB0_10:
	movq	_linuxraw_hotplug@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movl	$1, %eax
	jmp	LBB0_11
LBB0_1:
	xorl	%eax, %eax
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_13
## %bb.12:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_linuxraw_epoll,4,2             ## @linuxraw_epoll
	.comm	_MAX_USERS,4,2                  ## @MAX_USERS
	.comm	_PATH_MAX_LENGTH,4,2            ## @PATH_MAX_LENGTH
	.comm	_linuxraw_pads,8,3              ## @linuxraw_pads
	.comm	_input_device_names,8,3         ## @input_device_names
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/input/js%u"

L_.str.1:                               ## @.str.1
	.asciz	"linuxraw"

	.comm	_linuxraw_inotify,8,3           ## @linuxraw_inotify
	.comm	_F_SETFL,4,2                    ## @F_SETFL
	.comm	_F_GETFL,4,2                    ## @F_GETFL
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
L_.str.2:                               ## @.str.2
	.asciz	"/dev/input"

	.comm	_IN_DELETE,4,2                  ## @IN_DELETE
	.comm	_IN_CREATE,4,2                  ## @IN_CREATE
	.comm	_IN_ATTRIB,4,2                  ## @IN_ATTRIB
	.comm	_EPOLLIN,4,2                    ## @EPOLLIN
	.comm	_EPOLL_CTL_ADD,4,2              ## @EPOLL_CTL_ADD
L_.str.3:                               ## @.str.3
	.asciz	"Failed to add FD (%d) to epoll list (%s).\n"

	.comm	_errno,4,2                      ## @errno
	.comm	_linuxraw_hotplug,4,2           ## @linuxraw_hotplug
	.no_dead_strip	_linuxraw_joypad_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function linuxraw_joypad_init
_linuxraw_joypad_init:                  ; @linuxraw_joypad_init
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #32
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	mov	w0, #32
	bl	_epoll_create
	tbnz	w0, #31, LBB0_10
; %bb.1:
Lloh3:
	adrp	x8, _linuxraw_epoll@GOTPAGE
Lloh4:
	ldr	x8, [x8, _linuxraw_epoll@GOTPAGEOFF]
Lloh5:
	str	w0, [x8]
Lloh6:
	adrp	x8, _MAX_USERS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX_USERS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cbz	w8, LBB0_6
; %bb.2:
	mov	x26, #0
	mov	w28, #1
Lloh9:
	adrp	x19, l_.str@PAGE
Lloh10:
	add	x19, x19, l_.str@PAGEOFF
Lloh11:
	adrp	x20, l_.str.1@PAGE
Lloh12:
	add	x20, x20, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	sp, x24
Lloh13:
	adrp	x8, _MAX_USERS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MAX_USERS@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	add	x9, x28, #1
	add	x26, x26, #4
	cmp	x28, x8
	mov	x28, x9
	b.hs	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x24, sp
Lloh16:
	adrp	x8, _PATH_MAX_LENGTH@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PATH_MAX_LENGTH@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x9, x1
Lloh19:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh20:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x1, #15
	and	x9, x9, #0x1fffffff0
	sub	x22, x8, x9
	mov	sp, x22
Lloh21:
	adrp	x8, _linuxraw_pads@GOTPAGE
Lloh22:
	ldr	x8, [x8, _linuxraw_pads@GOTPAGEOFF]
Lloh23:
	ldr	x25, [x8]
	add	x21, x25, x26
	strb	wzr, [x22]
	mov	w8, #-1
	str	w8, [x21]
Lloh24:
	adrp	x8, _input_device_names@GOTPAGE
Lloh25:
	ldr	x8, [x8, _input_device_names@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	ldr	w8, [x8, x26]
	lsl	x27, x28, #2
	str	w8, [x25, x27]
	sub	w23, w28, #1
	mov	x0, x22
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x2, x19
	mov	x3, x23
	bl	_snprintf
	ldr	w0, [x25, x27]
	mov	x1, #0
	mov	x2, x20
	mov	x3, x23
	mov	w4, #0
	mov	w5, #0
	bl	_input_autoconfigure_connect
	mov	x0, x22
	mov	x1, x21
	bl	_linuxraw_joypad_init_pad
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_linuxraw_poll_pad
	b	LBB0_3
LBB0_6:
	bl	_inotify_init
Lloh27:
	adrp	x21, _linuxraw_inotify@GOTPAGE
Lloh28:
	ldr	x21, [x21, _linuxraw_inotify@GOTPAGEOFF]
	str	x0, [x21]
	tbnz	x0, #63, LBB0_9
; %bb.7:
	mov	x19, x0
Lloh29:
	adrp	x8, _F_SETFL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _F_SETFL@GOTPAGEOFF]
Lloh31:
	ldr	w20, [x8]
Lloh32:
	adrp	x8, _F_GETFL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _F_GETFL@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	bl	_fcntl
Lloh35:
	adrp	x8, _O_NONBLOCK@GOTPAGE
Lloh36:
	ldr	x8, [x8, _O_NONBLOCK@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	orr	w8, w8, w0
	str	x8, [sp, #-16]!
	mov	x0, x19
	mov	x1, x20
	bl	_fcntl
	add	sp, sp, #16
	ldr	x0, [x21]
Lloh38:
	adrp	x8, _IN_DELETE@GOTPAGE
Lloh39:
	ldr	x8, [x8, _IN_DELETE@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
Lloh41:
	adrp	x9, _IN_CREATE@GOTPAGE
Lloh42:
	ldr	x9, [x9, _IN_CREATE@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh44:
	adrp	x9, _IN_ATTRIB@GOTPAGE
Lloh45:
	ldr	x9, [x9, _IN_ATTRIB@GOTPAGEOFF]
Lloh46:
	ldr	w9, [x9]
	orr	w2, w8, w9
Lloh47:
	adrp	x1, l_.str.2@PAGE
Lloh48:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_inotify_add_watch
Lloh49:
	adrp	x8, _EPOLLIN@GOTPAGE
Lloh50:
	ldr	x8, [x8, _EPOLLIN@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
	stur	w8, [x29, #-96]
	stur	xzr, [x29, #-104]
Lloh52:
	adrp	x8, _linuxraw_epoll@GOTPAGE
Lloh53:
	ldr	x8, [x8, _linuxraw_epoll@GOTPAGEOFF]
Lloh54:
	ldr	w0, [x8]
Lloh55:
	adrp	x8, _EPOLL_CTL_ADD@GOTPAGE
Lloh56:
	ldr	x8, [x8, _EPOLL_CTL_ADD@GOTPAGEOFF]
Lloh57:
	ldr	w1, [x8]
	ldr	x2, [x21]
	sub	x3, x29, #104
	bl	_epoll_ctl
	tbz	x0, #63, LBB0_9
; %bb.8:
	ldr	x19, [x21]
Lloh58:
	adrp	x8, _errno@GOTPAGE
Lloh59:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh60:
	ldr	w0, [x8]
	bl	_strerror
	mov	x2, x0
Lloh61:
	adrp	x0, l_.str.3@PAGE
Lloh62:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_RARCH_ERR
LBB0_9:
Lloh63:
	adrp	x8, _linuxraw_hotplug@GOTPAGE
Lloh64:
	ldr	x8, [x8, _linuxraw_hotplug@GOTPAGEOFF]
	mov	w0, #1
Lloh65:
	str	w0, [x8]
	b	LBB0_11
LBB0_10:
	mov	w0, #0
LBB0_11:
	ldur	x8, [x29, #-88]
Lloh66:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh67:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh68:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGotStr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.cfi_endproc
                                        ; -- End function
	.comm	_linuxraw_epoll,4,2             ; @linuxraw_epoll
	.comm	_MAX_USERS,4,2                  ; @MAX_USERS
	.comm	_PATH_MAX_LENGTH,4,2            ; @PATH_MAX_LENGTH
	.comm	_linuxraw_pads,8,3              ; @linuxraw_pads
	.comm	_input_device_names,8,3         ; @input_device_names
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/input/js%u"

l_.str.1:                               ; @.str.1
	.asciz	"linuxraw"

	.comm	_linuxraw_inotify,8,3           ; @linuxraw_inotify
	.comm	_F_SETFL,4,2                    ; @F_SETFL
	.comm	_F_GETFL,4,2                    ; @F_GETFL
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
l_.str.2:                               ; @.str.2
	.asciz	"/dev/input"

	.comm	_IN_DELETE,4,2                  ; @IN_DELETE
	.comm	_IN_CREATE,4,2                  ; @IN_CREATE
	.comm	_IN_ATTRIB,4,2                  ; @IN_ATTRIB
	.comm	_EPOLLIN,4,2                    ; @EPOLLIN
	.comm	_EPOLL_CTL_ADD,4,2              ; @EPOLL_CTL_ADD
l_.str.3:                               ; @.str.3
	.asciz	"Failed to add FD (%d) to epoll list (%s).\n"

	.comm	_errno,4,2                      ; @errno
	.comm	_linuxraw_hotplug,4,2           ; @linuxraw_hotplug
	.no_dead_strip	_linuxraw_joypad_init
.subsections_via_symbols
