	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl1251_event_handle            ## -- Begin function wl1251_event_handle
	.p2align	4, 0x90
_wl1251_event_handle:                   ## @wl1251_event_handle
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_DEBUG_EVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_wl1251_debug
	cmpl	$2, %ebx
	jl	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_4
LBB0_2:
	movq	(%r14), %rax
	movslq	%ebx, %rcx
	movl	(%rax,%rcx,4), %esi
	leaq	-24(%rbp), %rbx
	movq	%r14, %rdi
	movq	%rbx, %rdx
	movl	$4, %ecx
	callq	_wl1251_mem_read
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_wl1251_event_process
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	movq	_ACX_REG_INTERRUPT_TRIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_INTR_TRIG_EVENT_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_wl1251_reg_write32
	xorl	%eax, %eax
LBB0_4:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DEBUG_EVENT,4,2                ## @DEBUG_EVENT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"EVENT on mbox %d"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ACX_REG_INTERRUPT_TRIG,4,2     ## @ACX_REG_INTERRUPT_TRIG
	.comm	_INTR_TRIG_EVENT_ACK,4,2        ## @INTR_TRIG_EVENT_ACK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl1251_event_handle            ; -- Begin function wl1251_event_handle
	.p2align	2
_wl1251_event_handle:                   ; @wl1251_event_handle
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _DEBUG_EVENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEBUG_EVENT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_wl1251_debug
	cmp	w20, #2
	b.lt	LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_2:
	ldr	x8, [x19]
	ldr	w1, [x8, w20, sxtw #2]
	add	x2, sp, #8
	mov	x0, x19
	mov	w3, #4
	bl	_wl1251_mem_read
	add	x1, sp, #8
	mov	x0, x19
	bl	_wl1251_event_process
	tbnz	w0, #31, LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _ACX_REG_INTERRUPT_TRIG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ACX_REG_INTERRUPT_TRIG@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _INTR_TRIG_EVENT_ACK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _INTR_TRIG_EVENT_ACK@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_wl1251_reg_write32
	mov	w0, #0
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_DEBUG_EVENT,4,2                ; @DEBUG_EVENT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"EVENT on mbox %d"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ACX_REG_INTERRUPT_TRIG,4,2     ; @ACX_REG_INTERRUPT_TRIG
	.comm	_INTR_TRIG_EVENT_ACK,4,2        ; @INTR_TRIG_EVENT_ACK
.subsections_via_symbols
