	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cyapa_i2c_pip_cmd_irq_sync     ## -- Begin function cyapa_i2c_pip_cmd_irq_sync
	.p2align	4, 0x90
_cyapa_i2c_pip_cmd_irq_sync:            ## @cyapa_i2c_pip_cmd_irq_sync
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movl	%edx, %r14d
	testl	%edx, %edx
	je	LBB0_2
## %bb.3:
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	leaq	24(%rdi), %r13
	movq	%r13, %rdi
	callq	_mutex_lock_interruptible
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_22
## %bb.4:
	movl	24(%rbp), %eax
	movq	16(%rbp), %rdi
	movq	%rdi, 32(%rbx)
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rbx)
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	movq	%r8, 8(%rbx)
	movq	_PIP_MIN_APP_CMD_LENGTH@GOTPCREL(%rip), %rdx
	cmpl	%r14d, (%rdx)
	jg	LBB0_7
## %bb.5:
	movl	16(%r12), %esi
	movq	_PIP_APP_CMD_REPORT_ID@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %esi
	jne	LBB0_7
## %bb.6:
	movl	24(%r12), %edx
	andl	$127, %edx
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	jmp	LBB0_10
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_22
LBB0_7:
	movq	_PIP_MIN_BL_CMD_LENGTH@GOTPCREL(%rip), %rdx
	cmpl	%r14d, (%rdx)
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	jg	LBB0_11
## %bb.8:
	movl	16(%r12), %esi
	movq	_PIP_BL_CMD_REPORT_ID@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %esi
	jne	LBB0_11
## %bb.9:
	movl	28(%r12), %edx
LBB0_10:
	movl	%edx, 16(%rbx)
LBB0_11:
	testl	%eax, %eax
	je	LBB0_20
## %bb.12:
	movl	$1, 20(%rbx)
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	movq	%r9, %rcx
	callq	_cyapa_do_i2c_pip_cmd_irq_sync
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, %r15d
	testq	%rdx, %rdx
	je	LBB0_21
## %bb.13:
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	testq	%rsi, %rsi
	je	LBB0_21
## %bb.14:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %r14
	xorl	%eax, %eax
	subl	(%r14), %eax
	cmpl	%eax, %r15d
	jne	LBB0_21
## %bb.15:
	movq	16(%rbp), %rcx
	testq	%rcx, %rcx
	je	LBB0_21
## %bb.16:
	cmpl	$0, (%rdx)
	je	LBB0_21
## %bb.17:
	movq	%rbx, %rdi
	callq	_cyapa_empty_pip_output_data
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, %eax
	jne	LBB0_19
## %bb.18:
	xorl	%r15d, %r15d
	cmpl	$0, (%rcx)
	jne	LBB0_21
LBB0_19:
	xorl	%r15d, %r15d
	subl	(%r14), %r15d
	testl	%eax, %eax
	cmovnel	%eax, %r15d
	jmp	LBB0_21
LBB0_20:
	movl	$0, 20(%rbx)
	movq	%rdi, (%rsp)
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_cyapa_do_i2c_pip_cmd_polling
	movl	%eax, %r15d
LBB0_21:
	movq	$0, 32(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
	movq	_PIP_INVALID_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	%r13, %rdi
	callq	_mutex_unlock
LBB0_22:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PIP_MIN_APP_CMD_LENGTH,4,2     ## @PIP_MIN_APP_CMD_LENGTH
	.comm	_PIP_APP_CMD_REPORT_ID,4,2      ## @PIP_APP_CMD_REPORT_ID
	.comm	_PIP_MIN_BL_CMD_LENGTH,4,2      ## @PIP_MIN_BL_CMD_LENGTH
	.comm	_PIP_BL_CMD_REPORT_ID,4,2       ## @PIP_BL_CMD_REPORT_ID
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_PIP_INVALID_CMD,4,2            ## @PIP_INVALID_CMD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cyapa_i2c_pip_cmd_irq_sync     ; -- Begin function cyapa_i2c_pip_cmd_irq_sync
	.p2align	2
_cyapa_i2c_pip_cmd_irq_sync:            ; @cyapa_i2c_pip_cmd_irq_sync
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cbz	x1, LBB0_6
; %bb.1:
	mov	x25, x2
	cbz	w2, LBB0_6
; %bb.2:
	mov	x27, x7
	mov	x22, x6
	mov	x24, x5
	mov	x21, x4
	mov	x23, x3
	mov	x26, x1
	mov	x19, x0
	add	x20, x0, #24
	mov	x0, x20
	bl	_mutex_lock_interruptible
	mov	x28, x0
	cbnz	w0, LBB0_21
; %bb.3:
	str	x22, [x19, #32]
	stp	x23, x21, [x19]
Lloh0:
	adrp	x8, _PIP_MIN_APP_CMD_LENGTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PIP_MIN_APP_CMD_LENGTH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w25
	b.gt	LBB0_7
; %bb.4:
	ldr	w8, [x26, #16]
Lloh3:
	adrp	x9, _PIP_APP_CMD_REPORT_ID@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PIP_APP_CMD_REPORT_ID@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.5:
	ldr	w8, [x26, #24]
	and	w8, w8, #0x7f
	b	LBB0_10
LBB0_6:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w28, w8
	b	LBB0_21
LBB0_7:
Lloh9:
	adrp	x8, _PIP_MIN_BL_CMD_LENGTH@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PIP_MIN_BL_CMD_LENGTH@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w8, w25
	b.gt	LBB0_11
; %bb.8:
	ldr	w8, [x26, #16]
Lloh12:
	adrp	x9, _PIP_BL_CMD_REPORT_ID@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PIP_BL_CMD_REPORT_ID@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_11
; %bb.9:
	ldr	w8, [x26, #28]
LBB0_10:
	str	w8, [x19, #16]
LBB0_11:
	cbz	w27, LBB0_19
; %bb.12:
	mov	w8, #1
	str	w8, [x19, #20]
	mov	x0, x19
	mov	x1, x26
	mov	x2, x25
	mov	x3, x24
	bl	_cyapa_do_i2c_pip_cmd_irq_sync
	mov	x28, x0
	cbz	x21, LBB0_20
; %bb.13:
	cbz	x23, LBB0_20
; %bb.14:
Lloh15:
	adrp	x24, _ETIMEDOUT@GOTPAGE
Lloh16:
	ldr	x24, [x24, _ETIMEDOUT@GOTPAGEOFF]
	ldr	w8, [x24]
	neg	w8, w8
	cmp	w28, w8
	b.ne	LBB0_20
; %bb.15:
	cbz	x22, LBB0_20
; %bb.16:
	ldr	w8, [x21]
	cbz	w8, LBB0_20
; %bb.17:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x21
	mov	x3, x22
	bl	_cyapa_empty_pip_output_data
	cbz	w0, LBB0_22
LBB0_18:
	ldr	w8, [x24]
	cmp	w0, #0
	csneg	w28, w0, w8, ne
	b	LBB0_20
LBB0_19:
	str	wzr, [x19, #20]
	mov	x0, x19
	mov	x1, x26
	mov	x2, x25
	mov	x3, x23
	mov	x4, x21
	mov	x5, x24
	mov	x6, x22
	bl	_cyapa_do_i2c_pip_cmd_polling
	mov	x28, x0
LBB0_20:
	str	xzr, [x19, #32]
	stp	xzr, xzr, [x19]
Lloh17:
	adrp	x8, _PIP_INVALID_CMD@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PIP_INVALID_CMD@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	mov	x0, x20
	bl	_mutex_unlock
LBB0_21:
	mov	x0, x28
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_22:
	ldr	w8, [x21]
	cbz	w8, LBB0_18
; %bb.23:
	mov	w28, #0
	b	LBB0_20
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PIP_MIN_APP_CMD_LENGTH,4,2     ; @PIP_MIN_APP_CMD_LENGTH
	.comm	_PIP_APP_CMD_REPORT_ID,4,2      ; @PIP_APP_CMD_REPORT_ID
	.comm	_PIP_MIN_BL_CMD_LENGTH,4,2      ; @PIP_MIN_BL_CMD_LENGTH
	.comm	_PIP_BL_CMD_REPORT_ID,4,2       ; @PIP_BL_CMD_REPORT_ID
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_PIP_INVALID_CMD,4,2            ; @PIP_INVALID_CMD
.subsections_via_symbols
