	.file	"extr_mlx4_port.c_mlx4_get_base_gid_ix.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	mlx4_get_base_gid_ix
	.type	mlx4_get_base_gid_ix, @function
mlx4_get_base_gid_ix:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	test	esi, esi
	jne	.L15
.L2:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L16
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	mov	esi, edx
	mov	r15, rdi
	mov	ebp, edx
	call	mlx4_phys_to_slaves_pport@PLT
	mov	esi, r12d
	mov	rdi, r15
	mov	DWORD PTR 12[rsp], eax
	call	mlx4_get_active_ports@PLT
	mov	rsi, QWORD PTR 8[r15]
	mov	edi, eax
	mov	r14d, eax
	call	find_first_bit@PLT
	mov	rsi, QWORD PTR 8[r15]
	mov	edi, r14d
	mov	r13d, eax
	call	bitmap_weight@PLT
	add	r13d, eax
	lea	eax, 1[r13]
	cmp	eax, 1
	jbe	.L3
	mov	ebx, 1
	lea	r14, 20[rsp]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L9:
	mov	ebx, eax
.L6:
	mov	rsi, QWORD PTR 8[r15]
	mov	edi, DWORD PTR 20[rsp]
	call	bitmap_zero@PLT
	mov	esi, DWORD PTR 20[rsp]
	lea	edi, -1[rbx]
	call	set_bit@PLT
	cmp	ebx, ebp
	je	.L5
	mov	rsi, r14
	mov	rdi, r15
	call	mlx4_phys_to_slaves_pport_actv@PLT
	mov	edi, eax
	mov	rax, QWORD PTR [r15]
	mov	rsi, QWORD PTR [rax]
	add	rsi, 1
	call	bitmap_weight@PLT
	sub	r12d, eax
.L5:
	lea	eax, 1[rbx]
	cmp	ebx, r13d
	jne	.L9
.L3:
	mov	rax, QWORD PTR [r15]
	mov	edi, DWORD PTR 12[rsp]
	mov	ebx, DWORD PTR MLX4_ROCE_MAX_GIDS[rip]
	sub	ebx, DWORD PTR MLX4_ROCE_PF_GIDS[rip]
	mov	rsi, QWORD PTR [rax]
	add	rsi, 1
	call	bitmap_weight@PLT
	lea	ecx, -1[rax]
	mov	eax, ebx
	lea	ebx, -1[r12]
	cdq
	idiv	ecx
	cmp	edx, r12d
	jge	.L17
	imul	eax, ebx
	add	edx, DWORD PTR MLX4_ROCE_PF_GIDS[rip]
	lea	r12d, [rdx+rax]
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L17:
	lea	r12d, 1[rax]
	mov	eax, r12d
	imul	eax, ebx
	add	eax, DWORD PTR MLX4_ROCE_PF_GIDS[rip]
	mov	r12d, eax
	jmp	.L2
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	mlx4_get_base_gid_ix, .-mlx4_get_base_gid_ix
	.comm	MLX4_ROCE_PF_GIDS,4,4
	.comm	MLX4_ROCE_MAX_GIDS,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_mlx4_port.c_mlx4_get_base_gid_ix.c"
	.text
	.global	__aeabi_idivmod
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	mlx4_get_base_gid_ix
	.syntax unified
	.arm
	.fpu softvfp
	.type	mlx4_get_base_gid_ix, %function
mlx4_get_base_gid_ix:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r3, .L17
	sub	sp, sp, #12
	subs	r6, r1, #0
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bne	.L15
.L2:
	ldr	r3, .L17
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L16
	mov	r0, r6
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L15:
	mov	r1, r2
	mov	r7, r2
	mov	r5, r0
	bl	mlx4_phys_to_slaves_pport
	mov	r1, r6
	mov	r9, r0
	mov	r0, r5
	bl	mlx4_get_active_ports
	ldr	r1, [r5, #4]
	mov	r4, r0
	bl	find_first_bit
	ldr	r1, [r5, #4]
	mov	r8, r0
	mov	r0, r4
	bl	bitmap_weight
	add	r8, r8, r0
	add	r3, r8, #1
	cmp	r3, #1
	bls	.L3
	mov	r4, #1
.L6:
	ldr	r1, [r5, #4]
	ldr	r0, [sp]
	bl	bitmap_zero
	ldr	r1, [sp]
	sub	r0, r4, #1
	bl	set_bit
	cmp	r4, r7
	beq	.L5
	mov	r1, sp
	mov	r0, r5
	bl	mlx4_phys_to_slaves_pport_actv
	ldr	r3, [r5]
	ldr	r1, [r3]
	add	r1, r1, #1
	bl	bitmap_weight
	sub	r6, r6, r0
.L5:
	cmp	r4, r8
	add	r4, r4, #1
	bne	.L6
.L3:
	ldr	r2, [r5]
	ldr	r3, .L17+4
	ldr	r5, .L17+8
	ldr	r1, [r2]
	ldr	r4, [r3]
	ldr	r3, [r5]
	add	r1, r1, #1
	mov	r0, r9
	sub	r4, r4, r3
	bl	bitmap_weight
	mov	r1, r0
	mov	r0, r4
	sub	r1, r1, #1
	bl	__aeabi_idivmod
	cmp	r1, r6
	ldrlt	r3, [r5]
	ldrge	r1, [r5]
	sub	r6, r6, #1
	addge	r0, r0, #1
	addlt	r1, r1, r3
	mla	r6, r0, r6, r1
	b	.L2
.L16:
	bl	__stack_chk_fail
.L18:
	.align	2
.L17:
	.word	.LC0
	.word	MLX4_ROCE_MAX_GIDS
	.word	MLX4_ROCE_PF_GIDS
	.size	mlx4_get_base_gid_ix, .-mlx4_get_base_gid_ix
	.comm	MLX4_ROCE_PF_GIDS,4,4
	.comm	MLX4_ROCE_MAX_GIDS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
