	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_enable_sriov
_mlx4_enable_sriov:                     ## @mlx4_enable_sriov
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r13d
	movl	%ecx, %r14d
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movl	(%rdi), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %rdi
	callq	_pci_sriov_get_totalvfs
	movq	_MLX4_MAX_NUM_VF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_min
	testl	%r13d, %r13d
	je	LBB0_4
## %bb.1:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_17
LBB0_4:
	movl	%eax, %r13d
	movq	_pf_loading@GOTPCREL(%rip), %rdi
	callq	_atomic_inc
	movq	_MLX4_FLAG_SRIOV@GOTPCREL(%rip), %rcx
	cmpl	%r15d, %r14d
	je	LBB0_5
## %bb.6:
	movl	%r14d, %edx
	movl	(%rcx), %eax
	andl	(%r12), %eax
	movq	%rcx, %r14
	je	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %ecx
	movl	%edx, %r15d
	xorl	%eax, %eax
	callq	_mlx4_err
	jmp	LBB0_8
LBB0_3:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_16
LBB0_5:
	movq	%rcx, %r14
LBB0_8:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movl	(%r14), %eax
	testl	%eax, (%r12)
	je	LBB0_11
LBB0_18:
	leaq	L_.str.5(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_mlx4_warn
	movq	_MLX4_FLAG_MASTER@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	orl	(%r14), %ebx
	orl	(%rax), %ebx
	movq	_MLX4_FLAG_SLAVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %ebx
	movq	16(%r12), %rax
	movl	%r15d, (%rax)
	jmp	LBB0_17
LBB0_9:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_mlx4_err
	jmp	LBB0_15
LBB0_11:
	cmpl	%r13d, %r15d
	jle	LBB0_13
## %bb.12:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_mlx4_err
	jmp	LBB0_15
LBB0_13:
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_mlx4_warn
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_pci_enable_sriov
	testl	%eax, %eax
	je	LBB0_18
## %bb.14:
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_mlx4_err
LBB0_15:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movq	_pf_loading@GOTPCREL(%rip), %rdi
	callq	_atomic_dec
	movq	8(%r12), %rax
LBB0_16:
	movq	16(%r12), %rcx
	movl	$0, (%rcx)
	movq	%rax, %rdi
	callq	_kfree
	movq	$0, 8(%r12)
	movq	_MLX4_FLAG_MASTER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_MAX_NUM_VF,4,2            ## @MLX4_MAX_NUM_VF
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_pf_loading,4,2                 ## @pf_loading
	.comm	_MLX4_FLAG_SRIOV,4,2            ## @MLX4_FLAG_SRIOV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SR-IOV was already enabled, but with num_vfs (%d) different than requested (%d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate memory for VFs\n"

L_.str.2:                               ## @.str.2
	.asciz	"requested vfs (%d) > available vfs (%d). Continuing without SR_IOV\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"Enabling SR-IOV with %d VFs\n"

L_.str.4:                               ## @.str.4
	.asciz	"Failed to enable SR-IOV, continuing without SR-IOV (err = %d)\n"

L_.str.5:                               ## @.str.5
	.asciz	"Running in master mode\n"

	.comm	_MLX4_FLAG_MASTER,4,2           ## @MLX4_FLAG_MASTER
	.comm	_MLX4_FLAG_SLAVE,4,2            ## @MLX4_FLAG_SLAVE
	.no_dead_strip	_mlx4_enable_sriov
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_enable_sriov
_mlx4_enable_sriov:                     ; @mlx4_enable_sriov
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x25, x4
	mov	x21, x3
	mov	x24, x2
	mov	x22, x1
	mov	x20, x0
	ldr	w19, [x0]
	mov	x0, x1
	bl	_pci_sriov_get_totalvfs
Lloh0:
	adrp	x8, _MLX4_MAX_NUM_VF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX4_MAX_NUM_VF@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_min
	cbz	w25, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x24
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x20, #8]
	cbnz	x0, LBB0_16
	b	LBB0_15
LBB0_2:
	mov	x23, x0
Lloh6:
	adrp	x0, _pf_loading@GOTPAGE
Lloh7:
	ldr	x0, [x0, _pf_loading@GOTPAGEOFF]
	bl	_atomic_inc
Lloh8:
	adrp	x25, _MLX4_FLAG_SRIOV@GOTPAGE
Lloh9:
	ldr	x25, [x25, _MLX4_FLAG_SRIOV@GOTPAGEOFF]
	cmp	w21, w24
	b.eq	LBB0_5
; %bb.3:
	ldr	w8, [x20]
	ldr	w9, [x25]
	and	w8, w9, w8
	cbz	w8, LBB0_5
; %bb.4:
	mov	x8, x21
	stp	x8, x24, [sp]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_mlx4_err
	b	LBB0_6
LBB0_5:
	mov	x21, x24
LBB0_6:
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x20, #8]
	cbz	x0, LBB0_9
; %bb.7:
	ldr	w8, [x20]
	ldr	w9, [x25]
	tst	w9, w8
	b.eq	LBB0_10
LBB0_8:
Lloh15:
	adrp	x1, l_.str.5@PAGE
Lloh16:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	_mlx4_warn
	ldr	w8, [x25]
Lloh17:
	adrp	x9, _MLX4_FLAG_MASTER@GOTPAGE
Lloh18:
	ldr	x9, [x9, _MLX4_FLAG_MASTER@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w8, w19
	orr	w8, w8, w9
Lloh20:
	adrp	x9, _MLX4_FLAG_SLAVE@GOTPAGE
Lloh21:
	ldr	x9, [x9, _MLX4_FLAG_SLAVE@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	bic	w19, w8, w9
	ldr	x8, [x20, #16]
	str	w21, [x8]
	b	LBB0_16
LBB0_9:
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_14
LBB0_10:
	cmp	w21, w23
	b.le	LBB0_12
; %bb.11:
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	stp	x21, x23, [sp]
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_14
LBB0_12:
	str	x21, [sp]
Lloh27:
	adrp	x1, l_.str.3@PAGE
Lloh28:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_mlx4_warn
	mov	x0, x22
	mov	x1, x21
	bl	_pci_enable_sriov
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_8
; %bb.13:
	str	x0, [sp]
Lloh29:
	adrp	x1, l_.str.4@PAGE
Lloh30:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_14:
	mov	x0, x20
	bl	_mlx4_err
Lloh31:
	adrp	x0, _pf_loading@GOTPAGE
Lloh32:
	ldr	x0, [x0, _pf_loading@GOTPAGEOFF]
	bl	_atomic_dec
	ldr	x0, [x20, #8]
LBB0_15:
	ldr	x8, [x20, #16]
	str	wzr, [x8]
	bl	_kfree
	str	xzr, [x20, #8]
Lloh33:
	adrp	x8, _MLX4_FLAG_MASTER@GOTPAGE
Lloh34:
	ldr	x8, [x8, _MLX4_FLAG_MASTER@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	bic	w19, w19, w8
LBB0_16:
	mov	x0, x19
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_MAX_NUM_VF,4,2            ; @MLX4_MAX_NUM_VF
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_pf_loading,4,2                 ; @pf_loading
	.comm	_MLX4_FLAG_SRIOV,4,2            ; @MLX4_FLAG_SRIOV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SR-IOV was already enabled, but with num_vfs (%d) different than requested (%d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate memory for VFs\n"

l_.str.2:                               ; @.str.2
	.asciz	"requested vfs (%d) > available vfs (%d). Continuing without SR_IOV\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"Enabling SR-IOV with %d VFs\n"

l_.str.4:                               ; @.str.4
	.asciz	"Failed to enable SR-IOV, continuing without SR-IOV (err = %d)\n"

l_.str.5:                               ; @.str.5
	.asciz	"Running in master mode\n"

	.comm	_MLX4_FLAG_MASTER,4,2           ; @MLX4_FLAG_MASTER
	.comm	_MLX4_FLAG_SLAVE,4,2            ; @MLX4_FLAG_SLAVE
	.no_dead_strip	_mlx4_enable_sriov
.subsections_via_symbols
