	.file	"extr_tg3.c_tg3_ape_event_lock.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	tg3_ape_event_lock, @function
tg3_ape_event_lock:
.LFB0:
	.cfi_startproc
	endbr64
	test	esi, esi
	je	.L14
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	ebx, esi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	mov	esi, DWORD PTR TG3_APE_EVENT_STATUS[rip]
	mov	rdi, rbp
	call	tg3_ape_read32@PLT
	and	eax, DWORD PTR APE_EVENT_STATUS_EVENT_PENDING[rip]
	je	.L1
	mov	esi, DWORD PTR TG3_APE_LOCK_MEM[rip]
	mov	rdi, rbp
	call	tg3_ape_unlock@PLT
	mov	edi, 10
	call	udelay@PLT
	cmp	ebx, 10
	mov	eax, 10
	cmovle	eax, ebx
	sub	ebx, eax
	je	.L18
.L5:
	mov	esi, DWORD PTR TG3_APE_LOCK_MEM[rip]
	mov	rdi, rbp
	call	tg3_ape_lock@PLT
	test	rax, rax
	je	.L3
.L18:
	mov	eax, DWORD PTR EBUSY[rip]
	neg	eax
.L1:
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore 3
	.cfi_restore 6
	mov	eax, DWORD PTR EBUSY[rip]
	neg	eax
	ret
	.cfi_endproc
.LFE0:
	.size	tg3_ape_event_lock, .-tg3_ape_event_lock
	.comm	TG3_APE_LOCK_MEM,4,4
	.comm	TG3_APE_EVENT_STATUS,4,4
	.comm	EBUSY,4,4
	.comm	APE_EVENT_STATUS_EVENT_PENDING,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_tg3.c_tg3_ape_event_lock.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tg3_ape_event_lock, %function
tg3_ape_event_lock:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	subs	r4, r1, #0
	beq	.L2
	mov	r5, r0
	ldr	r6, .L15
	ldr	r8, .L15+4
	ldr	r7, .L15+8
	b	.L5
.L3:
	mov	r0, r5
	ldr	r1, [r8]
	bl	tg3_ape_read32
	ldr	r3, [r7]
	ands	r0, r0, r3
	popeq	{r4, r5, r6, r7, r8, pc}
	cmp	r4, #10
	ldr	r1, [r6]
	mov	r0, r5
	suble	r4, r4, r4
	subgt	r4, r4, #10
	bl	tg3_ape_unlock
	mov	r0, #10
	bl	udelay
	cmp	r4, #0
	beq	.L2
.L5:
	mov	r0, r5
	ldr	r1, [r6]
	bl	tg3_ape_lock
	cmp	r0, #0
	beq	.L3
.L2:
	ldr	r3, .L15+12
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L16:
	.align	2
.L15:
	.word	TG3_APE_LOCK_MEM
	.word	TG3_APE_EVENT_STATUS
	.word	APE_EVENT_STATUS_EVENT_PENDING
	.word	EBUSY
	.size	tg3_ape_event_lock, .-tg3_ape_event_lock
	.comm	TG3_APE_LOCK_MEM,4,4
	.comm	TG3_APE_EVENT_STATUS,4,4
	.comm	EBUSY,4,4
	.comm	APE_EVENT_STATUS_EVENT_PENDING,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
