	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aiptek_query
_aiptek_query:                          ## @aiptek_query
	.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
	movl	%edx, %r12d
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$12, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r15
	movl	$2, (%rax)
	movzbl	%bl, %esi
	movl	%esi, 4(%rax)
	movzbl	%r12b, %edx
	movl	%edx, 8(%rax)
	movq	%r14, %rdi
	callq	_aiptek_command
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	callq	_kfree
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_5:
	movl	8(%r14), %edi
	callq	_msleep
	movq	%r14, %rdi
	movl	$3, %esi
	movl	$2, %edx
	movq	%r15, %rcx
	movl	$12, %r8d
	callq	_aiptek_get_report
	cmpl	$12, %eax
	jne	LBB0_6
## %bb.7:
	movq	%r15, %rdi
	addq	$4, %rdi
	callq	_get_unaligned_le16
	movl	%eax, %ebx
	jmp	LBB0_8
LBB0_6:
	movq	(%r14), %rdi
	movl	(%r15), %edx
	movl	4(%r15), %ecx
	movl	8(%r15), %r8d
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movq	%r15, %rdi
	callq	_kfree
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"aiptek_query failed: returned 0x%02x 0x%02x 0x%02x\n"

	.no_dead_strip	_aiptek_query
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aiptek_query
_aiptek_query:                          ; @aiptek_query
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, x2
	mov	x23, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #12
	bl	_kmalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	mov	w8, #2
	str	w8, [x0]
	mov	x21, x0
	str	w23, [x21, #4]!
	str	w22, [x0, #8]
	mov	x0, x20
	mov	x1, x23
	mov	x2, x22
	bl	_aiptek_command
	cbz	x0, LBB0_5
; %bb.2:
	mov	x0, x19
	bl	_kfree
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_9
LBB0_5:
	ldr	w0, [x20, #8]
	bl	_msleep
	mov	x0, x20
	mov	w1, #3
	mov	w2, #2
	mov	x3, x19
	mov	w4, #12
	bl	_aiptek_get_report
	cmp	w0, #12
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x21
	bl	_get_unaligned_le16
	mov	x20, x0
	b	LBB0_8
LBB0_7:
	ldr	x0, [x20]
	ldp	w2, w3, [x19]
	ldr	w4, [x19, #8]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_8:
	mov	x0, x19
	bl	_kfree
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"aiptek_query failed: returned 0x%02x 0x%02x 0x%02x\n"

	.no_dead_strip	_aiptek_query
.subsections_via_symbols
