	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alps_get_v3_v7_resolution
_alps_get_v3_v7_resolution:             ## @alps_get_v3_v7_resolution
	.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	%esi, %ebx
	movq	%rdi, %r14
	movq	(%rdi), %r12
	callq	_alps_command_mode_read_reg
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_4
## %bb.1:
	incl	%ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_alps_command_mode_read_reg
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movsbl	%r15b, %ecx
	sarl	$3, %ecx
	addl	$36, %ecx
	andl	$-2, %ecx
	shll	$28, %r15d
	sarl	$27, %r15d
	addl	$50, %r15d
	movl	%eax, %esi
	shll	$28, %esi
	sarl	$28, %esi
	leal	17(%rsi), %r8d
	movsbl	%al, %edi
	sarl	$4, %edi
	leal	13(%rdi), %r9d
	addl	$16, %esi
	imull	%r15d, %esi
	addl	$12, %edi
	imull	%ecx, %edi
	movl	4(%r12), %eax
	movl	12(%r12), %ebx
	addl	%eax, %eax
	leal	(%rax,%rax,4), %eax
	cltd
	idivl	%esi
	movl	%eax, %r10d
	movl	%eax, (%r12)
	addl	%ebx, %ebx
	leal	(%rbx,%rbx,4), %eax
	cltd
	idivl	%edi
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, 8(%r12)
	movzwl	%si, %edx
	imull	$52429, %edx, %r11d             ## imm = 0xCCCD
	shrl	$19, %r11d
	movzwl	%di, %edx
	imull	$52429, %edx, %ebx              ## imm = 0xCCCD
	shrl	$19, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %edx
	pushq	%rax
	pushq	%r10
	pushq	%rbx
	pushq	%r11
	callq	_psmouse_dbg
	addq	$32, %rsp
	xorl	%r15d, %r15d
	jmp	LBB0_4
LBB0_2:
	movl	%eax, %r15d
LBB0_4:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pitch %dx%d num-electrodes %dx%d physical size %dx%d mm res %dx%d\n"

	.no_dead_strip	_alps_get_v3_v7_resolution
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alps_get_v3_v7_resolution
_alps_get_v3_v7_resolution:             ; @alps_get_v3_v7_resolution
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x22, [x0]
	bl	_alps_command_mode_read_reg
	mov	x20, x0
	tbnz	w0, #31, LBB0_4
; %bb.1:
	add	w1, w21, #1
	mov	x0, x19
	bl	_alps_command_mode_read_reg
	tbnz	w0, #31, LBB0_3
; %bb.2:
	sbfx	w8, w20, #3, #5
	add	w8, w8, #36
	and	w3, w8, #0xfffffffe
	sbfiz	w8, w20, #1, #4
	add	w2, w8, #50
	sbfx	w8, w0, #0, #4
	add	w4, w8, #17
	sbfx	w9, w0, #4, #4
	add	w5, w9, #13
	add	w8, w8, #16
	mul	w8, w8, w2
	add	w9, w9, #12
	mul	w9, w9, w3
	ldr	w10, [x22, #4]
	add	w10, w10, w10, lsl #2
	lsl	w10, w10, #1
	sdiv	w10, w10, w8
	str	w10, [x22]
	ldr	w11, [x22, #12]
	add	w11, w11, w11, lsl #2
	lsl	w11, w11, #1
	sdiv	w11, w11, w9
	str	w11, [x22, #8]
	and	w8, w8, #0xfffe
	mov	w12, #52429
	mul	w8, w8, w12
	lsr	w6, w8, #19
	and	w8, w9, #0xfffe
	mul	w8, w8, w12
	lsr	w7, w8, #19
	stp	w10, w11, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_psmouse_dbg
	mov	w20, #0
	b	LBB0_4
LBB0_3:
	mov	x20, x0
LBB0_4:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pitch %dx%d num-electrodes %dx%d physical size %dx%d mm res %dx%d\n"

	.no_dead_strip	_alps_get_v3_v7_resolution
.subsections_via_symbols
