	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wacom_set_device_mode
_wacom_set_device_mode:                 ## @wacom_set_device_mode
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rsi), %rax
	movq	(%rdi), %rcx
	movq	_HID_FEATURE_REPORT@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	(%rcx,%rdx,8), %rcx
	movq	(%rcx,%rax,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.3:
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_hid_alloc_report_buf
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r13
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_hid_report_len
	movq	(%r12), %rcx
	movl	$-1, %r14d
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, (%r13)
	movq	8(%r12), %rcx
	movq	%rcx, 8(%r13)
	movq	%r13, %r12
	movq	_HID_FEATURE_REPORT@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%r12, %rdx
	movl	%eax, %r13d
	movl	%eax, %ecx
	movl	$1, %r8d
	callq	_wacom_set_report
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_HID_FEATURE_REPORT@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	movl	%r13d, %r15d
	movl	%r13d, %ecx
	movl	$1, %r8d
	callq	_wacom_get_report
	movl	%eax, %ebx
	testl	%eax, %eax
	movq	%r12, %r13
	js	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	(%r12), %rcx
	cmpq	%rcx, 8(%r13)
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	incl	%r14d
	movq	_WAC_MSG_RETRIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	movl	%r15d, %eax
	jl	LBB0_6
	jmp	LBB0_11
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_7:
	movl	%eax, %ebx
	movq	%r12, %r13
LBB0_11:
	movq	%r13, %rdi
	callq	_kfree
	movl	%ebx, %eax
	sarl	$31, %eax
	andl	%ebx, %eax
LBB0_12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_HID_FEATURE_REPORT,8,3         ## @HID_FEATURE_REPORT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_WAC_MSG_RETRIES,4,2            ## @WAC_MSG_RETRIES
	.no_dead_strip	_wacom_set_device_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wacom_set_device_mode
_wacom_set_device_mode:                 ; @wacom_set_device_mode
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x8, [x1]
Lloh0:
	adrp	x24, _HID_FEATURE_REPORT@GOTPAGE
Lloh1:
	ldr	x24, [x24, _HID_FEATURE_REPORT@GOTPAGEOFF]
	ldr	x9, [x0]
	ldr	x10, [x24]
	ldr	x9, [x9, x10, lsl #3]
	ldr	x22, [x9, x8, lsl #3]
	cbz	x22, LBB0_7
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_hid_alloc_report_buf
	cbz	x0, LBB0_8
; %bb.2:
	mov	x21, x0
	mov	x0, x22
	bl	_hid_report_len
	mov	x22, x0
	ldr	x8, [x19]
	mov	w25, #-1
Lloh5:
	adrp	x26, _WAC_MSG_RETRIES@GOTPAGE
Lloh6:
	ldr	x26, [x26, _WAC_MSG_RETRIES@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	str	x8, [x21]
	ldr	x8, [x19, #8]
	str	x8, [x21, #8]
	ldr	x1, [x24]
	mov	x0, x20
	mov	x2, x21
	mov	x3, x22
	mov	w4, #1
	bl	_wacom_set_report
	tbnz	w0, #31, LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x1, [x24]
	mov	x0, x20
	mov	x2, x21
	mov	x3, x22
	mov	w4, #1
	bl	_wacom_get_report
	mov	x23, x0
	tbnz	w0, #31, LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x21, #8]
	ldr	x8, [x19]
	cmp	x9, x8
	b.eq	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x26]
	add	w25, w25, #1
	cmp	w25, w9
	b.lt	LBB0_3
	b	LBB0_11
LBB0_7:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_10:
	mov	x23, x0
LBB0_11:
	mov	x0, x21
	bl	_kfree
	cmp	w23, #0
	csel	w0, w23, wzr, lt
LBB0_12:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_HID_FEATURE_REPORT,8,3         ; @HID_FEATURE_REPORT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_WAC_MSG_RETRIES,4,2            ; @WAC_MSG_RETRIES
	.no_dead_strip	_wacom_set_device_mode
.subsections_via_symbols
