	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cyapa_gen5_get_query_data
_cyapa_gen5_get_query_data:             ## @cyapa_gen5_get_query_data
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_PIP_READ_SYS_INFO_RESP_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	shlq	$2, %rbx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	%ebx, -36(%rbp)
	movq	_pip_read_sys_info@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PIP_READ_SYS_INFO_CMD_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_cyapa_pip_sort_system_info_data@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	-36(%rbp), %r8
	movq	%r14, %rdi
	movq	%r15, %rcx
	movl	$2000, %r9d                     ## imm = 0x7D0
	pushq	$0
	pushq	%rax
	callq	_cyapa_i2c_pip_cmd_irq_sync
	addq	$16, %rsp
	movl	%eax, %ecx
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movslq	-36(%rbp), %rax
	cmpq	%rax, %rbx
	ja	LBB0_2
## %bb.3:
	leaq	28(%r15), %rdi
	callq	_get_unaligned_le16
	movq	_PIP_PRODUCT_FAMILY_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_PIP_PRODUCT_FAMILY_TRACKPAD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_11
## %bb.4:
	movl	196(%r15), %eax
	movq	_PIP_BL_PLATFORM_VER_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movq	_PIP_BL_PLATFORM_VER_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, (%r14)
	movq	8(%r14), %rcx
	movq	_CYAPA_GEN5@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	sete	%cl
	cmpl	$2, %eax
	setl	%al
	leaq	36(%r15), %rdx
	leaq	60(%r15), %rsi
	leaq	40(%r15), %rdi
	testb	%al, %cl
	cmovneq	%rsi, %rdx
	leaq	64(%r15), %rax
	cmoveq	%rdi, %rax
	movl	(%rax), %eax
	movl	(%rdx), %ecx
	movl	%ecx, 16(%r14)
	movl	%eax, 20(%r14)
	movl	208(%r15), %eax
	movl	%eax, 24(%r14)
	movl	212(%r15), %eax
	movl	%eax, 28(%r14)
	leaq	216(%r15), %rdi
	callq	_get_unaligned_le16
	cltq
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$32, %rax
	sarl	$5, %eax
	addl	%ecx, %eax
	movl	%eax, 32(%r14)
	leaq	224(%r15), %rdi
	callq	_get_unaligned_le16
	cltq
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$32, %rax
	sarl	$5, %eax
	addl	%ecx, %eax
	movl	%eax, 36(%r14)
	leaq	232(%r15), %rdi
	callq	_get_unaligned_le16
	movl	%eax, 40(%r14)
	leaq	240(%r15), %rdi
	callq	_get_unaligned_le16
	movl	%eax, 44(%r14)
	leaq	248(%r15), %rdi
	callq	_get_unaligned_le16
	movl	%eax, 48(%r14)
	movl	256(%r15), %eax
	andl	$1, %eax
	movl	%eax, 52(%r14)
	movl	260(%r15), %eax
	andl	$1, %eax
	movl	%eax, 56(%r14)
	movl	280(%r15), %eax
	shll	$3, %eax
	movq	_CAPABILITY_BTN_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, 60(%r14)
	movq	64(%r14), %rdi
	leaq	132(%r15), %rsi
	movl	$5, %edx
	callq	_memcpy
	movq	64(%r14), %rax
	movb	$45, 5(%rax)
	movq	64(%r14), %rdi
	addq	$6, %rdi
	leaq	152(%r15), %rsi
	movl	$6, %edx
	callq	_memcpy
	movq	64(%r14), %rax
	movb	$45, 12(%rax)
	movq	64(%r14), %rdi
	addq	$13, %rdi
	addq	$176, %r15
	movq	%r15, %rsi
	movl	$2, %edx
	callq	_memcpy
	movq	64(%r14), %rax
	movb	$0, 15(%rax)
	cmpl	$0, 24(%r14)
	je	LBB0_11
## %bb.5:
	cmpl	$0, 28(%r14)
	je	LBB0_11
## %bb.6:
	cmpl	$0, 32(%r14)
	je	LBB0_11
## %bb.7:
	cmpl	$0, 36(%r14)
	je	LBB0_11
## %bb.8:
	cmpl	$0, 40(%r14)
	je	LBB0_11
## %bb.9:
	cmpl	$0, 44(%r14)
	je	LBB0_11
## %bb.10:
	xorl	%eax, %eax
	cmpl	$0, 48(%r14)
	jne	LBB0_12
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_2:
	movq	_EIO@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	subl	(%rdx), %eax
	testl	%ecx, %ecx
	cmovnel	%ecx, %eax
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_14
## %bb.13:
	leaq	-24(%rbp), %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PIP_READ_SYS_INFO_RESP_LENGTH,4,2 ## @PIP_READ_SYS_INFO_RESP_LENGTH
	.comm	_pip_read_sys_info,4,2          ## @pip_read_sys_info
	.comm	_PIP_READ_SYS_INFO_CMD_LENGTH,4,2 ## @PIP_READ_SYS_INFO_CMD_LENGTH
	.comm	_cyapa_pip_sort_system_info_data,4,2 ## @cyapa_pip_sort_system_info_data
	.comm	_EIO,4,2                        ## @EIO
	.comm	_PIP_PRODUCT_FAMILY_MASK,4,2    ## @PIP_PRODUCT_FAMILY_MASK
	.comm	_PIP_PRODUCT_FAMILY_TRACKPAD,4,2 ## @PIP_PRODUCT_FAMILY_TRACKPAD
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PIP_BL_PLATFORM_VER_SHIFT,4,2  ## @PIP_BL_PLATFORM_VER_SHIFT
	.comm	_PIP_BL_PLATFORM_VER_MASK,4,2   ## @PIP_BL_PLATFORM_VER_MASK
	.comm	_CYAPA_GEN5,8,3                 ## @CYAPA_GEN5
	.comm	_CAPABILITY_BTN_MASK,4,2        ## @CAPABILITY_BTN_MASK
	.no_dead_strip	_cyapa_gen5_get_query_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cyapa_gen5_get_query_data
_cyapa_gen5_get_query_data:             ; @cyapa_gen5_get_query_data
	.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
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _PIP_READ_SYS_INFO_RESP_LENGTH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PIP_READ_SYS_INFO_RESP_LENGTH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x21, x8, #2
	mov	x9, x21
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x21, #15
	and	x9, x9, #0x7fffffff0
	sub	x20, x8, x9
	mov	sp, x20
	stur	w21, [x29, #-44]
Lloh8:
	adrp	x8, _pip_read_sys_info@GOTPAGE
Lloh9:
	ldr	x8, [x8, _pip_read_sys_info@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _PIP_READ_SYS_INFO_CMD_LENGTH@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PIP_READ_SYS_INFO_CMD_LENGTH@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x8, _cyapa_pip_sort_system_info_data@GOTPAGE
Lloh15:
	ldr	x8, [x8, _cyapa_pip_sort_system_info_data@GOTPAGEOFF]
Lloh16:
	ldr	w6, [x8]
	sub	x4, x29, #44
	mov	x3, x20
	mov	w5, #2000
	mov	w7, #0
	bl	_cyapa_i2c_pip_cmd_irq_sync
	ldursw	x8, [x29, #-44]
	cmp	w0, #0
	ccmp	x21, x8, #2, eq
	b.ls	LBB0_2
; %bb.1:
Lloh17:
	adrp	x8, _EIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w0, #0
	csneg	w0, w0, w8, ne
	b	LBB0_12
LBB0_2:
	add	x0, x20, #28
	bl	_get_unaligned_le16
Lloh20:
	adrp	x8, _PIP_PRODUCT_FAMILY_MASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PIP_PRODUCT_FAMILY_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh23:
	adrp	x9, _PIP_PRODUCT_FAMILY_TRACKPAD@GOTPAGE
Lloh24:
	ldr	x9, [x9, _PIP_PRODUCT_FAMILY_TRACKPAD@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_11
; %bb.3:
	ldr	w8, [x20, #196]
Lloh26:
	adrp	x9, _PIP_BL_PLATFORM_VER_SHIFT@GOTPAGE
Lloh27:
	ldr	x9, [x9, _PIP_BL_PLATFORM_VER_SHIFT@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	asr	w8, w8, w9
Lloh29:
	adrp	x9, _PIP_BL_PLATFORM_VER_MASK@GOTPAGE
Lloh30:
	ldr	x9, [x9, _PIP_BL_PLATFORM_VER_MASK@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	and	w8, w8, w9
	ldr	x9, [x19, #8]
Lloh32:
	adrp	x10, _CYAPA_GEN5@GOTPAGE
Lloh33:
	ldr	x10, [x10, _CYAPA_GEN5@GOTPAGEOFF]
Lloh34:
	ldr	x10, [x10]
	cmp	x9, x10
	cset	w9, eq
	cmp	w8, #2
	cset	w10, lt
	tst	w9, w10
	mov	w9, #36
	mov	w10, #60
	csel	x9, x10, x9, ne
	mov	w10, #40
	mov	w11, #64
	csel	x10, x11, x10, ne
	ldr	w10, [x20, x10]
	ldr	w9, [x20, x9]
	str	w8, [x19]
	stp	w9, w10, [x19, #16]
	ldr	d0, [x20, #208]
	str	d0, [x19, #24]
	add	x0, x20, #216
	bl	_get_unaligned_le16
	mov	w21, #34079
	movk	w21, #20971, lsl #16
	smull	x8, w0, w21
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w8, w8, w9, asr #5
	str	w8, [x19, #32]
	add	x0, x20, #224
	bl	_get_unaligned_le16
	smull	x8, w0, w21
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w8, w8, w9, asr #5
	str	w8, [x19, #36]
	add	x0, x20, #232
	bl	_get_unaligned_le16
	str	w0, [x19, #40]
	add	x0, x20, #240
	bl	_get_unaligned_le16
	str	w0, [x19, #44]
	add	x0, x20, #248
	bl	_get_unaligned_le16
	str	w0, [x19, #48]
	ldr	d0, [x20, #256]
	movi.2s	v1, #1
	and.8b	v0, v0, v1
	stur	d0, [x19, #52]
Lloh35:
	adrp	x8, _CAPABILITY_BTN_MASK@GOTPAGE
Lloh36:
	ldr	x8, [x8, _CAPABILITY_BTN_MASK@GOTPAGEOFF]
	ldr	w9, [x20, #280]
Lloh37:
	ldr	w8, [x8]
	and	w8, w8, w9, lsl #3
	str	w8, [x19, #60]
	ldr	x0, [x19, #64]
	add	x1, x20, #132
	mov	w2, #5
	bl	_memcpy
	ldr	x8, [x19, #64]
	mov	w21, #45
	strb	w21, [x8, #5]
	ldr	x8, [x19, #64]
	add	x0, x8, #6
	add	x1, x20, #152
	mov	w2, #6
	bl	_memcpy
	ldr	x8, [x19, #64]
	strb	w21, [x8, #12]
	ldr	x8, [x19, #64]
	add	x0, x8, #13
	add	x1, x20, #176
	mov	w2, #2
	bl	_memcpy
	ldr	x8, [x19, #64]
	strb	wzr, [x8, #15]
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_11
; %bb.4:
	ldr	w8, [x19, #28]
	cbz	w8, LBB0_11
; %bb.5:
	ldr	w8, [x19, #32]
	cbz	w8, LBB0_11
; %bb.6:
	ldr	w8, [x19, #36]
	cbz	w8, LBB0_11
; %bb.7:
	ldr	w8, [x19, #40]
	cbz	w8, LBB0_11
; %bb.8:
	ldr	w8, [x19, #44]
	cbz	w8, LBB0_11
; %bb.9:
	ldr	w8, [x19, #48]
	cbz	w8, LBB0_11
; %bb.10:
	mov	w0, #0
	b	LBB0_12
LBB0_11:
Lloh38:
	adrp	x8, _EINVAL@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldur	x8, [x29, #-40]
Lloh41:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh42:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh43:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	sub	sp, x29, #32
	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_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_PIP_READ_SYS_INFO_RESP_LENGTH,4,2 ; @PIP_READ_SYS_INFO_RESP_LENGTH
	.comm	_pip_read_sys_info,4,2          ; @pip_read_sys_info
	.comm	_PIP_READ_SYS_INFO_CMD_LENGTH,4,2 ; @PIP_READ_SYS_INFO_CMD_LENGTH
	.comm	_cyapa_pip_sort_system_info_data,4,2 ; @cyapa_pip_sort_system_info_data
	.comm	_EIO,4,2                        ; @EIO
	.comm	_PIP_PRODUCT_FAMILY_MASK,4,2    ; @PIP_PRODUCT_FAMILY_MASK
	.comm	_PIP_PRODUCT_FAMILY_TRACKPAD,4,2 ; @PIP_PRODUCT_FAMILY_TRACKPAD
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PIP_BL_PLATFORM_VER_SHIFT,4,2  ; @PIP_BL_PLATFORM_VER_SHIFT
	.comm	_PIP_BL_PLATFORM_VER_MASK,4,2   ; @PIP_BL_PLATFORM_VER_MASK
	.comm	_CYAPA_GEN5,8,3                 ; @CYAPA_GEN5
	.comm	_CAPABILITY_BTN_MASK,4,2        ; @CAPABILITY_BTN_MASK
	.no_dead_strip	_cyapa_gen5_get_query_data
.subsections_via_symbols
