	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rwebpad_joypad_init
_rwebpad_joypad_init:                   ## @rwebpad_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_emscripten_sample_gamepad_data
	movq	_EMSCRIPTEN_RESULT_NOT_SUPPORTED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.1:
	movq	_g_rwebpad_initialized@GOTPCREL(%rip), %rax
	movl	$1, %ebx
	cmpl	$0, (%rax)
	jne	LBB0_6
## %bb.2:
	movl	$1, (%rax)
	movq	_rwebpad_gamepad_cb@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_emscripten_set_gamepadconnected_callback
	movq	_EMSCRIPTEN_RESULT_SUCCESS@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	callq	_RARCH_ERR
LBB0_4:
	movl	(%r14), %edx
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_emscripten_set_gamepaddisconnected_callback
	cmpq	(%r15), %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	movq	%rax, %rsi
	callq	_RARCH_ERR
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EMSCRIPTEN_RESULT_NOT_SUPPORTED,8,3 ## @EMSCRIPTEN_RESULT_NOT_SUPPORTED
	.comm	_g_rwebpad_initialized,4,2      ## @g_rwebpad_initialized
	.comm	_rwebpad_gamepad_cb,4,2         ## @rwebpad_gamepad_cb
	.comm	_EMSCRIPTEN_RESULT_SUCCESS,8,3  ## @EMSCRIPTEN_RESULT_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[EMSCRIPTEN/PAD] failed to create connect callback: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"[EMSCRIPTEN/PAD] failed to create disconnect callback: %d\n"

	.no_dead_strip	_rwebpad_joypad_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rwebpad_joypad_init
_rwebpad_joypad_init:                   ; @rwebpad_joypad_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_emscripten_sample_gamepad_data
Lloh0:
	adrp	x8, _EMSCRIPTEN_RESULT_NOT_SUPPORTED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EMSCRIPTEN_RESULT_NOT_SUPPORTED@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_8
LBB0_2:
Lloh3:
	adrp	x8, _g_rwebpad_initialized@GOTPAGE
Lloh4:
	ldr	x8, [x8, _g_rwebpad_initialized@GOTPAGEOFF]
	ldr	w9, [x8]
	mov	w0, #1
	cbnz	w9, LBB0_8
; %bb.3:
	str	w0, [x8]
Lloh5:
	adrp	x19, _rwebpad_gamepad_cb@GOTPAGE
Lloh6:
	ldr	x19, [x19, _rwebpad_gamepad_cb@GOTPAGEOFF]
	ldr	w2, [x19]
	mov	x0, #0
	mov	w1, #0
	bl	_emscripten_set_gamepadconnected_callback
Lloh7:
	adrp	x20, _EMSCRIPTEN_RESULT_SUCCESS@GOTPAGE
Lloh8:
	ldr	x20, [x20, _EMSCRIPTEN_RESULT_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x20]
	cmp	x0, x8
	b.eq	LBB0_5
; %bb.4:
	mov	x1, x0
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_ERR
LBB0_5:
	ldr	w2, [x19]
	mov	x0, #0
	mov	w1, #0
	bl	_emscripten_set_gamepaddisconnected_callback
	ldr	x8, [x20]
	cmp	x0, x8
	b.eq	LBB0_7
; %bb.6:
	mov	x1, x0
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_RARCH_ERR
LBB0_7:
	mov	w0, #1
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EMSCRIPTEN_RESULT_NOT_SUPPORTED,8,3 ; @EMSCRIPTEN_RESULT_NOT_SUPPORTED
	.comm	_g_rwebpad_initialized,4,2      ; @g_rwebpad_initialized
	.comm	_rwebpad_gamepad_cb,4,2         ; @rwebpad_gamepad_cb
	.comm	_EMSCRIPTEN_RESULT_SUCCESS,8,3  ; @EMSCRIPTEN_RESULT_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[EMSCRIPTEN/PAD] failed to create connect callback: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"[EMSCRIPTEN/PAD] failed to create disconnect callback: %d\n"

	.no_dead_strip	_rwebpad_joypad_init
.subsections_via_symbols
