	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_get_slave_num_gids        ## -- Begin function mlx4_get_slave_num_gids
	.p2align	4, 0x90
_mlx4_get_slave_num_gids:               ## @mlx4_get_slave_num_gids
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	%edx, %esi
	callq	_mlx4_phys_to_slaves_pport
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_mlx4_get_active_ports
	movl	%eax, %r12d
	movq	8(%rbx), %rsi
	movl	%eax, %edi
	callq	_find_first_bit
	movl	%eax, %r13d
	movq	8(%rbx), %rsi
	movl	%r12d, %edi
	callq	_bitmap_weight
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r13), %ecx
	incl	%ecx
	cmpl	$2, %ecx
	jb	LBB0_7
## %bb.3:
	addl	%eax, %r13d
	decl	%r15d
	xorl	%r12d, %r12d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incl	%r12d
	cmpl	%r12d, %r13d
	je	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rsi
	callq	_bitmap_zero
	movl	-48(%rbp), %esi
	movl	%r12d, %edi
	callq	_set_bit
	cmpl	%r12d, %r15d
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	leaq	-48(%rbp), %rsi
	callq	_mlx4_phys_to_slaves_pport_actv
	movq	(%rbx), %rcx
	movq	(%rcx), %rsi
	incq	%rsi
	movl	%eax, %edi
	callq	_bitmap_weight
	subl	%eax, %r14d
	jmp	LBB0_6
LBB0_7:
	movq	(%rbx), %rax
	movq	(%rax), %rsi
	incq	%rsi
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_bitmap_weight
	movl	%eax, %ecx
	decl	%ecx
	movq	_MLX4_ROCE_MAX_GIDS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_MLX4_ROCE_PF_GIDS@GOTPCREL(%rip), %rdx
	subl	(%rdx), %eax
	cltd
	idivl	%ecx
	movl	%eax, %ecx
	xorl	%eax, %eax
	cmpl	%edx, %r14d
	setle	%al
	addl	%ecx, %eax
	jmp	LBB0_8
LBB0_1:
	movq	_MLX4_ROCE_PF_GIDS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_ROCE_PF_GIDS,4,2          ## @MLX4_ROCE_PF_GIDS
	.comm	_MLX4_ROCE_MAX_GIDS,4,2         ## @MLX4_ROCE_MAX_GIDS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_get_slave_num_gids        ; -- Begin function mlx4_get_slave_num_gids
	.p2align	2
_mlx4_get_slave_num_gids:               ; @mlx4_get_slave_num_gids
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	cbz	w1, LBB0_7
; %bb.1:
	mov	x23, x2
	mov	x19, x1
	mov	x20, x0
	mov	x1, x2
	bl	_mlx4_phys_to_slaves_pport
	mov	x21, x0
	mov	x0, x20
	mov	x1, x19
	bl	_mlx4_get_active_ports
	mov	x22, x0
	ldr	x1, [x20, #8]
	bl	_find_first_bit
	mov	x24, x0
	ldr	x1, [x20, #8]
	mov	x0, x22
	bl	_bitmap_weight
	add	w24, w24, w0
	add	w8, w24, #1
	cmp	w8, #2
	b.lo	LBB0_6
; %bb.2:
	mov	w22, #0
	sub	w23, w23, #1
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w22, w22, #1
	cmp	w24, w22
	b.eq	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x20, #8]
	bl	_bitmap_zero
	ldr	w1, [sp, #8]
	mov	x0, x22
	bl	_set_bit
	cmp	w23, w22
	b.eq	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x1, sp, #8
	mov	x0, x20
	bl	_mlx4_phys_to_slaves_pport_actv
	ldr	x8, [x20]
	ldr	x8, [x8]
	add	x1, x8, #1
	bl	_bitmap_weight
	sub	w19, w19, w0
	b	LBB0_3
LBB0_6:
	ldr	x8, [x20]
	ldr	x8, [x8]
	add	x1, x8, #1
	mov	x0, x21
	bl	_bitmap_weight
	sub	w8, w0, #1
Lloh0:
	adrp	x9, _MLX4_ROCE_MAX_GIDS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MLX4_ROCE_MAX_GIDS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _MLX4_ROCE_PF_GIDS@GOTPAGE
Lloh4:
	ldr	x10, [x10, _MLX4_ROCE_PF_GIDS@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	sub	w9, w9, w10
	sdiv	w10, w9, w8
	msub	w8, w10, w8, w9
	cmp	w19, w8
	cinc	w0, w10, le
	b	LBB0_8
LBB0_7:
Lloh6:
	adrp	x8, _MLX4_ROCE_PF_GIDS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MLX4_ROCE_PF_GIDS@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_ROCE_PF_GIDS,4,2          ; @MLX4_ROCE_PF_GIDS
	.comm	_MLX4_ROCE_MAX_GIDS,4,2         ; @MLX4_ROCE_MAX_GIDS
.subsections_via_symbols
