	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wiiuse_write_data              ## -- Begin function wiiuse_write_data
	.p2align	4, 0x90
_wiiuse_write_data:                     ## @wiiuse_write_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r13d, %r13d
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.1:
	movl	%r8d, %r12d
	movl	%ecx, %r14d
	movq	%rdx, %r15
	movq	%rdi, %rbx
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	callq	_WIIMOTE_IS_CONNECTED
	testl	%eax, %eax
	je	LBB0_6
## %bb.2:
	testq	%r15, %r15
	je	LBB0_6
## %bb.3:
	testl	%r14d, %r14d
	je	LBB0_6
## %bb.4:
	movq	%rbx, %rdi
	callq	___lwp_queue_get
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movl	%r12d, 16(%rax)
	movl	$22, (%rax)
	movq	8(%rax), %r12
	movq	%rax, %r13
	movq	_WM_CMD_WRITE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r12)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%r12)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_BIG_ENDIAN_LONG
	movl	%eax, 8(%r12)
	movl	%r14d, %eax
	andl	$15, %eax
	movl	%eax, (%r12)
	movl	4(%r12), %edi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	movl	4(%r12), %edi
	addl	%r14d, %edi
	movl	$16, %edx
	subl	%r14d, %edx
	xorl	%esi, %esi
	callq	_memset
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	___wiiuse_push_command
	movl	$1, %r13d
LBB0_6:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WM_CMD_WRITE_DATA,4,2          ## @WM_CMD_WRITE_DATA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wiiuse_write_data              ; -- Begin function wiiuse_write_data
	.p2align	2
_wiiuse_write_data:                     ; @wiiuse_write_data
	.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
	cbz	x0, LBB0_6
; %bb.1:
	mov	x24, x4
	mov	x20, x3
	mov	x21, x2
	mov	x23, x1
	mov	x19, x0
	bl	_WIIMOTE_IS_CONNECTED
	cbz	w0, LBB0_6
; %bb.2:
	mov	w0, #0
	cbz	x21, LBB0_6
; %bb.3:
	cbz	w20, LBB0_6
; %bb.4:
	mov	x0, x19
	bl	___lwp_queue_get
	cbz	x0, LBB0_6
; %bb.5:
	mov	x22, x0
	str	w24, [x0, #16]
	mov	w8, #22
	str	w8, [x0]
	ldr	x24, [x0, #8]
Lloh0:
	adrp	x8, _WM_CMD_WRITE_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WM_CMD_WRITE_DATA@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x24, #32]
	stp	xzr, xzr, [x24, #16]
	mov	x0, x23
	bl	_BIG_ENDIAN_LONG
	str	w0, [x24, #8]
	and	w8, w20, #0xf
	str	w8, [x24]
	ldr	w0, [x24, #4]
	mov	x1, x21
	mov	x2, x20
	bl	_memcpy
	ldr	w8, [x24, #4]
	add	w0, w8, w20
	mov	w8, #16
	sub	w2, w8, w20
	mov	w1, #0
	bl	_memset
	mov	x0, x19
	mov	x1, x22
	bl	___wiiuse_push_command
	mov	w0, #1
LBB0_6:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_WM_CMD_WRITE_DATA,4,2          ; @WM_CMD_WRITE_DATA
.subsections_via_symbols
