	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cyapa_pip_irq_cmd_handler      ## -- Begin function cyapa_pip_irq_cmd_handler
	.p2align	4, 0x90
_cyapa_pip_irq_cmd_handler:             ## @cyapa_pip_irq_cmd_handler
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	20(%rdi), %r15
	movq	%r15, %rdi
	callq	_atomic_read
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	xorl	%r14d, %r14d
	cmpl	$0, (%rbx)
	je	LBB0_16
## %bb.3:
	movl	24(%rbx), %esi
	movq	_PIP_RESP_LENGTH_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_cyapa_i2c_pip_read
	movl	24(%rbx), %edi
	callq	_get_unaligned_le16
	movl	(%r12), %r12d
	cmpl	%r12d, %eax
	cmovgl	%eax, %r12d
	jle	LBB0_5
## %bb.4:
	movl	24(%rbx), %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	_cyapa_i2c_pip_read
LBB0_5:
	movq	40(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	24(%rbx), %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	*%rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.12:
	movq	32(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.13:
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movl	(%rax), %ecx
	cmpl	%r12d, %ecx
	cmovll	%ecx, %r12d
	movl	%r12d, (%rax)
	movl	24(%rbx), %esi
	movl	%r12d, %edx
	callq	_memcpy
	jmp	LBB0_15
LBB0_1:
	movl	$1, %r14d
	jmp	LBB0_16
LBB0_7:
	movl	$0, -36(%rbp)
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
LBB0_9:
	movq	32(%rbx), %rsi
	movq	40(%rbx), %rcx
	leaq	-36(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_cyapa_empty_pip_output_data
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_16
## %bb.10:
	movl	-36(%rbp), %ecx
	testl	%ecx, %ecx
	je	LBB0_16
## %bb.11:
	movl	%ecx, (%rax)
LBB0_15:
	movq	%r15, %rdi
	callq	_atomic_dec
	addq	$16, %rbx
	movq	%rbx, %rdi
	callq	_complete
LBB0_16:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PIP_RESP_LENGTH_SIZE,4,2       ## @PIP_RESP_LENGTH_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cyapa_pip_irq_cmd_handler      ; -- Begin function cyapa_pip_irq_cmd_handler
	.p2align	2
_cyapa_pip_irq_cmd_handler:             ; @cyapa_pip_irq_cmd_handler
	.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	x19, x0
	add	x20, x0, #20
	mov	x0, x20
	bl	_atomic_read
	cbz	x0, LBB0_9
; %bb.1:
	ldr	w8, [x19]
	cbz	w8, LBB0_16
; %bb.2:
	ldr	w1, [x19, #24]
Lloh0:
	adrp	x21, _PIP_RESP_LENGTH_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _PIP_RESP_LENGTH_SIZE@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_cyapa_i2c_pip_read
	ldr	w0, [x19, #24]
	bl	_get_unaligned_le16
	ldr	w8, [x21]
	cmp	w0, w8
	csel	w21, w0, w8, gt
	cmp	w8, w0
	b.ge	LBB0_4
; %bb.3:
	ldr	w1, [x19, #24]
	mov	x0, x19
	mov	x2, x21
	bl	_cyapa_i2c_pip_read
LBB0_4:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_10
; %bb.5:
	ldr	w1, [x19, #24]
	mov	x0, x19
	mov	x2, x21
	blr	x8
	cbz	x0, LBB0_10
; %bb.6:
	ldr	x0, [x19, #32]
	cbz	x0, LBB0_15
; %bb.7:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_15
; %bb.8:
	ldr	w9, [x8]
	cmp	w9, w21
	csel	w2, w9, w21, lt
	str	w2, [x8]
	ldr	w1, [x19, #24]
	bl	_memcpy
	b	LBB0_15
LBB0_9:
	mov	w0, #1
	b	LBB0_17
LBB0_10:
	str	wzr, [sp, #12]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_12
; %bb.11:
	ldr	w8, [x8]
	str	w8, [sp, #12]
LBB0_12:
	ldp	x1, x3, [x19, #32]
	add	x2, sp, #12
	mov	x0, x19
	bl	_cyapa_empty_pip_output_data
	mov	w0, #0
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_17
; %bb.13:
	ldr	w9, [sp, #12]
	cbz	w9, LBB0_17
; %bb.14:
	str	w9, [x8]
LBB0_15:
	mov	x0, x20
	bl	_atomic_dec
	add	x0, x19, #16
	bl	_complete
LBB0_16:
	mov	w0, #0
LBB0_17:
	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 AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_PIP_RESP_LENGTH_SIZE,4,2       ; @PIP_RESP_LENGTH_SIZE
.subsections_via_symbols
