	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_allocate_port_vpps
_mlx4_allocate_port_vpps:               ## @mlx4_allocate_port_vpps
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	%rsp, -72(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MLX4_NUM_UP@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movq	%r12, %rdi
	callq	_mlx4_priv
	movq	%rax, %r14
	leaq	-56(%rbp), %rdx
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	%r13, %rcx
	callq	_mlx4_ALLOCATE_VPP_get
	leaq	L_.str(%rip), %rsi
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %r12
	movq	(%r14), %r15
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movslq	%ebx, %r14
	movl	-56(%rbp), %ebx
	movl	4(%r15,%r14,8), %edi
	movl	(%r12), %esi
	callq	_bitmap_weight
	movl	%eax, %ecx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movl	%eax, %ebx
	cmpl	$0, (%r12)
	jle	LBB0_6
## %bb.2:
	xorl	%r12d, %r12d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r12
	movq	_MLX4_NUM_UP@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r12
	jge	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r15,%r14,8), %esi
	movl	%r12d, %edi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, (%r13,%r12,4)
	jmp	LBB0_5
LBB0_6:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movq	%r13, %rdx
	callq	_mlx4_ALLOCATE_VPP_set
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_8
LBB0_9:
	leaq	-56(%rbp), %rdx
	movq	%r12, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movq	%r13, %rcx
	callq	_mlx4_ALLOCATE_VPP_get
	testl	%eax, %eax
	leaq	L_.str(%rip), %rsi
	je	LBB0_10
LBB0_8:
	movq	%r12, %rdi
	callq	_mlx4_info
LBB0_13:
	movq	-72(%rbp), %rsp                 ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	%ebx, (%r15,%r14,8)
	movl	-56(%rbp), %ecx
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_mlx4_dbg
	movq	_MLX4_NUM_UP@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	jle	LBB0_13
## %bb.11:
	movq	%r12, %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r13,%rbx,4), %r8d
	movq	%r14, %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%r15d, %edx
	movq	%rcx, %r12
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_mlx4_dbg
	movq	%r12, %rcx
	incq	%rbx
	movslq	(%rcx), %rax
	cmpq	%rax, %rbx
	jl	LBB0_12
	jmp	LBB0_13
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_NUM_UP,4,2                ## @MLX4_NUM_UP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed query available VPPs\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed allocating VPPs\n"

L_.str.2:                               ## @.str.2
	.asciz	"Port %d Available VPPs %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Port %d UP %d Allocated %d VPPs\n"

	.no_dead_strip	_mlx4_allocate_port_vpps
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_allocate_port_vpps
_mlx4_allocate_port_vpps:               ; @mlx4_allocate_port_vpps
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x20, x1
	mov	x19, x0
	mov	x24, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x25, _MLX4_NUM_UP@GOTPAGE
Lloh4:
	ldr	x25, [x25, _MLX4_NUM_UP@GOTPAGEOFF]
	ldr	w8, [x25]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	bl	_mlx4_priv
	mov	x22, x0
	sub	x2, x29, #92
	mov	x0, x19
	mov	x1, x20
	mov	x3, x21
	bl	_mlx4_ALLOCATE_VPP_get
	cbz	w0, LBB0_2
LBB0_1:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_9
LBB0_2:
	ldr	x23, [x22]
	ldur	w22, [x29, #-92]
	add	x27, x23, w20, sxtw #3
	ldr	w0, [x27, #4]!
	ldr	w1, [x25]
	bl	_bitmap_weight
	ldr	w8, [x25]
	sdiv	w26, w22, w0
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.3:
	mov	x22, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x25]
	cmp	x22, x8
	b.ge	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x27]
	mov	x0, x22
	bl	_test_bit
	cbz	x0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	str	w26, [x21, x22, lsl #2]
	b	LBB0_4
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_mlx4_ALLOCATE_VPP_set
	cbz	w0, LBB0_12
; %bb.8:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_9:
	mov	x0, x19
	bl	_mlx4_info
LBB0_10:
	mov	sp, x24
	ldur	x8, [x29, #-88]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.11:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:
	sub	x2, x29, #92
	mov	x0, x19
	mov	x1, x20
	mov	x3, x21
	bl	_mlx4_ALLOCATE_VPP_get
	cbnz	w0, LBB0_1
; %bb.13:
	sxtw	x8, w20
	lsl	x8, x8, #3
	str	w26, [x23, x8]
	ldur	w3, [x29, #-92]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_mlx4_dbg
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.14:
	mov	x22, #0
Lloh16:
	adrp	x23, l_.str.3@PAGE
Lloh17:
	add	x23, x23, l_.str.3@PAGEOFF
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21, x22, lsl #2]
	str	x8, [sp, #-16]!
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	mov	x3, x22
	bl	_mlx4_dbg
	add	sp, sp, #16
	add	x22, x22, #1
	ldrsw	x8, [x25]
	cmp	x22, x8
	b.lt	LBB0_15
	b	LBB0_10
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_NUM_UP,4,2                ; @MLX4_NUM_UP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed query available VPPs\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed allocating VPPs\n"

l_.str.2:                               ; @.str.2
	.asciz	"Port %d Available VPPs %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Port %d UP %d Allocated %d VPPs\n"

	.no_dead_strip	_mlx4_allocate_port_vpps
.subsections_via_symbols
