	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_enic_alloc_vnic_resources      ## -- Begin function enic_alloc_vnic_resources
	.p2align	4, 0x90
_enic_alloc_vnic_resources:             ## @enic_alloc_vnic_resources
	.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
	movq	%rdi, %r15
	movl	20(%rdi), %edi
	callq	_vnic_dev_get_intr_mode
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_enic_get_dev
	movl	(%r15), %edx
	movl	4(%r15), %ecx
	movl	8(%r15), %r8d
	movl	12(%r15), %r9d
	movq	_VNIC_DEV_INTR_MODE_INTX@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %r14d
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_5
LBB0_2:
	movq	_VNIC_DEV_INTR_MODE_MSI@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %r14d
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_5
LBB0_4:
	movq	_VNIC_DEV_INTR_MODE_MSIX@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %r14d
	leaq	L_.str.3(%rip), %rdi
	leaq	L_.str.4(%rip), %rsi
	cmoveq	%rdi, %rsi
LBB0_5:
	movq	%rsi, (%rsp)
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_info
	cmpl	$0, (%r15)
	je	LBB0_9
## %bb.6:
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	56(%r15), %rsi
	addq	%r12, %rsi
	movl	20(%r15), %edi
	movl	32(%r15), %ecx
	movl	%ebx, %edx
	movl	$4, %r8d
	callq	_vnic_wq_alloc
	testl	%eax, %eax
	jne	LBB0_29
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	movl	(%r15), %eax
	addq	$4, %r12
	cmpq	%rax, %rbx
	jb	LBB0_7
LBB0_9:
	cmpl	$0, 4(%r15)
	je	LBB0_15
## %bb.10:
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	48(%r15), %rsi
	addq	%r12, %rsi
	movl	20(%r15), %edi
	movl	36(%r15), %ecx
	movl	%ebx, %edx
	movl	$4, %r8d
	callq	_vnic_rq_alloc
	testl	%eax, %eax
	jne	LBB0_29
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	incq	%rbx
	movl	4(%r15), %eax
	addq	$4, %r12
	cmpq	%rax, %rbx
	jb	LBB0_11
## %bb.13:
	cmpl	$0, 8(%r15)
	jne	LBB0_16
	jmp	LBB0_20
LBB0_15:
	xorl	%eax, %eax
	cmpl	$0, 8(%r15)
	je	LBB0_20
LBB0_16:
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	%eax, %eax
	xorl	%ecx, %ecx
	cmpq	%rax, %r12
	setb	%cl
	movl	20(%r15), %edi
	movq	40(%r15), %rsi
	addq	%rbx, %rsi
	movl	32(%r15,%rcx,4), %ecx
	movl	%r12d, %edx
	movl	$4, %r8d
	callq	_vnic_cq_alloc
	testl	%eax, %eax
	jne	LBB0_29
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	incq	%r12
	movl	8(%r15), %eax
	cmpq	%rax, %r12
	jae	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	movl	4(%r15), %eax
	addq	$4, %rbx
	jmp	LBB0_17
LBB0_20:
	cmpl	$0, 12(%r15)
	je	LBB0_24
## %bb.21:
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movl	20(%r15), %edi
	movq	24(%r15), %rsi
	addq	%r12, %rsi
	movl	%ebx, %edx
	callq	_vnic_intr_alloc
	testl	%eax, %eax
	jne	LBB0_29
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	incq	%rbx
	movl	12(%r15), %eax
	addq	$4, %r12
	cmpq	%rax, %rbx
	jb	LBB0_22
LBB0_24:
	movl	20(%r15), %edi
	movq	_RES_TYPE_INTR_PBA_LEGACY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r13d, %r13d
	xorl	%edx, %edx
	callq	_vnic_dev_get_res
	movl	%eax, 16(%r15)
	testl	%eax, %eax
	jne	LBB0_31
## %bb.25:
	movq	_VNIC_DEV_INTR_MODE_INTX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_31
## %bb.26:
	movq	%r15, %rdi
	callq	_enic_get_dev
	leaq	L_.str.5(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_30
LBB0_29:
	movl	%eax, %r13d
LBB0_30:
	movq	%r15, %rdi
	callq	_enic_free_vnic_resources
LBB0_31:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vNIC resources used:  wq %d rq %d cq %d intr %d intr mode %s\n"

	.comm	_VNIC_DEV_INTR_MODE_INTX,4,2    ## @VNIC_DEV_INTR_MODE_INTX
L_.str.1:                               ## @.str.1
	.asciz	"legacy PCI INTx"

	.comm	_VNIC_DEV_INTR_MODE_MSI,4,2     ## @VNIC_DEV_INTR_MODE_MSI
L_.str.2:                               ## @.str.2
	.asciz	"MSI"

	.comm	_VNIC_DEV_INTR_MODE_MSIX,4,2    ## @VNIC_DEV_INTR_MODE_MSIX
L_.str.3:                               ## @.str.3
	.asciz	"MSI-X"

L_.str.4:                               ## @.str.4
	.asciz	"unknown"

	.comm	_RES_TYPE_INTR_PBA_LEGACY,4,2   ## @RES_TYPE_INTR_PBA_LEGACY
L_.str.5:                               ## @.str.5
	.asciz	"Failed to hook legacy pba resource\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_enic_alloc_vnic_resources      ; -- Begin function enic_alloc_vnic_resources
	.p2align	2
_enic_alloc_vnic_resources:             ; @enic_alloc_vnic_resources
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	w0, [x0, #20]
	bl	_vnic_dev_get_intr_mode
	mov	x20, x0
	mov	x0, x19
	bl	_enic_get_dev
	ldp	w2, w3, [x19]
	ldp	w4, w5, [x19, #8]
Lloh0:
	adrp	x23, _VNIC_DEV_INTR_MODE_INTX@GOTPAGE
Lloh1:
	ldr	x23, [x23, _VNIC_DEV_INTR_MODE_INTX@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w20, w8
	b.ne	LBB0_2
; %bb.1:
Lloh2:
	adrp	x6, l_.str.1@PAGE
Lloh3:
	add	x6, x6, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_2:
Lloh4:
	adrp	x8, _VNIC_DEV_INTR_MODE_MSI@GOTPAGE
Lloh5:
	ldr	x8, [x8, _VNIC_DEV_INTR_MODE_MSI@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_4
; %bb.3:
Lloh7:
	adrp	x6, l_.str.2@PAGE
Lloh8:
	add	x6, x6, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_4:
Lloh9:
	adrp	x8, _VNIC_DEV_INTR_MODE_MSIX@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VNIC_DEV_INTR_MODE_MSIX@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, l_.str.4@PAGE
Lloh13:
	add	x9, x9, l_.str.4@PAGEOFF
Lloh14:
	adrp	x10, l_.str.3@PAGE
Lloh15:
	add	x10, x10, l_.str.3@PAGEOFF
	cmp	w20, w8
	csel	x6, x10, x9, eq
LBB0_5:
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	ldr	w8, [x19]
	cbz	w8, LBB0_9
; %bb.6:
	mov	x24, #0
	mov	x21, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #20]
	ldr	x8, [x19, #56]
	add	x1, x8, x24
	ldr	w3, [x19, #32]
	mov	x2, x21
	mov	w4, #4
	bl	_vnic_wq_alloc
	cbnz	w0, LBB0_24
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x21, x21, #1
	ldr	w8, [x19]
	add	x24, x24, #4
	cmp	x21, x8
	b.lo	LBB0_7
LBB0_9:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_13
; %bb.10:
	mov	x24, #0
	mov	x21, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #20]
	ldr	x8, [x19, #48]
	add	x1, x8, x24
	ldr	w3, [x19, #36]
	mov	x2, x21
	mov	w4, #4
	bl	_vnic_rq_alloc
	cbnz	w0, LBB0_24
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	add	x21, x21, #1
	ldr	w8, [x19, #4]
	add	x24, x24, #4
	cmp	x21, x8
	b.lo	LBB0_11
LBB0_13:
	ldr	w9, [x19, #8]
	cbz	w9, LBB0_18
; %bb.14:
	mov	x24, #0
	mov	x21, #0
	mov	w25, #32
	mov	w26, #36
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #20]
	ldr	x9, [x19, #40]
	add	x1, x9, x24
	cmp	x21, w8, uxtw
	csel	x8, x26, x25, lo
	ldr	w3, [x19, x8]
	mov	x2, x21
	mov	w4, #4
	bl	_vnic_cq_alloc
	cbnz	w0, LBB0_24
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	add	x21, x21, #1
	ldr	w8, [x19, #8]
	cmp	x21, x8
	b.hs	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [x19, #4]
	add	x24, x24, #4
	b	LBB0_15
LBB0_18:
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_22
; %bb.19:
	mov	x24, #0
	mov	x21, #0
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #20]
	ldr	x8, [x19, #24]
	add	x1, x8, x24
	mov	x2, x21
	bl	_vnic_intr_alloc
	cbnz	w0, LBB0_24
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	add	x21, x21, #1
	ldr	w8, [x19, #12]
	add	x24, x24, #4
	cmp	x21, x8
	b.lo	LBB0_20
LBB0_22:
	ldr	w0, [x19, #20]
Lloh18:
	adrp	x8, _RES_TYPE_INTR_PBA_LEGACY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RES_TYPE_INTR_PBA_LEGACY@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_vnic_dev_get_res
	mov	w22, #0
	str	w0, [x19, #16]
	ldr	w8, [x23]
	cmp	w0, #0
	ccmp	w20, w8, #0, eq
	b.ne	LBB0_26
; %bb.23:
	mov	x0, x19
	bl	_enic_get_dev
Lloh21:
	adrp	x1, l_.str.5@PAGE
Lloh22:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
Lloh23:
	adrp	x8, _ENODEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_25
LBB0_24:
	mov	x22, x0
LBB0_25:
	mov	x0, x19
	bl	_enic_free_vnic_resources
LBB0_26:
	mov	x0, x22
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vNIC resources used:  wq %d rq %d cq %d intr %d intr mode %s\n"

	.comm	_VNIC_DEV_INTR_MODE_INTX,4,2    ; @VNIC_DEV_INTR_MODE_INTX
l_.str.1:                               ; @.str.1
	.asciz	"legacy PCI INTx"

	.comm	_VNIC_DEV_INTR_MODE_MSI,4,2     ; @VNIC_DEV_INTR_MODE_MSI
l_.str.2:                               ; @.str.2
	.asciz	"MSI"

	.comm	_VNIC_DEV_INTR_MODE_MSIX,4,2    ; @VNIC_DEV_INTR_MODE_MSIX
l_.str.3:                               ; @.str.3
	.asciz	"MSI-X"

l_.str.4:                               ; @.str.4
	.asciz	"unknown"

	.comm	_RES_TYPE_INTR_PBA_LEGACY,4,2   ; @RES_TYPE_INTR_PBA_LEGACY
l_.str.5:                               ; @.str.5
	.asciz	"Failed to hook legacy pba resource\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
.subsections_via_symbols
