	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiimod_pro_calib_store
_wiimod_pro_calib_store:                ## @wiimod_pro_calib_store
	.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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	callq	_dev_to_wii
	movq	%rax, %r15
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	$5, %edx
	callq	_strncmp
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	leaq	-56(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	leaq	-40(%rbp), %r8
	leaq	-32(%rbp), %r9
	movq	%r14, %rdi
	callq	_sscanf
	cmpl	$4, %eax
	jne	LBB0_3
## %bb.4:
	movq	%r15, %rbx
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irq
	movq	_WIIPROTO_FLAG_PRO_CALIB_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 12(%r15)
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
	movq	-56(%rbp), %rax
	movq	(%r15), %rcx
	movq	%rax, (%rcx)
	movq	-48(%rbp), %rax
	movq	(%r15), %rcx
	movq	%rax, 8(%rcx)
	movq	-40(%rbp), %rax
	movq	(%r15), %rcx
	movq	%rax, 16(%rcx)
	movq	-32(%rbp), %rax
	movq	(%r15), %rcx
	movq	%rax, 24(%rcx)
	jmp	LBB0_5
LBB0_1:
	movq	%r15, %rbx
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irq
	movq	_WIIPROTO_FLAG_PRO_CALIB_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 12(%r15)
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
LBB0_5:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_strnlen
	jmp	LBB0_6
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"scan\n"

	.comm	_WIIPROTO_FLAG_PRO_CALIB_DONE,4,2 ## @WIIPROTO_FLAG_PRO_CALIB_DONE
L_.str.1:                               ## @.str.1
	.asciz	"%hd:%hd %hd:%hd"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.no_dead_strip	_wiimod_pro_calib_store
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiimod_pro_calib_store
_wiimod_pro_calib_store:                ; @wiimod_pro_calib_store
	.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
	mov	x19, x2
	bl	_dev_to_wii
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #5
	bl	_strncmp
	cbz	w0, LBB0_3
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #24
	add	x3, sp, #16
	add	x4, sp, #8
	mov	x5, sp
	mov	x0, x19
	bl	_sscanf
	cmp	w0, #4
	b.ne	LBB0_5
; %bb.2:
	add	x21, x20, #8
	mov	x0, x21
	bl	_spin_lock_irq
Lloh4:
	adrp	x8, _WIIPROTO_FLAG_PRO_CALIB_DONE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _WIIPROTO_FLAG_PRO_CALIB_DONE@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	w9, [x20, #12]
	orr	w8, w9, w8
	str	w8, [x20, #12]
	mov	x0, x21
	bl	_spin_unlock_irq
	ldr	x8, [sp, #24]
	ldr	x9, [x20]
	str	x8, [x9]
	ldr	x8, [sp, #16]
	ldr	x9, [x20]
	str	x8, [x9, #8]
	ldr	x8, [sp, #8]
	ldr	x9, [x20]
	str	x8, [x9, #16]
	ldr	x8, [sp]
	ldr	x9, [x20]
	str	x8, [x9, #24]
	b	LBB0_4
LBB0_3:
	add	x21, x20, #8
	mov	x0, x21
	bl	_spin_lock_irq
Lloh7:
	adrp	x8, _WIIPROTO_FLAG_PRO_CALIB_DONE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _WIIPROTO_FLAG_PRO_CALIB_DONE@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	ldr	w9, [x20, #12]
	bic	w8, w9, w8
	str	w8, [x20, #12]
	mov	x0, x21
	bl	_spin_unlock_irq
LBB0_4:
Lloh10:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_strnlen
	b	LBB0_6
LBB0_5:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"scan\n"

	.comm	_WIIPROTO_FLAG_PRO_CALIB_DONE,4,2 ; @WIIPROTO_FLAG_PRO_CALIB_DONE
l_.str.1:                               ; @.str.1
	.asciz	"%hd:%hd %hd:%hd"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.no_dead_strip	_wiimod_pro_calib_store
.subsections_via_symbols
