	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cyapa_open
_cyapa_open:                            ## @cyapa_open
	.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
	callq	_input_get_drvdata
	movq	%rax, %r15
	movq	24(%rax), %r12
	movq	%rax, %rdi
	callq	_mutex_lock_interruptible
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	leaq	4(%r12), %r14
	cmpq	$0, 8(%r15)
	je	LBB0_4
## %bb.2:
	movq	16(%r15), %rax
	movq	_PWR_MODE_FULL_ACTIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_CYAPA_PM_ACTIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_7
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dev_warn
	jmp	LBB0_10
LBB0_4:
	movq	%r15, %rdi
	callq	_cyapa_reinitialize
	testl	%eax, %eax
	je	LBB0_5
LBB0_6:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	subl	(%rcx), %ebx
	testl	%eax, %eax
	cmovnel	%eax, %ebx
	jmp	LBB0_10
LBB0_5:
	cmpq	$0, 8(%r15)
	je	LBB0_6
LBB0_7:
	movl	(%r12), %edi
	callq	_enable_irq
	movq	%r14, %rdi
	callq	_pm_runtime_enabled
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movq	%r14, %rdi
	callq	_pm_runtime_set_active
	movq	%r14, %rdi
	callq	_pm_runtime_enable
LBB0_9:
	movq	%r14, %rdi
	callq	_pm_runtime_get_sync
	movq	%r14, %rdi
	callq	_pm_runtime_mark_last_busy
	movq	%r14, %rdi
	callq	_pm_runtime_put_sync_autosuspend
	xorl	%ebx, %ebx
LBB0_10:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PWR_MODE_FULL_ACTIVE,4,2       ## @PWR_MODE_FULL_ACTIVE
	.comm	_CYAPA_PM_ACTIVE,4,2            ## @CYAPA_PM_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set active power failed: %d\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_cyapa_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cyapa_open
_cyapa_open:                            ; @cyapa_open
	.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
	bl	_input_get_drvdata
	mov	x19, x0
	ldr	x22, [x0, #24]
	bl	_mutex_lock_interruptible
	mov	x21, x0
	cbnz	w0, LBB0_11
; %bb.1:
	add	x20, x22, #4
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_4
; %bb.2:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _PWR_MODE_FULL_ACTIVE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PWR_MODE_FULL_ACTIVE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
Lloh3:
	adrp	x9, _CYAPA_PM_ACTIVE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CYAPA_PM_ACTIVE@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x9]
	mov	x0, x19
	mov	w2, #0
	blr	x8
	cbz	w0, LBB0_7
; %bb.3:
	mov	x21, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_dev_warn
	b	LBB0_10
LBB0_4:
	mov	x0, x19
	bl	_cyapa_reinitialize
	cbz	w0, LBB0_6
LBB0_5:
Lloh8:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w0, #0
	csneg	w21, w0, w8, ne
	b	LBB0_10
LBB0_6:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_5
LBB0_7:
	ldr	w0, [x22]
	bl	_enable_irq
	mov	x0, x20
	bl	_pm_runtime_enabled
	cbnz	w0, LBB0_9
; %bb.8:
	mov	x0, x20
	bl	_pm_runtime_set_active
	mov	x0, x20
	bl	_pm_runtime_enable
LBB0_9:
	mov	x0, x20
	bl	_pm_runtime_get_sync
	mov	x0, x20
	bl	_pm_runtime_mark_last_busy
	mov	x0, x20
	bl	_pm_runtime_put_sync_autosuspend
	mov	w21, #0
LBB0_10:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_11:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PWR_MODE_FULL_ACTIVE,4,2       ; @PWR_MODE_FULL_ACTIVE
	.comm	_CYAPA_PM_ACTIVE,4,2            ; @CYAPA_PM_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set active power failed: %d\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_cyapa_open
.subsections_via_symbols
