	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiimote_handshake
_wiimote_handshake:                     ## @wiimote_handshake
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r15d, %r15d
	testq	%rdi, %rdi
	je	LBB0_31
## %bb.1:
	movq	%rdx, %r12
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	leaq	8(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %ecx
	leaq	LJTI0_0(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$6, %ecx
	ja	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ecx, %eax
	movslq	(%r14,%rax,4), %rax
	addq	%r14, %rax
	jmpq	*%rax
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_WM_RPT_CTRL_STATUS@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jne	LBB0_31
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	8(%r12), %r15d
	notl	%r15d
	movq	_WM_CTRL_STATUS_BYTE1_ATTACHMENT@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	movq	_WIIMOTE_STATE_EXP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_IS_SET
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	testl	%eax, %eax
	movq	_WIIMOTE_STATE_HANDSHAKE_COMPLETE@GOTPCREL(%rip), %r15
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_WIIMOTE_STATE_EXP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_DISABLE_STATE
	movq	_EXP_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_IS_SET
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_DISABLE_STATE
	movq	_WIIMOTE_STATE_HANDSHAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_ENABLE_STATE
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_WIIMOTE_STATE_HANDSHAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_IS_SET
	movl	$2, %ecx
	testl	%eax, %eax
	movl	$0, %r15d
	jne	LBB0_22
	jmp	LBB0_31
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_WM_RPT_BTN@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_WM_RPT_BTN_EXP@GOTPCREL(%rip), %rax
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_wiimote_data_report
	movl	$6, %ecx
	movl	%ecx, (%rbx)
	jmp	LBB0_2
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_WM_RPT_READ@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jne	LBB0_31
## %bb.18:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %edi
	callq	_swap_if_little32
	movl	$2, %ecx
	cmpl	$128, %eax
	jne	LBB0_22
	jmp	LBB0_19
LBB0_20:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_WM_RPT_READ@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jne	LBB0_31
## %bb.21:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	callq	_wiimote_classic_ctrl_handshake
	movl	$3, %ecx
LBB0_22:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%ecx, (%rbx)
	jmp	LBB0_2
LBB0_30:
	movq	_WIIMOTE_STATE_HANDSHAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_ENABLE_STATE
	movq	_WIIMOTE_LED_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_wiimote_set_leds
	movq	%rbx, %rdi
	callq	_wiimote_status
	movl	$1, (%rbx)
	jmp	LBB0_31
LBB0_23:
	movq	_WIIMOTE_STATE_HANDSHAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_DISABLE_STATE
	movq	_WIIMOTE_STATE_HANDSHAKE_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_ENABLE_STATE
	movl	$1, (%rbx)
	movl	4(%rbx), %eax
	movl	$1, %r15d
	cmpq	$3, %rax
	ja	LBB0_31
## %bb.24:
	leaq	LJTI0_1(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_25:
	movq	_WIIMOTE_LED_1@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_27:
	movq	_WIIMOTE_LED_2@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_28:
	movq	_WIIMOTE_LED_3@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_29:
	movq	_WIIMOTE_LED_4@GOTPCREL(%rip), %rax
LBB0_26:
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_wiimote_set_leds
LBB0_31:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	testl	%eax, %eax
	movl	$0, %r15d
	jne	LBB0_31
## %bb.7:
	movq	_WIIMOTE_STATE_EXP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_ENABLE_STATE
	movq	_WIIMOTE_STATE_HANDSHAKE_COMPLETE@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_IS_SET
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_DISABLE_STATE
	movq	_WIIMOTE_STATE_HANDSHAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_WIIMOTE_ENABLE_STATE
LBB0_9:
	movl	$85, -44(%rbp)
	leaq	-44(%rbp), %r15
	movq	%rbx, %rdi
	movl	$77857008, %esi                 ## imm = 0x4A400F0
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	_wiimote_write_data
	movl	$100, %edi
	callq	_retro_sleep
	movl	$0, -44(%rbp)
	movq	%rbx, %rdi
	movl	$77857019, %esi                 ## imm = 0x4A400FB
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	_wiimote_write_data
	movl	$100, %edi
	callq	_retro_sleep
	movq	_WM_EXP_MEM_CALIBR@GOTPCREL(%rip), %rax
	movl	$220, %esi
	addl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_wiimote_read_data
	movl	$4, (%rbx)
	xorl	%r15d, %r15d
	jmp	LBB0_31
LBB0_19:
	movl	$100, %edi
	callq	_retro_sleep
	movq	_WM_EXP_MEM_CALIBR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$16, %edx
	callq	_wiimote_read_data
	movl	$5, (%rbx)
	jmp	LBB0_31
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_30, LBB0_30-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_17, LBB0_17-LJTI0_0
.set L0_0_set_20, LBB0_20-LJTI0_0
.set L0_0_set_23, LBB0_23-LJTI0_0
LJTI0_0:
	.long	L0_0_set_30
	.long	L0_0_set_4
	.long	L0_0_set_14
	.long	L0_0_set_16
	.long	L0_0_set_17
	.long	L0_0_set_20
	.long	L0_0_set_23
.set L0_1_set_25, LBB0_25-LJTI0_1
.set L0_1_set_27, LBB0_27-LJTI0_1
.set L0_1_set_28, LBB0_28-LJTI0_1
.set L0_1_set_29, LBB0_29-LJTI0_1
LJTI0_1:
	.long	L0_1_set_25
	.long	L0_1_set_27
	.long	L0_1_set_28
	.long	L0_1_set_29
	.end_data_region
                                        ## -- End function
	.comm	_WIIMOTE_STATE_HANDSHAKE,4,2    ## @WIIMOTE_STATE_HANDSHAKE
	.comm	_WIIMOTE_LED_NONE,4,2           ## @WIIMOTE_LED_NONE
	.comm	_WM_RPT_CTRL_STATUS,4,2         ## @WM_RPT_CTRL_STATUS
	.comm	_WM_CTRL_STATUS_BYTE1_ATTACHMENT,4,2 ## @WM_CTRL_STATUS_BYTE1_ATTACHMENT
	.comm	_WIIMOTE_STATE_EXP,4,2          ## @WIIMOTE_STATE_EXP
	.comm	_WIIMOTE_STATE_HANDSHAKE_COMPLETE,4,2 ## @WIIMOTE_STATE_HANDSHAKE_COMPLETE
	.comm	_WM_EXP_MEM_CALIBR,4,2          ## @WM_EXP_MEM_CALIBR
	.comm	_EXP_NONE,4,2                   ## @EXP_NONE
	.comm	_WM_RPT_BTN,4,2                 ## @WM_RPT_BTN
	.comm	_WM_RPT_BTN_EXP,4,2             ## @WM_RPT_BTN_EXP
	.comm	_WM_RPT_READ,4,2                ## @WM_RPT_READ
	.comm	_WIIMOTE_LED_1,4,2              ## @WIIMOTE_LED_1
	.comm	_WIIMOTE_LED_2,4,2              ## @WIIMOTE_LED_2
	.comm	_WIIMOTE_LED_3,4,2              ## @WIIMOTE_LED_3
	.comm	_WIIMOTE_LED_4,4,2              ## @WIIMOTE_LED_4
	.comm	_EXP_HANDSHAKE_LEN,4,2          ## @EXP_HANDSHAKE_LEN
	.comm	_WM_EXP_MEM_ENABLE,4,2          ## @WM_EXP_MEM_ENABLE
	.no_dead_strip	_wiimote_handshake
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiimote_handshake
_wiimote_handshake:                     ; @wiimote_handshake
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	cbz	x0, LBB0_28
; %bb.1:
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	mov	x23, x0
	ldr	w8, [x23], #8
Lloh0:
	adrp	x27, lJTI0_0@PAGE
Lloh1:
	add	x27, x27, lJTI0_0@PAGEOFF
Lloh2:
	adrp	x26, _WM_RPT_CTRL_STATUS@GOTPAGE
Lloh3:
	ldr	x26, [x26, _WM_RPT_CTRL_STATUS@GOTPAGEOFF]
Lloh4:
	adrp	x24, _WIIMOTE_STATE_HANDSHAKE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _WIIMOTE_STATE_HANDSHAKE@GOTPAGEOFF]
Lloh6:
	adrp	x25, _WIIMOTE_STATE_HANDSHAKE_COMPLETE@GOTPAGE
Lloh7:
	ldr	x25, [x25, _WIIMOTE_STATE_HANDSHAKE_COMPLETE@GOTPAGEOFF]
Lloh8:
	adrp	x28, _WM_RPT_BTN@GOTPAGE
Lloh9:
	ldr	x28, [x28, _WM_RPT_BTN@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w8, #6
	b.hi	LBB0_2
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w8, w8
	adr	x9, LBB0_4
	ldrb	w10, [x27, x8]
	add	x9, x9, x10, lsl #2
	br	x9
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x26]
	cmp	w8, w22
	b.ne	LBB0_30
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	str	x23, [sp]                       ; 8-byte Folded Spill
	mov	x23, x22
	mov	x22, x27
	mov	x27, x20
	mov	x20, x28
	mov	x28, x26
	ldr	w8, [x21, #8]
Lloh10:
	adrp	x9, _WM_CTRL_STATUS_BYTE1_ATTACHMENT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _WM_CTRL_STATUS_BYTE1_ATTACHMENT@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	bic	w26, w9, w8
Lloh13:
	adrp	x8, _WIIMOTE_STATE_EXP@GOTPAGE
Lloh14:
	ldr	x8, [x8, _WIIMOTE_STATE_EXP@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_WIIMOTE_IS_SET
	cbz	w26, LBB0_29
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	cbz	w0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh16:
	adrp	x8, _WIIMOTE_STATE_EXP@GOTPAGE
Lloh17:
	ldr	x8, [x8, _WIIMOTE_STATE_EXP@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_WIIMOTE_DISABLE_STATE
Lloh19:
	adrp	x8, _EXP_NONE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EXP_NONE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [x19, #12]
	ldr	w1, [x25]
	mov	x0, x19
	bl	_WIIMOTE_IS_SET
	cbz	w0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x25]
	mov	x0, x19
	bl	_WIIMOTE_DISABLE_STATE
	ldr	w1, [x24]
	mov	x0, x19
	bl	_WIIMOTE_ENABLE_STATE
LBB0_9:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x24]
	mov	x0, x19
	bl	_WIIMOTE_IS_SET
	cbz	w0, LBB0_28
; %bb.10:                               ;   in Loop: Header=BB0_2 Depth=1
	mov	x26, x28
	mov	w8, #2
	mov	x28, x20
	mov	x20, x27
	mov	x27, x22
	mov	x22, x23
	ldr	x23, [sp]                       ; 8-byte Folded Reload
	str	w8, [x19]
	b	LBB0_2
LBB0_11:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x28]
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh22:
	adrp	x8, _WM_RPT_BTN_EXP@GOTPAGE
Lloh23:
	ldr	x8, [x8, _WM_RPT_BTN_EXP@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
LBB0_13:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x19
	bl	_wiimote_data_report
	mov	w8, #6
	str	w8, [x19]
	b	LBB0_2
LBB0_14:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh25:
	adrp	x8, _WM_RPT_READ@GOTPAGE
Lloh26:
	ldr	x8, [x8, _WM_RPT_READ@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_30
; %bb.15:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x21]
	bl	_swap_if_little32
	cmp	w0, #128
	b.eq	LBB0_31
; %bb.16:                               ;   in Loop: Header=BB0_2 Depth=1
	mov	w8, #2
	str	w8, [x19]
	b	LBB0_2
LBB0_17:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh28:
	adrp	x8, _WM_RPT_READ@GOTPAGE
Lloh29:
	ldr	x8, [x8, _WM_RPT_READ@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_30
; %bb.18:                               ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x19
	mov	x1, x23
	mov	x2, x21
	mov	x3, x20
	bl	_wiimote_classic_ctrl_handshake
	mov	w8, #3
	str	w8, [x19]
	b	LBB0_2
LBB0_19:
	ldr	w1, [x24]
	mov	x0, x19
	bl	_WIIMOTE_ENABLE_STATE
Lloh31:
	adrp	x8, _WIIMOTE_LED_NONE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _WIIMOTE_LED_NONE@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wiimote_set_leds
	mov	x0, x19
	bl	_wiimote_status
	mov	w0, #0
	mov	w8, #1
LBB0_20:
	str	w8, [x19]
	b	LBB0_28
LBB0_21:
	ldr	w1, [x24]
	mov	x0, x19
	bl	_WIIMOTE_DISABLE_STATE
	ldr	w1, [x25]
	mov	x0, x19
	bl	_WIIMOTE_ENABLE_STATE
	mov	w0, #1
	str	w0, [x19]
	ldr	w8, [x19, #4]
	cmp	w8, #3
	b.hi	LBB0_28
; %bb.22:
Lloh34:
	adrp	x9, lJTI0_1@PAGE
Lloh35:
	add	x9, x9, lJTI0_1@PAGEOFF
	adr	x10, LBB0_23
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_23:
Lloh36:
	adrp	x8, _WIIMOTE_LED_1@GOTPAGE
Lloh37:
	ldr	x8, [x8, _WIIMOTE_LED_1@GOTPAGEOFF]
	b	LBB0_27
LBB0_24:
Lloh38:
	adrp	x8, _WIIMOTE_LED_2@GOTPAGE
Lloh39:
	ldr	x8, [x8, _WIIMOTE_LED_2@GOTPAGEOFF]
	b	LBB0_27
LBB0_25:
Lloh40:
	adrp	x8, _WIIMOTE_LED_3@GOTPAGE
Lloh41:
	ldr	x8, [x8, _WIIMOTE_LED_3@GOTPAGEOFF]
	b	LBB0_27
LBB0_26:
Lloh42:
	adrp	x8, _WIIMOTE_LED_4@GOTPAGE
Lloh43:
	ldr	x8, [x8, _WIIMOTE_LED_4@GOTPAGEOFF]
LBB0_27:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wiimote_set_leds
	mov	w0, #1
LBB0_28:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_29:
	cbz	w0, LBB0_32
LBB0_30:
	mov	w0, #0
	b	LBB0_28
LBB0_31:
	mov	w0, #100
	bl	_retro_sleep
Lloh44:
	adrp	x8, _WM_EXP_MEM_CALIBR@GOTPAGE
Lloh45:
	ldr	x8, [x8, _WM_EXP_MEM_CALIBR@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #16
	bl	_wiimote_read_data
	mov	w0, #0
	mov	w8, #5
	b	LBB0_20
LBB0_32:
Lloh47:
	adrp	x8, _WIIMOTE_STATE_EXP@GOTPAGE
Lloh48:
	ldr	x8, [x8, _WIIMOTE_STATE_EXP@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_WIIMOTE_ENABLE_STATE
	ldr	w1, [x25]
	mov	x0, x19
	bl	_WIIMOTE_IS_SET
	cbz	w0, LBB0_34
; %bb.33:
	ldr	w1, [x25]
	mov	x0, x19
	bl	_WIIMOTE_DISABLE_STATE
	ldr	w1, [x24]
	mov	x0, x19
	bl	_WIIMOTE_ENABLE_STATE
LBB0_34:
	mov	w8, #85
	str	w8, [sp, #12]
	mov	w20, #240
	movk	w20, #1188, lsl #16
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #240
	movk	w1, #1188, lsl #16
	mov	w3, #1
	bl	_wiimote_write_data
	mov	w0, #100
	bl	_retro_sleep
	str	wzr, [sp, #12]
	mov	w8, #11
	orr	w1, w20, w8
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #1
	bl	_wiimote_write_data
	mov	w0, #100
	bl	_retro_sleep
Lloh50:
	adrp	x8, _WM_EXP_MEM_CALIBR@GOTPAGE
Lloh51:
	ldr	x8, [x8, _WM_EXP_MEM_CALIBR@GOTPAGEOFF]
Lloh52:
	ldr	w8, [x8]
	add	w1, w8, #220
	mov	w20, #4
	mov	x0, x19
	mov	w2, #4
	bl	_wiimote_read_data
	mov	w0, #0
	str	w20, [x19]
	b	LBB0_28
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_19-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_11-LBB0_4)>>2
	.byte	(LBB0_12-LBB0_4)>>2
	.byte	(LBB0_14-LBB0_4)>>2
	.byte	(LBB0_17-LBB0_4)>>2
	.byte	(LBB0_21-LBB0_4)>>2
lJTI0_1:
	.byte	(LBB0_23-LBB0_23)>>2
	.byte	(LBB0_24-LBB0_23)>>2
	.byte	(LBB0_25-LBB0_23)>>2
	.byte	(LBB0_26-LBB0_23)>>2
                                        ; -- End function
	.comm	_WIIMOTE_STATE_HANDSHAKE,4,2    ; @WIIMOTE_STATE_HANDSHAKE
	.comm	_WIIMOTE_LED_NONE,4,2           ; @WIIMOTE_LED_NONE
	.comm	_WM_RPT_CTRL_STATUS,4,2         ; @WM_RPT_CTRL_STATUS
	.comm	_WM_CTRL_STATUS_BYTE1_ATTACHMENT,4,2 ; @WM_CTRL_STATUS_BYTE1_ATTACHMENT
	.comm	_WIIMOTE_STATE_EXP,4,2          ; @WIIMOTE_STATE_EXP
	.comm	_WIIMOTE_STATE_HANDSHAKE_COMPLETE,4,2 ; @WIIMOTE_STATE_HANDSHAKE_COMPLETE
	.comm	_WM_EXP_MEM_CALIBR,4,2          ; @WM_EXP_MEM_CALIBR
	.comm	_EXP_NONE,4,2                   ; @EXP_NONE
	.comm	_WM_RPT_BTN,4,2                 ; @WM_RPT_BTN
	.comm	_WM_RPT_BTN_EXP,4,2             ; @WM_RPT_BTN_EXP
	.comm	_WM_RPT_READ,4,2                ; @WM_RPT_READ
	.comm	_WIIMOTE_LED_1,4,2              ; @WIIMOTE_LED_1
	.comm	_WIIMOTE_LED_2,4,2              ; @WIIMOTE_LED_2
	.comm	_WIIMOTE_LED_3,4,2              ; @WIIMOTE_LED_3
	.comm	_WIIMOTE_LED_4,4,2              ; @WIIMOTE_LED_4
	.comm	_EXP_HANDSHAKE_LEN,4,2          ; @EXP_HANDSHAKE_LEN
	.comm	_WM_EXP_MEM_ENABLE,4,2          ; @WM_EXP_MEM_ENABLE
	.no_dead_strip	_wiimote_handshake
.subsections_via_symbols
