	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lg4ff_handle_multimode_wheel
_lg4ff_handle_multimode_wheel:          ## @lg4ff_handle_multimode_wheel
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rdi), %rbx
	movq	%rbx, %rsi
	callq	_lg4ff_identify_multimode_wheel
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	_USB_DEVICE_ID_LOGITECH_WHEEL@GOTPCREL(%rip), %rcx
	movq	_LG4FF_MMODE_IS_MULTIMODE@GOTPCREL(%rip), %r12
	cmpq	(%rcx), %rbx
	jne	LBB0_9
## %bb.2:
	cmpq	%rax, %rbx
	je	LBB0_9
## %bb.3:
	movq	_lg4ff_no_autoswitch@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	jne	LBB0_9
## %bb.4:
	movq	%rax, %rdi
	movq	%rax, %rsi
	callq	_lg4ff_get_mode_switch_command
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_lg4ff_switch_compatibility_mode
	testl	%eax, %eax
	je	LBB0_11
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_hid_err
	jmp	LBB0_9
LBB0_7:
	movq	%rbx, (%r14)
	leaq	L_.str(%rip), %rdi
	callq	_dbg_hid
LBB0_8:
	movq	_LG4FF_MMODE_NOT_MULTIMODE@GOTPCREL(%rip), %r12
LBB0_9:
	movl	(%r12), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_hid_err
	jmp	LBB0_8
LBB0_11:
	movq	_LG4FF_MMODE_SWITCHED@GOTPCREL(%rip), %r12
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Wheel is not a multimode wheel\n"

	.comm	_LG4FF_MMODE_NOT_MULTIMODE,4,2  ## @LG4FF_MMODE_NOT_MULTIMODE
	.comm	_USB_DEVICE_ID_LOGITECH_WHEEL,8,3 ## @USB_DEVICE_ID_LOGITECH_WHEEL
	.comm	_lg4ff_no_autoswitch,4,2        ## @lg4ff_no_autoswitch
L_.str.1:                               ## @.str.1
	.asciz	"Invalid product id %X\n"

L_.str.2:                               ## @.str.2
	.asciz	"Unable to switch wheel mode, errno %d\n"

	.comm	_LG4FF_MMODE_IS_MULTIMODE,4,2   ## @LG4FF_MMODE_IS_MULTIMODE
	.comm	_LG4FF_MMODE_SWITCHED,4,2       ## @LG4FF_MMODE_SWITCHED
	.no_dead_strip	_lg4ff_handle_multimode_wheel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lg4ff_handle_multimode_wheel
_lg4ff_handle_multimode_wheel:          ; @lg4ff_handle_multimode_wheel
	.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, x1
	mov	x19, x0
	ldr	x21, [x0]
	mov	x1, x21
	bl	_lg4ff_identify_multimode_wheel
	str	x0, [x20]
	cbz	x0, LBB0_7
; %bb.1:
Lloh0:
	adrp	x8, _USB_DEVICE_ID_LOGITECH_WHEEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _USB_DEVICE_ID_LOGITECH_WHEEL@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x21, x8
	b.ne	LBB0_6
; %bb.2:
Lloh3:
	adrp	x8, _lg4ff_no_autoswitch@GOTPAGE
Lloh4:
	ldr	x8, [x8, _lg4ff_no_autoswitch@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	x21, x0
	ccmp	w8, #0, #0, ne
	b.ne	LBB0_6
; %bb.3:
	mov	x1, x0
	bl	_lg4ff_get_mode_switch_command
	cbz	x0, LBB0_10
; %bb.4:
	mov	x1, x0
	mov	x0, x19
	bl	_lg4ff_switch_compatibility_mode
	cbz	w0, LBB0_11
; %bb.5:
	mov	x2, x0
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_hid_err
LBB0_6:
Lloh8:
	adrp	x8, _LG4FF_MMODE_IS_MULTIMODE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LG4FF_MMODE_IS_MULTIMODE@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
	str	x21, [x20]
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg_hid
LBB0_8:
Lloh12:
	adrp	x8, _LG4FF_MMODE_NOT_MULTIMODE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _LG4FF_MMODE_NOT_MULTIMODE@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
	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_10:
	ldr	w2, [x20]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_hid_err
	b	LBB0_8
LBB0_11:
Lloh16:
	adrp	x8, _LG4FF_MMODE_SWITCHED@GOTPAGE
Lloh17:
	ldr	x8, [x8, _LG4FF_MMODE_SWITCHED@GOTPAGEOFF]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Wheel is not a multimode wheel\n"

	.comm	_LG4FF_MMODE_NOT_MULTIMODE,4,2  ; @LG4FF_MMODE_NOT_MULTIMODE
	.comm	_USB_DEVICE_ID_LOGITECH_WHEEL,8,3 ; @USB_DEVICE_ID_LOGITECH_WHEEL
	.comm	_lg4ff_no_autoswitch,4,2        ; @lg4ff_no_autoswitch
l_.str.1:                               ; @.str.1
	.asciz	"Invalid product id %X\n"

l_.str.2:                               ; @.str.2
	.asciz	"Unable to switch wheel mode, errno %d\n"

	.comm	_LG4FF_MMODE_IS_MULTIMODE,4,2   ; @LG4FF_MMODE_IS_MULTIMODE
	.comm	_LG4FF_MMODE_SWITCHED,4,2       ; @LG4FF_MMODE_SWITCHED
	.no_dead_strip	_lg4ff_handle_multimode_wheel
.subsections_via_symbols
