	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wiiuse_write_streamdata        ## -- Begin function wiiuse_write_streamdata
	.p2align	4, 0x90
_wiiuse_write_streamdata:               ## @wiiuse_write_streamdata
	.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	%r15d, %r15d
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.1:
	movl	%ecx, %r13d
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	callq	_WIIMOTE_IS_CONNECTED
	testl	%eax, %eax
	je	LBB0_7
## %bb.2:
	cmpl	$20, %r14d
	jg	LBB0_7
## %bb.3:
	testq	%r12, %r12
	je	LBB0_7
## %bb.4:
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.5:
	movq	%rbx, %rdi
	callq	___lwp_queue_get
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	%r13d, 16(%rax)
	movl	$22, (%rax)
	movq	%rax, %r15
	movq	_WM_CMD_STREAM_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r15), %rdi
	movl	%eax, (%rdi)
	leal	(,%r14,8), %eax
	movl	%eax, 4(%rdi)
	addq	$8, %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	___wiiuse_push_command
	movl	$1, %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WM_CMD_STREAM_DATA,4,2         ## @WM_CMD_STREAM_DATA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wiiuse_write_streamdata        ; -- Begin function wiiuse_write_streamdata
	.p2align	2
_wiiuse_write_streamdata:               ; @wiiuse_write_streamdata
	.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_7
; %bb.1:
	mov	x22, x3
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_WIIMOTE_IS_CONNECTED
	cbz	w0, LBB0_7
; %bb.2:
	mov	w0, #0
	cmp	w20, #20
	b.gt	LBB0_7
; %bb.3:
	cbz	x21, LBB0_7
; %bb.4:
	cbz	w20, LBB0_7
; %bb.5:
	mov	x0, x19
	bl	___lwp_queue_get
	cbz	x0, LBB0_7
; %bb.6:
	mov	x23, x0
	str	w22, [x0, #16]
	mov	w8, #22
	str	w8, [x0]
Lloh0:
	adrp	x8, _WM_CMD_STREAM_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WM_CMD_STREAM_DATA@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	x9, [x0, #8]
	lsl	w10, w20, #3
	stp	w8, w10, [x9]
	add	x0, x9, #8
	mov	x1, x21
	mov	x2, x20
	bl	_memcpy
	mov	x0, x19
	mov	x1, x23
	bl	___wiiuse_push_command
	mov	w0, #1
LBB0_7:
	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_STREAM_DATA,4,2         ; @WM_CMD_STREAM_DATA
.subsections_via_symbols
