	.file	"extr_cmd.c_mlx4_allocate_port_vpps.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Failed query available VPPs\n"
.LC1:
	.string	"Failed allocating VPPs\n"
.LC2:
	.string	"Port %d Available VPPs %d\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC3:
	.string	"Port %d UP %d Allocated %d VPPs\n"
	.text
	.p2align 4
	.type	mlx4_allocate_port_vpps, @function
mlx4_allocate_port_vpps:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	r12, rdi
	push	rbx
	.cfi_offset 3, -56
	mov	ebx, esi
	sub	rsp, 56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR MLX4_NUM_UP[rip]
	mov	rcx, rsp
	mov	QWORD PTR -80[rbp], rsp
	lea	rax, 15[0+rax*4]
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L26:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L26
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L27
.L4:
	mov	rdi, r12
	mov	r14, rsp
	call	mlx4_priv@PLT
	mov	rcx, r14
	mov	esi, ebx
	mov	rdi, r12
	mov	r13, rax
	lea	rax, -60[rbp]
	mov	rdx, rax
	mov	QWORD PTR -88[rbp], rax
	call	mlx4_ALLOCATE_VPP_get@PLT
	test	eax, eax
	jne	.L11
	mov	rdx, QWORD PTR 0[r13]
	movsx	rax, ebx
	mov	esi, DWORD PTR MLX4_NUM_UP[rip]
	mov	r15d, DWORD PTR -60[rbp]
	lea	r13, [rdx+rax*8]
	mov	edi, DWORD PTR 4[r13]
	call	bitmap_weight@PLT
	mov	r8d, eax
	mov	eax, r15d
	cdq
	idiv	r8d
	mov	edx, DWORD PTR MLX4_NUM_UP[rip]
	mov	DWORD PTR -68[rbp], eax
	test	edx, edx
	jle	.L7
	xor	r15d, r15d
	.p2align 4,,10
	.p2align 3
.L9:
	mov	esi, DWORD PTR 4[r13]
	mov	edi, r15d
	call	test_bit@PLT
	test	rax, rax
	je	.L8
	mov	eax, DWORD PTR -68[rbp]
	mov	DWORD PTR [r14+r15*4], eax
.L8:
	add	r15, 1
	cmp	DWORD PTR MLX4_NUM_UP[rip], r15d
	jg	.L9
.L7:
	mov	rdx, r14
	mov	esi, ebx
	mov	rdi, r12
	call	mlx4_ALLOCATE_VPP_set@PLT
	test	eax, eax
	jne	.L28
	mov	rdx, QWORD PTR -88[rbp]
	mov	rcx, r14
	mov	esi, ebx
	mov	rdi, r12
	call	mlx4_ALLOCATE_VPP_get@PLT
	test	eax, eax
	jne	.L11
	mov	eax, DWORD PTR -68[rbp]
	mov	ecx, DWORD PTR -60[rbp]
	mov	edx, ebx
	lea	rsi, .LC2[rip]
	mov	rdi, r12
	mov	DWORD PTR 0[r13], eax
	xor	eax, eax
	call	mlx4_dbg@PLT
	mov	eax, DWORD PTR MLX4_NUM_UP[rip]
	test	eax, eax
	jle	.L6
	xor	r15d, r15d
	lea	r13, .LC3[rip]
	.p2align 4,,10
	.p2align 3
.L13:
	mov	r8d, DWORD PTR [r14+r15*4]
	mov	ecx, r15d
	xor	eax, eax
	mov	edx, ebx
	mov	rsi, r13
	mov	rdi, r12
	add	r15, 1
	call	mlx4_dbg@PLT
	cmp	DWORD PTR MLX4_NUM_UP[rip], r15d
	jg	.L13
.L6:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	mov	rsp, QWORD PTR -80[rbp]
	jne	.L29
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
	mov	rdi, r12
	call	mlx4_info@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	lea	rsi, .LC1[rip]
	mov	rdi, r12
	call	mlx4_info@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L27:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	mlx4_allocate_port_vpps, .-mlx4_allocate_port_vpps
	.comm	MLX4_NUM_UP,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_cmd.c_mlx4_allocate_port_vpps.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Failed query available VPPs\012\000"
	.global	__aeabi_idiv
	.align	2
.LC1:
	.ascii	"Failed allocating VPPs\012\000"
	.align	2
.LC2:
	.ascii	"Port %d Available VPPs %d\012\000"
	.align	2
.LC3:
	.ascii	"Port %d UP %d Allocated %d VPPs\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mlx4_allocate_port_vpps, %function
mlx4_allocate_port_vpps:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #28
	ldr	r4, .L22
	str	sp, [fp, #-48]
	ldr	r3, [r4]
	mov	r7, r1
	lsl	r3, r3, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	ldr	r3, .L22+4
	mov	r8, r0
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bl	mlx4_priv
	add	r6, sp, #8
	mov	r5, r0
	mov	r3, r6
	mov	r1, r7
	mov	r0, r8
	sub	r2, fp, #44
	bl	mlx4_ALLOCATE_VPP_get
	subs	r10, r0, #0
	bne	.L8
	ldr	r3, [r5]
	ldr	r1, [r4]
	add	r5, r3, r7, lsl #3
	ldr	r0, [r5, #4]
	ldr	r9, [fp, #-44]
	str	r3, [fp, #-52]
	bl	bitmap_weight
	mov	r1, r0
	mov	r0, r9
	bl	__aeabi_idiv
	ldr	r2, [r4]
	mov	r9, r0
	cmp	r2, #0
	ble	.L4
.L6:
	mov	r0, r10
	ldr	r1, [r5, #4]
	bl	test_bit
	ldr	r2, [r4]
	cmp	r0, #0
	strne	r9, [r6, r10, lsl #2]
	add	r10, r10, #1
	cmp	r2, r10
	bgt	.L6
.L4:
	mov	r2, r6
	mov	r1, r7
	mov	r0, r8
	bl	mlx4_ALLOCATE_VPP_set
	cmp	r0, #0
	bne	.L20
	mov	r3, r6
	mov	r1, r7
	mov	r0, r8
	sub	r2, fp, #44
	bl	mlx4_ALLOCATE_VPP_get
	subs	r5, r0, #0
	bne	.L8
	ldr	r3, [fp, #-52]
	mov	r2, r7
	str	r9, [r3, r7, lsl #3]
	mov	r0, r8
	ldr	r3, [fp, #-44]
	ldr	r1, .L22+8
	bl	mlx4_dbg
	ldr	r3, [r4]
	cmp	r3, #0
	ble	.L3
	ldr	r9, .L22+12
	sub	r6, r6, #4
.L10:
	ldr	r2, [r6, #4]!
	mov	r3, r5
	str	r2, [sp]
	mov	r1, r9
	mov	r2, r7
	mov	r0, r8
	bl	mlx4_dbg
	ldr	r3, [r4]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L10
.L3:
	ldr	r3, .L22+4
	ldr	sp, [fp, #-48]
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L20:
	mov	r0, r8
	ldr	r1, .L22+16
	bl	mlx4_info
	b	.L3
.L8:
	mov	r0, r8
	ldr	r1, .L22+20
	bl	mlx4_info
	b	.L3
.L21:
	bl	__stack_chk_fail
.L23:
	.align	2
.L22:
	.word	MLX4_NUM_UP
	.word	.LC4
	.word	.LC2
	.word	.LC3
	.word	.LC1
	.word	.LC0
	.size	mlx4_allocate_port_vpps, .-mlx4_allocate_port_vpps
	.comm	MLX4_NUM_UP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
