	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiimote_hid_probe
_wiimote_hid_probe:                     ## @wiimote_hid_probe
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_HID_QUIRK_NO_INIT_REPORTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%rdi)
	callq	_wiimote_create
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_hid_parse
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_hid_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_19
LBB0_5:
	movq	_HID_CONNECT_HIDRAW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_hid_hw_start
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r15d
	leaq	L_.str.2(%rip), %rsi
LBB0_4:
	movq	%rbx, %rdi
	callq	_hid_err
LBB0_10:
	movl	4(%r14), %edi
	callq	_input_free_device
	movl	(%r14), %edi
	callq	_input_free_device
	movq	%r14, %rdi
	callq	_kfree
LBB0_19:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%rbx, %rdi
	callq	_hid_hw_open
	testl	%eax, %eax
	je	LBB0_11
## %bb.8:
	movl	%eax, %r15d
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_hid_err
	jmp	LBB0_9
LBB0_11:
	movq	_dev_attr_extension@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_device_create_file
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:
	movl	%eax, %r15d
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	callq	_hid_err
	jmp	LBB0_13
LBB0_14:
	movq	_dev_attr_devtype@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_device_create_file
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %r15d
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	callq	_hid_err
	movq	8(%r14), %rdi
	movq	_dev_attr_extension@GOTPCREL(%rip), %rsi
	callq	_device_remove_file
LBB0_13:
	movq	%rbx, %rdi
	callq	_hid_hw_close
LBB0_9:
	movq	%rbx, %rdi
	callq	_hid_hw_stop
	jmp	LBB0_10
LBB0_16:
	movq	%r14, %rdi
	callq	_wiidebug_init
	testl	%eax, %eax
	je	LBB0_17
## %bb.18:
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_wiimote_destroy
	jmp	LBB0_19
LBB0_17:
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	callq	_hid_info
	movq	%r14, %rdi
	callq	_wiimote_schedule
	xorl	%r15d, %r15d
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_HID_QUIRK_NO_INIT_REPORTS,4,2  ## @HID_QUIRK_NO_INIT_REPORTS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't alloc device\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"HID parse failed\n"

	.comm	_HID_CONNECT_HIDRAW,4,2         ## @HID_CONNECT_HIDRAW
L_.str.2:                               ## @.str.2
	.asciz	"HW start failed\n"

L_.str.3:                               ## @.str.3
	.asciz	"cannot start hardware I/O\n"

	.comm	_dev_attr_extension,4,2         ## @dev_attr_extension
L_.str.4:                               ## @.str.4
	.asciz	"cannot create sysfs attribute\n"

	.comm	_dev_attr_devtype,4,2           ## @dev_attr_devtype
L_.str.5:                               ## @.str.5
	.asciz	"New device registered\n"

	.no_dead_strip	_wiimote_hid_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiimote_hid_probe
_wiimote_hid_probe:                     ; @wiimote_hid_probe
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x0
Lloh0:
	adrp	x8, _HID_QUIRK_NO_INIT_REPORTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HID_QUIRK_NO_INIT_REPORTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x0, #4]
	orr	w8, w9, w8
	str	w8, [x0, #4]
	bl	_wiimote_create
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	mov	x0, x20
	bl	_hid_parse
	cbz	w0, LBB0_4
; %bb.2:
	mov	x21, x0
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_3:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_hid_err
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_4:
Lloh10:
	adrp	x8, _HID_CONNECT_HIDRAW@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HID_CONNECT_HIDRAW@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_hid_hw_start
	cbz	w0, LBB0_9
; %bb.5:
	mov	x21, x0
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_6:
	mov	x0, x20
	bl	_hid_err
LBB0_7:
	ldr	w0, [x19, #4]
	bl	_input_free_device
	ldr	w0, [x19]
	bl	_input_free_device
	mov	x0, x19
	bl	_kfree
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	x0, x20
	bl	_hid_hw_open
	cbz	w0, LBB0_11
; %bb.10:
	mov	x21, x0
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_hid_err
	b	LBB0_16
LBB0_11:
Lloh17:
	adrp	x1, _dev_attr_extension@GOTPAGE
Lloh18:
	ldr	x1, [x1, _dev_attr_extension@GOTPAGEOFF]
	mov	x0, x20
	bl	_device_create_file
	cbz	w0, LBB0_13
; %bb.12:
	mov	x21, x0
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_hid_err
	b	LBB0_15
LBB0_13:
Lloh21:
	adrp	x1, _dev_attr_devtype@GOTPAGE
Lloh22:
	ldr	x1, [x1, _dev_attr_devtype@GOTPAGEOFF]
	mov	x0, x20
	bl	_device_create_file
	cbz	w0, LBB0_17
; %bb.14:
	mov	x21, x0
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_hid_err
	ldr	x0, [x19, #8]
Lloh25:
	adrp	x1, _dev_attr_extension@GOTPAGE
Lloh26:
	ldr	x1, [x1, _dev_attr_extension@GOTPAGEOFF]
	bl	_device_remove_file
LBB0_15:
	mov	x0, x20
	bl	_hid_hw_close
LBB0_16:
	mov	x0, x20
	bl	_hid_hw_stop
	b	LBB0_7
LBB0_17:
	mov	x0, x19
	bl	_wiidebug_init
	mov	x21, x0
	cbz	w0, LBB0_19
; %bb.18:
	mov	x0, x19
	bl	_wiimote_destroy
	b	LBB0_8
LBB0_19:
Lloh27:
	adrp	x1, l_.str.5@PAGE
Lloh28:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	_hid_info
	mov	x0, x19
	bl	_wiimote_schedule
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_HID_QUIRK_NO_INIT_REPORTS,4,2  ; @HID_QUIRK_NO_INIT_REPORTS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't alloc device\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"HID parse failed\n"

	.comm	_HID_CONNECT_HIDRAW,4,2         ; @HID_CONNECT_HIDRAW
l_.str.2:                               ; @.str.2
	.asciz	"HW start failed\n"

l_.str.3:                               ; @.str.3
	.asciz	"cannot start hardware I/O\n"

	.comm	_dev_attr_extension,4,2         ; @dev_attr_extension
l_.str.4:                               ; @.str.4
	.asciz	"cannot create sysfs attribute\n"

	.comm	_dev_attr_devtype,4,2           ; @dev_attr_devtype
l_.str.5:                               ; @.str.5
	.asciz	"New device registered\n"

	.no_dead_strip	_wiimote_hid_probe
.subsections_via_symbols
