	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiimote_read_data
_wiimote_read_data:                     ## @wiimote_read_data
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movq	$0, -48(%rbp)
	xorl	%r15d, %r15d
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	movl	%edx, %r14d
	movl	%esi, %r12d
	movq	%rdi, %rbx
	callq	_wiimote_is_connected
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.2:
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%r12d, %edi
	callq	_swap_if_little32
	movl	%eax, -64(%rbp)
	movl	%r14d, %edi
	callq	_swap_if_little16
	movl	%eax, -48(%rbp)
	movq	_WM_CMD_READ_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$6, %ecx
	callq	_wiimote_send
	movl	$1, %r15d
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	movl	%r15d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_WM_CMD_READ_DATA,4,2           ## @WM_CMD_READ_DATA
	.no_dead_strip	_wiimote_read_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiimote_read_data
_wiimote_read_data:                     ; @wiimote_read_data
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	stur	xzr, [sp, #12]
	stur	xzr, [sp, #4]
	str	wzr, [sp, #20]
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_wiimote_is_connected
	mov	x8, x0
	mov	w0, #0
	cbz	w20, LBB0_4
; %bb.2:
	cbz	w8, LBB0_4
; %bb.3:
	mov	x0, x21
	bl	_swap_if_little32
	str	w0, [sp]
	mov	x0, x20
	bl	_swap_if_little16
	str	w0, [sp, #16]
Lloh3:
	adrp	x8, _WM_CMD_READ_DATA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WM_CMD_READ_DATA@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	mov	w3, #6
	bl	_wiimote_send
	mov	w0, #1
LBB0_4:
	ldr	x8, [sp, #24]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_WM_CMD_READ_DATA,4,2           ; @WM_CMD_READ_DATA
	.no_dead_strip	_wiimote_read_data
.subsections_via_symbols
