	.file	"extr_ena_com.c_ena_com_validate_version.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Reg read timeout occurred\n"
.LC1:
	.string	"ena device version: %d.%d\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"ena controller version: %d.%d.%d implementation version %d\n"
	.align 8
.LC3:
	.string	"ENA ctrl version is lower than the minimal ctrl version the driver supports\n"
	.text
	.p2align 4
	.globl	ena_com_validate_version
	.type	ena_com_validate_version, @function
ena_com_validate_version:
.LFB0:
	.cfi_startproc
	endbr64
	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
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	esi, DWORD PTR ENA_REGS_VERSION_OFF[rip]
	call	ena_com_reg_bar_read32@PLT
	mov	esi, DWORD PTR ENA_REGS_CONTROLLER_VERSION_OFF[rip]
	mov	rdi, rbp
	mov	ebx, eax
	call	ena_com_reg_bar_read32@PLT
	mov	ebp, eax
	mov	eax, DWORD PTR ENA_MMIO_READ_TIMEOUT[rip]
	cmp	eax, ebp
	sete	dil
	cmp	eax, ebx
	sete	al
	or	edi, eax
	movzx	edi, dil
	call	unlikely@PLT
	test	rax, rax
	jne	.L7
	mov	edx, DWORD PTR ENA_REGS_VERSION_MINOR_VERSION_MASK[rip]
	mov	ecx, DWORD PTR ENA_REGS_VERSION_MAJOR_VERSION_SHIFT[rip]
	lea	rdi, .LC1[rip]
	xor	eax, eax
	and	edx, ebx
	and	ebx, DWORD PTR ENA_REGS_VERSION_MAJOR_VERSION_MASK[rip]
	mov	esi, ebx
	sar	esi, cl
	call	ena_trc_info@PLT
	mov	edx, DWORD PTR ENA_REGS_CONTROLLER_VERSION_MINOR_VERSION_MASK[rip]
	xor	eax, eax
	mov	ecx, DWORD PTR ENA_REGS_CONTROLLER_VERSION_MINOR_VERSION_SHIFT[rip]
	mov	esi, DWORD PTR ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_MASK[rip]
	mov	r8d, DWORD PTR ENA_REGS_CONTROLLER_VERSION_IMPL_ID_MASK[rip]
	lea	rdi, .LC2[rip]
	and	edx, ebp
	mov	r9d, DWORD PTR ENA_REGS_CONTROLLER_VERSION_SUBMINOR_VERSION_MASK[rip]
	sar	edx, cl
	mov	ecx, DWORD PTR ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_SHIFT[rip]
	and	esi, ebp
	and	r8d, ebp
	and	r9d, ebp
	sar	esi, cl
	mov	ecx, DWORD PTR ENA_REGS_CONTROLLER_VERSION_IMPL_ID_SHIFT[rip]
	sar	r8d, cl
	mov	ecx, r9d
	call	ena_trc_info@PLT
	mov	eax, DWORD PTR ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_MASK[rip]
	or	eax, DWORD PTR ENA_REGS_CONTROLLER_VERSION_MINOR_VERSION_MASK[rip]
	or	eax, DWORD PTR ENA_REGS_CONTROLLER_VERSION_SUBMINOR_VERSION_MASK[rip]
	and	ebp, eax
	cmp	DWORD PTR MIN_ENA_CTRL_VER[rip], ebp
	jg	.L8
	xor	eax, eax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	lea	rdi, .LC0[rip]
	call	ena_trc_err@PLT
	mov	eax, DWORD PTR ENA_COM_TIMER_EXPIRED[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	lea	rdi, .LC3[rip]
	call	ena_trc_err@PLT
	mov	eax, -1
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	ena_com_validate_version, .-ena_com_validate_version
	.comm	MIN_ENA_CTRL_VER,4,4
	.comm	ENA_REGS_VERSION_OFF,4,4
	.comm	ENA_REGS_VERSION_MINOR_VERSION_MASK,4,4
	.comm	ENA_REGS_VERSION_MAJOR_VERSION_SHIFT,4,4
	.comm	ENA_REGS_VERSION_MAJOR_VERSION_MASK,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_SUBMINOR_VERSION_MASK,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_OFF,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_MINOR_VERSION_SHIFT,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_MINOR_VERSION_MASK,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_SHIFT,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_MASK,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_IMPL_ID_SHIFT,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_IMPL_ID_MASK,4,4
	.comm	ENA_MMIO_READ_TIMEOUT,4,4
	.comm	ENA_COM_TIMER_EXPIRED,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_ena_com.c_ena_com_validate_version.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Reg read timeout occurred\012\000"
	.align	2
.LC1:
	.ascii	"ena device version: %d.%d\012\000"
	.align	2
.LC2:
	.ascii	"ena controller version: %d.%d.%d implementation ver"
	.ascii	"sion %d\012\000"
	.align	2
.LC3:
	.ascii	"ENA ctrl version is lower than the minimal ctrl ver"
	.ascii	"sion the driver supports\012\000"
	.text
	.align	2
	.global	ena_com_validate_version
	.syntax unified
	.arm
	.fpu softvfp
	.type	ena_com_validate_version, %function
ena_com_validate_version:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L8
	sub	sp, sp, #8
	ldr	r1, [r3]
	mov	r4, r0
	bl	ena_com_reg_bar_read32
	ldr	r3, .L8+4
	mov	r6, r0
	ldr	r1, [r3]
	mov	r0, r4
	bl	ena_com_reg_bar_read32
	mov	r4, r0
	ldr	r3, .L8+8
	ldr	r0, [r3]
	cmp	r0, r6
	cmpne	r0, r4
	moveq	r0, #1
	movne	r0, #0
	bl	unlikely
	subs	r5, r0, #0
	bne	.L6
	ldr	r3, .L8+12
	ldr	r1, .L8+16
	ldr	r2, .L8+20
	ldr	r3, [r3]
	ldr	r1, [r1]
	ldr	r2, [r2]
	and	r3, r3, r6
	asr	r1, r3, r1
	and	r2, r2, r6
	ldr	r0, .L8+24
	bl	ena_trc_info
	ldr	r3, .L8+28
	ldr	r2, .L8+32
	ldr	r3, [r3]
	ldr	r1, [r2]
	ldr	r7, .L8+36
	ldr	r8, .L8+40
	and	r3, r3, r4
	ldr	ip, .L8+44
	ldr	r0, .L8+48
	asr	r3, r3, r1
	ldr	r6, .L8+52
	ldr	r0, [r0]
	ldr	ip, [ip]
	ldr	r2, [r7]
	ldr	r1, [r8]
	str	r3, [sp]
	ldr	r3, [r6]
	and	r2, r2, r4
	and	r1, r1, r4
	asr	r1, r1, r0
	and	r3, r3, r4
	asr	r2, r2, ip
	ldr	r0, .L8+56
	bl	ena_trc_info
	ldr	r0, [r8]
	ldr	r1, [r7]
	ldr	r2, [r6]
	ldr	r3, .L8+60
	orr	r0, r0, r1
	ldr	r3, [r3]
	orr	r0, r0, r2
	and	r4, r4, r0
	cmp	r3, r4
	bgt	.L7
.L1:
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L6:
	ldr	r0, .L8+64
	bl	ena_trc_err
	ldr	r3, .L8+68
	ldr	r5, [r3]
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L7:
	ldr	r0, .L8+72
	bl	ena_trc_err
	mvn	r5, #0
	b	.L1
.L9:
	.align	2
.L8:
	.word	ENA_REGS_VERSION_OFF
	.word	ENA_REGS_CONTROLLER_VERSION_OFF
	.word	ENA_MMIO_READ_TIMEOUT
	.word	ENA_REGS_VERSION_MAJOR_VERSION_MASK
	.word	ENA_REGS_VERSION_MAJOR_VERSION_SHIFT
	.word	ENA_REGS_VERSION_MINOR_VERSION_MASK
	.word	.LC1
	.word	ENA_REGS_CONTROLLER_VERSION_IMPL_ID_MASK
	.word	ENA_REGS_CONTROLLER_VERSION_IMPL_ID_SHIFT
	.word	ENA_REGS_CONTROLLER_VERSION_MINOR_VERSION_MASK
	.word	ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_MASK
	.word	ENA_REGS_CONTROLLER_VERSION_MINOR_VERSION_SHIFT
	.word	ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_SHIFT
	.word	ENA_REGS_CONTROLLER_VERSION_SUBMINOR_VERSION_MASK
	.word	.LC2
	.word	MIN_ENA_CTRL_VER
	.word	.LC0
	.word	ENA_COM_TIMER_EXPIRED
	.word	.LC3
	.size	ena_com_validate_version, .-ena_com_validate_version
	.comm	MIN_ENA_CTRL_VER,4,4
	.comm	ENA_REGS_VERSION_OFF,4,4
	.comm	ENA_REGS_VERSION_MINOR_VERSION_MASK,4,4
	.comm	ENA_REGS_VERSION_MAJOR_VERSION_SHIFT,4,4
	.comm	ENA_REGS_VERSION_MAJOR_VERSION_MASK,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_SUBMINOR_VERSION_MASK,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_OFF,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_MINOR_VERSION_SHIFT,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_MINOR_VERSION_MASK,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_SHIFT,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_MASK,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_IMPL_ID_SHIFT,4,4
	.comm	ENA_REGS_CONTROLLER_VERSION_IMPL_ID_MASK,4,4
	.comm	ENA_MMIO_READ_TIMEOUT,4,4
	.comm	ENA_COM_TIMER_EXPIRED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
