	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tg3_ape_send_event
_tg3_ape_send_event:                    ## @tg3_ape_send_event
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_TG3_APE_SEG_SIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_tg3_ape_read32
	movq	_APE_SEG_SIG_MAGIC@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_1
## %bb.2:
	movq	_TG3_APE_FW_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_tg3_ape_read32
	movq	_APE_FW_STATUS_READY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_1
## %bb.3:
	movq	%rbx, %rdi
	movl	$20000, %esi                    ## imm = 0x4E20
	callq	_tg3_ape_event_lock
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	_TG3_APE_EVENT_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_APE_EVENT_STATUS_EVENT_PENDING@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_tg3_ape_write32
	movq	_TG3_APE_LOCK_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_tg3_ape_unlock
	movq	_TG3_APE_EVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_APE_EVENT_1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_tg3_ape_write32
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_1:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TG3_APE_SEG_SIG,4,2            ## @TG3_APE_SEG_SIG
	.comm	_APE_SEG_SIG_MAGIC,4,2          ## @APE_SEG_SIG_MAGIC
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_TG3_APE_FW_STATUS,4,2          ## @TG3_APE_FW_STATUS
	.comm	_APE_FW_STATUS_READY,4,2        ## @APE_FW_STATUS_READY
	.comm	_TG3_APE_EVENT_STATUS,4,2       ## @TG3_APE_EVENT_STATUS
	.comm	_APE_EVENT_STATUS_EVENT_PENDING,4,2 ## @APE_EVENT_STATUS_EVENT_PENDING
	.comm	_TG3_APE_LOCK_MEM,4,2           ## @TG3_APE_LOCK_MEM
	.comm	_TG3_APE_EVENT,4,2              ## @TG3_APE_EVENT
	.comm	_APE_EVENT_1,4,2                ## @APE_EVENT_1
	.no_dead_strip	_tg3_ape_send_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tg3_ape_send_event
_tg3_ape_send_event:                    ; @tg3_ape_send_event
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.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, _TG3_APE_SEG_SIG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TG3_APE_SEG_SIG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_tg3_ape_read32
Lloh3:
	adrp	x8, _APE_SEG_SIG_MAGIC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _APE_SEG_SIG_MAGIC@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_4
; %bb.1:
Lloh6:
	adrp	x8, _TG3_APE_FW_STATUS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TG3_APE_FW_STATUS@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_tg3_ape_read32
Lloh9:
	adrp	x8, _APE_FW_STATUS_READY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _APE_FW_STATUS_READY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.2:
	mov	x0, x19
	mov	w1, #20000
	bl	_tg3_ape_event_lock
	cbnz	w0, LBB0_5
; %bb.3:
Lloh12:
	adrp	x8, _TG3_APE_EVENT_STATUS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TG3_APE_EVENT_STATUS@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _APE_EVENT_STATUS_EVENT_PENDING@GOTPAGE
Lloh16:
	ldr	x8, [x8, _APE_EVENT_STATUS_EVENT_PENDING@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	orr	w2, w8, w20
	mov	x0, x19
	bl	_tg3_ape_write32
Lloh18:
	adrp	x8, _TG3_APE_LOCK_MEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TG3_APE_LOCK_MEM@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_tg3_ape_unlock
Lloh21:
	adrp	x8, _TG3_APE_EVENT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _TG3_APE_EVENT@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _APE_EVENT_1@GOTPAGE
Lloh25:
	ldr	x8, [x8, _APE_EVENT_1@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_tg3_ape_write32
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh27:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_TG3_APE_SEG_SIG,4,2            ; @TG3_APE_SEG_SIG
	.comm	_APE_SEG_SIG_MAGIC,4,2          ; @APE_SEG_SIG_MAGIC
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_TG3_APE_FW_STATUS,4,2          ; @TG3_APE_FW_STATUS
	.comm	_APE_FW_STATUS_READY,4,2        ; @APE_FW_STATUS_READY
	.comm	_TG3_APE_EVENT_STATUS,4,2       ; @TG3_APE_EVENT_STATUS
	.comm	_APE_EVENT_STATUS_EVENT_PENDING,4,2 ; @APE_EVENT_STATUS_EVENT_PENDING
	.comm	_TG3_APE_LOCK_MEM,4,2           ; @TG3_APE_LOCK_MEM
	.comm	_TG3_APE_EVENT,4,2              ; @TG3_APE_EVENT
	.comm	_APE_EVENT_1,4,2                ; @APE_EVENT_1
	.no_dead_strip	_tg3_ape_send_event
.subsections_via_symbols
