	.file	"extr_mlx5_vsc.c_mlx5_vsc_lock.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Unable to acquire vsc lock, vsc_addr not initialized\n"
	.text
	.p2align 4
	.globl	mlx5_vsc_lock
	.type	mlx5_vsc_lock, @function
mlx5_vsc_lock:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	movsx	rbx, DWORD PTR [rdi]
	test	ebx, ebx
	je	.L2
	mov	eax, DWORD PTR MLX5_VSC_MAX_RETRIES[rip]
	test	eax, eax
	js	.L5
	mov	rax, QWORD PTR 8[rdi]
	mov	r13d, 1
	mov	r12d, DWORD PTR [rax]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rsi, QWORD PTR MLX5_VSC_COUNTER_OFFSET[rip]
	mov	edx, 4
	mov	edi, r12d
	add	rsi, rbx
	call	pci_read_config@PLT
	mov	rsi, QWORD PTR MLX5_VSC_SEMA_OFFSET[rip]
	mov	edi, r12d
	mov	ecx, 4
	mov	rdx, rax
	mov	rbp, rax
	add	rsi, rbx
	call	pci_write_config@PLT
	mov	rsi, QWORD PTR MLX5_VSC_SEMA_OFFSET[rip]
	mov	edx, 4
	mov	edi, r12d
	add	rsi, rbx
	call	pci_read_config@PLT
	cmp	rbp, rax
	je	.L9
	mov	ebp, r13d
	add	r13d, 1
	cmp	DWORD PTR MLX5_VSC_MAX_RETRIES[rip], ebp
	jl	.L5
.L6:
	mov	rsi, QWORD PTR MLX5_VSC_SEMA_OFFSET[rip]
	mov	edx, 4
	mov	edi, r12d
	add	rsi, rbx
	call	pci_read_config@PLT
	test	rax, rax
	je	.L7
	xor	eax, eax
	mov	ebp, r13d
	add	r13d, 1
	call	random@PLT
	movsx	rdx, eax
	mov	ecx, eax
	imul	rdx, rdx, 1954687339
	sar	ecx, 31
	sar	rdx, 44
	sub	edx, ecx
	imul	edx, edx, 9000
	sub	eax, edx
	lea	edi, 1000[rax]
	call	DELAY@PLT
	cmp	DWORD PTR MLX5_VSC_MAX_RETRIES[rip], ebp
	jge	.L6
.L5:
	mov	eax, DWORD PTR EBUSY[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
	call	mlx5_core_warn@PLT
	mov	eax, DWORD PTR EINVAL[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	mlx5_vsc_lock, .-mlx5_vsc_lock
	.comm	MLX5_VSC_SEMA_OFFSET,8,8
	.comm	MLX5_VSC_MAX_RETRIES,4,4
	.comm	MLX5_VSC_COUNTER_OFFSET,8,8
	.comm	EINVAL,4,4
	.comm	EBUSY,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_mlx5_vsc.c_mlx5_vsc_lock.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Unable to acquire vsc lock, vsc_addr not initialize"
	.ascii	"d\012\000"
	.text
	.align	2
	.global	mlx5_vsc_lock
	.syntax unified
	.arm
	.fpu softvfp
	.type	mlx5_vsc_lock, %function
mlx5_vsc_lock:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r6, [r0]
	cmp	r6, #0
	beq	.L2
	ldr	r10, .L14
	ldr	r2, [r10]
	cmp	r2, #0
	blt	.L3
	ldr	r3, [r0, #4]
	mov	r8, #1
	ldr	r9, .L14+4
	ldr	r7, [r3]
	ldr	fp, .L14+8
	b	.L6
.L7:
	ldr	r1, [fp]
	mov	r2, #4
	add	r1, r6, r1
	mov	r0, r7
	bl	pci_read_config
	ldr	r1, [r9]
	mov	r2, r0
	mov	r5, r0
	mov	r3, #4
	add	r1, r6, r1
	mov	r0, r7
	bl	pci_write_config
	ldr	r1, [r9]
	mov	r2, #4
	mov	r0, r7
	add	r1, r6, r1
	bl	pci_read_config
	cmp	r5, r0
	beq	.L1
	mov	r4, r8
	ldr	r3, [r10]
	add	r8, r8, #1
	cmp	r3, r4
	blt	.L3
.L6:
	ldr	r1, [r9]
	mov	r2, #4
	mov	r0, r7
	add	r1, r6, r1
	bl	pci_read_config
	subs	r4, r0, #0
	beq	.L7
	bl	random
	mov	r4, r8
	ldr	r2, .L14+12
	add	r8, r8, #1
	smull	r3, r2, r0, r2
	asr	r3, r0, #31
	rsb	r3, r3, r2, asr #12
	add	r3, r3, r3, lsl #2
	rsb	r3, r3, r3, lsl #4
	rsb	r3, r3, r3, lsl #4
	sub	r0, r0, r3, lsl #3
	add	r0, r0, #1000
	bl	DELAY
	ldr	r3, [r10]
	cmp	r3, r4
	bge	.L6
.L3:
	ldr	r3, .L14+16
	ldr	r4, [r3]
.L1:
	mov	r0, r4
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r1, .L14+20
	bl	mlx5_core_warn
	ldr	r3, .L14+24
	ldr	r4, [r3]
	mov	r0, r4
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	.align	2
.L14:
	.word	MLX5_VSC_MAX_RETRIES
	.word	MLX5_VSC_SEMA_OFFSET
	.word	MLX5_VSC_COUNTER_OFFSET
	.word	1954687339
	.word	EBUSY
	.word	.LC0
	.word	EINVAL
	.size	mlx5_vsc_lock, .-mlx5_vsc_lock
	.comm	MLX5_VSC_SEMA_OFFSET,4,4
	.comm	MLX5_VSC_MAX_RETRIES,4,4
	.comm	MLX5_VSC_COUNTER_OFFSET,4,4
	.comm	EINVAL,4,4
	.comm	EBUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
