	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_calc_res_counter_guaranteed
_mlx4_calc_res_counter_guaranteed:      ## @mlx4_calc_res_counter_guaranteed
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_mlx4_master_func_num
	cmpl	%r15d, %eax
	jne	LBB0_2
## %bb.1:
	movq	_MLX4_PF_COUNTERS_PER_PORT@GOTPCREL(%rip), %rcx
	movl	(%rbx), %eax
	imull	(%rcx), %eax
	jmp	LBB0_3
LBB0_2:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_mlx4_get_active_ports
	movl	(%rbx), %esi
	movl	%eax, %edi
	callq	_bitmap_weight
	movl	%eax, %ecx
	movq	_MLX4_VF_COUNTERS_PER_PORT@GOTPCREL(%rip), %rax
	imull	(%rax), %ecx
	movl	(%r14), %edx
	addl	%ecx, %edx
	xorl	%eax, %eax
	cmpl	4(%rbx), %edx
	cmovll	%ecx, %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_PF_COUNTERS_PER_PORT,4,2  ## @MLX4_PF_COUNTERS_PER_PORT
	.comm	_MLX4_VF_COUNTERS_PER_PORT,4,2  ## @MLX4_VF_COUNTERS_PER_PORT
	.no_dead_strip	_mlx4_calc_res_counter_guaranteed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_calc_res_counter_guaranteed
_mlx4_calc_res_counter_guaranteed:      ; @mlx4_calc_res_counter_guaranteed
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	bl	_mlx4_master_func_num
	cmp	w0, w21
	b.ne	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _MLX4_PF_COUNTERS_PER_PORT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX4_PF_COUNTERS_PER_PORT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19]
	mul	w0, w9, w8
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	mov	x1, x21
	bl	_mlx4_get_active_ports
	ldr	w1, [x19]
	bl	_bitmap_weight
Lloh3:
	adrp	x8, _MLX4_VF_COUNTERS_PER_PORT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MLX4_VF_COUNTERS_PER_PORT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mul	w8, w8, w0
	ldr	w9, [x20]
	ldr	w10, [x19, #4]
	add	w9, w9, w8
	cmp	w9, w10
	csel	w0, w8, wzr, lt
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_PF_COUNTERS_PER_PORT,4,2  ; @MLX4_PF_COUNTERS_PER_PORT
	.comm	_MLX4_VF_COUNTERS_PER_PORT,4,2  ; @MLX4_VF_COUNTERS_PER_PORT
	.no_dead_strip	_mlx4_calc_res_counter_guaranteed
.subsections_via_symbols
