	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiiproto_req_wmem
_wiiproto_req_wmem:                     ## @wiiproto_req_wmem
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %ebx
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	cmpl	$16, %r8d
	jg	LBB0_2
## %bb.1:
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.4:
	movq	%rcx, %r12
	movl	%esi, %r15d
	leaq	-144(%rbp), %rdi
	xorl	%esi, %esi
	movl	%edx, %r13d
	movl	$88, %edx
	callq	_memset
	movq	_WIIPROTO_REQ_WMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -144(%rbp)
	movl	%r13d, %ecx
	movl	%r13d, %eax
	shrl	$16, %eax
	movzbl	%al, %eax
	movl	%eax, -136(%rbp)
	movzbl	%ch, %eax
	movl	%eax, -132(%rbp)
	movzbl	%cl, %eax
	movl	%eax, -128(%rbp)
	movl	%ebx, -124(%rbp)
	leaq	-120(%rbp), %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	testl	%r15d, %r15d
	jne	LBB0_6
## %bb.5:
	orb	$4, -140(%rbp)
LBB0_6:
	leaq	-140(%rbp), %rsi
	movq	%r14, %rdi
	callq	_wiiproto_keep_rumble
	leaq	-144(%rbp), %rsi
	movq	%r14, %rdi
	movl	$88, %edx
	callq	_wiimote_queue
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	(%r14), %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hid_warn                       ## TAILCALL
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid length %d wmem request\n"

	.comm	_WIIPROTO_REQ_WMEM,4,2          ## @WIIPROTO_REQ_WMEM
	.no_dead_strip	_wiiproto_req_wmem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function wiiproto_req_wmem
lCPI0_0:
	.long	4294967280                      ; 0xfffffff0
	.long	4294967288                      ; 0xfffffff8
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_wiiproto_req_wmem:                     ; @wiiproto_req_wmem
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	mov	x20, x4
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	cmp	w4, #16
	b.gt	LBB0_6
; %bb.1:
	cbz	w20, LBB0_6
; %bb.2:
	mov	x22, x3
	mov	x23, x2
	mov	x21, x1
	mov	x24, sp
	mov	x0, sp
	mov	w1, #0
	mov	w2, #88
	bl	_memset
Lloh3:
	adrp	x8, _WIIPROTO_REQ_WMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WIIPROTO_REQ_WMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp]
	dup.2s	v0, w23
Lloh6:
	adrp	x8, lCPI0_0@PAGE
Lloh7:
	ldr	d1, [x8, lCPI0_0@PAGEOFF]
	ushl.2s	v0, v0, v1
	movi	d1, #0x0000ff000000ff
	and.8b	v0, v0, v1
	str	d0, [sp, #8]
	and	w8, w23, #0xff
	stp	w8, w20, [sp, #16]
	add	x0, x24, #24
	mov	x1, x22
	mov	x2, x20
	bl	_memcpy
	cbnz	w21, LBB0_4
; %bb.3:
	ldr	w8, [sp, #4]
	orr	w8, w8, #0x4
	str	w8, [sp, #4]
LBB0_4:
	add	x1, x24, #4
	mov	x0, x19
	bl	_wiiproto_keep_rumble
	mov	x1, sp
	mov	x0, x19
	mov	w2, #88
	bl	_wiimote_queue
	ldur	x8, [x29, #-56]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.5:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_6:
	ldr	w0, [x19]
	ldur	x8, [x29, #-56]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #160
	b	_hid_warn
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdr	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid length %d wmem request\n"

	.comm	_WIIPROTO_REQ_WMEM,4,2          ; @WIIPROTO_REQ_WMEM
	.no_dead_strip	_wiiproto_req_wmem
.subsections_via_symbols
